FFmpeg
Loading...
Searching...
No Matches
bayer_template.c File Reference

Go to the source code of this file.

Macros

#define S(y, x)
 
#define T(y, x)
 
#define R(y, x)
 
#define G(y, x)
 
#define B(y, x)
 
#define BAYER_TO_RGB24_COPY
 
#define BAYER_TO_RGB24_INTERPOLATE
 
#define BAYER_TO_RGB48_COPY
 
#define BAYER_TO_RGB48_INTERPOLATE
 
#define rgb24toyv12_2x2(src, dstY, dstU, dstV, luma_stride, src_stride, rgb2yuv)
 invoke ff_rgb24toyv12 for 2x2 pixels
 

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 rgb48_copy (const uint8_t *src, int src_stride, uint8_t *ddst, int dst_stride, int width)
 
static void BAYER_RENAME rgb48_interpolate (const uint8_t *src, int src_stride, uint8_t *ddst, 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, const 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, const int32_t *rgb2yuv)
 

Macro Definition Documentation

◆ S

#define S ( y,
x )
Value:
BAYER_READ(src[(y)*src_stride + BAYER_SIZEOF*(x)])
#define src
Definition vp8dsp.c:248

Definition at line 49 of file bayer_template.c.

◆ T

#define T ( y,
x )
Value:
(unsigned int)S(y, x)
#define S(s, c, i)

Definition at line 50 of file bayer_template.c.

◆ R

#define R ( y,
x )
Value:
dst[(y)*dst_stride + (x)*3 + BAYER_R]
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87

Definition at line 51 of file bayer_template.c.

◆ G

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

Definition at line 52 of file bayer_template.c.

◆ B

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

Definition at line 53 of file bayer_template.c.

◆ BAYER_TO_RGB24_COPY

#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 T(x)
Definition vpx_arith.h:29
#define R
Definition huffyuv.h:44

Definition at line 88 of file bayer_template.c.

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

◆ BAYER_TO_RGB24_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);

Definition at line 103 of file bayer_template.c.

Referenced by rgb24_interpolate(), and yv12_interpolate().

◆ BAYER_TO_RGB48_COPY

#define BAYER_TO_RGB48_COPY
Value:
R(0, 0) = \
R(0, 1) = \
R(1, 1) = \
R(1, 0) = S(1, 0); \
\
G(0, 0) = S(0, 0); \
G(1, 1) = S(1, 1); \
G(0, 1) = \
G(1, 0) = (T(0, 0) + T(1, 1)) >> 1; \
\
B(1, 1) = \
B(0, 0) = \
B(0, 1) = \
B(1, 0) = S(0, 1);

Definition at line 154 of file bayer_template.c.

Referenced by rgb48_copy(), and rgb48_interpolate().

◆ BAYER_TO_RGB48_INTERPOLATE

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

Definition at line 169 of file bayer_template.c.

Referenced by rgb48_interpolate().

◆ rgb24toyv12_2x2

#define rgb24toyv12_2x2 ( src,
dstY,
dstU,
dstV,
luma_stride,
src_stride,
rgb2yuv )
Value:
ff_rgb24toyv12(src, dstY, dstV, dstU, 2, 2, luma_stride, 0, src_stride, rgb2yuv)
static void fn rgb2yuv(uint8_t *_yuv[3], const ptrdiff_t yuv_stride[3], int16_t *rgb[3], ptrdiff_t s, int w, int h, const int16_t rgb2yuv_coeffs[3][3][8], const int16_t yuv_offset[8])
void(* ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride, const int32_t *rgb2yuv)
Height should be a multiple of 2 and width should be a multiple of 2.
Definition rgb2rgb.c:81

invoke ff_rgb24toyv12 for 2x2 pixels

Definition at line 190 of file bayer_template.c.

Referenced by yv12_copy(), and yv12_interpolate().

Function Documentation

◆ rgb24_copy()

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 193 of file bayer_template.c.

Referenced by rgb24_copy().

◆ rgb24_interpolate()

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 203 of file bayer_template.c.

Referenced by rgb24_interpolate().

◆ rgb48_copy()

static void BAYER_RENAME rgb48_copy ( const uint8_t * src,
int src_stride,
uint8_t * ddst,
int dst_stride,
int width )
static

Definition at line 222 of file bayer_template.c.

Referenced by rgb48_copy().

◆ rgb48_interpolate()

static void BAYER_RENAME rgb48_interpolate ( const uint8_t * src,
int src_stride,
uint8_t * ddst,
int dst_stride,
int width )
static

Definition at line 235 of file bayer_template.c.

Referenced by rgb48_interpolate().

◆ yv12_copy()

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,
const int32_t * rgb2yuv )
static

Definition at line 256 of file bayer_template.c.

Referenced by yv12_copy().

◆ yv12_interpolate()

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,
const int32_t * rgb2yuv )
static

Definition at line 271 of file bayer_template.c.

Referenced by yv12_interpolate().