#include "internal.h"
#include "avcodec.h"
-#include "h264.h"
+#include "h264dec.h"
#include "h264_mvpred.h"
#include "h264data.h"
-#include "golomb.h"
+#include "golomb_legacy.h"
#include "mpegutils.h"
#include <assert.h>
buf=GET_CACHE(re, gb);
log= 32 - av_log2(buf);
-#ifdef TRACE
- print_bin(buf>>(32-log), log);
- av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d lpr @%5d in %s get_level_prefix\n", buf>>(32-log), log, log-1, get_bits_count(gb), __FILE__);
-#endif
LAST_SKIP_BITS(re, gb, log);
CLOSE_READER(re, gb);
for(i=1;i<total_coeff && zeros_left > 0;i++) { \
if(zeros_left < 7) \
run_before= get_vlc2(gb, run_vlc[zeros_left - 1].table, RUN_VLC_BITS, 1); \
- else \
+ else {\
run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); \
+ run_before = FFMIN(zeros_left, run_before);\
+ }\
zeros_left -= run_before; \
scantable -= 1 + run_before; \
((type*)block)[*scantable]= level[i]; \
for(i=1;i<total_coeff && zeros_left > 0;i++) { \
if(zeros_left < 7) \
run_before= get_vlc2(gb, run_vlc[zeros_left - 1].table, RUN_VLC_BITS, 1); \
- else \
+ else {\
run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); \
+ run_before = FFMIN(zeros_left, run_before);\
+ }\
zeros_left -= run_before; \
scantable -= 1 + run_before; \
((type*)block)[*scantable]= ((int)(level[i] * qmul[*scantable] + 32))>>6; \
}
}
- sl->chroma_qp[0] = get_chroma_qp(h, 0, sl->qscale);
- sl->chroma_qp[1] = get_chroma_qp(h, 1, sl->qscale);
+ sl->chroma_qp[0] = get_chroma_qp(h->ps.pps, 0, sl->qscale);
+ sl->chroma_qp[1] = get_chroma_qp(h->ps.pps, 1, sl->qscale);
if ((ret = decode_luma_residual(h, sl, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 0)) < 0 ) {
return -1;