diff mbox series

[FFmpeg-devel,1/6] avcodec/huffyuvdec: Don't zero unnecessarily

Message ID GV1P250MB07373EAE6095C91504AB56B98F3C2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit cebf1d59a56991b775f9bea92d8efd2f810c39ba
Headers show
Series [FFmpeg-devel,1/6] avcodec/huffyuvdec: Don't zero unnecessarily | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt April 4, 2024, 4:59 a.m. UTC
A decoder's private data has already been zeroed (apart from options)
before init is called.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/huffyuvdec.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Andreas Rheinhardt April 4, 2024, 7:33 p.m. UTC | #1
Andreas Rheinhardt:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/dv.c          | 4 +---
>  libavcodec/dv_internal.h | 2 +-
>  libavcodec/dvdec.c       | 6 +-----
>  libavcodec/dvenc.c       | 6 +-----
>  4 files changed, 4 insertions(+), 14 deletions(-)
> 
> diff --git a/libavcodec/dv.c b/libavcodec/dv.c
> index eb49978ad8..194d982562 100644
> --- a/libavcodec/dv.c
> +++ b/libavcodec/dv.c
> @@ -166,7 +166,7 @@ static inline void dv_calc_mb_coordinates(const AVDVProfile *d, int chan,
>      }
>  }
>  
> -int ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d)
> +void ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d)
>  {
>      int j, i, c, s, p;
>  
> @@ -185,6 +185,4 @@ int ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d)
>              }
>          }
>      }
> -
> -    return 0;
>  }
> diff --git a/libavcodec/dv_internal.h b/libavcodec/dv_internal.h
> index 4b4151c88d..05e26a8138 100644
> --- a/libavcodec/dv_internal.h
> +++ b/libavcodec/dv_internal.h
> @@ -32,7 +32,7 @@ typedef struct DVwork_chunk {
>      uint16_t mb_coordinates[5];
>  } DVwork_chunk;
>  
> -int ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d);
> +void ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d);
>  
>  static inline int dv_work_pool_size(const AVDVProfile *d)
>  {
> diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c
> index a06e4807e7..9e8d40187d 100644
> --- a/libavcodec/dvdec.c
> +++ b/libavcodec/dvdec.c
> @@ -637,11 +637,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, AVFrame *frame,
>      }
>  
>      if (sys != s->sys) {
> -        ret = ff_dv_init_dynamic_tables(s->work_chunks, sys);
> -        if (ret < 0) {
> -            av_log(avctx, AV_LOG_ERROR, "Error initializing the work tables.\n");
> -            return ret;
> -        }
> +        ff_dv_init_dynamic_tables(s->work_chunks, sys);
>          dv_init_weight_tables(s, sys);
>          s->sys = sys;
>      }
> diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
> index ce21247081..3afeedbb87 100644
> --- a/libavcodec/dvenc.c
> +++ b/libavcodec/dvenc.c
> @@ -93,11 +93,7 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
>          return AVERROR(EINVAL);
>      }
>  
> -    ret = ff_dv_init_dynamic_tables(s->work_chunks, s->sys);
> -    if (ret < 0) {
> -        av_log(avctx, AV_LOG_ERROR, "Error initializing work tables.\n");
> -        return ret;
> -    }
> +    ff_dv_init_dynamic_tables(s->work_chunks, s->sys);
>  
>      memset(&fdsp,0, sizeof(fdsp));
>      memset(&mecc,0, sizeof(mecc));

Sorry, sent the wrong patches. Ignore v1 of #8 and #9.

- Andreas
Andreas Rheinhardt April 5, 2024, 10:23 p.m. UTC | #2
Andreas Rheinhardt:
> A decoder's private data has already been zeroed (apart from options)
> before init is called.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/huffyuvdec.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
> index 3bed27be21..29e5419d91 100644
> --- a/libavcodec/huffyuvdec.c
> +++ b/libavcodec/huffyuvdec.c
> @@ -346,7 +346,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
>      ff_bswapdsp_init(&s->bdsp);
>      ff_huffyuvdsp_init(&s->hdsp, avctx->pix_fmt);
>      ff_llviddsp_init(&s->llviddsp);
> -    memset(s->vlc, 0, 4 * sizeof(VLC));
>  
>      s->interlaced = avctx->height > 288;
>      s->bgr32      = 1;

Will apply this patchset tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 3bed27be21..29e5419d91 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -346,7 +346,6 @@  static av_cold int decode_init(AVCodecContext *avctx)
     ff_bswapdsp_init(&s->bdsp);
     ff_huffyuvdsp_init(&s->hdsp, avctx->pix_fmt);
     ff_llviddsp_init(&s->llviddsp);
-    memset(s->vlc, 0, 4 * sizeof(VLC));
 
     s->interlaced = avctx->height > 288;
     s->bgr32      = 1;