yuv2rgb_template.c File Reference

Go to the source code of this file.

Macros

#define MOVNTQ   "movq"
 
#define SFENCE   " # nop"
 
#define REG_BLUE   "0"
 
#define REG_RED   "1"
 
#define REG_GREEN   "2"
 
#define REG_ALPHA   "3"
 
#define YUV2RGB_LOOP(depth)
 
#define YUV2RGB_INITIAL_LOAD
 
#define YUV2RGB
 
#define RGB_PACK_INTERLEAVE
 
#define YUV2RGB_ENDLOOP(depth)
 
#define YUV2RGB_OPERANDS
 
#define YUV2RGB_OPERANDS_ALPHA
 
#define YUV2RGB_ENDFUNC
 
#define IF0(x)
 
#define IF1(x)   x
 
#define RGB_PACK16(gmask, is15)
 
#define DITHER_RGB
 
#define RGB_PACK24(blue, red)
 
#define RGB_PACK24_B
 
#define SET_EMPTY_ALPHA   "pcmpeqd %%mm"REG_ALPHA", %%mm"REG_ALPHA"\n\t" /* set alpha to 0xFF */ \
 
#define LOAD_ALPHA   "movq (%6, %0, 2), %%mm"REG_ALPHA"\n\t" \
 
#define RGB_PACK32(red, green, blue, alpha)
 

Functions

static int RENAME() yuv420_rgb15 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 
static int RENAME() yuv420_rgb16 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 
static int RENAME() yuv420_rgb24 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 
static int RENAME() yuv420_bgr24 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 
static int RENAME() yuv420_rgb32 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 
static int RENAME() yuv420_bgr32 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 

Macro Definition Documentation

#define DITHER_RGB
Value:
"paddusb "BLUE_DITHER"(%4), %%mm0\n\t" \
"paddusb "GREEN_DITHER"(%4), %%mm2\n\t" \
"paddusb "RED_DITHER"(%4), %%mm1\n\t" \
#define GREEN_DITHER
#define RED_DITHER
#define BLUE_DITHER

Definition at line 179 of file yuv2rgb_template.c.

Referenced by yuv420_rgb15(), and yuv420_rgb16().

#define IF0 (   x)

Definition at line 158 of file yuv2rgb_template.c.

#define IF1 (   x)    x

Definition at line 159 of file yuv2rgb_template.c.

#define LOAD_ALPHA   "movq (%6, %0, 2), %%mm"REG_ALPHA"\n\t" \

Definition at line 343 of file yuv2rgb_template.c.

Referenced by yuv420_bgr32(), and yuv420_rgb32().

#define MOVNTQ   "movq"

Definition at line 32 of file yuv2rgb_template.c.

#define REG_ALPHA   "3"

Definition at line 39 of file yuv2rgb_template.c.

Referenced by yuv420_bgr32(), and yuv420_rgb32().

#define REG_BLUE   "0"

Definition at line 36 of file yuv2rgb_template.c.

Referenced by yuv420_bgr24(), yuv420_bgr32(), yuv420_rgb24(), and yuv420_rgb32().

#define REG_GREEN   "2"

Definition at line 38 of file yuv2rgb_template.c.

Referenced by yuv420_bgr32(), and yuv420_rgb32().

#define REG_RED   "1"

Definition at line 37 of file yuv2rgb_template.c.

Referenced by yuv420_bgr24(), yuv420_bgr32(), yuv420_rgb24(), and yuv420_rgb32().

#define RGB_PACK16 (   gmask,
  is15 
)
Value:
"pand "MANGLE(mmx_redmask)", %%mm0\n\t" \
"pand "MANGLE(mmx_redmask)", %%mm1\n\t" \
"movq %%mm2, %%mm3\n\t" \
"psllw $"AV_STRINGIFY(3-is15)", %%mm2\n\t" \
"psrlw $"AV_STRINGIFY(5+is15)", %%mm3\n\t" \
"psrlw $3, %%mm0\n\t" \
IF##is15("psrlw $1, %%mm1\n\t") \
"pand "MANGLE(pb_e0)", %%mm2\n\t" \
"pand "MANGLE(gmask)", %%mm3\n\t" \
"por %%mm2, %%mm0\n\t" \
"por %%mm3, %%mm1\n\t" \
"movq %%mm0, %%mm2\n\t" \
"punpcklbw %%mm1, %%mm0\n\t" \
"punpckhbw %%mm1, %%mm2\n\t" \
MOVNTQ " %%mm0, (%1)\n\t" \
MOVNTQ " %%mm2, 8(%1)\n\t" \
#define MANGLE(a)
#define MOVNTQ
#define AV_STRINGIFY(s)

Definition at line 161 of file yuv2rgb_template.c.

Referenced by yuv420_rgb15(), and yuv420_rgb16().

