Defines | Functions

libswscale/x86/yuv2rgb_template2.c File Reference

Go to the source code of this file.

Defines

#define EMMS   "emms"
#define MOVNTQ   "movntq"
#define SFENCE   "sfence"
#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 YUV2RGB_ENDLOOP(depth)
#define YUV2RGB_OPERANDS
#define YUV2RGB_OPERANDS_ALPHA
#define YUV2RGB_ENDFUNC
#define RGB_PACK16(gmask, gshift, rshift)
#define DITHER_RGB
#define RGB_PACK24(red, blue)
#define SET_EMPTY_ALPHA   "pcmpeqd %%mm"REG_ALPHA", %%mm"REG_ALPHA"\n\t"
#define LOAD_ALPHA   "movq (%6, %0, 2), %%mm"REG_ALPHA"\n\t" \
#define RGB_PACK32(red, green, blue, alpha)

Functions

static int yuv420_rgb15_MMX2 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int yuv420_rgb16_MMX2 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int yuv420_rgb24_MMX2 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int yuv420_bgr24_MMX2 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int yuv420_rgb32_MMX2 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int yuva420_rgb32_MMX2 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int yuv420_bgr32_MMX2 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
static int yuva420_bgr32_MMX2 (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])

Define 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"      \

Definition at line 191 of file yuv2rgb_template2.c.

Referenced by yuv420_rgb15_MMX2(), and yuv420_rgb16_MMX2().

#define EMMS   "emms"

Definition at line 32 of file yuv2rgb_template2.c.

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

Definition at line 359 of file yuv2rgb_template2.c.

Referenced by yuva420_bgr32_MMX2(), and yuva420_rgb32_MMX2().

#define MOVNTQ   "movntq"

Definition at line 36 of file yuv2rgb_template2.c.

#define REG_ALPHA   "3"
#define REG_BLUE   "0"
#define REG_GREEN   "2"
#define REG_RED   "1"
#define RGB_PACK16 (   gmask,
  gshift,
  rshift 
)
Value:
"pand      "MANGLE(mmx_redmask)", %%mm0\n\t" \
    "pand      "MANGLE(mmx_redmask)", %%mm1\n\t" \
    "psrlw     $3,        %%mm0\n\t"             \
    "pand      "MANGLE(gmask)",       %%mm2\n\t" \
    "movq      %%mm0,     %%mm5\n\t"             \
    "movq      %%mm1,     %%mm6\n\t"             \
    "movq      %%mm2,     %%mm7\n\t"             \
    "punpcklbw %%mm4,     %%mm0\n\t"             \
    "punpcklbw %%mm4,     %%mm1\n\t"             \
    "punpcklbw %%mm4,     %%mm2\n\t"             \
    "punpckhbw %%mm4,     %%mm5\n\t"             \
    "punpckhbw %%mm4,     %%mm6\n\t"             \
    "punpckhbw %%mm4,     %%mm7\n\t"             \
    "psllw     $"rshift", %%mm1\n\t"             \
    "psllw     $"rshift", %%mm6\n\t"             \
    "psllw     $"gshift", %%mm2\n\t"             \
    "psllw     $"gshift", %%mm7\n\t"             \
    "por       %%mm1,     %%mm0\n\t"             \
    "por       %%mm6,     %%mm5\n\t"             \
    "por       %%mm2,     %%mm0\n\t"             \
    "por       %%mm7,     %%mm5\n\t"             \
    MOVNTQ "   %%mm0,      (%1)\n\t"             \
    MOVNTQ "   %%mm5,     8(%1)\n\t"             \

Definition at line 166 of file yuv2rgb_template2.c.

Referenced by yuv420_rgb15_MMX2(), and yuv420_rgb16_MMX2().

#define RGB_PACK24 (   red,
  blue 
)

Definition at line 251 of file yuv2rgb_template2.c.

Referenced by yuv420_bgr24_MMX2(), and yuv420_rgb24_MMX2().

#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"      \

Definition at line 362 of file yuv2rgb_template2.c.

Referenced by yuv420_bgr32_MMX2(), yuv420_rgb32_MMX2(), yuva420_bgr32_MMX2(), and yuva420_rgb32_MMX2().

#define SET_EMPTY_ALPHA   "pcmpeqd %%mm"REG_ALPHA", %%mm"REG_ALPHA"\n\t"

Definition at line 355 of file yuv2rgb_template2.c.

Referenced by yuv420_bgr32_MMX2(), and yuv420_rgb32_MMX2().

#define SFENCE   "sfence"

Definition at line 37 of file yuv2rgb_template2.c.

#define YUV2RGB
#define YUV2RGB_ENDFUNC
Value:
__asm__ volatile (SFENCE"\n\t"EMMS);         \
    return srcSliceH;                            \

