[FFmpeg-devel] [PATCH] Fix non-mod16 libtheora encoding

David Conrad lessen42
Fri May 22 02:54:30 CEST 2009


On May 21, 2009, at 6:56 PM, David Conrad wrote:

> On May 21, 2009, at 6:01 PM, M?ns Rullg?rd wrote:
>
>> David Conrad <lessen42 at gmail.com> writes:
>>
>>> Hi,
>>>
>>> Currently using non-mod16 sizes produces garbage.
>>>
>>>
>>> commit 7af4d351600878e1c37467837d8d10c226e2b805
>>> Author: David Conrad <lessen42 at gmail.com>
>>> Date:   Thu May 21 17:38:44 2009 -0400
>>>
>>>   Fix libtheora encoding for non-mod16 sizes
>>>
>>> diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c
>>> index dbc98e3..ef8b6aa 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 = (avc_context->width + 15) & 0xFFFFFFF0;
>>> +    t_info.height = (avc_context->height + 15) & 0xFFFFFFF0;
>>
>> Isn't there a macro for that somewhere?  If not, & ~15 is both easier
>> to read and safe against non-32-bit types.
>
> It doesn't look like it; patch adding and using it where I found  
> attached

Loren pointed me at the ALIGN macros in libavcodec/utils.c and  
libavfilter/defaults.c, so here's a more general macro.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffmpeg-pad-mod16.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090521/33391c29/attachment.txt>
-------------- next part --------------




More information about the ffmpeg-devel mailing list