OLD | NEW |
---|---|
1 /* | 1 /* |
2 * jdhuff.c | 2 * jdhuff.c |
3 * | 3 * |
4 * This file was part of the Independent JPEG Group's software: | 4 * This file was part of the Independent JPEG Group's software: |
5 * Copyright (C) 1991-1997, Thomas G. Lane. | 5 * Copyright (C) 1991-1997, Thomas G. Lane. |
6 * libjpeg-turbo Modifications: | 6 * libjpeg-turbo Modifications: |
7 * Copyright (C) 2009-2011, 2015, D. R. Commander. | 7 * Copyright (C) 2009-2011, 2015, D. R. Commander. |
8 * For conditions of distribution and use, see the accompanying README file. | 8 * For conditions of distribution and use, see the accompanying README file. |
9 * | 9 * |
10 * This file contains Huffman entropy decoding routines. | 10 * This file contains Huffman entropy decoding routines. |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
653 int blkn; | 653 int blkn; |
654 savable_state state; | 654 savable_state state; |
655 /* Outer loop handles each block in the MCU */ | 655 /* Outer loop handles each block in the MCU */ |
656 | 656 |
657 /* Load up working state */ | 657 /* Load up working state */ |
658 BITREAD_LOAD_STATE(cinfo,entropy->bitstate); | 658 BITREAD_LOAD_STATE(cinfo,entropy->bitstate); |
659 buffer = (JOCTET *) br_state.next_input_byte; | 659 buffer = (JOCTET *) br_state.next_input_byte; |
660 ASSIGN_STATE(state, entropy->saved); | 660 ASSIGN_STATE(state, entropy->saved); |
661 | 661 |
662 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { | 662 for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) { |
663 JBLOCKROW block = MCU_data[blkn]; | 663 JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL; |
Noel Gordon
2015/08/12 00:39:22
Confusing: this change was in the original submit,
| |
664 d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; | 664 d_derived_tbl * dctbl = entropy->dc_cur_tbls[blkn]; |
665 d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; | 665 d_derived_tbl * actbl = entropy->ac_cur_tbls[blkn]; |
666 register int s, k, r, l; | 666 register int s, k, r, l; |
667 | 667 |
668 HUFF_DECODE_FAST(s, l, dctbl, slow_decode_mcu); | 668 HUFF_DECODE_FAST(s, l, dctbl, slow_decode_mcu); |
669 if (s) { | 669 if (s) { |
670 FILL_BIT_BUFFER_FAST | 670 FILL_BIT_BUFFER_FAST |
671 r = GET_BITS(s); | 671 r = GET_BITS(s); |
672 s = HUFF_EXTEND(r, s); | 672 s = HUFF_EXTEND(r, s); |
673 } | 673 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
804 SIZEOF(huff_entropy_decoder)); | 804 SIZEOF(huff_entropy_decoder)); |
805 cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; | 805 cinfo->entropy = (struct jpeg_entropy_decoder *) entropy; |
806 entropy->pub.start_pass = start_pass_huff_decoder; | 806 entropy->pub.start_pass = start_pass_huff_decoder; |
807 entropy->pub.decode_mcu = decode_mcu; | 807 entropy->pub.decode_mcu = decode_mcu; |
808 | 808 |
809 /* Mark tables unallocated */ | 809 /* Mark tables unallocated */ |
810 for (i = 0; i < NUM_HUFF_TBLS; i++) { | 810 for (i = 0; i < NUM_HUFF_TBLS; i++) { |
811 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; | 811 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; |
812 } | 812 } |
813 } | 813 } |
OLD | NEW |