libavcodec/ppc/vp8dsp_altivec.c File Reference

#include "libavutil/cpu.h"
#include "libavcodec/vp8dsp.h"
#include "dsputil_altivec.h"
#include "types_altivec.h"
#include "util_altivec.h"

Go to the source code of this file.

Defines

#define REPT4(...)   { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ }
 VP8 compatible video decoder.
#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, int dst_stride, uint8_t *src, int src_stride, int h, int mx, int w, int is6tap)
static av_always_inline void put_vp8_epel_v_altivec_core (uint8_t *dst, int dst_stride, uint8_t *src, int src_stride, int h, int my, int w, int is6tap)
static void put_vp8_pixels16_altivec (uint8_t *dst, int stride, uint8_t *src, int 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]


Define Documentation

#define EPEL_FUNCS ( WIDTH,
TAPS   ) 

Value:

static av_noinline \
void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, int dst_stride, uint8_t *src, int 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, int dst_stride, uint8_t *src, int 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 227 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, int stride, uint8_t *src, int 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 240 of file vp8dsp_altivec.c.

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

Referenced by put_vp8_epel_h_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 146 of file vp8dsp_altivec.c.

Referenced by put_vp8_epel_v_altivec_core().

#define LOAD_H_SUBPEL_FILTER (  ) 

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

Referenced by put_vp8_epel_h_altivec_core().

#define LOAD_V_SUBPEL_FILTER (  ) 

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

Referenced by put_vp8_epel_v_altivec_core().

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

VP8 compatible video decoder.

Copyright (C) 2010 David Conrad

This file is part of FFmpeg.

FFmpeg is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

FFmpeg is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with FFmpeg; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Definition at line 29 of file vp8dsp_altivec.c.


Function Documentation

av_cold void ff_vp8dsp_init_altivec ( VP8DSPContext c  ) 

Definition at line 274 of file vp8dsp_altivec.c.

Referenced by ff_vp8dsp_init().

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

Definition at line 78 of file vp8dsp_altivec.c.

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

Definition at line 164 of file vp8dsp_altivec.c.

static void put_vp8_pixels16_altivec ( uint8_t *  dst,
int  stride,
uint8_t *  src,
int  s,
int  h,
int  mx,
int  my 
) [static]

Definition at line 269 of file vp8dsp_altivec.c.

Referenced by ff_vp8dsp_init_altivec().


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 32 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 46 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 126 of file vp8dsp_altivec.c.


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