libswscale/yuv2rgb_altivec.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <assert.h>
#include "config.h"
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"

Go to the source code of this file.

Defines

#define vec_merge3(x2, x1, x0, y0, y1, y2)
#define vec_mstbgr24(x0, x1, x2, ptr)
#define vec_mstrgb24(x0, x1, x2, ptr)
#define vec_mstrgb32(T, x0, x1, x2, x3, ptr)
#define vec_unh(x)
#define vec_unl(x)
#define vec_clip_s16(x)
#define vec_packclp(x, y)
#define DEFCSP420_CVT(name, out_pixels)
#define out_abgr(a, b, c, ptr)   vec_mstrgb32(typeof(a),((typeof (a))AVV(0)),c,b,a,ptr)
#define out_bgra(a, b, c, ptr)   vec_mstrgb32(typeof(a),c,b,a,((typeof (a))AVV(0)),ptr)
#define out_rgba(a, b, c, ptr)   vec_mstrgb32(typeof(a),a,b,c,((typeof (a))AVV(0)),ptr)
#define out_argb(a, b, c, ptr)   vec_mstrgb32(typeof(a),((typeof (a))AVV(0)),a,b,c,ptr)
#define out_rgb24(a, b, c, ptr)   vec_mstrgb24(a,b,c,ptr)
#define out_bgr24(a, b, c, ptr)   vec_mstbgr24(a,b,c,ptr)

Typedefs

typedef unsigned char ubyte
typedef signed char sbyte

Functions

static void cvtyuvtoRGB (SwsContext *c, vector signed short Y, vector signed short U, vector signed short V, vector signed short *R, vector signed short *G, vector signed short *B)
static int altivec_uyvy_rgb32 (SwsContext *c, unsigned char **in, int *instrides, int srcSliceY, int srcSliceH, unsigned char **oplanes, int *outstrides)
SwsFunc yuv2rgb_init_altivec (SwsContext *c)
static uint16_t roundToInt16 (int64_t f)
void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4], int brightness, int contrast, int saturation)
void altivec_yuv2packedX (SwsContext *c, int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize, int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, int dstW, int dstY)

Variables

static const vector unsigned char perm_rgb_0
static const vector unsigned char perm_rgb_1
static const vector unsigned char perm_rgb_2
static const vector unsigned char perm_rgb_3
static const vector unsigned char demux_u
static const vector unsigned char demux_v
static const vector unsigned char demux_y


Define Documentation

#define DEFCSP420_CVT ( name,
out_pixels   ) 

Definition at line 274 of file yuv2rgb_altivec.c.

#define out_abgr ( a,
b,
c,
ptr   )     vec_mstrgb32(typeof(a),((typeof (a))AVV(0)),c,b,a,ptr)

Definition at line 439 of file yuv2rgb_altivec.c.

Referenced by altivec_yuv2packedX().

#define out_argb ( a,
b,
c,
ptr   )     vec_mstrgb32(typeof(a),((typeof (a))AVV(0)),a,b,c,ptr)

Definition at line 442 of file yuv2rgb_altivec.c.

Referenced by altivec_yuv2packedX().

#define out_bgr24 ( a,
b,
c,
ptr   )     vec_mstbgr24(a,b,c,ptr)

Definition at line 444 of file yuv2rgb_altivec.c.

Referenced by altivec_yuv2packedX().

#define out_bgra ( a,
b,
c,
ptr   )     vec_mstrgb32(typeof(a),c,b,a,((typeof (a))AVV(0)),ptr)

Definition at line 440 of file yuv2rgb_altivec.c.

Referenced by altivec_yuv2packedX().

#define out_rgb24 ( a,
b,
c,
ptr   )     vec_mstrgb24(a,b,c,ptr)

Definition at line 443 of file yuv2rgb_altivec.c.

Referenced by altivec_yuv2packedX().

#define out_rgba ( a,
b,
c,
ptr   )     vec_mstrgb32(typeof(a),a,b,c,((typeof (a))AVV(0)),ptr)

Definition at line 441 of file yuv2rgb_altivec.c.

Referenced by altivec_uyvy_rgb32(), and altivec_yuv2packedX().

#define vec_clip_s16 (  ) 

Value:

vec_max (vec_min (x, (vector signed short)AVV(235,235,235,235,235,235,235,235)),\
                         (vector signed short)AVV( 16, 16, 16, 16, 16, 16, 16, 16))

