This functionality is better accessed through tools like oprofile. Originally committed as revision 23808 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -211,8 +211,6 @@ Advanced options (experts only): · 210 unmodified lines | ||
| 211 | 211 | --arch=ARCH select architecture [$arch] |
| 212 | 212 | --cpu=CPU select the minimum required CPU (affects |
| 213 | 213 | instruction selection, may crash on older CPUs) |
| 214 | − --enable-powerpc-perf enable performance report on PPC | |
| 215 | − (requires enabling PMC) | |
| 216 | 214 | --disable-asm disable all assembler optimizations |
| 217 | 215 | --disable-altivec disable AltiVec optimizations |
| 218 | 216 | --disable-amd3dnow disable 3DNow! optimizations |
| @@ -886,7 +884,6 @@ CONFIG_LIST=" · 667 unmodified lines | ||
| 886 | 884 | nonfree |
| 887 | 885 | pic |
| 888 | 886 | postproc |
| 889 | − powerpc_perf | |
| 890 | 887 | rdft |
| 891 | 888 | runtime_cpudetect |
| 892 | 889 | shared |
| @@ -2772,7 +2769,6 @@ if enabled ppc; then · 1879 unmodified lines | ||
| 2772 | 2769 | echo "AltiVec enabled ${altivec-no}" |
| 2773 | 2770 | echo "PPC 4xx optimizations ${ppc4xx-no}" |
| 2774 | 2771 | echo "dcbzl available ${dcbzl-no}" |
| 2775 | − echo "performance report ${powerpc_perf-no}" | |
| 2776 | 2772 | fi |
| 2777 | 2773 | if enabled sparc; then |
| 2778 | 2774 | echo "VIS enabled ${vis-no}" |
| @@ -1,172 +0,0 @@ | ||
| 1 | −FFmpeg & evaluating performance on the PowerPC Architecture HOWTO | |
| 2 | − | |
| 3 | −(c) 2003-2004 Romain Dolbeau <romain@dolbeau.org> | |
| 4 | − | |
| 5 | − | |
| 6 | − | |
| 7 | −I - Introduction | |
| 8 | − | |
| 9 | −The PowerPC architecture and its SIMD extension AltiVec offer some | |
| 10 | −interesting tools to evaluate performance and improve the code. | |
| 11 | −This document tries to explain how to use those tools with FFmpeg. | |
| 12 | − | |
| 13 | −The architecture itself offers two ways to evaluate the performance of | |
| 14 | −a given piece of code: | |
| 15 | − | |
| 16 | −1) The Time Base Registers (TBL) | |
| 17 | −2) The Performance Monitor Counter Registers (PMC) | |
| 18 | − | |
| 19 | −The first ones are always available, always active, but they're not very | |
| 20 | −accurate: the registers increment by one every four *bus* cycles. On | |
| 21 | −my 667 Mhz tiBook (ppc7450), this means once every twenty *processor* | |
| 22 | −cycles. So we won't use that. | |
| 23 | − | |
| 24 | −The PMC are much more useful: not only can they report cycle-accurate | |
| 25 | −timing, but they can also be used to monitor many other parameters, | |
| 26 | −such as the number of AltiVec stalls for every kind of instruction, | |
| 27 | −or instruction cache misses. The downside is that not all processors | |
| 28 | −support the PMC (all G3, all G4 and the 970 do support them), and | |
| 29 | −they're inactive by default - you need to activate them with a | |
| 30 | −dedicated tool. Also, the number of available PMC depends on the | |
| 31 | −procesor: the various 604 have 2, the various 75x (aka. G3) have 4, | |
| 32 | −and the various 74xx (aka G4) have 6. | |
| 33 | − | |
| 34 | −*WARNING*: The PowerPC 970 is not very well documented, and its PMC | |
| 35 | −registers are 64 bits wide. To properly notify the code, you *must* | |
| 36 | −tune for the 970 (using --tune=970), or the code will assume 32 bit | |
| 37 | −registers. | |
| 38 | − | |
| 39 | − | |
| 40 | −II - Enabling FFmpeg PowerPC performance support | |
| 41 | − | |
| 42 | −This needs to be done by hand. First, you need to configure FFmpeg as | |
| 43 | −usual, but add the "--powerpc-perf-enable" option. For instance: | |
| 44 | − | |
| 45 | −##### | |
| 46 | −./configure --prefix=/usr/local/ffmpeg-svn --cc=gcc-3.3 --tune=7450 --powerpc-perf-enable | |
| 47 | −##### | |
| 48 | − | |
| 49 | −This will configure FFmpeg to install inside /usr/local/ffmpeg-svn, | |
| 50 | −compiling with gcc-3.3 (you should try to use this one or a newer | |
| 51 | −gcc), and tuning for the PowerPC 7450 (i.e. the newer G4; as a rule of | |
| 52 | −thumb, those at 550Mhz and more). It will also enable the PMC. | |
| 53 | − | |
| 54 | −You may also edit the file "config.h" to enable the following line: | |
| 55 | − | |
| 56 | −##### | |
| 57 | −// #define ALTIVEC_USE_REFERENCE_C_CODE 1 | |
| 58 | −##### | |
| 59 | − | |
| 60 | −If you enable this line, then the code will not make use of AltiVec, | |
| 61 | −but will use the reference C code instead. This is useful to compare | |
| 62 | −performance between two versions of the code. | |
| 63 | − | |
| 64 | −Also, the number of enabled PMC is defined in "libavcodec/ppc/dsputil_ppc.h": | |
| 65 | − | |
| 66 | −##### | |
| 67 | −#define POWERPC_NUM_PMC_ENABLED 4 | |
| 68 | −##### | |
| 69 | − | |
| 70 | −If you have a G4 CPU, you can enable all 6 PMC. DO NOT enable more | |
| 71 | −PMC than available on your CPU! | |
| 72 | − | |
| 73 | −Then, simply compile FFmpeg as usual (make && make install). | |
| 74 | − | |
| 75 | − | |
| 76 | − | |
| 77 | −III - Using FFmpeg PowerPC performance support | |
| 78 | − | |
| 79 | −This FFmeg can be used exactly as usual. But before exiting, FFmpeg | |
| 80 | −will dump a per-function report that looks like this: | |
| 81 | − | |
| 82 | −##### | |
| 83 | −PowerPC performance report | |
| 84 | − Values are from the PMC registers, and represent whatever the | |
| 85 | − registers are set to record. | |
| 86 | − Function "gmc1_altivec" (pmc1): | |
| 87 | − min: 231 | |
| 88 | − max: 1339867 | |
| 89 | − avg: 558.25 (255302) | |
| 90 | − Function "gmc1_altivec" (pmc2): | |
| 91 | − min: 93 | |
| 92 | − max: 2164 | |
| 93 | − avg: 267.31 (255302) | |
| 94 | − Function "gmc1_altivec" (pmc3): | |
| 95 | − min: 72 | |
| 96 | − max: 1987 | |
| 97 | − avg: 276.20 (255302) | |
| 98 | −(...) | |
| 99 | −##### | |
| 100 | − | |
| 101 | −In this example, PMC1 was set to record CPU cycles, PMC2 was set to | |
| 102 | −record AltiVec Permute Stall Cycles, and PMC3 was set to record AltiVec | |
| 103 | −Issue Stalls. | |
| 104 | − | |
| 105 | −The function "gmc1_altivec" was monitored 255302 times, and the | |
| 106 | −minimum execution time was 231 processor cycles. The max and average | |
| 107 | −aren't much use, as it's very likely the OS interrupted execution for | |
| 108 | −reasons of its own :-( | |
| 109 | − | |
| 110 | −With the exact same settings and source file, but using the reference C | |
| 111 | −code we get: | |
| 112 | − | |
| 113 | −##### | |
| 114 | −PowerPC performance report | |
| 115 | − Values are from the PMC registers, and represent whatever the | |
| 116 | − registers are set to record. | |
| 117 | − Function "gmc1_altivec" (pmc1): | |
| 118 | − min: 592 | |
| 119 | − max: 2532235 | |
| 120 | − avg: 962.88 (255302) | |
| 121 | − Function "gmc1_altivec" (pmc2): | |
| 122 | − min: 0 | |
| 123 | − max: 33 | |
| 124 | − avg: 0.00 (255302) | |
| 125 | − Function "gmc1_altivec" (pmc3): | |
| 126 | − min: 0 | |
| 127 | − max: 350 | |
| 128 | − avg: 0.03 (255302) | |
| 129 | −(...) | |
| 130 | −##### | |
| 131 | − | |
| 132 | −592 cycles, so the fastest AltiVec execution is about 2.5x faster than | |
| 133 | −the fastest C execution in this example. It's not perfect but it's not | |
| 134 | −bad (well I wrote this function so I can't say otherwise :-). | |
| 135 | − | |
| 136 | −Once you have that kind of report, you can try to improve things by | |
| 137 | −finding what goes wrong and fixing it; in the example above, one | |
| 138 | −should try to diminish the number of AltiVec stalls, as this *may* | |
| 139 | −improve performance. | |
| 140 | − | |
| 141 | − | |
| 142 | − | |
| 143 | −IV) Enabling the PMC in Mac OS X | |
| 144 | − | |
| 145 | −This is easy. Use "Monster" and "monster". Those tools come from | |
| 146 | −Apple's CHUD package, and can be found hidden in the developer web | |
| 147 | −site & FTP site. "MONster" is the graphical application, use it to | |
| 148 | −generate a config file specifying what each register should | |
| 149 | −monitor. Then use the command-line application "monster" to use that | |
| 150 | −config file, and enjoy the results. | |
| 151 | − | |
| 152 | −Note that "MONster" can be used for many other things, but it's | |
| 153 | −documented by Apple, it's not my subject. | |
| 154 | − | |
| 155 | −If you are using CHUD 4.4.2 or later, you'll notice that MONster is | |
| 156 | −no longer available. It's been superseeded by Shark, where | |
| 157 | −configuration of PMCs is available as a plugin. | |
| 158 | − | |
| 159 | − | |
| 160 | − | |
| 161 | −V) Enabling the PMC on Linux | |
| 162 | − | |
| 163 | −On linux you may use oprofile from http://oprofile.sf.net, depending on the | |
| 164 | −version and the cpu you may need to apply a patch[1] to access a set of the | |
| 165 | −possibile counters from the userspace application. You can always define them | |
| 166 | −using the kernel interface /dev/oprofile/* . | |
| 167 | − | |
| 168 | −[1] http://dev.gentoo.org/~lu_zero/development/oprofile-g4-20060423.patch | |
| 169 | − | |
| 170 | −-- | |
| 171 | −Romain Dolbeau <romain@dolbeau.org> | |
| 172 | −Luca Barbato <lu_zero@gentoo.org> | |
| @@ -618,11 +618,6 @@ static int av_exit(int ret) · 617 unmodified lines | ||
| 618 | 618 | |
| 619 | 619 | av_free(video_standard); |
| 620 | 620 | |
| 621 | −#if CONFIG_POWERPC_PERF | |
| 622 | − void powerpc_display_perf_report(void); | |
| 623 | − powerpc_display_perf_report(); | |
| 624 | −#endif /* CONFIG_POWERPC_PERF */ | |
| 625 | − | |
| 626 | 621 | for (i=0;i<AVMEDIA_TYPE_NB;i++) |
| 627 | 622 | av_free(avcodec_opts[i]); |
| 628 | 623 | av_free(avformat_opts); |
| @@ -25,7 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | #include <altivec.h> |
| 26 | 26 | #endif |
| 27 | 27 | #include "libavcodec/dsputil.h" |
| 28 | −#include "dsputil_ppc.h" | |
| 29 | 28 | #include "util_altivec.h" |
| 30 | 29 | #include "types_altivec.h" |
| 31 | 30 | #include "dsputil_altivec.h" |
| @@ -610,7 +609,6 @@ static void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w) { · 578 unmodified lines | ||
| 610 | 609 | /* next one assumes that ((line_size % 16) == 0) */ |
| 611 | 610 | void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
| 612 | 611 | { |
| 613 | −POWERPC_PERF_DECLARE(altivec_put_pixels16_num, 1); | |
| 614 | 612 | register vector unsigned char pixelsv1, pixelsv2; |
| 615 | 613 | register vector unsigned char pixelsv1B, pixelsv2B; |
| 616 | 614 | register vector unsigned char pixelsv1C, pixelsv2C; |
| @@ -622,7 +620,6 @@ POWERPC_PERF_DECLARE(altivec_put_pixels16_num, 1); · 5 unmodified lines | ||
| 622 | 620 | register int line_size_3 = line_size + line_size_2; |
| 623 | 621 | register int line_size_4 = line_size << 2; |
| 624 | 622 | |
| 625 | −POWERPC_PERF_START_COUNT(altivec_put_pixels16_num, 1); | |
| 626 | 623 | // hand-unrolling the loop by 4 gains about 15% |
| 627 | 624 | // mininum execution time goes from 74 to 60 cycles |
| 628 | 625 | // it's faster than -funroll-loops, but using |
| @@ -659,20 +656,16 @@ POWERPC_PERF_START_COUNT(altivec_put_pixels16_num, 1); · 30 unmodified lines | ||
| 659 | 656 | block +=line_size_4; |
| 660 | 657 | } |
| 661 | 658 | #endif |
| 662 | −POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_num, 1); | |
| 663 | 659 | } |
| 664 | 660 | |
| 665 | 661 | /* next one assumes that ((line_size % 16) == 0) */ |
| 666 | 662 | #define op_avg(a,b) a = ( ((a)|(b)) - ((((a)^(b))&0xFEFEFEFEUL)>>1) ) |
| 667 | 663 | void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
| 668 | 664 | { |
| 669 | −POWERPC_PERF_DECLARE(altivec_avg_pixels16_num, 1); | |
| 670 | 665 | register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv; |
| 671 | 666 | register vector unsigned char perm = vec_lvsl(0, pixels); |
| 672 | 667 | int i; |
| 673 | 668 | |
| 674 | −POWERPC_PERF_START_COUNT(altivec_avg_pixels16_num, 1); | |
| 675 | − | |
| 676 | 669 | for (i = 0; i < h; i++) { |
| 677 | 670 | pixelsv1 = vec_ld( 0, pixels); |
| 678 | 671 | pixelsv2 = vec_ld(16,pixels); |
| @@ -683,19 +676,14 @@ POWERPC_PERF_START_COUNT(altivec_avg_pixels16_num, 1); · 4 unmodified lines | ||
| 683 | 676 | pixels+=line_size; |
| 684 | 677 | block +=line_size; |
| 685 | 678 | } |
| 686 | − | |
| 687 | −POWERPC_PERF_STOP_COUNT(altivec_avg_pixels16_num, 1); | |
| 688 | 679 | } |
| 689 | 680 | |
| 690 | 681 | /* next one assumes that ((line_size % 8) == 0) */ |
| 691 | 682 | static void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h) |
| 692 | 683 | { |
| 693 | −POWERPC_PERF_DECLARE(altivec_avg_pixels8_num, 1); | |
| 694 | 684 | register vector unsigned char pixelsv1, pixelsv2, pixelsv, blockv; |
| 695 | 685 | int i; |
| 696 | 686 | |
| 697 | −POWERPC_PERF_START_COUNT(altivec_avg_pixels8_num, 1); | |
| 698 | − | |
| 699 | 687 | for (i = 0; i < h; i++) { |
| 700 | 688 | /* block is 8 bytes-aligned, so we're either in the |
| 701 | 689 | left block (16 bytes-aligned) or in the right block (not) */ |
| @@ -719,14 +707,11 @@ POWERPC_PERF_START_COUNT(altivec_avg_pixels8_num, 1); · 17 unmodified lines | ||
| 719 | 707 | pixels += line_size; |
| 720 | 708 | block += line_size; |
| 721 | 709 | } |
| 722 | − | |
| 723 | −POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_num, 1); | |
| 724 | 710 | } |
| 725 | 711 | |
| 726 | 712 | /* next one assumes that ((line_size % 8) == 0) */ |
| 727 | 713 | static void put_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
| 728 | 714 | { |
| 729 | −POWERPC_PERF_DECLARE(altivec_put_pixels8_xy2_num, 1); | |
| 730 | 715 | register int i; |
| 731 | 716 | register vector unsigned char pixelsv1, pixelsv2, pixelsavg; |
| 732 | 717 | register vector unsigned char blockv, temp1, temp2; |
| @@ -748,7 +733,6 @@ POWERPC_PERF_DECLARE(altivec_put_pixels8_xy2_num, 1); · 15 unmodified lines | ||
| 748 | 733 | (vector unsigned short)pixelsv2); |
| 749 | 734 | pixelssum1 = vec_add(pixelssum1, vctwo); |
| 750 | 735 | |
| 751 | −POWERPC_PERF_START_COUNT(altivec_put_pixels8_xy2_num, 1); | |
| 752 | 736 | for (i = 0; i < h ; i++) { |
| 753 | 737 | int rightside = ((unsigned long)block & 0x0000000F); |
| 754 | 738 | blockv = vec_ld(0, block); |
| @@ -782,14 +766,11 @@ POWERPC_PERF_START_COUNT(altivec_put_pixels8_xy2_num, 1); · 27 unmodified lines | ||
| 782 | 766 | block += line_size; |
| 783 | 767 | pixels += line_size; |
| 784 | 768 | } |
| 785 | − | |
| 786 | −POWERPC_PERF_STOP_COUNT(altivec_put_pixels8_xy2_num, 1); | |
| 787 | 769 | } |
| 788 | 770 | |
| 789 | 771 | /* next one assumes that ((line_size % 8) == 0) */ |
| 790 | 772 | static void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
| 791 | 773 | { |
| 792 | −POWERPC_PERF_DECLARE(altivec_put_no_rnd_pixels8_xy2_num, 1); | |
| 793 | 774 | register int i; |
| 794 | 775 | register vector unsigned char pixelsv1, pixelsv2, pixelsavg; |
| 795 | 776 | register vector unsigned char blockv, temp1, temp2; |
| @@ -812,7 +793,6 @@ POWERPC_PERF_DECLARE(altivec_put_no_rnd_pixels8_xy2_num, 1); · 16 unmodified lines | ||
| 812 | 793 | (vector unsigned short)pixelsv2); |
| 813 | 794 | pixelssum1 = vec_add(pixelssum1, vcone); |
| 814 | 795 | |
| 815 | −POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1); | |
| 816 | 796 | for (i = 0; i < h ; i++) { |
| 817 | 797 | int rightside = ((unsigned long)block & 0x0000000F); |
| 818 | 798 | blockv = vec_ld(0, block); |
| @@ -846,14 +826,11 @@ POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1); · 27 unmodified lines | ||
| 846 | 826 | block += line_size; |
| 847 | 827 | pixels += line_size; |
| 848 | 828 | } |
| 849 | − | |
| 850 | −POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels8_xy2_num, 1); | |
| 851 | 829 | } |
| 852 | 830 | |
| 853 | 831 | /* next one assumes that ((line_size % 16) == 0) */ |
| 854 | 832 | static void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h) |
| 855 | 833 | { |
| 856 | −POWERPC_PERF_DECLARE(altivec_put_pixels16_xy2_num, 1); | |
| 857 | 834 | register int i; |
| 858 | 835 | register vector unsigned char pixelsv1, pixelsv2, pixelsv3, pixelsv4; |
| 859 | 836 | register vector unsigned char blockv, temp1, temp2; |
| @@ -862,8 +839,6 @@ POWERPC_PERF_DECLARE(altivec_put_pixels16_xy2_num, 1); · 2 unmodified lines | ||
| 862 | 839 | register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0); |
| 863 | 840 | register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2); |
| 864 | 841 | |
| 865 | −POWERPC_PERF_START_COUNT(altivec_put_pixels16_xy2_num, 1); | |
| 866 | − | |
| 867 | 842 | temp1 = vec_ld(0, pixels); |
| 868 | 843 | temp2 = vec_ld(16, pixels); |
| 869 | 844 | pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels)); |
| @@ -919,14 +894,11 @@ POWERPC_PERF_START_COUNT(altivec_put_pixels16_xy2_num, 1); · 49 unmodified lines | ||
| 919 | 894 | block += line_size; |
| 920 | 895 | pixels += line_size; |
| 921 | 896 | } |
| 922 | − | |
| 923 | −POWERPC_PERF_STOP_COUNT(altivec_put_pixels16_xy2_num, 1); | |
| 924 | 897 | } |
| 925 | 898 | |
| 926 | 899 | /* next one assumes that ((line_size % 16) == 0) */ |
| 927 | 900 | static void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h) |
| 928 | 901 | { |
| 929 | −POWERPC_PERF_DECLARE(altivec_put_no_rnd_pixels16_xy2_num, 1); | |
| 930 | 902 | register int i; |
| 931 | 903 | register vector unsigned char pixelsv1, pixelsv2, pixelsv3, pixelsv4; |
| 932 | 904 | register vector unsigned char blockv, temp1, temp2; |
| @@ -936,8 +908,6 @@ POWERPC_PERF_DECLARE(altivec_put_no_rnd_pixels16_xy2_num, 1); · 3 unmodified lines | ||
| 936 | 908 | register const vector unsigned short vcone = (const vector unsigned short)vec_splat_u16(1); |
| 937 | 909 | register const vector unsigned short vctwo = (const vector unsigned short)vec_splat_u16(2); |
| 938 | 910 | |
| 939 | −POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1); | |
| 940 | − | |
| 941 | 911 | temp1 = vec_ld(0, pixels); |
| 942 | 912 | temp2 = vec_ld(16, pixels); |
| 943 | 913 | pixelsv1 = vec_perm(temp1, temp2, vec_lvsl(0, pixels)); |
| @@ -993,18 +963,14 @@ POWERPC_PERF_START_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1); · 49 unmodified lines | ||
| 993 | 963 | block += line_size; |
| 994 | 964 | pixels += line_size; |
| 995 | 965 | } |
| 996 | − | |
| 997 | −POWERPC_PERF_STOP_COUNT(altivec_put_no_rnd_pixels16_xy2_num, 1); | |
| 998 | 966 | } |
| 999 | 967 | |
| 1000 | 968 | static int hadamard8_diff8x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){ |
| 1001 | −POWERPC_PERF_DECLARE(altivec_hadamard8_diff8x8_num, 1); | |
| 1002 | 969 | int sum; |
| 1003 | 970 | register const vector unsigned char vzero = |
| 1004 | 971 | (const vector unsigned char)vec_splat_u8(0); |
| 1005 | 972 | register vector signed short temp0, temp1, temp2, temp3, temp4, |
| 1006 | 973 | temp5, temp6, temp7; |
| 1007 | −POWERPC_PERF_START_COUNT(altivec_hadamard8_diff8x8_num, 1); | |
| 1008 | 974 | { |
| 1009 | 975 | register const vector signed short vprod1 =(const vector signed short) |
| 1010 | 976 | { 1,-1, 1,-1, 1,-1, 1,-1 }; |
| @@ -1100,7 +1066,6 @@ POWERPC_PERF_START_COUNT(altivec_hadamard8_diff8x8_num, 1); · 89 unmodified lines | ||
| 1100 | 1066 | vsum = vec_splat(vsum, 3); |
| 1101 | 1067 | vec_ste(vsum, 0, &sum); |
| 1102 | 1068 | } |
| 1103 | −POWERPC_PERF_STOP_COUNT(altivec_hadamard8_diff8x8_num, 1); | |
| 1104 | 1069 | return sum; |
| 1105 | 1070 | } |
| 1106 | 1071 | |
| @@ -1319,16 +1284,13 @@ static int hadamard8_diff16x8_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, · 212 unmodified lines | ||
| 1319 | 1284 | } |
| 1320 | 1285 | |
| 1321 | 1286 | static int hadamard8_diff16_altivec(/*MpegEncContext*/ void *s, uint8_t *dst, uint8_t *src, int stride, int h){ |
| 1322 | −POWERPC_PERF_DECLARE(altivec_hadamard8_diff16_num, 1); | |
| 1323 | 1287 | int score; |
| 1324 | −POWERPC_PERF_START_COUNT(altivec_hadamard8_diff16_num, 1); | |
| 1325 | 1288 | score = hadamard8_diff16x8_altivec(s, dst, src, stride, 8); |
| 1326 | 1289 | if (h==16) { |
| 1327 | 1290 | dst += 8*stride; |
| 1328 | 1291 | src += 8*stride; |
| 1329 | 1292 | score += hadamard8_diff16x8_altivec(s, dst, src, stride, 8); |
| 1330 | 1293 | } |
| 1331 | −POWERPC_PERF_STOP_COUNT(altivec_hadamard8_diff16_num, 1); | |
| 1332 | 1294 | return score; |
| 1333 | 1295 | } |
| 1334 | 1296 | |
| @@ -1358,7 +1320,6 @@ static void vorbis_inverse_coupling_altivec(float *mag, float *ang, · 23 unmodified lines | ||
| 1358 | 1320 | /* next one assumes that ((line_size % 8) == 0) */ |
| 1359 | 1321 | static void avg_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h) |
| 1360 | 1322 | { |
| 1361 | −POWERPC_PERF_DECLARE(altivec_avg_pixels8_xy2_num, 1); | |
| 1362 | 1323 | register int i; |
| 1363 | 1324 | register vector unsigned char pixelsv1, pixelsv2, pixelsavg; |
| 1364 | 1325 | register vector unsigned char blockv, temp1, temp2, blocktemp; |
| @@ -1383,7 +1344,6 @@ POWERPC_PERF_DECLARE(altivec_avg_pixels8_xy2_num, 1); · 18 unmodified lines | ||
| 1383 | 1344 | (vector unsigned short)pixelsv2); |
| 1384 | 1345 | pixelssum1 = vec_add(pixelssum1, vctwo); |
| 1385 | 1346 | |
| 1386 | −POWERPC_PERF_START_COUNT(altivec_avg_pixels8_xy2_num, 1); | |
| 1387 | 1347 | for (i = 0; i < h ; i++) { |
| 1388 | 1348 | int rightside = ((unsigned long)block & 0x0000000F); |
| 1389 | 1349 | blockv = vec_ld(0, block); |
| @@ -1418,8 +1378,6 @@ POWERPC_PERF_START_COUNT(altivec_avg_pixels8_xy2_num, 1); · 28 unmodified lines | ||
| 1418 | 1378 | block += line_size; |
| 1419 | 1379 | pixels += line_size; |
| 1420 | 1380 | } |
| 1421 | − | |
| 1422 | −POWERPC_PERF_STOP_COUNT(altivec_avg_pixels8_xy2_num, 1); | |
| 1423 | 1381 | } |
| 1424 | 1382 | |
| 1425 | 1383 | void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx) |
| @@ -21,9 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | #include "libavcodec/dsputil.h" |
| 24 | − | |
| 25 | −#include "dsputil_ppc.h" | |
| 26 | − | |
| 27 | 24 | #include "dsputil_altivec.h" |
| 28 | 25 | |
| 29 | 26 | int mm_flags = 0; |
| @@ -39,63 +36,6 @@ int mm_support(void) · 9 unmodified lines | ||
| 39 | 36 | return result; |
| 40 | 37 | } |
| 41 | 38 | |
| 42 | −#if CONFIG_POWERPC_PERF | |
| 43 | −unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total]; | |
| 44 | −/* list below must match enum in dsputil_ppc.h */ | |
| 45 | −static unsigned char* perfname[] = { | |
| 46 | − "ff_fft_calc_altivec", | |
| 47 | − "gmc1_altivec", | |
| 48 | − "dct_unquantize_h263_altivec", | |
| 49 | − "fdct_altivec", | |
| 50 | − "idct_add_altivec", | |
| 51 | − "idct_put_altivec", | |
| 52 | − "put_pixels16_altivec", | |
| 53 | − "avg_pixels16_altivec", | |
| 54 | − "avg_pixels8_altivec", | |
| 55 | − "put_pixels8_xy2_altivec", | |
| 56 | − "put_no_rnd_pixels8_xy2_altivec", | |
| 57 | − "put_pixels16_xy2_altivec", | |
| 58 | − "put_no_rnd_pixels16_xy2_altivec", | |
| 59 | − "hadamard8_diff8x8_altivec", | |
| 60 | − "hadamard8_diff16_altivec", | |
| 61 | − "avg_pixels8_xy2_altivec", | |
| 62 | − "clear_blocks_dcbz32_ppc", | |
| 63 | − "clear_blocks_dcbz128_ppc", | |
| 64 | − "put_h264_chroma_mc8_altivec", | |
| 65 | − "avg_h264_chroma_mc8_altivec", | |
| 66 | − "put_h264_qpel16_h_lowpass_altivec", | |
| 67 | − "avg_h264_qpel16_h_lowpass_altivec", | |
| 68 | − "put_h264_qpel16_v_lowpass_altivec", | |
| 69 | − "avg_h264_qpel16_v_lowpass_altivec", | |
| 70 | − "put_h264_qpel16_hv_lowpass_altivec", | |
| 71 | − "avg_h264_qpel16_hv_lowpass_altivec", | |
| 72 | − "" | |
| 73 | −}; | |
| 74 | −#include <stdio.h> | |
| 75 | −#endif | |
| 76 | − | |
| 77 | −#if CONFIG_POWERPC_PERF | |
| 78 | −void powerpc_display_perf_report(void) | |
| 79 | −{ | |
| 80 | − int i, j; | |
| 81 | − av_log(NULL, AV_LOG_INFO, "PowerPC performance report\n Values are from the PMC registers, and represent whatever the registers are set to record.\n"); | |
| 82 | − for(i = 0 ; i < powerpc_perf_total ; i++) { | |
| 83 | − for (j = 0; j < POWERPC_NUM_PMC_ENABLED ; j++) { | |
| 84 | − if (perfdata[j][i][powerpc_data_num] != (unsigned long long)0) | |
| 85 | − av_log(NULL, AV_LOG_INFO, | |
| 86 | − " Function \"%s\" (pmc%d):\n\tmin: %"PRIu64"\n\tmax: %"PRIu64"\n\tavg: %1.2lf (%"PRIu64")\n", | |
| 87 | − perfname[i], | |
| 88 | − j+1, | |
| 89 | − perfdata[j][i][powerpc_data_min], | |
| 90 | − perfdata[j][i][powerpc_data_max], | |
| 91 | − (double)perfdata[j][i][powerpc_data_sum] / | |
| 92 | − (double)perfdata[j][i][powerpc_data_num], | |
| 93 | − perfdata[j][i][powerpc_data_num]); | |
| 94 | − } | |
| 95 | − } | |
| 96 | −} | |
| 97 | −#endif /* CONFIG_POWERPC_PERF */ | |
| 98 | − | |
| 99 | 39 | /* ***** WARNING ***** WARNING ***** WARNING ***** */ |
| 100 | 40 | /* |
| 101 | 41 | clear_blocks_dcbz32_ppc will not work properly on PowerPC processors with a |
| @@ -118,10 +58,8 @@ and <http://developer.apple.com/technotes/tn/tn2086.html> · 16 unmodified lines | ||
| 118 | 58 | */ |
| 119 | 59 | static void clear_blocks_dcbz32_ppc(DCTELEM *blocks) |
| 120 | 60 | { |
| 121 | −POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz32, 1); | |
| 122 | 61 | register int misal = ((unsigned long)blocks & 0x00000010); |
| 123 | 62 | register int i = 0; |
| 124 | −POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz32, 1); | |
| 125 | 63 | #if 1 |
| 126 | 64 | if (misal) { |
| 127 | 65 | ((unsigned long*)blocks)[0] = 0L; |
| @@ -143,7 +81,6 @@ POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz32, 1); · 15 unmodified lines | ||
| 143 | 81 | #else |
| 144 | 82 | memset(blocks, 0, sizeof(DCTELEM)*6*64); |
| 145 | 83 | #endif |
| 146 | −POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz32, 1); | |
| 147 | 84 | } |
| 148 | 85 | |
| 149 | 86 | /* same as above, when dcbzl clear a whole 128B cache line |
| @@ -151,10 +88,8 @@ POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz32, 1); · 1 unmodified line | ||
| 151 | 88 | #if HAVE_DCBZL |
| 152 | 89 | static void clear_blocks_dcbz128_ppc(DCTELEM *blocks) |
| 153 | 90 | { |
| 154 | −POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1); | |
| 155 | 91 | register int misal = ((unsigned long)blocks & 0x0000007f); |
| 156 | 92 | register int i = 0; |
| 157 | −POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz128, 1); | |
| 158 | 93 | #if 1 |
| 159 | 94 | if (misal) { |
| 160 | 95 | // we could probably also optimize this case, |
| @@ -169,7 +104,6 @@ POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz128, 1); · 8 unmodified lines | ||
| 169 | 104 | #else |
| 170 | 105 | memset(blocks, 0, sizeof(DCTELEM)*6*64); |
| 171 | 106 | #endif |
| 172 | −POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz128, 1); | |
| 173 | 107 | } |
| 174 | 108 | #else |
| 175 | 109 | static void clear_blocks_dcbz128_ppc(DCTELEM *blocks) |
| @@ -279,19 +213,6 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) · 103 unmodified lines | ||
| 279 | 213 | } |
| 280 | 214 | } |
| 281 | 215 | |
| 282 | −#if CONFIG_POWERPC_PERF | |
| 283 | − { | |
| 284 | − int i, j; | |
| 285 | − for (i = 0 ; i < powerpc_perf_total ; i++) { | |
| 286 | − for (j = 0; j < POWERPC_NUM_PMC_ENABLED ; j++) { | |
| 287 | − perfdata[j][i][powerpc_data_min] = 0xFFFFFFFFFFFFFFFFULL; | |
| 288 | − perfdata[j][i][powerpc_data_max] = 0x0000000000000000ULL; | |
| 289 | − perfdata[j][i][powerpc_data_sum] = 0x0000000000000000ULL; | |
| 290 | − perfdata[j][i][powerpc_data_num] = 0x0000000000000000ULL; | |
| 291 | − } | |
| 292 | − } | |
| 293 | − } | |
| 294 | −#endif /* CONFIG_POWERPC_PERF */ | |
| 295 | 216 | } |
| 296 | 217 | #endif /* HAVE_ALTIVEC */ |
| 297 | 218 | } |
| @@ -1,154 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org> | |
| 3 | − * | |
| 4 | − * This file is part of FFmpeg. | |
| 5 | − * | |
| 6 | − * FFmpeg is free software; you can redistribute it and/or | |
| 7 | − * modify it under the terms of the GNU Lesser General Public | |
| 8 | − * License as published by the Free Software Foundation; either | |
| 9 | − * version 2.1 of the License, or (at your option) any later version. | |
| 10 | − * | |
| 11 | − * FFmpeg is distributed in the hope that it will be useful, | |
| 12 | − * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | − * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 | − * Lesser General Public License for more details. | |
| 15 | − * | |
| 16 | − * You should have received a copy of the GNU Lesser General Public | |
| 17 | − * License along with FFmpeg; if not, write to the Free Software | |
| 18 | − * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 19 | − */ | |
| 20 | − | |
| 21 | −#ifndef AVCODEC_PPC_DSPUTIL_PPC_H | |
| 22 | −#define AVCODEC_PPC_DSPUTIL_PPC_H | |
| 23 | − | |
| 24 | −#include "config.h" | |
| 25 | − | |
| 26 | −#if CONFIG_POWERPC_PERF | |
| 27 | −void powerpc_display_perf_report(void); | |
| 28 | −/* the 604* have 2, the G3* have 4, the G4s have 6, | |
| 29 | − and the G5 are completely different (they MUST use | |
| 30 | − ARCH_PPC64, and let's hope all future 64 bis PPC | |
| 31 | − will use the same PMCs... */ | |
| 32 | −#define POWERPC_NUM_PMC_ENABLED 6 | |
| 33 | −/* if you add to the enum below, also add to the perfname array | |
| 34 | − in dsputil_ppc.c */ | |
| 35 | −enum powerpc_perf_index { | |
| 36 | − altivec_fft_num = 0, | |
| 37 | − altivec_gmc1_num, | |
| 38 | − altivec_dct_unquantize_h263_num, | |
| 39 | − altivec_fdct, | |
| 40 | − altivec_idct_add_num, | |
| 41 | − altivec_idct_put_num, | |
| 42 | − altivec_put_pixels16_num, | |
| 43 | − altivec_avg_pixels16_num, | |
| 44 | − altivec_avg_pixels8_num, | |
| 45 | − altivec_put_pixels8_xy2_num, | |
| 46 | − altivec_put_no_rnd_pixels8_xy2_num, | |
| 47 | − altivec_put_pixels16_xy2_num, | |
| 48 | − altivec_put_no_rnd_pixels16_xy2_num, | |
| 49 | − altivec_hadamard8_diff8x8_num, | |
| 50 | − altivec_hadamard8_diff16_num, | |
| 51 | − altivec_avg_pixels8_xy2_num, | |
| 52 | − powerpc_clear_blocks_dcbz32, | |
| 53 | − powerpc_clear_blocks_dcbz128, | |
| 54 | − altivec_put_h264_chroma_mc8_num, | |
| 55 | − altivec_avg_h264_chroma_mc8_num, | |
| 56 | − altivec_put_h264_qpel16_h_lowpass_num, | |
| 57 | − altivec_avg_h264_qpel16_h_lowpass_num, | |
| 58 | − altivec_put_h264_qpel16_v_lowpass_num, | |
| 59 | − altivec_avg_h264_qpel16_v_lowpass_num, | |
| 60 | − altivec_put_h264_qpel16_hv_lowpass_num, | |
| 61 | − altivec_avg_h264_qpel16_hv_lowpass_num, | |
| 62 | − powerpc_perf_total | |
| 63 | −}; | |
| 64 | −enum powerpc_data_index { | |
| 65 | − powerpc_data_min = 0, | |
| 66 | − powerpc_data_max, | |
| 67 | − powerpc_data_sum, | |
| 68 | − powerpc_data_num, | |
| 69 | − powerpc_data_total | |
| 70 | −}; | |
| 71 | −extern unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total]; | |
| 72 | − | |
| 73 | −#if !ARCH_PPC64 | |
| 74 | −#define POWERP_PMC_DATATYPE unsigned long | |
| 75 | −#define POWERPC_GET_PMC1(a) __asm__ volatile("mfspr %0, 937" : "=r" (a)) | |
| 76 | −#define POWERPC_GET_PMC2(a) __asm__ volatile("mfspr %0, 938" : "=r" (a)) | |
| 77 | −#if (POWERPC_NUM_PMC_ENABLED > 2) | |
| 78 | −#define POWERPC_GET_PMC3(a) __asm__ volatile("mfspr %0, 941" : "=r" (a)) | |
| 79 | −#define POWERPC_GET_PMC4(a) __asm__ volatile("mfspr %0, 942" : "=r" (a)) | |
| 80 | −#else | |
| 81 | −#define POWERPC_GET_PMC3(a) do {} while (0) | |
| 82 | −#define POWERPC_GET_PMC4(a) do {} while (0) | |
| 83 | −#endif | |
| 84 | −#if (POWERPC_NUM_PMC_ENABLED > 4) | |
| 85 | −#define POWERPC_GET_PMC5(a) __asm__ volatile("mfspr %0, 929" : "=r" (a)) | |
| 86 | −#define POWERPC_GET_PMC6(a) __asm__ volatile("mfspr %0, 930" : "=r" (a)) | |
| 87 | −#else | |
| 88 | −#define POWERPC_GET_PMC5(a) do {} while (0) | |
| 89 | −#define POWERPC_GET_PMC6(a) do {} while (0) | |
| 90 | −#endif | |
| 91 | −#else /* ARCH_PPC64 */ | |
| 92 | −#define POWERP_PMC_DATATYPE unsigned long long | |
| 93 | −#define POWERPC_GET_PMC1(a) __asm__ volatile("mfspr %0, 771" : "=r" (a)) | |
| 94 | −#define POWERPC_GET_PMC2(a) __asm__ volatile("mfspr %0, 772" : "=r" (a)) | |
| 95 | −#if (POWERPC_NUM_PMC_ENABLED > 2) | |
| 96 | −#define POWERPC_GET_PMC3(a) __asm__ volatile("mfspr %0, 773" : "=r" (a)) | |
| 97 | −#define POWERPC_GET_PMC4(a) __asm__ volatile("mfspr %0, 774" : "=r" (a)) | |
| 98 | −#else | |
| 99 | −#define POWERPC_GET_PMC3(a) do {} while (0) | |
| 100 | −#define POWERPC_GET_PMC4(a) do {} while (0) | |
| 101 | −#endif | |
| 102 | −#if (POWERPC_NUM_PMC_ENABLED > 4) | |
| 103 | −#define POWERPC_GET_PMC5(a) __asm__ volatile("mfspr %0, 775" : "=r" (a)) | |
| 104 | −#define POWERPC_GET_PMC6(a) __asm__ volatile("mfspr %0, 776" : "=r" (a)) | |
| 105 | −#else | |
| 106 | −#define POWERPC_GET_PMC5(a) do {} while (0) | |
| 107 | −#define POWERPC_GET_PMC6(a) do {} while (0) | |
| 108 | −#endif | |
| 109 | −#endif /* ARCH_PPC64 */ | |
| 110 | −#define POWERPC_PERF_DECLARE(a, cond) \ | |
| 111 | − POWERP_PMC_DATATYPE \ | |
| 112 | − pmc_start[POWERPC_NUM_PMC_ENABLED], \ | |
| 113 | − pmc_stop[POWERPC_NUM_PMC_ENABLED], \ | |
| 114 | − pmc_loop_index; | |
| 115 | −#define POWERPC_PERF_START_COUNT(a, cond) do { \ | |
| 116 | − POWERPC_GET_PMC6(pmc_start[5]); \ | |
| 117 | − POWERPC_GET_PMC5(pmc_start[4]); \ | |
| 118 | − POWERPC_GET_PMC4(pmc_start[3]); \ | |
| 119 | − POWERPC_GET_PMC3(pmc_start[2]); \ | |
| 120 | − POWERPC_GET_PMC2(pmc_start[1]); \ | |
| 121 | − POWERPC_GET_PMC1(pmc_start[0]); \ | |
| 122 | − } while (0) | |
| 123 | −#define POWERPC_PERF_STOP_COUNT(a, cond) do { \ | |
| 124 | − POWERPC_GET_PMC1(pmc_stop[0]); \ | |
| 125 | − POWERPC_GET_PMC2(pmc_stop[1]); \ | |
| 126 | − POWERPC_GET_PMC3(pmc_stop[2]); \ | |
| 127 | − POWERPC_GET_PMC4(pmc_stop[3]); \ | |
| 128 | − POWERPC_GET_PMC5(pmc_stop[4]); \ | |
| 129 | − POWERPC_GET_PMC6(pmc_stop[5]); \ | |
| 130 | − if (cond) { \ | |
| 131 | − for(pmc_loop_index = 0; \ | |
| 132 | − pmc_loop_index < POWERPC_NUM_PMC_ENABLED; \ | |
| 133 | − pmc_loop_index++) { \ | |
| 134 | − if (pmc_stop[pmc_loop_index] >= pmc_start[pmc_loop_index]) { \ | |
| 135 | − POWERP_PMC_DATATYPE diff = \ | |
| 136 | − pmc_stop[pmc_loop_index] - pmc_start[pmc_loop_index]; \ | |
| 137 | − if (diff < perfdata[pmc_loop_index][a][powerpc_data_min]) \ | |
| 138 | − perfdata[pmc_loop_index][a][powerpc_data_min] = diff; \ | |
| 139 | − if (diff > perfdata[pmc_loop_index][a][powerpc_data_max]) \ | |
| 140 | − perfdata[pmc_loop_index][a][powerpc_data_max] = diff; \ | |
| 141 | − perfdata[pmc_loop_index][a][powerpc_data_sum] += diff; \ | |
| 142 | − perfdata[pmc_loop_index][a][powerpc_data_num] ++; \ | |
| 143 | − } \ | |
| 144 | − } \ | |
| 145 | − } \ | |
| 146 | −} while (0) | |
| 147 | −#else /* CONFIG_POWERPC_PERF */ | |
| 148 | −// those are needed to avoid empty statements. | |
| 149 | −#define POWERPC_PERF_DECLARE(a, cond) int altivec_placeholder __attribute__ ((unused)) | |
| 150 | −#define POWERPC_PERF_START_COUNT(a, cond) do {} while (0) | |
| 151 | −#define POWERPC_PERF_STOP_COUNT(a, cond) do {} while (0) | |
| 152 | −#endif /* CONFIG_POWERPC_PERF */ | |
| 153 | − | |
| 154 | −#endif /* AVCODEC_PPC_DSPUTIL_PPC_H */ | |
| @@ -24,7 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | #endif |
| 25 | 25 | #include "libavutil/common.h" |
| 26 | 26 | #include "libavcodec/dsputil.h" |
| 27 | −#include "dsputil_ppc.h" | |
| 28 | 27 | #include "dsputil_altivec.h" |
| 29 | 28 | |
| 30 | 29 | #define vs16(v) ((vector signed short)(v)) |
| @@ -198,7 +197,6 @@ static vector float fdctconsts[3] = { · 167 unmodified lines | ||
| 198 | 197 | |
| 199 | 198 | void fdct_altivec(int16_t *block) |
| 200 | 199 | { |
| 201 | −POWERPC_PERF_DECLARE(altivec_fdct, 1); | |
| 202 | 200 | vector signed short *bp; |
| 203 | 201 | vector float *cp; |
| 204 | 202 | vector float b00, b10, b20, b30, b40, b50, b60, b70; |
| @@ -206,9 +204,6 @@ POWERPC_PERF_DECLARE(altivec_fdct, 1); · 1 unmodified line | ||
| 206 | 204 | vector float mzero, cnst, cnsts0, cnsts1, cnsts2; |
| 207 | 205 | vector float x0, x1, x2, x3, x4, x5, x6, x7, x8; |
| 208 | 206 | |
| 209 | − POWERPC_PERF_START_COUNT(altivec_fdct, 1); | |
| 210 | − | |
| 211 | − | |
| 212 | 207 | /* setup constants {{{ */ |
| 213 | 208 | /* mzero = -0.0 */ |
| 214 | 209 | mzero = ((vector float)vec_splat_u32(-1)); |
| @@ -487,8 +482,6 @@ POWERPC_PERF_DECLARE(altivec_fdct, 1); · 272 unmodified lines | ||
| 487 | 482 | |
| 488 | 483 | #undef CTS |
| 489 | 484 | /* }}} */ |
| 490 | − | |
| 491 | −POWERPC_PERF_STOP_COUNT(altivec_fdct, 1); | |
| 492 | 485 | } |
| 493 | 486 | |
| 494 | 487 | /* vim:set foldmethod=marker foldlevel=0: */ |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 22 | 22 | */ |
| 23 | 23 | #include "libavcodec/fft.h" |
| 24 | −#include "dsputil_ppc.h" | |
| 25 | 24 | #include "util_altivec.h" |
| 26 | 25 | #include "dsputil_altivec.h" |
| 27 | 26 | |
| @@ -38,7 +37,6 @@ · 10 unmodified lines | ||
| 38 | 37 | */ |
| 39 | 38 | static void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z) |
| 40 | 39 | { |
| 41 | −POWERPC_PERF_DECLARE(altivec_fft_num, s->nbits >= 6); | |
| 42 | 40 | register const vector float vczero = (const vector float)vec_splat_u32(0.); |
| 43 | 41 | |
| 44 | 42 | int ln = s->nbits; |
| @@ -48,8 +46,6 @@ POWERPC_PERF_DECLARE(altivec_fft_num, s->nbits >= 6); · 3 unmodified lines | ||
| 48 | 46 | FFTComplex *cptr, *cptr1; |
| 49 | 47 | int k; |
| 50 | 48 | |
| 51 | −POWERPC_PERF_START_COUNT(altivec_fft_num, s->nbits >= 6); | |
| 52 | − | |
| 53 | 49 | np = 1 << ln; |
| 54 | 50 | |
| 55 | 51 | { |
| @@ -132,8 +128,6 @@ POWERPC_PERF_START_COUNT(altivec_fft_num, s->nbits >= 6); · 76 unmodified lines | ||
| 132 | 128 | nblocks = nblocks >> 1; |
| 133 | 129 | nloops = nloops << 1; |
| 134 | 130 | } while (nblocks != 0); |
| 135 | − | |
| 136 | −POWERPC_PERF_STOP_COUNT(altivec_fft_num, s->nbits >= 6); | |
| 137 | 131 | } |
| 138 | 132 | |
| 139 | 133 | av_cold void ff_fft_init_altivec(FFTContext *s) |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | */ |
| 22 | 22 | |
| 23 | 23 | #include "libavcodec/dsputil.h" |
| 24 | −#include "dsputil_ppc.h" | |
| 25 | 24 | #include "util_altivec.h" |
| 26 | 25 | #include "types_altivec.h" |
| 27 | 26 | #include "dsputil_altivec.h" |
| @@ -30,10 +29,8 @@ · 2 unmodified lines | ||
| 30 | 29 | altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8, |
| 31 | 30 | to preserve proper dst alignment. |
| 32 | 31 | */ |
| 33 | −#define GMC1_PERF_COND (h==8) | |
| 34 | 32 | void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder) |
| 35 | 33 | { |
| 36 | −POWERPC_PERF_DECLARE(altivec_gmc1_num, GMC1_PERF_COND); | |
| 37 | 34 | const DECLARE_ALIGNED(16, unsigned short, rounder_a) = rounder; |
| 38 | 35 | const DECLARE_ALIGNED(16, unsigned short, ABCD)[8] = |
| 39 | 36 | { |
| @@ -51,9 +48,6 @@ POWERPC_PERF_DECLARE(altivec_gmc1_num, GMC1_PERF_COND); · 11 unmodified lines | ||
| 51 | 48 | unsigned long dst_odd = (unsigned long)dst & 0x0000000F; |
| 52 | 49 | unsigned long src_really_odd = (unsigned long)src & 0x0000000F; |
| 53 | 50 | |
| 54 | − | |
| 55 | −POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND); | |
| 56 | − | |
| 57 | 51 | tempA = vec_ld(0, (unsigned short*)ABCD); |
| 58 | 52 | Av = vec_splat(tempA, 0); |
| 59 | 53 | Bv = vec_splat(tempA, 1); |
| @@ -133,6 +127,4 @@ POWERPC_PERF_START_COUNT(altivec_gmc1_num, GMC1_PERF_COND); · 73 unmodified lines | ||
| 133 | 127 | dst += stride; |
| 134 | 128 | src += stride; |
| 135 | 129 | } |
| 136 | − | |
| 137 | −POWERPC_PERF_STOP_COUNT(altivec_gmc1_num, GMC1_PERF_COND); | |
| 138 | 130 | } |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | #include "libavcodec/h264data.h" |
| 23 | 23 | #include "libavcodec/h264dsp.h" |
| 24 | 24 | |
| 25 | −#include "dsputil_ppc.h" | |
| 26 | 25 | #include "dsputil_altivec.h" |
| 27 | 26 | #include "util_altivec.h" |
| 28 | 27 | #include "types_altivec.h" |
| @@ -77,7 +77,6 @@ · 76 unmodified lines | ||
| 77 | 77 | |
| 78 | 78 | static void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, |
| 79 | 79 | int stride, int h, int x, int y) { |
| 80 | − POWERPC_PERF_DECLARE(PREFIX_h264_chroma_mc8_num, 1); | |
| 81 | 80 | DECLARE_ALIGNED(16, signed int, ABCD)[4] = |
| 82 | 81 | {((8 - x) * (8 - y)), |
| 83 | 82 | (( x) * (8 - y)), |
| @@ -103,8 +102,6 @@ static void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, · 19 unmodified lines | ||
| 103 | 102 | vec_s16 vsrc2ssH, vsrc3ssH, psum; |
| 104 | 103 | vec_u8 vdst, ppsum, vfdst, fsum; |
| 105 | 104 | |
| 106 | − POWERPC_PERF_START_COUNT(PREFIX_h264_chroma_mc8_num, 1); | |
| 107 | − | |
| 108 | 105 | if (((unsigned long)dst) % 16 == 0) { |
| 109 | 106 | fperm = (vec_u8){0x10, 0x11, 0x12, 0x13, |
| 110 | 107 | 0x14, 0x15, 0x16, 0x17, |
| @@ -203,7 +200,6 @@ static void PREFIX_h264_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, · 92 unmodified lines | ||
| 203 | 200 | } |
| 204 | 201 | } |
| 205 | 202 | } |
| 206 | − POWERPC_PERF_STOP_COUNT(PREFIX_h264_chroma_mc8_num, 1); | |
| 207 | 203 | } |
| 208 | 204 | |
| 209 | 205 | /* this code assume that stride % 16 == 0 */ |
| @@ -295,7 +291,6 @@ static void PREFIX_no_rnd_vc1_chroma_mc8_altivec(uint8_t * dst, uint8_t * src, i · 85 unmodified lines | ||
| 295 | 291 | |
| 296 | 292 | /* this code assume stride % 16 == 0 */ |
| 297 | 293 | static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) { |
| 298 | − POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_h_lowpass_num, 1); | |
| 299 | 294 | register int i; |
| 300 | 295 | |
| 301 | 296 | LOAD_ZERO; |
| @@ -323,8 +318,6 @@ static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, i · 21 unmodified lines | ||
| 323 | 318 | |
| 324 | 319 | vec_u8 sum, vdst, fsum; |
| 325 | 320 | |
| 326 | − POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1); | |
| 327 | − | |
| 328 | 321 | for (i = 0 ; i < 16 ; i ++) { |
| 329 | 322 | vec_u8 srcR1 = vec_ld(-2, src); |
| 330 | 323 | vec_u8 srcR2 = vec_ld(14, src); |
| @@ -433,13 +426,10 @@ static void PREFIX_h264_qpel16_h_lowpass_altivec(uint8_t * dst, uint8_t * src, i · 102 unmodified lines | ||
| 433 | 426 | src += srcStride; |
| 434 | 427 | dst += dstStride; |
| 435 | 428 | } |
| 436 | − POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_h_lowpass_num, 1); | |
| 437 | 429 | } |
| 438 | 430 | |
| 439 | 431 | /* this code assume stride % 16 == 0 */ |
| 440 | 432 | static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, int dstStride, int srcStride) { |
| 441 | − POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_v_lowpass_num, 1); | |
| 442 | − | |
| 443 | 433 | register int i; |
| 444 | 434 | |
| 445 | 435 | LOAD_ZERO; |
| @@ -490,8 +480,6 @@ static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, i · 44 unmodified lines | ||
| 490 | 480 | |
| 491 | 481 | vec_u8 sum, vdst, fsum, srcP3a, srcP3b, srcP3; |
| 492 | 482 | |
| 493 | − POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1); | |
| 494 | − | |
| 495 | 483 | for (i = 0 ; i < 16 ; i++) { |
| 496 | 484 | srcP3a = vec_ld(0, srcbis += srcStride); |
| 497 | 485 | srcP3b = vec_ld(16, srcbis); |
| @@ -544,12 +532,10 @@ static void PREFIX_h264_qpel16_v_lowpass_altivec(uint8_t * dst, uint8_t * src, i · 46 unmodified lines | ||
| 544 | 532 | |
| 545 | 533 | dst += dstStride; |
| 546 | 534 | } |
| 547 | − POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_v_lowpass_num, 1); | |
| 548 | 535 | } |
| 549 | 536 | |
| 550 | 537 | /* this code assume stride % 16 == 0 *and* tmp is properly aligned */ |
| 551 | 538 | static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, uint8_t * src, int dstStride, int tmpStride, int srcStride) { |
| 552 | − POWERPC_PERF_DECLARE(PREFIX_h264_qpel16_hv_lowpass_num, 1); | |
| 553 | 539 | register int i; |
| 554 | 540 | LOAD_ZERO; |
| 555 | 541 | const vec_u8 permM2 = vec_lvsl(-2, src); |
| @@ -589,7 +575,6 @@ static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, · 33 unmodified lines | ||
| 589 | 575 | vec_u8 fsum, sumv, sum, vdst; |
| 590 | 576 | vec_s16 ssume, ssumo; |
| 591 | 577 | |
| 592 | − POWERPC_PERF_START_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1); | |
| 593 | 578 | src -= (2 * srcStride); |
| 594 | 579 | for (i = 0 ; i < 21 ; i ++) { |
| 595 | 580 | vec_u8 srcM2, srcM1, srcP0, srcP1, srcP2, srcP3; |
| @@ -779,5 +764,4 @@ static void PREFIX_h264_qpel16_hv_lowpass_altivec(uint8_t * dst, int16_t * tmp, · 183 unmodified lines | ||
| 779 | 764 | |
| 780 | 765 | dst += dstStride; |
| 781 | 766 | } |
| 782 | − POWERPC_PERF_STOP_COUNT(PREFIX_h264_qpel16_hv_lowpass_num, 1); | |
| 783 | 767 | } |
| @@ -43,7 +43,6 @@ · 42 unmodified lines | ||
| 43 | 43 | #endif |
| 44 | 44 | #include "libavcodec/dsputil.h" |
| 45 | 45 | #include "types_altivec.h" |
| 46 | −#include "dsputil_ppc.h" | |
| 47 | 46 | #include "dsputil_altivec.h" |
| 48 | 47 | |
| 49 | 48 | #define IDCT_HALF \ |
| @@ -161,13 +160,9 @@ static const vec_s16 constants[5] = { · 111 unmodified lines | ||
| 161 | 160 | |
| 162 | 161 | void idct_put_altivec(uint8_t* dest, int stride, int16_t *blk) |
| 163 | 162 | { |
| 164 | −POWERPC_PERF_DECLARE(altivec_idct_put_num, 1); | |
| 165 | 163 | vec_s16 *block = (vec_s16*)blk; |
| 166 | 164 | vec_u8 tmp; |
| 167 | 165 | |
| 168 | −#if CONFIG_POWERPC_PERF | |
| 169 | −POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1); | |
| 170 | −#endif | |
| 171 | 166 | IDCT |
| 172 | 167 | |
| 173 | 168 | #define COPY(dest,src) \ |
| @@ -183,13 +178,10 @@ POWERPC_PERF_START_COUNT(altivec_idct_put_num, 1); · 9 unmodified lines | ||
| 183 | 178 | COPY (dest, vx5) dest += stride; |
| 184 | 179 | COPY (dest, vx6) dest += stride; |
| 185 | 180 | COPY (dest, vx7) |
| 186 | − | |
| 187 | −POWERPC_PERF_STOP_COUNT(altivec_idct_put_num, 1); | |
| 188 | 181 | } |
| 189 | 182 | |
| 190 | 183 | void idct_add_altivec(uint8_t* dest, int stride, int16_t *blk) |
| 191 | 184 | { |
| 192 | −POWERPC_PERF_DECLARE(altivec_idct_add_num, 1); | |
| 193 | 185 | vec_s16 *block = (vec_s16*)blk; |
| 194 | 186 | vec_u8 tmp; |
| 195 | 187 | vec_s16 tmp2, tmp3; |
| @@ -197,10 +189,6 @@ POWERPC_PERF_DECLARE(altivec_idct_add_num, 1); · 1 unmodified line | ||
| 197 | 189 | vec_u8 perm1; |
| 198 | 190 | vec_u8 p0, p1, p; |
| 199 | 191 | |
| 200 | −#if CONFIG_POWERPC_PERF | |
| 201 | −POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1); | |
| 202 | −#endif | |
| 203 | − | |
| 204 | 192 | IDCT |
| 205 | 193 | |
| 206 | 194 | p0 = vec_lvsl (0, dest); |
| @@ -226,7 +214,5 @@ POWERPC_PERF_START_COUNT(altivec_idct_add_num, 1); · 19 unmodified lines | ||
| 226 | 214 | ADD (dest, vx5, perm1) dest += stride; |
| 227 | 215 | ADD (dest, vx6, perm0) dest += stride; |
| 228 | 216 | ADD (dest, vx7, perm1) |
| 229 | − | |
| 230 | −POWERPC_PERF_STOP_COUNT(altivec_idct_add_num, 1); | |
| 231 | 217 | } |
| 232 | 218 | |
| @@ -26,7 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | #include "libavcodec/dsputil.h" |
| 27 | 27 | #include "libavcodec/mpegvideo.h" |
| 28 | 28 | |
| 29 | −#include "dsputil_ppc.h" | |
| 30 | 29 | #include "util_altivec.h" |
| 31 | 30 | #include "types_altivec.h" |
| 32 | 31 | #include "dsputil_altivec.h" |
| @@ -479,14 +478,11 @@ static int dct_quantize_altivec(MpegEncContext* s, · 446 unmodified lines | ||
| 479 | 478 | static void dct_unquantize_h263_altivec(MpegEncContext *s, |
| 480 | 479 | DCTELEM *block, int n, int qscale) |
| 481 | 480 | { |
| 482 | −POWERPC_PERF_DECLARE(altivec_dct_unquantize_h263_num, 1); | |
| 483 | 481 | int i, level, qmul, qadd; |
| 484 | 482 | int nCoeffs; |
| 485 | 483 | |
| 486 | 484 | assert(s->block_last_index[n]>=0); |
| 487 | 485 | |
| 488 | −POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1); | |
| 489 | − | |
| 490 | 486 | qadd = (qscale - 1) | 1; |
| 491 | 487 | qmul = qscale << 1; |
| 492 | 488 | |
| @@ -569,7 +565,6 @@ POWERPC_PERF_START_COUNT(altivec_dct_unquantize_h263_num, 1); · 76 unmodified lines | ||
| 569 | 565 | block[0] = backup_0; |
| 570 | 566 | } |
| 571 | 567 | } |
| 572 | −POWERPC_PERF_STOP_COUNT(altivec_dct_unquantize_h263_num, nCoeffs == 63); | |
| 573 | 568 | } |
| 574 | 569 | |
| 575 | 570 | |