[FFmpeg-devel] MMX accelerated DSP functions for VC1/WMV3 decoders

Christophe GISQUET christophe.gisquet
Tue Jul 3 21:48:37 CEST 2007


Michael Niedermayer a ?crit :
>> -static void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
>> +void put_pixels8_mmx(uint8_t *block, const uint8_t *pixels, int line_size, int h)
>>  {
> 
> non static fuctions need a ff_ prefix

This produces errors like:
[...]
/home/cgisquet/src/ffmpeg/libavcodec/libavcodec.a(dsputil_mmx.o): In
function `put_qpel8_mc00_3dnow':
/home/cgisquet/src/ffmpeg/libavcodec/i386/dsputil_mmx.c:2572: undefined
reference to `put_pixels8_mmx'

For dsputil_mmx.c that's due to the following macro call:
QPEL_OP(put_       , ff_pw_16, _       , PUT_OP, 3dnow)

Indeed, it will at some point concatenate put_ with pixels8_mmx. Either
I fix up the macro, or I do as for h264dsp_mmx.c, which gets included in
dsputil_mmx.c

So I did the later. Now the question is: should the include of
h264dsp_mmx.c be conditioned by ifdefs on CONFIG_H264_{EN,DE}CODER? I
did that for this VC1 include.

>> +#if defined(CONFIG_VC1_DECODER) || defined(CONFIG_WMV3_DECODER)
>> +            ff_vc1dsp_init_mmx(c, avctx);
>> +#endif
> 
> shouldnt these be enabled for a VC1/WMV3 encoder too?

I don't know the state of the encoder, but at some point it will indeed
matter. Modified such conditionals accordingly.

>> +    int           mode1 = mode & 3;
>> +    int           mode2 = (mode >> 2) & 3;
> 
> you could pass mode1 and 2 as parameters this would avoid the calculation above

Kostya chose to do so.

I have attached a patch for vc1dsp.c mimicking what I did in
vc1dsp_mmx.c, but maybe it's full of cosmetics (ff_ prefix dropped, use
of a macro, ...).

> dst_stride= stride;
[...]
> vc1_put_shift[mode2-1](dst, dst_stride, src, stride, 8, 1-rnd, stride);
> 
> also the -1 in [...-1] can be avoided by putting a NULL at place 0 of the
> array

Indeed, applied. I didn't bother benchmarking the difference, though.

Best regards,
Christophe GISQUET
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vc1dsp_c.diff
Type: text/x-patch
Size: 6413 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070703/6420cad2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vc1dsp_mmx.diff
Type: text/x-patch
Size: 13176 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070703/6420cad2/attachment-0001.bin>



More information about the ffmpeg-devel mailing list