summaryrefslogtreecommitdiff
path: root/libavcodec/h264_cavlc.c
diff options
context:
space:
mode:
authorAnton Mitrofanov <BugMaster@narod.ru>2017-06-14 03:01:56 +0300
committerRonald S. Bultje <rsbultje@gmail.com>2017-06-19 14:33:40 -0400
commitcf231b68da1150c100114f2c5671b7ed740f917a (patch)
tree2738d003599506c69b50a639187539ee573ce1a4 /libavcodec/h264_cavlc.c
parent06dda70f1e7c69a3b1684af5e6930431c62c527a (diff)
avcodec/h264: Fix mix of lossless and lossy MBs decoding
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/h264_cavlc.c')
-rw-r--r--libavcodec/h264_cavlc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index e70bb3e607..f01e76070c 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -1102,14 +1102,6 @@ decode_intra_mb:
const uint8_t *scan, *scan8x8;
const int max_qp = 51 + 6 * (h->ps.sps->bit_depth_luma - 8);
- if(IS_INTERLACED(mb_type)){
- scan8x8 = sl->qscale ? h->field_scan8x8_cavlc : h->field_scan8x8_cavlc_q0;
- scan = sl->qscale ? h->field_scan : h->field_scan_q0;
- }else{
- scan8x8 = sl->qscale ? h->zigzag_scan8x8_cavlc : h->zigzag_scan8x8_cavlc_q0;
- scan = sl->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
- }
-
dquant= get_se_golomb(&sl->gb);
sl->qscale += (unsigned)dquant;
@@ -1126,6 +1118,14 @@ decode_intra_mb:
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(IS_INTERLACED(mb_type)){
+ scan8x8 = sl->qscale ? h->field_scan8x8_cavlc : h->field_scan8x8_cavlc_q0;
+ scan = sl->qscale ? h->field_scan : h->field_scan_q0;
+ }else{
+ scan8x8 = sl->qscale ? h->zigzag_scan8x8_cavlc : h->zigzag_scan8x8_cavlc_q0;
+ scan = sl->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
+ }
+
if ((ret = decode_luma_residual(h, sl, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 0)) < 0 ) {
return -1;
}