Definition at line 161 of file yuv2rgb_template2.c.

Referenced by yuv420_bgr24_MMX2(), yuv420_bgr32_MMX2(), yuv420_rgb15_MMX2(), yuv420_rgb16_MMX2(), yuv420_rgb24_MMX2(), yuv420_rgb32_MMX2(), yuva420_bgr32_MMX2(), and yuva420_rgb32_MMX2().

#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"                                \

Definition at line 139 of file yuv2rgb_template2.c.

Referenced by yuv420_bgr24_MMX2(), yuv420_bgr32_MMX2(), yuv420_rgb15_MMX2(), yuv420_rgb16_MMX2(), yuv420_rgb24_MMX2(), yuv420_rgb32_MMX2(), yuva420_bgr32_MMX2(), and yuva420_rgb32_MMX2().

#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 66 of file yuv2rgb_template2.c.

Referenced by yuv420_bgr24_MMX2(), yuv420_bgr32_MMX2(), yuv420_rgb15_MMX2(), yuv420_rgb16_MMX2(), yuv420_rgb24_MMX2(), yuv420_rgb32_MMX2(), yuva420_bgr32_MMX2(), and yuva420_rgb32_MMX2().

#define YUV2RGB_LOOP (   depth  ) 
Value:
h_size = (c->dstW + 7) & ~7;                                     \
    if (h_size * depth > FFABS(dstStride[0]))                        \
        h_size -= 8;                                                 \
                                                                     \
    if (c->srcFormat == PIX_FMT_YUV422P) {                           \
        srcStride[1] *= 2;                                           \
        srcStride[2] *= 2;                                           \
    }                                                                \
                                                                     \
    __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 >> 1) * srcStride[1]; \
        const uint8_t *pv = src[2] +        (y >> 1) * srcStride[2]; \
        x86_reg index = -h_size / 2;                                 \

Definition at line 48 of file yuv2rgb_template2.c.

Referenced by yuv420_bgr24_MMX2(), yuv420_bgr32_MMX2(), yuv420_rgb15_MMX2(), yuv420_rgb16_MMX2(), yuv420_rgb24_MMX2(), yuv420_rgb32_MMX2(), yuva420_bgr32_MMX2(), and yuva420_rgb32_MMX2().

#define YUV2RGB_OPERANDS
Value:
: "+r" (index), "+r" (image)                              \
        : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), \
          "r" (py - 2*index)                                      \
        );                                                        \
    }                                                             \

Definition at line 147 of file yuv2rgb_template2.c.

Referenced by yuv420_bgr24_MMX2(), yuv420_bgr32_MMX2(), yuv420_rgb15_MMX2(), yuv420_rgb16_MMX2(), yuv420_rgb24_MMX2(), and yuv420_rgb32_MMX2().

#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)                  \
        );                                                        \
    }                                                             \

Definition at line 154 of file yuv2rgb_template2.c.

Referenced by yuva420_bgr32_MMX2(), and yuva420_rgb32_MMX2().


Function Documentation

static int yuv420_bgr24_MMX2 ( SwsContext c,
const uint8_t *  src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t *  dst[],
int  dstStride[] 
) [inline, static]

Definition at line 336 of file yuv2rgb_template2.c.

static int yuv420_bgr32_MMX2 ( SwsContext c,
const uint8_t *  src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t *  dst[],
int  dstStride[] 
) [inline, static]

Definition at line 421 of file yuv2rgb_template2.c.

static int yuv420_rgb15_MMX2 ( SwsContext c,
const uint8_t *  src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t *  dst[],
int  dstStride[] 
) [inline, static]

Definition at line 196 of file yuv2rgb_template2.c.

static int yuv420_rgb16_MMX2 ( SwsContext c,
const uint8_t *  src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t *  dst[],
int  dstStride[] 
) [inline, static]

Definition at line 223 of file yuv2rgb_template2.c.

static int yuv420_rgb24_MMX2 ( SwsContext c,
const uint8_t *  src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t *  dst[],
int  dstStride[] 
) [inline, static]

Definition at line 318 of file yuv2rgb_template2.c.

static int yuv420_rgb32_MMX2 ( SwsContext c,
const uint8_t *  src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t *  dst[],
int  dstStride[] 
) [inline, static]

Definition at line 380 of file yuv2rgb_template2.c.

static int yuva420_bgr32_MMX2 ( SwsContext c,
const uint8_t *  src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t *  dst[],
int  dstStride[] 
) [inline, static]

Definition at line 440 of file yuv2rgb_template2.c.

static int yuva420_rgb32_MMX2 ( SwsContext c,
const uint8_t *  src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t *  dst[],
int  dstStride[] 
) [inline, static]

Definition at line 399 of file yuv2rgb_template2.c.