[FFmpeg-devel] [PATCH 1/2] swresample: Refactor resample asm and port it to yasm

James Almer jamrial at gmail.com
Thu Mar 20 05:25:21 CET 2014


On 20/03/14 12:04 AM, Michael Niedermayer wrote:
> On Wed, Mar 19, 2014 at 10:16:17PM -0300, James Almer wrote:
>> On 19/03/14 9:08 PM, Michael Niedermayer wrote:
>>> On Wed, Mar 19, 2014 at 06:45:03PM -0300, James Almer wrote:
>>>> +%if mmsize == 8
>>>> +    emms
>>>> +%endif
>>>
>>> this is not ok
>>> emms is slow and does not belong in the inner loop
>>
>> This is a problem. Not sure how to make sure to run emms_c() from outside the 
>> loop only when an mmx version of scalarproduct is used.
> 
> well, it was outside before the patch

Yes, but there was this "need_emms" variable inside multiple_resample() that was set
only when swri_resample_int16_mmx2() was called.
With this refactoring, it calls swri_resample_int16() instead, and doesn't know if c, 
mmx2 or sse2 code is going to be used.

I guess a solution would be adding that variable to the ResampleContext struct, which 
would get set to 1 in swri_audio_resample_init_x86() if c->scalarproduct == 
ff_resample_scalarproduct_<sampleformat>_mmxext.

But not that it matters anymore.


More information about the ffmpeg-devel mailing list