mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
mp_image: add mp_image_crop()
Actually stolen from draw_bmp.c.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user