summaryrefslogtreecommitdiff
path: root/libavcodec/h264_slice.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-04-12 19:13:56 +0200
committerAnton Khirnov <anton@khirnov.net>2015-04-29 05:52:58 +0200
commitc9ccbc7333eddd025ebbde5cc4f27d68a950c623 (patch)
tree1847c6aad448340aea5af99e172895c98517c6f8 /libavcodec/h264_slice.c
parent29dcde2b87559b72957454a7e9bcd5227d8057ba (diff)
h264: update the current bit depth/chroma type in init_slice_header()
With frame threading, it is currently only updated in the context where the change occurs, but not in any other contexts.
Diffstat (limited to 'libavcodec/h264_slice.c')
-rw-r--r--libavcodec/h264_slice.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index a760068d0b..92fc51ec0f 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1014,6 +1014,8 @@ static int h264_slice_header_init(H264Context *h, int reinit)
h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
h->pixel_shift = h->sps.bit_depth_luma > 8;
+ h->chroma_format_idc = h->sps.chroma_format_idc;
+ h->bit_depth_luma = h->sps.bit_depth_luma;
ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma,
h->sps.chroma_format_idc);
@@ -1158,11 +1160,8 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
h->sps = *h->sps_buffers[h->pps.sps_id];
if (h->bit_depth_luma != h->sps.bit_depth_luma ||
- h->chroma_format_idc != h->sps.chroma_format_idc) {
- h->bit_depth_luma = h->sps.bit_depth_luma;
- h->chroma_format_idc = h->sps.chroma_format_idc;
+ h->chroma_format_idc != h->sps.chroma_format_idc)
needs_reinit = 1;
- }
if (h->flags & CODEC_FLAG_LOW_DELAY ||
(h->sps.bitstream_restriction_flag &&