Revision d343d598 libavcodec/x86/fdct_mmx.c

View differences:

libavcodec/x86/fdct_mmx.c
33 33
#include "libavutil/common.h"
34 34
#include "libavcodec/dsputil.h"
35 35

  
36
#define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align)))
37

  
38 36
//////////////////////////////////////////////////////////////////////
39 37
//
40 38
// constants for the forward DCT
......
55 53
#define X8(x) x,x,x,x,x,x,x,x
56 54

  
57 55
//concatenated table, for forward DCT transformation
58
static const int16_t fdct_tg_all_16[24] ATTR_ALIGN(16) = {
56
DECLARE_ALIGNED(16, static const int16_t, fdct_tg_all_16)[24] = {
59 57
    X8(13036),  // tg * (2<<16) + 0.5
60 58
    X8(27146),  // tg * (2<<16) + 0.5
61 59
    X8(-21746)  // tg * (2<<16) + 0.5
62 60
};
63 61

  
64
static const int16_t ocos_4_16[8] ATTR_ALIGN(16) = {
62
DECLARE_ALIGNED(16, static const int16_t, ocos_4_16)[8] = {
65 63
    X8(23170)   //cos * (2<<15) + 0.5
66 64
};
67 65

  
68
static const int16_t fdct_one_corr[8] ATTR_ALIGN(16) = { X8(1) };
66
DECLARE_ALIGNED(16, static const int16_t, fdct_one_corr)[8] = { X8(1) };
69 67

  
70
static const int32_t fdct_r_row[2] ATTR_ALIGN(8) = {RND_FRW_ROW, RND_FRW_ROW };
68
DECLARE_ALIGNED(8, static const int32_t, fdct_r_row)[2] = {RND_FRW_ROW, RND_FRW_ROW };
71 69

  
72 70
static struct
73 71
{
74
 const int32_t fdct_r_row_sse2[4] ATTR_ALIGN(16);
75
} fdct_r_row_sse2 ATTR_ALIGN(16)=
72
 DECLARE_ALIGNED(16, const int32_t, fdct_r_row_sse2)[4];
73
} fdct_r_row_sse2 =
76 74
{{
77 75
 RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW
78 76
}};
79
//static const long fdct_r_row_sse2[4] ATTR_ALIGN(16) = {RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW};
77
//DECLARE_ALIGNED(16, static const long, fdct_r_row_sse2)[4] = {RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW, RND_FRW_ROW};
80 78

  
81
static const int16_t tab_frw_01234567[] ATTR_ALIGN(8) = {  // forward_dct coeff table
79
DECLARE_ALIGNED(8, static const int16_t, tab_frw_01234567)[] = {  // forward_dct coeff table
82 80
  16384,   16384,   22725,   19266,
83 81
  16384,   16384,   12873,    4520,
84 82
  21407,    8867,   19266,   -4520,
......
154 152

  
155 153
static struct
156 154
{
157
 const int16_t tab_frw_01234567_sse2[256] ATTR_ALIGN(16);
158
} tab_frw_01234567_sse2 ATTR_ALIGN(16) =
155
 DECLARE_ALIGNED(16, const int16_t, tab_frw_01234567_sse2)[256];
156
} tab_frw_01234567_sse2 =
159 157
{{
160
//static const int16_t tab_frw_01234567_sse2[] ATTR_ALIGN(16) = {  // forward_dct coeff table
158
//DECLARE_ALIGNED(16, static const int16_t, tab_frw_01234567_sse2)[] = {  // forward_dct coeff table
161 159
#define TABLE_SSE2 C4,  C4,  C1,  C3, -C6, -C2, -C1, -C5, \
162 160
                   C4,  C4,  C5,  C7,  C2,  C6,  C3, -C7, \
163 161
                  -C4,  C4,  C7,  C3,  C6, -C2,  C7, -C5, \
......
535 533

  
536 534
void ff_fdct_mmx(int16_t *block)
537 535
{
538
    int64_t align_tmp[16] ATTR_ALIGN(8);
536
    DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
539 537
    int16_t * block1= (int16_t*)align_tmp;
540 538
    const int16_t *table= tab_frw_01234567;
541 539
    int i;
......
553 551

  
554 552
void ff_fdct_mmx2(int16_t *block)
555 553
{
556
    int64_t align_tmp[16] ATTR_ALIGN(8);
554
    DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
557 555
    int16_t *block1= (int16_t*)align_tmp;
558 556
    const int16_t *table= tab_frw_01234567;
559 557
    int i;
......
571 569

  
572 570
void ff_fdct_sse2(int16_t *block)
573 571
{
574
    int64_t align_tmp[16] ATTR_ALIGN(16);
572
    DECLARE_ALIGNED(16, int64_t, align_tmp)[16];
575 573
    int16_t * const block1= (int16_t*)align_tmp;
576 574

  
577 575
    fdct_col_sse2(block, block1, 0);

Also available in: Unified diff