libpostproc/postprocess_altivec_template.c File Reference

#include "libavutil/avutil.h"

Go to the source code of this file.

Defines

#define ALTIVEC_TRANSPOSE_8x8_SHORT(src_a, src_b, src_c, src_d, src_e, src_f, src_g, src_h)
#define LOAD_LINE(i)
#define LOAD_LINE_ALIGNED(i)
#define ITER(i, j)
#define LOAD_LINE(i)
#define LOAD_LINE_ALIGNED(i)
#define COMPUTE_VR(i, j, k)
#define PACK_AND_STORE(i)
#define PACK_AND_STORE_ALIGNED(i)
#define LOAD_LINE(i)
#define STORE(i)
#define LOAD_LINE(i)
#define EXTRACT(op)
#define COMPARE(i)
#define F_INIT(i)
#define F2(i, j, k, l)
#define ITER(i, j, k)
#define STORE_LINE(i)
#define doHorizLowPass_altivec(a...)   doHorizLowPass_C(a)
#define doHorizDefFilter_altivec(a...)   doHorizDefFilter_C(a)
#define do_a_deblock_altivec(a...)   do_a_deblock_C(a)
#define LOAD_LINE(src, i)
#define ACCUMULATE_DIFFS(i)
#define OP(i)   v_tempBlurredAss##i = vec_avg(v_tempBlurredAss##i, v_srcAss##i);
#define OP(i)   v_tempBlurredAss##i = v_srcAss##i;
#define OP(i)
#define OP(i)
#define PACK_AND_STORE(src, i)
#define LOAD_DOUBLE_LINE(i, j)
#define LOAD_DOUBLE_LINE(i, j)
#define STORE_DOUBLE_LINE(i, j)

Functions

static int vertClassify_altivec (uint8_t src[], int stride, PPContext *c)
static void doVertLowPass_altivec (uint8_t *src, int stride, PPContext *c)
static void doVertDefFilter_altivec (uint8_t src[], int stride, PPContext *c)
static void dering_altivec (uint8_t src[], int stride, PPContext *c)
static void tempNoiseReducer_TMPL (uint8_t *src, int stride, uint8_t *tempBlurred, uint32_t *tempBlurredPast, int *maxNoise)
static void transpose_16x8_char_toPackedAlign_altivec (unsigned char *dst, unsigned char *src, int stride)
static void transpose_8x16_char_fromPackedAlign_altivec (unsigned char *dst, unsigned char *src, int stride)


Define Documentation

#define ACCUMULATE_DIFFS (  ) 

Value:

