📄 jdmaster.txt
字号:
00004c 4620 MOV r0,r4 ;531
00004e e8bd4070 POP {r4-r6,lr} ;531
000052 4708 BX r1 ;531
;;;533
ENDP
AREA ||i.master_selection||, CODE, READONLY, ALIGN=1
master_selection PROC
;;;287 LOCAL(void)
;;;288 master_selection (j_decompress_ptr cinfo)
000000 e92d41f0 PUSH {r4-r8,lr}
;;;289 {
000004 4604 MOV r4,r0
;;;290 my_master_ptr master = (my_master_ptr) cinfo->master;
;;;291 boolean use_c_buffer;
;;;292 long samplesperrow;
;;;293 JDIMENSION jd_samplesperrow;
;;;294
;;;295 /* Initialize dimensions and other stuff */
;;;296 jpeg_calc_output_dimensions(cinfo);
000006 f8d051a4 LDR r5,[r0,#0x1a4]
00000a f7fffffe BL jpeg_calc_output_dimensions
00000e 6860 LDR r0,[r4,#4]
000010 f44f62b0 MOV r2,#0x580
000014 6803 LDR r3,[r0,#0]
000016 2101 MOVS r1,#1
000018 4620 MOV r0,r4
00001a 4798 BLX r3
00001c f5007680 ADD r6,r0,#0x100
000020 f44f7180 MOV r1,#0x100
000024 f8c46144 STR r6,[r4,#0x144]
000028 f7fffffe BL __aeabi_memclr
00002c 2100 MOVS r1,#0
|L5.46|
00002e 5471 STRB r1,[r6,r1]
000030 1c49 ADDS r1,r1,#1
000032 29ff CMP r1,#0xff
000034 ddfb BLE |L5.46|
000036 3680 ADDS r6,r6,#0x80
000038 2180 MOVS r1,#0x80
00003a 20ff MOVS r0,#0xff
00003c 008a LSLS r2,r1,#2
|L5.62|
00003e 5470 STRB r0,[r6,r1]
000040 1c49 ADDS r1,r1,#1
000042 4291 CMP r1,r2
000044 dbfb BLT |L5.62|
000046 f44f71c0 MOV r1,#0x180
00004a f5067000 ADD r0,r6,#0x200
00004e f7fffffe BL __aeabi_memclr
000052 2280 MOVS r2,#0x80
000054 f5067060 ADD r0,r6,#0x380
000058 f8d41144 LDR r1,[r4,#0x144]
00005c f7fffffe BL __aeabi_memcpy
;;;297 prepare_range_limit_table(cinfo);
;;;298
;;;299 /* Width of an output scanline must be representable as JDIMENSION. */
;;;300 samplesperrow = (long) cinfo->output_width * (long) cinfo->out_color_components;
;;;301 jd_samplesperrow = (JDIMENSION) samplesperrow;
;;;302 if ((long) jd_samplesperrow != samplesperrow)
;;;303 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
;;;304
;;;305 /* Initialize my private state */
;;;306 master->pass_number = 0;
000060 2700 MOVS r7,#0
;;;307 master->using_merged_upsample = use_merged_upsample(cinfo);
000062 4620 MOV r0,r4
000064 60ef STR r7,[r5,#0xc]
000066 f7fffffe BL use_merged_upsample
;;;308
;;;309 /* Color quantizer selection */
;;;310 master->quantizer_1pass = NULL;
;;;311 master->quantizer_2pass = NULL;
00006a e9c50704 STRD r0,r7,[r5,#0x10]
;;;312 /* No mode changes if not using buffered-image mode. */
;;;313 if (! cinfo->quantize_colors || ! cinfo->buffered_image) {
00006e 61af STR r7,[r5,#0x18]
000070 6d60 LDR r0,[r4,#0x54]
000072 2601 MOVS r6,#1
000074 b108 CBZ r0,|L5.122|
000076 6c21 LDR r1,[r4,#0x40]
000078 b919 CBNZ r1,|L5.130|
|L5.122|
;;;314 cinfo->enable_1pass_quant = FALSE;
;;;315 cinfo->enable_external_quant = FALSE;
00007a 6667 STR r7,[r4,#0x64]
;;;316 cinfo->enable_2pass_quant = FALSE;
00007c 66a7 STR r7,[r4,#0x68]
;;;317 }
;;;318 if (cinfo->quantize_colors) {
00007e 66e7 STR r7,[r4,#0x6c]
000080 b358 CBZ r0,|L5.218|
|L5.130|
;;;319 if (cinfo->raw_data_out)
000082 6c60 LDR r0,[r4,#0x44]
000084 b130 CBZ r0,|L5.148|
;;;320 ERREXIT(cinfo, JERR_NOTIMPL);
000086 6821 LDR r1,[r4,#0]
000088 202f MOVS r0,#0x2f
00008a 6148 STR r0,[r1,#0x14]
00008c 6820 LDR r0,[r4,#0]
00008e 6801 LDR r1,[r0,#0]
000090 4620 MOV r0,r4
000092 4788 BLX r1
|L5.148|
;;;321 /* 2-pass quantizer only works in 3-component color space. */
;;;322 if (cinfo->out_color_components != 3) {
000094 6fa0 LDR r0,[r4,#0x78]
000096 2803 CMP r0,#3
000098 d005 BEQ |L5.166|
;;;323 cinfo->enable_1pass_quant = TRUE;
;;;324 cinfo->enable_external_quant = FALSE;
;;;325 cinfo->enable_2pass_quant = FALSE;
00009a e9c46719 STRD r6,r7,[r4,#0x64]
;;;326 cinfo->colormap = NULL;
00009e 66e7 STR r7,[r4,#0x6c]
0000a0 f8c47088 STR r7,[r4,#0x88]
0000a4 e009 B |L5.186|
|L5.166|
;;;327 } else if (cinfo->colormap != NULL) {
0000a6 f8d40088 LDR r0,[r4,#0x88]
0000aa b108 CBZ r0,|L5.176|
;;;328 cinfo->enable_external_quant = TRUE;
0000ac 66a6 STR r6,[r4,#0x68]
0000ae e002 B |L5.182|
|L5.176|
;;;329 } else if (cinfo->two_pass_quantize) {
0000b0 6de0 LDR r0,[r4,#0x5c]
0000b2 b1d8 CBZ r0,|L5.236|
;;;330 cinfo->enable_2pass_quant = TRUE;
0000b4 66e6 STR r6,[r4,#0x6c]
|L5.182|
;;;331 } else {
;;;332 cinfo->enable_1pass_quant = TRUE;
;;;333 }
;;;334
;;;335 if (cinfo->enable_1pass_quant) {
0000b6 6e60 LDR r0,[r4,#0x64]
0000b8 b128 CBZ r0,|L5.198|
|L5.186|
;;;336 #ifdef QUANT_1PASS_SUPPORTED
;;;337 jinit_1pass_quantizer(cinfo);
0000ba 4620 MOV r0,r4
0000bc f7fffffe BL jinit_1pass_quantizer
;;;338 master->quantizer_1pass = cinfo->cquantize;
0000c0 f8d401cc LDR r0,[r4,#0x1cc]
0000c4 6168 STR r0,[r5,#0x14]
|L5.198|
;;;339 #else
;;;340 ERREXIT(cinfo, JERR_NOT_COMPILED);
;;;341 #endif
;;;342 }
;;;343
;;;344 /* We use the 2-pass code to map to external colormaps. */
;;;345 if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
0000c6 6ee0 LDR r0,[r4,#0x6c]
0000c8 b908 CBNZ r0,|L5.206|
0000ca 6ea0 LDR r0,[r4,#0x68]
0000cc b128 CBZ r0,|L5.218|
|L5.206|
;;;346 #ifdef QUANT_2PASS_SUPPORTED
;;;347 jinit_2pass_quantizer(cinfo);
0000ce 4620 MOV r0,r4
0000d0 f7fffffe BL jinit_2pass_quantizer
;;;348 master->quantizer_2pass = cinfo->cquantize;
0000d4 f8d401cc LDR r0,[r4,#0x1cc]
0000d8 61a8 STR r0,[r5,#0x18]
|L5.218|
;;;349 #else
;;;350 ERREXIT(cinfo, JERR_NOT_COMPILED);
;;;351 #endif
;;;352 }
;;;353 /* If both quantizers are initialized, the 2-pass one is left active;
;;;354 * this is necessary for starting with quantization to an external map.
;;;355 */
;;;356 }
;;;357
;;;358 /* Post-processing: in particular, color conversion first */
;;;359 if (! cinfo->raw_data_out) {
0000da 6c60 LDR r0,[r4,#0x44]
0000dc b988 CBNZ r0,|L5.258|
;;;360 if (master->using_merged_upsample) {
0000de 6928 LDR r0,[r5,#0x10]
0000e0 2800 CMP r0,#0
;;;361 #ifdef UPSAMPLE_MERGING_SUPPORTED
;;;362 jinit_merged_upsampler(cinfo); /* does color conversion too */
0000e2 4620 MOV r0,r4
0000e4 d004 BEQ |L5.240|
0000e6 f7fffffe BL jinit_merged_upsampler
0000ea e006 B |L5.250|
|L5.236|
0000ec 6666 STR r6,[r4,#0x64] ;332
0000ee e7e4 B |L5.186|
|L5.240|
;;;363 #else
;;;364 ERREXIT(cinfo, JERR_NOT_COMPILED);
;;;365 #endif
;;;366 } else {
;;;367 jinit_color_deconverter(cinfo);
0000f0 f7fffffe BL jinit_color_deconverter
;;;368 jinit_upsampler(cinfo);
0000f4 4620 MOV r0,r4
0000f6 f7fffffe BL jinit_upsampler
|L5.250|
;;;369 }
;;;370 jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
0000fa 4620 MOV r0,r4
0000fc 6ee1 LDR r1,[r4,#0x6c]
0000fe f7fffffe BL jinit_d_post_controller
|L5.258|
;;;371 }
;;;372 /* Inverse DCT */
;;;373 jinit_inverse_dct(cinfo);
000102 4620 MOV r0,r4
000104 f7fffffe BL jinit_inverse_dct
;;;374 /* Entropy decoding: either Huffman or arithmetic coding. */
;;;375 if (cinfo->arith_code) {
000108 f8d400e0 LDR r0,[r4,#0xe0]
00010c b130 CBZ r0,|L5.284|
;;;376 ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
00010e 6820 LDR r0,[r4,#0]
000110 6146 STR r6,[r0,#0x14]
000112 6820 LDR r0,[r4,#0]
000114 6801 LDR r1,[r0,#0]
000116 4620 MOV r0,r4
000118 4788 BLX r1
00011a e009 B |L5.304|
|L5.284|
;;;377 } else {
;;;378 if (cinfo->progressive_mode) {
00011c f8d400dc LDR r0,[r4,#0xdc]
000120 2800 CMP r0,#0
;;;379 #ifdef D_PROGRESSIVE_SUPPORTED
;;;380 jinit_phuff_decoder(cinfo);
000122 4620 MOV r0,r4
000124 d002 BEQ |L5.300|
000126 f7fffffe BL jinit_phuff_decoder
00012a e001 B |L5.304|
|L5.300|
;;;381 #else
;;;382 ERREXIT(cinfo, JERR_NOT_COMPILED);
;;;383 #endif
;;;384 } else
;;;385 jinit_huff_decoder(cinfo);
00012c f7fffffe BL jinit_huff_decoder
|L5.304|
;;;386 }
;;;387
;;;388 /* Initialize principal buffer controllers. */
;;;389 use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;
000130 f8d401b4 LDR r0,[r4,#0x1b4]
000134 4631 MOV r1,r6
000136 6900 LDR r0,[r0,#0x10]
000138 b910 CBNZ r0,|L5.320|
00013a 6c20 LDR r0,[r4,#0x40]
00013c b900 CBNZ r0,|L5.320|
00013e 2100 MOVS r1,#0
|L5.320|
;;;390 jinit_d_coef_controller(cinfo, use_c_buffer);
000140 4620 MOV r0,r4
000142 f7fffffe BL jinit_d_coef_controller
;;;391
;;;392 if (! cinfo->raw_data_out)
000146 6c60 LDR r0,[r4,#0x44]
000148 b918 CBNZ r0,|L5.338|
;;;393 jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
00014a 2100 MOVS r1,#0
00014c 4620 MOV r0,r4
00014e f7fffffe BL jinit_d_main_controller
|L5.338|
;;;394
;;;395 /* We can now tell the memory manager to allocate virtual arrays. */
;;;396 (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo);
000152 6860 LDR r0,[r4,#4]
000154 6981 LDR r1,[r0,#0x18]
000156 4620 MOV r0,r4
000158 4788 BLX r1
;;;397
;;;398 /* Initialize input side of decompressor to consume first scan. */
;;;399 (*cinfo->inputctl->start_input_pass) (cinfo);
00015a f8d401b4 LDR r0,[r4,#0x1b4]
00015e 6881 LDR r1,[r0,#8]
000160 4620 MOV r0,r4
000162 4788 BLX r1
;;;400
;;;401 #ifdef D_MULTISCAN_FILES_SUPPORTED
;;;402 /* If jpeg_start_decompress will read the whole file, initialize
;;;403 * progress monitoring appropriately. The input step is counted
;;;404 * as one pass.
;;;405 */
;;;406 if (cinfo->progress != NULL && ! cinfo->buffered_image &&
000164 68a1 LDR r1,[r4,#8]
000166 2900 CMP r1,#0
000168 d021 BEQ |L5.430|
00016a 6c20 LDR r0,[r4,#0x40]
00016c 2800 CMP r0,#0
00016e d11e BNE |L5.430|
;;;407 cinfo->inputctl->has_multiple_scans) {
000170 f8d401b4 LDR r0,[r4,#0x1b4]
000174 6900 LDR r0,[r0,#0x10]
000176 2800 CMP r0,#0
000178 d019 BEQ |L5.430|
;;;408 int nscans;
;;;409 /* Estimate number of scans to set pass_limit. */
;;;410 if (cinfo->progressive_mode) {
00017a f8d400dc LDR r0,[r4,#0xdc]
00017e 2800 CMP r0,#0
000180 6a60 LDR r0,[r4,#0x24]
000182 d003 BEQ |L5.396|
;;;411 /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
;;;412 nscans = 2 + 3 * cinfo->num_components;
000184 eb000040 ADD r0,r0,r0,LSL #1
000188 1c80 ADDS r0,r0,#2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -