libavcodec/ppc/h264_altivec.c File Reference

#include "dsputil.h"
#include "gcc_fixes.h"
#include "dsputil_ppc.h"
#include "dsputil_altivec.h"
#include "util_altivec.h"
#include "types_altivec.h"
#include "h264_template_altivec.c"

Go to the source code of this file.

Defines

#define PUT_OP_U8_ALTIVEC(d, s, dst)   d = s
#define AVG_OP_U8_ALTIVEC(d, s, dst)   d = vec_avg(dst, s)
#define OP_U8_ALTIVEC   PUT_OP_U8_ALTIVEC
#define PREFIX_h264_chroma_mc8_altivec   put_h264_chroma_mc8_altivec
#define PREFIX_h264_chroma_mc8_num   altivec_put_h264_chroma_mc8_num
#define PREFIX_h264_qpel16_h_lowpass_altivec   put_h264_qpel16_h_lowpass_altivec
#define PREFIX_h264_qpel16_h_lowpass_num   altivec_put_h264_qpel16_h_lowpass_num
#define PREFIX_h264_qpel16_v_lowpass_altivec   put_h264_qpel16_v_lowpass_altivec
#define PREFIX_h264_qpel16_v_lowpass_num   altivec_put_h264_qpel16_v_lowpass_num
#define PREFIX_h264_qpel16_hv_lowpass_altivec   put_h264_qpel16_hv_lowpass_altivec
#define PREFIX_h264_qpel16_hv_lowpass_num   altivec_put_h264_qpel16_hv_lowpass_num
#define OP_U8_ALTIVEC   AVG_OP_U8_ALTIVEC
#define PREFIX_h264_chroma_mc8_altivec   avg_h264_chroma_mc8_altivec
#define PREFIX_h264_chroma_mc8_num   altivec_avg_h264_chroma_mc8_num
#define PREFIX_h264_qpel16_h_lowpass_altivec   avg_h264_qpel16_h_lowpass_altivec
#define PREFIX_h264_qpel16_h_lowpass_num   altivec_avg_h264_qpel16_h_lowpass_num
#define PREFIX_h264_qpel16_v_lowpass_altivec   avg_h264_qpel16_v_lowpass_altivec
#define PREFIX_h264_qpel16_v_lowpass_num   altivec_avg_h264_qpel16_v_lowpass_num
#define PREFIX_h264_qpel16_hv_lowpass_altivec   avg_h264_qpel16_hv_lowpass_altivec
#define PREFIX_h264_qpel16_hv_lowpass_num   altivec_avg_h264_qpel16_hv_lowpass_num
#define H264_MC(OPNAME, SIZE, CODETYPE)
#define VEC_1D_DCT(vb0, vb1, vb2, vb3, va0, va1, va2, va3)
#define VEC_TRANSPOSE_4(a0, a1, a2, a3, b0, b1, b2, b3)
#define VEC_LOAD_U8_ADD_S16_STORE_U8(va)
#define IDCT8_1D_ALTIVEC(s0, s1, s2, s3, s4, s5, s6, s7,d0, d1, d2, d3, d4, d5, d6, d7)
#define ALTIVEC_STORE_SUM_CLIP(dest, idctv, perm_ldv, perm_stv, sel)
#define transpose4x16(r0, r1, r2, r3)
#define readAndTranspose16x6(src, src_stride, r8, r9, r10, r11, r12, r13)
 performs a 6x16 transpose of data in src, and stores it to dst
#define h264_deblock_p0_q0(p0, p1, q0, q1, tc0masked)
#define h264_loop_filter_luma_altivec(p2, p1, p0, q0, q1, q2, alpha, beta, tc0)
#define dspfunc(PFX, IDX, NUM)

Functions

void put_no_rnd_h264_chroma_mc8_altivec (uint8_t *dst, uint8_t *src, int stride, int h, int x, int y)
static void put_pixels16_l2_altivec (uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int h)
static void avg_pixels16_l2_altivec (uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int h)
static void ff_h264_idct_add_altivec (uint8_t *dst, DCTELEM *block, int stride)
void ff_h264_idct8_add_altivec (uint8_t *dst, DCTELEM *dct, int stride)
static void write16x4 (uint8_t *dst, int dst_stride, register vec_u8_t r0, register vec_u8_t r1, register vec_u8_t r2, register vec_u8_t r3)
static vec_u8_t diff_lt_altivec (register vec_u8_t x, register vec_u8_t y, register vec_u8_t a)
static vec_u8_t h264_deblock_mask (register vec_u8_t p0, register vec_u8_t p1, register vec_u8_t q0, register vec_u8_t q1, register vec_u8_t alpha, register vec_u8_t beta)
static vec_u8_t h264_deblock_q1 (register vec_u8_t p0, register vec_u8_t p1, register vec_u8_t p2, register vec_u8_t q0, register vec_u8_t tc0)
static void h264_v_loop_filter_luma_altivec (uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
static void h264_h_loop_filter_luma_altivec (uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
void dsputil_h264_init_ppc (DSPContext *c, AVCodecContext *avctx)


Define Documentation

#define ALTIVEC_STORE_SUM_CLIP ( dest,
idctv,
perm_ldv,
perm_stv,
sel   ) 

Value:

{ \
    /* unaligned load */                                       \
    vec_u8_t hv = vec_ld( 0, dest );                           \
    vec_u8_t lv = vec_ld( 7, dest );                           \
    vec_u8_t dstv   = vec_perm( hv, lv, (vec_u8_t)perm_ldv );  \
    vec_s16_t idct_sh6 = vec_sra(idctv, sixv);                 \
    vec_u16_t dst16 = (vec_u16_t)vec_mergeh(zero_u8v, dstv);   \
    vec_s16_t idstsum = vec_adds(idct_sh6, (vec_s16_t)dst16);  \
    vec_u8_t idstsum8 = vec_packsu(zero_s16v, idstsum);        \
    vec_u8_t edgehv;                                           \
    /* unaligned store */                                      \
    vec_u8_t bodyv  = vec_perm( idstsum8, idstsum8, perm_stv );\
    vec_u8_t edgelv = vec_perm( sel, zero_u8v, perm_stv );     \
    lv    = vec_sel( lv, bodyv, edgelv );                      \
    vec_st( lv, 7, dest );                                     \
    hv    = vec_ld( 0, dest );                                 \
    edgehv = vec_perm( zero_u8v, sel, perm_stv );              \
    hv    = vec_sel( hv, bodyv, edgehv );                      \
    vec_st( hv, 0, dest );                                     \
 }

Definition at line 533 of file h264_altivec.c.

Referenced by ff_h264_idct8_add_altivec().

#define AVG_OP_U8_ALTIVEC ( d,
s,
dst   )     d = vec_avg(dst, s)

Definition at line 31 of file h264_altivec.c.

#define dspfunc ( PFX,
IDX,
NUM   ) 

Value:

c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_altivec; \
        c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_altivec; \
        c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_altivec; \
        c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_altivec; \
        c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_altivec; \
        c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_altivec; \
        c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_altivec; \
        c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_altivec; \
        c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_altivec; \
        c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_altivec; \
        c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_altivec; \
        c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_altivec; \
        c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_altivec; \
        c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_altivec; \
        c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_altivec; \
        c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_altivec

#define h264_deblock_p0_q0 ( p0,
p1,
q0,
q1,
tc0masked   ) 

Definition at line 765 of file h264_altivec.c.

#define h264_loop_filter_luma_altivec ( p2,
p1,
p0,
q0,
q1,
q2,
alpha,
beta,
tc0   ) 

#define H264_MC ( OPNAME,
SIZE,
CODETYPE   ) 

Definition at line 73 of file h264_altivec.c.

#define IDCT8_1D_ALTIVEC ( s0,
s1,
s2,
s3,
s4,
s5,
s6,
s7,
d0,
d1,
d2,
d3,
d4,
d5,
d6,
d7   ) 

Definition at line 479 of file h264_altivec.c.

Referenced by ff_h264_idct8_add_altivec().

#define OP_U8_ALTIVEC   AVG_OP_U8_ALTIVEC

Definition at line 53 of file h264_altivec.c.

#define OP_U8_ALTIVEC   PUT_OP_U8_ALTIVEC

#define PREFIX_h264_chroma_mc8_altivec   avg_h264_chroma_mc8_altivec

Definition at line 54 of file h264_altivec.c.

#define PREFIX_h264_chroma_mc8_altivec   put_h264_chroma_mc8_altivec

Definition at line 54 of file h264_altivec.c.

#define PREFIX_h264_chroma_mc8_num   altivec_avg_h264_chroma_mc8_num

Definition at line 55 of file h264_altivec.c.

#define PREFIX_h264_chroma_mc8_num   altivec_put_h264_chroma_mc8_num

Definition at line 55 of file h264_altivec.c.

Referenced by PREFIX_h264_chroma_mc8_altivec().

#define PREFIX_h264_qpel16_h_lowpass_altivec   avg_h264_qpel16_h_lowpass_altivec

Definition at line 56 of file h264_altivec.c.

#define PREFIX_h264_qpel16_h_lowpass_altivec   put_h264_qpel16_h_lowpass_altivec

Definition at line 56 of file h264_altivec.c.

#define PREFIX_h264_qpel16_h_lowpass_num   altivec_avg_h264_qpel16_h_lowpass_num

Definition at line 57 of file h264_altivec.c.

#define PREFIX_h264_qpel16_h_lowpass_num   altivec_put_h264_qpel16_h_lowpass_num

Definition at line 57 of file h264_altivec.c.

Referenced by PREFIX_h264_qpel16_h_lowpass_altivec().

#define PREFIX_h264_qpel16_hv_lowpass_altivec   avg_h264_qpel16_hv_lowpass_altivec

Definition at line 60 of file h264_altivec.c.

#define PREFIX_h264_qpel16_hv_lowpass_altivec   put_h264_qpel16_hv_lowpass_altivec

Definition at line 60 of file h264_altivec.c.

#define PREFIX_h264_qpel16_hv_lowpass_num   altivec_avg_h264_qpel16_hv_lowpass_num

Definition at line 61 of file h264_altivec.c.

#define PREFIX_h264_qpel16_hv_lowpass_num   altivec_put_h264_qpel16_hv_lowpass_num

Definition at line 61 of file h264_altivec.c.

Referenced by PREFIX_h264_qpel16_hv_lowpass_altivec().

#define PREFIX_h264_qpel16_v_lowpass_altivec   avg_h264_qpel16_v_lowpass_altivec

Definition at line 58 of file h264_altivec.c.

#define PREFIX_h264_qpel16_v_lowpass_altivec   put_h264_qpel16_v_lowpass_altivec

Definition at line 58 of file h264_altivec.c.

#define PREFIX_h264_qpel16_v_lowpass_num   altivec_avg_h264_qpel16_v_lowpass_num

Definition at line 59 of file h264_altivec.c.

#define PREFIX_h264_qpel16_v_lowpass_num   altivec_put_h264_qpel16_v_lowpass_num

Definition at line 59 of file h264_altivec.c.

Referenced by PREFIX_h264_qpel16_v_lowpass_altivec().

#define PUT_OP_U8_ALTIVEC ( d,
s,
dst   )     d = s

Definition at line 30 of file h264_altivec.c.

#define readAndTranspose16x6 ( src,
src_stride,
r8,
r9,
r10,
r11,
r12,
r13   ) 

performs a 6x16 transpose of data in src, and stores it to dst

Todo:
FIXME: see if we can't spare some vec_lvsl() by them factorizing out of unaligned_load()

Definition at line 648 of file h264_altivec.c.

Referenced by h264_h_loop_filter_luma_altivec().

#define transpose4x16 ( r0,
r1,
r2,
r3   ) 

Value:

{      \
    register vec_u8_t r4;                    \
    register vec_u8_t r5;                    \
    register vec_u8_t r6;                    \
    register vec_u8_t r7;                    \
                                             \
    r4 = vec_mergeh(r0, r2);  /*0, 2 set 0*/ \
    r5 = vec_mergel(r0, r2);  /*0, 2 set 1*/ \
    r6 = vec_mergeh(r1, r3);  /*1, 3 set 0*/ \
    r7 = vec_mergel(r1, r3);  /*1, 3 set 1*/ \
                                             \
    r0 = vec_mergeh(r4, r6);  /*all set 0*/  \
    r1 = vec_mergel(r4, r6);  /*all set 1*/  \
    r2 = vec_mergeh(r5, r7);  /*all set 2*/  \
    r3 = vec_mergel(r5, r7);  /*all set 3*/  \
}

Definition at line 598 of file h264_altivec.c.

Referenced by h264_h_loop_filter_luma_altivec().

#define VEC_1D_DCT ( vb0,
vb1,
vb2,
vb3,
va0,
va1,
va2,
va3   ) 

Value:

/* 1st stage */                                               \
    vz0 = vec_add(vb0,vb2);       /* temp[0] = Y[0] + Y[2] */     \
    vz1 = vec_sub(vb0,vb2);       /* temp[1] = Y[0] - Y[2] */     \
    vz2 = vec_sra(vb1,vec_splat_u16(1));                          \
    vz2 = vec_sub(vz2,vb3);       /* temp[2] = Y[1].1/2 - Y[3] */ \
    vz3 = vec_sra(vb3,vec_splat_u16(1));                          \
    vz3 = vec_add(vb1,vz3);       /* temp[3] = Y[1] + Y[3].1/2 */ \
    /* 2nd stage: output */                                       \
    va0 = vec_add(vz0,vz3);       /* x[0] = temp[0] + temp[3] */  \
    va1 = vec_add(vz1,vz2);       /* x[1] = temp[1] + temp[2] */  \
    va2 = vec_sub(vz1,vz2);       /* x[2] = temp[1] - temp[2] */  \
    va3 = vec_sub(vz0,vz3)

Definition at line 403 of file h264_altivec.c.

Referenced by ff_h264_idct_add_altivec().

#define VEC_LOAD_U8_ADD_S16_STORE_U8 ( va   ) 

Value:

vdst_orig = vec_ld(0, dst);                               \
    vdst = vec_perm(vdst_orig, zero_u8v, vdst_mask);          \
    vdst_ss = (vec_s16_t) vec_mergeh(zero_u8v, vdst);         \
    va = vec_add(va, vdst_ss);                                \
    va_u8 = vec_packsu(va, zero_s16v);                        \
    va_u32 = vec_splat((vec_u32_t)va_u8, 0);                  \
    vec_ste(va_u32, element, (uint32_t*)dst);

Definition at line 431 of file h264_altivec.c.

Referenced by ff_h264_idct_add_altivec().

#define VEC_TRANSPOSE_4 ( a0,
a1,
a2,
a3,
b0,
b1,
b2,
b3   ) 

Value:

b0 = vec_mergeh( a0, a0 ); \
    b1 = vec_mergeh( a1, a0 ); \
    b2 = vec_mergeh( a2, a0 ); \
    b3 = vec_mergeh( a3, a0 ); \
    a0 = vec_mergeh( b0, b2 ); \
    a1 = vec_mergel( b0, b2 ); \
    a2 = vec_mergeh( b1, b3 ); \
    a3 = vec_mergel( b1, b3 ); \
    b0 = vec_mergeh( a0, a2 ); \
    b1 = vec_mergel( a0, a2 ); \
    b2 = vec_mergeh( a1, a3 ); \
    b3 = vec_mergel( a1, a3 )

Definition at line 417 of file h264_altivec.c.

Referenced by ff_h264_idct_add_altivec().


Function Documentation

static void avg_pixels16_l2_altivec ( uint8_t dst,
const uint8_t src1,
const uint8_t src2,
int  dst_stride,
int  src_stride1,
int  h 
) [inline, static]

Definition at line 348 of file h264_altivec.c.

static vec_u8_t diff_lt_altivec ( register vec_u8_t  x,
register vec_u8_t  y,
register vec_u8_t  a 
) [inline, static]

Definition at line 708 of file h264_altivec.c.

Referenced by h264_deblock_mask().

void dsputil_h264_init_ppc ( DSPContext c,
AVCodecContext avctx 
)

Definition at line 871 of file h264_altivec.c.

Referenced by dsputil_init_ppc().

void ff_h264_idct8_add_altivec ( uint8_t dst,
DCTELEM dct,
int  stride 
)

Definition at line 554 of file h264_altivec.c.

Referenced by dsputil_h264_init_ppc().

static void ff_h264_idct_add_altivec ( uint8_t dst,
DCTELEM block,
int  stride 
) [static]

Definition at line 440 of file h264_altivec.c.

Referenced by dsputil_h264_init_ppc().

static vec_u8_t h264_deblock_mask ( register vec_u8_t  p0,
register vec_u8_t  p1,
register vec_u8_t  q0,
register vec_u8_t  q1,
register vec_u8_t  alpha,
register vec_u8_t  beta 
) [inline, static]

Definition at line 719 of file h264_altivec.c.

static vec_u8_t h264_deblock_q1 ( register vec_u8_t  p0,
register vec_u8_t  p1,
register vec_u8_t  p2,
register vec_u8_t  q0,
register vec_u8_t  tc0 
) [inline, static]

Definition at line 739 of file h264_altivec.c.

static void h264_h_loop_filter_luma_altivec ( uint8_t pix,
int  stride,
int  alpha,
int  beta,
int8_t *  tc0 
) [static]

Definition at line 860 of file h264_altivec.c.

Referenced by dsputil_h264_init_ppc().

static void h264_v_loop_filter_luma_altivec ( uint8_t pix,
int  stride,
int  alpha,
int  beta,
int8_t *  tc0 
) [static]

Definition at line 843 of file h264_altivec.c.

Referenced by dsputil_h264_init_ppc().

void put_no_rnd_h264_chroma_mc8_altivec ( uint8_t dst,
uint8_t src,
int  stride,
int  h,
int  x,
int  y 
)

Definition at line 184 of file h264_altivec.c.

Referenced by dsputil_h264_init_ppc().

static void put_pixels16_l2_altivec ( uint8_t dst,
const uint8_t src1,
const uint8_t src2,
int  dst_stride,
int  src_stride1,
int  h 
) [inline, static]

Definition at line 306 of file h264_altivec.c.

static void write16x4 ( uint8_t dst,
int  dst_stride,
register vec_u8_t  r0,
register vec_u8_t  r1,
register vec_u8_t  r2,
register vec_u8_t  r3 
) [inline, static]

Definition at line 615 of file h264_altivec.c.

Referenced by h264_h_loop_filter_luma_altivec().


Generated on Thu Apr 2 07:15:42 2009 for ffmpeg by  doxygen 1.5.6