* [FFmpeg-devel] [PATCH v2 2/3] avcodec/x86/vvc/vvcdsp_init: add avg prototypes
[not found] <20240415173550.657-1-toqsxw@outlook.com>
@ 2024-04-15 17:35 ` toqsxw
2024-04-15 17:35 ` [FFmpeg-devel] [PATCH v2 3/3] avcodec/x86/vvc/vvcdsp_init: fix linking error when configuring with --disable-ssse3 --disable-optimizations options toqsxw
1 sibling, 0 replies; 2+ messages in thread
From: toqsxw @ 2024-04-15 17:35 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Wu Jianhua
From: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
---
libavcodec/x86/vvc/vvcdsp_init.c | 45 ++++++++++++++++++++------------
1 file changed, 28 insertions(+), 17 deletions(-)
diff --git a/libavcodec/x86/vvc/vvcdsp_init.c b/libavcodec/x86/vvc/vvcdsp_init.c
index d9203f4d5f..aef6699c35 100644
--- a/libavcodec/x86/vvc/vvcdsp_init.c
+++ b/libavcodec/x86/vvc/vvcdsp_init.c
@@ -63,6 +63,30 @@ PUT_TAP_PROTOTYPES(8, sse4)
PUT_TAP_PROTOTYPES(4, avx2)
PUT_TAP_PROTOTYPES(8, avx2)
+#define bf(fn, bd, opt) fn##_##bd##_##opt
+#define BF(fn, bpc, opt) fn##_##bpc##bpc_##opt
+
+#define AVG_BPC_PROTOTYPES(bpc, opt) \
+void BF(ff_vvc_avg, bpc, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
+ const int16_t *src0, const int16_t *src1, intptr_t width, intptr_t height, intptr_t pixel_max); \
+void BF(ff_vvc_w_avg, bpc, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
+ const int16_t *src0, const int16_t *src1, intptr_t width, intptr_t height, \
+ intptr_t denom, intptr_t w0, intptr_t w1, intptr_t o0, intptr_t o1, intptr_t pixel_max);
+
+#define AVG_PROTOTYPES(bd, opt) \
+void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
+ const int16_t *src0, const int16_t *src1, int width, int height); \
+void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
+ const int16_t *src0, const int16_t *src1, int width, int height, \
+ int denom, int w0, int w1, int o0, int o1);
+
+AVG_BPC_PROTOTYPES( 8, avx2)
+AVG_BPC_PROTOTYPES(16, avx2)
+
+AVG_PROTOTYPES( 8, avx2)
+AVG_PROTOTYPES(10, avx2)
+AVG_PROTOTYPES(12, avx2)
+
#if ARCH_X86_64
#define FW_PUT(name, depth, opt) \
void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \
@@ -202,23 +226,13 @@ FW_PUT_16BPC_AVX2(12)
MC_TAP_LINKS_16BPC_AVX2(LUMA, 8, bd); \
MC_TAP_LINKS_16BPC_AVX2(CHROMA, 4, bd);
-#define bf(fn, bd, opt) fn##_##bd##_##opt
-#define BF(fn, bpc, opt) fn##_##bpc##bpc_##opt
-
-#define AVG_BPC_FUNC(bpc, opt) \
-void BF(ff_vvc_avg, bpc, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
- const int16_t *src0, const int16_t *src1, intptr_t width, intptr_t height, intptr_t pixel_max); \
-void BF(ff_vvc_w_avg, bpc, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
- const int16_t *src0, const int16_t *src1, intptr_t width, intptr_t height, \
- intptr_t denom, intptr_t w0, intptr_t w1, intptr_t o0, intptr_t o1, intptr_t pixel_max);
-
#define AVG_FUNCS(bpc, bd, opt) \
-static void bf(avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
+void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
const int16_t *src0, const int16_t *src1, int width, int height) \
{ \
BF(ff_vvc_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, (1 << bd) - 1); \
} \
-static void bf(w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
+void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
const int16_t *src0, const int16_t *src1, int width, int height, \
int denom, int w0, int w1, int o0, int o1) \
{ \
@@ -226,16 +240,13 @@ static void bf(w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride,
denom, w0, w1, o0, o1, (1 << bd) - 1); \
}
-AVG_BPC_FUNC(8, avx2)
-AVG_BPC_FUNC(16, avx2)
-
AVG_FUNCS(8, 8, avx2)
AVG_FUNCS(16, 10, avx2)
AVG_FUNCS(16, 12, avx2)
#define AVG_INIT(bd, opt) do { \
- c->inter.avg = bf(avg, bd, opt); \
- c->inter.w_avg = bf(w_avg, bd, opt); \
+ c->inter.avg = bf(ff_vvc_avg, bd, opt); \
+ c->inter.w_avg = bf(ff_vvc_w_avg, bd, opt); \
} while (0)
#endif
--
2.44.0.windows.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] 2+ messages in thread
* [FFmpeg-devel] [PATCH v2 3/3] avcodec/x86/vvc/vvcdsp_init: fix linking error when configuring with --disable-ssse3 --disable-optimizations options
[not found] <20240415173550.657-1-toqsxw@outlook.com>
2024-04-15 17:35 ` [FFmpeg-devel] [PATCH v2 2/3] avcodec/x86/vvc/vvcdsp_init: add avg prototypes toqsxw
@ 2024-04-15 17:35 ` toqsxw
1 sibling, 0 replies; 2+ messages in thread
From: toqsxw @ 2024-04-15 17:35 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Wu Jianhua
From: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
---
libavcodec/x86/vvc/vvcdsp_init.c | 46 +++++++++++++++++---------------
1 file changed, 25 insertions(+), 21 deletions(-)
diff --git a/libavcodec/x86/vvc/vvcdsp_init.c b/libavcodec/x86/vvc/vvcdsp_init.c
index aef6699c35..985d750472 100644
--- a/libavcodec/x86/vvc/vvcdsp_init.c
+++ b/libavcodec/x86/vvc/vvcdsp_init.c
@@ -88,6 +88,7 @@ AVG_PROTOTYPES(10, avx2)
AVG_PROTOTYPES(12, avx2)
#if ARCH_X86_64
+#if HAVE_SSE4_EXTERNAL
#define FW_PUT(name, depth, opt) \
void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \
int height, const int8_t *hf, const int8_t *vf, int width) \
@@ -125,7 +126,9 @@ void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *sr
FW_PUT_SSE4( 8)
FW_PUT_SSE4(10)
FW_PUT_SSE4(12)
+#endif
+#if HAVE_AVX2_EXTERNAL
#define FW_PUT_TAP_AVX2(n, bitd) \
FW_PUT(n ## tap_h32, bitd, avx2) \
FW_PUT(n ## tap_h64, bitd, avx2) \
@@ -161,6 +164,25 @@ FW_PUT_AVX2(12)
FW_PUT_16BPC_AVX2(10)
FW_PUT_16BPC_AVX2(12)
+#define AVG_FUNCS(bpc, bd, opt) \
+void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
+ const int16_t *src0, const int16_t *src1, int width, int height) \
+{ \
+ BF(ff_vvc_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, (1 << bd) - 1); \
+} \
+void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
+ const int16_t *src0, const int16_t *src1, int width, int height, \
+ int denom, int w0, int w1, int o0, int o1) \
+{ \
+ BF(ff_vvc_w_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, \
+ denom, w0, w1, o0, o1, (1 << bd) - 1); \
+}
+
+AVG_FUNCS(8, 8, avx2)
+AVG_FUNCS(16, 10, avx2)
+AVG_FUNCS(16, 12, avx2)
+#endif
+
#define PEL_LINK(dst, C, W, idx1, idx2, name, D, opt) \
dst[C][W][idx1][idx2] = ff_vvc_put_## name ## _ ## D ## _##opt; \
dst ## _uni[C][W][idx1][idx2] = ff_h2656_put_uni_ ## name ## _ ## D ## _##opt; \
@@ -226,27 +248,9 @@ FW_PUT_16BPC_AVX2(12)
MC_TAP_LINKS_16BPC_AVX2(LUMA, 8, bd); \
MC_TAP_LINKS_16BPC_AVX2(CHROMA, 4, bd);
-#define AVG_FUNCS(bpc, bd, opt) \
-void bf(ff_vvc_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
- const int16_t *src0, const int16_t *src1, int width, int height) \
-{ \
- BF(ff_vvc_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, (1 << bd) - 1); \
-} \
-void bf(ff_vvc_w_avg, bd, opt)(uint8_t *dst, ptrdiff_t dst_stride, \
- const int16_t *src0, const int16_t *src1, int width, int height, \
- int denom, int w0, int w1, int o0, int o1) \
-{ \
- BF(ff_vvc_w_avg, bpc, opt)(dst, dst_stride, src0, src1, width, height, \
- denom, w0, w1, o0, o1, (1 << bd) - 1); \
-}
-
-AVG_FUNCS(8, 8, avx2)
-AVG_FUNCS(16, 10, avx2)
-AVG_FUNCS(16, 12, avx2)
-
-#define AVG_INIT(bd, opt) do { \
- c->inter.avg = bf(ff_vvc_avg, bd, opt); \
- c->inter.w_avg = bf(ff_vvc_w_avg, bd, opt); \
+#define AVG_INIT(bd, opt) do { \
+ c->inter.avg = bf(ff_vvc_avg, bd, opt); \
+ c->inter.w_avg = bf(ff_vvc_w_avg, bd, opt); \
} while (0)
#endif
--
2.44.0.windows.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] 2+ messages in thread
end of thread, other threads:[~2024-04-15 17:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20240415173550.657-1-toqsxw@outlook.com>
2024-04-15 17:35 ` [FFmpeg-devel] [PATCH v2 2/3] avcodec/x86/vvc/vvcdsp_init: add avg prototypes toqsxw
2024-04-15 17:35 ` [FFmpeg-devel] [PATCH v2 3/3] avcodec/x86/vvc/vvcdsp_init: fix linking error when configuring with --disable-ssse3 --disable-optimizations options toqsxw
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