[FFmpeg-cvslog] avpicture_layout: use a endian independant format for the palette.

Michael Niedermayer git at videolan.org
Fri Apr 13 18:39:19 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Apr 13 18:21:51 2012 +0200| [2ec8789eb8f28a3e99dde329a6a36f25b68f89c4] | committer: Michael Niedermayer

avpicture_layout: use a endian independant format for the palette.

This should fix the failing fate PAL8 tests.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ec8789eb8f28a3e99dde329a6a36f25b68f89c4
---

 libavcodec/imgconvert.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index c26e5b6..76d75aa 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -340,8 +340,11 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
         return size;
     }
 
-    if (desc->flags & PIX_FMT_PAL)
-        memcpy((unsigned char *)(((size_t)dest + 3) & ~3), src->data[1], 256 * 4);
+    if (desc->flags & PIX_FMT_PAL) {
+        uint32_t *d32 = (unsigned char *)(((size_t)dest + 3) & ~3);
+        for (i = 0; i<256; i++)
+            AV_WL32(d32 + i, AV_RN32(src->data[1] + 4*i));
+    }
 
     return size;
 }



More information about the ffmpeg-cvslog mailing list