diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 13:24:23 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-21 13:24:23 +0100 |
commit | c27f53b9fbcd8f638afecc637ef844b612cc39be (patch) | |
tree | 7c6588de62ee97cddb5ddd1f6c77fd4fb7a0c9d3 /libavcodec/svq3.c | |
parent | cc31d9ce80abd8b2a1a446f73a8651e2f1d76853 (diff) | |
parent | d231e84b06a9964c840cff4e228509f706165fb6 (diff) | |
download | ffmpeg-c27f53b9fbcd8f638afecc637ef844b612cc39be.tar.gz |
Merge commit 'd231e84b06a9964c840cff4e228509f706165fb6'
* commit 'd231e84b06a9964c840cff4e228509f706165fb6':
h264: move the quantizers into the per-slice context
Conflicts:
libavcodec/dxva2_h264.c
libavcodec/h264_cavlc.c
libavcodec/h264_loopfilter.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r-- | libavcodec/svq3.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 0ddcd6a7b4..cd3d28f184 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -488,6 +488,7 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode, static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) { H264Context *h = &s->h; + H264SliceContext *sl = &h->slice_ctx[0]; int i, j, k, m, dir, mode; int cbp = 0; uint32_t vlc; @@ -704,10 +705,10 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) } if (IS_INTRA16x16(mb_type) || (h->pict_type != AV_PICTURE_TYPE_I && s->adaptive_quant && cbp)) { - h->qscale += svq3_get_se_golomb(&h->gb); + sl->qscale += svq3_get_se_golomb(&h->gb); - if (h->qscale > 31u) { - av_log(h->avctx, AV_LOG_ERROR, "qscale:%d\n", h->qscale); + if (sl->qscale > 31u) { + av_log(h->avctx, AV_LOG_ERROR, "qscale:%d\n", sl->qscale); return -1; } } @@ -723,7 +724,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type) if (cbp) { const int index = IS_INTRA16x16(mb_type) ? 1 : 0; - const int type = ((h->qscale < 24 && IS_INTRA4x4(mb_type)) ? 2 : 1); + const int type = ((sl->qscale < 24 && IS_INTRA4x4(mb_type)) ? 2 : 1); for (i = 0; i < 4; i++) if ((cbp & (1 << i))) { @@ -779,6 +780,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx) { SVQ3Context *s = avctx->priv_data; H264Context *h = &s->h; + H264SliceContext *sl = &h->slice_ctx[0]; const int mb_xy = h->mb_xy; int i, header; unsigned slice_id; @@ -833,7 +835,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx) } h->slice_num = get_bits(&h->gb, 8); - h->qscale = get_bits(&h->gb, 5); + sl->qscale = get_bits(&h->gb, 5); s->adaptive_quant = get_bits1(&h->gb); /* unknown fields */ @@ -898,7 +900,7 @@ static av_cold int svq3_decode_init(AVCodecContext *avctx) avctx->pix_fmt = AV_PIX_FMT_YUVJ420P; avctx->color_range = AVCOL_RANGE_JPEG; - h->chroma_qp[0] = h->chroma_qp[1] = 4; + h->slice_ctx[0].chroma_qp[0] = h->slice_ctx[0].chroma_qp[1] = 4; h->chroma_x_shift = h->chroma_y_shift = 1; s->halfpel_flag = 1; @@ -1229,7 +1231,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, "%c hpel:%d, tpel:%d aqp:%d qp:%d, slice_num:%02X\n", av_get_picture_type_char(h->pict_type), s->halfpel_flag, s->thirdpel_flag, - s->adaptive_quant, h->qscale, h->slice_num); + s->adaptive_quant, h->slice_ctx[0].qscale, h->slice_num); if (avctx->skip_frame >= AVDISCARD_NONREF && h->pict_type == AV_PICTURE_TYPE_B || avctx->skip_frame >= AVDISCARD_NONKEY && h->pict_type != AV_PICTURE_TYPE_I || |