Add comments about non successfull attempt of implementing alternate INITDEC, DECODE and BYTEIN procedures (refs #921)
This commit is contained in:
parent
f7a126af61
commit
4431fa7265
|
@ -448,6 +448,11 @@ void opj_mqc_segmark_enc(opj_mqc_t *mqc)
|
||||||
|
|
||||||
OPJ_BOOL opj_mqc_init_dec(opj_mqc_t *mqc, OPJ_BYTE *bp, OPJ_UINT32 len)
|
OPJ_BOOL opj_mqc_init_dec(opj_mqc_t *mqc, OPJ_BYTE *bp, OPJ_UINT32 len)
|
||||||
{
|
{
|
||||||
|
/* Implements ISO 15444-1 C.3.5 Initialization of the decoder (INITDEC) */
|
||||||
|
/* Note: alternate "J.1 - Initialization of the software-conventions */
|
||||||
|
/* decoder" has been tried, but does */
|
||||||
|
/* not bring any improvement. */
|
||||||
|
/* See https://github.com/uclouvain/openjpeg/issues/921 */
|
||||||
opj_mqc_setcurctx(mqc, 0);
|
opj_mqc_setcurctx(mqc, 0);
|
||||||
mqc->start = bp;
|
mqc->start = bp;
|
||||||
mqc->end = bp + len;
|
mqc->end = bp + len;
|
||||||
|
|
|
@ -93,6 +93,10 @@ static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc)
|
||||||
#else
|
#else
|
||||||
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc)
|
static INLINE void opj_mqc_bytein(opj_mqc_t *const mqc)
|
||||||
{
|
{
|
||||||
|
/* Implements ISO 15444-1 C.3.4 Compressed image data input (BYTEIN) */
|
||||||
|
/* Note: alternate "J.3 - Inserting a new byte into the C register in the */
|
||||||
|
/* software-conventions decoder" has been tried, but does not bring any */
|
||||||
|
/* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */
|
||||||
if (mqc->bp != mqc->end) {
|
if (mqc->bp != mqc->end) {
|
||||||
OPJ_UINT32 c;
|
OPJ_UINT32 c;
|
||||||
if (mqc->bp + 1 != mqc->end) {
|
if (mqc->bp + 1 != mqc->end) {
|
||||||
|
@ -144,6 +148,10 @@ Decode a symbol
|
||||||
*/
|
*/
|
||||||
static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc)
|
static INLINE OPJ_INT32 opj_mqc_decode(opj_mqc_t *const mqc)
|
||||||
{
|
{
|
||||||
|
/* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */
|
||||||
|
/* Note: alternate "J.2 - Decoding an MPS or an LPS in the */
|
||||||
|
/* software-conventions decoder" has been tried, but does not bring any */
|
||||||
|
/* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */
|
||||||
OPJ_INT32 d;
|
OPJ_INT32 d;
|
||||||
mqc->a -= (*mqc->curctx)->qeval;
|
mqc->a -= (*mqc->curctx)->qeval;
|
||||||
if ((mqc->c >> 16) < (*mqc->curctx)->qeval) {
|
if ((mqc->c >> 16) < (*mqc->curctx)->qeval) {
|
||||||
|
|
Loading…
Reference in New Issue