FFmpeg
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   "prefetchnta"
 
#define PAVGB   "pavgb"
 
#define MOVNTQ   "movntq"
 
#define SFENCE   "sfence"
 
#define EMMS   "emms"
 
#define STORE_BGR24_MMX
 
#define PACK_RGB32
 

Functions

static void rgb24tobgr32_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32tobgr24_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb15to16_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb16to15_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32to16_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32tobgr16_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32to15_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb32tobgr15_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24tobgr16_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24to16_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24tobgr15_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24to15_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb15tobgr24_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb16tobgr24_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb15to32_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb16to32_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void rgb24tobgr24_TMPL (const uint8_t *src, uint8_t *dst, int src_size)
 
static void yuvPlanartoyuy2_TMPL (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_TMPL (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_TMPL (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_TMPL (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_TMPL (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_TMPL (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_TMPL (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_TMPL (const uint8_t *src, uint8_t *dst, int srcWidth, int srcHeight, int srcStride, int dstStride)
 
static void uyvytoyv12_TMPL (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 vu9_to_vu12_TMPL (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)
 Height should be a multiple of 2 and width should be a multiple of 2. More...
 
static void yvu9_to_yuy2_TMPL (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_TMPL (const uint8_t *src, uint8_t *dst, x86_reg count)
 
static void extract_odd_TMPL (const uint8_t *src, uint8_t *dst, x86_reg count)
 
static void extract_even2avg_TMPL (const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count)
 
static void extract_odd2_TMPL (const uint8_t *src, uint8_t *dst0, uint8_t *dst1, x86_reg count)
 
static void extract_odd2avg_TMPL (const uint8_t *src0, const uint8_t *src1, uint8_t *dst0, uint8_t *dst1, x86_reg count)
 
static void yuyvtoyuv420_TMPL (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_TMPL (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_TMPL (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_TMPL (void)
 

Macro Definition Documentation

◆ PREFETCH

#define PREFETCH   "prefetchnta"

Definition at line 39 of file rgb2rgb_template.c.

◆ PAVGB

#define PAVGB   "pavgb"

Definition at line 40 of file rgb2rgb_template.c.

◆ MOVNTQ

#define MOVNTQ   "movntq"

Definition at line 41 of file rgb2rgb_template.c.

◆ SFENCE

#define SFENCE   "sfence"

Definition at line 42 of file rgb2rgb_template.c.

◆ EMMS

#define EMMS   "emms"

Definition at line 44 of file rgb2rgb_template.c.

◆ STORE_BGR24_MMX

#define STORE_BGR24_MMX

Definition at line 92 of file rgb2rgb_template.c.

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

Function Documentation

◆ rgb24tobgr32_TMPL()

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

Definition at line 48 of file rgb2rgb_template.c.

◆ rgb32tobgr24_TMPL()

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

Definition at line 126 of file rgb2rgb_template.c.

◆ rgb15to16_TMPL()

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

Definition at line 169 of file rgb2rgb_template.c.

◆ rgb16to15_TMPL()

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

Definition at line 212 of file rgb2rgb_template.c.

◆ rgb32to16_TMPL()

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

Definition at line 260 of file rgb2rgb_template.c.

◆ rgb32tobgr16_TMPL()

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

Definition at line 310 of file rgb2rgb_template.c.

◆ rgb32to15_TMPL()

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

Definition at line 365 of file rgb2rgb_template.c.

◆ rgb32tobgr15_TMPL()

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

Definition at line 415 of file rgb2rgb_template.c.

◆ rgb24tobgr16_TMPL()

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

Definition at line 470 of file rgb2rgb_template.c.

◆ rgb24to16_TMPL()

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

Definition at line 527 of file rgb2rgb_template.c.

◆ rgb24tobgr15_TMPL()

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

Definition at line 584 of file rgb2rgb_template.c.

◆ rgb24to15_TMPL()

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

Definition at line 641 of file rgb2rgb_template.c.

◆ rgb15tobgr24_TMPL()

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

Definition at line 698 of file rgb2rgb_template.c.

◆ rgb16tobgr24_TMPL()

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

Definition at line 804 of file rgb2rgb_template.c.

◆ rgb15to32_TMPL()

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

Definition at line 930 of file rgb2rgb_template.c.

◆ rgb16to32_TMPL()

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

Definition at line 973 of file rgb2rgb_template.c.

◆ rgb24tobgr24_TMPL()

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

Definition at line 1017 of file rgb2rgb_template.c.

◆ yuvPlanartoyuy2_TMPL()

static void yuvPlanartoyuy2_TMPL ( 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 1085 of file rgb2rgb_template.c.

◆ yv12toyuy2_TMPL()

static void yv12toyuy2_TMPL ( 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 1142 of file rgb2rgb_template.c.

◆ yuvPlanartouyvy_TMPL()

static void yuvPlanartouyvy_TMPL ( 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 1150 of file rgb2rgb_template.c.

◆ yv12touyvy_TMPL()

static void yv12touyvy_TMPL ( 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 1207 of file rgb2rgb_template.c.

◆ yuv422ptouyvy_TMPL()

static void yuv422ptouyvy_TMPL ( 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 1218 of file rgb2rgb_template.c.

◆ yuv422ptoyuy2_TMPL()

static void yuv422ptoyuy2_TMPL ( 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 1228 of file rgb2rgb_template.c.

◆ yuy2toyv12_TMPL()

static void yuy2toyv12_TMPL ( 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 1239 of file rgb2rgb_template.c.

◆ planar2x_TMPL()

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

Definition at line 1337 of file rgb2rgb_template.c.

◆ uyvytoyv12_TMPL()

static void uyvytoyv12_TMPL ( 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 1441 of file rgb2rgb_template.c.

◆ vu9_to_vu12_TMPL()

static void vu9_to_vu12_TMPL ( 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

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

◆ yvu9_to_yuy2_TMPL()

static void yvu9_to_yuy2_TMPL ( 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 1940 of file rgb2rgb_template.c.

◆ extract_even_TMPL()

static void extract_even_TMPL ( const uint8_t *  src,
uint8_t *  dst,
x86_reg  count 
)
static

Definition at line 2026 of file rgb2rgb_template.c.

◆ extract_odd_TMPL()

static void extract_odd_TMPL ( const uint8_t *  src,
uint8_t *  dst,
x86_reg  count 
)
static

Definition at line 2063 of file rgb2rgb_template.c.

◆ extract_even2avg_TMPL()

static void extract_even2avg_TMPL ( const uint8_t *  src0,
const uint8_t *  src1,
uint8_t *  dst0,
uint8_t *  dst1,
x86_reg  count 
)
static

Definition at line 2149 of file rgb2rgb_template.c.

◆ extract_odd2_TMPL()

static void extract_odd2_TMPL ( const uint8_t *  src,
uint8_t *  dst0,
uint8_t *  dst1,
x86_reg  count 
)
static

Definition at line 2202 of file rgb2rgb_template.c.

◆ extract_odd2avg_TMPL()

static void extract_odd2avg_TMPL ( const uint8_t *  src0,
const uint8_t *  src1,
uint8_t *  dst0,
uint8_t *  dst1,
x86_reg  count 
)
static

Definition at line 2249 of file rgb2rgb_template.c.

◆ yuyvtoyuv420_TMPL()

static void yuyvtoyuv420_TMPL ( 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 2304 of file rgb2rgb_template.c.

◆ yuyvtoyuv422_TMPL()

static void yuyvtoyuv422_TMPL ( 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 2329 of file rgb2rgb_template.c.

◆ uyvytoyuv420_TMPL()

static void uyvytoyuv420_TMPL ( 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 2352 of file rgb2rgb_template.c.

◆ rgb2rgb_init_TMPL()

static av_cold void rgb2rgb_init_TMPL ( void  )
static

Definition at line 2403 of file rgb2rgb_template.c.