comparison libswscale/rgb2rgb.c @ 25875:2356fe5b7596

Use DECLARE_ASM_CONST where possible in libswscale code
author reimar
date Mon, 28 Jan 2008 14:38:11 +0000
parents 06bf0eb70a55
children 2ad528dd42a0
comparison
equal deleted inserted replaced
25874:62e8b0134919 25875:2356fe5b7596
86 long width, long height, 86 long width, long height,
87 long srcStride1, long srcStride2, 87 long srcStride1, long srcStride2,
88 long srcStride3, long dstStride); 88 long srcStride3, long dstStride);
89 89
90 #if defined(ARCH_X86) && defined(CONFIG_GPL) 90 #if defined(ARCH_X86) && defined(CONFIG_GPL)
91 static const uint64_t mmx_null __attribute__((aligned(8))) = 0x0000000000000000ULL; 91 DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0x0000000000000000ULL;
92 static const uint64_t mmx_one __attribute__((aligned(8))) = 0xFFFFFFFFFFFFFFFFULL; 92 DECLARE_ASM_CONST(8, uint64_t, mmx_one) = 0xFFFFFFFFFFFFFFFFULL;
93 static const uint64_t mask32b attribute_used __attribute__((aligned(8))) = 0x000000FF000000FFULL; 93 DECLARE_ASM_CONST(8, uint64_t, mask32b) = 0x000000FF000000FFULL;
94 static const uint64_t mask32g attribute_used __attribute__((aligned(8))) = 0x0000FF000000FF00ULL; 94 DECLARE_ASM_CONST(8, uint64_t, mask32g) = 0x0000FF000000FF00ULL;
95 static const uint64_t mask32r attribute_used __attribute__((aligned(8))) = 0x00FF000000FF0000ULL; 95 DECLARE_ASM_CONST(8, uint64_t, mask32r) = 0x00FF000000FF0000ULL;
96 static const uint64_t mask32 __attribute__((aligned(8))) = 0x00FFFFFF00FFFFFFULL; 96 DECLARE_ASM_CONST(8, uint64_t, mask32) = 0x00FFFFFF00FFFFFFULL;
97 static const uint64_t mask3216br __attribute__((aligned(8))) = 0x00F800F800F800F8ULL; 97 DECLARE_ASM_CONST(8, uint64_t, mask3216br) = 0x00F800F800F800F8ULL;
98 static const uint64_t mask3216g __attribute__((aligned(8))) = 0x0000FC000000FC00ULL; 98 DECLARE_ASM_CONST(8, uint64_t, mask3216g) = 0x0000FC000000FC00ULL;
99 static const uint64_t mask3215g __attribute__((aligned(8))) = 0x0000F8000000F800ULL; 99 DECLARE_ASM_CONST(8, uint64_t, mask3215g) = 0x0000F8000000F800ULL;
100 static const uint64_t mul3216 __attribute__((aligned(8))) = 0x2000000420000004ULL; 100 DECLARE_ASM_CONST(8, uint64_t, mul3216) = 0x2000000420000004ULL;
101 static const uint64_t mul3215 __attribute__((aligned(8))) = 0x2000000820000008ULL; 101 DECLARE_ASM_CONST(8, uint64_t, mul3215) = 0x2000000820000008ULL;
102 static const uint64_t mask24b attribute_used __attribute__((aligned(8))) = 0x00FF0000FF0000FFULL; 102 DECLARE_ASM_CONST(8, uint64_t, mask24b) = 0x00FF0000FF0000FFULL;
103 static const uint64_t mask24g attribute_used __attribute__((aligned(8))) = 0xFF0000FF0000FF00ULL; 103 DECLARE_ASM_CONST(8, uint64_t, mask24g) = 0xFF0000FF0000FF00ULL;
104 static const uint64_t mask24r attribute_used __attribute__((aligned(8))) = 0x0000FF0000FF0000ULL; 104 DECLARE_ASM_CONST(8, uint64_t, mask24r) = 0x0000FF0000FF0000ULL;
105 static const uint64_t mask24l __attribute__((aligned(8))) = 0x0000000000FFFFFFULL; 105 DECLARE_ASM_CONST(8, uint64_t, mask24l) = 0x0000000000FFFFFFULL;
106 static const uint64_t mask24h __attribute__((aligned(8))) = 0x0000FFFFFF000000ULL; 106 DECLARE_ASM_CONST(8, uint64_t, mask24h) = 0x0000FFFFFF000000ULL;
107 static const uint64_t mask24hh __attribute__((aligned(8))) = 0xffff000000000000ULL; 107 DECLARE_ASM_CONST(8, uint64_t, mask24hh) = 0xffff000000000000ULL;
108 static const uint64_t mask24hhh __attribute__((aligned(8))) = 0xffffffff00000000ULL; 108 DECLARE_ASM_CONST(8, uint64_t, mask24hhh) = 0xffffffff00000000ULL;
109 static const uint64_t mask24hhhh __attribute__((aligned(8))) = 0xffffffffffff0000ULL; 109 DECLARE_ASM_CONST(8, uint64_t, mask24hhhh) = 0xffffffffffff0000ULL;
110 static const uint64_t mask15b __attribute__((aligned(8))) = 0x001F001F001F001FULL; /* 00000000 00011111 xxB */ 110 DECLARE_ASM_CONST(8, uint64_t, mask15b) = 0x001F001F001F001FULL; /* 00000000 00011111 xxB */
111 static const uint64_t mask15rg __attribute__((aligned(8))) = 0x7FE07FE07FE07FE0ULL; /* 01111111 11100000 RGx */ 111 DECLARE_ASM_CONST(8, uint64_t, mask15rg) = 0x7FE07FE07FE07FE0ULL; /* 01111111 11100000 RGx */
112 static const uint64_t mask15s __attribute__((aligned(8))) = 0xFFE0FFE0FFE0FFE0ULL; 112 DECLARE_ASM_CONST(8, uint64_t, mask15s) = 0xFFE0FFE0FFE0FFE0ULL;
113 static const uint64_t mask15g __attribute__((aligned(8))) = 0x03E003E003E003E0ULL; 113 DECLARE_ASM_CONST(8, uint64_t, mask15g) = 0x03E003E003E003E0ULL;
114 static const uint64_t mask15r __attribute__((aligned(8))) = 0x7C007C007C007C00ULL; 114 DECLARE_ASM_CONST(8, uint64_t, mask15r) = 0x7C007C007C007C00ULL;
115 #define mask16b mask15b 115 #define mask16b mask15b
116 static const uint64_t mask16g __attribute__((aligned(8))) = 0x07E007E007E007E0ULL; 116 DECLARE_ASM_CONST(8, uint64_t, mask16g) = 0x07E007E007E007E0ULL;
117 static const uint64_t mask16r __attribute__((aligned(8))) = 0xF800F800F800F800ULL; 117 DECLARE_ASM_CONST(8, uint64_t, mask16r) = 0xF800F800F800F800ULL;
118 static const uint64_t red_16mask __attribute__((aligned(8))) = 0x0000f8000000f800ULL; 118 DECLARE_ASM_CONST(8, uint64_t, red_16mask) = 0x0000f8000000f800ULL;
119 static const uint64_t green_16mask __attribute__((aligned(8))) = 0x000007e0000007e0ULL; 119 DECLARE_ASM_CONST(8, uint64_t, green_16mask) = 0x000007e0000007e0ULL;
120 static const uint64_t blue_16mask __attribute__((aligned(8))) = 0x0000001f0000001fULL; 120 DECLARE_ASM_CONST(8, uint64_t, blue_16mask) = 0x0000001f0000001fULL;
121 static const uint64_t red_15mask __attribute__((aligned(8))) = 0x00007c0000007c00ULL; 121 DECLARE_ASM_CONST(8, uint64_t, red_15mask) = 0x00007c0000007c00ULL;
122 static const uint64_t green_15mask __attribute__((aligned(8))) = 0x000003e0000003e0ULL; 122 DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x000003e0000003e0ULL;
123 static const uint64_t blue_15mask __attribute__((aligned(8))) = 0x0000001f0000001fULL; 123 DECLARE_ASM_CONST(8, uint64_t, blue_15mask) = 0x0000001f0000001fULL;
124 124
125 #ifdef FAST_BGR2YV12 125 #ifdef FAST_BGR2YV12
126 static const uint64_t bgr2YCoeff attribute_used __attribute__((aligned(8))) = 0x000000210041000DULL; 126 DECLARE_ASM_CONST(8, uint64_t, bgr2YCoeff) = 0x000000210041000DULL;
127 static const uint64_t bgr2UCoeff attribute_used __attribute__((aligned(8))) = 0x0000FFEEFFDC0038ULL; 127 DECLARE_ASM_CONST(8, uint64_t, bgr2UCoeff) = 0x0000FFEEFFDC0038ULL;
128 static const uint64_t bgr2VCoeff attribute_used __attribute__((aligned(8))) = 0x00000038FFD2FFF8ULL; 128 DECLARE_ASM_CONST(8, uint64_t, bgr2VCoeff) = 0x00000038FFD2FFF8ULL;
129 #else 129 #else
130 static const uint64_t bgr2YCoeff attribute_used __attribute__((aligned(8))) = 0x000020E540830C8BULL; 130 DECLARE_ASM_CONST(8, uint64_t, bgr2YCoeff) = 0x000020E540830C8BULL;
131 static const uint64_t bgr2UCoeff attribute_used __attribute__((aligned(8))) = 0x0000ED0FDAC23831ULL; 131 DECLARE_ASM_CONST(8, uint64_t, bgr2UCoeff) = 0x0000ED0FDAC23831ULL;
132 static const uint64_t bgr2VCoeff attribute_used __attribute__((aligned(8))) = 0x00003831D0E6F6EAULL; 132 DECLARE_ASM_CONST(8, uint64_t, bgr2VCoeff) = 0x00003831D0E6F6EAULL;
133 #endif 133 #endif
134 static const uint64_t bgr2YOffset attribute_used __attribute__((aligned(8))) = 0x1010101010101010ULL; 134 DECLARE_ASM_CONST(8, uint64_t, bgr2YOffset) = 0x1010101010101010ULL;
135 static const uint64_t bgr2UVOffset attribute_used __attribute__((aligned(8))) = 0x8080808080808080ULL; 135 DECLARE_ASM_CONST(8, uint64_t, bgr2UVOffset) = 0x8080808080808080ULL;
136 static const uint64_t w1111 attribute_used __attribute__((aligned(8))) = 0x0001000100010001ULL; 136 DECLARE_ASM_CONST(8, uint64_t, w1111) = 0x0001000100010001ULL;
137 137
138 #if 0 138 #if 0
139 static volatile uint64_t __attribute__((aligned(8))) b5Dither; 139 static volatile uint64_t __attribute__((aligned(8))) b5Dither;
140 static volatile uint64_t __attribute__((aligned(8))) g5Dither; 140 static volatile uint64_t __attribute__((aligned(8))) g5Dither;
141 static volatile uint64_t __attribute__((aligned(8))) g6Dither; 141 static volatile uint64_t __attribute__((aligned(8))) g6Dither;