[FFmpeg-devel] [PATCH] MMX VP3 Loop Filter

David Conrad lessen42
Tue Oct 7 11:19:05 CEST 2008


On Oct 7, 2008, at 4:40 AM, Guillaume Poirier wrote:

> Hello,
>
> David Conrad wrote:
>> Here's an 8-bit version. However, checking for the C fallback negates
>> the small speedup on my Penryn compared to the 16-bit version.
>>
>
> Then is it possible to adapt ....
>
>> ------------------------------------------------------------------------
>>
>> diff --git a/libavcodec/i386/dsputil_mmx.c b/libavcodec/i386/ 
>> dsputil_mmx.c
>> index 6e1a93d..2f035d2 100644
>> --- a/libavcodec/i386/dsputil_mmx.c
>> +++ b/libavcodec/i386/dsputil_mmx.c
>> @@ -2591,6 +2591,10 @@ void dsputil_init_mmx(DSPContext* c,  
>> AVCodecContext *avctx)
>>             c->h263_v_loop_filter= h263_v_loop_filter_mmx;
>>             c->h263_h_loop_filter= h263_h_loop_filter_mmx;
>>         }
>> +        if (ENABLE_VP3_DECODER || ENABLE_THEORA_DECODER) {
>> +            c->vp3_v_loop_filter= ff_vp3_v_loop_filter_mmx;
>> +            c->vp3_h_loop_filter= ff_vp3_h_loop_filter_mmx;
>> +        }
>>         c->put_h264_chroma_pixels_tab[0]=  
>> put_h264_chroma_mc8_mmx_rnd;
>>         c->put_h264_chroma_pixels_tab[1]= put_h264_chroma_mc4_mmx;
>>         c->put_no_rnd_h264_chroma_pixels_tab[0]=  
>> put_h264_chroma_mc8_mmx_nornd;
>
> this code so that you detect "globally" that filter_limit is greater
> than 63, so that you should alwaus use the C version, and never the  
> MMX
> version?
>
>
> This may seem stupid, but I prefered to ask as it seemed like a damn  
> too
> simple solution.

I guess I could add something like

if (filter_limit > 63)
     s->dsp.vp3_v_loop_filter = ff_vp3_v_loop_filter_c;
etc.

to in vp3.c, though I don't really like the idea of overriding  
dsputil_init().

Alternatively, it could just be under CODEC_FLAGS_BITEXACT - the only  
discrepancy with filter_limit > 63 is when filtering the pixel  
sequence (255,0,255,0) which should be rather rare (as should  
filter_limit > 63 in the first place)




More information about the ffmpeg-devel mailing list