FFmpeg
Loading...
Searching...
No Matches
vp8dsp_altivec.c File Reference
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/mem_internal.h"
#include "libavutil/ppc/util_altivec.h"
#include "libavcodec/vp8dsp.h"
#include "hpeldsp_altivec.h"
#include "vp8dsp_altivec.h"

Go to the source code of this file.

Macros

#define REPT4(...)
 
#define LOAD_H_SUBPEL_FILTER(i)
 
#define GET_PIXHL(offset)
 
#define GET_OUTER(offset)
 
#define FILTER_H(dstv, off)
 
#define LOAD_V_SUBPEL_FILTER(i)
 
#define FILTER_V(dstv, vec_mul)
 
#define LOAD_HL(off, s, perm)
 
#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, const 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, const 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 dstride, const uint8_t *src, ptrdiff_t sstride, int h, int mx, int my)
 
av_cold void ff_vp78dsp_init_altivec (VP8DSPContext *c)
 

Variables

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

Macro Definition Documentation

◆ REPT4

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

Definition at line 34 of file vp8dsp_altivec.c.

◆ LOAD_H_SUBPEL_FILTER

#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)
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define vec_s8
static const vec_s8 h_subpel_filters_inner[7]
static const vec_s8 h_subpel_filters_outer[4]

Definition at line 59 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_h_altivec_core().

◆ GET_PIXHL

#define GET_PIXHL ( offset)
Value:
a = vec_vsx_ld((offset)-is6tap-1, src); \
pixh = vec_perm(a, a, perm_inner); \
pixl = vec_perm(a, a, vec_add(perm_inner, vec_splat_u8(4)))
int a
unsigned offset
Definition libaomenc.c:763
#define src
Definition vp8dsp.c:248

Definition at line 73 of file vp8dsp_altivec.c.

◆ GET_OUTER

#define GET_OUTER ( offset)
Value:
outer = vec_perm(a, a, perm_outer)

Definition at line 78 of file vp8dsp_altivec.c.

◆ FILTER_H

#define FILTER_H ( dstv,
off )
Value:
GET_PIXHL(off); \
filth = vec_msum(filter_inner, pixh, c64); \
filtl = vec_msum(filter_inner, pixl, c64); \
\
if (is6tap) { \
GET_OUTER(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)
uint8_t w
Definition llvidencdsp.c:39
#define GET_PIXHL(offset)

Definition at line 81 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_h_altivec_core().

◆ LOAD_V_SUBPEL_FILTER

#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)
#define vec_u8
static const vec_u8 v_subpel_filters[7]

Definition at line 161 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_v_altivec_core().

◆ FILTER_V

#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)
#define vec_s16

Definition at line 170 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_v_altivec_core().

◆ LOAD_HL

#define LOAD_HL ( off,
s,
perm )
Value:
vec_mergeh(vec_vsx_ld(off,s), vec_vsx_ld(off+8,s))
#define s(width, name)
Definition cbs_vp9.c:198

Definition at line 190 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_v_altivec_core().

◆ EPEL_FUNCS

#define EPEL_FUNCS ( WIDTH,
TAPS )
Value:
static av_noinline \
void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, const 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, const 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); \
}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
Definition dsp.h:67
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
Definition dsp.h:67
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:97
#define WIDTH
Definition c93.c:45

Definition at line 259 of file vp8dsp_altivec.c.

◆ EPEL_HV

#define EPEL_HV ( WIDTH,
HTAPS,
VTAPS )
Value:
static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t dstride, const uint8_t *src, ptrdiff_t sstride, 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*sstride, sstride, h+5, mx, my); \
put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, dstride, tmp+2*16, 16, h, mx, my); \
} else { \
put_vp8_epel ## WIDTH ## _h ## HTAPS ## _altivec(tmp, 16, src-sstride, sstride, h+4, mx, my); \
put_vp8_epel ## WIDTH ## _v ## VTAPS ## _altivec(dst, dstride, tmp+16, 16, h, mx, my); \
} \
}
static uint8_t tmp[40]
Definition aes_ctr.c:52

Definition at line 272 of file vp8dsp_altivec.c.

Function Documentation

◆ put_vp8_epel_h_altivec_core()

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

Definition at line 97 of file vp8dsp_altivec.c.

◆ put_vp8_epel_v_altivec_core()

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

Definition at line 194 of file vp8dsp_altivec.c.

◆ put_vp8_pixels16_altivec()

static void put_vp8_pixels16_altivec ( uint8_t * dst,
ptrdiff_t dstride,
const uint8_t * src,
ptrdiff_t sstride,
int h,
int mx,
int my )
static

Definition at line 301 of file vp8dsp_altivec.c.

Referenced by ff_vp78dsp_init_altivec(), and put_vp8_pixels16_altivec().

◆ ff_vp78dsp_init_altivec()

av_cold void ff_vp78dsp_init_altivec ( VP8DSPContext * c)

Definition at line 327 of file vp8dsp_altivec.c.

Referenced by ff_vp78dsp_init_ppc().

Variable Documentation

◆ h_subpel_filters_inner

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),
}
#define REPT4(...)

Definition at line 37 of file vp8dsp_altivec.c.

◆ h_subpel_filters_outer

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

Definition at line 51 of file vp8dsp_altivec.c.

◆ v_subpel_filters

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 150 of file vp8dsp_altivec.c.