[FFmpeg-devel] [PATCH] Fix unaligned fill_rectangle in rv34.c

Kostya kostya.shishkov
Sat Aug 29 17:28:00 CEST 2009


On Sat, Aug 29, 2009 at 01:59:13PM +0200, Michael Niedermayer wrote:
> On Fri, Aug 28, 2009 at 07:44:54PM +0300, Kostya wrote:
[...]
> >  
> > Let's see what are the cases when fill_rectangle() is used:
> > 1) r->avail_cache - zeroes 8x2 bytes, stride is always 16 bytes,
> >                     alignment is 4
> > 2) r->intra_types - zeroes 4x4 bytes, stride is multiple of 4,
> >                     alignment is 16
> > 3) pic->motion_val - zeroes 8x2 bytes, stride is s->b8_stride*4,
> >                      alignment is 8
> > 
> > For the case 1 I will fix alignment to be 8, for the case 2 there's
> > nothing to do. In case 3 it fails because of stride since mpegvideo.c
> > says:
> >     s->b8_stride = s->mb_width*2 + 1
> > and allocates memory for pic->motion_val according to it.
> > So in this case I either need custom zeroing function or just strides
> > adjusted.
> 
> so motion_val is the problem?
> well, you could really try to change stride

Can somebody benchmark this? I don't think it will hurt H.263-based
decoders performance but better be safe than sorry.

> or call
> fill_rectangle twice with half the size? not ideal but neither is
> a custom functiondoing misaligned access
> 
> [...]
> -- 
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: align-strides.patch
Type: text/x-diff
Size: 628 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090829/caee030e/attachment.patch>



More information about the ffmpeg-devel mailing list