]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Fix avpicture_layout to not chroma shift the alpha plane when outputting YUVA420P
authorsdrik <sdrik@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 28 Feb 2009 07:31:36 +0000 (07:31 +0000)
committersdrik <sdrik@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Sat, 28 Feb 2009 07:31:36 +0000 (07:31 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17654 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/imgconvert.c

index 9f5db681912c1fe0946518ce5d77ae91883f99bc..1e0c66de8446aeb25738a47ce71e5689210630b4 100644 (file)
@@ -721,7 +721,7 @@ int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,
                      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* src, int pix_fmt, int width, int height,
         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++) {