J2kCodingStyle codsty[4];
J2kQuantStyle qntsty[4];
- uint8_t *buf_start;
- uint8_t *buf;
- uint8_t *buf_end;
+ const uint8_t *buf_start;
+ const uint8_t *buf;
+ const uint8_t *buf_end;
int bit_index;
int16_t curtileno;
uint8_t x = bytestream_get_byte(&s->buf);
s->cbps[i] = (x & 0x7f) + 1;
s->precision = FFMAX(s->cbps[i], s->precision);
- s->sgnd[i] = (x & 0x80) == 1;
+ s->sgnd[i] = !!(x & 0x80);
s->cdx[i] = bytestream_get_byte(&s->buf);
s->cdy[i] = bytestream_get_byte(&s->buf);
}
for (;;){
int marker, len, ret = 0;
- uint8_t *oldbuf;
+ const uint8_t *oldbuf;
if (s->buf_end - s->buf < 2){
av_log(s->avctx, AV_LOG_ERROR, "Missing EOC\n");
break;
}
marker = bytestream_get_be16(&s->buf);
+ if(s->avctx->debug & FF_DEBUG_STARTCODE)
+ av_log(s->avctx, AV_LOG_DEBUG, "marker 0x%.4X at pos 0x%x\n", marker, s->buf - s->buf_start - 4);
oldbuf = s->buf;
if (marker == J2K_SOD){