Revision 8a26b2c6

View differences:

libswscale/x86/yuv2rgb_mmx.c
41 41
DECLARE_ASM_CONST(8, uint64_t, mmx_00ffw)   = 0x00ff00ff00ff00ffULL;
42 42
DECLARE_ASM_CONST(8, uint64_t, mmx_redmask) = 0xf8f8f8f8f8f8f8f8ULL;
43 43
DECLARE_ASM_CONST(8, uint64_t, mmx_grnmask) = 0xfcfcfcfcfcfcfcfcULL;
44
DECLARE_ASM_CONST(8, uint64_t, pb_e0) = 0xe0e0e0e0e0e0e0e0ULL;
45
DECLARE_ASM_CONST(8, uint64_t, pb_03) = 0x0303030303030303ULL;
46
DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL;
44 47

  
45 48
//MMX versions
46 49
#undef RENAME
libswscale/x86/yuv2rgb_template2.c
162 162
    __asm__ volatile (SFENCE"\n\t"EMMS);         \
163 163
    return srcSliceH;                            \
164 164

  
165
#define IF0(x)
166
#define IF1(x) x
165 167

  
166
#define RGB_PACK16(gmask, gshift, rshift)        \
168
#define RGB_PACK16(gmask, is15)                  \
167 169
    "pand      "MANGLE(mmx_redmask)", %%mm0\n\t" \
168 170
    "pand      "MANGLE(mmx_redmask)", %%mm1\n\t" \
171
    "movq      %%mm2,     %%mm3\n\t"             \
172
    "psllw   $"AV_STRINGIFY(3-is15)", %%mm2\n\t" \
173
    "psrlw   $"AV_STRINGIFY(5+is15)", %%mm3\n\t" \
169 174
    "psrlw     $3,        %%mm0\n\t"             \
170
    "pand      "MANGLE(gmask)",       %%mm2\n\t" \
171
    "movq      %%mm0,     %%mm5\n\t"             \
172
    "movq      %%mm1,     %%mm6\n\t"             \
173
    "movq      %%mm2,     %%mm7\n\t"             \
174
    "punpcklbw %%mm4,     %%mm0\n\t"             \
175
    "punpcklbw %%mm4,     %%mm1\n\t"             \
176
    "punpcklbw %%mm4,     %%mm2\n\t"             \
177
    "punpckhbw %%mm4,     %%mm5\n\t"             \
178
    "punpckhbw %%mm4,     %%mm6\n\t"             \
179
    "punpckhbw %%mm4,     %%mm7\n\t"             \
180
    "psllw     $"rshift", %%mm1\n\t"             \
181
    "psllw     $"rshift", %%mm6\n\t"             \
182
    "psllw     $"gshift", %%mm2\n\t"             \
183
    "psllw     $"gshift", %%mm7\n\t"             \
184
    "por       %%mm1,     %%mm0\n\t"             \
185
    "por       %%mm6,     %%mm5\n\t"             \
175
    IF##is15("psrlw  $1,  %%mm1\n\t")            \
176
    "pand "MANGLE(pb_e0)", %%mm2\n\t"            \
177
    "pand "MANGLE(gmask)", %%mm3\n\t"            \
186 178
    "por       %%mm2,     %%mm0\n\t"             \
187
    "por       %%mm7,     %%mm5\n\t"             \
179
    "por       %%mm3,     %%mm1\n\t"             \
180
    "movq      %%mm0,     %%mm2\n\t"             \
181
    "punpcklbw %%mm1,     %%mm0\n\t"             \
182
    "punpckhbw %%mm1,     %%mm2\n\t"             \
188 183
    MOVNTQ "   %%mm0,      (%1)\n\t"             \
189
    MOVNTQ "   %%mm5,     8(%1)\n\t"             \
184
    MOVNTQ "   %%mm2,     8(%1)\n\t"             \
190 185

  
191 186
#define DITHER_RGB                               \
192 187
    "paddusb "BLUE_DITHER"(%4),  %%mm0\n\t"      \
......
214 209
#ifdef DITHER1XBPP
215 210
        DITHER_RGB
216 211
#endif
217
        RGB_PACK16(mmx_redmask, "2", "7")
212
        RGB_PACK16(pb_03, 1)
218 213

  
219 214
    YUV2RGB_ENDLOOP(2)
220 215
    YUV2RGB_OPERANDS
......
242 237
#ifdef DITHER1XBPP
243 238
        DITHER_RGB
244 239
#endif
245
        RGB_PACK16(mmx_grnmask, "3", "8")
240
        RGB_PACK16(pb_07, 0)
246 241

  
247 242
    YUV2RGB_ENDLOOP(2)
248 243
    YUV2RGB_OPERANDS

Also available in: Unified diff