diff options
author | Diego Biurrun <diego@biurrun.de> | 2016-09-01 22:41:01 +0300 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2016-09-29 15:48:04 +0300 |
commit | e4a94d8b36c48d95a7d412c40d7b558422ff659c (patch) | |
tree | 754724de182b2d0379f14d2a347d1e4f78d52648 /libavcodec/h264chroma_template.c | |
parent | 2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428 (diff) |
h264chroma: Change type of stride parameters to ptrdiff_t
This avoids SIMD-optimized functions having to sign-extend their
stride argument manually to be able to do pointer arithmetic.
Diffstat (limited to 'libavcodec/h264chroma_template.c')
-rw-r--r-- | libavcodec/h264chroma_template.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/h264chroma_template.c b/libavcodec/h264chroma_template.c index 028ed132cf..ed364ddbdd 100644 --- a/libavcodec/h264chroma_template.c +++ b/libavcodec/h264chroma_template.c @@ -20,11 +20,13 @@ */ #include <assert.h> +#include <stddef.h> #include "bit_depth_template.c" #define H264_CHROMA_MC(OPNAME, OP)\ -static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ +static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst /*align 8*/, uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ +{\ pixel *dst = (pixel*)_dst;\ pixel *src = (pixel*)_src;\ const int A=(8-x)*(8-y);\ @@ -45,7 +47,7 @@ static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t * }\ } else if (B + C) {\ const int E= B+C;\ - const int step= C ? stride : 1;\ + const ptrdiff_t step = C ? stride : 1;\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + E*src[step+0]));\ OP(dst[1], (A*src[1] + E*src[step+1]));\ @@ -62,7 +64,8 @@ static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t * }\ }\ \ -static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ +static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst /*align 8*/, uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ +{\ pixel *dst = (pixel*)_dst;\ pixel *src = (pixel*)_src;\ const int A=(8-x)*(8-y);\ @@ -85,7 +88,7 @@ static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t * }\ } else if (B + C) {\ const int E= B+C;\ - const int step= C ? stride : 1;\ + const ptrdiff_t step = C ? stride : 1;\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + E*src[step+0]));\ OP(dst[1], (A*src[1] + E*src[step+1]));\ @@ -106,7 +109,8 @@ static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t * }\ }\ \ -static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ +static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst /*align 8*/, uint8_t *_src /*align 1*/, ptrdiff_t stride, int h, int x, int y)\ +{\ pixel *dst = (pixel*)_dst;\ pixel *src = (pixel*)_src;\ const int A=(8-x)*(8-y);\ @@ -133,7 +137,7 @@ static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst/*align 8*/, uint8_t * }\ } else if (B + C) {\ const int E= B+C;\ - const int step= C ? stride : 1;\ + const ptrdiff_t step = C ? stride : 1;\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + E*src[step+0]));\ OP(dst[1], (A*src[1] + E*src[step+1]));\ |