|
|
|
@ -42,7 +42,8 @@ |
|
|
|
|
#define Q1 p0_p[ 1*stride] |
|
|
|
|
#define Q2 p0_p[ 2*stride] |
|
|
|
|
|
|
|
|
|
static inline void loop_filter_l2(uint8_t *p0_p,int stride,int alpha, int beta) { |
|
|
|
|
static inline void loop_filter_l2(uint8_t *p0_p, ptrdiff_t stride, int alpha, int beta) |
|
|
|
|
{ |
|
|
|
|
int p0 = P0; |
|
|
|
|
int q0 = Q0; |
|
|
|
|
|
|
|
|
@ -62,7 +63,8 @@ static inline void loop_filter_l2(uint8_t *p0_p,int stride,int alpha, int beta) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static inline void loop_filter_l1(uint8_t *p0_p, int stride, int alpha, int beta, int tc) { |
|
|
|
|
static inline void loop_filter_l1(uint8_t *p0_p, ptrdiff_t stride, int alpha, int beta, int tc) |
|
|
|
|
{ |
|
|
|
|
int p0 = P0; |
|
|
|
|
int q0 = Q0; |
|
|
|
|
|
|
|
|
@ -81,7 +83,8 @@ static inline void loop_filter_l1(uint8_t *p0_p, int stride, int alpha, int beta |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static inline void loop_filter_c2(uint8_t *p0_p,int stride,int alpha, int beta) { |
|
|
|
|
static inline void loop_filter_c2(uint8_t *p0_p, ptrdiff_t stride, int alpha, int beta) |
|
|
|
|
{ |
|
|
|
|
int p0 = P0; |
|
|
|
|
int q0 = Q0; |
|
|
|
|
|
|
|
|
@ -99,8 +102,9 @@ static inline void loop_filter_c2(uint8_t *p0_p,int stride,int alpha, int beta) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static inline void loop_filter_c1(uint8_t *p0_p,int stride,int alpha, int beta, |
|
|
|
|
int tc) { |
|
|
|
|
static inline void loop_filter_c1(uint8_t *p0_p, ptrdiff_t stride, int alpha, int beta, |
|
|
|
|
int tc) |
|
|
|
|
{ |
|
|
|
|
if(abs(P0-Q0)<alpha && abs(P1-P0)<beta && abs(Q1-Q0)<beta) { |
|
|
|
|
int delta = av_clip(((Q0-P0)*3+P1-Q1+4)>>3, -tc, tc); |
|
|
|
|
P0 = av_clip_uint8(P0+delta); |
|
|
|
@ -115,8 +119,9 @@ static inline void loop_filter_c1(uint8_t *p0_p,int stride,int alpha, int beta, |
|
|
|
|
#undef Q1 |
|
|
|
|
#undef Q2 |
|
|
|
|
|
|
|
|
|
static void cavs_filter_lv_c(uint8_t *d, int stride, int alpha, int beta, int tc, |
|
|
|
|
int bs1, int bs2) { |
|
|
|
|
static void cavs_filter_lv_c(uint8_t *d, ptrdiff_t stride, int alpha, int beta, int tc, |
|
|
|
|
int bs1, int bs2) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
if(bs1==2) |
|
|
|
|
for(i=0;i<16;i++) |
|
|
|
@ -131,8 +136,9 @@ static void cavs_filter_lv_c(uint8_t *d, int stride, int alpha, int beta, int tc |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void cavs_filter_lh_c(uint8_t *d, int stride, int alpha, int beta, int tc, |
|
|
|
|
int bs1, int bs2) { |
|
|
|
|
static void cavs_filter_lh_c(uint8_t *d, ptrdiff_t stride, int alpha, int beta, int tc, |
|
|
|
|
int bs1, int bs2) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
if(bs1==2) |
|
|
|
|
for(i=0;i<16;i++) |
|
|
|
@ -147,8 +153,9 @@ static void cavs_filter_lh_c(uint8_t *d, int stride, int alpha, int beta, int tc |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void cavs_filter_cv_c(uint8_t *d, int stride, int alpha, int beta, int tc, |
|
|
|
|
int bs1, int bs2) { |
|
|
|
|
static void cavs_filter_cv_c(uint8_t *d, ptrdiff_t stride, int alpha, int beta, int tc, |
|
|
|
|
int bs1, int bs2) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
if(bs1==2) |
|
|
|
|
for(i=0;i<8;i++) |
|
|
|
@ -163,8 +170,9 @@ static void cavs_filter_cv_c(uint8_t *d, int stride, int alpha, int beta, int tc |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc, |
|
|
|
|
int bs1, int bs2) { |
|
|
|
|
static void cavs_filter_ch_c(uint8_t *d, ptrdiff_t stride, int alpha, int beta, int tc, |
|
|
|
|
int bs1, int bs2) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
if(bs1==2) |
|
|
|
|
for(i=0;i<8;i++) |
|
|
|
@ -185,7 +193,8 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc |
|
|
|
|
* |
|
|
|
|
****************************************************************************/ |
|
|
|
|
|
|
|
|
|
static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) { |
|
|
|
|
static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, ptrdiff_t stride) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
int16_t (*src)[8] = (int16_t(*)[8])block; |
|
|
|
|
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; |
|
|
|
@ -261,7 +270,8 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) { |
|
|
|
|
****************************************************************************/ |
|
|
|
|
|
|
|
|
|
#define CAVS_SUBPIX(OPNAME, OP, NAME, A, B, C, D, E, F) \ |
|
|
|
|
static void OPNAME ## cavs_filt8_h_ ## NAME(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
|
|
|
|
|
static void OPNAME ## cavs_filt8_h_ ## NAME(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride)\
|
|
|
|
|
{ \
|
|
|
|
|
const int h=8;\
|
|
|
|
|
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
|
|
|
|
|
int i;\
|
|
|
|
@ -280,7 +290,8 @@ static void OPNAME ## cavs_filt8_h_ ## NAME(uint8_t *dst, const uint8_t *src, in |
|
|
|
|
}\
|
|
|
|
|
}\
|
|
|
|
|
\
|
|
|
|
|
static void OPNAME ## cavs_filt8_v_ ## NAME(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
|
|
|
|
|
static void OPNAME ## cavs_filt8_v_ ## NAME(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride)\
|
|
|
|
|
{ \
|
|
|
|
|
const int w=8;\
|
|
|
|
|
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;\
|
|
|
|
|
int i;\
|
|
|
|
@ -312,7 +323,8 @@ static void OPNAME ## cavs_filt8_v_ ## NAME(uint8_t *dst, const uint8_t *src, i |
|
|
|
|
}\
|
|
|
|
|
}\
|
|
|
|
|
\
|
|
|
|
|
static void OPNAME ## cavs_filt16_v_ ## NAME(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
|
|
|
|
|
static void OPNAME ## cavs_filt16_v_ ## NAME(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride)\
|
|
|
|
|
{ \
|
|
|
|
|
OPNAME ## cavs_filt8_v_ ## NAME(dst , src , dstStride, srcStride);\
|
|
|
|
|
OPNAME ## cavs_filt8_v_ ## NAME(dst+8, src+8, dstStride, srcStride);\
|
|
|
|
|
src += 8*srcStride;\
|
|
|
|
@ -321,7 +333,8 @@ static void OPNAME ## cavs_filt16_v_ ## NAME(uint8_t *dst, const uint8_t *src, i |
|
|
|
|
OPNAME ## cavs_filt8_v_ ## NAME(dst+8, src+8, dstStride, srcStride);\
|
|
|
|
|
}\
|
|
|
|
|
\
|
|
|
|
|
static void OPNAME ## cavs_filt16_h_ ## NAME(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride){\
|
|
|
|
|
static void OPNAME ## cavs_filt16_h_ ## NAME(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride)\
|
|
|
|
|
{ \
|
|
|
|
|
OPNAME ## cavs_filt8_h_ ## NAME(dst , src , dstStride, srcStride);\
|
|
|
|
|
OPNAME ## cavs_filt8_h_ ## NAME(dst+8, src+8, dstStride, srcStride);\
|
|
|
|
|
src += 8*srcStride;\
|
|
|
|
@ -331,7 +344,8 @@ static void OPNAME ## cavs_filt16_h_ ## NAME(uint8_t *dst, const uint8_t *src, i |
|
|
|
|
}\
|
|
|
|
|
|
|
|
|
|
#define CAVS_SUBPIX_HV(OPNAME, OP, NAME, AH, BH, CH, DH, EH, FH, AV, BV, CV, DV, EV, FV, FULL) \ |
|
|
|
|
static void OPNAME ## cavs_filt8_hv_ ## NAME(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dstStride, int srcStride){\
|
|
|
|
|
static void OPNAME ## cavs_filt8_hv_ ## NAME(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, ptrdiff_t dstStride, ptrdiff_t srcStride)\
|
|
|
|
|
{ \
|
|
|
|
|
int16_t temp[8*(8+5)];\
|
|
|
|
|
int16_t *tmp = temp;\
|
|
|
|
|
const int h=8;\
|
|
|
|
@ -412,7 +426,8 @@ static void OPNAME ## cavs_filt8_hv_ ## NAME(uint8_t *dst, const uint8_t *src1, |
|
|
|
|
}\
|
|
|
|
|
}\
|
|
|
|
|
\
|
|
|
|
|
static void OPNAME ## cavs_filt16_hv_ ## NAME(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dstStride, int srcStride){ \
|
|
|
|
|
static void OPNAME ## cavs_filt16_hv_ ## NAME(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, ptrdiff_t dstStride, ptrdiff_t srcStride)\
|
|
|
|
|
{ \
|
|
|
|
|
OPNAME ## cavs_filt8_hv_ ## NAME(dst , src1, src2 , dstStride, srcStride); \
|
|
|
|
|
OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, src2+8, dstStride, srcStride); \
|
|
|
|
|
src1 += 8*srcStride;\
|
|
|
|
|