[FFmpeg-devel] [PATCH] Fix alignment for calls to dsp diff_bytes()

Michael Niedermayer michaelni
Sat May 23 19:17:03 CEST 2009


On Fri, May 22, 2009 at 02:29:33PM -0400, Jeff Downs wrote:
> diff_bytes() in dsputil has 16 byte alignment restriction on its first 
> source pointer.  At a minimum, the C implementation, diff_bytes_c(), 
> does depend on this.
> 
> huffyuv passes unaligned pointers to diff_bytes during encode 
> (encode_frame, first set of calls to sub_left_prediction, which in turn 
> uses diff_bytes).
> 
> This was revealed by "make test" (make regtest-huffyuv is the specific 
> test) failing with Bus Error on Sparc/Solaris 
> (http://fate.multimedia.cx/index.php?test_result=15846002).
> 
> 
> Potential fix attached in two parts:
> 
> 1. huff-offsets.patch:  Adds offset to encode_422_bitstream to enable 
> skip of initial elements in s->temp when coding. Needed for second patch, 
> split for clarity.
> 
> 2. huff-align.patch: Changes calls to sub_left_prediction such that 
> the source frame data pointers are no longer offset to skip the initial 
> elements, thus keeping them properly aligned.  Changes encoding offset to 
> compensate.
> 
> With patches, no change to regression tests on x86_64/Linux and regression 
> tests now complete (but do not pass due to other issues ... I think) on 
> Sparc/Solaris.
> 
> 	-Jeff
>  huffyuv.c |   25 ++++++++++++++-----------
>  1 file changed, 14 insertions(+), 11 deletions(-)
> 5f82e817b4ca84e72ba6568d2dcda49edd83e8fc  huff-offsets.patch
[...]
>  huffyuv.c |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> a315471373a5cfd553439adf2ad60ed9841d15f6  huff-align.patch

patches should be ok

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090523/8d378fb5/attachment.pgp>



More information about the ffmpeg-devel mailing list