diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-24 20:36:10 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-25 19:07:31 +0100 |
commit | e944ab796d9624b269424c5a6e2e82cf393b2884 (patch) | |
tree | 09723b4e0a6223081f032bc1f8f89af2531ad8d3 /libavcodec/h264dec.h | |
parent | c4fcfa47df24bbef354ae3ae3e1fe839c95519fb (diff) | |
download | ffmpeg-e944ab796d9624b269424c5a6e2e82cf393b2884.tar.gz |
avcodec/h264dec: Move ERContext to H264Context
Since 7be2d2a70cd20d88fd826a83f87037d14681a579 only one context
is used. Moving it to H264Context from H264SliceContext is natural.
One could access the ERContext from H264SliceContext
via H264SliceContext.h264->er; yet H264SliceContext.h264 should
naturally be const-qualified, because slice threads should not
modify the main context. The ERContext is an exception
to this, as ff_er_add_slice() is intended to be called simultaneously
by multiple threads. And for this one needs a pointer whose
pointed-to-type is not const-qualified.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/h264dec.h')
-rw-r--r-- | libavcodec/h264dec.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 6ad2333419..0b9c5784a2 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -170,7 +170,7 @@ typedef struct H264Ref { typedef struct H264SliceContext { struct H264Context *h264; GetBitContext gb; - ERContext er; + ERContext *er; int slice_num; int slice_type; @@ -271,7 +271,6 @@ typedef struct H264SliceContext { unsigned int pps_id; const uint8_t *intra_pcm_ptr; - int16_t *dc_val_base; uint8_t *bipred_scratchpad; uint8_t *edge_emu_buffer; @@ -543,6 +542,8 @@ typedef struct H264Context { int height_from_caller; int enable_er; + ERContext er; + int16_t *dc_val_base; H264SEIContext sei; @@ -784,7 +785,7 @@ int ff_h264_ref_picture(H264Context *h, H264Picture *dst, H264Picture *src); int ff_h264_replace_picture(H264Context *h, H264Picture *dst, const H264Picture *src); void ff_h264_unref_picture(H264Context *h, H264Picture *pic); -int ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl); +void ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl); void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, int y, int height); |