diff options
author | wm4 <wm4@nowhere> | 2012-12-25 22:29:49 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-01-13 20:04:12 +0100 |
commit | 717d904bbc20e06e2c6c71613d59e065845ff209 (patch) | |
tree | 6f758cff6d98e579b767952894023997618c44d5 /video/img_format.c | |
parent | ded932dbd40e326a8d42acb8c4b8297046f08695 (diff) | |
download | mpv-717d904bbc20e06e2c6c71613d59e065845ff209.tar.bz2 mpv-717d904bbc20e06e2c6c71613d59e065845ff209.tar.xz |
mp_image: add mp_image_crop()
Actually stolen from draw_bmp.c.
Diffstat (limited to 'video/img_format.c')
-rw-r--r-- | video/img_format.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/img_format.c b/video/img_format.c index 8a286be9fc..a6d92f1a1f 100644 --- a/video/img_format.c +++ b/video/img_format.c @@ -210,6 +210,12 @@ static struct mp_imgfmt_desc get_avutil_fmt(enum PixelFormat fmt) desc.ys[p] = (p == 1 || p == 2) ? desc.chroma_ys : 0; } + desc.align_x = 1 << desc.chroma_xs; + desc.align_y = 1 << desc.chroma_ys; + + if ((desc.bpp[0] % 8) != 0) + desc.align_x = 8 / desc.bpp[0]; // expect power of 2 + return desc; } |