diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2017-06-02 16:49:26 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2017-06-02 18:24:07 +0200 |
| commit | 532243f1fd9997db63ea7f6b199d21138ccf58a3 (patch) | |
| tree | 3e204ebb64f2a1ceb5c73af30c3ff377dde55b9a /src/lib/openjp2/tcd.c | |
| parent | 9b39fc4bccb3e9e4e9a9f61c4dc672fb7f05d865 (diff) | |
MQC/RAW decoder: use an artificial 0xFF 0xFF terminating marker.
This saves comparing the current pointer with the end of buffer pointer.
This results at least in tiny speed improvement for raw decoding, and
smaller code size for MQC as well.
This kills the remains of the raw.h/.c files that were only used for
decoding. Encoding using the mqc structure already.
Diffstat (limited to 'src/lib/openjp2/tcd.c')
| -rw-r--r-- | src/lib/openjp2/tcd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c index f1e1c1c3..dc5c89b9 100644 --- a/src/lib/openjp2/tcd.c +++ b/src/lib/openjp2/tcd.c @@ -39,6 +39,7 @@ */ #include "opj_includes.h" +#include "opj_common.h" /* ----------------------------------------------------------------------- */ @@ -1185,11 +1186,11 @@ static OPJ_BOOL opj_tcd_code_block_dec_allocate(opj_tcd_cblk_dec_t * { if (! p_code_block->data) { - p_code_block->data = (OPJ_BYTE*) opj_malloc(OPJ_J2K_DEFAULT_CBLK_DATA_SIZE); + p_code_block->data = (OPJ_BYTE*) opj_malloc(OPJ_COMMON_DEFAULT_CBLK_DATA_SIZE); if (! p_code_block->data) { return OPJ_FALSE; } - p_code_block->data_max_size = OPJ_J2K_DEFAULT_CBLK_DATA_SIZE; + p_code_block->data_max_size = OPJ_COMMON_DEFAULT_CBLK_DATA_SIZE; /*fprintf(stderr, "Allocate 8192 elements of code_block->data\n");*/ p_code_block->segs = (opj_tcd_seg_t *) opj_calloc(OPJ_J2K_DEFAULT_NB_SEGS, |
