FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
vp8dsp_altivec.c File Reference
#include "libavutil/cpu.h"
#include "libavutil/mem.h"
#include "libavutil/ppc/types_altivec.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vp8dsp.h"
#include "dsputil_altivec.h"

Go to the source code of this file.

Macros

#define REPT4(...)   { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ }
 
#define LOAD_H_SUBPEL_FILTER(i)
 
#define FILTER_H(dstv, off)
 
#define LOAD_V_SUBPEL_FILTER(i)
 
#define FILTER_V(dstv, vec_mul)
 
#define EPEL_FUNCS(WIDTH, TAPS)
 
#define EPEL_HV(WIDTH, HTAPS, VTAPS)
 

Functions

static av_always_inline void put_vp8_epel_h_altivec_core (uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int w, int is6tap)
 
static av_always_inline void put_vp8_epel_v_altivec_core (uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int my, int w, int is6tap)
 
static void put_vp8_pixels16_altivec (uint8_t *dst, ptrdiff_t stride, uint8_t *src, ptrdiff_t s, int h, int mx, int my)
 
av_cold void ff_vp8dsp_init_altivec (VP8DSPContext *c)
 

Variables

static const vec_s8 h_subpel_filters_inner [7]
 
static const vec_s8 h_subpel_filters_outer [3]
 
static const vec_u8 v_subpel_filters [7]
 

Macro Definition Documentation

#define REPT4 (   ...)    { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ }

Definition at line 30 of file vp8dsp_altivec.c.

#define LOAD_H_SUBPEL_FILTER (   i)
Value:
vec_s8 filter_inner = h_subpel_filters_inner[i]; \
vec_s8 filter_outerh = h_subpel_filters_outer[(i)>>1]; \
vec_s8 filter_outerl = vec_sld(filter_outerh, filter_outerh, 2)

Definition at line 54 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_h_altivec_core().

#define FILTER_H (   dstv,
  off 
)
Value:
a = vec_ld((off)-is6tap-1, src); \
b = vec_ld((off)-is6tap-1+15, src); \
\
pixh = vec_perm(a, b, permh##off); \
pixl = vec_perm(a, b, perml##off); \
filth = vec_msum(filter_inner, pixh, c64); \
filtl = vec_msum(filter_inner, pixl, c64); \
if (is6tap) { \
outer = vec_perm(a, b, perm_6tap##off); \
filth = vec_msum(filter_outerh, outer, filth); \
filtl = vec_msum(filter_outerl, outer, filtl); \
} \
if (w == 4) \
filtl = filth; /* discard pixels 4-7 */ \
dstv = vec_packs(filth, filtl); \
dstv = vec_sra(dstv, c7)

Definition at line 59 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_h_altivec_core().

#define LOAD_V_SUBPEL_FILTER (   i)
Value:
vec_u8 subpel_filter = v_subpel_filters[i]; \
vec_u8 f0 = vec_splat(subpel_filter, 0); \
vec_u8 f1 = vec_splat(subpel_filter, 1); \
vec_u8 f2 = vec_splat(subpel_filter, 2); \
vec_u8 f3 = vec_splat(subpel_filter, 3); \
vec_u8 f4 = vec_splat(subpel_filter, 4); \
vec_u8 f5 = vec_splat(subpel_filter, 5)

Definition at line 138 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_v_altivec_core().

#define FILTER_V (   dstv,
  vec_mul 
)
Value:
s1f = (vec_s16)vec_mul(s1, f1); \
s2f = (vec_s16)vec_mul(s2, f2); \
s3f = (vec_s16)vec_mul(s3, f3); \
s4f = (vec_s16)vec_mul(s4, f4); \
s2f = vec_subs(s2f, s1f); \
s3f = vec_subs(s3f, s4f); \
if (is6tap) { \
s0f = (vec_s16)vec_mul(s0, f0); \
s5f = (vec_s16)vec_mul(s5, f5); \
s2f = vec_adds(s2f, s0f); \
s3f = vec_adds(s3f, s5f); \
} \
dstv = vec_adds(s2f, s3f); \
dstv = vec_adds(dstv, c64); \
dstv = vec_sra(dstv, c7)

Definition at line 147 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_v_altivec_core().

#define EPEL_FUNCS (   WIDTH,
  TAPS 
)
Value:
static av_noinline \
void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
{ \
put_vp8_epel_h_altivec_core(dst, dst_stride, src, src_stride, h, mx, WIDTH, TAPS == 6); \
} \
\
static av_noinline \
void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
{ \
put_vp8_epel_v_altivec_core(dst, dst_stride, src, src_stride, h, my, WIDTH, TAPS == 6); \
}

Definition at line 228 of file vp8dsp_altivec.c.

#define EPEL_HV (   WIDTH,
  HTAPS,
  VTAPS 
)
Value:
static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t stride, uint8_t *src, ptrdiff_t s, int h, int mx, int my) \
{ \
DECLARE_ALIGNED(16, uint8_t, tmp)[(2*WIDTH+5)*16]; \
if (VTAPS == 6) { \
put_vp8_epel ## WIDTH ## _h ## HTAPS ## _altivec(tmp, 16, src-2*stride, stride, h+5, mx, my); \
put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, stride, tmp+2*16, 16, h, mx, my); \
} else { \
put_vp8_epel ## WIDTH ## _h ## HTAPS ## _altivec(tmp, 16, src-stride, stride, h+4, mx, my); \
put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, stride, tmp+16, 16, h, mx, my); \
} \
}

Definition at line 241 of file vp8dsp_altivec.c.

Function Documentation

static av_always_inline void put_vp8_epel_h_altivec_core ( uint8_t dst,
ptrdiff_t  dst_stride,
uint8_t src,
ptrdiff_t  src_stride,
int  h,
int  mx,
int  w,
int  is6tap 
)
static

Definition at line 79 of file vp8dsp_altivec.c.

static av_always_inline void put_vp8_epel_v_altivec_core ( uint8_t dst,
ptrdiff_t  dst_stride,
uint8_t src,
ptrdiff_t  src_stride,
int  h,
int  my,
int  w,
int  is6tap 
)
static

Definition at line 165 of file vp8dsp_altivec.c.

static void put_vp8_pixels16_altivec ( uint8_t dst,
ptrdiff_t  stride,
uint8_t src,
ptrdiff_t  s,
int  h,
int  mx,
int  my 
)
static

Definition at line 270 of file vp8dsp_altivec.c.

Referenced by ff_vp8dsp_init_altivec().

av_cold void ff_vp8dsp_init_altivec ( VP8DSPContext c)

Definition at line 275 of file vp8dsp_altivec.c.

Referenced by ff_vp8dsp_init().

Variable Documentation

const vec_s8 h_subpel_filters_inner[7]
static
Initial value:
=
{
REPT4( -6, 123, 12, -1),
REPT4(-11, 108, 36, -8),
REPT4( -9, 93, 50, -6),
REPT4(-16, 77, 77, -16),
REPT4( -6, 50, 93, -9),
REPT4( -8, 36, 108, -11),
REPT4( -1, 12, 123, -6),
}

Definition at line 33 of file vp8dsp_altivec.c.

const vec_s8 h_subpel_filters_outer[3]
static
Initial value:
=
{
REPT4(0, 0, 2, 1),
REPT4(0, 0, 3, 3),
REPT4(0, 0, 1, 2),
}

Definition at line 47 of file vp8dsp_altivec.c.

const vec_u8 v_subpel_filters[7]
static
Initial value:
=
{
{ 0, 6, 123, 12, 1, 0 },
{ 2, 11, 108, 36, 8, 1 },
{ 0, 9, 93, 50, 6, 0 },
{ 3, 16, 77, 77, 16, 3 },
{ 0, 6, 50, 93, 9, 0 },
{ 1, 8, 36, 108, 11, 2 },
{ 0, 1, 12, 123, 6, 0 },
}

Definition at line 127 of file vp8dsp_altivec.c.