vector signed short v_d##i = vec_sub(v_tempBlurredAss##i,   \
                                         v_srcAss##i);          \
    v_dp = vec_msums(v_d##i, v_d##i, v_dp);                     \
    v_sysdp = vec_msums(v_d##i, vsint16_1, v_sysdp)

Referenced by tempNoiseReducer_TMPL().

#define ALTIVEC_TRANSPOSE_8x8_SHORT ( src_a,
src_b,
src_c,
src_d,
src_e,
src_f,
src_g,
src_h   ) 

Value:

do {                                                          \
        __typeof__(src_a) tempA1, tempB1, tempC1, tempD1;         \
        __typeof__(src_a) tempE1, tempF1, tempG1, tempH1;         \
        __typeof__(src_a) tempA2, tempB2, tempC2, tempD2;         \
        __typeof__(src_a) tempE2, tempF2, tempG2, tempH2;         \
        tempA1 = vec_mergeh (src_a, src_e);                       \
        tempB1 = vec_mergel (src_a, src_e);                       \
        tempC1 = vec_mergeh (src_b, src_f);                       \
        tempD1 = vec_mergel (src_b, src_f);                       \
        tempE1 = vec_mergeh (src_c, src_g);                       \
        tempF1 = vec_mergel (src_c, src_g);                       \
        tempG1 = vec_mergeh (src_d, src_h);                       \
        tempH1 = vec_mergel (src_d, src_h);                       \
        tempA2 = vec_mergeh (tempA1, tempE1);                     \
        tempB2 = vec_mergel (tempA1, tempE1);                     \
        tempC2 = vec_mergeh (tempB1, tempF1);                     \
        tempD2 = vec_mergel (tempB1, tempF1);                     \
        tempE2 = vec_mergeh (tempC1, tempG1);                     \
        tempF2 = vec_mergel (tempC1, tempG1);                     \
        tempG2 = vec_mergeh (tempD1, tempH1);                     \
        tempH2 = vec_mergel (tempD1, tempH1);                     \
        src_a = vec_mergeh (tempA2, tempE2);                      \
        src_b = vec_mergel (tempA2, tempE2);                      \
        src_c = vec_mergeh (tempB2, tempF2);                      \
        src_d = vec_mergel (tempB2, tempF2);                      \
        src_e = vec_mergeh (tempC2, tempG2);                      \
        src_f = vec_mergel (tempC2, tempG2);                      \
        src_g = vec_mergeh (tempD2, tempH2);                      \
        src_h = vec_mergel (tempD2, tempH2);                      \
    } while (0)

Definition at line 25 of file postprocess_altivec_template.c.

#define COMPARE (  ) 

Value:

vector signed int sum##i;                                           \
    do {                                                                \
        const vector unsigned char cmp##i =                             \
            (vector unsigned char)vec_cmpgt(src##i, v_avg);             \
        const vector unsigned short cmpHi##i =                          \
            (vector unsigned short)vec_mergeh(cmp##i, cmp##i);          \
        const vector unsigned short cmpLi##i =                          \
            (vector unsigned short)vec_mergel(cmp##i, cmp##i);          \
        const vector signed short cmpHf##i =                            \
            (vector signed short)vec_and(cmpHi##i, mask1);              \
        const vector signed short cmpLf##i =                            \
            (vector signed short)vec_and(cmpLi##i, mask2);              \
        const vector signed int sump##i = vec_sum4s(cmpHf##i, zero);    \
        const vector signed int sumq##i = vec_sum4s(cmpLf##i, sump##i); \
        sum##i  = vec_sums(sumq##i, zero); } while (0)

Referenced by dering_altivec().

#define COMPUTE_VR ( i,
j,
 ) 

Value:

const vector signed short temps1##i =                               \
            vec_add(v_sumsB##i, v_sumsB##k);                                \
        const vector signed short temps2##i =                               \
            vec_mladd(vb##j, (vector signed short)v_2, temps1##i);          \
        const vector signed short  vr##j = vec_sra(temps2##i, v_4)

Referenced by doVertLowPass_altivec().

#define do_a_deblock_altivec ( a...   )     do_a_deblock_C(a)

Definition at line 829 of file postprocess_altivec_template.c.

#define doHorizDefFilter_altivec ( a...   )     doHorizDefFilter_C(a)

Definition at line 828 of file postprocess_altivec_template.c.

#define doHorizLowPass_altivec ( a...   )     doHorizLowPass_C(a)

Definition at line 827 of file postprocess_altivec_template.c.

#define EXTRACT ( op   ) 

Value:

do {                                                \
    const vector unsigned char s##op##_1   = vec_##op(trunc_src12, trunc_src34); \
    const vector unsigned char s##op##_2   = vec_##op(trunc_src56, trunc_src78); \
    const vector unsigned char s##op##_6   = vec_##op(s##op##_1, s##op##_2);     \
    const vector unsigned char s##op##_8h  = vec_mergeh(s##op##_6, s##op##_6);   \
    const vector unsigned char s##op##_8l  = vec_mergel(s##op##_6, s##op##_6);   \
    const vector unsigned char s##op##_9   = vec_##op(s##op##_8h, s##op##_8l);   \
    const vector unsigned char s##op##_9h  = vec_mergeh(s##op##_9, s##op##_9);   \
    const vector unsigned char s##op##_9l  = vec_mergel(s##op##_9, s##op##_9);   \
    const vector unsigned char s##op##_10  = vec_##op(s##op##_9h, s##op##_9l);   \
    const vector unsigned char s##op##_10h = vec_mergeh(s##op##_10, s##op##_10); \
    const vector unsigned char s##op##_10l = vec_mergel(s##op##_10, s##op##_10); \
    const vector unsigned char s##op##_11  = vec_##op(s##op##_10h, s##op##_10l); \
    const vector unsigned char s##op##_11h = vec_mergeh(s##op##_11, s##op##_11); \
    const vector unsigned char s##op##_11l = vec_mergel(s##op##_11, s##op##_11); \
    v_##op = vec_##op(s##op##_11h, s##op##_11l); } while (0)

Referenced by dering_altivec().

#define F2 ( i,
j,
k,
 ) 

#define F_INIT (  ) 

Value:

vector unsigned char tenRightM##i = tenRight;       \
    vector unsigned char permA1M##i = permA1;           \
    vector unsigned char permA2M##i = permA2;           \
    vector unsigned char extractPermM##i = extractPerm

#define ITER ( i,
j,
 ) 

Value:

F_INIT(i);                                  \
    F2(i, j, k, 0);                             \
    F2(i, j, k, 1);                             \
    F2(i, j, k, 2);                             \
    F2(i, j, k, 3);                             \
    F2(i, j, k, 4);                             \
    F2(i, j, k, 5);                             \
    F2(i, j, k, 6);                             \
    F2(i, j, k, 7)

#define ITER ( i,
 ) 

Value:

const vector signed short v_diff##i =                               \
        vec_sub(v_srcAss##i, v_srcAss##j);                              \
    const vector signed short v_sum##i =                                \
        vec_add(v_diff##i, v_dcOffset);                                 \
    const vector signed short v_comp##i =                               \
        (vector signed short)vec_cmplt((vector unsigned short)v_sum##i, \
                                       v_dcThreshold);                  \
    const vector signed short v_part##i = vec_and(mask, v_comp##i);

Referenced by dering_altivec(), and vertClassify_altivec().

#define LOAD_DOUBLE_LINE ( i,
 ) 

Value:

vector unsigned char src##i = vec_ld(i * 16, src);            \
    vector unsigned char src##j = vec_ld(j * 16, src)

#define LOAD_DOUBLE_LINE ( i,
 ) 

Value:

vector unsigned char perm1##i = vec_lvsl(i * stride, src);          \
    vector unsigned char perm2##i = vec_lvsl(j * stride, src);          \
    vector unsigned char srcA##i = vec_ld(i * stride, src);             \
    vector unsigned char srcB##i = vec_ld(i * stride + 16, src);        \
    vector unsigned char srcC##i = vec_ld(j * stride, src);             \
    vector unsigned char srcD##i = vec_ld(j * stride+ 16, src);         \
    vector unsigned char src##i = vec_perm(srcA##i, srcB##i, perm1##i); \
    vector unsigned char src##j = vec_perm(srcC##i, srcD##i, perm2##i)

Referenced by transpose_16x8_char_toPackedAlign_altivec(), and transpose_8x16_char_fromPackedAlign_altivec().

#define LOAD_LINE ( src,
 ) 

Value:

register int j##src##i = i * stride;                                \
    vector unsigned char perm##src##i = vec_lvsl(j##src##i, src);       \
    const vector unsigned char v_##src##A1##i = vec_ld(j##src##i, src); \
    const vector unsigned char v_##src##A2##i = vec_ld(j##src##i + 16, src); \
    const vector unsigned char v_##src##A##i =                          \
        vec_perm(v_##src##A1##i, v_##src##A2##i, perm##src##i);         \
    vector signed short v_##src##Ass##i =                               \
        (vector signed short)vec_mergeh((vector signed char)zero,       \
                                        (vector signed char)v_##src##A##i)

#define LOAD_LINE (  ) 

Value:

const vector unsigned char perm##i =                              \
        vec_lvsl(i * stride, srcCopy);                                \
    vector unsigned char sA##i = vec_ld(i * stride, srcCopy);         \
    vector unsigned char sB##i = vec_ld(i * stride + 16, srcCopy);    \
    vector unsigned char src##i = vec_perm(sA##i, sB##i, perm##i)

#define LOAD_LINE (  ) 

Value:

const vector unsigned char perm##i =                                \
        vec_lvsl(i * stride, src2);                                     \
    const vector unsigned char vbA##i =                                 \
        vec_ld(i * stride, src2);                                       \
    const vector unsigned char vbB##i =                                 \
        vec_ld(i * stride + 16, src2);                                  \
    const vector unsigned char vbT##i =                                 \
        vec_perm(vbA##i, vbB##i, perm##i);                              \
    const vector signed short vb##i =                                   \
        (vector signed short)vec_mergeh((vector unsigned char)zero,     \
                                        (vector unsigned char)vbT##i)

#define LOAD_LINE (  ) 

Value:

perml##i = vec_lvsl(i * stride, src2);                              \
    vbA##i = vec_ld(i * stride, src2);                                  \
    vbB##i = vec_ld(i * stride + 16, src2);                             \
    vbT##i = vec_perm(vbA##i, vbB##i, perml##i);                        \
    vb##i =                                                             \
        (vector signed short)vec_mergeh((vector unsigned char)zero,     \
                                        (vector unsigned char)vbT##i)

#define LOAD_LINE (  ) 

Value:

{                                                                   \
    vector unsigned char perm##i = vec_lvsl(j##i, src2);                \
    vector unsigned char v_srcA2##i;                                    \
    vector unsigned char v_srcA1##i = vec_ld(j##i, src2);               \
    if (two_vectors)                                                    \
        v_srcA2##i = vec_ld(j##i + 16, src2);                           \
    v_srcA##i =                                                         \
        vec_perm(v_srcA1##i, v_srcA2##i, perm##i);                      \
    v_srcAss##i =                                                       \
        (vector signed short)vec_mergeh((vector signed char)zero,       \
                                        (vector signed char)v_srcA##i); }

Referenced by dering_altivec(), doVertDefFilter_altivec(), doVertLowPass_altivec(), tempNoiseReducer_TMPL(), and vertClassify_altivec().

#define LOAD_LINE_ALIGNED (  ) 

Value:

vbT##i = vec_ld(j##i, src2);                                        \
    vb##i =                                                             \
        (vector signed short)vec_mergeh((vector signed char)zero,       \
                                        (vector signed char)vbT##i)

#define LOAD_LINE_ALIGNED (  ) 

Value:

v_srcA##i = vec_ld(j##i, src2);                                     \
    v_srcAss##i =                                                       \
        (vector signed short)vec_mergeh((vector signed char)zero,       \
                                        (vector signed char)v_srcA##i)

Referenced by doVertLowPass_altivec(), and vertClassify_altivec().

#define OP (  ) 

Value:

const vector signed short v_temp##i =               \
                vec_mladd(v_tempBlurredAss##i,                  \
                          vsint16_3, v_srcAss##i);              \
            const vector signed short v_temp2##i =              \
                vec_add(v_temp##i, vsint16_2);                  \
            v_tempBlurredAss##i = vec_sr(v_temp2##i, (vector unsigned short)vsint16_2)

#define OP (  ) 

Value:

const vector signed short v_temp##i =               \
                vec_mladd(v_tempBlurredAss##i,                  \
                          vsint16_7, v_srcAss##i);              \
            const vector signed short v_temp2##i =              \
                vec_add(v_temp##i, vsint16_4);                  \
            v_tempBlurredAss##i = vec_sr(v_temp2##i, vuint16_3)

#define OP (  )     v_tempBlurredAss##i = v_srcAss##i;

#define OP (  )     v_tempBlurredAss##i = vec_avg(v_tempBlurredAss##i, v_srcAss##i);

#define PACK_AND_STORE ( src,
 ) 

Value:

const vector unsigned char perms##src##i =                  \
        vec_lvsr(i * stride, src);                              \
    const vector unsigned char vf##src##i =                     \
        vec_packsu(v_tempBlurredAss##i, (vector signed short)zero); \
    const vector unsigned char vg##src##i =                     \
        vec_perm(vf##src##i, v_##src##A##i, permHH);            \
    const vector unsigned char mask##src##i =                   \
        vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##src##i); \
    const vector unsigned char vg2##src##i =                    \
        vec_perm(vg##src##i, vg##src##i, perms##src##i);        \
    const vector unsigned char svA##src##i =                    \
        vec_sel(v_##src##A1##i, vg2##src##i, mask##src##i);     \
    const vector unsigned char svB##src##i =                    \
        vec_sel(vg2##src##i, v_##src##A2##i, mask##src##i);     \
    vec_st(svA##src##i, i * stride, src);                       \
    vec_st(svB##src##i, i * stride + 16, src)

#define PACK_AND_STORE (  ) 

Value:

{   const vector unsigned char perms##i =                       \
        vec_lvsr(i * stride, src2);                             \
    const vector unsigned char vf##i =                          \
        vec_packsu(vr##i, (vector signed short)zero);           \
    const vector unsigned char vg##i =                          \
        vec_perm(vf##i, vbT##i, permHH);                        \
    const vector unsigned char mask##i =                        \
        vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##i); \
    const vector unsigned char vg2##i =                         \
        vec_perm(vg##i, vg##i, perms##i);                       \
    const vector unsigned char svA##i =                         \
        vec_sel(vbA##i, vg2##i, mask##i);                       \
    const vector unsigned char svB##i =                         \
        vec_sel(vg2##i, vbB##i, mask##i);                       \
    vec_st(svA##i, i * stride, src2);                           \
    vec_st(svB##i, i * stride + 16, src2);}

Referenced by doVertLowPass_altivec(), and tempNoiseReducer_TMPL().

#define PACK_AND_STORE_ALIGNED (  ) 

Value:

{   const vector unsigned char vf##i =                          \
        vec_packsu(vr##i, (vector signed short)zero);           \
    const vector unsigned char vg##i =                          \
        vec_perm(vf##i, vbT##i, permHH);                        \
    vec_st(vg##i, i * stride, src2);}

Referenced by doVertLowPass_altivec().

#define STORE (  ) 

Value:

{    const vector unsigned char perms##i =                      \
         vec_lvsr(i * stride, src2);                            \
     const vector unsigned char vg##i =                         \
         vec_perm(st##i, vbT##i, permHH);                       \
     const vector unsigned char mask##i =                       \
         vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##i); \
     const vector unsigned char vg2##i =                        \
         vec_perm(vg##i, vg##i, perms##i);                      \
     const vector unsigned char svA##i =                        \
         vec_sel(vbA##i, vg2##i, mask##i);                      \
     const vector unsigned char svB##i =                        \
         vec_sel(vg2##i, vbB##i, mask##i);                      \
     vec_st(svA##i, i * stride, src2);                          \
     vec_st(svB##i, i * stride + 16, src2);}

#define STORE_DOUBLE_LINE ( i,
 ) 

Value:

vector unsigned char dstA##i = vec_ld(i * stride, dst);             \
    vector unsigned char dstB##i = vec_ld(i * stride + 16, dst);        \
    vector unsigned char dstA##j = vec_ld(j * stride, dst);             \
    vector unsigned char dstB##j = vec_ld(j * stride+ 16, dst);         \
    vector unsigned char align##i = vec_lvsr(i * stride, dst);          \
    vector unsigned char align##j = vec_lvsr(j * stride, dst);          \
    vector unsigned char mask##i = vec_perm(zero, (vector unsigned char)neg1, align##i); \
    vector unsigned char mask##j = vec_perm(zero, (vector unsigned char)neg1, align##j); \
    vector unsigned char dstR##i = vec_perm(temp##i, temp##i, align##i);\
    vector unsigned char dstR##j = vec_perm(temp##j, temp##j, align##j);\
    vector unsigned char dstAF##i = vec_sel(dstA##i, dstR##i, mask##i); \
    vector unsigned char dstBF##i = vec_sel(dstR##i, dstB##i, mask##i); \
    vector unsigned char dstAF##j = vec_sel(dstA##j, dstR##j, mask##j); \
    vector unsigned char dstBF##j = vec_sel(dstR##j, dstB##j, mask##j); \
    vec_st(dstAF##i, i * stride, dst);                                  \
    vec_st(dstBF##i, i * stride + 16, dst);                             \
    vec_st(dstAF##j, j * stride, dst);                                  \
    vec_st(dstBF##j, j * stride + 16, dst)

Referenced by transpose_8x16_char_fromPackedAlign_altivec().

#define STORE_LINE (  ) 

Value:

const vector unsigned char permST##i =              \
        vec_lvsr(i * stride, srcCopy);                  \
    const vector unsigned char maskST##i =              \
        vec_perm((vector unsigned char)zero,            \
                 (vector unsigned char)neg1, permST##i);\
    src##i = vec_perm(src##i ,src##i, permST##i);       \
    sA##i= vec_sel(sA##i, src##i, maskST##i);           \
    sB##i= vec_sel(src##i, sB##i, maskST##i);           \
    vec_st(sA##i, i * stride, srcCopy);                 \
    vec_st(sB##i, i * stride + 16, srcCopy)

Referenced by dering_altivec().


Function Documentation

static void dering_altivec ( uint8_t  src[],
int  stride,
PPContext c 
) [inline, static]

Definition at line 531 of file postprocess_altivec_template.c.

static void doVertDefFilter_altivec ( uint8_t  src[],
int  stride,
PPContext c 
) [inline, static]

Definition at line 410 of file postprocess_altivec_template.c.

Referenced by postProcess_TMPL().

static void doVertLowPass_altivec ( uint8_t *  src,
int  stride,
PPContext c 
) [inline, static]

Definition at line 212 of file postprocess_altivec_template.c.

Referenced by postProcess_TMPL().

static void tempNoiseReducer_TMPL ( uint8_t *  src,
int  stride,
uint8_t *  tempBlurred,
uint32_t *  tempBlurredPast,
int *  maxNoise 
) [inline, static]

Definition at line 831 of file postprocess_altivec_template.c.

static void transpose_16x8_char_toPackedAlign_altivec ( unsigned char *  dst,
unsigned char *  src,
int  stride 
) [inline, static]

Definition at line 1022 of file postprocess_altivec_template.c.

Referenced by postProcess_TMPL().

static void transpose_8x16_char_fromPackedAlign_altivec ( unsigned char *  dst,
unsigned char *  src,
int  stride 
) [inline, static]

Definition at line 1127 of file postprocess_altivec_template.c.

Referenced by postProcess_TMPL().

static int vertClassify_altivec ( uint8_t  src[],
int  stride,
PPContext c 
) [inline, static]

Definition at line 58 of file postprocess_altivec_template.c.

Referenced by postProcess_TMPL().


Generated on Fri Oct 26 02:35:46 2012 for FFmpeg by  doxygen 1.5.8