History

Fix libtheora encoding for non-mod16 sizes

Originally committed as revision 18899 to svn://svn.ffmpeg.org/ffmpeg/trunk

David Conrad committed 17 years ago

Commit cc0aae41 parent ef516f71 file · +5 −5Browse files

Unified · Split

libavcodec/libtheoraenc.c+5−5
@@ -87,12 +87,12 @@ static av_cold int encode_init(AVCodecContext* avc_context) · 86 unmodified lines
87 87
88 /* Set up the theora_info struct */88 /* Set up the theora_info struct */
89 theora_info_init( &t_info );89 theora_info_init( &t_info );
90 t_info.width = avc_context->width;90 t_info.width = FFALIGN(avc_context->width, 16);
91 t_info.height = avc_context->height;91 t_info.height = FFALIGN(avc_context->height, 16);
92 t_info.frame_width = avc_context->width;92 t_info.frame_width = avc_context->width;
93 t_info.frame_height = avc_context->height;93 t_info.frame_height = avc_context->height;
94 t_info.offset_x = 0;94 t_info.offset_x = 0;
95 t_info.offset_y = 0;95 t_info.offset_y = avc_context->height & 0xf;
96 /* Swap numerator and denominator as time_base in AVCodecContext gives the96 /* Swap numerator and denominator as time_base in AVCodecContext gives the
97 * time period between frames, but theora_info needs the framerate. */97 * time period between frames, but theora_info needs the framerate. */
98 t_info.fps_numerator = avc_context->time_base.den;98 t_info.fps_numerator = avc_context->time_base.den;
@@ -186,8 +186,8 @@ static int encode_frame( · 87 unmodified lines
186 return -1;186 return -1;
187 }187 }
188 188
189 t_yuv_buffer.y_width = avc_context->width;189 t_yuv_buffer.y_width = FFALIGN(avc_context->width, 16);
190 t_yuv_buffer.y_height = avc_context->height;190 t_yuv_buffer.y_height = FFALIGN(avc_context->height, 16);
191 t_yuv_buffer.y_stride = frame->linesize[0];191 t_yuv_buffer.y_stride = frame->linesize[0];
192 t_yuv_buffer.uv_width = t_yuv_buffer.y_width / 2;192 t_yuv_buffer.uv_width = t_yuv_buffer.y_width / 2;
193 t_yuv_buffer.uv_height = t_yuv_buffer.y_height / 2;193 t_yuv_buffer.uv_height = t_yuv_buffer.y_height / 2;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t