Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH v2 1/7] x86/vvcdec: misc, reordered functions in dsp_init for improved readability
@ 2025-05-03  9:13 Nuo Mi
  2025-05-03  9:13 ` [FFmpeg-devel] [PATCH v2 2/7] x86/hevcdec: sao, refact out h26x macros Nuo Mi
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Nuo Mi @ 2025-05-03  9:13 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Nuo Mi

---
 libavcodec/x86/vvc/dsp_init.c | 48 +++++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 19 deletions(-)

diff --git a/libavcodec/x86/vvc/dsp_init.c b/libavcodec/x86/vvc/dsp_init.c
index dc833bb0f1..bb68ba0b1e 100644
--- a/libavcodec/x86/vvc/dsp_init.c
+++ b/libavcodec/x86/vvc/dsp_init.c
@@ -215,6 +215,18 @@ ALF_FUNCS(16, 12, avx2)
 
 #endif
 
+#define AVG_INIT(bd, opt) do {                                       \
+    c->inter.avg    = bf(vvc_avg, bd, opt);                          \
+    c->inter.w_avg  = bf(vvc_w_avg, bd, opt);                        \
+} while (0)
+
+#define DMVR_INIT(bd) do {                                           \
+    c->inter.dmvr[0][0]   = ff_vvc_dmvr_##bd##_avx2;                 \
+    c->inter.dmvr[0][1]   = ff_vvc_dmvr_h_##bd##_avx2;               \
+    c->inter.dmvr[1][0]   = ff_vvc_dmvr_v_##bd##_avx2;               \
+    c->inter.dmvr[1][1]   = ff_vvc_dmvr_hv_##bd##_avx2;              \
+} while (0)
+
 #define PEL_LINK(dst, C, W, idx1, idx2, name, D, opt)                              \
     dst[C][W][idx1][idx2] = vvc_put_## name ## _ ## D ## _##opt;                   \
     dst ## _uni[C][W][idx1][idx2] = ff_h2656_put_uni_ ## name ## _ ## D ## _##opt; \
@@ -280,17 +292,8 @@ ALF_FUNCS(16, 12, avx2)
     MC_TAP_LINKS_16BPC_AVX2(LUMA,   8, bd);                          \
     MC_TAP_LINKS_16BPC_AVX2(CHROMA, 4, bd);
 
-#define AVG_INIT(bd, opt) do {                                       \
-    c->inter.avg    = bf(vvc_avg, bd, opt);                          \
-    c->inter.w_avg  = bf(vvc_w_avg, bd, opt);                        \
-} while (0)
-
-#define DMVR_INIT(bd) do {                                           \
-    c->inter.dmvr[0][0]   = ff_vvc_dmvr_##bd##_avx2;                 \
-    c->inter.dmvr[0][1]   = ff_vvc_dmvr_h_##bd##_avx2;               \
-    c->inter.dmvr[1][0]   = ff_vvc_dmvr_v_##bd##_avx2;               \
-    c->inter.dmvr[1][1]   = ff_vvc_dmvr_hv_##bd##_avx2;              \
-} while (0)
+int ff_vvc_sad_avx2(const int16_t *src0, const int16_t *src1, int dx, int dy, int block_w, int block_h);
+#define SAD_INIT() c->inter.sad = ff_vvc_sad_avx2
 
 #define ALF_INIT(bd) do {                                            \
     c->alf.filter[LUMA]   = vvc_alf_filter_luma_##bd##_avx2;         \
@@ -298,8 +301,6 @@ ALF_FUNCS(16, 12, avx2)
     c->alf.classify       = vvc_alf_classify_##bd##_avx2;            \
 } while (0)
 
-int ff_vvc_sad_avx2(const int16_t *src0, const int16_t *src1, int dx, int dy, int block_w, int block_h);
-#define SAD_INIT() c->inter.sad = ff_vvc_sad_avx2
 #endif
 
 
@@ -319,12 +320,15 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd)
 #endif
 #if HAVE_AVX2_EXTERNAL
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
-            ALF_INIT(8);
+            // inter
             AVG_INIT(8, avx2);
+            DMVR_INIT(8);
             MC_LINKS_AVX2(8);
             OF_INIT(8);
-            DMVR_INIT(8);
             SAD_INIT();
+
+            // filter
+            ALF_INIT(8);
         }
 #endif
         break;
@@ -336,13 +340,16 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd)
 #endif
 #if HAVE_AVX2_EXTERNAL
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
-            ALF_INIT(10);
+            // inter
             AVG_INIT(10, avx2);
+            DMVR_INIT(10);
             MC_LINKS_AVX2(10);
             MC_LINKS_16BPC_AVX2(10);
             OF_INIT(10);
-            DMVR_INIT(10);
             SAD_INIT();
+
+            // filter
+            ALF_INIT(10);
         }
 #endif
         break;
@@ -354,13 +361,16 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd)
 #endif
 #if HAVE_AVX2_EXTERNAL
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
-            ALF_INIT(12);
+            // inter
             AVG_INIT(12, avx2);
+            DMVR_INIT(12);
             MC_LINKS_AVX2(12);
             MC_LINKS_16BPC_AVX2(12);
             OF_INIT(12);
-            DMVR_INIT(12);
             SAD_INIT();
+
+            // filter
+            ALF_INIT(12);
         }
 #endif
         break;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-05-15 20:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-03  9:13 [FFmpeg-devel] [PATCH v2 1/7] x86/vvcdec: misc, reordered functions in dsp_init for improved readability Nuo Mi
2025-05-03  9:13 ` [FFmpeg-devel] [PATCH v2 2/7] x86/hevcdec: sao, refact out h26x macros Nuo Mi
2025-05-03  9:13 ` [FFmpeg-devel] [PATCH v2 3/7] x86/hevcdec: refact, remove duplicate code in HEVC_SAO_{BAND, EDGE}_FILTER Nuo Mi
2025-05-03  9:13 ` [FFmpeg-devel] [PATCH v2 4/7] x86/vvcdec: sao, add avx2 support Nuo Mi
2025-05-03  9:13 ` [FFmpeg-devel] [PATCH v2 5/7] checkasm: add vvc_sao Nuo Mi
2025-05-03  9:13 ` [FFmpeg-devel] [PATCH v2 6/7] checkasm: hevc sao_edge, benchmarking inside the width loop is meaningless Nuo Mi
2025-05-15  1:05   ` softworkz .
2025-05-15 12:49     ` Nuo Mi
2025-05-15 20:29       ` softworkz .
2025-05-03  9:13 ` [FFmpeg-devel] [PATCH v2 7/7] checkasm: hevc sao, use checkasm_check_padded Nuo Mi

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git