| OLD | NEW |
| 1 /* | 1 /* |
| 2 * jchuff.c | 2 * jchuff.c |
| 3 * | 3 * |
| 4 * Copyright (C) 1991-1997, Thomas G. Lane. | 4 * Copyright (C) 1991-1997, Thomas G. Lane. |
| 5 * This file is part of the Independent JPEG Group's software. | 5 * This file is part of the Independent JPEG Group's software. |
| 6 * For conditions of distribution and use, see the accompanying README file. | 6 * For conditions of distribution and use, see the accompanying README file. |
| 7 * | 7 * |
| 8 * This file contains Huffman entropy encoding routines. | 8 * This file contains Huffman entropy encoding routines. |
| 9 * | 9 * |
| 10 * Much of the complexity here has to do with supporting output suspension. | 10 * Much of the complexity here has to do with supporting output suspension. |
| 11 * If the data destination module demands suspension, we want to be able to | 11 * If the data destination module demands suspension, we want to be able to |
| 12 * back up to the start of the current MCU. To do this, we copy state | 12 * back up to the start of the current MCU. To do this, we copy state |
| 13 * variables into local working storage, and update them back to the | 13 * variables into local working storage, and update them back to the |
| 14 * permanent JPEG objects only upon successful completion of an MCU. | 14 * permanent JPEG objects only upon successful completion of an MCU. |
| 15 */ | 15 */ |
| 16 | 16 |
| 17 #define JPEG_INTERNALS | 17 #define JPEG_INTERNALS |
| 18 #include "jinclude.h" | 18 #include "jinclude.h" |
| 19 #include "jpeglib.h" | 19 #include "jpeglib.h" |
| 20 #include "jchuff.h" /* Declarations shared with jcphuff.c */ | 20 #include "jchuff.h" /* Declarations shared with jcphuff.c */ |
| 21 | 21 |
| 22 #ifdef _FX_MANAGED_CODE_ | |
| 23 #define savable_state savable_state_c | |
| 24 #endif | |
| 25 | |
| 26 /* Expanded entropy encoder object for Huffman encoding. | 22 /* Expanded entropy encoder object for Huffman encoding. |
| 27 * | 23 * |
| 28 * The savable_state subrecord contains fields that change within an MCU, | 24 * The savable_state subrecord contains fields that change within an MCU, |
| 29 * but must not be updated permanently until we complete the MCU. | 25 * but must not be updated permanently until we complete the MCU. |
| 30 */ | 26 */ |
| 31 | 27 |
| 32 typedef struct { | 28 typedef struct { |
| 33 INT32 put_buffer; /* current bit-accumulation buffer */ | 29 INT32 put_buffer; /* current bit-accumulation buffer */ |
| 34 int put_bits; /* # of bits now in it */ | 30 int put_bits; /* # of bits now in it */ |
| 35 int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ | 31 int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */ |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 entropy->pub.start_pass = start_pass_huff; | 899 entropy->pub.start_pass = start_pass_huff; |
| 904 | 900 |
| 905 /* Mark tables unallocated */ | 901 /* Mark tables unallocated */ |
| 906 for (i = 0; i < NUM_HUFF_TBLS; i++) { | 902 for (i = 0; i < NUM_HUFF_TBLS; i++) { |
| 907 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; | 903 entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL; |
| 908 #ifdef ENTROPY_OPT_SUPPORTED | 904 #ifdef ENTROPY_OPT_SUPPORTED |
| 909 entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; | 905 entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL; |
| 910 #endif | 906 #endif |
| 911 } | 907 } |
| 912 } | 908 } |
| OLD | NEW |