#define RGB_PACK24 (   blue,
  red 
)
Value:
"packuswb %%mm3, %%mm0 \n" /* R0 R2 R4 R6 R1 R3 R5 R7 */\
"packuswb %%mm5, %%mm1 \n" /* B0 B2 B4 B6 B1 B3 B5 B7 */\
"packuswb %%mm7, %%mm2 \n" /* G0 G2 G4 G6 G1 G3 G5 G7 */\
"movq %%mm"red", %%mm3 \n"\
"movq %%mm"blue", %%mm6 \n"\
"psrlq $32, %%mm"red" \n" /* R1 R3 R5 R7 */\
"punpcklbw %%mm2, %%mm3 \n" /* R0 G0 R2 G2 R4 G4 R6 G6 */\
"punpcklbw %%mm"red", %%mm6 \n" /* B0 R1 B2 R3 B4 R5 B6 R7 */\
"movq %%mm3, %%mm5 \n"\
"punpckhbw %%mm"blue", %%mm2 \n" /* G1 B1 G3 B3 G5 B5 G7 B7 */\
"punpcklwd %%mm6, %%mm3 \n" /* R0 G0 B0 R1 R2 G2 B2 R3 */\
"punpckhwd %%mm6, %%mm5 \n" /* R4 G4 B4 R5 R6 G6 B6 R7 */\
#define RGB_PACK24_B

Definition at line 242 of file yuv2rgb_template.c.

Referenced by yuv420_bgr24(), and yuv420_rgb24().

#define RGB_PACK24_B
Value:
"movd %%mm3, (%1) \n" /* R0 G0 B0 R1 */\
"movd %%mm2, 4(%1) \n" /* G1 B1 */\
"psrlq $32, %%mm3 \n"\
"psrlq $16, %%mm2 \n"\
"movd %%mm3, 6(%1) \n" /* R2 G2 B2 R3 */\
"movd %%mm2, 10(%1) \n" /* G3 B3 */\
"psrlq $16, %%mm2 \n"\
"movd %%mm5, 12(%1) \n" /* R4 G4 B4 R5 */\
"movd %%mm2, 16(%1) \n" /* G5 B5 */\
"psrlq $32, %%mm5 \n"\
"movd %%mm2, 20(%1) \n" /* -- -- G7 B7 */\
"movd %%mm5, 18(%1) \n" /* R6 G6 B6 R7 */\

Definition at line 287 of file yuv2rgb_template.c.

#define RGB_PACK32 (   red,
  green,
  blue,
  alpha 
)
Value:
"movq %%mm"blue", %%mm5\n\t" \
"movq %%mm"red", %%mm6\n\t" \
"punpckhbw %%mm"green", %%mm5\n\t" \
"punpcklbw %%mm"green", %%mm"blue"\n\t" \
"punpckhbw %%mm"alpha", %%mm6\n\t" \
"punpcklbw %%mm"alpha", %%mm"red"\n\t" \
"movq %%mm"blue", %%mm"green"\n\t" \
"movq %%mm5, %%mm"alpha"\n\t" \
"punpcklwd %%mm"red", %%mm"blue"\n\t" \
"punpckhwd %%mm"red", %%mm"green"\n\t" \
"punpcklwd %%mm6, %%mm5\n\t" \
"punpckhwd %%mm6, %%mm"alpha"\n\t" \
MOVNTQ " %%mm"blue", 0(%1)\n\t" \
MOVNTQ " %%mm"green", 8(%1)\n\t" \
MOVNTQ " %%mm5, 16(%1)\n\t" \
MOVNTQ " %%mm"alpha", 24(%1)\n\t" \
static double alpha(void *priv, double x, double y)
Definition: vf_geq.c:86
#define MOVNTQ

Definition at line 346 of file yuv2rgb_template.c.

Referenced by yuv420_bgr32(), and yuv420_rgb32().

#define RGB_PACK_INTERLEAVE
Value:
/* pack and interleave even/odd pixels */ \
"packuswb %%mm1, %%mm0\n\t" \
"packuswb %%mm5, %%mm3\n\t" \
"packuswb %%mm2, %%mm2\n\t" \
"movq %%mm0, %%mm1\n\n" \
"packuswb %%mm7, %%mm7\n\t" \
"punpcklbw %%mm3, %%mm0\n\t" \
"punpckhbw %%mm3, %%mm1\n\t" \
"punpcklbw %%mm7, %%mm2\n\t" \

Definition at line 118 of file yuv2rgb_template.c.

Referenced by yuv420_bgr32(), yuv420_rgb15(), yuv420_rgb16(), and yuv420_rgb32().

#define SET_EMPTY_ALPHA   "pcmpeqd %%mm"REG_ALPHA", %%mm"REG_ALPHA"\n\t" /* set alpha to 0xFF */ \

Definition at line 340 of file yuv2rgb_template.c.

Referenced by yuv420_bgr32(), and yuv420_rgb32().

#define SFENCE   " # nop"

Definition at line 33 of file yuv2rgb_template.c.

#define YUV2RGB
#define YUV2RGB_ENDFUNC
Value:
__asm__ volatile (SFENCE"\n\t" \
"emms \n\t"); \
return srcSliceH; \
#define SFENCE
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return

Definition at line 153 of file yuv2rgb_template.c.

