diff options
author | Diego Biurrun <diego@biurrun.de> | 2016-09-01 21:41:01 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2016-09-29 14:48:04 +0200 |
commit | e4a94d8b36c48d95a7d412c40d7b558422ff659c (patch) | |
tree | 754724de182b2d0379f14d2a347d1e4f78d52648 /libavcodec/rv40dsp.c | |
parent | 2ec9fa5ec60dcd10e1cb10d8b4e4437e634ea428 (diff) | |
download | ffmpeg-e4a94d8b36c48d95a7d412c40d7b558422ff659c.tar.gz |
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/rv40dsp.c')
-rw-r--r-- | libavcodec/rv40dsp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/rv40dsp.c b/libavcodec/rv40dsp.c index da3efb4442..4ca5cc7b52 100644 --- a/libavcodec/rv40dsp.c +++ b/libavcodec/rv40dsp.c @@ -291,7 +291,10 @@ static const int rv40_bias[4][4] = { }; #define RV40_CHROMA_MC(OPNAME, OP)\ -static void OPNAME ## rv40_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\ +static void OPNAME ## rv40_chroma_mc4_c(uint8_t *dst /*align 8*/,\ + uint8_t *src /*align 1*/,\ + ptrdiff_t stride, int h, int x, int y)\ +{\ const int A = (8-x) * (8-y);\ const int B = ( x) * (8-y);\ const int C = (8-x) * ( y);\ @@ -312,7 +315,7 @@ static void OPNAME ## rv40_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*a }\ }else{\ 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] + bias));\ OP(dst[1], (A*src[1] + E*src[step+1] + bias));\ @@ -324,7 +327,10 @@ static void OPNAME ## rv40_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*a }\ }\ \ -static void OPNAME ## rv40_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\ +static void OPNAME ## rv40_chroma_mc8_c(uint8_t *dst/*align 8*/,\ + uint8_t *src/*align 1*/,\ + ptrdiff_t stride, int h, int x, int y)\ +{\ const int A = (8-x) * (8-y);\ const int B = ( x) * (8-y);\ const int C = (8-x) * ( y);\ @@ -349,7 +355,7 @@ static void OPNAME ## rv40_chroma_mc8_c(uint8_t *dst/*align 8*/, uint8_t *src/*a }\ }else{\ 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] + bias));\ OP(dst[1], (A*src[1] + E*src[step+1] + bias));\ |