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