FFmpeg
Macros | Functions
rgb2rgb_template.c File Reference
#include <stddef.h>
#include "libavutil/attributes.h"

Go to the source code of this file.

Macros

#define DEFINE_SHUFFLE_BYTES(name, a, b, c, d)
 

Functions

static void rgb24tobgr32_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32tobgr24_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb15to16_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb16to15_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32to16_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32tobgr16_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32to15_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32tobgr15_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24tobgr16_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24to16_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24tobgr15_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24to15_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb15tobgr24_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb16tobgr24_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb15to32_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb16to32_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void shuffle_bytes_2103_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void shuffle_bytes_0321_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24tobgr24_c (const uint8_t *src, uint8_t *dst, int src_size)
 
static void yuvPlanartoyuy2_c (const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride, int vertLumPerChroma)
 
static void yv12toyuy2_c (const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
 Height should be a multiple of 2 and width should be a multiple of 16. More...
 
static void yuvPlanartouyvy_c (const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride, int vertLumPerChroma)
 
static void yv12touyvy_c (const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
 Height should be a multiple of 2 and width should be a multiple of 16 (If this is a problem for anyone then tell me, and I will fix it.) More...
 
static void yuv422ptouyvy_c (const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
 Width should be a multiple of 16. More...
 
static void yuv422ptoyuy2_c (const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, int width, int height, int lumStride, int chromStride, int dstStride)
 Width should be a multiple of 16. More...
 
static void yuy2toyv12_c (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride)
 Height should be a multiple of 2 and width should be a multiple of 16. More...
 
static void planar2x_c (const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride)
 
static void uyvytoyv12_c (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride)
 Height should be a multiple of 2 and width should be a multiple of 16. More...
 
void ff_rgb24toyv12_c (const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, int width, int height, int lumStride, int chromStride, int srcStride, int32_t *rgb2yuv)
 Height should be a multiple of 2 and width should be a multiple of 2. More...
 
static void interleaveBytes_c (const uint8_t *src1, const uint8_t *src2, uint8_t *dest, int width, int height, int src1Stride, int src2Stride, int dstStride)
 
static void deinterleaveBytes_c (const uint8_t *src, uint8_t *dst1, uint8_t *dst2, int width, int height, int srcStride, int dst1Stride, int dst2Stride)
 
static void vu9_to_vu12_c (const uint8_t *src1, const uint8_t *src2, uint8_t *dst1, uint8_t *dst2, int width, int height, int srcStride1, int srcStride2, int dstStride1, int dstStride2)
 
static void yvu9_to_yuy2_c (const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, uint8_t *dst, int width, int height, int srcStride1, int srcStride2, int srcStride3, int dstStride)
 
static void extract_even_c (const uint8_t *src, uint8_t *dst, int count)
 
static void extract_even2_c (const uint8_t *src, uint8_t *dst0, uint8_t *dst1, int count)
 
static void extract_even2avg_c (const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, int count)
 
static void extract_odd2_c (const uint8_t *src, uint8_t *dst0, uint8_t *dst1, int count)
 
static void extract_odd2avg_c (const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, int count)
 
static void yuyvtoyuv420_c (uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
 
static void yuyvtoyuv422_c (uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
 
static void uyvytoyuv420_c (uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
 
static void uyvytoyuv422_c (uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, int width, int height, int lumStride, int chromStride, int srcStride)
 
static av_cold void rgb2rgb_init_c (void)
 

Macro Definition Documentation

◆ DEFINE_SHUFFLE_BYTES

#define DEFINE_SHUFFLE_BYTES (   name,
  a,
  b,
  c,
  d 
)
Value:
static void shuffle_bytes_##name (const uint8_t *src, \
uint8_t *dst, int src_size) \
{ \
int i; \
for (i = 0; i < src_size; i += 4) { \
dst[i + 0] = src[i + a]; \
dst[i + 1] = src[i + b]; \
dst[i + 2] = src[i + c]; \
dst[i + 3] = src[i + d]; \
} \
}

Definition at line 345 of file rgb2rgb_template.c.

Function Documentation

◆ rgb24tobgr32_c()

static void rgb24tobgr32_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 31 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb32tobgr24_c()

static void rgb32tobgr24_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 55 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb15to16_c()

static void rgb15to16_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 85 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb16to15_c()

static void rgb16to15_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 104 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb32to16_c()

static void rgb32to16_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 123 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb32tobgr16_c()

static void rgb32tobgr16_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 138 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb32to15_c()

static void rgb32to15_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 154 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb32tobgr15_c()

static void rgb32tobgr15_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 169 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb24tobgr16_c()

static void rgb24tobgr16_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 185 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb24to16_c()

static void rgb24to16_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 200 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb24tobgr15_c()

static void rgb24tobgr15_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 214 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb24to15_c()

static void rgb24to15_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 229 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb15tobgr24_c()

static void rgb15tobgr24_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 243 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb16tobgr24_c()

static void rgb16tobgr24_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 258 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb15to32_c()

static void rgb15to32_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 273 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb16to32_c()

static void rgb16to32_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 295 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ shuffle_bytes_2103_c()

static void shuffle_bytes_2103_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 317 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ shuffle_bytes_0321_c()

static void shuffle_bytes_0321_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 331 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb24tobgr24_c()

static void rgb24tobgr24_c ( const uint8_t *  src,
uint8_t *  dst,
int  src_size 
)
inlinestatic

Definition at line 363 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ yuvPlanartoyuy2_c()

static void yuvPlanartoyuy2_c ( const uint8_t *  ysrc,
const uint8_t *  usrc,
const uint8_t *  vsrc,
uint8_t *  dst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  dstStride,
int  vertLumPerChroma 
)
inlinestatic

Definition at line 375 of file rgb2rgb_template.c.

Referenced by yuv422ptoyuy2_c(), and yv12toyuy2_c().

◆ yv12toyuy2_c()

static void yv12toyuy2_c ( const uint8_t *  ysrc,
const uint8_t *  usrc,
const uint8_t *  vsrc,
uint8_t *  dst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  dstStride 
)
inlinestatic

Height should be a multiple of 2 and width should be a multiple of 16.

(If this is a problem for anyone then tell me, and I will fix it.)

Definition at line 429 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ yuvPlanartouyvy_c()

static void yuvPlanartouyvy_c ( const uint8_t *  ysrc,
const uint8_t *  usrc,
const uint8_t *  vsrc,
uint8_t *  dst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  dstStride,
int  vertLumPerChroma 
)
inlinestatic

Definition at line 439 of file rgb2rgb_template.c.

Referenced by yuv422ptouyvy_c(), and yv12touyvy_c().

◆ yv12touyvy_c()

static void yv12touyvy_c ( const uint8_t *  ysrc,
const uint8_t *  usrc,
const uint8_t *  vsrc,
uint8_t *  dst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  dstStride 
)
inlinestatic

Height should be a multiple of 2 and width should be a multiple of 16 (If this is a problem for anyone then tell me, and I will fix it.)

Definition at line 493 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ yuv422ptouyvy_c()

static void yuv422ptouyvy_c ( const uint8_t *  ysrc,
const uint8_t *  usrc,
const uint8_t *  vsrc,
uint8_t *  dst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  dstStride 
)
inlinestatic

Width should be a multiple of 16.

Definition at line 506 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ yuv422ptoyuy2_c()

static void yuv422ptoyuy2_c ( const uint8_t *  ysrc,
const uint8_t *  usrc,
const uint8_t *  vsrc,
uint8_t *  dst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  dstStride 
)
inlinestatic

Width should be a multiple of 16.

Definition at line 518 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ yuy2toyv12_c()

static void yuy2toyv12_c ( const uint8_t *  src,
uint8_t *  ydst,
uint8_t *  udst,
uint8_t *  vdst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  srcStride 
)
inlinestatic

Height should be a multiple of 2 and width should be a multiple of 16.

(If this is a problem for anyone then tell me, and I will fix it.)

Definition at line 531 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ planar2x_c()

static void planar2x_c ( const uint8_t *  src,
uint8_t *  dst,
int  srcWidth,
int  srcHeight,
int  srcStride,
int  dstStride 
)
inlinestatic

Definition at line 561 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ uyvytoyv12_c()

static void uyvytoyv12_c ( const uint8_t *  src,
uint8_t *  ydst,
uint8_t *  udst,
uint8_t *  vdst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  srcStride 
)
inlinestatic

Height should be a multiple of 2 and width should be a multiple of 16.

(If this is a problem for anyone then tell me, and I will fix it.) Chrominance data is only taken from every second line, others are ignored. FIXME: Write HQ version.

Definition at line 612 of file rgb2rgb_template.c.

◆ ff_rgb24toyv12_c()

void ff_rgb24toyv12_c ( const uint8_t *  src,
uint8_t *  ydst,
uint8_t *  udst,
uint8_t *  vdst,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  srcStride,
int32_t rgb2yuv 
)

Height should be a multiple of 2 and width should be a multiple of 2.

(If this is a problem for anyone then tell me, and I will fix it.) Chrominance data is only taken from every second line, others are ignored in the C version. FIXME: Write HQ version.

Definition at line 649 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ interleaveBytes_c()

static void interleaveBytes_c ( const uint8_t *  src1,
const uint8_t *  src2,
uint8_t *  dest,
int  width,
int  height,
int  src1Stride,
int  src2Stride,
int  dstStride 
)
static

Definition at line 710 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ deinterleaveBytes_c()

static void deinterleaveBytes_c ( const uint8_t *  src,
uint8_t *  dst1,
uint8_t *  dst2,
int  width,
int  height,
int  srcStride,
int  dst1Stride,
int  dst2Stride 
)
static

Definition at line 728 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ vu9_to_vu12_c()

static void vu9_to_vu12_c ( const uint8_t *  src1,
const uint8_t *  src2,
uint8_t *  dst1,
uint8_t *  dst2,
int  width,
int  height,
int  srcStride1,
int  srcStride2,
int  dstStride1,
int  dstStride2 
)
inlinestatic

Definition at line 746 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ yvu9_to_yuy2_c()

static void yvu9_to_yuy2_c ( const uint8_t *  src1,
const uint8_t *  src2,
const uint8_t *  src3,
uint8_t *  dst,
int  width,
int  height,
int  srcStride1,
int  srcStride2,
int  srcStride3,
int  dstStride 
)
inlinestatic

Definition at line 770 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ extract_even_c()

static void extract_even_c ( const uint8_t *  src,
uint8_t *  dst,
int  count 
)
static

Definition at line 799 of file rgb2rgb_template.c.

Referenced by uyvytoyuv420_c(), uyvytoyuv422_c(), yuyvtoyuv420_c(), and yuyvtoyuv422_c().

◆ extract_even2_c()

static void extract_even2_c ( const uint8_t *  src,
uint8_t *  dst0,
uint8_t *  dst1,
int  count 
)
static

Definition at line 810 of file rgb2rgb_template.c.

Referenced by uyvytoyuv422_c().

◆ extract_even2avg_c()

static void extract_even2avg_c ( const uint8_t *  src0,
const uint8_t *  src1,
uint8_t *  dst0,
uint8_t *  dst1,
int  count 
)
static

Definition at line 824 of file rgb2rgb_template.c.

Referenced by uyvytoyuv420_c().

◆ extract_odd2_c()

static void extract_odd2_c ( const uint8_t *  src,
uint8_t *  dst0,
uint8_t *  dst1,
int  count 
)
static

Definition at line 839 of file rgb2rgb_template.c.

Referenced by yuyvtoyuv422_c().

◆ extract_odd2avg_c()

static void extract_odd2avg_c ( const uint8_t *  src0,
const uint8_t *  src1,
uint8_t *  dst0,
uint8_t *  dst1,
int  count 
)
static

Definition at line 854 of file rgb2rgb_template.c.

Referenced by yuyvtoyuv420_c().

◆ yuyvtoyuv420_c()

static void yuyvtoyuv420_c ( uint8_t *  ydst,
uint8_t *  udst,
uint8_t *  vdst,
const uint8_t *  src,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  srcStride 
)
static

Definition at line 871 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ yuyvtoyuv422_c()

static void yuyvtoyuv422_c ( uint8_t *  ydst,
uint8_t *  udst,
uint8_t *  vdst,
const uint8_t *  src,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  srcStride 
)
static

Definition at line 891 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ uyvytoyuv420_c()

static void uyvytoyuv420_c ( uint8_t *  ydst,
uint8_t *  udst,
uint8_t *  vdst,
const uint8_t *  src,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  srcStride 
)
static

Definition at line 909 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ uyvytoyuv422_c()

static void uyvytoyuv422_c ( uint8_t *  ydst,
uint8_t *  udst,
uint8_t *  vdst,
const uint8_t *  src,
int  width,
int  height,
int  lumStride,
int  chromStride,
int  srcStride 
)
static

Definition at line 929 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init_c().

◆ rgb2rgb_init_c()

static av_cold void rgb2rgb_init_c ( void  )
static

Definition at line 947 of file rgb2rgb_template.c.

Referenced by ff_sws_rgb2rgb_init().

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
b
#define b
Definition: input.c:40
src
#define src
Definition: vp8dsp.c:255
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
for
for(j=16;j >0;--j)
Definition: h264pred_template.c:469
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:271
d
d
Definition: ffmpeg_filter.c:153