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

Go to the source code of this file.

Macros

#define PREFETCH   " # nop"
 
#define EMMS   "emms"
 
#define MOVNTQ   "movq"
 
#define SFENCE   " # nop"
 
#define STORE_BGR24_MMX
 
#define PACK_RGB32
 

Functions

static void RENAME() rgb24tobgr32 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb32tobgr24 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb15to16 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb16to15 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb32to16 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb32tobgr16 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb32to15 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb32tobgr15 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb24tobgr16 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb24to16 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb24tobgr15 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb24to15 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb15tobgr24 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb16tobgr24 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb15to32 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb16to32 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() shuffle_bytes_2103 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() rgb24tobgr24 (const uint8_t *src, uint8_t *dst, int src_size)
 
static void RENAME() yuvPlanartoyuy2 (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 RENAME() yv12toyuy2 (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 RENAME() yuvPlanartouyvy (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 RENAME() yv12touyvy (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 RENAME() yuv422ptouyvy (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 RENAME() yuv422ptoyuy2 (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 RENAME() yuy2toyv12 (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 RENAME() uyvytoyv12 (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 RENAME() interleaveBytes (const uint8_t *src1, const uint8_t *src2, uint8_t *dest, int width, int height, int src1Stride, int src2Stride, int dstStride)
 Height should be a multiple of 2 and width should be a multiple of 2. More...
 
static void RENAME() vu9_to_vu12 (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 RENAME() yvu9_to_yuy2 (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 RENAME() extract_even (const uint8_t *src, uint8_t *dst, x86_reg count)
 
static void RENAME() extract_odd (const uint8_t *src, uint8_t *dst, x86_reg count)
 
static void RENAME() extract_even2 (const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count)
 
static void RENAME() extract_even2avg (const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count)
 
static void RENAME() extract_odd2 (const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count)
 
static void RENAME() extract_odd2avg (const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count)
 
static void RENAME() yuyvtoyuv420 (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 RENAME() yuyvtoyuv422 (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 RENAME() uyvytoyuv420 (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 RENAME() uyvytoyuv422 (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 RENAME() rgb2rgb_init (void)
 

Macro Definition Documentation

◆ PREFETCH

#define PREFETCH   " # nop"

◆ EMMS

#define EMMS   "emms"

◆ MOVNTQ

#define MOVNTQ   "movq"

◆ SFENCE

#define SFENCE   " # nop"

◆ STORE_BGR24_MMX

#define STORE_BGR24_MMX

Definition at line 112 of file rgb2rgb_template.c.

Referenced by rgb15tobgr24(), rgb16tobgr24(), and rgb32tobgr24().

◆ PACK_RGB32

#define PACK_RGB32
Value:
"packuswb %%mm7, %%mm0 \n\t" /* 00 00 00 00 B3 B2 B1 B0 */ \
"packuswb %%mm7, %%mm1 \n\t" /* 00 00 00 00 G3 G2 G1 G0 */ \
"packuswb %%mm7, %%mm2 \n\t" /* 00 00 00 00 R3 R2 R1 R0 */ \
"punpcklbw %%mm1, %%mm0 \n\t" /* G3 B3 G2 B2 G1 B1 G0 B0 */ \
"punpcklbw %%mm6, %%mm2 \n\t" /* FF R3 FF R2 FF R1 FF R0 */ \
"movq %%mm0, %%mm3 \n\t" \
"punpcklwd %%mm2, %%mm0 \n\t" /* FF R1 G1 B1 FF R0 G0 B0 */ \
"punpckhwd %%mm2, %%mm3 \n\t" /* FF R3 G3 B3 FF R2 G2 B2 */ \
MOVNTQ" %%mm0, (%0) \n\t" \
MOVNTQ" %%mm3, 8(%0) \n\t" \

Definition at line 938 of file rgb2rgb_template.c.

Referenced by rgb15to32(), and rgb16to32().

Function Documentation

◆ rgb24tobgr32()

static void RENAME() rgb24tobgr32 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 68 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb32tobgr24()

static void RENAME() rgb32tobgr24 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 146 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb15to16()

static void RENAME() rgb15to16 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 189 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb16to15()

static void RENAME() rgb16to15 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 232 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb32to16()

static void RENAME() rgb32to16 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 280 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb32tobgr16()

static void RENAME() rgb32tobgr16 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 330 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb32to15()

static void RENAME() rgb32to15 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 385 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb32tobgr15()

static void RENAME() rgb32tobgr15 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 435 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb24tobgr16()

static void RENAME() rgb24tobgr16 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 490 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb24to16()

static void RENAME() rgb24to16 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 547 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb24tobgr15()

static void RENAME() rgb24tobgr15 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 604 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb24to15()

static void RENAME() rgb24to15 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 661 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb15tobgr24()

static void RENAME() rgb15tobgr24 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 718 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb16tobgr24()

static void RENAME() rgb16tobgr24 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 824 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb15to32()

static void RENAME() rgb15to32 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 950 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb16to32()

static void RENAME() rgb16to32 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 993 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ shuffle_bytes_2103()

static void RENAME() shuffle_bytes_2103 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 1037 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb24tobgr24()

static void RENAME() rgb24tobgr24 ( const uint8_t src,
uint8_t dst,
int  src_size 
)
inlinestatic

Definition at line 1099 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ yuvPlanartoyuy2()

static void RENAME() yuvPlanartoyuy2 ( 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 1167 of file rgb2rgb_template.c.

Referenced by yuv422ptoyuy2(), and yv12toyuy2().

◆ yv12toyuy2()

static void RENAME() yv12toyuy2 ( 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 1224 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ yuvPlanartouyvy()

static void RENAME() yuvPlanartouyvy ( 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 1232 of file rgb2rgb_template.c.

Referenced by yuv422ptouyvy(), and yv12touyvy().

◆ yv12touyvy()

static void RENAME() yv12touyvy ( 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 1289 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ yuv422ptouyvy()

static void RENAME() yuv422ptouyvy ( 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 1300 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ yuv422ptoyuy2()

static void RENAME() yuv422ptoyuy2 ( 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 1310 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ yuy2toyv12()

static void RENAME() yuy2toyv12 ( 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 1321 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ uyvytoyv12()

static void RENAME() uyvytoyv12 ( 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 1527 of file rgb2rgb_template.c.

◆ interleaveBytes()

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

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 1888 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ vu9_to_vu12()

static void RENAME() vu9_to_vu12 ( 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 1996 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ yvu9_to_yuy2()

static void RENAME() yvu9_to_yuy2 ( 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 2088 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ extract_even()

static void RENAME() extract_even ( const uint8_t src,
uint8_t dst,
x86_reg  count 
)
static

Definition at line 2175 of file rgb2rgb_template.c.

Referenced by yuyvtoyuv420(), and yuyvtoyuv422().

◆ extract_odd()

static void RENAME() extract_odd ( const uint8_t src,
uint8_t dst,
x86_reg  count 
)
static

Definition at line 2212 of file rgb2rgb_template.c.

Referenced by uyvytoyuv420(), and uyvytoyuv422().

◆ extract_even2()

static void RENAME() extract_even2 ( const uint8_t src,
uint8_t dst0,
uint8_t dst1,
x86_reg  count 
)
static

Definition at line 2251 of file rgb2rgb_template.c.

Referenced by uyvytoyuv422().

◆ extract_even2avg()

static void RENAME() extract_even2avg ( const uint8_t src0,
const uint8_t src1,
uint8_t dst0,
uint8_t dst1,
x86_reg  count 
)
static

Definition at line 2298 of file rgb2rgb_template.c.

Referenced by uyvytoyuv420().

◆ extract_odd2()

static void RENAME() extract_odd2 ( const uint8_t src,
uint8_t dst0,
uint8_t dst1,
x86_reg  count 
)
static

Definition at line 2352 of file rgb2rgb_template.c.

Referenced by yuyvtoyuv422().

◆ extract_odd2avg()

static void RENAME() extract_odd2avg ( const uint8_t src0,
const uint8_t src1,
uint8_t dst0,
uint8_t dst1,
x86_reg  count 
)
static

Definition at line 2400 of file rgb2rgb_template.c.

Referenced by yuyvtoyuv420().

◆ yuyvtoyuv420()

static void RENAME() yuyvtoyuv420 ( 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 2455 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ yuyvtoyuv422()

static void RENAME() yuyvtoyuv422 ( 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 2481 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ uyvytoyuv420()

static void RENAME() uyvytoyuv420 ( 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 2505 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ uyvytoyuv422()

static void RENAME() uyvytoyuv422 ( 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 2531 of file rgb2rgb_template.c.

Referenced by rgb2rgb_init(), and rgb2rgb_init_c().

◆ rgb2rgb_init()

static av_cold void RENAME() rgb2rgb_init ( void  )
static

Definition at line 2556 of file rgb2rgb_template.c.