|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
29 #ifndef JCONFIG_INCLUDED
44 #include "cuda_runtime.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;
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"; \
64 #define nvjpegCheckError(call) { \
65 nvjpegStatus_t e = (call); \
66 if(e != NVJPEG_STATUS_SUCCESS) { \
67 std::cout << "nvjpeg failure: error #" << e << "\n"; \
73 std::string input_dir;
74 std::string output_dir;
76 std::string subsampling;
85 #ifndef DONT_USE_EXTERN_C
94 #ifndef JPEG_LIB_VERSION
95 #define JPEG_LIB_VERSION 90
97 #ifndef JPEG_LIB_VERSION_MAJOR
98 #define JPEG_LIB_VERSION_MAJOR 9
100 #ifndef JPEG_LIB_VERSION_MINOR
101 #define JPEG_LIB_VERSION_MINOR 6
112 #define NUM_QUANT_TBLS 4
113 #define NUM_HUFF_TBLS 4
114 #define NUM_ARITH_TBLS 16
115 #define MAX_COMPS_IN_SCAN 4
116 #define MAX_SAMP_FACTOR 4
124 #define C_MAX_BLOCKS_IN_MCU 10
125 #ifndef D_MAX_BLOCKS_IN_MCU
126 #define D_MAX_BLOCKS_IN_MCU 10
215 int DCT_h_scaled_size;
216 int DCT_v_scaled_size;
234 boolean component_needed;
241 int MCU_sample_width;
272 unsigned int original_length;
273 unsigned int data_length;
291 #ifdef TEGRA_ACCELERATE
316 #define JDCT_DEFAULT JDCT_ISLOW
319 #define JDCT_FASTEST JDCT_IFAST
331 #ifdef TEGRA_ACCELERATE
333 unsigned char *buff[3];
334 unsigned int pitch[3];
348 #ifdef TEGRA_ACCELERATE
349 #define jpeg_common_fields \
350 struct jpeg_error_mgr * err; \
351 struct jpeg_memory_mgr * mem; \
352 struct jpeg_progress_mgr * progress; \
354 void * client_data; \
355 boolean is_decompressor; \
356 boolean tegra_acceleration; \
357 boolean mjpeg_decode; \
358 boolean buffer_in_use; \
359 unsigned int initWidth; \
360 void *nvbufsurfptr; \
361 unsigned int initHeight; \
362 unsigned int initBitstreamBuffer; \
363 unsigned int inputBuffSize; \
364 unsigned int outputBuffSize; \
366 boolean IsVendorbuf; \
367 unsigned char *pVendor_buf; \
368 unsigned int Vendorbuf_Size; \
371 boolean bMeasure_ImageProcessTime; \
373 unsigned int quality; \
374 int dec_out_mem_type; \
375 int enc_in_mem_type; \
376 boolean dec_use_external_buffer; \
377 unsigned char reserved[256]
379 #define jpeg_common_fields \
380 struct jpeg_error_mgr * err; \
381 struct jpeg_memory_mgr * mem; \
382 struct jpeg_progress_mgr * progress; \
383 void * client_data; \
384 boolean is_decompressor; \
386 unsigned int inputBuffSize; \
387 unsigned char *start_of_data; \
388 boolean IsVendorbuf; \
389 unsigned char *pVendor_buf; \
390 unsigned int Vendorbuf_Size; \
391 unsigned int outputBuffSize; \
395 unsigned char *alpha; \
396 unsigned int quality; \
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; \
409 vector<size_t> file_len; \
410 vector<int> widths; \
411 vector<int> heights; \
412 vector<nvjpegImage_t> iout; \
413 vector<nvjpegImage_t> isz; \
416 cudaStream_t cuda_stream; \
417 NvBufSurface *surf1; \
418 unsigned int nvjpegdec_init; \
419 boolean nvjpegenc_init;
421 #define jpeg_common_fields \
422 struct jpeg_error_mgr * err; \
423 struct jpeg_memory_mgr * mem; \
424 struct jpeg_progress_mgr * progress; \
425 void * client_data; \
426 boolean is_decompressor; \
446 #ifdef TEGRA_ACCELERATE
468 int input_components;
481 unsigned int scale_num, scale_denom;
523 boolean optimize_coding;
524 boolean CCIR601_sampling;
525 boolean do_fancy_downsampling;
526 int smoothing_factor;
534 unsigned int restart_interval;
539 boolean write_JFIF_header;
540 UINT8 JFIF_major_version;
541 UINT8 JFIF_minor_version;
549 boolean write_Adobe_marker;
568 boolean progressive_mode;
569 int max_h_samp_factor;
570 int max_v_samp_factor;
572 int min_DCT_h_scaled_size;
573 int min_DCT_v_scaled_size;
601 const int * natural_order;
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;
625 int script_space_size;
626 #ifdef TEGRA_ACCELERATE
662 unsigned int scale_num, scale_denom;
666 boolean buffered_image;
667 boolean raw_data_out;
670 boolean do_fancy_upsampling;
671 boolean do_block_smoothing;
673 boolean quantize_colors;
676 boolean two_pass_quantize;
677 int desired_number_of_colors;
679 boolean enable_1pass_quant;
680 boolean enable_external_quant;
681 boolean enable_2pass_quant;
691 int out_color_components;
692 int output_components;
696 int rec_outbuf_height;
708 int actual_number_of_colors;
724 int input_scan_number;
731 int output_scan_number;
769 boolean progressive_mode;
776 unsigned int restart_interval;
781 boolean saw_JFIF_marker;
783 UINT8 JFIF_major_version;
784 UINT8 JFIF_minor_version;
788 boolean saw_Adobe_marker;
789 UINT8 Adobe_transform;
794 boolean CCIR601_sampling;
809 int max_h_samp_factor;
810 int max_v_samp_factor;
812 int min_DCT_h_scaled_size;
813 int min_DCT_v_scaled_size;
848 const int * natural_order;
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;
905 #define JMSG_LENGTH_MAX 200
913 #define JMSG_STR_PARM_MAX 80
941 const char *
const * jpeg_message_table;
942 int last_jpeg_message;
946 const char *
const * addon_message_table;
947 int first_addon_message;
948 int last_addon_message;
959 int completed_passes;
967 JOCTET * next_output_byte;
968 size_t free_in_buffer;
979 const JOCTET * next_input_byte;
980 size_t bytes_in_buffer;
1001 #define JPOOL_PERMANENT 0
1002 #define JPOOL_IMAGE 1
1003 #define JPOOL_NUMPOOLS 2
1012 size_t sizeofobject));
1014 size_t sizeofobject));
1052 long max_memory_to_use;
1055 long max_alloc_chunk;
1070 #ifdef HAVE_PROTOTYPES
1071 #define JPP(arglist) arglist
1073 #define JPP(arglist) ()
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
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))
1169 EXTERN(
void) jpeg_destroy_surface
JPP((
void* surf));
1227 EXTERN(
void) jpeg_write_marker
1231 EXTERN(
void) jpeg_write_m_header
1233 EXTERN(
void) jpeg_write_m_byte
1243 #define JPEG_SUSPENDED 0
1244 #define JPEG_HEADER_OK 1
1245 #define JPEG_HEADER_TABLES_ONLY 2
1274 #define JPEG_REACHED_SOS 1
1275 #define JPEG_REACHED_EOI 2
1276 #define JPEG_ROW_COMPLETED 3
1277 #define JPEG_SCAN_COMPLETED 4
1284 EXTERN(
void) jpeg_save_markers
1289 EXTERN(
void) jpeg_set_marker_processor
1319 #ifdef TEGRA_ACCELERATE
1342 #define JPEG_RST0 0xD0
1343 #define JPEG_EOI 0xD9
1344 #define JPEG_APP0 0xE0
1345 #define JPEG_COM 0xFE
1353 #ifdef INCOMPLETE_TYPES_BROKEN
1354 #ifndef JPEG_INTERNALS
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; };
1388 #ifdef JPEG_INTERNALS
1389 #include "jpegint.h"
1394 #ifndef DONT_USE_EXTERN_C
unsigned char * pOutputSurface
boolean unsigned int unsigned int defaultWidth
#define MAX_COMPS_IN_SCAN
unsigned int v_pixel_row_cnt
boolean(* jpeg_marker_parser_method)(j_decompress_ptr cinfo)
unsigned char ** outbuffer
J_COLOR_TRANSFORM color_transform
#define jpeg_common_fields
int boolean force_baseline
boolean b_surface_alloc_done
JSAMPARRAY JDIMENSION max_lines
JDIMENSION scaled_image_width
unsigned char size_t * outsize
struct jpeg_common_struct * j_common_ptr
jpeg_rect_struct crop_rect
struct jpeg_mgr * j_mgr_ptr
EXTERN(struct jpeg_error_mgr *) jpeg_std_error JPP((struct jpeg_error_mgr *err))
JDIMENSION scaled_image_height
boolean unsigned int unsigned int unsigned int unsigned int boolean rgb565
struct jpeg_decompress_struct * j_decompress_ptr
JBLOCKARRAY * JBLOCKIMAGE
unsigned int buf_size_to_encode
int const unsigned int * basic_table
struct jvirt_barray_control * jvirt_barray_ptr
jvirt_barray_ptr * coef_arrays
#define JMSG_STR_PARM_MAX
struct jvirt_sarray_control * jvirt_sarray_ptr
boolean unsigned int unsigned int unsigned int unsigned int defaultBitstreamBuffSize
typedef JMETHOD(boolean, jpeg_marker_parser_method,(j_decompress_ptr cinfo))
boolean unsigned int defaultBuffSize
const unsigned char size_t insize
int const JOCTET * dataptr
unsigned int u_pixel_row_cnt
int unsigned int length_limit
int const JOCTET unsigned int datalen
int jpeg_marker_parser_method routine
#define D_MAX_BLOCKS_IN_MCU
Extensions to the C++ standard library.
JSAMPARRAY JDIMENSION num_lines
unsigned int pixel_row_cnt
bool CHECK_(int e, int iLine, const char *szFile)
const unsigned char * inbuffer
struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr
boolean unsigned int unsigned int unsigned int defaultHeight
J_COLOR_TRANSFORM color_transform
#define C_MAX_BLOCKS_IN_MCU
unsigned char * input_frame_buf
struct jvirt_barray_control * jvirt_barray_ptr
struct jpeg_compress_struct * j_compress_ptr
static std::string format(const char *fmt,...)
struct jvirt_sarray_control * jvirt_sarray_ptr