diff mbox series

[FFmpeg-devel,2/3] avcodec/hevcdec: Remove redundant context_initialized

Message ID DB6PR0101MB221498DA8C8AF7A71A4C0D198FBA9@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Accepted
Commit a3b833c3ea9caf54d1a07980343bb82d9337105f
Headers show
Series [FFmpeg-devel,1/3] avcodec/cbs_h2645: Remove unnecessary (h264|hevc)_sei.h inclusions | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt June 30, 2022, 8:51 a.m. UTC
All contexts are always initialized during init, regardless
of whether frame threading is in use or not.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/hevcdec.c | 7 -------
 libavcodec/hevcdec.h | 1 -
 2 files changed, 8 deletions(-)

Comments

Anton Khirnov June 30, 2022, 9:01 a.m. UTC | #1
Quoting Andreas Rheinhardt (2022-06-30 10:51:55)
> All contexts are always initialized during init, regardless
> of whether frame threading is in use or not.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/hevcdec.c | 7 -------
>  libavcodec/hevcdec.h | 1 -
>  2 files changed, 8 deletions(-)

LGTM
diff mbox series

Patch

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index e84c30dd13..7ab012d68f 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3679,7 +3679,6 @@  static av_cold int hevc_init_context(AVCodecContext *avctx)
     ff_bswapdsp_init(&s->bdsp);
 
     s->dovi_ctx.logctx = avctx;
-    s->context_initialized = 1;
     s->eos = 0;
 
     ff_hevc_reset_sei(&s->sei);
@@ -3699,12 +3698,6 @@  static int hevc_update_thread_context(AVCodecContext *dst,
     HEVCContext *s0 = src->priv_data;
     int i, ret;
 
-    if (!s->context_initialized) {
-        ret = hevc_init_context(dst);
-        if (ret < 0)
-            return ret;
-    }
-
     for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
         ff_hevc_unref_frame(s, &s->DPB[i], ~0);
         if (s0->DPB[i].frame->buf[0]) {
diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h
index de861b88b3..ff2199aa5a 100644
--- a/libavcodec/hevcdec.h
+++ b/libavcodec/hevcdec.h
@@ -563,7 +563,6 @@  typedef struct HEVCContext {
     // type of the first VCL NAL of the current frame
     enum HEVCNALUnitType first_nal_type;
 
-    uint8_t context_initialized;
     int is_nalff;           ///< this flag is != 0 if bitstream is encapsulated
                             ///< as a format defined in 14496-15
     int apply_defdispwin;