[FFmpeg-cvslog] avcodec/exrdsp: improve the ExrDSPContext->reorder_pixels prototype

James Almer git at videolan.org
Mon Sep 18 01:10:04 EEST 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Sep 17 18:56:39 2017 -0300| [98d7ad085e20f7cd3347bbaff251bd687db733ee] | committer: James Almer

avcodec/exrdsp: improve the ExrDSPContext->reorder_pixels prototype

Make dst be the first parameter and src const. It's more in line with the rest of the codebase.

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/exr.c             | 4 ++--
 libavcodec/exrdsp.c          | 2 +-
 libavcodec/exrdsp.h          | 2 +-
 libavcodec/x86/exrdsp.asm    | 4 ++--
 libavcodec/x86/exrdsp_init.c | 4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index de2f05d3a9..230d5bbca8 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -289,7 +289,7 @@ static int zip_uncompress(EXRContext *s, const uint8_t *src, int compressed_size
     av_assert1(uncompressed_size % 2 == 0);
 
     predictor(td->tmp, uncompressed_size);
-    s->dsp.reorder_pixels(td->tmp, td->uncompressed_data, uncompressed_size);
+    s->dsp.reorder_pixels(td->uncompressed_data, td->tmp, uncompressed_size);
 
     return 0;
 }
@@ -336,7 +336,7 @@ static int rle_uncompress(EXRContext *ctx, const uint8_t *src, int compressed_si
     av_assert1(uncompressed_size % 2 == 0);
 
     predictor(td->tmp, uncompressed_size);
-    ctx->dsp.reorder_pixels(td->tmp, td->uncompressed_data, uncompressed_size);
+    ctx->dsp.reorder_pixels(td->uncompressed_data, td->tmp, uncompressed_size);
 
     return 0;
 }
diff --git a/libavcodec/exrdsp.c b/libavcodec/exrdsp.c
index e59dac3dc4..871b6f1276 100644
--- a/libavcodec/exrdsp.c
+++ b/libavcodec/exrdsp.c
@@ -24,7 +24,7 @@
 #include "exrdsp.h"
 #include "config.h"
 
-static void reorder_pixels_scalar(uint8_t *src, uint8_t *dst, ptrdiff_t size)
+static void reorder_pixels_scalar(uint8_t *dst, const uint8_t *src, ptrdiff_t size)
 {
     const uint8_t *t1 = src;
     int half_size     = size / 2;
diff --git a/libavcodec/exrdsp.h b/libavcodec/exrdsp.h
index 09a76a518e..d8cb002efc 100644
--- a/libavcodec/exrdsp.h
+++ b/libavcodec/exrdsp.h
@@ -23,7 +23,7 @@
 #include "libavutil/common.h"
 
 typedef struct ExrDSPContext {
-    void (*reorder_pixels)(uint8_t *src, uint8_t *dst, ptrdiff_t size);
+    void (*reorder_pixels)(uint8_t *dst, const uint8_t *src, ptrdiff_t size);
 } ExrDSPContext;
 
 void ff_exrdsp_init(ExrDSPContext *c);
diff --git a/libavcodec/x86/exrdsp.asm b/libavcodec/x86/exrdsp.asm
index 91d9c0b0a7..b91a7be20d 100644
--- a/libavcodec/x86/exrdsp.asm
+++ b/libavcodec/x86/exrdsp.asm
@@ -27,11 +27,11 @@
 SECTION .text
 
 ;------------------------------------------------------------------------------
-; void ff_reorder_pixels(uint8_t *src, uint8_t *dst, ptrdiff_t size)
+; void ff_reorder_pixels(uint8_t *dst, const uint8_t *src, ptrdiff_t size);
 ;------------------------------------------------------------------------------
 
 %macro REORDER_PIXELS 0
-cglobal reorder_pixels, 3,4,3, src1, dst, size, src2
+cglobal reorder_pixels, 3,4,3, dst, src1, size, src2
     lea                              src2q, [src1q+sizeq] ; src2 = src + 2 * half_size
     add                               dstq, sizeq         ; dst offset by size
     shr                              sizeq, 1             ; half_size
diff --git a/libavcodec/x86/exrdsp_init.c b/libavcodec/x86/exrdsp_init.c
index c0f508b2c4..5669be3d97 100644
--- a/libavcodec/x86/exrdsp_init.c
+++ b/libavcodec/x86/exrdsp_init.c
@@ -22,9 +22,9 @@
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/exrdsp.h"
 
-void ff_reorder_pixels_sse2(uint8_t *src, uint8_t *dst, ptrdiff_t size);
+void ff_reorder_pixels_sse2(uint8_t *dst, const uint8_t *src, ptrdiff_t size);
 
-void ff_reorder_pixels_avx2(uint8_t *src, uint8_t *dst, ptrdiff_t size);
+void ff_reorder_pixels_avx2(uint8_t *dst, const uint8_t *src, ptrdiff_t size);
 
 av_cold void ff_exrdsp_init_x86(ExrDSPContext *dsp)
 {



More information about the ffmpeg-cvslog mailing list