Re: [FFmpeg-devel] [PATCH] tests/imgutils: test the output of av_image_fill_* functions

2020-07-29 Thread James Almer
On 7/27/2020 5:03 PM, James Almer wrote:
> Signed-off-by: James Almer 
> ---
> Should prevent regressions like the one fixed in 5ce47d0aad
>  libavutil/tests/imgutils.c |  38 
>  tests/ref/fate/imgutils| 183 +
>  2 files changed, 221 insertions(+)

Will apply soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH] tests/imgutils: test the output of av_image_fill_* functions

2020-07-27 Thread James Almer
Signed-off-by: James Almer 
---
Should prevent regressions like the one fixed in 5ce47d0aad
 libavutil/tests/imgutils.c |  38 
 tests/ref/fate/imgutils| 183 +
 2 files changed, 221 insertions(+)

diff --git a/libavutil/tests/imgutils.c b/libavutil/tests/imgutils.c
index 571045c857..748bd6c9d2 100644
--- a/libavutil/tests/imgutils.c
+++ b/libavutil/tests/imgutils.c
@@ -22,6 +22,7 @@
 
 int main(void)
 {
+const AVPixFmtDescriptor *desc = NULL;
 int64_t x, y;
 
 for (y = -1; yname);
+for (i = 0; i < 4 && data[i]; i++);
+printf("planes: %d", i);
+// Test the output of av_image_fill_linesizes()
+printf(", linesizes:");
+for (i = 0; i < 4; i++)
+printf(" %3d", linesizes[i]);
+// Test the output of av_image_fill_plane_sizes()
+printf(", plane_sizes:");
+for (i = 0; i < 4; i++)
+printf(" %5"SIZE_SPECIFIER, sizes[i]);
+// Test the output of av_image_fill_pointers()
+for (i = 0; i < 3 && data[i + 1]; i++)
+offsets[i] = data[i + 1] - data[i];
+printf(", plane_offsets:");
+for (i = 0; i < 3; i++)
+printf(" %5"PTRDIFF_SPECIFIER, offsets[i]);
+printf(", total_size: %d\n", total_size);
+}
 
 return 0;
 }
diff --git a/tests/ref/fate/imgutils b/tests/ref/fate/imgutils
index aba482221f..c968ea0e85 100644
--- a/tests/ref/fate/imgutils
+++ b/tests/ref/fate/imgutils
@@ -53,3 +53,186 @@
 000
 000
 000
+
+yuv420p planes: 3, linesizes:  64  32  32   0, plane_sizes:  3072   
768   768 0, plane_offsets:  3072   768 0, total_size: 4608
+yuyv422 planes: 1, linesizes: 128   0   0   0, plane_sizes:  6144 
0 0 0, plane_offsets: 0 0 0, total_size: 6144
+rgb24   planes: 1, linesizes: 192   0   0   0, plane_sizes:  9216 
0 0 0, plane_offsets: 0 0 0, total_size: 9216
+bgr24   planes: 1, linesizes: 192   0   0   0, plane_sizes:  9216 
0 0 0, plane_offsets: 0 0 0, total_size: 9216
+yuv422p planes: 3, linesizes:  64  32  32   0, plane_sizes:  3072  
1536  1536 0, plane_offsets:  3072  1536 0, total_size: 6144
+yuv444p planes: 3, linesizes:  64  64  64   0, plane_sizes:  3072  
3072  3072 0, plane_offsets:  3072  3072 0, total_size: 9216
+yuv410p planes: 3, linesizes:  64  16  16   0, plane_sizes:  3072   
192   192 0, plane_offsets:  3072   192 0, total_size: 3456
+yuv411p planes: 3, linesizes:  64  16  16   0, plane_sizes:  3072   
768   768 0, plane_offsets:  3072   768 0, total_size: 4608
+grayplanes: 2, linesizes:  64   0   0   0, plane_sizes:  3072  
1024 0 0, plane_offsets:  3072 0 0, total_size: 4096
+monow   planes: 1, linesizes:   8   0   0   0, plane_sizes:   384 
0 0 0, plane_offsets: 0 0 0, total_size: 384
+monob   planes: 1, linesizes:   8   0   0   0, plane_sizes:   384 
0 0 0, plane_offsets: 0 0 0, total_size: 384
+pal8planes: 2, linesizes:  64   0   0   0, plane_sizes:  3072  
1024 0 0, plane_offsets:  3072 0 0, total_size: 4096
+yuvj420pplanes: 3, linesizes:  64  32  32   0, plane_sizes:  3072   
768   768 0, plane_offsets:  3072   768 0, total_size: 4608
+yuvj422pplanes: 3, linesizes:  64  32  32   0, plane_sizes:  3072  
1536  1536 0, plane_offsets:  3072  1536 0, total_size: 6144
+yuvj444pplanes: 3, linesizes:  64  64  64   0, plane_sizes:  3072  
3072  3072 0, plane_offsets:  3072  3072 0, total_size: 9216
+uyvy422 planes: 1, linesizes: 128   0   0   0, plane_sizes:  6144 
0 0 0, plane_offsets: 0 0 0, total_size: 6144
+uyyvyy411   planes: 1, linesizes:  96   0   0   0, plane_sizes:  4608 
0 0 0, plane_offsets: 0 0 0, total_size: 4608
+bgr8planes: 2, linesizes:  64   0   0   0, plane_sizes:  3072  
1024 0 0, plane_offsets:  3072 0 0, total_size: 4096
+bgr4planes: 1, linesizes:  32   0   0   0, plane_sizes:  1536 
0 0 0, plane_offsets: 0 0 0, total_size: 1536
+bgr4_byte   planes: 2, linesizes:  64   0   0   0, plane_sizes:  3072  
1024 0 0, plane_offsets:  3072 0 0, total_size: 4096
+rgb8planes: 2, linesizes:  64   0   0   0, plane_sizes:  3072  
1024 0 0, plane_offsets:  3072 0 0, total_size: 4096
+rgb4planes: 1, linesizes:  32   0   0   0, plane_sizes:  1536 
0 0 0, plane_offsets: 0 0 0, total_size: 1536
+rgb4_byte   planes: 2, linesizes:  64   0   0   0, plane_sizes:  3072  
1024 0 0, plane_offsets: