[FFmpeg-devel] [PATCH 1/2] avcodec/idctdsp: change {put, add}_pixels_clamped to ptrdiff_t line_size

James Almer jamrial at gmail.com
Thu Sep 25 00:56:32 CEST 2014


Signed-off-by: James Almer <jamrial at gmail.com>
---
Architectures other than x86 are untested, but the changes are trivial so it should be ok.

 libavcodec/alpha/idctdsp_alpha.c     |  8 ++++----
 libavcodec/alpha/idctdsp_alpha.h     |  4 ++--
 libavcodec/alpha/idctdsp_alpha_asm.S |  4 ++--
 libavcodec/arm/idctdsp_arm.S         |  2 +-
 libavcodec/arm/idctdsp_init_arm.c    |  2 +-
 libavcodec/arm/idctdsp_init_armv6.c  |  2 +-
 libavcodec/arm/idctdsp_init_neon.c   |  6 +++---
 libavcodec/idctdsp.c                 | 10 +++++-----
 libavcodec/idctdsp.h                 | 10 +++++-----
 libavcodec/x86/idctdsp.asm           |  2 +-
 libavcodec/x86/idctdsp.h             |  8 ++++----
 libavcodec/x86/idctdsp_mmx.c         |  5 +++--
 12 files changed, 32 insertions(+), 31 deletions(-)

diff --git a/libavcodec/alpha/idctdsp_alpha.c b/libavcodec/alpha/idctdsp_alpha.c
index 1050697..1923ebb 100644
--- a/libavcodec/alpha/idctdsp_alpha.c
+++ b/libavcodec/alpha/idctdsp_alpha.c
@@ -24,14 +24,14 @@
 #include "asm.h"
 
 void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
-                                int line_size);
+                                ptrdiff_t line_size);
 void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
-                                int line_size);
+                                ptrdiff_t line_size);
 
 void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
-                                 int line_size);
+                                 ptrdiff_t line_size);
 void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
-                                 int line_size);
+                                 ptrdiff_t line_size);
 
 #if 0
 /* These functions were the base for the optimized assembler routines,
diff --git a/libavcodec/alpha/idctdsp_alpha.h b/libavcodec/alpha/idctdsp_alpha.h
index e52cd80..bf98495 100644
--- a/libavcodec/alpha/idctdsp_alpha.h
+++ b/libavcodec/alpha/idctdsp_alpha.h
@@ -23,9 +23,9 @@
 #include <stdint.h>
 
 extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
-                                        int line_size);
+                                        ptrdiff_t line_size);
 extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
-                                        int line_size);
+                                        ptrdiff_t line_size);
 
 void ff_simple_idct_axp(int16_t *block);
 void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
diff --git a/libavcodec/alpha/idctdsp_alpha_asm.S b/libavcodec/alpha/idctdsp_alpha_asm.S
index e3a8364..f545df9 100644
--- a/libavcodec/alpha/idctdsp_alpha_asm.S
+++ b/libavcodec/alpha/idctdsp_alpha_asm.S
@@ -33,7 +33,7 @@
 
 /************************************************************************
  * void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
- *                                 int line_size)
+ *                                 ptrdiff_t line_size)
  */
         .align 6
         .globl put_pixels_clamped_mvi_asm
@@ -83,7 +83,7 @@ put_pixels_clamped_mvi_asm:
 
 /************************************************************************
  * void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
- *                                 int line_size)
+ *                                 ptrdiff_t line_size)
  */
         .align 6
         .globl add_pixels_clamped_mvi_asm
diff --git a/libavcodec/arm/idctdsp_arm.S b/libavcodec/arm/idctdsp_arm.S
index e8333c4..057eff9 100644
--- a/libavcodec/arm/idctdsp_arm.S
+++ b/libavcodec/arm/idctdsp_arm.S
@@ -22,7 +22,7 @@
 #include "config.h"
 #include "libavutil/arm/asm.S"
 
-@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, int stride)
+@ void ff_add_pixels_clamped_arm(int16_t *block, uint8_t *dest, ptrdiff_t stride)
 function ff_add_pixels_clamped_arm, export=1, align=5
         push            {r4-r10}
         mov             r10, #8
diff --git a/libavcodec/arm/idctdsp_init_arm.c b/libavcodec/arm/idctdsp_init_arm.c
index 2d846dc..da5da06 100644
--- a/libavcodec/arm/idctdsp_init_arm.c
+++ b/libavcodec/arm/idctdsp_init_arm.c
@@ -30,7 +30,7 @@
 #include "idctdsp_arm.h"
 
 void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
-                               int line_size);
+                               ptrdiff_t line_size);
 
 /* XXX: those functions should be suppressed ASAP when all IDCTs are
  * converted */
diff --git a/libavcodec/arm/idctdsp_init_armv6.c b/libavcodec/arm/idctdsp_init_armv6.c
index 648f1fd..a3470a8 100644
--- a/libavcodec/arm/idctdsp_init_armv6.c
+++ b/libavcodec/arm/idctdsp_init_armv6.c
@@ -27,7 +27,7 @@
 #include "idctdsp_arm.h"
 
 void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
-                                 int line_size);
+                                 ptrdiff_t line_size);
 
 av_cold void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
                                    unsigned high_bit_depth)
diff --git a/libavcodec/arm/idctdsp_init_neon.c b/libavcodec/arm/idctdsp_init_neon.c
index 80c391c..b70c5b0 100644
--- a/libavcodec/arm/idctdsp_init_neon.c
+++ b/libavcodec/arm/idctdsp_init_neon.c
@@ -27,9 +27,9 @@
 #include "idct.h"
 #include "idctdsp_arm.h"
 
-void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int);
-void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int);
-void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int);
+void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, ptrdiff_t);
+void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, ptrdiff_t);
+void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, ptrdiff_t);
 
 av_cold void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx,
                                   unsigned high_bit_depth)
diff --git a/libavcodec/idctdsp.c b/libavcodec/idctdsp.c
index 75695ef..b497221 100644
--- a/libavcodec/idctdsp.c
+++ b/libavcodec/idctdsp.c
@@ -80,11 +80,11 @@ av_cold void ff_init_scantable_permutation(uint8_t *idct_permutation,
     }
 }
 
-void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
-void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
+void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
+void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
 
 static void put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
-                                 int line_size)
+                                 ptrdiff_t line_size)
 {
     int i;
 
@@ -138,7 +138,7 @@ static void put_pixels_clamped2_c(const int16_t *block, uint8_t *av_restrict pix
 
 static void put_signed_pixels_clamped_c(const int16_t *block,
                                         uint8_t *av_restrict pixels,
-                                        int line_size)
+                                        ptrdiff_t line_size)
 {
     int i, j;
 
@@ -158,7 +158,7 @@ static void put_signed_pixels_clamped_c(const int16_t *block,
 }
 
 static void add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
-                                 int line_size)
+                                 ptrdiff_t line_size)
 {
     int i;
 
diff --git a/libavcodec/idctdsp.h b/libavcodec/idctdsp.h
index 8d60656..538b716 100644
--- a/libavcodec/idctdsp.h
+++ b/libavcodec/idctdsp.h
@@ -52,13 +52,13 @@ typedef struct IDCTDSPContext {
     /* pixel ops : interface with DCT */
     void (*put_pixels_clamped)(const int16_t *block /* align 16 */,
                                uint8_t *pixels /* align 8 */,
-                               int line_size);
+                               ptrdiff_t line_size);
     void (*put_signed_pixels_clamped)(const int16_t *block /* align 16 */,
                                       uint8_t *pixels /* align 8 */,
-                                      int line_size);
+                                      ptrdiff_t line_size);
     void (*add_pixels_clamped)(const int16_t *block /* align 16 */,
                                uint8_t *pixels /* align 8 */,
-                               int line_size);
+                               ptrdiff_t line_size);
 
     void (*idct)(int16_t *block /* align 16 */);
 
@@ -95,8 +95,8 @@ typedef struct IDCTDSPContext {
     enum idct_permutation_type perm_type;
 } IDCTDSPContext;
 
-extern void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
-extern void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
+extern void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
+extern void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
 
 void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx);
 
diff --git a/libavcodec/x86/idctdsp.asm b/libavcodec/x86/idctdsp.asm
index 44a1a6e..c3f37c4 100644
--- a/libavcodec/x86/idctdsp.asm
+++ b/libavcodec/x86/idctdsp.asm
@@ -31,7 +31,7 @@ SECTION_TEXT
 
 ;--------------------------------------------------------------------------
 ;void ff_put_signed_pixels_clamped(const int16_t *block, uint8_t *pixels,
-;                                  int line_size)
+;                                  ptrdiff_t line_size)
 ;--------------------------------------------------------------------------
 
 %macro PUT_SIGNED_PIXELS_CLAMPED_HALF 1
diff --git a/libavcodec/x86/idctdsp.h b/libavcodec/x86/idctdsp.h
index 9b7177a..252e704 100644
--- a/libavcodec/x86/idctdsp.h
+++ b/libavcodec/x86/idctdsp.h
@@ -22,12 +22,12 @@
 #include <stdint.h>
 
 void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size);
+                               ptrdiff_t line_size);
 void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size);
+                               ptrdiff_t line_size);
 void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                                      int line_size);
+                                      ptrdiff_t line_size);
 void ff_put_signed_pixels_clamped_sse2(const int16_t *block, uint8_t *pixels,
-                                       int line_size);
+                                       ptrdiff_t line_size);
 
 #endif /* AVCODEC_X86_IDCTDSP_H */
diff --git a/libavcodec/x86/idctdsp_mmx.c b/libavcodec/x86/idctdsp_mmx.c
index a72b941..0ce9a92 100644
--- a/libavcodec/x86/idctdsp_mmx.c
+++ b/libavcodec/x86/idctdsp_mmx.c
@@ -25,13 +25,14 @@
 #include "config.h"
 #include "libavutil/cpu.h"
 #include "libavutil/x86/asm.h"
+#include "libavcodec/idctdsp.h"
 #include "idctdsp.h"
 #include "inline_asm.h"
 
 #if HAVE_INLINE_ASM
 
 void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size)
+                               ptrdiff_t line_size)
 {
     const int16_t *p;
     uint8_t *pix;
@@ -89,7 +90,7 @@ void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
 }
 
 void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
-                               int line_size)
+                               ptrdiff_t line_size)
 {
     const int16_t *p;
     uint8_t *pix;
-- 
1.8.5.5



More information about the ffmpeg-devel mailing list