NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h
Go to the documentation of this file.
1 /*
2  * jpeglib.h
3  *
4  * SPDX-License-Identifier: IJG
5  *
6  * NVIDIA modifications (Tegra hardware acceleration):
7  * Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
8  * Copyright (C) 1991-1998, Thomas G. Lane.
9  * Modified 2002-2009 by Guido Vollbeding.
10  * This file is part of the Independent JPEG Group's software.
11  * For conditions of distribution and use, see the accompanying README.ijg
12  * file.
13  *
14  * This file defines the application interface for the JPEG library.
15  * Most applications using the library need only include this file,
16  * and perhaps jerror.h if they want to know the exact error codes.
17  */
18 
19 #ifndef JPEGLIB_H
20 #define JPEGLIB_H
21 
22 /*
23  * First we include the configuration files that record how this
24  * installation of the JPEG library is set up. jconfig.h can be
25  * generated automatically for many systems. jmorecfg.h contains
26  * manual configuration options that most people need not worry about.
27  */
28 
29 #ifndef JCONFIG_INCLUDED /* in case jinclude.h already did */
30 #include "jconfig.h" /* widely used configuration options */
31 #endif
32 #include "jmorecfg.h" /* seldom changed options */
33 
34 #ifdef GPU_ACCELERATE
35 using namespace std;
36 #include <iostream>
37 #include <fstream>
38 #include <sstream>
39 #include <vector>
40 #include <cstdlib>
41 #include <cuda.h>
42 #include <jerror.h>
43 #include <glib.h>
44 #include "cuda_runtime.h"
45 #include "nvjpeg.h"
46 #include "nvbufsurface.h"
47 inline bool CHECK_(cudaError_t e, int iLine, const char *szFile) {
48  if (e != cudaSuccess) {
49  std::cout << "CUDA runtime error " << e << " " << cudaGetErrorName(e) << " at line " << iLine << " in file " << szFile << std::endl;
50  abort ();
51  return false;
52  }
53  return true;
54  }
55 #define ck(call) CHECK_((call), __LINE__, __FILE__)
56 #define cudaCheckError() { \
57  cudaError_t e=cudaGetLastError(); \
58  if(e!=cudaSuccess) { \
59  std::cout << "Cuda failure: '" << cudaGetErrorString(e) << "'\n"; \
60  return 1; \
61  } \
62 }
63 
64 #define nvjpegCheckError(call) { \
65  nvjpegStatus_t e = (call); \
66  if(e != NVJPEG_STATUS_SUCCESS) { \
67  std::cout << "nvjpeg failure: error #" << e << "\n"; \
68  return 1; \
69  } \
70 }
71 
72 struct encode_params_t {
73  std::string input_dir;
74  std::string output_dir;
75  std::string format;
76  std::string subsampling;
77  int quality;
78  int huf;
79  int dev;
80 };
81 #endif
82 
83 
84 #ifdef __cplusplus
85 #ifndef DONT_USE_EXTERN_C
86 extern "C" {
87 #endif
88 #endif
89 
90 /* Version IDs for the JPEG library.
91  * Might be useful for tests like "#if JPEG_LIB_VERSION >= 90".
92  */
93 
94 #ifndef JPEG_LIB_VERSION
95 #define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
96 #endif
97 #ifndef JPEG_LIB_VERSION_MAJOR
98 #define JPEG_LIB_VERSION_MAJOR 9
99 #endif
100 #ifndef JPEG_LIB_VERSION_MINOR
101 #define JPEG_LIB_VERSION_MINOR 6
102 #endif
103 
104 
105 /* Various constants determining the sizes of things.
106  * All of these are specified by the JPEG standard,
107  * so don't change them if you want to be compatible.
108  */
109 
110 #define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */
111 #define DCTSIZE2 64 /* DCTSIZE squared; # of elements in a block */
112 #define NUM_QUANT_TBLS 4 /* Quantization tables are numbered 0..3 */
113 #define NUM_HUFF_TBLS 4 /* Huffman tables are numbered 0..3 */
114 #define NUM_ARITH_TBLS 16 /* Arith-coding tables are numbered 0..15 */
115 #define MAX_COMPS_IN_SCAN 4 /* JPEG limit on # of components in one scan */
116 #define MAX_SAMP_FACTOR 4 /* JPEG limit on sampling factors */
117 /* Unfortunately, some bozo at Adobe saw no reason to be bound by the standard;
118  * the PostScript DCT filter can emit files with many more than 10 blocks/MCU.
119  * If you happen to run across such a file, you can up D_MAX_BLOCKS_IN_MCU
120  * to handle it. We even let you do this from the jconfig.h file. However,
121  * we strongly discourage changing C_MAX_BLOCKS_IN_MCU; just because Adobe
122  * sometimes emits noncompliant files doesn't mean you should too.
123  */
124 #define C_MAX_BLOCKS_IN_MCU 10 /* compressor's limit on blocks per MCU */
125 #ifndef D_MAX_BLOCKS_IN_MCU
126 #define D_MAX_BLOCKS_IN_MCU 10 /* decompressor's limit on blocks per MCU */
127 #endif
128 
129 
130 /* Data structures for images (arrays of samples and of DCT coefficients).
131  * On 80x86 machines, the image arrays are too big for near pointers,
132  * but the pointer arrays can fit in near memory.
133  */
134 
135 typedef JSAMPLE FAR *JSAMPROW; /* ptr to one image row of pixel samples. */
136 typedef JSAMPROW *JSAMPARRAY; /* ptr to some rows (a 2-D sample array) */
137 typedef JSAMPARRAY *JSAMPIMAGE; /* a 3-D sample array: top index is color */
138 
139 typedef JCOEF JBLOCK[DCTSIZE2]; /* one block of coefficients */
140 typedef JBLOCK FAR *JBLOCKROW; /* pointer to one row of coefficient blocks */
141 typedef JBLOCKROW *JBLOCKARRAY; /* a 2-D array of coefficient blocks */
142 typedef JBLOCKARRAY *JBLOCKIMAGE; /* a 3-D array of coefficient blocks */
143 
144 typedef JCOEF FAR *JCOEFPTR; /* useful in a couple of places */
145 
146 
147 /* Types for JPEG compression parameters and working tables. */
148 
149 
150 /* DCT coefficient quantization tables. */
151 
152 typedef struct {
153  /* This array gives the coefficient quantizers in natural array order
154  * (not the zigzag order in which they are stored in a JPEG DQT marker).
155  * CAUTION: IJG versions prior to v6a kept this array in zigzag order.
156  */
157  UINT16 quantval[DCTSIZE2]; /* quantization step for each coefficient */
158  /* This field is used only during compression. It's initialized FALSE when
159  * the table is created, and set TRUE when it's been output to the file.
160  * You could suppress output of a table by setting this to TRUE.
161  * (See jpeg_suppress_tables for an example.)
162  */
163  boolean sent_table; /* TRUE when table has been output */
164 } JQUANT_TBL;
165 
166 
167 /* Huffman coding tables. */
168 
169 typedef struct {
170  /* These two fields directly represent the contents of a JPEG DHT marker */
171  UINT8 bits[17]; /* bits[k] = # of symbols with codes of */
172  /* length k bits; bits[0] is unused */
173  UINT8 huffval[256]; /* The symbols, in order of incr code length */
174  /* This field is used only during compression. It's initialized FALSE when
175  * the table is created, and set TRUE when it's been output to the file.
176  * You could suppress output of a table by setting this to TRUE.
177  * (See jpeg_suppress_tables for an example.)
178  */
179  boolean sent_table; /* TRUE when table has been output */
180 } JHUFF_TBL;
181 
182 
183 /* Basic info about one component (color channel). */
184 
185 typedef struct {
186  /* These values are fixed over the whole image. */
187  /* For compression, they must be supplied by parameter setup; */
188  /* for decompression, they are read from the SOF marker. */
189  int component_id; /* identifier for this component (0..255) */
190  int component_index; /* its index in SOF or cinfo->comp_info[] */
191  int h_samp_factor; /* horizontal sampling factor (1..4) */
192  int v_samp_factor; /* vertical sampling factor (1..4) */
193  int quant_tbl_no; /* quantization table selector (0..3) */
194  /* These values may vary between scans. */
195  /* For compression, they must be supplied by parameter setup; */
196  /* for decompression, they are read from the SOS marker. */
197  /* The decompressor output side may not use these variables. */
198  int dc_tbl_no; /* DC entropy table selector (0..3) */
199  int ac_tbl_no; /* AC entropy table selector (0..3) */
200 
201  /* Remaining fields should be treated as private by applications. */
202 
203  /* These values are computed during compression or decompression startup: */
204  /* Component's size in DCT blocks.
205  * Any dummy blocks added to complete an MCU are not counted; therefore
206  * these values do not depend on whether a scan is interleaved or not.
207  */
208  JDIMENSION width_in_blocks;
209  JDIMENSION height_in_blocks;
210  /* Size of a DCT block in samples,
211  * reflecting any scaling we choose to apply during the DCT step.
212  * Values from 1 to 16 are supported.
213  * Note that different components may receive different DCT scalings.
214  */
215  int DCT_h_scaled_size;
216  int DCT_v_scaled_size;
217  /* The downsampled dimensions are the component's actual, unpadded number
218  * of samples at the main buffer (preprocessing/compression interface);
219  * DCT scaling is included, so
220  * downsampled_width =
221  * ceil(image_width * Hi/Hmax * DCT_h_scaled_size/block_size)
222  * and similarly for height.
223  */
224  JDIMENSION downsampled_width; /* actual width in samples */
225  JDIMENSION downsampled_height; /* actual height in samples */
226  /* For decompression, in cases where some of the components will be
227  * ignored (eg grayscale output from YCbCr image), we can skip most
228  * computations for the unused components.
229  * For compression, some of the components will need further quantization
230  * scale by factor of 2 after DCT (eg BG_YCC output from normal RGB input).
231  * The field is first set TRUE for decompression, FALSE for compression
232  * in initial_setup, and then adapted in color conversion setup.
233  */
234  boolean component_needed;
235 
236  /* These values are computed before starting a scan of the component. */
237  /* The decompressor output side may not use these variables. */
238  int MCU_width; /* number of blocks per MCU, horizontally */
239  int MCU_height; /* number of blocks per MCU, vertically */
240  int MCU_blocks; /* MCU_width * MCU_height */
241  int MCU_sample_width; /* MCU width in samples: MCU_width * DCT_h_scaled_size */
242  int last_col_width; /* # of non-dummy blocks across in last MCU */
243  int last_row_height; /* # of non-dummy blocks down in last MCU */
244 
245  /* Saved quantization table for component; NULL if none yet saved.
246  * See jdinput.c comments about the need for this information.
247  * This field is currently used only for decompression.
248  */
249  JQUANT_TBL * quant_table;
250 
251  /* Private per-component storage for DCT or IDCT subsystem. */
252  void * dct_table;
254 
255 
256 /* The script for encoding a multiple-scan file is an array of these: */
257 
258 typedef struct {
259  int comps_in_scan; /* number of components encoded in this scan */
260  int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */
261  int Ss, Se; /* progressive JPEG spectral selection parms */
262  int Ah, Al; /* progressive JPEG successive approx. parms */
264 
265 /* The decompressor can save APPn and COM markers in a list of these: */
266 
268 
269 struct jpeg_marker_struct {
270  jpeg_saved_marker_ptr next; /* next in list, or NULL */
271  UINT8 marker; /* marker code: JPEG_COM, or JPEG_APP0+n */
272  unsigned int original_length; /* # bytes of data in the file */
273  unsigned int data_length; /* # bytes of data saved at data[] */
274  JOCTET FAR * data; /* the data contained in the marker */
275  /* the marker length word is not counted in data_length or original_length */
276 };
277 
278 /* Known color spaces. */
279 
280 typedef enum {
281  JCS_UNKNOWN, /* error/unspecified */
282  JCS_GRAYSCALE, /* monochrome */
283  JCS_RGB, /* red/green/blue, standard RGB (sRGB) */
284  JCS_YCbCr, /* Y/Cb/Cr (also known as YUV), standard YCC */
285  JCS_CMYK, /* C/M/Y/K */
286  JCS_YCCK, /* Y/Cb/Cr/K */
287 #ifdef ANDROID_RGB
288  JCS_RGBA_8888, /* red/green/blue/alpha */
289  JCS_RGB_565, /* red/green/blue in 565 format */
290 #else
291 #ifdef TEGRA_ACCELERATE
292  JCS_RGBA_8888, /* red/green/blue/alpha */
293  JCS_RGB_565, /* red/green/blue in 565 format */
294 #endif
295 #endif
296  JCS_BG_RGB, /* big gamut red/green/blue, bg-sRGB */
297  JCS_BG_YCC, /* big gamut Y/Cb/Cr, bg-sYCC */
298 } J_COLOR_SPACE;
299 
300 /* Supported color transforms. */
301 
302 typedef enum {
303  JCT_NONE = 0,
306 
307 /* DCT/IDCT algorithm options. */
308 
309 typedef enum {
310  JDCT_ISLOW, /* slow but accurate integer algorithm */
311  JDCT_IFAST, /* faster, less accurate integer method */
312  JDCT_FLOAT /* floating-point: accurate, fast on fast HW */
313 } J_DCT_METHOD;
314 
315 #ifndef JDCT_DEFAULT /* may be overridden in jconfig.h */
316 #define JDCT_DEFAULT JDCT_ISLOW
317 #endif
318 #ifndef JDCT_FASTEST /* may be overridden in jconfig.h */
319 #define JDCT_FASTEST JDCT_IFAST
320 #endif
321 
322 /* Dithering options for decompression. */
323 
324 typedef enum {
325  JDITHER_NONE, /* no dithering */
326  JDITHER_ORDERED, /* simple ordered dither */
327  JDITHER_FS /* Floyd-Steinberg error diffusion dither */
328 } J_DITHER_MODE;
329 
330 /* Tegra acceleration data structure */
331 #ifdef TEGRA_ACCELERATE
332 struct jpeg_mgr {
333  unsigned char *buff[3];
334  unsigned int pitch[3];
335  unsigned int mcu_type; // 0: Y=2x2, U,V=1x1
336  // 1: Y=2x1, U,V=1x1
337  // 2: Y=1x2, U,V=1x1
338  // 3: Y=1x1, U,V=1x1
339  // 4: Y=1x1, U,V not present
340 };
341 
342 typedef struct jpeg_mgr j_mgr;
343 typedef struct jpeg_mgr * j_mgr_ptr;
344 #endif
345 
346 /* Common fields between JPEG compression and decompression master structs. */
347 
348 #ifdef TEGRA_ACCELERATE
349 #define jpeg_common_fields \
350  struct jpeg_error_mgr * err; /* Error handler module */\
351  struct jpeg_memory_mgr * mem; /* Memory manager module */\
352  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
353  void * jpegMgr; /* Tegra related manager */\
354  void * client_data; /* Available for use by application */\
355  boolean is_decompressor; /* So common code can tell which is which */\
356  boolean tegra_acceleration; /* Enable Tegra based hardware acceleration*/\
357  boolean mjpeg_decode; /* Enable MJPEG decoding in hardware acceleration*/\
358  boolean buffer_in_use; /* Buffer provided to the caller is still in use*/\
359  unsigned int initWidth; /* Initial width for hardware acceleration */ \
360  void *nvbufsurfptr; /* */\
361  unsigned int initHeight; /* Initial height for hardware acceleration */ \
362  unsigned int initBitstreamBuffer; /* Initial bitstream buffer size */ \
363  unsigned int inputBuffSize; /* Maximum input buffer size */ \
364  unsigned int outputBuffSize; /* Maximum output buffer size */ \
365  boolean rgb565; /* Force output color to red/green/blue in 565 format */ \
366  boolean IsVendorbuf; /* check if input buffer is vendor specific buffer */ \
367  unsigned char *pVendor_buf; /* pointer to vendor specific buffer */ \
368  unsigned int Vendorbuf_Size; /* size of vendor buffer */ \
369  int global_state; /* For checking call sequence validity */ \
370  int fd; \
371  boolean bMeasure_ImageProcessTime; /* Measure image process time */ \
372  int gpu_id; /* Used in transform */ \
373  unsigned int quality; \
374  int dec_out_mem_type; /* NvBufSurfaceMemType for decoder output. Only applicable for jcuvid */ \
375  int enc_in_mem_type; /* NvBufSurfaceMemType for encoder input. Only applicable for jcuvid */ \
376  boolean dec_use_external_buffer; /* Use external buffer for decoder output */ \
377  unsigned char reserved[256] /* Reserved field for future use */
378 #elif GPU_ACCELERATE
379 #define jpeg_common_fields \
380  struct jpeg_error_mgr * err; /* Error handler module */\
381  struct jpeg_memory_mgr * mem; /* Memory manager module */\
382  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
383  void * client_data; /* Available for use by application */\
384  boolean is_decompressor; /* So common code can tell which is which */\
385  int global_state; /* For checking call sequence validity */\
386  unsigned int inputBuffSize; /* Maximum input buffer size */ \
387  unsigned char *start_of_data; \
388  boolean IsVendorbuf; /* check if input buffer is vendor specific buffer */ \
389  unsigned char *pVendor_buf; /* pointer to vendor specific buffer */ \
390  unsigned int Vendorbuf_Size; /* size of vendor buffer */ \
391  unsigned int outputBuffSize; /* Maximum output buffer size */ \
392  void *surf_ptr; \
393  int batch_size; \
394  int gpu_id; \
395  unsigned char *alpha; \
396  unsigned int quality; \
397  boolean grayscale; \
398  nvjpegJpegState_t nvjpeg_state; \
399  nvjpegJpegState_t nvjpegenc_state; \
400  nvjpegEncoderState_t encoder_state; \
401  nvjpegHandle_t nvjpeg_handle; \
402  nvjpegHandle_t nvjpegenc_handle; \
403  cudaStream_t stream; \
404  nvjpegOutputFormat_t fmt; \
405  bool write_decoded; \
406  std::string output_dir; \
407  bool pipelined; \
408  bool batched; \
409  vector<size_t> file_len; \
410  vector<int> widths; \
411  vector<int> heights; \
412  vector<nvjpegImage_t> iout; \
413  vector<nvjpegImage_t> isz; \
414  GQueue *buf_q;\
415  GMutex q_lck;\
416  cudaStream_t cuda_stream; \
417  NvBufSurface *surf1; \
418  unsigned int nvjpegdec_init; \
419  boolean nvjpegenc_init;
420 #else
421 #define jpeg_common_fields \
422  struct jpeg_error_mgr * err; /* Error handler module */\
423  struct jpeg_memory_mgr * mem; /* Memory manager module */\
424  struct jpeg_progress_mgr * progress; /* Progress monitor, or NULL if none */\
425  void * client_data; /* Available for use by application */\
426  boolean is_decompressor; /* So common code can tell which is which */\
427  int global_state /* For checking call sequence validity */
428 #endif
429 
430 /* Routines that are to be used by both halves of the library are declared
431  * to receive a pointer to this structure. There are no actual instances of
432  * jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
433  */
434 struct jpeg_common_struct {
435  jpeg_common_fields; /* Fields common to both master struct types */
436  /* Additional fields follow in an actual jpeg_compress_struct or
437  * jpeg_decompress_struct. All three structs must agree on these
438  * initial fields! (This would be a lot cleaner in C++.)
439  */
440 };
441 
445 
446 #ifdef TEGRA_ACCELERATE
447 typedef struct {
448  unsigned int left, top; /* ROI coordinates */
449  unsigned int width, height; /* ROI coordinates */
451 #endif
452 
453 /* Master record for a compression instance */
454 
455 struct jpeg_compress_struct {
456  jpeg_common_fields; /* Fields shared with jpeg_decompress_struct */
457 
458  /* Destination for compressed data */
459  struct jpeg_destination_mgr * dest;
460 
461  /* Description of source image --- these fields must be filled in by
462  * outer application before starting compression. in_color_space must
463  * be correct before you can even call jpeg_set_defaults().
464  */
465 
466  JDIMENSION image_width; /* input image width */
467  JDIMENSION image_height; /* input image height */
468  int input_components; /* # of color components in input image */
469  J_COLOR_SPACE in_color_space; /* colorspace of input image */
470 
471  double input_gamma; /* image gamma of input image */
472 
473  /* Compression parameters --- these fields must be set before calling
474  * jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
475  * initialize everything to reasonable defaults, then changing anything
476  * the application specifically wants to change. That way you won't get
477  * burnt when new parameters are added. Also note that there are several
478  * helper routines to simplify changing parameters.
479  */
480 
481  unsigned int scale_num, scale_denom; /* fraction by which to scale image */
482 
483  JDIMENSION jpeg_width; /* scaled JPEG image width */
484  JDIMENSION jpeg_height; /* scaled JPEG image height */
485  /* Dimensions of actual JPEG image that will be written to file,
486  * derived from input dimensions by scaling factors above.
487  * These fields are computed by jpeg_start_compress().
488  * You can also use jpeg_calc_jpeg_dimensions() to determine these values
489  * in advance of calling jpeg_start_compress().
490  */
491 
492  int data_precision; /* bits of precision in image data */
493 
494  int num_components; /* # of color components in JPEG image */
495  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
496 
497  jpeg_component_info * comp_info;
498  /* comp_info[i] describes component that appears i'th in SOF */
499 
500  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
501  int q_scale_factor[NUM_QUANT_TBLS];
502  /* ptrs to coefficient quantization tables, or NULL if not defined,
503  * and corresponding scale factors (percentage, initialized 100).
504  */
505 
506  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
507  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
508  /* ptrs to Huffman coding tables, or NULL if not defined */
509 
510  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
511  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
512  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
513 
514  int num_scans; /* # of entries in scan_info array */
515  const jpeg_scan_info * scan_info; /* script for multi-scan file, or NULL */
516  /* The default value of scan_info is NULL, which causes a single-scan
517  * sequential JPEG file to be emitted. To create a multi-scan file,
518  * set num_scans and scan_info to point to an array of scan definitions.
519  */
520 
521  boolean raw_data_in; /* TRUE=caller supplies downsampled data */
522  boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
523  boolean optimize_coding; /* TRUE=optimize entropy encoding parms */
524  boolean CCIR601_sampling; /* TRUE=first samples are cosited */
525  boolean do_fancy_downsampling; /* TRUE=apply fancy downsampling */
526  int smoothing_factor; /* 1..100, or 0 for no input smoothing */
527  J_DCT_METHOD dct_method; /* DCT algorithm selector */
528 
529  /* The restart interval can be specified in absolute MCUs by setting
530  * restart_interval, or in MCU rows by setting restart_in_rows
531  * (in which case the correct restart_interval will be figured
532  * for each scan).
533  */
534  unsigned int restart_interval; /* MCUs per restart, or 0 for no restart */
535  int restart_in_rows; /* if > 0, MCU rows per restart interval */
536 
537  /* Parameters controlling emission of special markers. */
538 
539  boolean write_JFIF_header; /* should a JFIF marker be written? */
540  UINT8 JFIF_major_version; /* What to write for the JFIF version number */
541  UINT8 JFIF_minor_version;
542  /* These three values are not used by the JPEG code, merely copied */
543  /* into the JFIF APP0 marker. density_unit can be 0 for unknown, */
544  /* 1 for dots/inch, or 2 for dots/cm. Note that the pixel aspect */
545  /* ratio is defined by X_density/Y_density even when density_unit=0. */
546  UINT8 density_unit; /* JFIF code for pixel size units */
547  UINT16 X_density; /* Horizontal pixel density */
548  UINT16 Y_density; /* Vertical pixel density */
549  boolean write_Adobe_marker; /* should an Adobe marker be written? */
550 
552  /* Color transform identifier, writes LSE marker if nonzero */
553 
554  /* State variable: index of next scanline to be written to
555  * jpeg_write_scanlines(). Application may use this to control its
556  * processing loop, e.g., "while (next_scanline < image_height)".
557  */
558 
559  JDIMENSION next_scanline; /* 0 .. image_height-1 */
560 
561  /* Remaining fields are known throughout compressor, but generally
562  * should not be touched by a surrounding application.
563  */
564 
565  /*
566  * These fields are computed during compression startup
567  */
568  boolean progressive_mode; /* TRUE if scan script uses progressive mode */
569  int max_h_samp_factor; /* largest h_samp_factor */
570  int max_v_samp_factor; /* largest v_samp_factor */
571 
572  int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */
573  int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */
574 
575  JDIMENSION total_iMCU_rows; /* # of iMCU rows to be input to coef ctlr */
576  /* The coefficient controller receives data in units of MCU rows as defined
577  * for fully interleaved scans (whether the JPEG file is interleaved or not).
578  * There are v_samp_factor * DCT_v_scaled_size sample rows of each component
579  * in an "iMCU" (interleaved MCU) row.
580  */
581 
582  /*
583  * These fields are valid during any one scan.
584  * They describe the components and MCUs actually appearing in the scan.
585  */
586  int comps_in_scan; /* # of JPEG components in this scan */
587  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
588  /* *cur_comp_info[i] describes component that appears i'th in SOS */
589 
590  JDIMENSION MCUs_per_row; /* # of MCUs across the image */
591  JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
592 
593  int blocks_in_MCU; /* # of DCT blocks per MCU */
594  int MCU_membership[C_MAX_BLOCKS_IN_MCU];
595  /* MCU_membership[i] is index in cur_comp_info of component owning */
596  /* i'th block in an MCU */
597 
598  int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
599 
600  int block_size; /* the basic DCT block size: 1..16 */
601  const int * natural_order; /* natural-order position array */
602  int lim_Se; /* min( Se, DCTSIZE2-1 ) */
603 
604  boolean frame_to_encode; /* make sure that hw encoding takes place only once */
605  unsigned int buf_size_to_encode; /* full frame buffer size to be encoded */
606  unsigned char *pOutputSurface; /* moving pointer inside output surface.
607  * Need to increment after every row component
608  * RGB to RGBA conversion to keep track of current
609  * location to be updated inside output surface.
610  */
611  boolean init_encMgr; /* check if encoder manager is already initialised */
612  /*
613  * Links to compression subobjects (methods and private variables of modules)
614  */
615  struct jpeg_comp_master * master;
616  struct jpeg_c_main_controller * main;
617  struct jpeg_c_prep_controller * prep;
618  struct jpeg_c_coef_controller * coef;
619  struct jpeg_marker_writer * marker;
620  struct jpeg_color_converter * cconvert;
621  struct jpeg_downsampler * downsample;
622  struct jpeg_forward_dct * fdct;
623  struct jpeg_entropy_encoder * entropy;
624  jpeg_scan_info * script_space; /* workspace for jpeg_simple_progression */
625  int script_space_size;
626 #ifdef TEGRA_ACCELERATE
627  boolean skip_SOI;
628  boolean exif_data;
629  boolean header_len;
630  boolean crop_region;
632  boolean image_scale;
633  JDIMENSION scaled_image_width; /* scaled image width */
634  JDIMENSION scaled_image_height; /* scaled image height */
635 #endif
636 };
637 
638 
639 /* Master record for a decompression instance */
640 
641 struct jpeg_decompress_struct {
642  jpeg_common_fields; /* Fields shared with jpeg_compress_struct */
643 
644  /* Source of compressed data */
645  struct jpeg_source_mgr * src;
646 
647  /* Basic description of image --- filled in by jpeg_read_header(). */
648  /* Application may inspect these values to decide how to process image. */
649 
650  JDIMENSION image_width; /* nominal image width (from SOF marker) */
651  JDIMENSION image_height; /* nominal image height */
652  int num_components; /* # of color components in JPEG image */
653  J_COLOR_SPACE jpeg_color_space; /* colorspace of JPEG image */
654 
655  /* Decompression processing parameters --- these fields must be set before
656  * calling jpeg_start_decompress(). Note that jpeg_read_header() initializes
657  * them to default values.
658  */
659 
660  J_COLOR_SPACE out_color_space; /* colorspace for output */
661 
662  unsigned int scale_num, scale_denom; /* fraction by which to scale image */
663 
664  double output_gamma; /* image gamma wanted in output */
665 
666  boolean buffered_image; /* TRUE=multiple output passes */
667  boolean raw_data_out; /* TRUE=downsampled data wanted */
668 
669  J_DCT_METHOD dct_method; /* IDCT algorithm selector */
670  boolean do_fancy_upsampling; /* TRUE=apply fancy upsampling */
671  boolean do_block_smoothing; /* TRUE=apply interblock smoothing */
672 
673  boolean quantize_colors; /* TRUE=colormapped output wanted */
674  /* the following are ignored if not quantize_colors: */
675  J_DITHER_MODE dither_mode; /* type of color dithering to use */
676  boolean two_pass_quantize; /* TRUE=use two-pass color quantization */
677  int desired_number_of_colors; /* max # colors to use in created colormap */
678  /* these are significant only in buffered-image mode: */
679  boolean enable_1pass_quant; /* enable future use of 1-pass quantizer */
680  boolean enable_external_quant;/* enable future use of external colormap */
681  boolean enable_2pass_quant; /* enable future use of 2-pass quantizer */
682 
683  /* Description of actual output image that will be returned to application.
684  * These fields are computed by jpeg_start_decompress().
685  * You can also use jpeg_calc_output_dimensions() to determine these values
686  * in advance of calling jpeg_start_decompress().
687  */
688 
689  JDIMENSION output_width; /* scaled image width */
690  JDIMENSION output_height; /* scaled image height */
691  int out_color_components; /* # of color components in out_color_space */
692  int output_components; /* # of color components returned */
693  /* output_components is 1 (a colormap index) when quantizing colors;
694  * otherwise it equals out_color_components.
695  */
696  int rec_outbuf_height; /* min recommended height of scanline buffer */
697  /* If the buffer passed to jpeg_read_scanlines() is less than this many rows
698  * high, space and time will be wasted due to unnecessary data copying.
699  * Usually rec_outbuf_height will be 1 or 2, at most 4.
700  */
701 
702  /* When quantizing colors, the output colormap is described by these fields.
703  * The application can supply a colormap by setting colormap non-NULL before
704  * calling jpeg_start_decompress; otherwise a colormap is created during
705  * jpeg_start_decompress or jpeg_start_output.
706  * The map has out_color_components rows and actual_number_of_colors columns.
707  */
708  int actual_number_of_colors; /* number of entries in use */
709  JSAMPARRAY colormap; /* The color map as a 2-D pixel array */
710 
711  /* State variables: these variables indicate the progress of decompression.
712  * The application may examine these but must not modify them.
713  */
714 
715  /* Row index of next scanline to be read from jpeg_read_scanlines().
716  * Application may use this to control its processing loop, e.g.,
717  * "while (output_scanline < output_height)".
718  */
719  JDIMENSION output_scanline; /* 0 .. output_height-1 */
720 
721  /* Current input scan number and number of iMCU rows completed in scan.
722  * These indicate the progress of the decompressor input side.
723  */
724  int input_scan_number; /* Number of SOS markers seen so far */
725  JDIMENSION input_iMCU_row; /* Number of iMCU rows completed */
726 
727  /* The "output scan number" is the notional scan being displayed by the
728  * output side. The decompressor will not allow output scan/row number
729  * to get ahead of input scan/row, but it can fall arbitrarily far behind.
730  */
731  int output_scan_number; /* Nominal scan number being displayed */
732  JDIMENSION output_iMCU_row; /* Number of iMCU rows read */
733 
734  /* Current progression status. coef_bits[c][i] indicates the precision
735  * with which component c's DCT coefficient i (in zigzag order) is known.
736  * It is -1 when no data has yet been received, otherwise it is the point
737  * transform (shift) value for the most recent scan of the coefficient
738  * (thus, 0 at completion of the progression).
739  * This pointer is NULL when reading a non-progressive file.
740  */
741  int (*coef_bits)[DCTSIZE2]; /* -1 or current Al value for each coef */
742 
743  /* Internal JPEG parameters --- the application usually need not look at
744  * these fields. Note that the decompressor output side may not use
745  * any parameters that can change between scans.
746  */
747 
748  /* Quantization and Huffman tables are carried forward across input
749  * datastreams when processing abbreviated JPEG datastreams.
750  */
751 
752  JQUANT_TBL * quant_tbl_ptrs[NUM_QUANT_TBLS];
753  /* ptrs to coefficient quantization tables, or NULL if not defined */
754 
755  JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS];
756  JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS];
757  /* ptrs to Huffman coding tables, or NULL if not defined */
758 
759  /* These parameters are never carried across datastreams, since they
760  * are given in SOF/SOS markers or defined to be reset by SOI.
761  */
762 
763  int data_precision; /* bits of precision in image data */
764 
765  jpeg_component_info * comp_info;
766  /* comp_info[i] describes component that appears i'th in SOF */
767 
768  boolean is_baseline; /* TRUE if Baseline SOF0 encountered */
769  boolean progressive_mode; /* TRUE if SOFn specifies progressive mode */
770  boolean arith_code; /* TRUE=arithmetic coding, FALSE=Huffman */
771 
772  UINT8 arith_dc_L[NUM_ARITH_TBLS]; /* L values for DC arith-coding tables */
773  UINT8 arith_dc_U[NUM_ARITH_TBLS]; /* U values for DC arith-coding tables */
774  UINT8 arith_ac_K[NUM_ARITH_TBLS]; /* Kx values for AC arith-coding tables */
775 
776  unsigned int restart_interval; /* MCUs per restart interval, or 0 for no restart */
777 
778  /* These fields record data obtained from optional markers recognized by
779  * the JPEG library.
780  */
781  boolean saw_JFIF_marker; /* TRUE iff a JFIF APP0 marker was found */
782  /* Data copied from JFIF marker; only valid if saw_JFIF_marker is TRUE: */
783  UINT8 JFIF_major_version; /* JFIF version number */
784  UINT8 JFIF_minor_version;
785  UINT8 density_unit; /* JFIF code for pixel size units */
786  UINT16 X_density; /* Horizontal pixel density */
787  UINT16 Y_density; /* Vertical pixel density */
788  boolean saw_Adobe_marker; /* TRUE iff an Adobe APP14 marker was found */
789  UINT8 Adobe_transform; /* Color transform code from Adobe marker */
790 
792  /* Color transform identifier derived from LSE marker, otherwise zero */
793 
794  boolean CCIR601_sampling; /* TRUE=first samples are cosited */
795 
796  /* Aside from the specific data retained from APPn markers known to the
797  * library, the uninterpreted contents of any or all APPn and COM markers
798  * can be saved in a list for examination by the application.
799  */
800  jpeg_saved_marker_ptr marker_list; /* Head of list of saved markers */
801 
802  /* Remaining fields are known throughout decompressor, but generally
803  * should not be touched by a surrounding application.
804  */
805 
806  /*
807  * These fields are computed during decompression startup
808  */
809  int max_h_samp_factor; /* largest h_samp_factor */
810  int max_v_samp_factor; /* largest v_samp_factor */
811 
812  int min_DCT_h_scaled_size; /* smallest DCT_h_scaled_size of any component */
813  int min_DCT_v_scaled_size; /* smallest DCT_v_scaled_size of any component */
814 
815  JDIMENSION total_iMCU_rows; /* # of iMCU rows in image */
816  /* The coefficient controller's input and output progress is measured in
817  * units of "iMCU" (interleaved MCU) rows. These are the same as MCU rows
818  * in fully interleaved JPEG scans, but are used whether the scan is
819  * interleaved or not. We define an iMCU row as v_samp_factor DCT block
820  * rows of each component. Therefore, the IDCT output contains
821  * v_samp_factor * DCT_v_scaled_size sample rows of a component per iMCU row.
822  */
823 
824  JSAMPLE * sample_range_limit; /* table for fast range-limiting */
825 
826  /*
827  * These fields are valid during any one scan.
828  * They describe the components and MCUs actually appearing in the scan.
829  * Note that the decompressor output side must not use these fields.
830  */
831  int comps_in_scan; /* # of JPEG components in this scan */
832  jpeg_component_info * cur_comp_info[MAX_COMPS_IN_SCAN];
833  /* *cur_comp_info[i] describes component that appears i'th in SOS */
834 
835  JDIMENSION MCUs_per_row; /* # of MCUs across the image */
836  JDIMENSION MCU_rows_in_scan; /* # of MCU rows in the image */
837 
838  int blocks_in_MCU; /* # of DCT blocks per MCU */
839  int MCU_membership[D_MAX_BLOCKS_IN_MCU];
840  /* MCU_membership[i] is index in cur_comp_info of component owning */
841  /* i'th block in an MCU */
842 
843  int Ss, Se, Ah, Al; /* progressive JPEG parameters for scan */
844 
845  /* These fields are derived from Se of first SOS marker.
846  */
847  int block_size; /* the basic DCT block size: 1..16 */
848  const int * natural_order; /* natural-order position array for entropy decode */
849  int lim_Se; /* min( Se, DCTSIZE2-1 ) for entropy decode */
850 
851  /* This field is shared between entropy decoder and marker parser.
852  * It is either zero or the code of a JPEG marker that has been
853  * read from the data source, but has not yet been processed.
854  */
855  int unread_marker;
856 
857 
858  boolean b_frametodecode; /* make sure that hw decoding takes place only once though
859  * jpeg_read_raw_data is called on MCU row basis.
860  */
861  boolean b_surface_alloc_done; /* make sure that surfaces are created only when
862  * jpegTegraDecoderMgrCreate() is called.
863  */
864  unsigned char * input_frame_buf; /* Buffer to hold encoded input frame */
865  unsigned int pixel_row_cnt; /* number of Y pixel rows to be copied in one MCU row */
866  unsigned int u_pixel_row_cnt; /* number of U pixel rows to be copied in one MCU row */
867  unsigned int v_pixel_row_cnt; /* number of V pixel rows to be copied in one MCU row */
868 
869  /*
870  * Links to decompression subobjects (methods, private variables of modules)
871  */
872  struct jpeg_decomp_master * master;
873  struct jpeg_d_main_controller * main;
874  struct jpeg_d_coef_controller * coef;
875  struct jpeg_d_post_controller * post;
876  struct jpeg_input_controller * inputctl;
877  struct jpeg_marker_reader * marker;
878  struct jpeg_entropy_decoder * entropy;
879  struct jpeg_inverse_dct * idct;
880  struct jpeg_upsampler * upsample;
881  struct jpeg_color_deconverter * cconvert;
882  struct jpeg_color_quantizer * cquantize;
883 };
884 
885 
886 /* "Object" declarations for JPEG modules that may be supplied or called
887  * directly by the surrounding application.
888  * As with all objects in the JPEG library, these structs only define the
889  * publicly visible methods and state variables of a module. Additional
890  * private fields may exist after the public ones.
891  */
892 
893 
894 /* Error handler object */
895 
896 struct jpeg_error_mgr {
897  /* Error exit handler: does not return to caller */
898  JMETHOD(noreturn_t, error_exit, (j_common_ptr cinfo));
899  /* Conditionally emit a trace or warning message */
900  JMETHOD(void, emit_message, (j_common_ptr cinfo, int msg_level));
901  /* Routine that actually outputs a trace or error message */
902  JMETHOD(void, output_message, (j_common_ptr cinfo));
903  /* Format a message string for the most recent JPEG error or message */
904  JMETHOD(void, format_message, (j_common_ptr cinfo, char * buffer));
905 #define JMSG_LENGTH_MAX 200 /* recommended size of format_message buffer */
906  /* Reset error state variables at start of a new image */
907  JMETHOD(void, reset_error_mgr, (j_common_ptr cinfo));
908 
909  /* The message ID code and any parameters are saved here.
910  * A message can have one string parameter or up to 8 int parameters.
911  */
912  int msg_code;
913 #define JMSG_STR_PARM_MAX 80
914  union {
915  int i[8];
916  char s[JMSG_STR_PARM_MAX];
917  } msg_parm;
918 
919  /* Standard state variables for error facility */
920 
921  int trace_level; /* max msg_level that will be displayed */
922 
923  /* For recoverable corrupt-data errors, we emit a warning message,
924  * but keep going unless emit_message chooses to abort. emit_message
925  * should count warnings in num_warnings. The surrounding application
926  * can check for bad data by seeing if num_warnings is nonzero at the
927  * end of processing.
928  */
929  long num_warnings; /* number of corrupt-data warnings */
930 
931  /* These fields point to the table(s) of error message strings.
932  * An application can change the table pointer to switch to a different
933  * message list (typically, to change the language in which errors are
934  * reported). Some applications may wish to add additional error codes
935  * that will be handled by the JPEG library error mechanism; the second
936  * table pointer is used for this purpose.
937  *
938  * First table includes all errors generated by JPEG library itself.
939  * Error code 0 is reserved for a "no such error string" message.
940  */
941  const char * const * jpeg_message_table; /* Library errors */
942  int last_jpeg_message; /* Table contains strings 0..last_jpeg_message */
943  /* Second table can be added by application (see cjpeg/djpeg for example).
944  * It contains strings numbered first_addon_message..last_addon_message.
945  */
946  const char * const * addon_message_table; /* Non-library errors */
947  int first_addon_message; /* code for first string in addon table */
948  int last_addon_message; /* code for last string in addon table */
949 };
950 
951 
952 /* Progress monitor object */
953 
954 struct jpeg_progress_mgr {
955  JMETHOD(void, progress_monitor, (j_common_ptr cinfo));
956 
957  long pass_counter; /* work units completed in this pass */
958  long pass_limit; /* total number of work units in this pass */
959  int completed_passes; /* passes completed so far */
960  int total_passes; /* total number of passes expected */
961 };
962 
963 
964 /* Data destination object for compression */
965 
966 struct jpeg_destination_mgr {
967  JOCTET * next_output_byte; /* => next byte to write in buffer */
968  size_t free_in_buffer; /* # of byte spaces remaining in buffer */
969 
970  JMETHOD(void, init_destination, (j_compress_ptr cinfo));
971  JMETHOD(boolean, empty_output_buffer, (j_compress_ptr cinfo));
972  JMETHOD(void, term_destination, (j_compress_ptr cinfo));
973 };
974 
975 
976 /* Data source object for decompression */
977 
978 struct jpeg_source_mgr {
979  const JOCTET * next_input_byte; /* => next byte to read from buffer */
980  size_t bytes_in_buffer; /* # of bytes remaining in buffer */
981 
982  JMETHOD(void, init_source, (j_decompress_ptr cinfo));
983  JMETHOD(boolean, fill_input_buffer, (j_decompress_ptr cinfo));
984  JMETHOD(void, skip_input_data, (j_decompress_ptr cinfo, long num_bytes));
985  JMETHOD(boolean, resync_to_restart, (j_decompress_ptr cinfo, int desired));
986  JMETHOD(void, term_source, (j_decompress_ptr cinfo));
987 };
988 
989 
990 /* Memory manager object.
991  * Allocates "small" objects (a few K total), "large" objects (tens of K),
992  * and "really big" objects (virtual arrays with backing store if needed).
993  * The memory manager does not allow individual objects to be freed; rather,
994  * each created object is assigned to a pool, and whole pools can be freed
995  * at once. This is faster and more convenient than remembering exactly what
996  * to free, especially where malloc()/free() are not too speedy.
997  * NB: alloc routines never return NULL. They exit to error_exit if not
998  * successful.
999  */
1000 
1001 #define JPOOL_PERMANENT 0 /* lasts until master record is destroyed */
1002 #define JPOOL_IMAGE 1 /* lasts until done with image/datastream */
1003 #define JPOOL_NUMPOOLS 2
1004 
1005 typedef struct jvirt_sarray_control * jvirt_sarray_ptr;
1006 typedef struct jvirt_barray_control * jvirt_barray_ptr;
1007 
1008 
1009 struct jpeg_memory_mgr {
1010  /* Method pointers */
1011  JMETHOD(void *, alloc_small, (j_common_ptr cinfo, int pool_id,
1012  size_t sizeofobject));
1013  JMETHOD(void FAR *, alloc_large, (j_common_ptr cinfo, int pool_id,
1014  size_t sizeofobject));
1015  JMETHOD(JSAMPARRAY, alloc_sarray, (j_common_ptr cinfo, int pool_id,
1016  JDIMENSION samplesperrow,
1017  JDIMENSION numrows));
1018  JMETHOD(JBLOCKARRAY, alloc_barray, (j_common_ptr cinfo, int pool_id,
1019  JDIMENSION blocksperrow,
1020  JDIMENSION numrows));
1021  JMETHOD(jvirt_sarray_ptr, request_virt_sarray, (j_common_ptr cinfo,
1022  int pool_id,
1023  boolean pre_zero,
1024  JDIMENSION samplesperrow,
1025  JDIMENSION numrows,
1026  JDIMENSION maxaccess));
1027  JMETHOD(jvirt_barray_ptr, request_virt_barray, (j_common_ptr cinfo,
1028  int pool_id,
1029  boolean pre_zero,
1030  JDIMENSION blocksperrow,
1031  JDIMENSION numrows,
1032  JDIMENSION maxaccess));
1033  JMETHOD(void, realize_virt_arrays, (j_common_ptr cinfo));
1034  JMETHOD(JSAMPARRAY, access_virt_sarray, (j_common_ptr cinfo,
1035  jvirt_sarray_ptr ptr,
1036  JDIMENSION start_row,
1037  JDIMENSION num_rows,
1038  boolean writable));
1039  JMETHOD(JBLOCKARRAY, access_virt_barray, (j_common_ptr cinfo,
1040  jvirt_barray_ptr ptr,
1041  JDIMENSION start_row,
1042  JDIMENSION num_rows,
1043  boolean writable));
1044  JMETHOD(void, free_pool, (j_common_ptr cinfo, int pool_id));
1045  JMETHOD(void, self_destruct, (j_common_ptr cinfo));
1046 
1047  /* Limit on memory allocation for this JPEG object. (Note that this is
1048  * merely advisory, not a guaranteed maximum; it only affects the space
1049  * used for virtual-array buffers.) May be changed by outer application
1050  * after creating the JPEG object.
1051  */
1052  long max_memory_to_use;
1053 
1054  /* Maximum allocation request accepted by alloc_large. */
1055  long max_alloc_chunk;
1056 };
1057 
1058 
1059 /* Routine signature for application-supplied marker processing methods.
1060  * Need not pass marker code since it is stored in cinfo->unread_marker.
1061  */
1062 typedef JMETHOD(boolean, jpeg_marker_parser_method, (j_decompress_ptr cinfo));
1063 
1064 
1065 /* Declarations for routines called by application.
1066  * The JPP macro hides prototype parameters from compilers that can't cope.
1067  * Note JPP requires double parentheses.
1068  */
1069 
1070 #ifdef HAVE_PROTOTYPES
1071 #define JPP(arglist) arglist
1072 #else
1073 #define JPP(arglist) ()
1074 #endif
1075 
1076 
1077 /* Short forms of external names for systems with brain-damaged linkers.
1078  * We shorten external names to be unique in the first six letters, which
1079  * is good enough for all known systems.
1080  * (If your compiler itself needs names to be unique in less than 15
1081  * characters, you are out of luck. Get a better compiler.)
1082  */
1083 
1084 #ifdef NEED_SHORT_EXTERNAL_NAMES
1085 #define jpeg_std_error jStdError
1086 #define jpeg_CreateCompress jCreaCompress
1087 #define jpeg_CreateDecompress jCreaDecompress
1088 #define jpeg_destroy_compress jDestCompress
1089 #define jpeg_destroy_decompress jDestDecompress
1090 #define jpeg_destroy_surface jDestSurf
1091 #define jpeg_stdio_dest jStdDest
1092 #define jpeg_stdio_src jStdSrc
1093 #define jpeg_mem_dest jMemDest
1094 #define jpeg_mem_src jMemSrc
1095 #define jpeg_set_defaults jSetDefaults
1096 #define jpeg_set_colorspace jSetColorspace
1097 #define jpeg_default_colorspace jDefColorspace
1098 #define jpeg_set_quality jSetQuality
1099 #define jpeg_set_linear_quality jSetLQuality
1100 #define jpeg_default_qtables jDefQTables
1101 #define jpeg_add_quant_table jAddQuantTable
1102 #define jpeg_quality_scaling jQualityScaling
1103 #define jpeg_simple_progression jSimProgress
1104 #define jpeg_suppress_tables jSuppressTables
1105 #define jpeg_alloc_quant_table jAlcQTable
1106 #define jpeg_alloc_huff_table jAlcHTable
1107 #define jpeg_std_huff_table jStdHTable
1108 #define jpeg_start_compress jStrtCompress
1109 #define jpeg_write_scanlines jWrtScanlines
1110 #define jpeg_finish_compress jFinCompress
1111 #define jpeg_calc_jpeg_dimensions jCjpegDimensions
1112 #define jpeg_write_raw_data jWrtRawData
1113 #define jpeg_write_marker jWrtMarker
1114 #define jpeg_write_m_header jWrtMHeader
1115 #define jpeg_write_m_byte jWrtMByte
1116 #define jpeg_write_tables jWrtTables
1117 #define jpeg_read_header jReadHeader
1118 #define jpeg_start_decompress jStrtDecompress
1119 #define jpeg_read_scanlines jReadScanlines
1120 #define jpeg_finish_decompress jFinDecompress
1121 #define jpeg_read_raw_data jReadRawData
1122 #define jpeg_has_multiple_scans jHasMultScn
1123 #define jpeg_start_output jStrtOutput
1124 #define jpeg_finish_output jFinOutput
1125 #define jpeg_input_complete jInComplete
1126 #define jpeg_new_colormap jNewCMap
1127 #define jpeg_consume_input jConsumeInput
1128 #define jpeg_core_output_dimensions jCoreDimensions
1129 #define jpeg_calc_output_dimensions jCalcDimensions
1130 #define jpeg_save_markers jSaveMarkers
1131 #define jpeg_set_marker_processor jSetMarker
1132 #define jpeg_read_coefficients jReadCoefs
1133 #define jpeg_write_coefficients jWrtCoefs
1134 #define jpeg_copy_critical_parameters jCopyCrit
1135 #define jpeg_abort_compress jAbrtCompress
1136 #define jpeg_abort_decompress jAbrtDecompress
1137 #define jpeg_abort jAbort
1138 #define jpeg_destroy jDestroy
1139 #define jpeg_resync_to_restart jResyncRestart
1140 #endif /* NEED_SHORT_EXTERNAL_NAMES */
1141 
1142 
1143 /* Default error-management setup */
1144 EXTERN(struct jpeg_error_mgr *) jpeg_std_error
1145  JPP((struct jpeg_error_mgr * err));
1146 
1147 /* Initialization of JPEG compression objects.
1148  * jpeg_create_compress() and jpeg_create_decompress() are the exported
1149  * names that applications should call. These expand to calls on
1150  * jpeg_CreateCompress and jpeg_CreateDecompress with additional information
1151  * passed for version mismatch checking.
1152  * NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
1153  */
1154 #define jpeg_create_compress(cinfo) \
1155  jpeg_CreateCompress((cinfo), JPEG_LIB_VERSION, \
1156  (size_t) sizeof(struct jpeg_compress_struct))
1157 #define jpeg_create_decompress(cinfo) \
1158  jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
1159  (size_t) sizeof(struct jpeg_decompress_struct))
1160 EXTERN(void) jpeg_CreateCompress JPP((j_compress_ptr cinfo,
1161  int version, size_t structsize));
1162 EXTERN(void) jpeg_CreateDecompress JPP((j_decompress_ptr cinfo,
1163  int version, size_t structsize));
1164 /* Destruction of JPEG compression objects */
1165 EXTERN(void) jpeg_destroy_compress JPP((j_compress_ptr cinfo));
1166 EXTERN(void) jpeg_destroy_decompress JPP((j_decompress_ptr cinfo));
1167 
1168 /* Destruction of JPEG output surface */
1169 EXTERN(void) jpeg_destroy_surface JPP((void* surf));
1170 
1171 /* Standard data source and destination managers: stdio streams. */
1172 /* Caller is responsible for opening the file before and closing after. */
1173 EXTERN(void) jpeg_stdio_dest JPP((j_compress_ptr cinfo, FILE * outfile));
1174 EXTERN(void) jpeg_stdio_src JPP((j_decompress_ptr cinfo, FILE * infile));
1175 
1176 /* Data source and destination managers: memory buffers. */
1177 EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo,
1178  unsigned char ** outbuffer,
1179  size_t * outsize));
1180 EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo,
1181  const unsigned char * inbuffer,
1182  size_t insize));
1183 
1184 /* Default parameter setup for compression */
1185 EXTERN(void) jpeg_set_defaults JPP((j_compress_ptr cinfo));
1186 /* Compression parameter setup aids */
1187 EXTERN(void) jpeg_set_colorspace JPP((j_compress_ptr cinfo,
1189 EXTERN(void) jpeg_default_colorspace JPP((j_compress_ptr cinfo));
1190 EXTERN(void) jpeg_set_quality JPP((j_compress_ptr cinfo, int quality,
1191  boolean force_baseline));
1192 EXTERN(void) jpeg_set_linear_quality JPP((j_compress_ptr cinfo,
1194  boolean force_baseline));
1195 EXTERN(void) jpeg_default_qtables JPP((j_compress_ptr cinfo,
1196  boolean force_baseline));
1197 EXTERN(void) jpeg_add_quant_table JPP((j_compress_ptr cinfo, int which_tbl,
1198  const unsigned int *basic_table,
1199  int scale_factor,
1200  boolean force_baseline));
1201 EXTERN(int) jpeg_quality_scaling JPP((int quality));
1202 EXTERN(void) jpeg_simple_progression JPP((j_compress_ptr cinfo));
1203 EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
1204  boolean suppress));
1205 EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table JPP((j_common_ptr cinfo));
1206 EXTERN(JHUFF_TBL *) jpeg_alloc_huff_table JPP((j_common_ptr cinfo));
1207 EXTERN(JHUFF_TBL *) jpeg_std_huff_table JPP((j_common_ptr cinfo,
1208  boolean isDC, int tblno));
1209 
1210 /* Main entry points for compression */
1211 EXTERN(void) jpeg_start_compress JPP((j_compress_ptr cinfo,
1212  boolean write_all_tables));
1213 EXTERN(JDIMENSION) jpeg_write_scanlines JPP((j_compress_ptr cinfo,
1216 EXTERN(void) jpeg_finish_compress JPP((j_compress_ptr cinfo));
1217 
1218 /* Precalculate JPEG dimensions for current compression parameters. */
1219 EXTERN(void) jpeg_calc_jpeg_dimensions JPP((j_compress_ptr cinfo));
1220 
1221 /* Replaces jpeg_write_scanlines when writing raw downsampled data. */
1222 EXTERN(JDIMENSION) jpeg_write_raw_data JPP((j_compress_ptr cinfo,
1225 
1226 /* Write a special marker. See libjpeg.txt concerning safe usage. */
1227 EXTERN(void) jpeg_write_marker
1229  const JOCTET * dataptr, unsigned int datalen));
1230 /* Same, but piecemeal. */
1231 EXTERN(void) jpeg_write_m_header
1232  JPP((j_compress_ptr cinfo, int marker, unsigned int datalen));
1233 EXTERN(void) jpeg_write_m_byte
1234  JPP((j_compress_ptr cinfo, int val));
1235 
1236 /* Alternate compression function: just write an abbreviated table file */
1237 EXTERN(void) jpeg_write_tables JPP((j_compress_ptr cinfo));
1238 
1239 /* Decompression startup: read start of JPEG datastream to see what's there */
1240 EXTERN(int) jpeg_read_header JPP((j_decompress_ptr cinfo,
1241  boolean require_image));
1242 /* Return value is one of: */
1243 #define JPEG_SUSPENDED 0 /* Suspended due to lack of input data */
1244 #define JPEG_HEADER_OK 1 /* Found valid image datastream */
1245 #define JPEG_HEADER_TABLES_ONLY 2 /* Found valid table-specs-only datastream */
1246 /* If you pass require_image = TRUE (normal case), you need not check for
1247  * a TABLES_ONLY return code; an abbreviated file will cause an error exit.
1248  * JPEG_SUSPENDED is only possible if you use a data source module that can
1249  * give a suspension return (the stdio source module doesn't).
1250  */
1251 
1252 /* Main entry points for decompression */
1253 EXTERN(boolean) jpeg_start_decompress JPP((j_decompress_ptr cinfo));
1254 EXTERN(JDIMENSION) jpeg_read_scanlines JPP((j_decompress_ptr cinfo,
1257 EXTERN(boolean) jpeg_finish_decompress JPP((j_decompress_ptr cinfo));
1258 
1259 /* Replaces jpeg_read_scanlines when reading raw downsampled data. */
1260 EXTERN(JDIMENSION) jpeg_read_raw_data JPP((j_decompress_ptr cinfo,
1261  JSAMPIMAGE data,
1263 
1264 /* Additional entry points for buffered-image mode. */
1265 EXTERN(boolean) jpeg_has_multiple_scans JPP((j_decompress_ptr cinfo));
1266 EXTERN(boolean) jpeg_start_output JPP((j_decompress_ptr cinfo,
1268 EXTERN(boolean) jpeg_finish_output JPP((j_decompress_ptr cinfo));
1269 EXTERN(boolean) jpeg_input_complete JPP((j_decompress_ptr cinfo));
1270 EXTERN(void) jpeg_new_colormap JPP((j_decompress_ptr cinfo));
1271 EXTERN(int) jpeg_consume_input JPP((j_decompress_ptr cinfo));
1272 /* Return value is one of: */
1273 /* #define JPEG_SUSPENDED 0 Suspended due to lack of input data */
1274 #define JPEG_REACHED_SOS 1 /* Reached start of new scan */
1275 #define JPEG_REACHED_EOI 2 /* Reached end of image */
1276 #define JPEG_ROW_COMPLETED 3 /* Completed one iMCU row */
1277 #define JPEG_SCAN_COMPLETED 4 /* Completed last iMCU row of a scan */
1278 
1279 /* Precalculate output dimensions for current decompression parameters. */
1280 EXTERN(void) jpeg_core_output_dimensions JPP((j_decompress_ptr cinfo));
1281 EXTERN(void) jpeg_calc_output_dimensions JPP((j_decompress_ptr cinfo));
1282 
1283 /* Control saving of COM and APPn markers into marker_list. */
1284 EXTERN(void) jpeg_save_markers
1286  unsigned int length_limit));
1287 
1288 /* Install a special processing method for COM or APPn markers. */
1289 EXTERN(void) jpeg_set_marker_processor
1290  JPP((j_decompress_ptr cinfo, int marker_code,
1292 
1293 /* Read or write raw DCT coefficients --- useful for lossless transcoding. */
1294 EXTERN(jvirt_barray_ptr *) jpeg_read_coefficients JPP((j_decompress_ptr cinfo));
1295 EXTERN(void) jpeg_write_coefficients JPP((j_compress_ptr cinfo,
1297 EXTERN(void) jpeg_copy_critical_parameters JPP((j_decompress_ptr srcinfo,
1299 
1300 /* If you choose to abort compression or decompression before completing
1301  * jpeg_finish_(de)compress, then you need to clean up to release memory,
1302  * temporary files, etc. You can just call jpeg_destroy_(de)compress
1303  * if you're done with the JPEG object, but if you want to clean it up and
1304  * reuse it, call this:
1305  */
1306 EXTERN(void) jpeg_abort_compress JPP((j_compress_ptr cinfo));
1307 EXTERN(void) jpeg_abort_decompress JPP((j_decompress_ptr cinfo));
1308 
1309 /* Generic versions of jpeg_abort and jpeg_destroy that work on either
1310  * flavor of JPEG object. These may be more convenient in some places.
1311  */
1312 EXTERN(void) jpeg_abort JPP((j_common_ptr cinfo));
1313 EXTERN(void) jpeg_destroy JPP((j_common_ptr cinfo));
1314 
1315 /* Default restart-marker-resync procedure for use by data source modules */
1316 EXTERN(boolean) jpeg_resync_to_restart JPP((j_decompress_ptr cinfo,
1317  int desired));
1318 
1319 #ifdef TEGRA_ACCELERATE
1320 EXTERN(void) jpeg_set_hardware_acceleration_parameters_enc JPP((j_compress_ptr cinfo,
1322  unsigned int defaultBuffSize,
1323  unsigned int defaultWidth,
1324  unsigned int defaultHeight
1325  ));
1326 
1327 EXTERN(void) jpeg_set_hardware_acceleration_parameters_dec JPP((j_decompress_ptr cinfo,
1328  boolean hw_acceleration,
1329  unsigned int defaultBuffSize,
1330  unsigned int defaultWidth,
1331  unsigned int defaultHeight,
1333  boolean rgb565
1334  ));
1335 #endif
1336 
1337 
1338 /* These marker codes are exported since applications and data source modules
1339  * are likely to want to use them.
1340  */
1341 
1342 #define JPEG_RST0 0xD0 /* RST0 marker code */
1343 #define JPEG_EOI 0xD9 /* EOI marker code */
1344 #define JPEG_APP0 0xE0 /* APP0 marker code */
1345 #define JPEG_COM 0xFE /* COM marker code */
1346 
1347 
1348 /* If we have a brain-damaged compiler that emits warnings (or worse, errors)
1349  * for structure definitions that are never filled in, keep it quiet by
1350  * supplying dummy definitions for the various substructures.
1351  */
1352 
1353 #ifdef INCOMPLETE_TYPES_BROKEN
1354 #ifndef JPEG_INTERNALS /* will be defined in jpegint.h */
1355 struct jvirt_sarray_control { long dummy; };
1356 struct jvirt_barray_control { long dummy; };
1357 struct jpeg_comp_master { long dummy; };
1358 struct jpeg_c_main_controller { long dummy; };
1359 struct jpeg_c_prep_controller { long dummy; };
1360 struct jpeg_c_coef_controller { long dummy; };
1361 struct jpeg_marker_writer { long dummy; };
1362 struct jpeg_color_converter { long dummy; };
1363 struct jpeg_downsampler { long dummy; };
1364 struct jpeg_forward_dct { long dummy; };
1365 struct jpeg_entropy_encoder { long dummy; };
1366 struct jpeg_decomp_master { long dummy; };
1367 struct jpeg_d_main_controller { long dummy; };
1368 struct jpeg_d_coef_controller { long dummy; };
1369 struct jpeg_d_post_controller { long dummy; };
1370 struct jpeg_input_controller { long dummy; };
1371 struct jpeg_marker_reader { long dummy; };
1372 struct jpeg_entropy_decoder { long dummy; };
1373 struct jpeg_inverse_dct { long dummy; };
1374 struct jpeg_upsampler { long dummy; };
1375 struct jpeg_color_deconverter { long dummy; };
1376 struct jpeg_color_quantizer { long dummy; };
1377 #endif /* JPEG_INTERNALS */
1378 #endif /* INCOMPLETE_TYPES_BROKEN */
1379 
1380 
1381 /*
1382  * The JPEG library modules define JPEG_INTERNALS before including this file.
1383  * The internal structure declarations are read only when that is true.
1384  * Applications using the library should not include jpegint.h, but may wish
1385  * to include jerror.h.
1386  */
1387 
1388 #ifdef JPEG_INTERNALS
1389 #include "jpegint.h" /* fetch private declarations */
1390 #include "jerror.h" /* fetch error codes too */
1391 #endif
1392 
1393 #ifdef __cplusplus
1394 #ifndef DONT_USE_EXTERN_C
1395 }
1396 #endif
1397 #endif
1398 
1399 #endif /* JPEGLIB_H */
jpeg_compress_struct::pOutputSurface
unsigned char * pOutputSurface
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:606
defaultWidth
boolean unsigned int unsigned int defaultWidth
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1323
JDITHER_FS
@ JDITHER_FS
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:327
MAX_COMPS_IN_SCAN
#define MAX_COMPS_IN_SCAN
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:115
JCT_NONE
@ JCT_NONE
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:303
colorspace
J_COLOR_SPACE colorspace
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1188
jpeg_decompress_struct::v_pixel_row_cnt
unsigned int v_pixel_row_cnt
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:867
jpeg_marker_parser_method
boolean(* jpeg_marker_parser_method)(j_decompress_ptr cinfo)
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:879
marker
int marker
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1228
outbuffer
unsigned char ** outbuffer
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1178
JCS_BG_RGB
@ JCS_BG_RGB
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:296
jpeg_compress_struct::frame_to_encode
boolean frame_to_encode
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:604
JCS_YCCK
@ JCS_YCCK
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:286
jpeg_compress_struct::color_transform
J_COLOR_TRANSFORM color_transform
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:551
UINT8
short UINT8
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jmorecfg.h:134
JSAMPIMAGE
JSAMPARRAY * JSAMPIMAGE
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:73
val
int val
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1234
JCS_BG_YCC
@ JCS_BG_YCC
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:297
JDITHER_ORDERED
@ JDITHER_ORDERED
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:326
jpeg_common_fields
#define jpeg_common_fields
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:349
quality
int quality
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1190
force_baseline
int boolean force_baseline
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1191
J_DCT_METHOD
J_DCT_METHOD
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:248
which_tbl
int which_tbl
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1197
JSAMPIMAGE
JSAMPARRAY * JSAMPIMAGE
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:137
JSAMPLE
char JSAMPLE
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jmorecfg.h:79
JHUFF_TBL
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:105
jpeg_decompress_struct::b_surface_alloc_done
boolean b_surface_alloc_done
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:861
JOCTET
char JOCTET
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jmorecfg.h:109
jpeg_compress_struct::image_scale
boolean image_scale
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:632
max_lines
JSAMPARRAY JDIMENSION max_lines
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1256
jpeg_compress_struct::exif_data
boolean exif_data
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:628
jpeg_compress_struct::scaled_image_width
JDIMENSION scaled_image_width
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:633
outsize
unsigned char size_t * outsize
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1179
jpeg_marker_struct
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:205
j_common_ptr
struct jpeg_common_struct * j_common_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:442
JSAMPARRAY
JSAMPROW * JSAMPARRAY
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:136
infile
FILE * infile
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1174
tblno
boolean int tblno
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1208
JCS_GRAYSCALE
@ JCS_GRAYSCALE
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:282
jpeg_compress_struct::crop_rect
jpeg_rect_struct crop_rect
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:631
JCS_YCbCr
@ JCS_YCbCr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:284
NUM_QUANT_TBLS
#define NUM_QUANT_TBLS
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:112
JDCT_IFAST
@ JDCT_IFAST
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:311
jpeg_decompress_struct::b_frametodecode
boolean b_frametodecode
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:858
jpeg_error_mgr
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:722
JDCT_FLOAT
@ JDCT_FLOAT
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:312
j_mgr_ptr
struct jpeg_mgr * j_mgr_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:343
UINT16
unsigned int UINT16
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jmorecfg.h:143
desired
int desired
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1317
JCS_RGB
@ JCS_RGB
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:283
JDITHER_NONE
@ JDITHER_NONE
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:325
jmorecfg.h
jpeg_mgr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:332
jpeg_destination_mgr
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:792
EXTERN
EXTERN(struct jpeg_error_mgr *) jpeg_std_error JPP((struct jpeg_error_mgr *err))
jpeg_compress_struct::scaled_image_height
JDIMENSION scaled_image_height
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:634
JBLOCKARRAY
JBLOCKROW * JBLOCKARRAY
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:141
JBLOCKROW
JBLOCK * JBLOCKROW
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:76
scale_factor
int scale_factor
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1193
structsize
int size_t structsize
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1161
J_DITHER_MODE
J_DITHER_MODE
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:324
rgb565
boolean unsigned int unsigned int unsigned int unsigned int boolean rgb565
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1334
j_decompress_ptr
struct jpeg_decompress_struct * j_decompress_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:444
jpeg_scan_info
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:194
JBLOCKIMAGE
JBLOCKARRAY * JBLOCKIMAGE
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:142
jpeg_common_struct
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:284
J_DITHER_MODE
J_DITHER_MODE
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:263
require_image
boolean require_image
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1241
jpeg_compress_struct
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:299
JSAMPROW
JSAMPLE FAR * JSAMPROW
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:135
write_all_tables
boolean write_all_tables
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1212
jpeg_compress_struct::buf_size_to_encode
unsigned int buf_size_to_encode
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:605
J_COLOR_SPACE
J_COLOR_SPACE
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:280
JCOEFPTR
JCOEF FAR * JCOEFPTR
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:144
jpeg_mgr::mcu_type
unsigned int mcu_type
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:335
basic_table
int const unsigned int * basic_table
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1198
jpeg_compress_struct::header_len
boolean header_len
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:629
JCS_RGB_565
@ JCS_RGB_565
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:293
jvirt_barray_ptr
struct jvirt_barray_control * jvirt_barray_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1006
JDIMENSION
unsigned int JDIMENSION
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jmorecfg.h:196
JBLOCKROW
JBLOCK FAR * JBLOCKROW
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:140
data
JSAMPIMAGE data
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1223
jpeg_compress_struct::skip_SOI
boolean skip_SOI
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:627
scan_number
int scan_number
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1267
encode_params_t_
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:44
coef_arrays
jvirt_barray_ptr * coef_arrays
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1296
JMSG_STR_PARM_MAX
#define JMSG_STR_PARM_MAX
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:913
jpeg_rect_struct
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:447
isDC
boolean isDC
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1208
jpeg_memory_mgr
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:835
jvirt_sarray_ptr
struct jvirt_sarray_control * jvirt_sarray_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:831
jpeg_compress_struct::init_encMgr
boolean init_encMgr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:611
defaultBitstreamBuffSize
boolean unsigned int unsigned int unsigned int unsigned int defaultBitstreamBuffSize
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1332
JMETHOD
typedef JMETHOD(boolean, jpeg_marker_parser_method,(j_decompress_ptr cinfo))
JCS_UNKNOWN
@ JCS_UNKNOWN
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:281
defaultBuffSize
boolean unsigned int defaultBuffSize
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1322
outfile
FILE * outfile
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1173
hw_acceleration
boolean hw_acceleration
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1321
insize
const unsigned char size_t insize
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1182
dataptr
int const JOCTET * dataptr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1229
jpeg_decompress_struct::u_pixel_row_cnt
unsigned int u_pixel_row_cnt
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:866
dstinfo
j_compress_ptr dstinfo
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1298
marker_code
int marker_code
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1285
length_limit
int unsigned int length_limit
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1286
datalen
int const JOCTET unsigned int datalen
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1229
routine
int jpeg_marker_parser_method routine
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1291
D_MAX_BLOCKS_IN_MCU
#define D_MAX_BLOCKS_IN_MCU
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:126
jpeg_rect_struct::top
unsigned int top
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:448
JSAMPARRAY
JSAMPROW * JSAMPARRAY
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:72
JCS_RGBA_8888
@ JCS_RGBA_8888
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:292
std
Extensions to the C++ standard library.
Definition: includes/opentelemetry/nostd/string_view.h:212
J_COLOR_TRANSFORM
J_COLOR_TRANSFORM
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:302
J_COLOR_SPACE
J_COLOR_SPACE
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:219
jpeg_rect_struct::width
unsigned int width
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:449
FAR
#define FAR
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jmorecfg.h:233
num_lines
JSAMPARRAY JDIMENSION num_lines
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1215
jpeg_progress_mgr
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:780
jpeg_decompress_struct::pixel_row_cnt
unsigned int pixel_row_cnt
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:865
noreturn_t
void noreturn_t
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jmorecfg.h:285
JCS_CMYK
@ JCS_CMYK
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:285
NUM_HUFF_TBLS
#define NUM_HUFF_TBLS
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:113
jconfig.h
CHECK_
bool CHECK_(int e, int iLine, const char *szFile)
Definition: includes/nvll_osd_int.h:25
JBLOCKARRAY
JBLOCKROW * JBLOCKARRAY
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:77
inbuffer
const unsigned char * inbuffer
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1181
scanlines
JSAMPARRAY scanlines
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1214
JCOEF
short JCOEF
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jmorecfg.h:93
suppress
boolean suppress
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1204
jpeg_saved_marker_ptr
struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:267
defaultHeight
boolean unsigned int unsigned int unsigned int defaultHeight
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1325
JDCT_ISLOW
@ JDCT_ISLOW
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:310
jpeg_decompress_struct::color_transform
J_COLOR_TRANSFORM color_transform
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:791
C_MAX_BLOCKS_IN_MCU
#define C_MAX_BLOCKS_IN_MCU
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:124
J_DCT_METHOD
J_DCT_METHOD
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:309
jpeg_decompress_struct::input_frame_buf
unsigned char * input_frame_buf
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:864
JQUANT_TBL
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:88
jpeg_marker_struct::data
JOCTET FAR * data
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:274
jpeg_compress_struct::crop_region
boolean crop_region
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:630
DCTSIZE2
#define DCTSIZE2
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:111
JCT_SUBTRACT_GREEN
@ JCT_SUBTRACT_GREEN
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:304
jvirt_barray_ptr
struct jvirt_barray_control * jvirt_barray_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:832
jpeg_source_mgr
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:804
JPP
#define JPP(arglist)
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1071
j_compress_ptr
struct jpeg_compress_struct * j_compress_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:443
JBLOCK
JCOEF JBLOCK[DCTSIZE2]
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:139
JSAMPROW
JSAMPLE * JSAMPROW
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:71
jpeg_decompress_struct
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:474
jpeg_component_info
Definition: sources/libs/nvll_batch_jpeg_encode/oss/jpeglib.h:121
version
int version
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1161
NUM_ARITH_TBLS
#define NUM_ARITH_TBLS
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:114
ds3d::v2xinfer::format
static std::string format(const char *fmt,...)
Definition: sources/libs/ds3d/inference_custom_lib/ds3d_v2x_infer_custom_preprocess/tensor.hpp:31
jvirt_sarray_ptr
struct jvirt_sarray_control * jvirt_sarray_ptr
Definition: sources/libs/nvll_batch_jpeg_encode/tegra/jpeglib.h:1005