mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/h264: Use ptrdiff_t for (bi)weight functions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
289a6bb8b1
commit
bc26fe8927
|
@ -28,11 +28,12 @@
|
||||||
#define AVCODEC_H264DSP_H
|
#define AVCODEC_H264DSP_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
typedef void (*h264_weight_func)(uint8_t *block, int stride, int height,
|
typedef void (*h264_weight_func)(uint8_t *block, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset);
|
int log2_denom, int weight, int offset);
|
||||||
typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src,
|
typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src,
|
||||||
int stride, int height, int log2_denom,
|
ptrdiff_t stride, int height, int log2_denom,
|
||||||
int weightd, int weights, int offset);
|
int weightd, int weights, int offset);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#define op_scale1(x) block[x] = av_clip_pixel( (block[x]*weight + offset) >> log2_denom )
|
#define op_scale1(x) block[x] = av_clip_pixel( (block[x]*weight + offset) >> log2_denom )
|
||||||
#define op_scale2(x) dst[x] = av_clip_pixel( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1))
|
#define op_scale2(x) dst[x] = av_clip_pixel( (src[x]*weights + dst[x]*weightd + offset) >> (log2_denom+1))
|
||||||
#define H264_WEIGHT(W) \
|
#define H264_WEIGHT(W) \
|
||||||
static void FUNCC(weight_h264_pixels ## W)(uint8_t *_block, int stride, int height, \
|
static void FUNCC(weight_h264_pixels ## W)(uint8_t *_block, ptrdiff_t stride, int height, \
|
||||||
int log2_denom, int weight, int offset) \
|
int log2_denom, int weight, int offset) \
|
||||||
{ \
|
{ \
|
||||||
int y; \
|
int y; \
|
||||||
|
@ -60,7 +60,7 @@ static void FUNCC(weight_h264_pixels ## W)(uint8_t *_block, int stride, int heig
|
||||||
op_scale1(15); \
|
op_scale1(15); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
static void FUNCC(biweight_h264_pixels ## W)(uint8_t *_dst, uint8_t *_src, int stride, int height, \
|
static void FUNCC(biweight_h264_pixels ## W)(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride, int height, \
|
||||||
int log2_denom, int weightd, int weights, int offset) \
|
int log2_denom, int weightd, int weights, int offset) \
|
||||||
{ \
|
{ \
|
||||||
int y; \
|
int y; \
|
||||||
|
|
|
@ -79,19 +79,19 @@ void ff_h264_h_loop_filter_luma_mbaff_intra_msa(uint8_t *src, int stride,
|
||||||
int alpha, int beta);
|
int alpha, int beta);
|
||||||
|
|
||||||
void ff_biweight_h264_pixels16_8_msa(uint8_t *dst, uint8_t *src,
|
void ff_biweight_h264_pixels16_8_msa(uint8_t *dst, uint8_t *src,
|
||||||
int stride, int height, int log2_denom,
|
ptrdiff_t stride, int height, int log2_denom,
|
||||||
int weightd, int weights, int offset);
|
int weightd, int weights, int offset);
|
||||||
void ff_biweight_h264_pixels8_8_msa(uint8_t *dst, uint8_t *src,
|
void ff_biweight_h264_pixels8_8_msa(uint8_t *dst, uint8_t *src,
|
||||||
int stride, int height, int log2_denom,
|
ptrdiff_t stride, int height, int log2_denom,
|
||||||
int weightd, int weights, int offset);
|
int weightd, int weights, int offset);
|
||||||
void ff_biweight_h264_pixels4_8_msa(uint8_t *dst, uint8_t *src,
|
void ff_biweight_h264_pixels4_8_msa(uint8_t *dst, uint8_t *src,
|
||||||
int stride, int height, int log2_denom,
|
ptrdiff_t stride, int height, int log2_denom,
|
||||||
int weightd, int weights, int offset);
|
int weightd, int weights, int offset);
|
||||||
void ff_weight_h264_pixels16_8_msa(uint8_t *src, int stride, int height,
|
void ff_weight_h264_pixels16_8_msa(uint8_t *src, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset);
|
int log2_denom, int weight, int offset);
|
||||||
void ff_weight_h264_pixels8_8_msa(uint8_t *src, int stride, int height,
|
void ff_weight_h264_pixels8_8_msa(uint8_t *src, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset);
|
int log2_denom, int weight, int offset);
|
||||||
void ff_weight_h264_pixels4_8_msa(uint8_t *src, int stride, int height,
|
void ff_weight_h264_pixels4_8_msa(uint8_t *src, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset);
|
int log2_denom, int weight, int offset);
|
||||||
|
|
||||||
void ff_put_h264_qpel16_mc00_msa(uint8_t *dst, const uint8_t *src,
|
void ff_put_h264_qpel16_mc00_msa(uint8_t *dst, const uint8_t *src,
|
||||||
|
@ -339,23 +339,23 @@ void ff_h264_luma_dc_dequant_idct_8_mmi(int16_t *output, int16_t *input,
|
||||||
void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul);
|
void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul);
|
||||||
void ff_h264_chroma422_dc_dequant_idct_8_mmi(int16_t *block, int qmul);
|
void ff_h264_chroma422_dc_dequant_idct_8_mmi(int16_t *block, int qmul);
|
||||||
|
|
||||||
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height,
|
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset);
|
int log2_denom, int weight, int offset);
|
||||||
void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src,
|
void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src,
|
||||||
int stride, int height, int log2_denom, int weightd, int weights,
|
ptrdiff_t stride, int height, int log2_denom, int weightd, int weights,
|
||||||
int offset);
|
int offset);
|
||||||
void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height,
|
void ff_h264_weight_pixels8_8_mmi(uint8_t *block, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset);
|
int log2_denom, int weight, int offset);
|
||||||
void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src,
|
void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src,
|
||||||
int stride, int height, int log2_denom, int weightd, int weights,
|
ptrdiff_t stride, int height, int log2_denom, int weightd, int weights,
|
||||||
int offset);
|
int offset);
|
||||||
void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height,
|
void ff_h264_weight_pixels4_8_mmi(uint8_t *block, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset);
|
int log2_denom, int weight, int offset);
|
||||||
void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src,
|
void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src,
|
||||||
int stride, int height, int log2_denom, int weightd, int weights,
|
ptrdiff_t stride, int height, int log2_denom, int weightd, int weights,
|
||||||
int offset);
|
int offset);
|
||||||
|
|
||||||
void ff_deblock_v_chroma_8_mmi(uint8_t *pix, int stride, int alpha, int beta,
|
void ff_deblock_v_chroma_8_mmi(uint8_t *pix, ptrdiff_t stride, int alpha, int beta,
|
||||||
int8_t *tc0);
|
int8_t *tc0);
|
||||||
void ff_deblock_v_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
|
void ff_deblock_v_chroma_intra_8_mmi(uint8_t *pix, int stride, int alpha,
|
||||||
int beta);
|
int beta);
|
||||||
|
|
|
@ -1152,7 +1152,7 @@ void ff_h264_chroma_dc_dequant_idct_8_mmi(int16_t *block, int qmul)
|
||||||
block[48]= ((d-b)*qmul) >> 7;
|
block[48]= ((d-b)*qmul) >> 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height,
|
void ff_h264_weight_pixels16_8_mmi(uint8_t *block, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset)
|
int log2_denom, int weight, int offset)
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
|
@ -1205,7 +1205,7 @@ void ff_h264_weight_pixels16_8_mmi(uint8_t *block, int stride, int height,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, int stride,
|
void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||||
int height, int log2_denom, int weightd, int weights, int offset)
|
int height, int log2_denom, int weightd, int weights, int offset)
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
|
@ -1273,7 +1273,7 @@ void ff_h264_biweight_pixels16_8_mmi(uint8_t *dst, uint8_t *src, int stride,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height,
|
void ff_h264_weight_pixels8_8_mmi(uint8_t *block, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset)
|
int log2_denom, int weight, int offset)
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
|
@ -1313,7 +1313,7 @@ void ff_h264_weight_pixels8_8_mmi(uint8_t *block, int stride, int height,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, int stride,
|
void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||||
int height, int log2_denom, int weightd, int weights, int offset)
|
int height, int log2_denom, int weightd, int weights, int offset)
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
|
@ -1362,7 +1362,7 @@ void ff_h264_biweight_pixels8_8_mmi(uint8_t *dst, uint8_t *src, int stride,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height,
|
void ff_h264_weight_pixels4_8_mmi(uint8_t *block, ptrdiff_t stride, int height,
|
||||||
int log2_denom, int weight, int offset)
|
int log2_denom, int weight, int offset)
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
|
@ -1402,7 +1402,7 @@ void ff_h264_weight_pixels4_8_mmi(uint8_t *block, int stride, int height,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src, int stride,
|
void ff_h264_biweight_pixels4_8_mmi(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||||
int height, int log2_denom, int weightd, int weights, int offset)
|
int height, int log2_denom, int weightd, int weights, int offset)
|
||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
|
|
|
@ -157,13 +157,13 @@ LF_IFUNC(v, luma_intra, 10, mmxext)
|
||||||
/* weighted prediction */
|
/* weighted prediction */
|
||||||
|
|
||||||
#define H264_WEIGHT(W, OPT) \
|
#define H264_WEIGHT(W, OPT) \
|
||||||
void ff_h264_weight_ ## W ## _ ## OPT(uint8_t *dst, int stride, \
|
void ff_h264_weight_ ## W ## _ ## OPT(uint8_t *dst, ptrdiff_t stride, \
|
||||||
int height, int log2_denom, \
|
int height, int log2_denom, \
|
||||||
int weight, int offset);
|
int weight, int offset);
|
||||||
|
|
||||||
#define H264_BIWEIGHT(W, OPT) \
|
#define H264_BIWEIGHT(W, OPT) \
|
||||||
void ff_h264_biweight_ ## W ## _ ## OPT(uint8_t *dst, uint8_t *src, \
|
void ff_h264_biweight_ ## W ## _ ## OPT(uint8_t *dst, uint8_t *src, \
|
||||||
int stride, int height, \
|
ptrdiff_t stride, int height, \
|
||||||
int log2_denom, int weightd, \
|
int log2_denom, int weightd, \
|
||||||
int weights, int offset);
|
int weights, int offset);
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ H264_BIWEIGHT_MMX(4)
|
||||||
|
|
||||||
#define H264_WEIGHT_10(W, DEPTH, OPT) \
|
#define H264_WEIGHT_10(W, DEPTH, OPT) \
|
||||||
void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
|
void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
|
||||||
int stride, \
|
ptrdiff_t stride, \
|
||||||
int height, \
|
int height, \
|
||||||
int log2_denom, \
|
int log2_denom, \
|
||||||
int weight, \
|
int weight, \
|
||||||
|
@ -192,7 +192,7 @@ void ff_h264_weight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
|
||||||
#define H264_BIWEIGHT_10(W, DEPTH, OPT) \
|
#define H264_BIWEIGHT_10(W, DEPTH, OPT) \
|
||||||
void ff_h264_biweight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
|
void ff_h264_biweight_ ## W ## _ ## DEPTH ## _ ## OPT(uint8_t *dst, \
|
||||||
uint8_t *src, \
|
uint8_t *src, \
|
||||||
int stride, \
|
ptrdiff_t stride, \
|
||||||
int height, \
|
int height, \
|
||||||
int log2_denom, \
|
int log2_denom, \
|
||||||
int weightd, \
|
int weightd, \
|
||||||
|
|
Loading…
Reference in New Issue