bindct_revisions.doc~
来自「JPEG Image compression using IJG standar」· DOC~ 代码 · 共 120 行
DOC~
120 行
1: cjpeg.c parse_switches, added options for bindct.2: jpeglib.h Add bindct enum options in J_DCT_METHOD.3: jmorecfg.h Define DCT_BIN_A1_SUPPORTED etc.4: jcdctmgr.c: jinit_forward_dct: added options for bindct.5: Added new files: jfdct_bin_a1.c jfdct_bin_b1.c : not completed. Check minus sign! jfdct_bin_c1.c : not completed. Check minus sign ! jfdct_bin_l1.c6. jdct.h Declare functions jfdct_bin_a1, jfdct_bin_b1, jfdct_bin_c1, jfdct_bin_l1. and jpeg_idct_bin_a1 etc. Note in jdct.h: * The DCT inputs are expected to be signed (range +-CENTERJSAMPLE). * The DCT outputs are returned scaled up by a factor of 8; they therefore * have a range of +-8K for 8-bit data, +-128K for 12-bit data. This * convention improves accuracy in integer implementations and saves some * work in floating-point ones. * Quantization of the output coefficients is done by jcdctmgr.c. */Is this scaling by 8 related to the scaling of Q table by 8 in jcdctmgr.c (for JDCT_ISLOW)?Then the scaling in DCT coef and Q tabel cancel out with each other.In jddctmgr.c, the dequantization table is the original one, without scling by 8. This justifies the above conclusion.7. Files involved in forward transform: 1. cjpeg.c calls jpeg_write_scanlines(), which is defined in jcapistd.c; 2. In jcapistd.c, jpeg_wtite_scanlines() call (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); which points to the process_data_simple_main() in jcmainct.c; 3. The jcmainct.c is the main buffer controller for compression. In process_data_simple_main(), it call (*cinfo->prep->pre_process_data), defined in jcprepct.c, which handles color conversion, downsamplign etc. It then check whether 8 rows have been copied to the buffer, if no, it returns to the cjpeg.c to call write_scanlines again. If yes, it calls (*cinfo->coef->compress_data) (cinfo, main->buffer), this points to the function compress_data() in jccoefct.c. 4. In the compress_data() of jccoefct.c, (*cinfo->fdct->forward_DCT) is called, which is defined in jcdctmgr.c. 5. In jcdctmgr.c, the function forward_DCT() does the followings: - subtract each pixel by 128. - call do (*do_dct) (workspace), which points to the actual forward DCT code. - Quantize the DCT coefficients./************************************************ * * Decoder * ************************************************ */jddctmgr.c :/* The current scaled-IDCT routines require ISLOW-style multiplier tables, * so be sure to compile that code if either ISLOW or SCALING is requested. */#ifdef DCT_ISLOW_SUPPORTED#define PROVIDE_ISLOW_TABLES#else#ifdef IDCT_SCALING_SUPPORTED#define PROVIDE_ISLOW_TABLES#endif#endifWhat does this mean?for JDCT_ISLOW:Define the q table as type ISLOW_MULT_TYPE: ISLOW_MULT_TYPE * ismtbl = (ISLOW_MULT_TYPE *) compptr->dct_table;The reason is discussed in jidctint.c.Check this, do we need new type for binDCT?1. djpeg.c call (void) jpeg_start_decompress(&cinfo); start_input_pass in jdinput.c calls latech_quant_tables. latch_quant_tables in jdinput.c is called to get Q table. but where to scale it according to the Quality factor? and jpeg_read_scanlines, both are defined in jdapistd.c.2. In jdapistd.c, the jpeg_read_scanlines calls (*cinfo->main->process_data), which points to the process_data_simple_main in jdmainct.c,3: The jdmainct.c is the main buffer controller for decompression. In the process_data_simple_main, it calls (*cinfo->coef->decompress_data), which points to decompress_onepass, which is defined in jdcoefct.c.4. In jdcoefct.c, the (*cinfo->entropy->decode_mcu) is called, which
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?