From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/x86/hpeldsp_init: Avoid using ff_avg_pixels16_mmx Date: Fri, 16 Feb 2024 21:30:25 +0100 Message-ID: <AS8P250MB074468C58B95CC6ADED273888F4C2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB07448EE3EABED32060A7A81D8F4C2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> Use ff_avg_pixels16_mmxext or ff_avg_pixels16_sse2 (for users with SSE2_FAST) instead. This also allows to remove ff_avg_pixels16_mmx, as this was its last remaining user. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/x86/fpel.asm | 1 - libavcodec/x86/fpel.h | 2 -- libavcodec/x86/hpeldsp_init.c | 15 +++++++-------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/libavcodec/x86/fpel.asm b/libavcodec/x86/fpel.asm index ebe8e43750..ecaca3c080 100644 --- a/libavcodec/x86/fpel.asm +++ b/libavcodec/x86/fpel.asm @@ -92,7 +92,6 @@ INIT_MMX mmx OP_PIXELS put, 4 OP_PIXELS put, 8 OP_PIXELS put, 16 -OP_PIXELS avg, 16 INIT_MMX mmxext OP_PIXELS avg, 4 diff --git a/libavcodec/x86/fpel.h b/libavcodec/x86/fpel.h index 90f7051a48..c533ca40b2 100644 --- a/libavcodec/x86/fpel.h +++ b/libavcodec/x86/fpel.h @@ -26,8 +26,6 @@ void ff_avg_pixels4_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_avg_pixels8_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); -void ff_avg_pixels16_mmx(uint8_t *block, const uint8_t *pixels, - ptrdiff_t line_size, int h); void ff_avg_pixels16_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); void ff_avg_pixels16_sse2(uint8_t *block, const uint8_t *pixels, diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c index f08c66f5c8..4a0513d06d 100644 --- a/libavcodec/x86/hpeldsp_init.c +++ b/libavcodec/x86/hpeldsp_init.c @@ -62,11 +62,9 @@ void ff_avg_pixels8_y2_mmxext(uint8_t *block, const uint8_t *pixels, void ff_avg_approx_pixels8_xy2_mmxext(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h); -#define avg_pixels16_mmx ff_avg_pixels16_mmx #define put_pixels8_mmx ff_put_pixels8_mmx #define put_pixels16_mmx ff_put_pixels16_mmx #define put_pixels8_xy2_mmx ff_put_pixels8_xy2_mmx -#define avg_no_rnd_pixels16_mmx ff_avg_pixels16_mmx #define put_no_rnd_pixels8_mmx ff_put_pixels8_mmx #define put_no_rnd_pixels16_mmx ff_put_pixels16_mmx @@ -138,7 +136,6 @@ HPELDSP_AVG_PIXELS16(_mmxext) if (HAVE_MMX_EXTERNAL) \ c->PFX ## _pixels_tab IDX [0] = PFX ## _pixels ## SIZE ## _ ## CPU -#if HAVE_MMX_INLINE #define SET_HPEL_FUNCS03(PFX, IDX, SIZE, CPU) \ do { \ SET_HPEL_FUNCS_EXT(PFX, IDX, SIZE, CPU); \ @@ -149,10 +146,6 @@ HPELDSP_AVG_PIXELS16(_mmxext) c->PFX ## _pixels_tab IDX [1] = PFX ## _pixels ## SIZE ## _x2_ ## CPU; \ c->PFX ## _pixels_tab IDX [2] = PFX ## _pixels ## SIZE ## _y2_ ## CPU; \ } while (0) -#else -#define SET_HPEL_FUNCS03(PFX, IDX, SIZE, CPU) SET_HPEL_FUNCS_EXT(PFX, IDX, SIZE, CPU) -#define SET_HPEL_FUNCS12(PFX, IDX, SIZE, CPU) ((void)0) -#endif #define SET_HPEL_FUNCS(PFX, IDX, SIZE, CPU) \ do { \ SET_HPEL_FUNCS03(PFX, IDX, SIZE, CPU); \ @@ -161,11 +154,14 @@ HPELDSP_AVG_PIXELS16(_mmxext) static void hpeldsp_init_mmx(HpelDSPContext *c, int flags) { +#if HAVE_MMX_INLINE SET_HPEL_FUNCS03(put, [0], 16, mmx); SET_HPEL_FUNCS(put_no_rnd, [0], 16, mmx); - SET_HPEL_FUNCS(avg_no_rnd, , 16, mmx); + SET_HPEL_FUNCS12(avg_no_rnd, , 16, mmx); + c->avg_no_rnd_pixels_tab[3] = avg_no_rnd_pixels16_xy2_mmx; SET_HPEL_FUNCS03(put, [1], 8, mmx); SET_HPEL_FUNCS(put_no_rnd, [1], 8, mmx); +#endif } static void hpeldsp_init_mmxext(HpelDSPContext *c, int flags) @@ -190,6 +186,8 @@ static void hpeldsp_init_mmxext(HpelDSPContext *c, int flags) c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_exact_mmxext; c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_exact_mmxext; + c->avg_no_rnd_pixels_tab[0] = ff_avg_pixels16_mmxext; + if (!(flags & AV_CODEC_FLAG_BITEXACT)) { c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmxext; c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmxext; @@ -214,6 +212,7 @@ static void hpeldsp_init_sse2_fast(HpelDSPContext *c, int flags) c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_sse2; c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_sse2; c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_sse2; + c->avg_no_rnd_pixels_tab[0] = ff_avg_pixels16_sse2; #endif /* HAVE_SSE2_EXTERNAL */ } -- 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 prev parent reply other threads:[~2024-02-16 20:28 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-02-16 20:29 [FFmpeg-devel] [PATCH 1/2] avcodec/x86/fpel: Remove declarations of inexistent functions Andreas Rheinhardt 2024-02-16 20:30 ` Andreas Rheinhardt [this message] 2024-02-17 0:12 ` [FFmpeg-devel] [PATCH 3/4] avcodec/h264qpel_template: Mark pointers as non-aliasing Andreas Rheinhardt 2024-02-17 0:12 ` [FFmpeg-devel] [PATCH 4/4] avcodec/x86/h264_qpel: Remove put_h264_qpel[48]_mmxext Andreas Rheinhardt 2024-02-18 23:14 ` [FFmpeg-devel] [PATCH 1/2] avcodec/x86/fpel: Remove declarations of inexistent functions Andreas Rheinhardt
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=AS8P250MB074468C58B95CC6ADED273888F4C2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.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