📄 jdhuff.txt
字号:
000218 e00f B |L1.570|
|L1.538|
00021a f1a20008 SUB r0,r2,#8
00021e fa41f000 ASR r0,r1,r0
000222 b2c0 UXTB r0,r0
000224 eb070380 ADD r3,r7,r0,LSL #2
000228 f8d33090 LDR r3,[r3,#0x90]
00022c b123 CBZ r3,|L1.568|
00022e 4438 ADD r0,r0,r7
000230 1ad2 SUBS r2,r2,r3
000232 f8900490 LDRB r0,[r0,#0x490]
000236 e009 B |L1.588|
|L1.568|
000238 2309 MOVS r3,#9
|L1.570|
00023a 9300 STR r3,[sp,#0]
00023c 463b MOV r3,r7
00023e a805 ADD r0,sp,#0x14
000240 f7fffffe BL jpeg_huff_decode
000244 2800 CMP r0,#0
000246 db0f BLT |L1.616|
000248 e9dd1207 LDRD r1,r2,[sp,#0x1c]
|L1.588|
;;;600
;;;601 r = s >> 4;
00024c 1103 ASRS r3,r0,#4
;;;602 s &= 15;
00024e f010060f ANDS r6,r0,#0xf
;;;603
;;;604 if (s) {
000252 d011 BEQ |L1.632|
;;;605 k += r;
000254 441c ADD r4,r4,r3
;;;606 CHECK_BIT_BUFFER(br_state, s, return FALSE);
000256 42b2 CMP r2,r6
000258 da0c BGE |L1.628|
00025a 4633 MOV r3,r6
00025c a805 ADD r0,sp,#0x14
00025e f7fffffe BL jpeg_fill_bit_buffer
000262 e000 B |L1.614|
|L1.612|
000264 e000 B |L1.616|
|L1.614|
000266 b918 CBNZ r0,|L1.624|
|L1.616|
000268 2000 MOVS r0,#0
|L1.618|
;;;607 DROP_BITS(s);
;;;608 } else {
;;;609 if (r != 15)
;;;610 break;
;;;611 k += 15;
;;;612 }
;;;613 }
;;;614
;;;615 }
;;;616 }
;;;617
;;;618 /* Completed MCU, so update state */
;;;619 BITREAD_SAVE_STATE(cinfo,entropy->bitstate);
;;;620 ASSIGN_STATE(entropy->saved, state);
;;;621 }
;;;622
;;;623 /* Account for restart interval (no-op if not using restarts) */
;;;624 entropy->restarts_to_go--;
;;;625
;;;626 return TRUE;
;;;627 }
00026a b00d ADD sp,sp,#0x34
00026c e8bd8ff0 POP {r4-r11,pc}
|L1.624|
000270 e9dd1207 LDRD r1,r2,[sp,#0x1c] ;606
|L1.628|
000274 1b92 SUBS r2,r2,r6 ;607
000276 e002 B |L1.638|
|L1.632|
000278 2b0f CMP r3,#0xf ;609
00027a d103 BNE |L1.644|
00027c 340f ADDS r4,r4,#0xf ;611
|L1.638|
00027e 1c64 ADDS r4,r4,#1 ;598
000280 2c40 CMP r4,#0x40 ;598
000282 dbbd BLT |L1.512|
|L1.644|
000284 f1080801 ADD r8,r8,#1 ;542
|L1.648|
000288 f8d50164 LDR r0,[r5,#0x164] ;542
00028c 4540 CMP r0,r8 ;542
00028e f73faeff BGT |L1.144|
000292 69ab LDR r3,[r5,#0x18] ;619
000294 9805 LDR r0,[sp,#0x14] ;619
000296 6018 STR r0,[r3,#0] ;619
000298 69ab LDR r3,[r5,#0x18] ;619
00029a 9806 LDR r0,[sp,#0x18] ;619
00029c 6058 STR r0,[r3,#4] ;619
00029e e9c91203 STRD r1,r2,[r9,#0xc] ;619
0002a2 ae01 ADD r6,sp,#4 ;620
0002a4 ce1e LDM r6!,{r1-r4} ;619
0002a6 980a LDR r0,[sp,#0x28] ;619
0002a8 c01e STM r0!,{r1-r4} ;619
|L1.682|
0002aa f8d90024 LDR r0,[r9,#0x24] ;624
0002ae 1e40 SUBS r0,r0,#1 ;624
0002b0 f8c90024 STR r0,[r9,#0x24] ;626
0002b4 2001 MOVS r0,#1 ;626
0002b6 e7d8 B |L1.618|
;;;628
ENDP
|L1.696|
DCD ||.constdata||
|L1.700|
DCD jpeg_natural_order
AREA ||i.jinit_huff_decoder||, CODE, READONLY, ALIGN=2
jinit_huff_decoder PROC
;;;634 GLOBAL(void)
;;;635 jinit_huff_decoder (j_decompress_ptr cinfo)
000000 b510 PUSH {r4,lr}
;;;636 {
000002 4604 MOV r4,r0
;;;637 huff_entropy_ptr entropy;
;;;638 int i;
;;;639
;;;640 entropy = (huff_entropy_ptr)
000004 6840 LDR r0,[r0,#4]
000006 22e8 MOVS r2,#0xe8
000008 6803 LDR r3,[r0,#0]
00000a 2101 MOVS r1,#1
00000c 4620 MOV r0,r4
00000e 4798 BLX r3
;;;641 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
;;;642 SIZEOF(huff_entropy_decoder));
;;;643 cinfo->entropy = (struct jpeg_entropy_decoder *) entropy;
;;;644 entropy->pub.start_pass = start_pass_huff_decoder;
000010 4907 LDR r1,|L2.48|
000012 f8c401bc STR r0,[r4,#0x1bc]
;;;645 entropy->pub.decode_mcu = decode_mcu;
000016 6001 STR r1,[r0,#0]
000018 4906 LDR r1,|L2.52|
;;;646
;;;647 /* Mark tables unallocated */
;;;648 for (i = 0; i < NUM_HUFF_TBLS; i++) {
00001a 6041 STR r1,[r0,#4]
00001c 2100 MOVS r1,#0
00001e 460b MOV r3,r1
|L2.32|
;;;649 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
000020 eb000281 ADD r2,r0,r1,LSL #2
000024 6393 STR r3,[r2,#0x38]
000026 1c49 ADDS r1,r1,#1 ;648
000028 6293 STR r3,[r2,#0x28] ;648
00002a 2904 CMP r1,#4 ;648
00002c dbf8 BLT |L2.32|
;;;650 }
;;;651 }
00002e bd10 POP {r4,pc}
ENDP
|L2.48|
DCD start_pass_huff_decoder
|L2.52|
DCD decode_mcu
AREA ||i.jpeg_fill_bit_buffer||, CODE, READONLY, ALIGN=1
jpeg_fill_bit_buffer PROC
;;;291 GLOBAL(boolean)
;;;292 jpeg_fill_bit_buffer (bitread_working_state * state,
000000 e92d47f0 PUSH {r4-r10,lr}
;;;293 register bit_buf_type get_buffer, register int bits_left,
;;;294 int nbits)
;;;295 /* Load up the bit buffer to a depth of at least nbits */
;;;296 {
000004 4680 MOV r8,r0
;;;297 /* Copy heavily used state fields into locals (hopefully registers) */
;;;298 register const JOCTET * next_input_byte = state->next_input_byte;
;;;299 register size_t bytes_in_buffer = state->bytes_in_buffer;
;;;300 j_decompress_ptr cinfo = state->cinfo;
;;;301
;;;302 /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
;;;303 /* (It is assumed that no request will be for more than that many bits.) */
;;;304 /* We fail to do so only if we hit a marker or are forced to suspend. */
;;;305
;;;306 if (cinfo->unread_marker == 0) { /* cannot advance past a marker */
000006 6906 LDR r6,[r0,#0x10]
000008 c830 LDM r0!,{r4,r5}
00000a f8d601a0 LDR r0,[r6,#0x1a0]
00000e 4689 MOV r9,r1 ;296
000010 4617 MOV r7,r2 ;296
000012 469a MOV r10,r3 ;296
000014 bb38 CBNZ r0,|L3.102|
000016 e021 B |L3.92|
|L3.24|
;;;307 while (bits_left < MIN_GET_BITS) {
;;;308 register int c;
;;;309
;;;310 /* Attempt to read a byte */
;;;311 if (bytes_in_buffer == 0) {
000018 b935 CBNZ r5,|L3.40|
;;;312 if (! (*cinfo->src->fill_input_buffer) (cinfo))
00001a 69b0 LDR r0,[r6,#0x18]
00001c 68c1 LDR r1,[r0,#0xc]
00001e 4630 MOV r0,r6
000020 4788 BLX r1
000022 b160 CBZ r0,|L3.62|
;;;313 return FALSE;
;;;314 next_input_byte = cinfo->src->next_input_byte;
;;;315 bytes_in_buffer = cinfo->src->bytes_in_buffer;
000024 69b0 LDR r0,[r6,#0x18]
000026 c830 LDM r0!,{r4,r5} ;314
|L3.40|
;;;316 }
;;;317 bytes_in_buffer--;
;;;318 c = GETJOCTET(*next_input_byte++);
000028 f8140b01 LDRB r0,[r4],#1
00002c 1e6d SUBS r5,r5,#1 ;317
;;;319
;;;320 /* If it's 0xFF, check and discard stuffed zero byte */
;;;321 if (c == 0xFF) {
00002e 28ff CMP r0,#0xff
000030 d111 BNE |L3.86|
|L3.50|
;;;322 /* Loop here to discard any padding FF's on terminating marker,
;;;323 * so that we can save a valid unread_marker value. NOTE: we will
;;;324 * accept multiple FF's followed by a 0 as meaning a single FF data
;;;325 * byte. This data pattern is not valid according to the standard.
;;;326 */
;;;327 do {
;;;328 if (bytes_in_buffer == 0) {
000032 b94d CBNZ r5,|L3.72|
;;;329 if (! (*cinfo->src->fill_input_buffer) (cinfo))
000034 69b0 LDR r0,[r6,#0x18]
000036 68c1 LDR r1,[r0,#0xc]
000038 4630 MOV r0,r6
00003a 4788 BLX r1
00003c b910 CBNZ r0,|L3.68|
|L3.62|
;;;330 return FALSE;
00003e 2000 MOVS r0,#0
|L3.64|
;;;331 next_input_byte = cinfo->src->next_input_byte;
;;;332 bytes_in_buffer = cinfo->src->bytes_in_buffer;
;;;333 }
;;;334 bytes_in_buffer--;
;;;335 c = GETJOCTET(*next_input_byte++);
;;;336 } while (c == 0xFF);
;;;337
;;;338 if (c == 0) {
;;;339 /* Found FF/00, which represents an FF data byte */
;;;340 c = 0xFF;
;;;341 } else {
;;;342 /* Oops, it's actually a marker indicating end of compressed data.
;;;343 * Save the marker code for later use.
;;;344 * Fine point: it might appear that we should save the marker into
;;;345 * bitread working state, not straight into permanent state. But
;;;346 * once we have hit a marker, we cannot need to suspend within the
;;;347 * current MCU, because we will read no more bytes from the data
;;;348 * source. So it is OK to update permanent state right away.
;;;349 */
;;;350 cinfo->unread_marker = c;
;;;351 /* See if we need to insert some fake zero bits. */
;;;352 goto no_more_bytes;
;;;353 }
;;;354 }
;;;355
;;;356 /* OK, load c into get_buffer */
;;;357 get_buffer = (get_buffer << 8) | c;
;;;358 bits_left += 8;
;;;359 } /* end while */
;;;360 } else {
;;;361 no_more_bytes:
;;;362 /* We get here if we've read the marker that terminates the compressed
;;;363 * data segment. There should be enough bits in the buffer register
;;;364 * to satisfy the request; if so, no problem.
;;;365 */
;;;366 if (nbits > bits_left) {
;;;367 /* Uh-oh. Report corrupted data to user and stuff zeroes into
;;;368 * the data stream, so that we can produce some kind of image.
;;;369 * We use a nonvolatile flag to ensure that only one warning message
;;;370 * appears per data segment.
;;;371 */
;;;372 if (! cinfo->entropy->insufficient_data) {
;;;373 WARNMS(cinfo, JWRN_HIT_MARKER);
;;;374 cinfo->entropy->insufficient_data = TRUE;
;;;375 }
;;;376 /* Fill the buffer with zero bits */
;;;377 get_buffer <<= MIN_GET_BITS - bits_left;
;;;378 bits_left = MIN_GET_BITS;
;;;379 }
;;;380 }
;;;381
;;;382 /* Unload the local registers */
;;;383 state->next_input_byte = next_input_byte;
;;;384 state->bytes_in_buffer = bytes_in_buffer;
;;;385 state->get_buffer = get_buffer;
;;;386 state->bits_left = bits_left;
;;;387
;;;388 return TRUE;
;;;389 }
000040 e8bd87f0 POP {r4-r10,pc}
|L3.68|
000044 69b0 LDR r0,[r6,#0x18] ;332
000046 c830 LDM r0!,{r4,r5} ;331
|L3.72|
000048 f8140b01 LDRB r0,[r4],#1 ;335
00004c 1e6d SUBS r5,r5,#1 ;334
00004e 28ff CMP r0,#0xff ;336
000050 d0ef BEQ |L3.50|
000052 b930 CBNZ r0,|L3.98|
000054 20ff MOVS r0,#0xff ;340
|L3.86|
000056 ea402909 ORR r9,r0,r9,LSL #8 ;357
00005a 3708 ADDS r7,r7,#8 ;358
|L3.92|
00005c 2f19 CMP r7,#0x19 ;307
00005e dbdb BLT |L3.24|
000060 e019 B |L3.150|
|L3.98|
000062 f8c601a0 STR r0,[r6,#0x1a0] ;350
|L3.102|
000066 45ba CMP r10,r7 ;366
000068 dd15 BLE |L3.150|
00006a f8d601bc LDR r0,[r6,#0x1bc] ;372
00006e 6880 LDR r0,[r0,#8] ;372
000070 b960 CBNZ r0,|L3.140|
000072 6831 LDR r1,[r6,#0] ;373
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -