Revision 525ac37f

View differences:

libavcodec/mpegaudiodec.c
528 528
/* butterfly operator */
529 529
#define BF(a, b, c, s)\
530 530
{\
531
    tmp0 = val##a + val##b;\
532
    tmp1 = val##a - val##b;\
533
    val##a = tmp0;\
534
    val##b = MULH3(tmp1, c, 1<<(s));\
535
}
536

  
537
#define BF0(a, b, c, s)\
538
{\
531 539
    tmp0 = tab[a] + tab[b];\
532 540
    tmp1 = tab[a] - tab[b];\
533
    tab[a] = tmp0;\
534
    tab[b] = MULH3(tmp1, c, 1<<(s));\
541
    val##a = tmp0;\
542
    val##b = MULH3(tmp1, c, 1<<(s));\
535 543
}
536 544

  
537 545
#define BF1(a, b, c, d)\
538 546
{\
539 547
    BF(a, b, COS4_0, 1);\
540 548
    BF(c, d,-COS4_0, 1);\
541
    tab[c] += tab[d];\
549
    val##c += val##d;\
542 550
}
543 551

  
544 552
#define BF2(a, b, c, d)\
545 553
{\
546 554
    BF(a, b, COS4_0, 1);\
547 555
    BF(c, d,-COS4_0, 1);\
548
    tab[c] += tab[d];\
549
    tab[a] += tab[c];\
550
    tab[c] += tab[b];\
551
    tab[b] += tab[d];\
556
    val##c += val##d;\
557
    val##a += val##c;\
558
    val##c += val##b;\
559
    val##b += val##d;\
552 560
}
553 561

  
554
#define ADD(a, b) tab[a] += tab[b]
562
#define ADD(a, b) val##a += val##b
555 563

  
556 564
/* DCT32 without 1/sqrt(2) coef zero scaling. */
557
static void dct32(INTFLOAT *out, INTFLOAT *tab)
565
static void dct32(INTFLOAT *out, const INTFLOAT *tab)
558 566
{
559 567
    INTFLOAT tmp0, tmp1;
560 568

  
569
    INTFLOAT val0 , val1 , val2 , val3 , val4 , val5 , val6 , val7 ,
570
             val8 , val9 , val10, val11, val12, val13, val14, val15,
571
             val16, val17, val18, val19, val20, val21, val22, val23,
572
             val24, val25, val26, val27, val28, val29, val30, val31;
573

  
561 574
    /* pass 1 */
562
    BF( 0, 31, COS0_0 , 1);
563
    BF(15, 16, COS0_15, 5);
575
    BF0( 0, 31, COS0_0 , 1);
576
    BF0(15, 16, COS0_15, 5);
564 577
    /* pass 2 */
565 578
    BF( 0, 15, COS1_0 , 1);
566 579
    BF(16, 31,-COS1_0 , 1);
567 580
    /* pass 1 */
568
    BF( 7, 24, COS0_7 , 1);
569
    BF( 8, 23, COS0_8 , 1);
581
    BF0( 7, 24, COS0_7 , 1);
582
    BF0( 8, 23, COS0_8 , 1);
570 583
    /* pass 2 */
571 584
    BF( 7,  8, COS1_7 , 4);
572 585
    BF(23, 24,-COS1_7 , 4);
......
576 589
    BF(16, 23, COS2_0 , 1);
577 590
    BF(24, 31,-COS2_0 , 1);
578 591
    /* pass 1 */
579
    BF( 3, 28, COS0_3 , 1);
580
    BF(12, 19, COS0_12, 2);
592
    BF0( 3, 28, COS0_3 , 1);
593
    BF0(12, 19, COS0_12, 2);
581 594
    /* pass 2 */
582 595
    BF( 3, 12, COS1_3 , 1);
583 596
    BF(19, 28,-COS1_3 , 1);
584 597
    /* pass 1 */
585
    BF( 4, 27, COS0_4 , 1);
586
    BF(11, 20, COS0_11, 2);
598
    BF0( 4, 27, COS0_4 , 1);
599
    BF0(11, 20, COS0_11, 2);
587 600
    /* pass 2 */
588 601
    BF( 4, 11, COS1_4 , 1);
589 602
    BF(20, 27,-COS1_4 , 1);
......
605 618

  
606 619

  
607 620
    /* pass 1 */
608
    BF( 1, 30, COS0_1 , 1);
609
    BF(14, 17, COS0_14, 3);
621
    BF0( 1, 30, COS0_1 , 1);
622
    BF0(14, 17, COS0_14, 3);
610 623
    /* pass 2 */
611 624
    BF( 1, 14, COS1_1 , 1);
612 625
    BF(17, 30,-COS1_1 , 1);
613 626
    /* pass 1 */
614
    BF( 6, 25, COS0_6 , 1);
615
    BF( 9, 22, COS0_9 , 1);
627
    BF0( 6, 25, COS0_6 , 1);
628
    BF0( 9, 22, COS0_9 , 1);
616 629
    /* pass 2 */
617 630
    BF( 6,  9, COS1_6 , 2);
618 631
    BF(22, 25,-COS1_6 , 2);
......
623 636
    BF(25, 30,-COS2_1 , 1);
624 637

  
625 638
    /* pass 1 */
626
    BF( 2, 29, COS0_2 , 1);
627
    BF(13, 18, COS0_13, 3);
639
    BF0( 2, 29, COS0_2 , 1);
640
    BF0(13, 18, COS0_13, 3);
628 641
    /* pass 2 */
629 642
    BF( 2, 13, COS1_2 , 1);
630 643
    BF(18, 29,-COS1_2 , 1);
631 644
    /* pass 1 */
632
    BF( 5, 26, COS0_5 , 1);
633
    BF(10, 21, COS0_10, 1);
645
    BF0( 5, 26, COS0_5 , 1);
646
    BF0(10, 21, COS0_10, 1);
634 647
    /* pass 2 */
635 648
    BF( 5, 10, COS1_5 , 2);
636 649
    BF(21, 26,-COS1_5 , 2);
......
669 682
    ADD(13, 11);
670 683
    ADD(11, 15);
671 684

  
672
    out[ 0] = tab[0];
673
    out[16] = tab[1];
674
    out[ 8] = tab[2];
675
    out[24] = tab[3];
676
    out[ 4] = tab[4];
677
    out[20] = tab[5];
678
    out[12] = tab[6];
679
    out[28] = tab[7];
680
    out[ 2] = tab[8];
681
    out[18] = tab[9];
682
    out[10] = tab[10];
683
    out[26] = tab[11];
684
    out[ 6] = tab[12];
685
    out[22] = tab[13];
686
    out[14] = tab[14];
687
    out[30] = tab[15];
685
    out[ 0] = val0;
686
    out[16] = val1;
687
    out[ 8] = val2;
688
    out[24] = val3;
689
    out[ 4] = val4;
690
    out[20] = val5;
691
    out[12] = val6;
692
    out[28] = val7;
693
    out[ 2] = val8;
694
    out[18] = val9;
695
    out[10] = val10;
696
    out[26] = val11;
697
    out[ 6] = val12;
698
    out[22] = val13;
699
    out[14] = val14;
700
    out[30] = val15;
688 701

  
689 702
    ADD(24, 28);
690 703
    ADD(28, 26);
......
694 707
    ADD(29, 27);
695 708
    ADD(27, 31);
696 709

  
697
    out[ 1] = tab[16] + tab[24];
698
    out[17] = tab[17] + tab[25];
699
    out[ 9] = tab[18] + tab[26];
700
    out[25] = tab[19] + tab[27];
701
    out[ 5] = tab[20] + tab[28];
702
    out[21] = tab[21] + tab[29];
703
    out[13] = tab[22] + tab[30];
704
    out[29] = tab[23] + tab[31];
705
    out[ 3] = tab[24] + tab[20];
706
    out[19] = tab[25] + tab[21];
707
    out[11] = tab[26] + tab[22];
708
    out[27] = tab[27] + tab[23];
709
    out[ 7] = tab[28] + tab[18];
710
    out[23] = tab[29] + tab[19];
711
    out[15] = tab[30] + tab[17];
712
    out[31] = tab[31];
710
    out[ 1] = val16 + val24;
711
    out[17] = val17 + val25;
712
    out[ 9] = val18 + val26;
713
    out[25] = val19 + val27;
714
    out[ 5] = val20 + val28;
715
    out[21] = val21 + val29;
716
    out[13] = val22 + val30;
717
    out[29] = val23 + val31;
718
    out[ 3] = val24 + val20;
719
    out[19] = val25 + val21;
720
    out[11] = val26 + val22;
721
    out[27] = val27 + val23;
722
    out[ 7] = val28 + val18;
723
    out[23] = val29 + val19;
724
    out[15] = val30 + val17;
725
    out[31] = val31;
713 726
}
714 727

  
715 728
#if CONFIG_FLOAT

Also available in: Unified diff