avcodec/vc1dsp: Consistently use ptrdiff_t for stride

Also do the same in the x86 MMX code and its MIPS MMI clone.

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-10-20 19:17:43 +02:00
parent ff0ad0278d
commit c8a4770599
3 changed files with 11 additions and 9 deletions
+7 -5
View File
@@ -1485,7 +1485,7 @@ void ff_vc1_v_s_overlap_mmi(int16_t *top, int16_t *bottom)
* @return whether other 3 pairs should be filtered or not
* @see 8.6
*/
static av_always_inline int vc1_filter_line(uint8_t *src, int stride, int pq)
static av_always_inline int vc1_filter_line(uint8_t *src, ptrdiff_t stride, int pq)
{
int a0 = (2 * (src[-2 * stride] - src[1 * stride]) -
5 * (src[-1 * stride] - src[0 * stride]) + 4) >> 3;
@@ -1534,7 +1534,7 @@ static av_always_inline int vc1_filter_line(uint8_t *src, int stride, int pq)
* @param pq block quantizer
* @see 8.6
*/
static inline void vc1_loop_filter(uint8_t *src, int step, int stride,
static inline void vc1_loop_filter(uint8_t *src, ptrdiff_t step, ptrdiff_t stride,
int len, int pq)
{
int i;
@@ -2079,8 +2079,9 @@ typedef void (*vc1_mspel_mc_filter_8bits)
* @param rnd Rounding bias.
*/
#define VC1_MSPEL_MC(OP) \
static void OP ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride,\
int hmode, int vmode, int rnd) \
static void OP ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, \
ptrdiff_t stride, int hmode, int vmode, \
int rnd) \
{ \
static const vc1_mspel_mc_filter_ver_16bits vc1_put_shift_ver_16bits[] =\
{ NULL, vc1_put_ver_16b_shift1_mmi, \
@@ -2118,7 +2119,8 @@ static void OP ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride,\
vc1_put_shift_8bits[hmode](dst, src, stride, rnd, 1); \
} \
static void OP ## vc1_mspel_mc_16(uint8_t *dst, const uint8_t *src, \
int stride, int hmode, int vmode, int rnd)\
ptrdiff_t stride, int hmode, int vmode, \
int rnd) \
{ \
OP ## vc1_mspel_mc(dst + 0, src + 0, stride, hmode, vmode, rnd); \
OP ## vc1_mspel_mc(dst + 8, src + 8, stride, hmode, vmode, rnd); \
+3 -3
View File
@@ -196,7 +196,7 @@ static av_always_inline int vc1_filter_line(uint8_t *src, ptrdiff_t stride, int
* @param pq block quantizer
* @see 8.6
*/
static inline void vc1_loop_filter(uint8_t *src, int step, ptrdiff_t stride,
static inline void vc1_loop_filter(uint8_t *src, ptrdiff_t step, ptrdiff_t stride,
int len, int pq)
{
int i;
@@ -547,7 +547,7 @@ static void vc1_inv_trans_4x4_c(uint8_t *dest, ptrdiff_t stride, int16_t *block)
/* Filter in case of 2 filters */
#define VC1_MSPEL_FILTER_16B(DIR, TYPE) \
static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, \
int stride, \
ptrdiff_t stride, \
int mode) \
{ \
switch(mode) { \
@@ -570,7 +570,7 @@ VC1_MSPEL_FILTER_16B(ver, uint8_t)
VC1_MSPEL_FILTER_16B(hor, int16_t)
/* Filter used to interpolate fractional pel values */
static av_always_inline int vc1_mspel_filter(const uint8_t *src, int stride,
static av_always_inline int vc1_mspel_filter(const uint8_t *src, ptrdiff_t stride,
int mode, int r)
{
switch (mode) {
+1 -1
View File
@@ -336,7 +336,7 @@ typedef void (*vc1_mspel_mc_filter_8bits)(uint8_t *dst, const uint8_t *src, x86_
* @param rnd Rounding bias.
*/
#define VC1_MSPEL_MC(OP, INSTR)\
static void OP ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, int stride,\
static void OP ## vc1_mspel_mc(uint8_t *dst, const uint8_t *src, ptrdiff_t stride,\
int hmode, int vmode, int rnd)\
{\
static const vc1_mspel_mc_filter_ver_16bits vc1_put_shift_ver_16bits[] =\