Definition at line 229 of file yuv2rgb_altivec.c.

Referenced by altivec_yuv2packedX().

#define vec_merge3 ( x2,
x1,
x0,
y0,
y1,
y2   ) 

Value:

do {                                        \
    typeof(x0) o0,o2,o3;                    \
        o0 = vec_mergeh (x0,x1);            \
        y0 = vec_perm (o0, x2, perm_rgb_0); \
        o2 = vec_perm (o0, x2, perm_rgb_1); \
        o3 = vec_mergel (x0,x1);            \
        y1 = vec_perm (o3,o2,perm_rgb_2);   \
        y2 = vec_perm (o3,o2,perm_rgb_3);   \
} while(0)

Definition at line 150 of file yuv2rgb_altivec.c.

#define vec_mstbgr24 ( x0,
x1,
x2,
ptr   ) 

Value:

do {                                    \
    typeof(x0) _0,_1,_2;                \
    vec_merge3 (x0,x1,x2,_0,_1,_2);     \
    vec_st (_0, 0, ptr++);              \
    vec_st (_1, 0, ptr++);              \
    vec_st (_2, 0, ptr++);              \
}  while (0);

Definition at line 161 of file yuv2rgb_altivec.c.

#define vec_mstrgb24 ( x0,
x1,
x2,
ptr   ) 

Value:

do {                                    \
    typeof(x0) _0,_1,_2;                \
    vec_merge3 (x2,x1,x0,_0,_1,_2);     \
    vec_st (_0, 0, ptr++);              \
    vec_st (_1, 0, ptr++);              \
    vec_st (_2, 0, ptr++);              \
}  while (0);

Definition at line 170 of file yuv2rgb_altivec.c.

#define vec_mstrgb32 ( T,
x0,
x1,
x2,
x3,
ptr   ) 

Value:

do {                                                                          \
    T _0,_1,_2,_3;                                                            \
    _0 = vec_mergeh (x0,x1);                                                  \
    _1 = vec_mergeh (x2,x3);                                                  \
    _2 = (T)vec_mergeh ((vector unsigned short)_0,(vector unsigned short)_1); \
    _3 = (T)vec_mergel ((vector unsigned short)_0,(vector unsigned short)_1); \
    vec_st (_2, 0*16, (T *)ptr);                                              \
    vec_st (_3, 1*16, (T *)ptr);                                              \
    _0 = vec_mergel (x0,x1);                                                  \
    _1 = vec_mergel (x2,x3);                                                  \
    _2 = (T)vec_mergeh ((vector unsigned short)_0,(vector unsigned short)_1); \
    _3 = (T)vec_mergel ((vector unsigned short)_0,(vector unsigned short)_1); \
    vec_st (_2, 2*16, (T *)ptr);                                              \
    vec_st (_3, 3*16, (T *)ptr);                                              \
    ptr += 4;                                                                 \
}  while (0);

Definition at line 183 of file yuv2rgb_altivec.c.

#define vec_packclp ( x,
 ) 

Value:

(vector unsigned char)vec_packs \
        ((vector unsigned short)vec_max (x,(vector signed short) AVV(0)), \
         (vector unsigned short)vec_max (y,(vector signed short) AVV(0)))

Definition at line 233 of file yuv2rgb_altivec.c.

Referenced by altivec_uyvy_rgb32(), and altivec_yuv2packedX().

#define vec_unh (  ) 

Value:

(vector signed short) \
        vec_perm(x,(typeof(x))AVV(0),\
                 (vector unsigned char)AVV(0x10,0x00,0x10,0x01,0x10,0x02,0x10,0x03,\
                                           0x10,0x04,0x10,0x05,0x10,0x06,0x10,0x07))

Definition at line 218 of file yuv2rgb_altivec.c.

#define vec_unl (  ) 

Value:

(vector signed short) \
        vec_perm(x,(typeof(x))AVV(0),\
                 (vector unsigned char)AVV(0x10,0x08,0x10,0x09,0x10,0x0A,0x10,0x0B,\
                                           0x10,0x0C,0x10,0x0D,0x10,0x0E,0x10,0x0F))

Definition at line 223 of file yuv2rgb_altivec.c.


Typedef Documentation

typedef signed char sbyte

Definition at line 100 of file yuv2rgb_altivec.c.

typedef unsigned char ubyte

