ffmpeg | branch: master | Niklas Haas <g...@haasn.dev> | Tue Feb 25 14:14:39 
2025 +0100| [1707e81073cebd419333b8e115a02d1a9d9588c2] | committer: Niklas Haas

tests/swscale: use yuva444p as reference

Instead of the lossy yuva420p. This does change the results compared to the
status quo, but is more reflective of the actual strength of a conversion,
since it will faithfully measure the round-trip error from subsampling and
upsampling.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1707e81073cebd419333b8e115a02d1a9d9588c2
---

 libswscale/tests/swscale.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c
index a30be077ab..04c07e19c4 100644
--- a/libswscale/tests/swscale.c
+++ b/libswscale/tests/swscale.c
@@ -82,7 +82,7 @@ static int fmt_comps(enum AVPixelFormat fmt)
 
 static void get_mse(int mse[4], const AVFrame *a, const AVFrame *b, int comps)
 {
-    av_assert1(a->format == AV_PIX_FMT_YUVA420P);
+    av_assert1(a->format == AV_PIX_FMT_YUVA444P);
     av_assert1(b->format == a->format);
     av_assert1(b->width == a->width && b->height == a->height);
 
@@ -90,8 +90,8 @@ static void get_mse(int mse[4], const AVFrame *a, const 
AVFrame *b, int comps)
         const int is_chroma = p == 1 || p == 2;
         const int stride_a = a->linesize[p];
         const int stride_b = b->linesize[p];
-        const int w = (a->width + is_chroma) >> is_chroma;
-        const int h = (a->height + is_chroma) >> is_chroma;
+        const int w = a->width;
+        const int h = a->height;
         uint64_t sum = 0;
 
         if (comps & (1 << p)) {
@@ -499,7 +499,7 @@ bad_option:
         goto error;
     ref->width  = opts.w;
     ref->height = opts.h;
-    ref->format = AV_PIX_FMT_YUVA420P;
+    ref->format = AV_PIX_FMT_YUVA444P;
 
     if (sws_scale_frame(sws[0], ref, rgb) < 0)
         goto error;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to