diff mbox series

[FFmpeg-devel,12/20] avcodec/snow: Move initializing HpelDSPContext to snowenc.c

Message ID AS8P250MB07449A6945A589CE5EB283C28F209@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 433925ac4d4a1eb0d2364e81e9f3e51e5d237895
Headers show
Series [FFmpeg-devel,1/8] configure: Remove dependencies of inexistant rtjpeg decoder | 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 Oct. 10, 2022, 3:13 a.m. UTC
Only used by the encoder.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 configure            | 2 +-
 libavcodec/snow.c    | 1 -
 libavcodec/snowenc.c | 2 ++
 3 files changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/configure b/configure
index f3fd91f592..bccbf1bdbf 100755
--- a/configure
+++ b/configure
@@ -2946,7 +2946,7 @@  screenpresso_decoder_deps="zlib"
 shorten_decoder_select="bswapdsp"
 sipr_decoder_select="lsp"
 smvjpeg_decoder_select="mjpeg_decoder"
-snow_decoder_select="dwt h264qpel hpeldsp rangecoder videodsp"
+snow_decoder_select="dwt h264qpel rangecoder videodsp"
 snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder videodsp"
 sonic_decoder_select="golomb rangecoder"
 sonic_encoder_select="golomb rangecoder"
diff --git a/libavcodec/snow.c b/libavcodec/snow.c
index c9bc4dbab9..4a6c781a95 100644
--- a/libavcodec/snow.c
+++ b/libavcodec/snow.c
@@ -433,7 +433,6 @@  av_cold int ff_snow_common_init(AVCodecContext *avctx){
     s->max_ref_frames=1; //just make sure it's not an invalid value in case of no initial keyframe
     s->spatial_decomposition_count = 1;
 
-    ff_hpeldsp_init(&s->hdsp, avctx->flags);
     ff_videodsp_init(&s->vdsp, 8);
     ff_dwt_init(&s->dwt);
     ff_h264qpel_init(&s->h264qpel, 8);
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index addca0ced9..0854f78da7 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -128,6 +128,8 @@  static av_cold int encode_init(AVCodecContext *avctx)
         s->plane[plane_index].fast_mc= 1;
     }
 
+    // Must be before ff_snow_common_init()
+    ff_hpeldsp_init(&s->hdsp, avctx->flags);
     if ((ret = ff_snow_common_init(avctx)) < 0) {
         return ret;
     }