diff options
author | David Conrad <lessen42@gmail.com> | 2009-05-22 22:01:50 +0000 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2009-05-22 22:01:50 +0000 |
commit | cc0aae43437374767ebda236649d983e69bdaf87 (patch) | |
tree | e528145bbb386db7e4f85b8ea63680df72b66323 /libavcodec/libtheoraenc.c | |
parent | ef516f73778aee928826e7158ad0506d26ed9ab0 (diff) | |
download | ffmpeg-cc0aae43437374767ebda236649d983e69bdaf87.tar.gz |
Fix libtheora encoding for non-mod16 sizes
Originally committed as revision 18899 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/libtheoraenc.c')
-rw-r--r-- | libavcodec/libtheoraenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index dbc98e3b5e..f17834e994 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -87,12 +87,12 @@ static av_cold int encode_init(AVCodecContext* avc_context) /* Set up the theora_info struct */ theora_info_init( &t_info ); - t_info.width = avc_context->width; - t_info.height = avc_context->height; + t_info.width = FFALIGN(avc_context->width, 16); + t_info.height = FFALIGN(avc_context->height, 16); t_info.frame_width = avc_context->width; t_info.frame_height = avc_context->height; t_info.offset_x = 0; - t_info.offset_y = 0; + t_info.offset_y = avc_context->height & 0xf; /* Swap numerator and denominator as time_base in AVCodecContext gives the * time period between frames, but theora_info needs the framerate. */ t_info.fps_numerator = avc_context->time_base.den; @@ -186,8 +186,8 @@ static int encode_frame( return -1; } - t_yuv_buffer.y_width = avc_context->width; - t_yuv_buffer.y_height = avc_context->height; + t_yuv_buffer.y_width = FFALIGN(avc_context->width, 16); + t_yuv_buffer.y_height = FFALIGN(avc_context->height, 16); t_yuv_buffer.y_stride = frame->linesize[0]; t_yuv_buffer.uv_width = t_yuv_buffer.y_width / 2; t_yuv_buffer.uv_height = t_yuv_buffer.y_height / 2; |