[FFmpeg-cvslog] r21011 - trunk/libavcodec/x86/dsputil_mmx.c

Reimar Döffinger Reimar.Doeffinger
Mon Jan 4 14:01:14 CET 2010


On Mon, Jan 04, 2010 at 01:38:43PM +0100, Gwenole Beauchesne wrote:
> On Mon, 4 Jan 2010, Reimar D?ffinger wrote:
> 
> >> -        if (mm_flags & FF_MM_SSE){
> >> +        if ((mm_flags & FF_MM_SSE) &&
> >> +            !(CONFIG_MPEG_XVMC_DECODER && avctx->xvmc_acceleration > 1)){
> >> +            /* XvMCCreateBlocks() may not allocate 16-byte aligned blocks */
> >>              c->clear_block  = clear_block_sse;
> >>              c->clear_blocks = clear_blocks_sse;
> >
> > While it is probably not relevant I'd like to point out that e.g. NVidia
> > drivers can use XvMC just fine without this, so I can't help considering
> > this a bit of a hack for XvMC implementations that are not properly
> > maintained.
> 
> IIRC, it wasn't the case either on my old (X, nvidia driver et al.) system 
> with an NVIDIA 6600GT. It also failed on newer systems, Ubuntu 9.04-based 
> (X.org 1.6.x probably), and Intel G45 or i945, and also AMD drivers. I 
> don't know for VIA since I don't have that.

Maybe I just got lucky. I don't have any issues with GeForce 7600 GS,
driver 190.53, 1.7.3.902.
It might be that this changed from the point where the NVidia drivers
started supporting only SSE-capable systems, maybe they just replaced
all allocs by memalign at that time or something...

> BTW, what revision of the XvMC specs mention that allocated blocks are 
> bound to be 16-byte aligned?

None. But neither does any revision of the specs say that it's allowed
to align the buffer insufficiently to use "completely ordinary" CPU
instructions on it.
Also in the absence of binary blob drivers I doesn't really make sense
not to change it to align the memory, does it (that's what my comment
about "not properly maintained was playing at)?
Just to clarify: I'm not objecting to it, I just wanted to say I think
it is the less preferable solution.
If someone can gather the motivation I'd appreciate it if they could try
getting the XvMC specification "improved", at least to mention that the
buffer "should" be aligned by the driver.



More information about the ffmpeg-cvslog mailing list