This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 6834762d7b61ad93c128268b16222455b295bce5
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Wed Feb 25 21:50:46 2026 +0100
Commit:     Andreas Rheinhardt <[email protected]>
CommitDate: Sun Mar 1 11:58:16 2026 +0100

    avcodec/huffyuvencdsp: Add width parameter to init
    
    This allows to only use certain functions using wide registers
    if there is enough work to do and if one can even read a whole
    register wide without overreading.
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libavcodec/huffyuvenc.c             | 2 +-
 libavcodec/huffyuvencdsp.c          | 4 ++--
 libavcodec/huffyuvencdsp.h          | 4 ++--
 libavcodec/x86/huffyuvencdsp_init.c | 2 +-
 tests/checkasm/huffyuvencdsp.c      | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index e90fe645d1..cd31e8f068 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -278,7 +278,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
     s->mask  = (1 << s->bps) - 1;
     s->vlc_n = FFMIN(1 << s->bps, MAX_VLC_N);
 
-    ff_huffyuvencdsp_init(&s->hencdsp, s->bps);
+    ff_huffyuvencdsp_init(&s->hencdsp, s->bps, avctx->width >> 
s->chroma_h_shift);
 
     switch (avctx->pix_fmt) {
     case AV_PIX_FMT_YUV420P:
diff --git a/libavcodec/huffyuvencdsp.c b/libavcodec/huffyuvencdsp.c
index dcae51f4f8..9dd84dbafe 100644
--- a/libavcodec/huffyuvencdsp.c
+++ b/libavcodec/huffyuvencdsp.c
@@ -84,12 +84,12 @@ static void sub_hfyu_median_pred_int16_c(uint16_t *dst, 
const uint16_t *src1, co
     *left_top = lt;
 }
 
-av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, int bpp)
+av_cold void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, int bpp, int width)
 {
     c->diff_int16           = diff_int16_c;
     c->sub_hfyu_median_pred_int16 = sub_hfyu_median_pred_int16_c;
 
 #if ARCH_X86 && HAVE_X86ASM
-    ff_huffyuvencdsp_init_x86(c, bpp);
+    ff_huffyuvencdsp_init_x86(c, bpp, width);
 #endif
 }
diff --git a/libavcodec/huffyuvencdsp.h b/libavcodec/huffyuvencdsp.h
index fae182add1..173fbca08f 100644
--- a/libavcodec/huffyuvencdsp.h
+++ b/libavcodec/huffyuvencdsp.h
@@ -32,7 +32,7 @@ typedef struct HuffYUVEncDSPContext {
                                        int w, int *left, int *left_top);
 } HuffYUVEncDSPContext;
 
-void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, int bpp);
-void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, int bpp);
+void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, int bpp, int width);
+void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, int bpp, int width);
 
 #endif /* AVCODEC_HUFFYUVENCDSP_H */
diff --git a/libavcodec/x86/huffyuvencdsp_init.c 
b/libavcodec/x86/huffyuvencdsp_init.c
index fd54fdcc00..153edabf02 100644
--- a/libavcodec/x86/huffyuvencdsp_init.c
+++ b/libavcodec/x86/huffyuvencdsp_init.c
@@ -34,7 +34,7 @@ void ff_diff_int16_avx2(uint16_t *dst, const uint16_t *src1, 
const uint16_t *src
 void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, 
const uint16_t *src2,
                                           unsigned mask, int w, int *left, int 
*left_top);
 
-av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, int bpp)
+av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, int bpp, int 
width)
 {
     av_unused int cpu_flags = av_get_cpu_flags();
 
diff --git a/tests/checkasm/huffyuvencdsp.c b/tests/checkasm/huffyuvencdsp.c
index 049a7d126b..a74b4295d6 100644
--- a/tests/checkasm/huffyuvencdsp.c
+++ b/tests/checkasm/huffyuvencdsp.c
@@ -48,7 +48,7 @@ static void check_sub_hfyu_median_pred_int16(const char 
*aligned, unsigned width
     for (size_t i = 0; i < FF_ARRAY_ELEMS(bpps); ++i) {
         const int bpp = bpps[i];
 
-        ff_huffyuvencdsp_init(&c, bpp);
+        ff_huffyuvencdsp_init(&c, bpp, width);
 
         if (check_func(c.sub_hfyu_median_pred_int16, 
"sub_hfyu_median_pred_int16_%dbpp%s", bpp, aligned)) {
             DECLARE_ALIGNED(32, uint16_t, dst0)[MAX_WIDTH];

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to