]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/qtrle : avoid swap in 32bpp decoding on little endian
authorMartin Vignali <martin.vignali@gmail.com>
Tue, 26 Feb 2019 09:37:32 +0000 (10:37 +0100)
committerMartin Vignali <martin.vignali@gmail.com>
Mon, 4 Mar 2019 12:03:39 +0000 (13:03 +0100)
improve speed on little endian

benchmark on x86_64 :
mainly raw : 33fps -> 38fps
mainly rle : 128fps -> 153 fps

libavcodec/qtrle.c
libavcodec/version.h

index 6155b4f3e3c979fcae1eb0ca6ac92421c4041992..bb55ba8a86aac100a664451792904fd12d2bb975 100644 (file)
@@ -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,7 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx)
         break;
 
     case 32:
-        avctx->pix_fmt = AV_PIX_FMT_RGB32;
+        avctx->pix_fmt = AV_PIX_FMT_ARGB;
         break;
 
     default:
index 7c3897e2d428348e34417316945ca88a8df96316..309e4111cbea84efbc5fabb89105222095f3d1e8 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  47
-#define LIBAVCODEC_VERSION_MICRO 102
+#define LIBAVCODEC_VERSION_MICRO 103
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \