summaryrefslogtreecommitdiffstats
path: root/video/filter
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 /video/filter
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 'video/filter')
-rw-r--r--video/filter/vf_vapoursynth.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/video/filter/vf_vapoursynth.c b/video/filter/vf_vapoursynth.c
index b7ed163c82..ea15506254 100644
--- a/video/filter/vf_vapoursynth.c
+++ b/video/filter/vf_vapoursynth.c
@@ -111,25 +111,25 @@ struct script_driver {
struct mpvs_fmt {
VSPresetFormat vs;
- int bits, cw, ch;
+ int bits, xs, ys;
};
static const struct mpvs_fmt mpvs_fmt_table[] = {
- {pfYUV420P8, 8, 2, 2},
- {pfYUV420P9, 9, 2, 2},
- {pfYUV420P10, 10, 2, 2},
- {pfYUV420P16, 16, 2, 2},
- {pfYUV422P8, 8, 2, 1},
- {pfYUV422P9, 9, 2, 1},
- {pfYUV422P10, 10, 2, 1},
- {pfYUV422P16, 16, 2, 1},
- {pfYUV410P8, 8, 4, 4},
- {pfYUV411P8, 8, 4, 1},
- {pfYUV440P8, 8, 1, 2},
- {pfYUV444P8, 8, 1, 1},
- {pfYUV444P9, 9, 1, 1},
- {pfYUV444P10, 10, 1, 1},
- {pfYUV444P16, 16, 1, 1},
+ {pfYUV420P8, 8, 1, 1},
+ {pfYUV420P9, 9, 1, 1},
+ {pfYUV420P10, 10, 1, 1},
+ {pfYUV420P16, 16, 1, 1},
+ {pfYUV422P8, 8, 1, 0},
+ {pfYUV422P9, 9, 1, 0},
+ {pfYUV422P10, 10, 1, 0},
+ {pfYUV422P16, 16, 1, 0},
+ {pfYUV410P8, 8, 2, 2},
+ {pfYUV411P8, 8, 2, 0},
+ {pfYUV440P8, 8, 0, 1},
+ {pfYUV444P8, 8, 0, 0},
+ {pfYUV444P9, 9, 0, 0},
+ {pfYUV444P10, 10, 0, 0},
+ {pfYUV444P16, 16, 0, 0},
{pfNone}
};
@@ -140,7 +140,7 @@ static bool compare_fmt(int imgfmt, const struct mpvs_fmt *vs)
return false;
if (rfmt.component_pad > 0)
return false;
- if (rfmt.chroma_w != vs->cw || rfmt.chroma_h != vs->ch)
+ if (rfmt.chroma_xs != vs->xs || rfmt.chroma_ys != vs->ys)
return false;
if (rfmt.component_size * 8 + rfmt.component_pad != vs->bits)
return false;