blob: a6bf08a032ac87e75c57d67ffbfca81dc30219db [file] [log] [blame]
Aaron Gablec9c87552015-08-03 09:34:32 -07001/*
2 * jdsample.h
3 *
4 * This file was part of the Independent JPEG Group's software:
5 * Copyright (C) 1991-1996, Thomas G. Lane.
Alex Naidis6eb7d372016-10-16 23:10:08 +02006 * For conditions of distribution and use, see the accompanying README.ijg
7 * file.
Aaron Gablec9c87552015-08-03 09:34:32 -07008 */
9
10#define JPEG_INTERNALS
Aaron Gablec9c87552015-08-03 09:34:32 -070011#include "jpeglib.h"
12
13
14/* Pointer to routine to upsample a single component */
15typedef void (*upsample1_ptr) (j_decompress_ptr cinfo,
Alex Naidis6eb7d372016-10-16 23:10:08 +020016 jpeg_component_info *compptr,
Aaron Gablec9c87552015-08-03 09:34:32 -070017 JSAMPARRAY input_data,
Alex Naidis6eb7d372016-10-16 23:10:08 +020018 JSAMPARRAY *output_data_ptr);
Aaron Gablec9c87552015-08-03 09:34:32 -070019
20/* Private subobject */
21
22typedef struct {
23 struct jpeg_upsampler pub; /* public fields */
24
25 /* Color conversion buffer. When using separate upsampling and color
26 * conversion steps, this buffer holds one upsampled row group until it
27 * has been color converted and output.
28 * Note: we do not allocate any storage for component(s) which are full-size,
29 * ie do not need rescaling. The corresponding entry of color_buf[] is
30 * simply set to point to the input data array, thereby avoiding copying.
31 */
32 JSAMPARRAY color_buf[MAX_COMPONENTS];
33
34 /* Per-component upsampling method pointers */
35 upsample1_ptr methods[MAX_COMPONENTS];
36
37 int next_row_out; /* counts rows emitted from color_buf */
38 JDIMENSION rows_to_go; /* counts rows remaining in image */
39
40 /* Height of an input row group for each component. */
41 int rowgroup_height[MAX_COMPONENTS];
42
43 /* These arrays save pixel expansion factors so that int_expand need not
44 * recompute them each time. They are unused for other upsampling methods.
45 */
46 UINT8 h_expand[MAX_COMPONENTS];
47 UINT8 v_expand[MAX_COMPONENTS];
48} my_upsampler;
49
Alex Naidis6eb7d372016-10-16 23:10:08 +020050typedef my_upsampler *my_upsample_ptr;