From: Nuo Mi <nuomi2021@gmail.com> To: ffmpeg-devel@ffmpeg.org Cc: Nuo Mi <nuomi2021@gmail.com> Subject: [FFmpeg-devel] [PATCH 1/5] x86/vvcdec: misc, reordered functions in dsp_init for improved readability Date: Fri, 2 May 2025 15:44:26 +0800 Message-ID: <20250502074430.291561-1-nuomi2021@gmail.com> (raw) --- 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".
next reply other threads:[~2025-05-02 7:44 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-05-02 7:44 Nuo Mi [this message] 2025-05-02 7:44 ` [FFmpeg-devel] [PATCH 2/5] x86/hevcdec: sao, refact out h26x macros Nuo Mi 2025-05-02 7:44 ` [FFmpeg-devel] [PATCH 3/5] x86/hevcdec: refact, remove duplicate code in HEVC_SAO_{BAND, EDGE}_FILTER Nuo Mi 2025-05-02 7:44 ` [FFmpeg-devel] [PATCH 4/5] x86/vvcdec: sao, add avx2 support Nuo Mi 2025-05-02 7:44 ` [FFmpeg-devel] [PATCH 5/5] checkasm: add vvc_sao Nuo Mi 2025-05-02 7:49 ` Martin Storsjö 2025-05-02 14:48 ` Nuo Mi 2025-05-02 20:45 ` Martin Storsjö 2025-05-03 9:15 ` Nuo Mi 2025-05-06 21:26 ` Martin Storsjö 2025-05-10 12:45 ` Nuo Mi 2025-05-14 13:01 ` Nuo Mi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20250502074430.291561-1-nuomi2021@gmail.com \ --to=nuomi2021@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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