From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 4/9] avfilter/bwdifdsp: Avoid including ff_bwdif_filter_line3_c() Date: Mon, 25 Sep 2023 20:04:52 +0200 Message-ID: <AS8P250MB0744A0C536AA21C6129DD1F28FFCA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB0744D7FEB3A2719DC2D9F0EA8FFCA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> This function is used by the AARCH64 code to filter a few remaining lines in case the dimensions are not suitably aligned; it is furthermore also used by checkasm to actually test the AARCH64 code against. But it is normally not used and this patch therefore moves it in bwdifdsp.h as a static inline function so that it can be avoided if possible or inlined where necessary. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavfilter/bwdifdsp.c | 25 ------------------------- libavfilter/bwdifdsp.h | 30 +++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/libavfilter/bwdifdsp.c b/libavfilter/bwdifdsp.c index 65bdbdc053..e87fe414e0 100644 --- a/libavfilter/bwdifdsp.c +++ b/libavfilter/bwdifdsp.c @@ -143,31 +143,6 @@ void ff_bwdif_filter_line_c(void *dst1, const void *prev1, const void *cur1, con FILTER2() } -#define NEXT_LINE()\ - dst += d_stride; \ - prev += prefs; \ - cur += prefs; \ - next += prefs; - -void ff_bwdif_filter_line3_c(void * dst1, int d_stride, - const void * prev1, const void * cur1, const void * next1, int s_stride, - int w, int parity, int clip_max) -{ - const int prefs = s_stride; - uint8_t * dst = dst1; - const uint8_t * prev = prev1; - const uint8_t * cur = cur1; - const uint8_t * next = next1; - - ff_bwdif_filter_line_c(dst, prev, cur, next, w, - prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max); - NEXT_LINE(); - memcpy(dst, cur, w); - NEXT_LINE(); - ff_bwdif_filter_line_c(dst, prev, cur, next, w, - prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max); -} - void ff_bwdif_filter_edge_c(void *dst1, const void *prev1, const void *cur1, const void *next1, int w, int prefs, int mrefs, int prefs2, int mrefs2, int parity, int clip_max, int spat) diff --git a/libavfilter/bwdifdsp.h b/libavfilter/bwdifdsp.h index 4bf595355c..4a350e5ccc 100644 --- a/libavfilter/bwdifdsp.h +++ b/libavfilter/bwdifdsp.h @@ -19,6 +19,9 @@ #ifndef AVFILTER_BWDIFDSP_H #define AVFILTER_BWDIFDSP_H +#include <stdint.h> +#include <string.h> + typedef struct BWDIFDSPContext { void (*filter_intra)(void *dst1, const void *cur1, int w, int prefs, int mrefs, int prefs3, int mrefs3, int parity, int clip_max); @@ -50,8 +53,33 @@ void ff_bwdif_filter_line_c(void *dst1, const void *prev1, const void *cur1, con int prefs3, int mrefs3, int prefs4, int mrefs4, int parity, int clip_max); +static inline void ff_bwdif_filter_line3_c(void * dst1, int d_stride, const void * prev1, const void * cur1, const void * next1, int s_stride, - int w, int parity, int clip_max); + int w, int parity, int clip_max) +{ + const int prefs = s_stride; + uint8_t * dst = dst1; + const uint8_t * prev = prev1; + const uint8_t * cur = cur1; + const uint8_t * next = next1; + + ff_bwdif_filter_line_c(dst, prev, cur, next, w, + prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max); +#define NEXT_LINE()\ + dst += d_stride; \ + prev += prefs; \ + cur += prefs; \ + next += prefs; + + NEXT_LINE(); + memcpy(dst, cur, w); + NEXT_LINE(); +#undef NEXT_LINE + ff_bwdif_filter_line_c(dst, prev, cur, next, w, + prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max); +} + + #endif /* AVFILTER_BWDIFDSP_H */ -- 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:[~2023-09-25 18:04 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-09-25 17:53 [FFmpeg-devel] [PATCH 1/9] avfilter/bwdif: Add proper BWDIFDSPContext Andreas Rheinhardt 2023-09-25 18:04 ` [FFmpeg-devel] [PATCH 2/9] avfilter/vf_bwdif: Move DSP code to a new file Andreas Rheinhardt 2023-09-25 18:04 ` [FFmpeg-devel] [PATCH 3/9] avfilter/bwdifdsp: Constify Andreas Rheinhardt 2023-09-25 18:04 ` Andreas Rheinhardt [this message] 2023-09-25 18:04 ` [FFmpeg-devel] [PATCH 5/9] checkasm/motion: Don't allocate AVCodecContext Andreas Rheinhardt 2023-09-25 18:04 ` [FFmpeg-devel] [PATCH 6/9] avcodec/snow: Split ff_snow_get_buffer() Andreas Rheinhardt 2023-09-25 18:04 ` [FFmpeg-devel] [PATCH 7/9] avcodec/snow: Move decoder parts out of ff_snow_common_init_after_header Andreas Rheinhardt 2023-09-25 18:04 ` [FFmpeg-devel] [PATCH 8/9] avcodec/aacsbrdata: Move ff_sbr_noise_table to sbrdsp_template.c Andreas Rheinhardt 2023-09-25 18:04 ` [FFmpeg-devel] [PATCH 9/9] avcodec/tests/.gitignore: Add bitstream test tools Andreas Rheinhardt 2023-09-26 22:11 ` [FFmpeg-devel] [PATCH 1/9] avfilter/bwdif: Add proper BWDIFDSPContext 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=AS8P250MB0744A0C536AA21C6129DD1F28FFCA@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