Commit 70946e60 authored by Anton Mitrofanov's avatar Anton Mitrofanov Committed by Anton Khirnov

h264dec: Fix mix of lossless and lossy MBs decoding

CC: libav-stable@libav.org
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 18d3f36d
...@@ -2371,14 +2371,6 @@ decode_intra_mb: ...@@ -2371,14 +2371,6 @@ decode_intra_mb:
const uint8_t *scan, *scan8x8; const uint8_t *scan, *scan8x8;
const uint32_t *qmul; const uint32_t *qmul;
if(IS_INTERLACED(mb_type)){
scan8x8 = sl->qscale ? h->field_scan8x8 : h->field_scan8x8_q0;
scan = sl->qscale ? h->field_scan : h->field_scan_q0;
}else{
scan8x8 = sl->qscale ? h->zigzag_scan8x8 : h->zigzag_scan8x8_q0;
scan = sl->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
}
// decode_cabac_mb_dqp // decode_cabac_mb_dqp
if(get_cabac_noinline( &sl->cabac, &sl->cabac_state[60 + (sl->last_qscale_diff != 0)])){ if(get_cabac_noinline( &sl->cabac, &sl->cabac_state[60 + (sl->last_qscale_diff != 0)])){
int val = 1; int val = 1;
...@@ -2409,6 +2401,14 @@ decode_intra_mb: ...@@ -2409,6 +2401,14 @@ decode_intra_mb:
}else }else
sl->last_qscale_diff=0; sl->last_qscale_diff=0;
if(IS_INTERLACED(mb_type)){
scan8x8 = sl->qscale ? h->field_scan8x8 : h->field_scan8x8_q0;
scan = sl->qscale ? h->field_scan : h->field_scan_q0;
}else{
scan8x8 = sl->qscale ? h->zigzag_scan8x8 : h->zigzag_scan8x8_q0;
scan = sl->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
}
decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_type, cbp, 0); decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_type, cbp, 0);
if (CHROMA444(h)) { if (CHROMA444(h)) {
decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_type, cbp, 1); decode_cabac_luma_residual(h, sl, scan, scan8x8, pixel_shift, mb_type, cbp, 1);
......
...@@ -1093,14 +1093,6 @@ decode_intra_mb: ...@@ -1093,14 +1093,6 @@ decode_intra_mb:
const uint8_t *scan, *scan8x8; const uint8_t *scan, *scan8x8;
const int max_qp = 51 + 6 * (h->ps.sps->bit_depth_luma - 8); 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); dquant= get_se_golomb(&sl->gb);
sl->qscale += dquant; sl->qscale += dquant;
...@@ -1117,6 +1109,14 @@ decode_intra_mb: ...@@ -1117,6 +1109,14 @@ decode_intra_mb:
sl->chroma_qp[0] = get_chroma_qp(h->ps.pps, 0, 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); 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 ) { if ((ret = decode_luma_residual(h, sl, gb, scan, scan8x8, pixel_shift, mb_type, cbp, 0)) < 0 ) {
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment