From 0f8f6a665b7bf7fc8786541eff518bacddbe1442 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 21 Apr 2020 23:11:23 +0200 Subject: 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. --- video/out/gpu/ra.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video/out/gpu') diff --git a/video/out/gpu/ra.c b/video/out/gpu/ra.c index 45abf5cba3..c4d3b53284 100644 --- a/video/out/gpu/ra.c +++ b/video/out/gpu/ra.c @@ -309,8 +309,8 @@ bool ra_get_imgfmt_desc(struct ra *ra, int imgfmt, struct ra_imgfmt_desc *out) return false; ctype = res.planes[n]->ctype; } - res.chroma_w = regfmt.chroma_w; - res.chroma_h = regfmt.chroma_h; + res.chroma_w = 1 << regfmt.chroma_xs; + res.chroma_h = 1 << regfmt.chroma_ys; goto supported; } -- cgit v1.2.3