FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
bayer_template.c File Reference

Go to the source code of this file.

Macros

#define S(y, x)   BAYER_READ(src[(y)*src_stride + BAYER_SIZEOF*(x)])
 
#define T(y, x)   (unsigned int)S(y, x)
 
#define R(y, x)   dst[(y)*dst_stride + (x)*3 + BAYER_R]
 
#define G(y, x)   dst[(y)*dst_stride + (x)*3 + BAYER_G]
 
#define B(y, x)   dst[(y)*dst_stride + (x)*3 + BAYER_B]
 
#define BAYER_TO_RGB24_COPY
 
#define BAYER_TO_RGB24_INTERPOLATE
 
#define rgb24toyv12_2x2(src, dstY, dstU, dstV, luma_stride, src_stride, rgb2yuv)   ff_rgb24toyv12(src, dstY, dstV, dstU, 2, 2, luma_stride, 0, src_stride, rgb2yuv)
 invoke ff_rgb24toyv12 for 2x2 pixels More...
 

Functions

static void BAYER_RENAME() rgb24_copy (const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width)
 
static void BAYER_RENAME() rgb24_interpolate (const uint8_t *src, int src_stride, uint8_t *dst, int dst_stride, int width)
 
static void BAYER_RENAME() yv12_copy (const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv)
 
static void BAYER_RENAME() yv12_interpolate (const uint8_t *src, int src_stride, uint8_t *dstY, uint8_t *dstU, uint8_t *dstV, int luma_stride, int width, int32_t *rgb2yuv)
 

Macro Definition Documentation

#define S (   y,
 
)    BAYER_READ(src[(y)*src_stride + BAYER_SIZEOF*(x)])

Definition at line 49 of file bayer_template.c.

#define T (   y,
 
)    (unsigned int)S(y, x)

Definition at line 50 of file bayer_template.c.

#define R (   y,
 
)    dst[(y)*dst_stride + (x)*3 + BAYER_R]

Definition at line 51 of file bayer_template.c.

#define G (   y,
 
)    dst[(y)*dst_stride + (x)*3 + BAYER_G]

Definition at line 52 of file bayer_template.c.

#define B (   y,
 
)    dst[(y)*dst_stride + (x)*3 + BAYER_B]

Definition at line 53 of file bayer_template.c.

#define BAYER_TO_RGB24_COPY
Value:
R(0, 0) = \
R(0, 1) = \
R(1, 1) = \
R(1, 0) = S(1, 0) >> BAYER_SHIFT; \
G(0, 0) = S(0, 0) >> BAYER_SHIFT; \
G(1, 1) = S(1, 1) >> BAYER_SHIFT; \
G(0, 1) = \
G(1, 0) = (T(0, 0) + T(1, 1)) >> (1 + BAYER_SHIFT); \
B(1, 1) = \
B(0, 0) = \
B(0, 1) = \
B(1, 0) = S(0, 1) >> BAYER_SHIFT;
#define S(y, x)
#define T(y, x)
#define R(y, x)
#define B(y, x)
#define G(y, x)

Definition at line 88 of file bayer_template.c.

Referenced by rgb24_copy(), rgb24_interpolate(), yv12_copy(), and yv12_interpolate().

#define BAYER_TO_RGB24_INTERPOLATE
Value:
R(0, 0) = (T(-1, 0) + T(1, 0)) >> (1 + BAYER_SHIFT); \
G(0, 0) = S(0, 0) >> BAYER_SHIFT; \
B(0, 0) = (T(0, -1) + T(0, 1)) >> (1 + BAYER_SHIFT); \
R(0, 1) = (T(-1, 0) + T(-1, 2) + T(1, 0) + T(1, 2)) >> (2 + BAYER_SHIFT); \
G(0, 1) = (T(-1, 1) + T(0, 0) + T(0, 2) + T(1, 1)) >> (2 + BAYER_SHIFT); \
B(0, 1) = S(0, 1) >> BAYER_SHIFT; \
R(1, 0) = S(1, 0) >> BAYER_SHIFT; \
G(1, 0) = (T(0, 0) + T(1, -1) + T(1, 1) + T(2, 0)) >> (2 + BAYER_SHIFT); \
B(1, 0) = (T(0, -1) + T(0, 1) + T(2, -1) + T(2, 1)) >> (2 + BAYER_SHIFT); \
R(1, 1) = (T(1, 0) + T(1, 2)) >> (1 + BAYER_SHIFT); \
G(1, 1) = S(1, 1) >> BAYER_SHIFT; \
B(1, 1) = (T(0, 1) + T(2, 1)) >> (1 + BAYER_SHIFT);
#define S(y, x)
#define T(y, x)
#define R(y, x)
#define B(y, x)
#define G(y, x)

Definition at line 103 of file bayer_template.c.

Referenced by rgb24_interpolate(), and yv12_interpolate().

#define rgb24toyv12_2x2 (   src,
  dstY,
  dstU,
  dstV,
  luma_stride,
  src_stride,
  rgb2yuv 
)    ff_rgb24toyv12(src, dstY, dstV, dstU, 2, 2, luma_stride, 0, src_stride, rgb2yuv)

invoke ff_rgb24toyv12 for 2x2 pixels

Definition at line 124 of file bayer_template.c.

Referenced by yv12_copy(), and yv12_interpolate().

Function Documentation

static void BAYER_RENAME() rgb24_copy ( const uint8_t src,
int  src_stride,
uint8_t dst,
int  dst_stride,
int  width 
)
static

Definition at line 127 of file bayer_template.c.

static void BAYER_RENAME() rgb24_interpolate ( const uint8_t src,
int  src_stride,
uint8_t dst,
int  dst_stride,
int  width 
)
static

Definition at line 137 of file bayer_template.c.

static void BAYER_RENAME() yv12_copy ( const uint8_t src,
int  src_stride,
uint8_t dstY,
uint8_t dstU,
uint8_t dstV,
int  luma_stride,
int  width,
int32_t rgb2yuv 
)
static

Definition at line 156 of file bayer_template.c.

static void BAYER_RENAME() yv12_interpolate ( const uint8_t src,
int  src_stride,
uint8_t dstY,
uint8_t dstU,
uint8_t dstV,
int  luma_stride,
int  width,
int32_t rgb2yuv 
)
static

Definition at line 171 of file bayer_template.c.