From 43c8c7df4bcda1463a01410b834655151ce78fef Mon Sep 17 00:00:00 2001
From: Martin Vignali <martin.vignali@gmail.com>
Date: Sat, 23 Feb 2019 14:16:13 +0100
Subject: [PATCH 2/4] avcodec/qtrle : avoid swap in 32bpp decoding

improve speed

mainly raw : 33fps -> 38fps
mainly rle : 128fps -> 153 fps
---
 libavcodec/qtrle.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index 6155b4f3e3..c2722c6946 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -367,7 +367,7 @@ static void qtrle_decode_32bpp(QtrleContext *s, int row_ptr, int lines_to_change
             } else if (rle_code < 0) {
                 /* decode the run length code */
                 rle_code = -rle_code;
-                argb = bytestream2_get_be32(&s->g);
+                argb = bytestream2_get_ne32(&s->g);
 
                 CHECK_PIXEL_PTR(rle_code * 4);
 
@@ -380,7 +380,7 @@ static void qtrle_decode_32bpp(QtrleContext *s, int row_ptr, int lines_to_change
 
                 /* copy pixels directly to output */
                 while (rle_code--) {
-                    argb = bytestream2_get_be32(&s->g);
+                    argb = bytestream2_get_ne32(&s->g);
                     AV_WN32A(rgb + pixel_ptr, argb);
                     pixel_ptr  += 4;
                 }
@@ -416,7 +416,11 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx)
         break;
 
     case 32:
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
+#if HAVE_BIGENDIAN
+        avctx->pix_fmt = AV_PIX_FMT_BGRA;
+#else
+        avctx->pix_fmt = AV_PIX_FMT_ARGB;
+#endif
         break;
 
     default:
-- 
2.17.2 (Apple Git-113)

