[FFmpeg-devel] [PATCH] move ff_mpeg1_decode_block_intra() to mpeg12.h

Benoit Fouet benoit.fouet
Mon May 11 14:56:55 CEST 2009


On 05/11/2009 02:56 PM, Diego Biurrun wrote:
> On Mon, May 11, 2009 at 02:47:14PM +0200, Benoit Fouet wrote:
>   
>> On 05/11/2009 01:52 PM, Diego Biurrun wrote:
>>     
>>> On Mon, May 11, 2009 at 09:18:26AM +0200, Benoit Fouet wrote:
>>>   
>>>       
>>>> On 05/09/2009 03:26 PM, Diego Biurrun wrote:
>>>>     
>>>>         
>>>>> $attached moves the inline function ff_mpeg1_decode_block_intra() to
>>>>> mpeg12.h and makes it static.
>>>>>
>>>>> This removes a bunch of warnings of the type
>>>>>
>>>>> mpeg12.h:59: warning: inline function 'ff_mpeg1_decode_block_intra' declared but never defined
>>>>> mpeg12.h:59: warning: inline function 'ff_mpeg1_decode_block_intra' declared but never defined
>>>>>
>>>>> IIRC extern inline functions cause C99 vs. gcc troubles.  The library
>>>>> size decreases slightly with my patch applied:
>>>>>
>>>>> -rw-rw-r-- 1 diego diego 26905890 2009-05-09 15:23 libavcodec.vanilla/libavcodec.a
>>>>> -rw-rw-r-- 1 diego diego 26897058 2009-05-09 15:16 libavcodec/libavcodec.a
>>>>>
>>>>> Is this an acceptable solution?
>>>>>       
>>>>>           
>>>> $ find . -name '*.[c,h]' -exec grep -Hn ff_mpeg1_decode_block_intra {} \;
>>>> ./libavcodec/mpeg12.c:322:                if
>>>> (ff_mpeg1_decode_block_intra(s, *s->pblocks[i], i) < 0)
>>>> ./libavcodec/mpeg12.c:607:inline int
>>>> ff_mpeg1_decode_block_intra(MpegEncContext *s,
>>>> ./libavcodec/mpeg12.h:59:extern inline int
>>>> ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n);
>>>> ./libavcodec/eatqi.c:66:        ff_mpeg1_decode_block_intra(s, block[n], n);
>>>>
>>>> I guess the last hit answers your question :)
>>>>     
>>>>         
>>> I'm not following you, elaborate please.
>>>       
>> how is EA tqi supposed to work if you move the function it uses to
>> somewhere it cannot see it ?
>>     
>
> That would not even compile.
>
> Read my patch again.  It moves the function from mpeg12.c to mpeg12.h.
> mpeg12.h is #included by eatqi.c.  Thus the function is
> visible/available where needed.
>
>   

indeed, I read it just the opposite way...

Ben



More information about the ffmpeg-devel mailing list