Referenced by yuv420_bgr24(), yuv420_bgr32(), yuv420_rgb15(), yuv420_rgb16(), yuv420_rgb24(), and yuv420_rgb32().

#define YUV2RGB_ENDLOOP (   depth)
Value:
"movq 8 (%5, %0, 2), %%mm6\n\t" \
"movd 4 (%3, %0), %%mm1\n\t" \
"movd 4 (%2, %0), %%mm0\n\t" \
"add $"AV_STRINGIFY(depth * 8)", %1\n\t" \
"add $4, %0\n\t" \
"js 1b\n\t" \
int depth
Definition: v4l.c:62
#define AV_STRINGIFY(s)

Definition at line 129 of file yuv2rgb_template.c.

Referenced by yuv420_bgr24(), yuv420_bgr32(), yuv420_rgb15(), yuv420_rgb16(), yuv420_rgb24(), and yuv420_rgb32().

#define YUV2RGB_INITIAL_LOAD
Value:
__asm__ volatile ( \
"movq (%5, %0, 2), %%mm6\n\t" \
"movd (%2, %0), %%mm0\n\t" \
"movd (%3, %0), %%mm1\n\t" \
"1: \n\t" \

Definition at line 56 of file yuv2rgb_template.c.

Referenced by yuv420_bgr24(), yuv420_bgr32(), yuv420_rgb15(), yuv420_rgb16(), yuv420_rgb24(), and yuv420_rgb32().

#define YUV2RGB_LOOP (   depth)
Value:
h_size = (c->dstW + 7) & ~7; \
if (h_size * depth > FFABS(dstStride[0])) \
h_size -= 8; \
\
vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \
\
__asm__ volatile ("pxor %mm4, %mm4\n\t"); \
for (y = 0; y < srcSliceH; y++) { \
uint8_t *image = dst[0] + (y + srcSliceY) * dstStride[0]; \
const uint8_t *py = src[0] + y * srcStride[0]; \
const uint8_t *pu = src[1] + (y >> vshift) * srcStride[1]; \
const uint8_t *pv = src[2] + (y >> vshift) * srcStride[2]; \
x86_reg index = -h_size / 2; \
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
uint8_t
#define pv
Definition: regdef.h:60
XImage * image
X11 image holding the grab.
Definition: x11grab.c:73
int depth
Definition: v4l.c:62
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:72
#define FFABS(a)
Definition: common.h:53
AVS_Value src
Definition: avisynth_c.h:523
int index
Definition: gxfenc.c:89
static double c[64]
function y
Definition: D.m:1
int x86_reg
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
for(j=16;j >0;--j)

Definition at line 41 of file yuv2rgb_template.c.

Referenced by yuv420_bgr24(), yuv420_bgr32(), yuv420_rgb15(), yuv420_rgb16(), yuv420_rgb24(), and yuv420_rgb32().

#define YUV2RGB_OPERANDS
Value:
: "+r" (index), "+r" (image) \
: "r" (pu - index), "r" (pv - index), "r"(&c->redDither), \
"r" (py - 2*index) \
: "memory" \
); \
} \
#define pv
Definition: regdef.h:60
XImage * image
X11 image holding the grab.
Definition: x11grab.c:73
int index
Definition: gxfenc.c:89
static double c[64]

Definition at line 137 of file yuv2rgb_template.c.

Referenced by yuv420_bgr24(), yuv420_bgr32(), yuv420_rgb15(), yuv420_rgb16(), yuv420_rgb24(), and yuv420_rgb32().

#define YUV2RGB_OPERANDS_ALPHA
Value:
: "+r" (index), "+r" (image) \
: "r" (pu - index), "r" (pv - index), "r"(&c->redDither), \
"r" (py - 2*index), "r" (pa - 2*index) \
: "memory" \
); \
} \
#define pv
Definition: regdef.h:60
XImage * image
X11 image holding the grab.
Definition: x11grab.c:73
int index
Definition: gxfenc.c:89
static double c[64]

Definition at line 145 of file yuv2rgb_template.c.

Referenced by yuv420_bgr32(), and yuv420_rgb32().

Function Documentation

static int RENAME() yuv420_bgr24 ( SwsContext c,
const uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)
inlinestatic

Definition at line 321 of file yuv2rgb_template.c.

static int RENAME() yuv420_bgr32 ( SwsContext c,
const uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)
inlinestatic

Definition at line 408 of file yuv2rgb_template.c.

static int RENAME() yuv420_rgb15 ( SwsContext c,
const uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)
inlinestatic

Definition at line 185 of file yuv2rgb_template.c.

static int RENAME() yuv420_rgb16 ( SwsContext c,
const uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)
inlinestatic

Definition at line 213 of file yuv2rgb_template.c.

static int RENAME() yuv420_rgb24 ( SwsContext c,
const uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)
inlinestatic

Definition at line 303 of file yuv2rgb_template.c.

static int RENAME() yuv420_rgb32 ( SwsContext c,
const uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)
inlinestatic

Definition at line 365 of file yuv2rgb_template.c.