annotate ppc/dsputil_ppc.c @ 9188:f534d0cca450 libavcodec

share some constants between the FLAC encoder and FLAC decoder
author jbr
date Thu, 19 Mar 2009 03:04:21 +0000
parents 13b6cdf7895e
children 5b68d22e5ec9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
828
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
1 /*
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
2 * Copyright (c) 2002 Brian Foley
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
3 * Copyright (c) 2002 Dieter Shirley
1949
66215baae7b9 hadamard8_diff8x8 in AltiVec, the 16bits edition by (Romain Dolbeau <dolbeau at irisa dot fr>)
michael
parents: 1879
diff changeset
4 * Copyright (c) 2003-2004 Romain Dolbeau <romain@dolbeau.org>
828
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
5 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3581
diff changeset
6 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3581
diff changeset
7 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3581
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or
828
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
9 * modify it under the terms of the GNU Lesser General Public
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
10 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3581
diff changeset
11 * version 2.1 of the License, or (at your option) any later version.
828
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
12 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3581
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
828
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
16 * Lesser General Public License for more details.
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
17 *
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3581
diff changeset
19 * License along with FFmpeg; if not, write to the Free Software
3036
0b546eab515d Update licensing information: The FSF changed postal address.
diego
parents: 2979
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
828
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
21 */
ace3ccd18dd2 Altivec Patch (Mark III) by (Dieter Shirley <dieters at schemasoft dot com>)
michaelni
parents: 748
diff changeset
22
6763
f7cbb7733146 Use full path for #includes from another directory.
diego
parents: 5958
diff changeset
23 #include "libavcodec/dsputil.h"
638
0012f75c92bb altivec build tidyup patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
michaelni
parents:
diff changeset
24
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
25 #include "dsputil_ppc.h"
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
26
638
0012f75c92bb altivec build tidyup patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
michaelni
parents:
diff changeset
27 #include "dsputil_altivec.h"
0012f75c92bb altivec build tidyup patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
michaelni
parents:
diff changeset
28
8250
cf4d575b1982 Delete unnecessary 'extern' keywords.
diego
parents: 8104
diff changeset
29 void fdct_altivec(int16_t *block);
cf4d575b1982 Delete unnecessary 'extern' keywords.
diego
parents: 8104
diff changeset
30 void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
cf4d575b1982 Delete unnecessary 'extern' keywords.
diego
parents: 8104
diff changeset
31 int x16, int y16, int rounder);
cf4d575b1982 Delete unnecessary 'extern' keywords.
diego
parents: 8104
diff changeset
32 void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
cf4d575b1982 Delete unnecessary 'extern' keywords.
diego
parents: 8104
diff changeset
33 void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
3547
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3546
diff changeset
34
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3546
diff changeset
35 void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx);
3532
95e2e92328c0 Cosmetics
lu_zero
parents: 3252
diff changeset
36
3546
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
37 void dsputil_init_altivec(DSPContext* c, AVCodecContext *avctx);
3542
bdbe52f38868 Cleanup
lu_zero
parents: 3537
diff changeset
38 void vc1dsp_init_altivec(DSPContext* c, AVCodecContext *avctx);
3547
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3546
diff changeset
39 void snow_init_altivec(DSPContext* c, AVCodecContext *avctx);
3581
49082584828a altivec float optimizations
lu_zero
parents: 3547
diff changeset
40 void float_init_altivec(DSPContext* c, AVCodecContext *avctx);
4838
eeac11145c4e ssd_int8_vs_int16_altivec, not completely benchmarkedwith svq1
lu_zero
parents: 4521
diff changeset
41 void int_init_altivec(DSPContext* c, AVCodecContext *avctx);
3532
95e2e92328c0 Cosmetics
lu_zero
parents: 3252
diff changeset
42
4197
bbe0bc387a19 revert bad checkin
mru
parents: 4196
diff changeset
43 int mm_flags = 0;
894
a408778eff87 altivec accelerated v-resample patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
michaelni
parents: 884
diff changeset
44
995
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
45 int mm_support(void)
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
46 {
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
47 int result = 0;
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8250
diff changeset
48 #if HAVE_ALTIVEC
995
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
49 if (has_altivec()) {
8104
0d108ec85620 Remove duplicated MM_* macros for CPU capabilities from dsputil.h.
rathann
parents: 8031
diff changeset
50 result |= FF_MM_ALTIVEC;
995
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
51 }
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
52 #endif /* result */
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
53 return result;
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
54 }
edc10966b081 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot fr>)
michaelni
parents: 981
diff changeset
55
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8250
diff changeset
56 #if CONFIG_POWERPC_PERF
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
57 unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total];
1024
9cc1031e1864 More AltiVec MC functions patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1015
diff changeset
58 /* list below must match enum in dsputil_ppc.h */
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
59 static unsigned char* perfname[] = {
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
60 "ff_fft_calc_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
61 "gmc1_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
62 "dct_unquantize_h263_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
63 "fdct_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
64 "idct_add_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
65 "idct_put_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
66 "put_pixels16_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
67 "avg_pixels16_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
68 "avg_pixels8_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
69 "put_pixels8_xy2_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
70 "put_no_rnd_pixels8_xy2_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
71 "put_pixels16_xy2_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
72 "put_no_rnd_pixels16_xy2_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
73 "hadamard8_diff8x8_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
74 "hadamard8_diff16_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
75 "avg_pixels8_xy2_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
76 "clear_blocks_dcbz32_ppc",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
77 "clear_blocks_dcbz128_ppc",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
78 "put_h264_chroma_mc8_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
79 "avg_h264_chroma_mc8_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
80 "put_h264_qpel16_h_lowpass_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
81 "avg_h264_qpel16_h_lowpass_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
82 "put_h264_qpel16_v_lowpass_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
83 "avg_h264_qpel16_v_lowpass_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
84 "put_h264_qpel16_hv_lowpass_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
85 "avg_h264_qpel16_hv_lowpass_altivec",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
86 ""
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
87 };
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
88 #include <stdio.h>
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
89 #endif
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
90
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8250
diff changeset
91 #if CONFIG_POWERPC_PERF
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
92 void powerpc_display_perf_report(void)
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
93 {
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
94 int i, j;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
95 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");
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
96 for(i = 0 ; i < powerpc_perf_total ; i++) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
97 for (j = 0; j < POWERPC_NUM_PMC_ENABLED ; j++) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
98 if (perfdata[j][i][powerpc_data_num] != (unsigned long long)0)
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
99 av_log(NULL, AV_LOG_INFO,
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
100 " Function \"%s\" (pmc%d):\n\tmin: %"PRIu64"\n\tmax: %"PRIu64"\n\tavg: %1.2lf (%"PRIu64")\n",
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
101 perfname[i],
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
102 j+1,
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
103 perfdata[j][i][powerpc_data_min],
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
104 perfdata[j][i][powerpc_data_max],
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
105 (double)perfdata[j][i][powerpc_data_sum] /
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
106 (double)perfdata[j][i][powerpc_data_num],
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
107 perfdata[j][i][powerpc_data_num]);
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
108 }
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
109 }
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
110 }
4521
891590781d9e rename POWERPC_PERFORMANCE_REPORT to CONFIG_POWERPC_PERF
mru
parents: 4227
diff changeset
111 #endif /* CONFIG_POWERPC_PERF */
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
112
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
113 /* ***** WARNING ***** WARNING ***** WARNING ***** */
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
114 /*
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
115 clear_blocks_dcbz32_ppc will not work properly on PowerPC processors with a
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
116 cache line size not equal to 32 bytes.
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
117 Fortunately all processor used by Apple up to at least the 7450 (aka second
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
118 generation G4) use 32 bytes cache line.
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
119 This is due to the use of the 'dcbz' instruction. It simply clear to zero a
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
120 single cache line, so you need to know the cache line size to use it !
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
121 It's absurd, but it's fast...
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
122
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
123 update 24/06/2003 : Apple released yesterday the G5, with a PPC970. cache line
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
124 size: 128 bytes. Oups.
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
125 The semantic of dcbz was changed, it always clear 32 bytes. so the function
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
126 below will work, but will be slow. So I fixed check_dcbz_effect to use dcbzl,
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
127 which is defined to clear a cache line (as dcbz before). So we still can
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
128 distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required.
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
129
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
130 see <http://developer.apple.com/technotes/tn/tn2087.html>
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
131 and <http://developer.apple.com/technotes/tn/tn2086.html>
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
132 */
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
133 void clear_blocks_dcbz32_ppc(DCTELEM *blocks)
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
134 {
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
135 POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz32, 1);
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
136 register int misal = ((unsigned long)blocks & 0x00000010);
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
137 register int i = 0;
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
138 POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz32, 1);
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
139 #if 1
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
140 if (misal) {
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
141 ((unsigned long*)blocks)[0] = 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
142 ((unsigned long*)blocks)[1] = 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
143 ((unsigned long*)blocks)[2] = 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
144 ((unsigned long*)blocks)[3] = 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
145 i += 16;
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
146 }
2294
fac626a2b73b missaliged clear_blocks() and h264 not complied but referenced fix patch by (Roine Gustafsson <roine at users dot sourceforge dot net>) and me
michael
parents: 2236
diff changeset
147 for ( ; i < sizeof(DCTELEM)*6*64-31 ; i += 32) {
8031
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7334
diff changeset
148 __asm__ volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory");
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
149 }
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
150 if (misal) {
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
151 ((unsigned long*)blocks)[188] = 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
152 ((unsigned long*)blocks)[189] = 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
153 ((unsigned long*)blocks)[190] = 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
154 ((unsigned long*)blocks)[191] = 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
155 i += 16;
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
156 }
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
157 #else
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
158 memset(blocks, 0, sizeof(DCTELEM)*6*64);
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
159 #endif
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
160 POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz32, 1);
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
161 }
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
162
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
163 /* same as above, when dcbzl clear a whole 128B cache line
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
164 i.e. the PPC970 aka G5 */
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8250
diff changeset
165 #if HAVE_DCBZL
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
166 void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
167 {
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
168 POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1);
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
169 register int misal = ((unsigned long)blocks & 0x0000007f);
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
170 register int i = 0;
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
171 POWERPC_PERF_START_COUNT(powerpc_clear_blocks_dcbz128, 1);
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
172 #if 1
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
173 if (misal) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
174 // we could probably also optimize this case,
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
175 // but there's not much point as the machines
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
176 // aren't available yet (2003-06-26)
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
177 memset(blocks, 0, sizeof(DCTELEM)*6*64);
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
178 }
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
179 else
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
180 for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) {
8031
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7334
diff changeset
181 __asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
182 }
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
183 #else
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
184 memset(blocks, 0, sizeof(DCTELEM)*6*64);
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
185 #endif
1352
e8ff4783f188 1) remove TBL support in PPC performance. It's much more useful to use the
michaelni
parents: 1340
diff changeset
186 POWERPC_PERF_STOP_COUNT(powerpc_clear_blocks_dcbz128, 1);
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
187 }
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
188 #else
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
189 void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
190 {
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
191 memset(blocks, 0, sizeof(DCTELEM)*6*64);
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
192 }
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
193 #endif
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
194
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8250
diff changeset
195 #if HAVE_DCBZL
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
196 /* check dcbz report how many bytes are set to 0 by dcbz */
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
197 /* update 24/06/2003 : replace dcbz by dcbzl to get
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
198 the intended effect (Apple "fixed" dcbz)
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
199 unfortunately this cannot be used unless the assembler
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
200 knows about dcbzl ... */
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
201 long check_dcbzl_effect(void)
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
202 {
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
203 register char *fakedata = av_malloc(1024);
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
204 register char *fakedata_middle;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
205 register long zero = 0;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
206 register long i = 0;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
207 long count = 0;
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
208
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
209 if (!fakedata) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
210 return 0L;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
211 }
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
212
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
213 fakedata_middle = (fakedata + 512);
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
214
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
215 memset(fakedata, 0xFF, 1024);
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
216
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
217 /* below the constraint "b" seems to mean "Address base register"
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
218 in gcc-3.3 / RS/6000 speaks. seems to avoid using r0, so.... */
8031
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7334
diff changeset
219 __asm__ volatile("dcbzl %0, %1" : : "b" (fakedata_middle), "r" (zero));
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
220
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
221 for (i = 0; i < 1024 ; i ++) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
222 if (fakedata[i] == (char)0)
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
223 count++;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
224 }
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
225
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
226 av_free(fakedata);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2778
diff changeset
227
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
228 return count;
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
229 }
1334
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
230 #else
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
231 long check_dcbzl_effect(void)
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
232 {
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
233 return 0;
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
234 }
80c46c310a91 PPC970 patch + cpu-specific tuning support by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1092
diff changeset
235 #endif
1015
35cf2f4a0f8c PPC perf, PPC clear_block, AltiVec put_pixels8_xy2 patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1009
diff changeset
236
4003
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
237 static void prefetch_ppc(void *mem, int stride, int h)
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
238 {
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
239 register const uint8_t *p = mem;
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
240 do {
8031
eebc7209c47f Convert asm keyword into __asm__.
flameeyes
parents: 7334
diff changeset
241 __asm__ volatile ("dcbt 0,%0" : : "r" (p));
4003
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
242 p+= stride;
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
243 } while(--h);
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
244 }
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
245
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1033
diff changeset
246 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
638
0012f75c92bb altivec build tidyup patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
michaelni
parents:
diff changeset
247 {
5749
784dcbdc910f cosmetics: Fix AltiVec spelling.
diego
parents: 5744
diff changeset
248 // Common optimizations whether AltiVec is available or not
4003
38ccf93476a1 ppc generic prefetch
lu_zero
parents: 3973
diff changeset
249 c->prefetch = prefetch_ppc;
3546
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
250 switch (check_dcbzl_effect()) {
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
251 case 32:
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
252 c->clear_blocks = clear_blocks_dcbz32_ppc;
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
253 break;
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
254 case 128:
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
255 c->clear_blocks = clear_blocks_dcbz128_ppc;
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
256 break;
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
257 default:
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
258 break;
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
259 }
2236
b0102ea621dd h264 qpel mc, size 16 patch by (Romain Dolbeau <dolbeau at caps-entreprise dot com>)
michael
parents: 2068
diff changeset
260
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8250
diff changeset
261 #if HAVE_ALTIVEC
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
262 if(CONFIG_H264_DECODER) dsputil_h264_init_ppc(c, avctx);
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2778
diff changeset
263
638
0012f75c92bb altivec build tidyup patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
michaelni
parents:
diff changeset
264 if (has_altivec()) {
8104
0d108ec85620 Remove duplicated MM_* macros for CPU capabilities from dsputil.h.
rathann
parents: 8031
diff changeset
265 mm_flags |= FF_MM_ALTIVEC;
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2778
diff changeset
266
3547
e542c9978077 standalone snow dsputil init
lu_zero
parents: 3546
diff changeset
267 dsputil_init_altivec(c, avctx);
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
268 if(CONFIG_SNOW_DECODER) snow_init_altivec(c, avctx);
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
269 if(CONFIG_VC1_DECODER || CONFIG_WMV3_DECODER)
4227
ef1d382309e5 Conditionally compile some of the AltiVec optimizations.
diego
parents: 4197
diff changeset
270 vc1dsp_init_altivec(c, avctx);
3581
49082584828a altivec float optimizations
lu_zero
parents: 3547
diff changeset
271 float_init_altivec(c, avctx);
4838
eeac11145c4e ssd_int8_vs_int16_altivec, not completely benchmarkedwith svq1
lu_zero
parents: 4521
diff changeset
272 int_init_altivec(c, avctx);
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
273 c->gmc1 = gmc1_altivec;
1092
f59c3f66363b MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni
parents: 1033
diff changeset
274
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8250
diff changeset
275 #if CONFIG_ENCODERS
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
276 if (avctx->dct_algo == FF_DCT_AUTO ||
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
277 avctx->dct_algo == FF_DCT_ALTIVEC) {
2979
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
278 c->fdct = fdct_altivec;
bfabfdf9ce55 COSMETICS: tabs --> spaces, some prettyprinting
diego
parents: 2967
diff changeset
279 }
1578
6a4cfc5f9f96 AltiVec optimized fdct patch by (James Klicman <james at klicman dot org>)
michael
parents: 1511
diff changeset
280 #endif //CONFIG_ENCODERS
6a4cfc5f9f96 AltiVec optimized fdct patch by (James Klicman <james at klicman dot org>)
michael
parents: 1511
diff changeset
281
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
282 if (avctx->lowres==0) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
283 if ((avctx->idct_algo == FF_IDCT_AUTO) ||
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
284 (avctx->idct_algo == FF_IDCT_ALTIVEC)) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
285 c->idct_put = idct_put_altivec;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
286 c->idct_add = idct_add_altivec;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
287 c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
288 }
3546
5f97ba9a4eaa Almost cosmetic changes in dsputil_init_ppc and vorbis_inverse_coupling_altivec:
lu_zero
parents: 3542
diff changeset
289 }
2967
ef2149182f1c COSMETICS: Remove all trailing whitespace.
diego
parents: 2778
diff changeset
290
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 8250
diff changeset
291 #if CONFIG_POWERPC_PERF
1009
3b7cc8e4b83f AltiVec perf (take 2), plus a couple AltiVec functions by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 995
diff changeset
292 {
7333
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
293 int i, j;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
294 for (i = 0 ; i < powerpc_perf_total ; i++) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
295 for (j = 0; j < POWERPC_NUM_PMC_ENABLED ; j++) {
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
296 perfdata[j][i][powerpc_data_min] = 0xFFFFFFFFFFFFFFFFULL;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
297 perfdata[j][i][powerpc_data_max] = 0x0000000000000000ULL;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
298 perfdata[j][i][powerpc_data_sum] = 0x0000000000000000ULL;
a8a79f5385f6 cosmetics: Reformat PPC code in libavcodec according to style guidelines.
diego
parents: 6763
diff changeset
299 perfdata[j][i][powerpc_data_num] = 0x0000000000000000ULL;
7334
3a93377e8b76 cosmetics: Reindent two misplaced braces.
diego
parents: 7333
diff changeset
300 }
3a93377e8b76 cosmetics: Reindent two misplaced braces.
diego
parents: 7333
diff changeset
301 }
1009
3b7cc8e4b83f AltiVec perf (take 2), plus a couple AltiVec functions by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 995
diff changeset
302 }
4521
891590781d9e rename POWERPC_PERFORMANCE_REPORT to CONFIG_POWERPC_PERF
mru
parents: 4227
diff changeset
303 #endif /* CONFIG_POWERPC_PERF */
3957
b6f6bf155661 Non Altivec optimizations already present at the top
lu_zero
parents: 3949
diff changeset
304 }
1024
9cc1031e1864 More AltiVec MC functions patch by (Romain Dolbeau <dolbeau at irisa dot fr>)
michaelni
parents: 1015
diff changeset
305 #endif /* HAVE_ALTIVEC */
638
0012f75c92bb altivec build tidyup patch by (Brian Foley <bfoley at compsoc dot nuigalway dot ie>)
michaelni
parents:
diff changeset
306 }