summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-21 23:11:23 +0200
committerwm4 <wm4@nowhere>2020-04-23 13:24:35 +0200
commit0f8f6a665b7bf7fc8786541eff518bacddbe1442 (patch)
treebb47ac337b6a249c2036910c599aaeb27728efa3 /test
parent7cb83593c2a032e91f82a90d0a9de8cf4d0fb158 (diff)
downloadmpv-0f8f6a665b7bf7fc8786541eff518bacddbe1442.tar.bz2
mpv-0f8f6a665b7bf7fc8786541eff518bacddbe1442.tar.xz
video: change chroma_w/chroma_h fields to use shift instead of size
When I added mp_regular_imgfmt, I made the chroma subsampling use the actual chroma division factor, instead of a shift (log2 of the actual value). I had some ideas about how this was (probably?) more intuitive and general. But nothing ever uses non-power of 2 subsampling (except jpeg in rare cases apparently, because the world is a bad place). Change the fields back to use shifts and rename them to avoid mistakes.
Diffstat (limited to 'test')
-rw-r--r--test/img_format.c3
-rw-r--r--test/scale_test.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/test/img_format.c b/test/img_format.c
index cf5bbb3af2..2e4e899203 100644
--- a/test/img_format.c
+++ b/test/img_format.c
@@ -144,7 +144,8 @@ static void run(struct test_ctx *ctx)
fprintf(f, " Regular: planes=%d compbytes=%d bitpad=%d "
"chroma=%dx%d ctype=%s\n",
reg.num_planes, reg.component_size, reg.component_pad,
- reg.chroma_w, reg.chroma_h, comp_type(reg.component_type));
+ 1 << reg.chroma_xs, 1 << reg.chroma_ys,
+ comp_type(reg.component_type));
for (int n = 0; n < reg.num_planes; n++) {
struct mp_regular_imgfmt_plane *plane = &reg.planes[n];
fprintf(f, " %d: {", n);
diff --git a/test/scale_test.c b/test/scale_test.c
index a0f31ec81a..912ecbcc22 100644
--- a/test/scale_test.c
+++ b/test/scale_test.c
@@ -18,8 +18,6 @@ static struct mp_image *gen_repack_test_img(int w, int h, int bytes, bool rgb,
{1, {rgb ? 1 : 3}},
{1, {4}},
},
- .chroma_w = 1,
- .chroma_h = 1,
};
int mpfmt = mp_find_regular_imgfmt(&planar_desc);
assert(mpfmt);