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