From ab94c64ed2d8b90bd7b0c348e79c2d8b8d055ee6 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 19 Dec 2012 12:04:32 +0100 Subject: mp_image: simplify image allocation mp_image_alloc_planes() allocated images with minimal stride, even if the resulting stride was unaligned. It was the responsibility of vf_get_image() to set an image's width to something larger than required to get an aligned stride, and then crop it. Always allocate with aligned strides instead. Get rid of IMGFMT_IF09 special handling. This format is not used anymore. (IF09 has 4x4 chroma sub-sampling, and that is what it was mainly used for - this is still supported.) Get rid of swapped chroma plane allocation. This is not used anywhere, and VOs like vo_xv, vo_direct3d and vo_sdl do their own swapping. Always round chroma width/height up instead of down. Consider 4:2:0 and an uneven image size. For luma, the size was left uneven, and the chroma size was rounded down. This doesn't make sense, because chroma would be missing for the bottom/right border. Remove mp_image_new_empty() and mp_image_alloc_planes(), they were not used anymore, except in draw_bmp.c. (It's still allowed to setup mp_images manually, you just can't allocate image data with them anymore - this is also done in draw_bmp.c.) --- video/decode/vd_lavc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 7fd7437a3b..2d47cb9c88 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -61,8 +61,8 @@ static const vd_info_t info = { #include "libavcodec/avcodec.h" #include "lavc.h" -#if AVPALETTE_SIZE > 1024 -#error palette too large, adapt libmpcodecs/vf.c:vf_get_image +#if AVPALETTE_SIZE != MP_PALETTE_SIZE +#error palette too large, adapt video/mp_image.h:MP_PALETTE_SIZE #endif #include "core/m_option.h" -- cgit v1.2.3