comparison libmpcodecs/vf_fspp.c @ 36726:ed1d856ec43d

Use DECLARE_ALIGNED helper macros. Patch by Matt Oliver [protogonoi gmail.com].
author reimar
date Sun, 09 Feb 2014 22:19:07 +0000
parents 68db224c2275
children cb58825b8571
comparison
equal deleted inserted replaced
36725:31138a69aee6 36726:ed1d856ec43d
73 56, 77, 74, 66, 56, 44, 30, 15, 73 56, 77, 74, 66, 56, 44, 30, 15,
74 38, 53, 50, 45, 38, 30, 21, 11, 74 38, 53, 50, 45, 38, 30, 21, 11,
75 20, 27, 26, 23, 20, 15, 11, 5 75 20, 27, 26, 23, 20, 15, 11, 5
76 }; 76 };
77 77
78 static const uint8_t __attribute__((aligned(32))) dither[8][8]={ 78 DECLARE_ASM_CONST(32, uint8_t, dither)[8][8]={
79 { 0, 48, 12, 60, 3, 51, 15, 63, }, 79 { 0, 48, 12, 60, 3, 51, 15, 63, },
80 { 32, 16, 44, 28, 35, 19, 47, 31, }, 80 { 32, 16, 44, 28, 35, 19, 47, 31, },
81 { 8, 56, 4, 52, 11, 59, 7, 55, }, 81 { 8, 56, 4, 52, 11, 59, 7, 55, },
82 { 40, 24, 36, 20, 43, 27, 39, 23, }, 82 { 40, 24, 36, 20, 43, 27, 39, 23, },
83 { 2, 50, 14, 62, 1, 49, 13, 61, }, 83 { 2, 50, 14, 62, 1, 49, 13, 61, },
414 { 414 {
415 int x, x0, y, es, qy, t; 415 int x, x0, y, es, qy, t;
416 const int stride= is_luma ? p->temp_stride : (width+16);//((width+16+15)&(~15)) 416 const int stride= is_luma ? p->temp_stride : (width+16);//((width+16+15)&(~15))
417 const int step=6-p->log2_count; 417 const int step=6-p->log2_count;
418 const int qps= 3 + is_luma; 418 const int qps= 3 + is_luma;
419 int32_t __attribute__((aligned(32))) block_align[4*8*BLOCKSZ+ 4*8*BLOCKSZ]; 419 DECLARE_ALIGNED(32, int32_t, block_align)[4*8*BLOCKSZ+ 4*8*BLOCKSZ];
420 int16_t *block= (int16_t *)block_align; 420 int16_t *block= (int16_t *)block_align;
421 int16_t *block3=(int16_t *)(block_align+4*8*BLOCKSZ); 421 int16_t *block3=(int16_t *)(block_align+4*8*BLOCKSZ);
422 422
423 memset(block3, 0, 4*8*BLOCKSZ); 423 memset(block3, 0, 4*8*BLOCKSZ);
424 424
871 871
872 #else /* HAVE_MMX */ 872 #else /* HAVE_MMX */
873 873
874 static void column_fidct_mmx(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt) 874 static void column_fidct_mmx(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt)
875 { 875 {
876 uint64_t __attribute__((aligned(8))) temps[4]; 876 DECLARE_ALIGNED(8, uint64_t, temps)[4];
877 __asm__ volatile( 877 __asm__ volatile(
878 ASMALIGN(4) 878 ASMALIGN(4)
879 "1: \n\t" 879 "1: \n\t"
880 "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t" 880 "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm1 \n\t"
881 // 881 //
1672 #else /* HAVE_MMX */ 1672 #else /* HAVE_MMX */
1673 1673
1674 static void row_idct_mmx (int16_t* workspace, 1674 static void row_idct_mmx (int16_t* workspace,
1675 int16_t* output_adr, int output_stride, int cnt) 1675 int16_t* output_adr, int output_stride, int cnt)
1676 { 1676 {
1677 uint64_t __attribute__((aligned(8))) temps[4]; 1677 DECLARE_ALIGNED(8, uint64_t, temps)[4];
1678 __asm__ volatile( 1678 __asm__ volatile(
1679 "lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t" 1679 "lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
1680 "1: \n\t" 1680 "1: \n\t"
1681 "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm0 \n\t" 1681 "movq "DCTSIZE_S"*0*2(%%"REG_S"), %%mm0 \n\t"
1682 // 1682 //
1938 1938
1939 #else /* HAVE_MMX */ 1939 #else /* HAVE_MMX */
1940 1940
1941 static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size, int cnt) 1941 static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size, int cnt)
1942 { 1942 {
1943 uint64_t __attribute__((aligned(8))) temps[4]; 1943 DECLARE_ALIGNED(8, uint64_t, temps)[4];
1944 __asm__ volatile( 1944 __asm__ volatile(
1945 "lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t" 1945 "lea (%%"REG_a",%%"REG_a",2), %%"REG_d" \n\t"
1946 "6: \n\t" 1946 "6: \n\t"
1947 "movd (%%"REG_S"), %%mm0 \n\t" 1947 "movd (%%"REG_S"), %%mm0 \n\t"
1948 "pxor %%mm7, %%mm7 \n\t" 1948 "pxor %%mm7, %%mm7 \n\t"