[FFmpeg-devel] [PATCH] VP56: 32-byte align picture width

Mans Rullgard mans
Sun Jul 13 15:13:39 CEST 2008


The VP5/6 decoder calls put_pixels16() on the chroma planes, so these
need 16-byte alignment.  Setting luma alignment to 32 achieves this,
although alignment of 16 is sufficient for the luma plane.
---
 libavcodec/utils.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 5d9ee33..819548c 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -127,7 +127,12 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){
     case PIX_FMT_YUVJ422P:
     case PIX_FMT_YUVJ444P:
     case PIX_FMT_YUVA420P:
-        w_align= 16; //FIXME check for non mpeg style codecs and use less alignment
+        //FIXME check for non mpeg style codecs and use less alignment
+        if (s->codec_id == CODEC_ID_VP5 || s->codec_id == CODEC_ID_VP6 ||
+            s->codec_id == CODEC_ID_VP6F)
+            w_align= 32;
+        else
+            w_align= 16;
         h_align= 16;
         break;
     case PIX_FMT_YUV411P:
-- 
1.5.6.2





More information about the ffmpeg-devel mailing list