Definition at line 99 of file yuv2rgb_altivec.c.


Function Documentation

static int altivec_uyvy_rgb32 ( SwsContext c,
unsigned char **  in,
int *  instrides,
int  srcSliceY,
int  srcSliceH,
unsigned char **  oplanes,
int *  outstrides 
) [static]

Definition at line 626 of file yuv2rgb_altivec.c.

Referenced by yuv2rgb_init_altivec().

void altivec_yuv2packedX ( SwsContext c,
int16_t *  lumFilter,
int16_t **  lumSrc,
int  lumFilterSize,
int16_t *  chrFilter,
int16_t **  chrSrc,
int  chrFilterSize,
uint8_t dest,
int  dstW,
int  dstY 
)

Definition at line 794 of file yuv2rgb_altivec.c.

Referenced by yuv2packedX_TMPL().

static void cvtyuvtoRGB ( SwsContext c,
vector signed short  Y,
vector signed short  U,
vector signed short  V,
vector signed short *  R,
vector signed short *  G,
vector signed short *  B 
) [inline, static]

Definition at line 241 of file yuv2rgb_altivec.c.

Referenced by altivec_uyvy_rgb32(), and altivec_yuv2packedX().

static uint16_t roundToInt16 ( int64_t  f  )  [static]

Definition at line 751 of file yuv2rgb_altivec.c.

void yuv2rgb_altivec_init_tables ( SwsContext c,
const int  inv_table[4],
int  brightness,
int  contrast,
int  saturation 
)

Definition at line 758 of file yuv2rgb_altivec.c.

SwsFunc yuv2rgb_init_altivec ( SwsContext c  ) 

Definition at line 691 of file yuv2rgb_altivec.c.

Referenced by yuv2rgb_get_func_ptr().


Variable Documentation

const vector unsigned char demux_u [static]

Initial value:

 (const vector unsigned char)AVV(0x10,0x00,0x10,0x00,
                                              0x10,0x04,0x10,0x04,
                                              0x10,0x08,0x10,0x08,
                                              0x10,0x0c,0x10,0x0c)

Definition at line 610 of file yuv2rgb_altivec.c.

Referenced by altivec_uyvy_rgb32().

const vector unsigned char demux_v [static]

Initial value:

 (const vector unsigned char)AVV(0x10,0x02,0x10,0x02,
                                              0x10,0x06,0x10,0x06,
                                              0x10,0x0A,0x10,0x0A,
                                              0x10,0x0E,0x10,0x0E)

Definition at line 614 of file yuv2rgb_altivec.c.

Referenced by altivec_uyvy_rgb32().

const vector unsigned char demux_y [static]

Initial value:

 (const vector unsigned char)AVV(0x10,0x01,0x10,0x03,
                                              0x10,0x05,0x10,0x07,
                                              0x10,0x09,0x10,0x0B,
                                              0x10,0x0D,0x10,0x0F)

Definition at line 618 of file yuv2rgb_altivec.c.

Referenced by altivec_uyvy_rgb32().

const vector unsigned char perm_rgb_0 [static]

Initial value:

 (const vector unsigned char)AVV(0x00,0x01,0x10,0x02,0x03,0x11,0x04,0x05,
                                               0x12,0x06,0x07,0x13,0x08,0x09,0x14,0x0a)

Definition at line 141 of file yuv2rgb_altivec.c.

const vector unsigned char perm_rgb_1 [static]

Initial value:

 (const vector unsigned char)AVV(0x0b,0x15,0x0c,0x0d,0x16,0x0e,0x0f,0x17,
                                               0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f)

Definition at line 143 of file yuv2rgb_altivec.c.

const vector unsigned char perm_rgb_2 [static]

Initial value:

 (const vector unsigned char)AVV(0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
                                               0x00,0x01,0x18,0x02,0x03,0x19,0x04,0x05)

Definition at line 145 of file yuv2rgb_altivec.c.

const vector unsigned char perm_rgb_3 [static]

Initial value:

 (const vector unsigned char)AVV(0x1a,0x06,0x07,0x1b,0x08,0x09,0x1c,0x0a,
                                               0x0b,0x1d,0x0c,0x0d,0x1e,0x0e,0x0f,0x1f)

Definition at line 147 of file yuv2rgb_altivec.c.


Generated on Wed Feb 9 19:10:13 2011 for ffmpeg by  doxygen 1.5.6