mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-28 19:22:02 +08:00
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.
This commit is contained in:
@@ -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));\
|
||||
|
||||
Reference in New Issue
Block a user