1*dfc6aa5cSAndroid Build Coastguard Worker /* 2*dfc6aa5cSAndroid Build Coastguard Worker * jdmerge.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) 1994-1996, Thomas G. Lane. 6*dfc6aa5cSAndroid Build Coastguard Worker * libjpeg-turbo Modifications: 7*dfc6aa5cSAndroid Build Coastguard Worker * Copyright (C) 2020, D. R. Commander. 8*dfc6aa5cSAndroid Build Coastguard Worker * For conditions of distribution and use, see the accompanying README.ijg 9*dfc6aa5cSAndroid Build Coastguard Worker * file. 10*dfc6aa5cSAndroid Build Coastguard Worker */ 11*dfc6aa5cSAndroid Build Coastguard Worker 12*dfc6aa5cSAndroid Build Coastguard Worker #define JPEG_INTERNALS 13*dfc6aa5cSAndroid Build Coastguard Worker #include "jpeglib.h" 14*dfc6aa5cSAndroid Build Coastguard Worker 15*dfc6aa5cSAndroid Build Coastguard Worker #ifdef UPSAMPLE_MERGING_SUPPORTED 16*dfc6aa5cSAndroid Build Coastguard Worker 17*dfc6aa5cSAndroid Build Coastguard Worker 18*dfc6aa5cSAndroid Build Coastguard Worker /* Private subobject */ 19*dfc6aa5cSAndroid Build Coastguard Worker 20*dfc6aa5cSAndroid Build Coastguard Worker typedef struct { 21*dfc6aa5cSAndroid Build Coastguard Worker struct jpeg_upsampler pub; /* public fields */ 22*dfc6aa5cSAndroid Build Coastguard Worker 23*dfc6aa5cSAndroid Build Coastguard Worker /* Pointer to routine to do actual upsampling/conversion of one row group */ 24*dfc6aa5cSAndroid Build Coastguard Worker void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, 25*dfc6aa5cSAndroid Build Coastguard Worker JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); 26*dfc6aa5cSAndroid Build Coastguard Worker 27*dfc6aa5cSAndroid Build Coastguard Worker /* Private state for YCC->RGB conversion */ 28*dfc6aa5cSAndroid Build Coastguard Worker int *Cr_r_tab; /* => table for Cr to R conversion */ 29*dfc6aa5cSAndroid Build Coastguard Worker int *Cb_b_tab; /* => table for Cb to B conversion */ 30*dfc6aa5cSAndroid Build Coastguard Worker JLONG *Cr_g_tab; /* => table for Cr to G conversion */ 31*dfc6aa5cSAndroid Build Coastguard Worker JLONG *Cb_g_tab; /* => table for Cb to G conversion */ 32*dfc6aa5cSAndroid Build Coastguard Worker 33*dfc6aa5cSAndroid Build Coastguard Worker /* For 2:1 vertical sampling, we produce two output rows at a time. 34*dfc6aa5cSAndroid Build Coastguard Worker * We need a "spare" row buffer to hold the second output row if the 35*dfc6aa5cSAndroid Build Coastguard Worker * application provides just a one-row buffer; we also use the spare 36*dfc6aa5cSAndroid Build Coastguard Worker * to discard the dummy last row if the image height is odd. 37*dfc6aa5cSAndroid Build Coastguard Worker */ 38*dfc6aa5cSAndroid Build Coastguard Worker JSAMPROW spare_row; 39*dfc6aa5cSAndroid Build Coastguard Worker boolean spare_full; /* T if spare buffer is occupied */ 40*dfc6aa5cSAndroid Build Coastguard Worker 41*dfc6aa5cSAndroid Build Coastguard Worker JDIMENSION out_row_width; /* samples per output row */ 42*dfc6aa5cSAndroid Build Coastguard Worker JDIMENSION rows_to_go; /* counts rows remaining in image */ 43*dfc6aa5cSAndroid Build Coastguard Worker } my_merged_upsampler; 44*dfc6aa5cSAndroid Build Coastguard Worker 45*dfc6aa5cSAndroid Build Coastguard Worker typedef my_merged_upsampler *my_merged_upsample_ptr; 46*dfc6aa5cSAndroid Build Coastguard Worker 47*dfc6aa5cSAndroid Build Coastguard Worker #endif /* UPSAMPLE_MERGING_SUPPORTED */ 48