* [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/bgr32 to yuv @ 2024-06-05 18:31 James Almer 2024-06-05 20:08 ` [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 " James Almer 0 siblings, 1 reply; 6+ messages in thread From: James Almer @ 2024-06-05 18:31 UTC (permalink / raw) To: ffmpeg-devel Signed-off-by: James Almer <jamrial@gmail.com> --- tests/checkasm/sw_rgb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c index b51d0836c3..57bd6b20cd 100644 --- a/tests/checkasm/sw_rgb.c +++ b/tests/checkasm/sw_rgb.c @@ -187,11 +187,13 @@ static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; static const enum AVPixelFormat rgb_formats[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGBA, + AV_PIX_FMT_BGRA, }; static void check_rgb_to_y(struct SwsContext *ctx) { - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); LOCAL_ALIGNED_32(uint8_t, dst0_y, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst1_y, [MAX_LINE_SIZE * 2]); @@ -199,7 +201,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *rgb2yuv, void *opq); - randomize_buffers(src, MAX_LINE_SIZE * 3); + randomize_buffers(src, MAX_LINE_SIZE * 4); for (int i = 0; i < FF_ARRAY_ELEMS(rgb_formats); i++) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(rgb_formats[i]); @@ -228,7 +230,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) static void check_rgb_to_uv(struct SwsContext *ctx) { - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); LOCAL_ALIGNED_32(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]); @@ -238,7 +240,7 @@ static void check_rgb_to_uv(struct SwsContext *ctx) const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal, void *opq); - randomize_buffers(src, MAX_LINE_SIZE * 3); + randomize_buffers(src, MAX_LINE_SIZE * 4); for (int i = 0; i < 2 * FF_ARRAY_ELEMS(rgb_formats); i++) { enum AVPixelFormat src_fmt = rgb_formats[i / 2]; -- 2.45.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] 6+ messages in thread
* [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 to yuv 2024-06-05 18:31 [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/bgr32 to yuv James Almer @ 2024-06-05 20:08 ` James Almer 2024-06-05 20:10 ` Andreas Rheinhardt 0 siblings, 1 reply; 6+ messages in thread From: James Almer @ 2024-06-05 20:08 UTC (permalink / raw) To: ffmpeg-devel Test all four pixel formats, but only bench the two native endian ones for a given target. Signed-off-by: James Almer <jamrial@gmail.com> --- tests/checkasm/sw_rgb.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c index b51d0836c3..cba6b87add 100644 --- a/tests/checkasm/sw_rgb.c +++ b/tests/checkasm/sw_rgb.c @@ -187,11 +187,15 @@ static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; static const enum AVPixelFormat rgb_formats[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGBA, + AV_PIX_FMT_BGRA, + AV_PIX_FMT_ABGR, + AV_PIX_FMT_ARGB, }; static void check_rgb_to_y(struct SwsContext *ctx) { - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); LOCAL_ALIGNED_32(uint8_t, dst0_y, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst1_y, [MAX_LINE_SIZE * 2]); @@ -199,7 +203,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *rgb2yuv, void *opq); - randomize_buffers(src, MAX_LINE_SIZE * 3); + randomize_buffers(src, MAX_LINE_SIZE * 4); for (int i = 0; i < FF_ARRAY_ELEMS(rgb_formats); i++) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(rgb_formats[i]); @@ -220,7 +224,10 @@ static void check_rgb_to_y(struct SwsContext *ctx) if (memcmp(dst0_y, dst1_y, w * 2)) fail(); - bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); + if (desc->nb_components == 3 || + // only bench native endian formats + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) + bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); } } } @@ -228,7 +235,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) static void check_rgb_to_uv(struct SwsContext *ctx) { - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); LOCAL_ALIGNED_32(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]); @@ -238,7 +245,7 @@ static void check_rgb_to_uv(struct SwsContext *ctx) const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal, void *opq); - randomize_buffers(src, MAX_LINE_SIZE * 3); + randomize_buffers(src, MAX_LINE_SIZE * 4); for (int i = 0; i < 2 * FF_ARRAY_ELEMS(rgb_formats); i++) { enum AVPixelFormat src_fmt = rgb_formats[i / 2]; @@ -266,7 +273,10 @@ static void check_rgb_to_uv(struct SwsContext *ctx) if (memcmp(dst0_u, dst1_u, w * 2) || memcmp(dst0_v, dst1_v, w * 2)) fail(); - bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); + if (desc->nb_components == 3 || + // only bench native endian formats + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) + bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); } } } -- 2.45.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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 to yuv 2024-06-05 20:08 ` [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 " James Almer @ 2024-06-05 20:10 ` Andreas Rheinhardt 2024-06-05 20:20 ` James Almer 0 siblings, 1 reply; 6+ messages in thread From: Andreas Rheinhardt @ 2024-06-05 20:10 UTC (permalink / raw) To: ffmpeg-devel James Almer: > Test all four pixel formats, but only bench the two native endian ones for a > given target. > > Signed-off-by: James Almer <jamrial@gmail.com> > --- > tests/checkasm/sw_rgb.c | 22 ++++++++++++++++------ > 1 file changed, 16 insertions(+), 6 deletions(-) > > diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c > index b51d0836c3..cba6b87add 100644 > --- a/tests/checkasm/sw_rgb.c > +++ b/tests/checkasm/sw_rgb.c > @@ -187,11 +187,15 @@ static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; > static const enum AVPixelFormat rgb_formats[] = { > AV_PIX_FMT_RGB24, > AV_PIX_FMT_BGR24, > + AV_PIX_FMT_RGBA, > + AV_PIX_FMT_BGRA, > + AV_PIX_FMT_ABGR, > + AV_PIX_FMT_ARGB, > }; > > static void check_rgb_to_y(struct SwsContext *ctx) > { > - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); > + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); > LOCAL_ALIGNED_32(uint8_t, dst0_y, [MAX_LINE_SIZE * 2]); > LOCAL_ALIGNED_32(uint8_t, dst1_y, [MAX_LINE_SIZE * 2]); > > @@ -199,7 +203,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) > const uint8_t *unused1, const uint8_t *unused2, int width, > uint32_t *rgb2yuv, void *opq); > > - randomize_buffers(src, MAX_LINE_SIZE * 3); > + randomize_buffers(src, MAX_LINE_SIZE * 4); > > for (int i = 0; i < FF_ARRAY_ELEMS(rgb_formats); i++) { > const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(rgb_formats[i]); > @@ -220,7 +224,10 @@ static void check_rgb_to_y(struct SwsContext *ctx) > if (memcmp(dst0_y, dst1_y, w * 2)) > fail(); > > - bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); > + if (desc->nb_components == 3 || > + // only bench native endian formats > + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) > + bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); > } > } > } > @@ -228,7 +235,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) > > static void check_rgb_to_uv(struct SwsContext *ctx) > { > - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); > + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); Doesn't this make the test less strict wrt overreading for tests that are only supposed to use MAX_LINE_SIZE * 3? > LOCAL_ALIGNED_32(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]); > LOCAL_ALIGNED_32(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]); > LOCAL_ALIGNED_32(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]); > @@ -238,7 +245,7 @@ static void check_rgb_to_uv(struct SwsContext *ctx) > const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, > int width, uint32_t *pal, void *opq); > > - randomize_buffers(src, MAX_LINE_SIZE * 3); > + randomize_buffers(src, MAX_LINE_SIZE * 4); > > for (int i = 0; i < 2 * FF_ARRAY_ELEMS(rgb_formats); i++) { > enum AVPixelFormat src_fmt = rgb_formats[i / 2]; > @@ -266,7 +273,10 @@ static void check_rgb_to_uv(struct SwsContext *ctx) > if (memcmp(dst0_u, dst1_u, w * 2) || memcmp(dst0_v, dst1_v, w * 2)) > fail(); > > - bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); > + if (desc->nb_components == 3 || > + // only bench native endian formats > + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) > + bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); > } > } > } _______________________________________________ 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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 to yuv 2024-06-05 20:10 ` Andreas Rheinhardt @ 2024-06-05 20:20 ` James Almer 2024-06-05 21:00 ` Andreas Rheinhardt 0 siblings, 1 reply; 6+ messages in thread From: James Almer @ 2024-06-05 20:20 UTC (permalink / raw) To: ffmpeg-devel On 6/5/2024 5:10 PM, Andreas Rheinhardt wrote: > James Almer: >> Test all four pixel formats, but only bench the two native endian ones for a >> given target. >> >> Signed-off-by: James Almer <jamrial@gmail.com> >> --- >> tests/checkasm/sw_rgb.c | 22 ++++++++++++++++------ >> 1 file changed, 16 insertions(+), 6 deletions(-) >> >> diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c >> index b51d0836c3..cba6b87add 100644 >> --- a/tests/checkasm/sw_rgb.c >> +++ b/tests/checkasm/sw_rgb.c >> @@ -187,11 +187,15 @@ static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; >> static const enum AVPixelFormat rgb_formats[] = { >> AV_PIX_FMT_RGB24, >> AV_PIX_FMT_BGR24, >> + AV_PIX_FMT_RGBA, >> + AV_PIX_FMT_BGRA, >> + AV_PIX_FMT_ABGR, >> + AV_PIX_FMT_ARGB, >> }; >> >> static void check_rgb_to_y(struct SwsContext *ctx) >> { >> - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); >> + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); >> LOCAL_ALIGNED_32(uint8_t, dst0_y, [MAX_LINE_SIZE * 2]); >> LOCAL_ALIGNED_32(uint8_t, dst1_y, [MAX_LINE_SIZE * 2]); >> >> @@ -199,7 +203,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) >> const uint8_t *unused1, const uint8_t *unused2, int width, >> uint32_t *rgb2yuv, void *opq); >> >> - randomize_buffers(src, MAX_LINE_SIZE * 3); >> + randomize_buffers(src, MAX_LINE_SIZE * 4); >> >> for (int i = 0; i < FF_ARRAY_ELEMS(rgb_formats); i++) { >> const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(rgb_formats[i]); >> @@ -220,7 +224,10 @@ static void check_rgb_to_y(struct SwsContext *ctx) >> if (memcmp(dst0_y, dst1_y, w * 2)) >> fail(); >> >> - bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); >> + if (desc->nb_components == 3 || >> + // only bench native endian formats >> + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) >> + bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); >> } >> } >> } >> @@ -228,7 +235,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) >> >> static void check_rgb_to_uv(struct SwsContext *ctx) >> { >> - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); >> + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); > > Doesn't this make the test less strict wrt overreading for tests that > are only supposed to use MAX_LINE_SIZE * 3? Probably. Want me to add a second src buffer for this? > >> LOCAL_ALIGNED_32(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]); >> LOCAL_ALIGNED_32(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]); >> LOCAL_ALIGNED_32(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]); >> @@ -238,7 +245,7 @@ static void check_rgb_to_uv(struct SwsContext *ctx) >> const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, >> int width, uint32_t *pal, void *opq); >> >> - randomize_buffers(src, MAX_LINE_SIZE * 3); >> + randomize_buffers(src, MAX_LINE_SIZE * 4); >> >> for (int i = 0; i < 2 * FF_ARRAY_ELEMS(rgb_formats); i++) { >> enum AVPixelFormat src_fmt = rgb_formats[i / 2]; >> @@ -266,7 +273,10 @@ static void check_rgb_to_uv(struct SwsContext *ctx) >> if (memcmp(dst0_u, dst1_u, w * 2) || memcmp(dst0_v, dst1_v, w * 2)) >> fail(); >> >> - bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); >> + if (desc->nb_components == 3 || >> + // only bench native endian formats >> + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) >> + bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); >> } >> } >> } > > _______________________________________________ > 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". _______________________________________________ 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] 6+ messages in thread
* Re: [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 to yuv 2024-06-05 20:20 ` James Almer @ 2024-06-05 21:00 ` Andreas Rheinhardt 2024-06-05 21:13 ` James Almer 0 siblings, 1 reply; 6+ messages in thread From: Andreas Rheinhardt @ 2024-06-05 21:00 UTC (permalink / raw) To: ffmpeg-devel James Almer: > On 6/5/2024 5:10 PM, Andreas Rheinhardt wrote: >> James Almer: >>> Test all four pixel formats, but only bench the two native endian >>> ones for a >>> given target. >>> >>> Signed-off-by: James Almer <jamrial@gmail.com> >>> --- >>> tests/checkasm/sw_rgb.c | 22 ++++++++++++++++------ >>> 1 file changed, 16 insertions(+), 6 deletions(-) >>> >>> diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c >>> index b51d0836c3..cba6b87add 100644 >>> --- a/tests/checkasm/sw_rgb.c >>> +++ b/tests/checkasm/sw_rgb.c >>> @@ -187,11 +187,15 @@ static const int input_sizes[] = {8, 128, 1080, >>> MAX_LINE_SIZE}; >>> static const enum AVPixelFormat rgb_formats[] = { >>> AV_PIX_FMT_RGB24, >>> AV_PIX_FMT_BGR24, >>> + AV_PIX_FMT_RGBA, >>> + AV_PIX_FMT_BGRA, >>> + AV_PIX_FMT_ABGR, >>> + AV_PIX_FMT_ARGB, >>> }; >>> static void check_rgb_to_y(struct SwsContext *ctx) >>> { >>> - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); >>> + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); >>> LOCAL_ALIGNED_32(uint8_t, dst0_y, [MAX_LINE_SIZE * 2]); >>> LOCAL_ALIGNED_32(uint8_t, dst1_y, [MAX_LINE_SIZE * 2]); >>> @@ -199,7 +203,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) >>> const uint8_t *unused1, const uint8_t *unused2, >>> int width, >>> uint32_t *rgb2yuv, void *opq); >>> - randomize_buffers(src, MAX_LINE_SIZE * 3); >>> + randomize_buffers(src, MAX_LINE_SIZE * 4); >>> for (int i = 0; i < FF_ARRAY_ELEMS(rgb_formats); i++) { >>> const AVPixFmtDescriptor *desc = >>> av_pix_fmt_desc_get(rgb_formats[i]); >>> @@ -220,7 +224,10 @@ static void check_rgb_to_y(struct SwsContext *ctx) >>> if (memcmp(dst0_y, dst1_y, w * 2)) >>> fail(); >>> - bench_new(dst1_y, src, NULL, NULL, w, >>> ctx->input_rgb2yuv_table, NULL); >>> + if (desc->nb_components == 3 || >>> + // only bench native endian formats >>> + (ctx->srcFormat == AV_PIX_FMT_RGB32 || >>> ctx->srcFormat == AV_PIX_FMT_RGB32_1)) >>> + bench_new(dst1_y, src, NULL, NULL, w, >>> ctx->input_rgb2yuv_table, NULL); >>> } >>> } >>> } >>> @@ -228,7 +235,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) >>> static void check_rgb_to_uv(struct SwsContext *ctx) >>> { >>> - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); >>> + LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 4]); >> >> Doesn't this make the test less strict wrt overreading for tests that >> are only supposed to use MAX_LINE_SIZE * 3? > > Probably. Want me to add a second src buffer for this? > Proceed as you wish. >> >>> LOCAL_ALIGNED_32(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]); >>> LOCAL_ALIGNED_32(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]); >>> LOCAL_ALIGNED_32(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]); >>> @@ -238,7 +245,7 @@ static void check_rgb_to_uv(struct SwsContext *ctx) >>> const uint8_t *src1, const uint8_t *src2, const >>> uint8_t *src3, >>> int width, uint32_t *pal, void *opq); >>> - randomize_buffers(src, MAX_LINE_SIZE * 3); >>> + randomize_buffers(src, MAX_LINE_SIZE * 4); >>> for (int i = 0; i < 2 * FF_ARRAY_ELEMS(rgb_formats); i++) { >>> enum AVPixelFormat src_fmt = rgb_formats[i / 2]; >>> @@ -266,7 +273,10 @@ static void check_rgb_to_uv(struct SwsContext *ctx) >>> if (memcmp(dst0_u, dst1_u, w * 2) || memcmp(dst0_v, >>> dst1_v, w * 2)) >>> fail(); >>> - bench_new(dst1_u, dst1_v, NULL, src, src, w, >>> ctx->input_rgb2yuv_table, NULL); >>> + if (desc->nb_components == 3 || >>> + // only bench native endian formats >>> + (ctx->srcFormat == AV_PIX_FMT_RGB32 || >>> ctx->srcFormat == AV_PIX_FMT_RGB32_1)) >>> + bench_new(dst1_u, dst1_v, NULL, src, src, w, >>> ctx->input_rgb2yuv_table, NULL); >>> } >>> } >>> } >> >> _______________________________________________ >> 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". > _______________________________________________ > 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". _______________________________________________ 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] 6+ messages in thread
* [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 to yuv 2024-06-05 21:00 ` Andreas Rheinhardt @ 2024-06-05 21:13 ` James Almer 0 siblings, 0 replies; 6+ messages in thread From: James Almer @ 2024-06-05 21:13 UTC (permalink / raw) To: ffmpeg-devel Test all four pixel formats, but only bench the two native endian ones for a given target. Signed-off-by: James Almer <jamrial@gmail.com> --- tests/checkasm/sw_rgb.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c index b51d0836c3..378412e9d2 100644 --- a/tests/checkasm/sw_rgb.c +++ b/tests/checkasm/sw_rgb.c @@ -187,11 +187,16 @@ static const int input_sizes[] = {8, 128, 1080, MAX_LINE_SIZE}; static const enum AVPixelFormat rgb_formats[] = { AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGBA, + AV_PIX_FMT_BGRA, + AV_PIX_FMT_ABGR, + AV_PIX_FMT_ARGB, }; static void check_rgb_to_y(struct SwsContext *ctx) { - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src24, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src32, [MAX_LINE_SIZE * 4]); LOCAL_ALIGNED_32(uint8_t, dst0_y, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst1_y, [MAX_LINE_SIZE * 2]); @@ -199,7 +204,8 @@ static void check_rgb_to_y(struct SwsContext *ctx) const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *rgb2yuv, void *opq); - randomize_buffers(src, MAX_LINE_SIZE * 3); + randomize_buffers(src24, MAX_LINE_SIZE * 3); + randomize_buffers(src32, MAX_LINE_SIZE * 4); for (int i = 0; i < FF_ARRAY_ELEMS(rgb_formats); i++) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(rgb_formats[i]); @@ -211,6 +217,7 @@ static void check_rgb_to_y(struct SwsContext *ctx) int w = input_sizes[j]; if (check_func(ctx->lumToYV12, "%s_to_y_%d", desc->name, w)) { + const uint8_t *src = desc->nb_components == 3 ? src24 : src32; memset(dst0_y, 0xFA, MAX_LINE_SIZE * 2); memset(dst1_y, 0xFA, MAX_LINE_SIZE * 2); @@ -220,7 +227,10 @@ static void check_rgb_to_y(struct SwsContext *ctx) if (memcmp(dst0_y, dst1_y, w * 2)) fail(); - bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); + if (desc->nb_components == 3 || + // only bench native endian formats + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) + bench_new(dst1_y, src, NULL, NULL, w, ctx->input_rgb2yuv_table, NULL); } } } @@ -228,7 +238,8 @@ static void check_rgb_to_y(struct SwsContext *ctx) static void check_rgb_to_uv(struct SwsContext *ctx) { - LOCAL_ALIGNED_32(uint8_t, src, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src24, [MAX_LINE_SIZE * 3]); + LOCAL_ALIGNED_32(uint8_t, src32, [MAX_LINE_SIZE * 4]); LOCAL_ALIGNED_32(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]); LOCAL_ALIGNED_32(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]); @@ -238,7 +249,8 @@ static void check_rgb_to_uv(struct SwsContext *ctx) const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, int width, uint32_t *pal, void *opq); - randomize_buffers(src, MAX_LINE_SIZE * 3); + randomize_buffers(src24, MAX_LINE_SIZE * 3); + randomize_buffers(src32, MAX_LINE_SIZE * 4); for (int i = 0; i < 2 * FF_ARRAY_ELEMS(rgb_formats); i++) { enum AVPixelFormat src_fmt = rgb_formats[i / 2]; @@ -255,6 +267,7 @@ static void check_rgb_to_uv(struct SwsContext *ctx) if (check_func(ctx->chrToYV12, "%s_to_uv%s_%d", desc->name, ctx->chrSrcHSubSample ? "_half" : "", input_sizes[j])) { + const uint8_t *src = desc->nb_components == 3 ? src24 : src32; memset(dst0_u, 0xFF, MAX_LINE_SIZE * 2); memset(dst0_v, 0xFF, MAX_LINE_SIZE * 2); memset(dst1_u, 0xFF, MAX_LINE_SIZE * 2); @@ -266,7 +279,10 @@ static void check_rgb_to_uv(struct SwsContext *ctx) if (memcmp(dst0_u, dst1_u, w * 2) || memcmp(dst0_v, dst1_v, w * 2)) fail(); - bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); + if (desc->nb_components == 3 || + // only bench native endian formats + (ctx->srcFormat == AV_PIX_FMT_RGB32 || ctx->srcFormat == AV_PIX_FMT_RGB32_1)) + bench_new(dst1_u, dst1_v, NULL, src, src, w, ctx->input_rgb2yuv_table, NULL); } } } -- 2.45.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] 6+ messages in thread
end of thread, other threads:[~2024-06-05 21:14 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-06-05 18:31 [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/bgr32 to yuv James Almer 2024-06-05 20:08 ` [FFmpeg-devel] [PATCH] checkasm/sw_rgb: test rgb32/rgb32_1 " James Almer 2024-06-05 20:10 ` Andreas Rheinhardt 2024-06-05 20:20 ` James Almer 2024-06-05 21:00 ` Andreas Rheinhardt 2024-06-05 21:13 ` James Almer
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