[FFmpeg-devel] discussion around the best way to patch the swscale for Blackfin

Panagiotis Issaris takis.issaris
Fri Jun 22 15:02:35 CEST 2007


Hi Marc,

Op 22-jun-07, om 14:39 heeft Marc Hoffman het volgende geschreven:

> On 6/22/07, Panagiotis Issaris <takis.issaris at uhasselt.be> wrote:
>>
>> Hi Marc,
>>
>> Op 22-jun-07, om 13:51 heeft Marc Hoffman het volgende geschreven:
>>
>>> On 6/22/07, Reimar Doeffinger <Reimar.Doeffinger at stud.uni-
>>> karlsruhe.de>
>>> wrote:
>>>>
>>>> Hello,
>>>> On Thu, Jun 21, 2007 at 11:00:28PM -0400, Marc Hoffman wrote:
>>>>> Does this look like a clean integration for the unscaled variant
>>>>> for the
>>>>> swscale infrastructure?  Seems reasonably clean to me but another
>>>>> set of
>>>>> eyes would be great.
>>>>
>>>> Looks good, except
>>>> 1) ff_bfin_get_unscaled_swscale (c); seems to be indented  
>>>> differently
>>>> than the other code.
>>>> 2) if (ENABLE_BFIN) ff_bfin_get_unscaled_swscale (c); avoids the
>>>> #ifdef
>>>> and matches current dsputil
>>>
>>>
>>>
>>> Hi Reimar,
>>>
>>>    On #1 I can't see that the indentation is incorrect. I must be
>>> missing
>>> your point.
>>>
>>> I'm actually not sure about this either do you mean this?
>>>
>>>
>>> #ifdef ARCH_BFIN
>>>     ff_bfin_get_unscaled_swscale (c);
>>> #endif
>>>
>>>
>>> converts into the following which to me is a reasonable idea
>>>
>>>     if (flags & SWS_CPU_CAPS_BFIN)
>>>        ff_bfin_get_unscaled_swscale (c);
>>>
>>> but this would still need to be wrapped inside of an ifdef
>>> ARCH_BFIN because
>>> the function is defined for compilation only bfin.  Did I miss
>>> something?
>>
>> The ENABLE_BFIN define is set in config.h by the configure script.
>> You can therefore use the if (ENABLE_BFIN) ... as Reimar pointed out;
>> GCC will optimize the call out in case ENABLE_BFIN is zero.
>
>
> Thanks I will try this but it seems that if the optimizer is turned  
> off this
> would cause the code to generate an undefined reference.  Am I in  
> correct?

Yes and no. Apparently, GCC will always optimise the code out, but  
for example,
TCC wont. There was a discussion about this in an earlier thread [1].

With friendly regards,
Takis

[1]
http://article.gmane.org/gmane.comp.video.ffmpeg.devel/50338





More information about the ffmpeg-devel mailing list