[Ffmpeg-devel] [PATCH]: Too much alignment assumed by H264 decoder

David S. Miller davem
Tue Dec 27 00:39:25 CET 2005


From: Loren Merritt <lorenm at u.washington.edu>
Date: Mon, 26 Dec 2005 00:37:42 -0800 (PST)

> int16_t mv_cache[2][5*8][2] __align8;
> 
> h->mv_cache[i][j] is size 4, so j only needs to be a multiple of 2, which 
> it is.

You're right, thanks everyone for steering me in the right direction.

The following works for me, but I can't vouch for it's correctness.
I can't say why the "+ 1" was there in the first place.

--- libavcodec/h264.c.~1~	2005-12-25 17:47:28.000000000 -0800
+++ libavcodec/h264.c	2005-12-26 15:36:44.000000000 -0800
@@ -4245,8 +4245,8 @@
     s->mb_width= h->sps.mb_width;
     s->mb_height= h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
 
-    h->b_stride=  s->mb_width*4 + 1;
-    h->b8_stride= s->mb_width*2 + 1;
+    h->b_stride=  s->mb_width*4;
+    h->b8_stride= s->mb_width*2;
 
     s->width = 16*s->mb_width - 2*(h->sps.crop_left + h->sps.crop_right );
     if(h->sps.frame_mbs_only_flag)





More information about the ffmpeg-devel mailing list