Mercurial > mplayer.hg
comparison libswscale/yuv2rgb_template.c @ 28937:f2abbc7bb8f0
Split YUV2RGB operands declaration into a separate macro
author | sdrik |
---|---|
date | Mon, 16 Mar 2009 08:29:40 +0000 |
parents | 267dd38c800e |
children | e538af2c69c1 |
comparison
equal
deleted
inserted
replaced
28936:fd9de1e70d47 | 28937:f2abbc7bb8f0 |
---|---|
160 | 160 |
161 #define YUV2RGB_ENDLOOP(depth) \ | 161 #define YUV2RGB_ENDLOOP(depth) \ |
162 "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \ | 162 "add $"AV_STRINGIFY(depth*8)", %1 \n\t" \ |
163 "add $4, %0 \n\t" \ | 163 "add $4, %0 \n\t" \ |
164 " js 1b \n\t" \ | 164 " js 1b \n\t" \ |
165 \ | 165 |
166 #define YUV2RGB_OPERANDS \ | |
166 : "+r" (index), "+r" (image) \ | 167 : "+r" (index), "+r" (image) \ |
167 : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index) \ | 168 : "r" (pu - index), "r" (pv - index), "r"(&c->redDither), "r" (py - 2*index) \ |
168 ); \ | 169 ); \ |
169 } \ | 170 } \ |
170 __asm__ volatile (EMMS); \ | 171 __asm__ volatile (EMMS); \ |
221 "movd 4 (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ | 222 "movd 4 (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ |
222 | 223 |
223 MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */ | 224 MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */ |
224 | 225 |
225 YUV2RGB_ENDLOOP(2) | 226 YUV2RGB_ENDLOOP(2) |
227 YUV2RGB_OPERANDS | |
226 } | 228 } |
227 | 229 |
228 static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, | 230 static inline int RENAME(yuv420_rgb15)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, |
229 int srcSliceH, uint8_t* dst[], int dstStride[]){ | 231 int srcSliceH, uint8_t* dst[], int dstStride[]){ |
230 int y, h_size; | 232 int y, h_size; |
278 "movd 4 (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ | 280 "movd 4 (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ |
279 | 281 |
280 MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */ | 282 MOVNTQ " %%mm5, 8 (%1);" /* store pixel 4-7 */ |
281 | 283 |
282 YUV2RGB_ENDLOOP(2) | 284 YUV2RGB_ENDLOOP(2) |
285 YUV2RGB_OPERANDS | |
283 } | 286 } |
284 | 287 |
285 static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, | 288 static inline int RENAME(yuv420_rgb24)(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, |
286 int srcSliceH, uint8_t* dst[], int dstStride[]){ | 289 int srcSliceH, uint8_t* dst[], int dstStride[]){ |
287 int y, h_size; | 290 int y, h_size; |
392 "movd 4 (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ | 395 "movd 4 (%3, %0), %%mm1;" /* Load 4 Cr 00 00 00 00 v3 v2 v1 v0 */ |
393 "pxor %%mm4, %%mm4 \n\t" | 396 "pxor %%mm4, %%mm4 \n\t" |
394 #endif | 397 #endif |
395 | 398 |
396 YUV2RGB_ENDLOOP(3) | 399 YUV2RGB_ENDLOOP(3) |
400 YUV2RGB_OPERANDS | |
397 } | 401 } |
398 | 402 |
399 #define RGB_PLANAR2PACKED32 \ | 403 #define RGB_PLANAR2PACKED32 \ |
400 /* convert RGB plane to RGB packed format, \ | 404 /* convert RGB plane to RGB packed format, \ |
401 mm0 -> B, mm1 -> R, mm2 -> G, mm3 -> A, \ | 405 mm0 -> B, mm1 -> R, mm2 -> G, mm3 -> A, \ |
448 YUV2RGB | 452 YUV2RGB |
449 "pcmpeqd %%mm3, %%mm3;" /* fill mm3 */ | 453 "pcmpeqd %%mm3, %%mm3;" /* fill mm3 */ |
450 RGB_PLANAR2PACKED32 | 454 RGB_PLANAR2PACKED32 |
451 | 455 |
452 YUV2RGB_ENDLOOP(4) | 456 YUV2RGB_ENDLOOP(4) |
457 YUV2RGB_OPERANDS | |
453 } | 458 } |