Mercurial > libavcodec.hg
comparison x86/dsputil_mmx.c @ 10961:34a65026fa06 libavcodec
Move array specifiers outside DECLARE_ALIGNED() invocations
author | mru |
---|---|
date | Fri, 22 Jan 2010 03:25:11 +0000 |
parents | 78c2be62260a |
children | abb3b23bda35 |
comparison
equal
deleted
inserted
replaced
10960:10759fd39860 | 10961:34a65026fa06 |
---|---|
40 | 40 |
41 /* pixel operations */ | 41 /* pixel operations */ |
42 DECLARE_ALIGNED_8 (const uint64_t, ff_bone) = 0x0101010101010101ULL; | 42 DECLARE_ALIGNED_8 (const uint64_t, ff_bone) = 0x0101010101010101ULL; |
43 DECLARE_ALIGNED_8 (const uint64_t, ff_wtwo) = 0x0002000200020002ULL; | 43 DECLARE_ALIGNED_8 (const uint64_t, ff_wtwo) = 0x0002000200020002ULL; |
44 | 44 |
45 DECLARE_ALIGNED_16(const uint64_t, ff_pdw_80000000[2]) = | 45 DECLARE_ALIGNED_16(const uint64_t, ff_pdw_80000000)[2] = |
46 {0x8000000080000000ULL, 0x8000000080000000ULL}; | 46 {0x8000000080000000ULL, 0x8000000080000000ULL}; |
47 | 47 |
48 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_3 ) = 0x0003000300030003ULL; | 48 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_3 ) = 0x0003000300030003ULL; |
49 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_4 ) = 0x0004000400040004ULL; | 49 DECLARE_ALIGNED_8 (const uint64_t, ff_pw_4 ) = 0x0004000400040004ULL; |
50 DECLARE_ALIGNED_16(const xmm_reg, ff_pw_5 ) = {0x0005000500050005ULL, 0x0005000500050005ULL}; | 50 DECLARE_ALIGNED_16(const xmm_reg, ff_pw_5 ) = {0x0005000500050005ULL, 0x0005000500050005ULL}; |
67 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_3F ) = 0x3F3F3F3F3F3F3F3FULL; | 67 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_3F ) = 0x3F3F3F3F3F3F3F3FULL; |
68 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_81 ) = 0x8181818181818181ULL; | 68 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_81 ) = 0x8181818181818181ULL; |
69 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_A1 ) = 0xA1A1A1A1A1A1A1A1ULL; | 69 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_A1 ) = 0xA1A1A1A1A1A1A1A1ULL; |
70 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_FC ) = 0xFCFCFCFCFCFCFCFCULL; | 70 DECLARE_ALIGNED_8 (const uint64_t, ff_pb_FC ) = 0xFCFCFCFCFCFCFCFCULL; |
71 | 71 |
72 DECLARE_ALIGNED_16(const double, ff_pd_1[2]) = { 1.0, 1.0 }; | 72 DECLARE_ALIGNED_16(const double, ff_pd_1)[2] = { 1.0, 1.0 }; |
73 DECLARE_ALIGNED_16(const double, ff_pd_2[2]) = { 2.0, 2.0 }; | 73 DECLARE_ALIGNED_16(const double, ff_pd_2)[2] = { 2.0, 2.0 }; |
74 | 74 |
75 #define JUMPALIGN() __asm__ volatile (ASMALIGN(3)::) | 75 #define JUMPALIGN() __asm__ volatile (ASMALIGN(3)::) |
76 #define MOVQ_ZERO(regd) __asm__ volatile ("pxor %%" #regd ", %%" #regd ::) | 76 #define MOVQ_ZERO(regd) __asm__ volatile ("pxor %%" #regd ", %%" #regd ::) |
77 | 77 |
78 #define MOVQ_BFE(regd) \ | 78 #define MOVQ_BFE(regd) \ |
275 "movq %%mm6, (%0, %2) \n\t" | 275 "movq %%mm6, (%0, %2) \n\t" |
276 ::"r" (pix), "r" ((x86_reg)line_size), "r" ((x86_reg)line_size*3), "r"(p) | 276 ::"r" (pix), "r" ((x86_reg)line_size), "r" ((x86_reg)line_size*3), "r"(p) |
277 :"memory"); | 277 :"memory"); |
278 } | 278 } |
279 | 279 |
280 DECLARE_ASM_CONST(8, uint8_t, ff_vector128[8]) = | 280 DECLARE_ASM_CONST(8, uint8_t, ff_vector128)[8] = |
281 { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; | 281 { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }; |
282 | 282 |
283 #define put_signed_pixels_clamped_mmx_half(off) \ | 283 #define put_signed_pixels_clamped_mmx_half(off) \ |
284 "movq "#off"(%2), %%mm1 \n\t"\ | 284 "movq "#off"(%2), %%mm1 \n\t"\ |
285 "movq 16+"#off"(%2), %%mm2 \n\t"\ | 285 "movq 16+"#off"(%2), %%mm2 \n\t"\ |
752 } | 752 } |
753 | 753 |
754 static void h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale){ | 754 static void h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale){ |
755 if(CONFIG_H263_DECODER || CONFIG_H263_ENCODER) { | 755 if(CONFIG_H263_DECODER || CONFIG_H263_ENCODER) { |
756 const int strength= ff_h263_loop_filter_strength[qscale]; | 756 const int strength= ff_h263_loop_filter_strength[qscale]; |
757 DECLARE_ALIGNED(8, uint64_t, temp[4]); | 757 DECLARE_ALIGNED(8, uint64_t, temp)[4]; |
758 uint8_t *btemp= (uint8_t*)temp; | 758 uint8_t *btemp= (uint8_t*)temp; |
759 | 759 |
760 src -= 2; | 760 src -= 2; |
761 | 761 |
762 transpose4x4(btemp , src , 8, stride); | 762 transpose4x4(btemp , src , 8, stride); |
2024 if(in_ch == 5 && out_ch == 2 && !(matrix_cmp[0][1]|matrix_cmp[2][0]|matrix_cmp[3][1]|matrix_cmp[4][0]|(matrix_cmp[1][0]^matrix_cmp[1][1])|(matrix_cmp[0][0]^matrix_cmp[2][1]))) { | 2024 if(in_ch == 5 && out_ch == 2 && !(matrix_cmp[0][1]|matrix_cmp[2][0]|matrix_cmp[3][1]|matrix_cmp[4][0]|(matrix_cmp[1][0]^matrix_cmp[1][1])|(matrix_cmp[0][0]^matrix_cmp[2][1]))) { |
2025 MIX5(IF0,IF1); | 2025 MIX5(IF0,IF1); |
2026 } else if(in_ch == 5 && out_ch == 1 && matrix_cmp[0][0]==matrix_cmp[2][0] && matrix_cmp[3][0]==matrix_cmp[4][0]) { | 2026 } else if(in_ch == 5 && out_ch == 1 && matrix_cmp[0][0]==matrix_cmp[2][0] && matrix_cmp[3][0]==matrix_cmp[4][0]) { |
2027 MIX5(IF1,IF0); | 2027 MIX5(IF1,IF0); |
2028 } else { | 2028 } else { |
2029 DECLARE_ALIGNED_16(float, matrix_simd[in_ch][2][4]); | 2029 DECLARE_ALIGNED_16(float, matrix_simd)[in_ch][2][4]; |
2030 j = 2*in_ch*sizeof(float); | 2030 j = 2*in_ch*sizeof(float); |
2031 __asm__ volatile( | 2031 __asm__ volatile( |
2032 "1: \n" | 2032 "1: \n" |
2033 "sub $8, %0 \n" | 2033 "sub $8, %0 \n" |
2034 "movss (%2,%0), %%xmm6 \n" | 2034 "movss (%2,%0), %%xmm6 \n" |
2411 #define ff_float_to_int16_interleave6_sse2 ff_float_to_int16_interleave6_sse | 2411 #define ff_float_to_int16_interleave6_sse2 ff_float_to_int16_interleave6_sse |
2412 | 2412 |
2413 #define FLOAT_TO_INT16_INTERLEAVE(cpu, body) \ | 2413 #define FLOAT_TO_INT16_INTERLEAVE(cpu, body) \ |
2414 /* gcc pessimizes register allocation if this is in the same function as float_to_int16_interleave_sse2*/\ | 2414 /* gcc pessimizes register allocation if this is in the same function as float_to_int16_interleave_sse2*/\ |
2415 static av_noinline void float_to_int16_interleave_misc_##cpu(int16_t *dst, const float **src, long len, int channels){\ | 2415 static av_noinline void float_to_int16_interleave_misc_##cpu(int16_t *dst, const float **src, long len, int channels){\ |
2416 DECLARE_ALIGNED_16(int16_t, tmp[len]);\ | 2416 DECLARE_ALIGNED_16(int16_t, tmp)[len];\ |
2417 int i,j,c;\ | 2417 int i,j,c;\ |
2418 for(c=0; c<channels; c++){\ | 2418 for(c=0; c<channels; c++){\ |
2419 float_to_int16_##cpu(tmp, src[c], len);\ | 2419 float_to_int16_##cpu(tmp, src[c], len);\ |
2420 for(i=0, j=c; i<len; i++, j+=channels)\ | 2420 for(i=0, j=c; i<len; i++, j+=channels)\ |
2421 dst[j] = tmp[i];\ | 2421 dst[j] = tmp[i];\ |