[FFmpeg-cvslog] Simplify ptx decoding on big-endian.

Carl Eugen Hoyos git at videolan.org
Sun Jul 15 15:05:21 CEST 2012


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Jul 15 15:04:44 2012 +0200| [a1e52c94411de56bb1071a162524be51f32d31f0] | committer: Carl Eugen Hoyos

Simplify ptx decoding on big-endian.

Reviewed-by: Reimar Döffinger

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

 libavcodec/ptx.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c
index d783940..3f6c746 100644
--- a/libavcodec/ptx.c
+++ b/libavcodec/ptx.c
@@ -58,7 +58,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
         return -1;
     }
 
-    avctx->pix_fmt = PIX_FMT_RGB555;
+    avctx->pix_fmt = PIX_FMT_RGB555LE;
 
     if (buf_end - buf < offset)
         return AVERROR_INVALIDDATA;
@@ -85,13 +85,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     stride = p->linesize[0];
 
     for (y = 0; y < h && buf_end - buf >= w * bytes_per_pixel; y++) {
-#if HAVE_BIGENDIAN
-        unsigned int x;
-        for (x=0; x<w*bytes_per_pixel; x+=bytes_per_pixel)
-            AV_WN16(ptr+x, AV_RL16(buf+x));
-#else
         memcpy(ptr, buf, w*bytes_per_pixel);
-#endif
         ptr += stride;
         buf += w*bytes_per_pixel;
     }



More information about the ffmpeg-cvslog mailing list