Revision d343d598 libavcodec/x86/idct_mmx.c

View differences:

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