[FFmpeg-devel] [PATCH] yuv4mpeg: correctly handle chroma for odd luma sizes.

Clément Bœsch ubitux at gmail.com
Tue Jun 25 00:42:03 CEST 2013


On Mon, Jun 24, 2013 at 03:31:28PM -0700, Ronald S. Bultje wrote:
> From: "Ronald S. Bultje" <rsbultje at gmail.com>
> 
> ---
>  libavformat/yuv4mpeg.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
> index bf48230..bac6664 100644
> --- a/libavformat/yuv4mpeg.c
> +++ b/libavformat/yuv4mpeg.c
> @@ -217,8 +217,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
>          // Adjust for smaller Cb and Cr planes
>          av_pix_fmt_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
>                                           &v_chroma_shift);
> -        width  >>= h_chroma_shift;
> -        height >>= v_chroma_shift;
> +        width  = -((-width)  >> h_chroma_shift);
> +        height = -((-height) >> v_chroma_shift);

FF_CEIL_RSHIFT()

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130625/03023e4c/attachment.asc>


More information about the ffmpeg-devel mailing list