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

Michael Niedermayer michaelni
Wed Jul 4 23:50:48 CEST 2007


Hi

On Tue, Jul 03, 2007 at 09:48:37PM +0200, Christophe GISQUET wrote:
> 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.

mmx patch ok

the c code is maintained by kostya so he has to approve it

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070704/52d62e39/attachment.pgp>



More information about the ffmpeg-devel mailing list