Revision d343d598

View differences:

Doxyfile
837 837

  
838 838
PREDEFINED             = __attribute__(x)="" "RENAME(x)=x ## _TMPL" "DEF(x)=x ## _TMPL" \
839 839
                         HAVE_AV_CONFIG_H HAVE_MMX HAVE_MMX2 HAVE_AMD3DNOW \
840
                         ATTR_ALIGN(x)=""
841 840

  
842 841
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
843 842
# this tag can be used to specify a list of macro names that should be expanded.
libavcodec/sparc/dsputil_vis.c
51 51
 *      fpsub16         f12, f10, f10
52 52
 */
53 53

  
54
#define ATTR_ALIGN(alignd) __attribute__ ((aligned(alignd)))
55

  
56 54
#define DUP4(x) {x, x, x, x}
57 55
#define DUP8(x) {x, x, x, x, x, x, x, x}
58
static const int16_t constants1[] ATTR_ALIGN(8) = DUP4 (1);
59
static const int16_t constants2[] ATTR_ALIGN(8) = DUP4 (2);
60
static const int16_t constants3[] ATTR_ALIGN(8) = DUP4 (3);
61
static const int16_t constants6[] ATTR_ALIGN(8) = DUP4 (6);
62
static const int8_t constants_fe[] ATTR_ALIGN(8) = DUP8 (0xfe);
63
static const int8_t constants_7f[] ATTR_ALIGN(8) = DUP8 (0x7f);
64
static const int8_t constants128[] ATTR_ALIGN(8) = DUP8 (128);
65
static const int16_t constants256_512[] ATTR_ALIGN(8) =
56
DECLARE_ALIGNED(8, static const int16_t, constants1)[] = DUP4 (1);
57
DECLARE_ALIGNED(8, static const int16_t, constants2)[] = DUP4 (2);
58
DECLARE_ALIGNED(8, static const int16_t, constants3)[] = DUP4 (3);
59
DECLARE_ALIGNED(8, static const int16_t, constants6)[] = DUP4 (6);
60
DECLARE_ALIGNED(8, static const int8_t, constants_fe)[] = DUP8 (0xfe);
61
DECLARE_ALIGNED(8, static const int8_t, constants_7f)[] = DUP8 (0x7f);
62
DECLARE_ALIGNED(8, static const int8_t, constants128)[] = DUP8 (128);
63
DECLARE_ALIGNED(8, static const int16_t, constants256_512)[] =
66 64
        {256, 512, 256, 512};
67
static const int16_t constants256_1024[] ATTR_ALIGN(8) =
65
DECLARE_ALIGNED(8, static const int16_t, constants256_1024)[] =
68 66
        {256, 1024, 256, 1024};
69 67

  
70 68
#define REF_0           0
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);
libavcodec/x86/idct_mmx.c
26 26
#include "dsputil_mmx.h"
27 27
#include "mmx.h"
28 28

  
29
#define ATTR_ALIGN(align) __attribute__ ((__aligned__ (align)))
30

  
31 29
#define ROW_SHIFT 11
32 30
#define COL_SHIFT 6
33 31

  
......
400 398
#define T3 43790
401 399
#define C4 23170
402 400

  
403
    static const short t1_vector[] ATTR_ALIGN(8) = {T1,T1,T1,T1};
404
    static const short t2_vector[] ATTR_ALIGN(8) = {T2,T2,T2,T2};
405
    static const short t3_vector[] ATTR_ALIGN(8) = {T3,T3,T3,T3};
406
    static const short c4_vector[] ATTR_ALIGN(8) = {C4,C4,C4,C4};
401
    DECLARE_ALIGNED(8, static const short, t1_vector)[] = {T1,T1,T1,T1};
402
    DECLARE_ALIGNED(8, static const short, t2_vector)[] = {T2,T2,T2,T2};
403
    DECLARE_ALIGNED(8, static const short, t3_vector)[] = {T3,T3,T3,T3};
404
    DECLARE_ALIGNED(8, static const short, c4_vector)[] = {C4,C4,C4,C4};
407 405

  
408 406
    /* column code adapted from Peter Gubanov */
409 407
    /* http://www.elecard.com/peter/idct.shtml */
......
542 540
}
543 541

  
544 542

  
545
static const int32_t rounder0[] ATTR_ALIGN(8) =
543
DECLARE_ALIGNED(8, static const int32_t, rounder0)[] =
546 544
    rounder ((1 << (COL_SHIFT - 1)) - 0.5);
547
static const int32_t rounder4[] ATTR_ALIGN(8) = rounder (0);
548
static const int32_t rounder1[] ATTR_ALIGN(8) =
545
DECLARE_ALIGNED(8, static const int32_t, rounder4)[] = rounder (0);
546
DECLARE_ALIGNED(8, static const int32_t, rounder1)[] =
549 547
    rounder (1.25683487303);        /* C1*(C1/C4+C1+C7)/2 */
550
static const int32_t rounder7[] ATTR_ALIGN(8) =
548
DECLARE_ALIGNED(8, static const int32_t, rounder7)[] =
551 549
    rounder (-0.25);                /* C1*(C7/C4+C7-C1)/2 */
552
static const int32_t rounder2[] ATTR_ALIGN(8) =
550
DECLARE_ALIGNED(8, static const int32_t, rounder2)[] =
553 551
    rounder (0.60355339059);        /* C2 * (C6+C2)/2 */
554
static const int32_t rounder6[] ATTR_ALIGN(8) =
552
DECLARE_ALIGNED(8, static const int32_t, rounder6)[] =
555 553
    rounder (-0.25);                /* C2 * (C6-C2)/2 */
556
static const int32_t rounder3[] ATTR_ALIGN(8) =
554
DECLARE_ALIGNED(8, static const int32_t, rounder3)[] =
557 555
    rounder (0.087788325588);       /* C3*(-C3/C4+C3+C5)/2 */
558
static const int32_t rounder5[] ATTR_ALIGN(8) =
556
DECLARE_ALIGNED(8, static const int32_t, rounder5)[] =
559 557
    rounder (-0.441341716183);      /* C3*(-C5/C4+C5-C3)/2 */
560 558

  
561 559
#undef COL_SHIFT
......
564 562
#define declare_idct(idct,table,idct_row_head,idct_row,idct_row_tail,idct_row_mid) \
565 563
void idct (int16_t * const block)                                       \
566 564
{                                                                       \
567
    static const int16_t table04[] ATTR_ALIGN(16) =                     \
565
    DECLARE_ALIGNED(16, static const int16_t, table04)[] =              \
568 566
        table (22725, 21407, 19266, 16384, 12873,  8867, 4520);         \
569
    static const int16_t table17[] ATTR_ALIGN(16) =                     \
567
    DECLARE_ALIGNED(16, static const int16_t, table17)[] =              \
570 568
        table (31521, 29692, 26722, 22725, 17855, 12299, 6270);         \
571
    static const int16_t table26[] ATTR_ALIGN(16) =                     \
569
    DECLARE_ALIGNED(16, static const int16_t, table26)[] =              \
572 570
        table (29692, 27969, 25172, 21407, 16819, 11585, 5906);         \
573
    static const int16_t table35[] ATTR_ALIGN(16) =                     \
571
    DECLARE_ALIGNED(16, static const int16_t, table35)[] =              \
574 572
        table (26722, 25172, 22654, 19266, 15137, 10426, 5315);         \
575 573
                                                                        \
576 574
    idct_row_head (block, 0*8, table04);                                \

Also available in: Unified diff