30 #define BITSTREAM_READER_LE
38 #define IVI4_STREAM_ANALYSER 0
39 #define IVI4_DEBUG_CHECKSUM 0
54 #define IVI4_PIC_SIZE_ESC 7
87 #if IVI4_STREAM_ANALYSER
140 for (i = 0; i < 4; i++)
151 return size_factor == 15 ? def_size : (size_factor + 1) << 5;
163 int pic_size_indx, i, p;
178 #if IVI4_STREAM_ANALYSER
181 ctx->has_b_frames = 1;
185 #if IVI4_STREAM_ANALYSER
201 av_dlog(avctx,
"Null frame encountered!\n");
210 av_dlog(avctx,
"Password-protected clip!\n");
226 #if IVI4_STREAM_ANALYSER
227 ctx->uses_tiling = 1;
248 av_log(avctx,
AV_LOG_ERROR,
"Scalability: unsupported subdivision! Luma bands: %d, chroma bands: %d\n",
263 for (p = 0; p <= 2; p++) {
273 "Couldn't reallocate internal structures!\n");
303 av_dlog(avctx,
"Pic hdr extension encountered!\n");
328 int plane, band_num, indx, transform_id, scan_indx;
351 #if IVI4_STREAM_ANALYSER
353 ctx->uses_fullpel = 1;
380 if ((transform_id >= 7 && transform_id <= 9) ||
381 transform_id == 17) {
386 #if IVI4_STREAM_ANALYSER
387 if ((transform_id >= 0 && transform_id <= 2) || transform_id == 10)
396 if (scan_indx == 15) {
428 for (i = 0; i < band->
num_corr * 2; i++)
464 int x, y, mv_x, mv_y, mv_delta, offs, mb_offset, blks_per_mb,
465 mv_scale, mb_type_bits;
587 int result, i,
t, pos, idx1, idx2;
607 for (i = 0; i < band->
num_corr; i++) {
608 idx1 = band->
corr[i * 2];
609 idx2 = band->
corr[i * 2 + 1];
623 av_dlog(avctx,
"Empty tile encountered!\n");
646 for (i = band->
num_corr - 1; i >= 0; i--) {
647 idx1 = band->
corr[i * 2];
648 idx2 = band->
corr[i * 2 + 1];
653 #if defined(DEBUG) && IVI4_DEBUG_CHECKSUM
658 "Band checksum mismatch! Plane %d, band %d, received: %x, calculated: %x\n",
728 const uint8_t *buf = avpkt->
data;
729 int buf_size = avpkt->
size;
743 for (p = 0; p < 3; p++) {
748 "Error decoding band: %d, plane: %d\n", b, p);
799 #if IVI4_STREAM_ANALYSER
802 if (ctx->uses_tiling)
804 if (ctx->has_b_frames)
810 if (ctx->uses_fullpel)