Mercurial > libavcodec.hg
comparison mpegaudiodec.c @ 3602:38b7b3629249 libavcodec
indent preprocessor directives
author | michael |
---|---|
date | Tue, 22 Aug 2006 11:16:47 +0000 |
parents | 99a352dc1601 |
children | 42b6cefc6c1a |
comparison
equal
deleted
inserted
replaced
3601:99a352dc1601 | 3602:38b7b3629249 |
---|---|
34 */ | 34 */ |
35 | 35 |
36 /* define USE_HIGHPRECISION to have a bit exact (but slower) mpeg | 36 /* define USE_HIGHPRECISION to have a bit exact (but slower) mpeg |
37 audio decoder */ | 37 audio decoder */ |
38 #ifdef CONFIG_MPEGAUDIO_HP | 38 #ifdef CONFIG_MPEGAUDIO_HP |
39 #define USE_HIGHPRECISION | 39 # define USE_HIGHPRECISION |
40 #endif | 40 #endif |
41 | 41 |
42 #include "mpegaudio.h" | 42 #include "mpegaudio.h" |
43 | 43 |
44 #define FRAC_ONE (1 << FRAC_BITS) | 44 #define FRAC_ONE (1 << FRAC_BITS) |
748 else if (sum1 > OUT_MAX) | 748 else if (sum1 > OUT_MAX) |
749 sum1 = OUT_MAX; | 749 sum1 = OUT_MAX; |
750 return sum1; | 750 return sum1; |
751 } | 751 } |
752 | 752 |
753 #if defined(ARCH_POWERPC_405) | 753 # if defined(ARCH_POWERPC_405) |
754 | 754 /* signed 16x16 -> 32 multiply add accumulate */ |
755 /* signed 16x16 -> 32 multiply add accumulate */ | 755 # define MACS(rt, ra, rb) \ |
756 #define MACS(rt, ra, rb) \ | 756 asm ("maclhw %0, %2, %3" : "=r" (rt) : "0" (rt), "r" (ra), "r" (rb)); |
757 asm ("maclhw %0, %2, %3" : "=r" (rt) : "0" (rt), "r" (ra), "r" (rb)); | 757 |
758 | 758 /* signed 16x16 -> 32 multiply */ |
759 /* signed 16x16 -> 32 multiply */ | 759 # define MULS(ra, rb) \ |
760 #define MULS(ra, rb) \ | 760 ({ int __rt; asm ("mullhw %0, %1, %2" : "=r" (__rt) : "r" (ra), "r" (rb)); __rt; }) |
761 ({ int __rt; asm ("mullhw %0, %1, %2" : "=r" (__rt) : "r" (ra), "r" (rb)); __rt; }) | 761 # else |
762 | 762 /* signed 16x16 -> 32 multiply add accumulate */ |
763 #else | 763 # define MACS(rt, ra, rb) rt += (ra) * (rb) |
764 | 764 |
765 /* signed 16x16 -> 32 multiply add accumulate */ | 765 /* signed 16x16 -> 32 multiply */ |
766 #define MACS(rt, ra, rb) rt += (ra) * (rb) | 766 # define MULS(ra, rb) ((ra) * (rb)) |
767 | 767 # endif |
768 /* signed 16x16 -> 32 multiply */ | |
769 #define MULS(ra, rb) ((ra) * (rb)) | |
770 | |
771 #endif | |
772 | |
773 #else | 768 #else |
774 | 769 |
775 static inline int round_sample(int64_t *sum) | 770 static inline int round_sample(int64_t *sum) |
776 { | 771 { |
777 int sum1; | 772 int sum1; |
782 else if (sum1 > OUT_MAX) | 777 else if (sum1 > OUT_MAX) |
783 sum1 = OUT_MAX; | 778 sum1 = OUT_MAX; |
784 return sum1; | 779 return sum1; |
785 } | 780 } |
786 | 781 |
787 #ifdef ARCH_X86 | 782 # ifdef ARCH_X86 |
788 /* ask gcc devels why this is 3 times faster then the generic code below */ | 783 /* ask gcc devels why this is 3 times faster then the generic code below */ |
789 #define MULS(ra, rb) \ | 784 # define MULS(ra, rb) \ |
790 ({ int64_t rt; asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb)); rt; }) | 785 ({ int64_t rt; asm ("imull %2\n\t" : "=A"(rt) : "a" (ra), "g" (rb)); rt; }) |
791 #else | 786 # else |
792 #define MULS(ra, rb) MUL64(ra, rb) | 787 # define MULS(ra, rb) MUL64(ra, rb) |
793 #endif | 788 # endif |
794 #endif | 789 #endif |
795 | 790 |
796 #define SUM8(sum, op, w, p) \ | 791 #define SUM8(sum, op, w, p) \ |
797 { \ | 792 { \ |
798 sum op MULS((w)[0 * 64], p[0 * 64]);\ | 793 sum op MULS((w)[0 * 64], p[0 * 64]);\ |