[FFmpeg-devel] [RFC] RV30 1/3pel MC functions

Loren Merritt lorenm
Sun Dec 23 22:37:05 CET 2007


> +#define op_avg(a, b)  a = (((a)+cm[((b) + 32)>>6]+1)>>1)
> +#define op_put(a, b)  a = cm[((b) + 32)>>6]
> +
> +static const int coeffs[4] = {8, 5, 3, 0};
> +
> +#define RV30_CHROMA(OPNAME, OP) \
> +static void OPNAME ## rv30_chroma_mc4_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
> +    const int A=coeffs[  x]*coeffs[  y];\
> +    const int B=coeffs[3-x]*coeffs[  y];\
> +    const int C=coeffs[  x]*coeffs[3-y];\
> +    const int D=coeffs[3-x]*coeffs[3-y];\
> +    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
> +    int i;\
> +\
> +    for(i=0; i<h; i++)\
> +    {\
> +        OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
> +        OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\
> +        OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\
> +        OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\
> +        dst+= stride;\
> +        src+= stride;\
> +    }\
> +}\

Why the ff_cropTbl? Bilinear interpolation has no overshoot.

--Loren Merritt




More information about the ffmpeg-devel mailing list