[FFmpeg-cvslog] r17654 - trunk/libavcodec/imgconvert.c

sdrik subversion
Sat Feb 28 08:31:36 CET 2009


Author: sdrik
Date: Sat Feb 28 08:31:36 2009
New Revision: 17654

Log:
Fix avpicture_layout to not chroma shift the alpha plane when outputting YUVA420P

Modified:
   trunk/libavcodec/imgconvert.c

Modified: trunk/libavcodec/imgconvert.c
==============================================================================
--- trunk/libavcodec/imgconvert.c	Sat Feb 28 00:12:14 2009	(r17653)
+++ trunk/libavcodec/imgconvert.c	Sat Feb 28 08:31:36 2009	(r17654)
@@ -721,7 +721,7 @@ int avpicture_layout(const AVPicture* sr
                      unsigned char *dest, int dest_size)
 {
     const PixFmtInfo* pf = &pix_fmt_info[pix_fmt];
-    int i, j, w, h, data_planes;
+    int i, j, w, ow, h, oh, data_planes;
     const unsigned char* s;
     int size = avpicture_get_size(pix_fmt, width, height);
 
@@ -751,10 +751,16 @@ int avpicture_layout(const AVPicture* sr
         h = height;
     }
 
+    ow = w;
+    oh = h;
+
     for (i=0; i<data_planes; i++) {
          if (i == 1) {
              w = width >> pf->x_chroma_shift;
              h = height >> pf->y_chroma_shift;
+         } else if (i == 3) {
+             w = ow;
+             h = oh;
          }
          s = src->data[i];
          for(j=0; j<h; j++) {




More information about the ffmpeg-cvslog mailing list