annotate postprocess_altivec_template.c @ 107:7cbdc99cc753 libpostproc

Do not ignore .depend files, they are no longer generated.
author diego
date Thu, 24 Apr 2008 10:17:55 +0000
parents 883d75fc0712
children 83d51d1fb580
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1 /*
22
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
2 * AltiVec optimizations (C) 2004 Romain Dolbeau <romain@dolbeau.org>
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
3 *
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
4 * based on code by Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at)
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
5 *
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
6 * This file is part of FFmpeg.
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
7 *
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
8 * FFmpeg is free software; you can redistribute it and/or modify
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
9 * it under the terms of the GNU General Public License as published by
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
11 * (at your option) any later version.
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
12 *
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
13 * FFmpeg is distributed in the hope that it will be useful,
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
16 * GNU General Public License for more details.
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
17 *
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
18 * You should have received a copy of the GNU General Public License
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
19 * along with FFmpeg; if not, write to the Free Software
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
da3bfee1fa67 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 0
diff changeset
21 */
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
22
42
lu_zero
parents: 41
diff changeset
23 #include "avutil.h"
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
24
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
25 #define ALTIVEC_TRANSPOSE_8x8_SHORT(src_a,src_b,src_c,src_d,src_e,src_f,src_g,src_h) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
26 do { \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
27 __typeof__(src_a) tempA1, tempB1, tempC1, tempD1; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
28 __typeof__(src_a) tempE1, tempF1, tempG1, tempH1; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
29 __typeof__(src_a) tempA2, tempB2, tempC2, tempD2; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
30 __typeof__(src_a) tempE2, tempF2, tempG2, tempH2; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
31 tempA1 = vec_mergeh (src_a, src_e); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
32 tempB1 = vec_mergel (src_a, src_e); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
33 tempC1 = vec_mergeh (src_b, src_f); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
34 tempD1 = vec_mergel (src_b, src_f); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
35 tempE1 = vec_mergeh (src_c, src_g); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
36 tempF1 = vec_mergel (src_c, src_g); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
37 tempG1 = vec_mergeh (src_d, src_h); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
38 tempH1 = vec_mergel (src_d, src_h); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
39 tempA2 = vec_mergeh (tempA1, tempE1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
40 tempB2 = vec_mergel (tempA1, tempE1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
41 tempC2 = vec_mergeh (tempB1, tempF1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
42 tempD2 = vec_mergel (tempB1, tempF1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
43 tempE2 = vec_mergeh (tempC1, tempG1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
44 tempF2 = vec_mergel (tempC1, tempG1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
45 tempG2 = vec_mergeh (tempD1, tempH1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
46 tempH2 = vec_mergel (tempD1, tempH1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
47 src_a = vec_mergeh (tempA2, tempE2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
48 src_b = vec_mergel (tempA2, tempE2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
49 src_c = vec_mergeh (tempB2, tempF2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
50 src_d = vec_mergel (tempB2, tempF2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
51 src_e = vec_mergeh (tempC2, tempG2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
52 src_f = vec_mergel (tempC2, tempG2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
53 src_g = vec_mergeh (tempD2, tempH2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
54 src_h = vec_mergel (tempD2, tempH2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
55 } while (0)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
56
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
57
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
58 static inline int vertClassify_altivec(uint8_t src[], int stride, PPContext *c) {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
59 /*
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
60 this code makes no assumption on src or stride.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
61 One could remove the recomputation of the perm
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
62 vector by assuming (stride % 16) == 0, unfortunately
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
63 this is not always true.
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
64 */
99
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
65 DECLARE_ALIGNED(16, short, data[8]) =
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
66 {
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
67 ((c->nonBQP*c->ppMode.baseDcDiff)>>8) + 1,
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
68 data[0] * 2 + 1,
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
69 c->QP * 2,
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
70 c->QP * 4
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
71 };
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
72 int numEq;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
73 uint8_t *src2 = src;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
74 vector signed short v_dcOffset;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
75 vector signed short v2QP;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
76 vector unsigned short v4QP;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
77 vector unsigned short v_dcThreshold;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
78 const int properStride = (stride % 16);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
79 const int srcAlign = ((unsigned long)src2 % 16);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
80 const int two_vectors = ((srcAlign > 8) || properStride) ? 1 : 0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
81 const vector signed int zero = vec_splat_s32(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
82 const vector signed short mask = vec_splat_s16(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
83 vector signed int v_numEq = vec_splat_s32(0);
99
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
84 vector signed short v_data = vec_ld(0, data);
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
85 vector signed short v_srcAss0, v_srcAss1, v_srcAss2, v_srcAss3,
fa0ecbc87f51 Reorder declarations in vertClassify_altivec
lu_zero
parents: 98
diff changeset
86 v_srcAss4, v_srcAss5, v_srcAss6, v_srcAss7;
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
87 //FIXME avoid this mess if possible
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
88 register int j0 = 0,
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
89 j1 = stride,
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
90 j2 = 2 * stride,
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
91 j3 = 3 * stride,
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
92 j4 = 4 * stride,
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
93 j5 = 5 * stride,
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
94 j6 = 6 * stride,
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
95 j7 = 7 * stride;
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
96 vector unsigned char v_srcA0, v_srcA1, v_srcA2, v_srcA3,
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
97 v_srcA4, v_srcA5, v_srcA6, v_srcA7;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
98
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
99 v_dcOffset = vec_splat(v_data, 0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
100 v_dcThreshold = (vector unsigned short)vec_splat(v_data, 1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
101 v2QP = vec_splat(v_data, 2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
102 v4QP = (vector unsigned short)vec_splat(v_data, 3);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
103
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
104 src2 += stride * 4;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
105
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
106 #define LOAD_LINE(i) \
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
107 { \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
108 vector unsigned char perm##i = vec_lvsl(j##i, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
109 vector unsigned char v_srcA2##i; \
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
110 vector unsigned char v_srcA1##i = vec_ld(j##i, src2); \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
111 if (two_vectors) \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
112 v_srcA2##i = vec_ld(j##i + 16, src2); \
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
113 v_srcA##i = \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
114 vec_perm(v_srcA1##i, v_srcA2##i, perm##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
115 v_srcAss##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
116 (vector signed short)vec_mergeh((vector signed char)zero, \
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
117 (vector signed char)v_srcA##i); }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
118
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
119 #define LOAD_LINE_ALIGNED(i) \
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
120 v_srcA##i = vec_ld(j##i, src2); \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
121 v_srcAss##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
122 (vector signed short)vec_mergeh((vector signed char)zero, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
123 (vector signed char)v_srcA##i)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
124
88
8181b013dafa typo fixes
diego
parents: 63
diff changeset
125 /* Special-casing the aligned case is worthwhile, as all calls from
8181b013dafa typo fixes
diego
parents: 63
diff changeset
126 * the (transposed) horizontable deblocks will be aligned, in addition
8181b013dafa typo fixes
diego
parents: 63
diff changeset
127 * to the naturally aligned vertical deblocks. */
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
128 if (properStride && srcAlign) {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
129 LOAD_LINE_ALIGNED(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
130 LOAD_LINE_ALIGNED(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
131 LOAD_LINE_ALIGNED(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
132 LOAD_LINE_ALIGNED(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
133 LOAD_LINE_ALIGNED(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
134 LOAD_LINE_ALIGNED(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
135 LOAD_LINE_ALIGNED(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
136 LOAD_LINE_ALIGNED(7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
137 } else {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
138 LOAD_LINE(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
139 LOAD_LINE(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
140 LOAD_LINE(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
141 LOAD_LINE(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
142 LOAD_LINE(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
143 LOAD_LINE(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
144 LOAD_LINE(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
145 LOAD_LINE(7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
146 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
147 #undef LOAD_LINE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
148 #undef LOAD_LINE_ALIGNED
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
149
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
150 #define ITER(i, j) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
151 const vector signed short v_diff##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
152 vec_sub(v_srcAss##i, v_srcAss##j); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
153 const vector signed short v_sum##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
154 vec_add(v_diff##i, v_dcOffset); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
155 const vector signed short v_comp##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
156 (vector signed short)vec_cmplt((vector unsigned short)v_sum##i, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
157 v_dcThreshold); \
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
158 const vector signed short v_part##i = vec_and(mask, v_comp##i);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
159
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
160 {
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
161 ITER(0, 1)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
162 ITER(1, 2)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
163 ITER(2, 3)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
164 ITER(3, 4)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
165 ITER(4, 5)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
166 ITER(5, 6)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
167 ITER(6, 7)
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
168
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
169 v_numEq = vec_sum4s(v_part0, v_numEq);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
170 v_numEq = vec_sum4s(v_part1, v_numEq);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
171 v_numEq = vec_sum4s(v_part2, v_numEq);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
172 v_numEq = vec_sum4s(v_part3, v_numEq);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
173 v_numEq = vec_sum4s(v_part4, v_numEq);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
174 v_numEq = vec_sum4s(v_part5, v_numEq);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
175 v_numEq = vec_sum4s(v_part6, v_numEq);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
176 }
100
b944f0b99b23 Remove declarations after statements from vertClassify_altivec
lu_zero
parents: 99
diff changeset
177
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
178 #undef ITER
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
179
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
180 v_numEq = vec_sums(v_numEq, zero);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
181
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
182 v_numEq = vec_splat(v_numEq, 3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
183 vec_ste(v_numEq, 0, &numEq);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
184
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
185 if (numEq > c->ppMode.flatnessThreshold){
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
186 const vector unsigned char mmoP1 = (const vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
187 AVV(0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
188 0x00, 0x01, 0x12, 0x13, 0x08, 0x09, 0x1A, 0x1B);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
189 const vector unsigned char mmoP2 = (const vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
190 AVV(0x04, 0x05, 0x16, 0x17, 0x0C, 0x0D, 0x1E, 0x1F,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
191 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
192 const vector unsigned char mmoP = (const vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
193 vec_lvsl(8, (unsigned char*)0);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
194
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
195 vector signed short mmoL1 = vec_perm(v_srcAss0, v_srcAss2, mmoP1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
196 vector signed short mmoL2 = vec_perm(v_srcAss4, v_srcAss6, mmoP2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
197 vector signed short mmoL = vec_perm(mmoL1, mmoL2, mmoP);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
198 vector signed short mmoR1 = vec_perm(v_srcAss5, v_srcAss7, mmoP1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
199 vector signed short mmoR2 = vec_perm(v_srcAss1, v_srcAss3, mmoP2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
200 vector signed short mmoR = vec_perm(mmoR1, mmoR2, mmoP);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
201 vector signed short mmoDiff = vec_sub(mmoL, mmoR);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
202 vector unsigned short mmoSum = (vector unsigned short)vec_add(mmoDiff, v2QP);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
203
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
204 if (vec_any_gt(mmoSum, v4QP))
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
205 return 0;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
206 else
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
207 return 1;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
208 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
209 else return 2;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
210 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
211
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
212 static inline void doVertLowPass_altivec(uint8_t *src, int stride, PPContext *c) {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
213 /*
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
214 this code makes no assumption on src or stride.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
215 One could remove the recomputation of the perm
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
216 vector by assuming (stride % 16) == 0, unfortunately
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
217 this is not always true. Quite a lot of load/stores
63
650554bacd12 spelling
vitor
parents: 59
diff changeset
218 can be removed by assuming proper alignment of
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
219 src & stride :-(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
220 */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
221 uint8_t *src2 = src;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
222 const vector signed int zero = vec_splat_s32(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
223 const int properStride = (stride % 16);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
224 const int srcAlign = ((unsigned long)src2 % 16);
101
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
225 DECLARE_ALIGNED(16, short, qp[8]) = {c->QP};
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
226 vector signed short vqp = vec_ld(0, qp);
101
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
227 vector signed short vb0, vb1, vb2, vb3, vb4, vb5, vb6, vb7, vb8, vb9;
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
228 vector unsigned char vbA0, vbA1, vbA2, vbA3, vbA4, vbA5, vbA6, vbA7, vbA8, vbA9;
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
229 vector unsigned char vbB0, vbB1, vbB2, vbB3, vbB4, vbB5, vbB6, vbB7, vbB8, vbB9;
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
230 vector unsigned char vbT0, vbT1, vbT2, vbT3, vbT4, vbT5, vbT6, vbT7, vbT8, vbT9;
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
231 vector unsigned char perml0, perml1, perml2, perml3, perml4,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
232 perml5, perml6, perml7, perml8, perml9;
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
233 register int j0 = 0,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
234 j1 = stride,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
235 j2 = 2 * stride,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
236 j3 = 3 * stride,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
237 j4 = 4 * stride,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
238 j5 = 5 * stride,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
239 j6 = 6 * stride,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
240 j7 = 7 * stride,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
241 j8 = 8 * stride,
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
242 j9 = 9 * stride;
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
243
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
244 vqp = vec_splat(vqp, 0);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
245
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
246 src2 += stride*3;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
247
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
248 #define LOAD_LINE(i) \
101
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
249 perml##i = vec_lvsl(i * stride, src2); \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
250 vbA##i = vec_ld(i * stride, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
251 vbB##i = vec_ld(i * stride + 16, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
252 vbT##i = vec_perm(vbA##i, vbB##i, perml##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
253 vb##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
254 (vector signed short)vec_mergeh((vector unsigned char)zero, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
255 (vector unsigned char)vbT##i)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
256
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
257 #define LOAD_LINE_ALIGNED(i) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
258 vbT##i = vec_ld(j##i, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
259 vb##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
260 (vector signed short)vec_mergeh((vector signed char)zero, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
261 (vector signed char)vbT##i)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
262
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
263 /* Special-casing the aligned case is worthwhile, as all calls from
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
264 * the (transposed) horizontable deblocks will be aligned, in addition
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
265 * to the naturally aligned vertical deblocks. */
101
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
266 if (properStride && srcAlign) {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
267 LOAD_LINE_ALIGNED(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
268 LOAD_LINE_ALIGNED(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
269 LOAD_LINE_ALIGNED(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
270 LOAD_LINE_ALIGNED(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
271 LOAD_LINE_ALIGNED(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
272 LOAD_LINE_ALIGNED(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
273 LOAD_LINE_ALIGNED(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
274 LOAD_LINE_ALIGNED(7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
275 LOAD_LINE_ALIGNED(8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
276 LOAD_LINE_ALIGNED(9);
101
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
277 } else {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
278 LOAD_LINE(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
279 LOAD_LINE(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
280 LOAD_LINE(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
281 LOAD_LINE(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
282 LOAD_LINE(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
283 LOAD_LINE(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
284 LOAD_LINE(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
285 LOAD_LINE(7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
286 LOAD_LINE(8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
287 LOAD_LINE(9);
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
288 }
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
289 #undef LOAD_LINE
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
290 #undef LOAD_LINE_ALIGNED
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
291 {
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
292 const vector unsigned short v_2 = vec_splat_u16(2);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
293 const vector unsigned short v_4 = vec_splat_u16(4);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
294
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
295 const vector signed short v_diff01 = vec_sub(vb0, vb1);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
296 const vector unsigned short v_cmp01 =
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
297 (const vector unsigned short) vec_cmplt(vec_abs(v_diff01), vqp);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
298 const vector signed short v_first = vec_sel(vb1, vb0, v_cmp01);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
299 const vector signed short v_diff89 = vec_sub(vb8, vb9);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
300 const vector unsigned short v_cmp89 =
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
301 (const vector unsigned short) vec_cmplt(vec_abs(v_diff89), vqp);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
302 const vector signed short v_last = vec_sel(vb8, vb9, v_cmp89);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
303
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
304 const vector signed short temp01 = vec_mladd(v_first, (vector signed short)v_4, vb1);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
305 const vector signed short temp02 = vec_add(vb2, vb3);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
306 const vector signed short temp03 = vec_add(temp01, (vector signed short)v_4);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
307 const vector signed short v_sumsB0 = vec_add(temp02, temp03);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
308
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
309 const vector signed short temp11 = vec_sub(v_sumsB0, v_first);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
310 const vector signed short v_sumsB1 = vec_add(temp11, vb4);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
311
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
312 const vector signed short temp21 = vec_sub(v_sumsB1, v_first);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
313 const vector signed short v_sumsB2 = vec_add(temp21, vb5);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
314
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
315 const vector signed short temp31 = vec_sub(v_sumsB2, v_first);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
316 const vector signed short v_sumsB3 = vec_add(temp31, vb6);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
317
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
318 const vector signed short temp41 = vec_sub(v_sumsB3, v_first);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
319 const vector signed short v_sumsB4 = vec_add(temp41, vb7);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
320
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
321 const vector signed short temp51 = vec_sub(v_sumsB4, vb1);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
322 const vector signed short v_sumsB5 = vec_add(temp51, vb8);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
323
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
324 const vector signed short temp61 = vec_sub(v_sumsB5, vb2);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
325 const vector signed short v_sumsB6 = vec_add(temp61, v_last);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
326
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
327 const vector signed short temp71 = vec_sub(v_sumsB6, vb3);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
328 const vector signed short v_sumsB7 = vec_add(temp71, v_last);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
329
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
330 const vector signed short temp81 = vec_sub(v_sumsB7, vb4);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
331 const vector signed short v_sumsB8 = vec_add(temp81, v_last);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
332
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
333 const vector signed short temp91 = vec_sub(v_sumsB8, vb5);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
334 const vector signed short v_sumsB9 = vec_add(temp91, v_last);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
335
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
336 #define COMPUTE_VR(i, j, k) \
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
337 const vector signed short temps1##i = \
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
338 vec_add(v_sumsB##i, v_sumsB##k); \
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
339 const vector signed short temps2##i = \
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
340 vec_mladd(vb##j, (vector signed short)v_2, temps1##i); \
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
341 const vector signed short vr##j = vec_sra(temps2##i, v_4)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
342
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
343 COMPUTE_VR(0, 1, 2);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
344 COMPUTE_VR(1, 2, 3);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
345 COMPUTE_VR(2, 3, 4);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
346 COMPUTE_VR(3, 4, 5);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
347 COMPUTE_VR(4, 5, 6);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
348 COMPUTE_VR(5, 6, 7);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
349 COMPUTE_VR(6, 7, 8);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
350 COMPUTE_VR(7, 8, 9);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
351
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
352 const vector signed char neg1 = vec_splat_s8(-1);
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
353 const vector unsigned char permHH = (const vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
354 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
355
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
356 #define PACK_AND_STORE(i) \
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
357 { const vector unsigned char perms##i = \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
358 vec_lvsr(i * stride, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
359 const vector unsigned char vf##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
360 vec_packsu(vr##i, (vector signed short)zero); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
361 const vector unsigned char vg##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
362 vec_perm(vf##i, vbT##i, permHH); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
363 const vector unsigned char mask##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
364 vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
365 const vector unsigned char vg2##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
366 vec_perm(vg##i, vg##i, perms##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
367 const vector unsigned char svA##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
368 vec_sel(vbA##i, vg2##i, mask##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
369 const vector unsigned char svB##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
370 vec_sel(vg2##i, vbB##i, mask##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
371 vec_st(svA##i, i * stride, src2); \
101
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
372 vec_st(svB##i, i * stride + 16, src2);}
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
373
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
374 #define PACK_AND_STORE_ALIGNED(i) \
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
375 { const vector unsigned char vf##i = \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
376 vec_packsu(vr##i, (vector signed short)zero); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
377 const vector unsigned char vg##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
378 vec_perm(vf##i, vbT##i, permHH); \
101
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
379 vec_st(vg##i, i * stride, src2);}
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
380
103
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
381 /* Special-casing the aligned case is worthwhile, as all calls from
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
382 * the (transposed) horizontable deblocks will be aligned, in addition
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
383 * to the naturally aligned vertical deblocks. */
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
384 if (properStride && srcAlign) {
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
385 PACK_AND_STORE_ALIGNED(1)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
386 PACK_AND_STORE_ALIGNED(2)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
387 PACK_AND_STORE_ALIGNED(3)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
388 PACK_AND_STORE_ALIGNED(4)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
389 PACK_AND_STORE_ALIGNED(5)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
390 PACK_AND_STORE_ALIGNED(6)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
391 PACK_AND_STORE_ALIGNED(7)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
392 PACK_AND_STORE_ALIGNED(8)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
393 } else {
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
394 PACK_AND_STORE(1)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
395 PACK_AND_STORE(2)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
396 PACK_AND_STORE(3)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
397 PACK_AND_STORE(4)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
398 PACK_AND_STORE(5)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
399 PACK_AND_STORE(6)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
400 PACK_AND_STORE(7)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
401 PACK_AND_STORE(8)
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
402 }
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
403 #undef PACK_AND_STORE
53295ae2d45e Cosmetics: reindent and whitespaces
lu_zero
parents: 102
diff changeset
404 #undef PACK_AND_STORE_ALIGNED
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
405 }
101
db57626d7d76 Remove declarations after statements from doVertLowPass_altivec
lu_zero
parents: 100
diff changeset
406 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
407
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
408
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
409
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
410 static inline void doVertDefFilter_altivec(uint8_t src[], int stride, PPContext *c) {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
411 /*
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
412 this code makes no assumption on src or stride.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
413 One could remove the recomputation of the perm
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
414 vector by assuming (stride % 16) == 0, unfortunately
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
415 this is not always true. Quite a lot of load/stores
63
650554bacd12 spelling
vitor
parents: 59
diff changeset
416 can be removed by assuming proper alignment of
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
417 src & stride :-(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
418 */
102
eeb4558c950a Remove declarations after statements from doVertDefFilter_altivec
lu_zero
parents: 101
diff changeset
419 uint8_t *src2 = src + stride*3;
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
420 const vector signed int zero = vec_splat_s32(0);
102
eeb4558c950a Remove declarations after statements from doVertDefFilter_altivec
lu_zero
parents: 101
diff changeset
421 DECLARE_ALIGNED(16, short, qp[8]) = {8*c->QP};
eeb4558c950a Remove declarations after statements from doVertDefFilter_altivec
lu_zero
parents: 101
diff changeset
422 vector signed short vqp = vec_splat(
eeb4558c950a Remove declarations after statements from doVertDefFilter_altivec
lu_zero
parents: 101
diff changeset
423 (vector signed short)vec_ld(0, qp), 0);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
424
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
425 #define LOAD_LINE(i) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
426 const vector unsigned char perm##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
427 vec_lvsl(i * stride, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
428 const vector unsigned char vbA##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
429 vec_ld(i * stride, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
430 const vector unsigned char vbB##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
431 vec_ld(i * stride + 16, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
432 const vector unsigned char vbT##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
433 vec_perm(vbA##i, vbB##i, perm##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
434 const vector signed short vb##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
435 (vector signed short)vec_mergeh((vector unsigned char)zero, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
436 (vector unsigned char)vbT##i)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
437
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
438 LOAD_LINE(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
439 LOAD_LINE(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
440 LOAD_LINE(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
441 LOAD_LINE(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
442 LOAD_LINE(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
443 LOAD_LINE(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
444 LOAD_LINE(7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
445 LOAD_LINE(8);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
446 #undef LOAD_LINE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
447
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
448 const vector signed short v_1 = vec_splat_s16(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
449 const vector signed short v_2 = vec_splat_s16(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
450 const vector signed short v_5 = vec_splat_s16(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
451 const vector signed short v_32 = vec_sl(v_1,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
452 (vector unsigned short)v_5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
453 /* middle energy */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
454 const vector signed short l3minusl6 = vec_sub(vb3, vb6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
455 const vector signed short l5minusl4 = vec_sub(vb5, vb4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
456 const vector signed short twotimes_l3minusl6 = vec_mladd(v_2, l3minusl6, (vector signed short)zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
457 const vector signed short mE = vec_mladd(v_5, l5minusl4, twotimes_l3minusl6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
458 const vector signed short absmE = vec_abs(mE);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
459 /* left & right energy */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
460 const vector signed short l1minusl4 = vec_sub(vb1, vb4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
461 const vector signed short l3minusl2 = vec_sub(vb3, vb2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
462 const vector signed short l5minusl8 = vec_sub(vb5, vb8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
463 const vector signed short l7minusl6 = vec_sub(vb7, vb6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
464 const vector signed short twotimes_l1minusl4 = vec_mladd(v_2, l1minusl4, (vector signed short)zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
465 const vector signed short twotimes_l5minusl8 = vec_mladd(v_2, l5minusl8, (vector signed short)zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
466 const vector signed short lE = vec_mladd(v_5, l3minusl2, twotimes_l1minusl4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
467 const vector signed short rE = vec_mladd(v_5, l7minusl6, twotimes_l5minusl8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
468 /* d */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
469 const vector signed short ddiff = vec_sub(absmE,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
470 vec_min(vec_abs(lE),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
471 vec_abs(rE)));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
472 const vector signed short ddiffclamp = vec_max(ddiff, (vector signed short)zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
473 const vector signed short dtimes64 = vec_mladd(v_5, ddiffclamp, v_32);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
474 const vector signed short d = vec_sra(dtimes64, vec_splat_u16(6));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
475 const vector signed short minusd = vec_sub((vector signed short)zero, d);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
476 const vector signed short finald = vec_sel(minusd,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
477 d,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
478 vec_cmpgt(vec_sub((vector signed short)zero, mE),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
479 (vector signed short)zero));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
480 /* q */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
481 const vector signed short qtimes2 = vec_sub(vb4, vb5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
482 /* for a shift right to behave like /2, we need to add one
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
483 to all negative integer */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
484 const vector signed short rounddown = vec_sel((vector signed short)zero,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
485 v_1,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
486 vec_cmplt(qtimes2, (vector signed short)zero));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
487 const vector signed short q = vec_sra(vec_add(qtimes2, rounddown), vec_splat_u16(1));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
488 /* clamp */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
489 const vector signed short dclamp_P1 = vec_max((vector signed short)zero, finald);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
490 const vector signed short dclamp_P = vec_min(dclamp_P1, q);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
491 const vector signed short dclamp_N1 = vec_min((vector signed short)zero, finald);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
492 const vector signed short dclamp_N = vec_max(dclamp_N1, q);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
493
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
494 const vector signed short dclampedfinal = vec_sel(dclamp_N,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
495 dclamp_P,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
496 vec_cmpgt(q, (vector signed short)zero));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
497 const vector signed short dornotd = vec_sel((vector signed short)zero,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
498 dclampedfinal,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
499 vec_cmplt(absmE, vqp));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
500 /* add/subtract to l4 and l5 */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
501 const vector signed short vb4minusd = vec_sub(vb4, dornotd);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
502 const vector signed short vb5plusd = vec_add(vb5, dornotd);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
503 /* finally, stores */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
504 const vector unsigned char st4 = vec_packsu(vb4minusd, (vector signed short)zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
505 const vector unsigned char st5 = vec_packsu(vb5plusd, (vector signed short)zero);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
506
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
507 const vector signed char neg1 = vec_splat_s8(-1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
508 const vector unsigned char permHH = (const vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
509 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
510
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
511 #define STORE(i) \
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
512 { const vector unsigned char perms##i = \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
513 vec_lvsr(i * stride, src2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
514 const vector unsigned char vg##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
515 vec_perm(st##i, vbT##i, permHH); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
516 const vector unsigned char mask##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
517 vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
518 const vector unsigned char vg2##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
519 vec_perm(vg##i, vg##i, perms##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
520 const vector unsigned char svA##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
521 vec_sel(vbA##i, vg2##i, mask##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
522 const vector unsigned char svB##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
523 vec_sel(vg2##i, vbB##i, mask##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
524 vec_st(svA##i, i * stride, src2); \
102
eeb4558c950a Remove declarations after statements from doVertDefFilter_altivec
lu_zero
parents: 101
diff changeset
525 vec_st(svB##i, i * stride + 16, src2);}
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
526
102
eeb4558c950a Remove declarations after statements from doVertDefFilter_altivec
lu_zero
parents: 101
diff changeset
527 STORE(4)
eeb4558c950a Remove declarations after statements from doVertDefFilter_altivec
lu_zero
parents: 101
diff changeset
528 STORE(5)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
529 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
530
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
531 static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
532 /*
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
533 this code makes no assumption on src or stride.
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
534 One could remove the recomputation of the perm
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
535 vector by assuming (stride % 16) == 0, unfortunately
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
536 this is not always true. Quite a lot of load/stores
63
650554bacd12 spelling
vitor
parents: 59
diff changeset
537 can be removed by assuming proper alignment of
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
538 src & stride :-(
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
539 */
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
540 uint8_t *srcCopy = src;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
541 DECLARE_ALIGNED(16, uint8_t, dt[16]);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
542 const vector signed int zero = vec_splat_s32(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
543 vector unsigned char v_dt;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
544 dt[0] = deringThreshold;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
545 v_dt = vec_splat(vec_ld(0, dt), 0);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
546
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
547 #define LOAD_LINE(i) \
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
548 const vector unsigned char perm##i = \
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
549 vec_lvsl(i * stride, srcCopy); \
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
550 vector unsigned char sA##i = vec_ld(i * stride, srcCopy); \
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
551 vector unsigned char sB##i = vec_ld(i * stride + 16, srcCopy); \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
552 vector unsigned char src##i = vec_perm(sA##i, sB##i, perm##i)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
553
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
554 LOAD_LINE(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
555 LOAD_LINE(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
556 LOAD_LINE(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
557 LOAD_LINE(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
558 LOAD_LINE(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
559 LOAD_LINE(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
560 LOAD_LINE(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
561 LOAD_LINE(7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
562 LOAD_LINE(8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
563 LOAD_LINE(9);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
564 #undef LOAD_LINE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
565
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
566 vector unsigned char v_avg;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
567 {
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
568 const vector unsigned char trunc_perm = (vector unsigned char)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
569 AVV(0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
570 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
571 const vector unsigned char trunc_src12 = vec_perm(src1, src2, trunc_perm);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
572 const vector unsigned char trunc_src34 = vec_perm(src3, src4, trunc_perm);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
573 const vector unsigned char trunc_src56 = vec_perm(src5, src6, trunc_perm);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
574 const vector unsigned char trunc_src78 = vec_perm(src7, src8, trunc_perm);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
575
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
576 #define EXTRACT(op) do { \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
577 const vector unsigned char s##op##_1 = vec_##op(trunc_src12, trunc_src34); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
578 const vector unsigned char s##op##_2 = vec_##op(trunc_src56, trunc_src78); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
579 const vector unsigned char s##op##_6 = vec_##op(s##op##_1, s##op##_2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
580 const vector unsigned char s##op##_8h = vec_mergeh(s##op##_6, s##op##_6); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
581 const vector unsigned char s##op##_8l = vec_mergel(s##op##_6, s##op##_6); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
582 const vector unsigned char s##op##_9 = vec_##op(s##op##_8h, s##op##_8l); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
583 const vector unsigned char s##op##_9h = vec_mergeh(s##op##_9, s##op##_9); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
584 const vector unsigned char s##op##_9l = vec_mergel(s##op##_9, s##op##_9); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
585 const vector unsigned char s##op##_10 = vec_##op(s##op##_9h, s##op##_9l); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
586 const vector unsigned char s##op##_10h = vec_mergeh(s##op##_10, s##op##_10); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
587 const vector unsigned char s##op##_10l = vec_mergel(s##op##_10, s##op##_10); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
588 const vector unsigned char s##op##_11 = vec_##op(s##op##_10h, s##op##_10l); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
589 const vector unsigned char s##op##_11h = vec_mergeh(s##op##_11, s##op##_11); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
590 const vector unsigned char s##op##_11l = vec_mergel(s##op##_11, s##op##_11); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
591 v_##op = vec_##op(s##op##_11h, s##op##_11l); } while (0)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
592
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
593 vector unsigned char v_min;
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
594 vector unsigned char v_max;
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
595 EXTRACT(min);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
596 EXTRACT(max);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
597 #undef EXTRACT
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
598
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
599 if (vec_all_lt(vec_sub(v_max, v_min), v_dt))
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
600 return;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
601
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
602 v_avg = vec_avg(v_min, v_max);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
603 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
604
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
605 DECLARE_ALIGNED(16, signed int, S[8]);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
606 {
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
607 const vector unsigned short mask1 = (vector unsigned short)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
608 AVV(0x0001, 0x0002, 0x0004, 0x0008,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
609 0x0010, 0x0020, 0x0040, 0x0080);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
610 const vector unsigned short mask2 = (vector unsigned short)
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
611 AVV(0x0100, 0x0200, 0x0000, 0x0000,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
612 0x0000, 0x0000, 0x0000, 0x0000);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
613
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
614 const vector unsigned int vuint32_16 = vec_sl(vec_splat_u32(1), vec_splat_u32(4));
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
615 const vector unsigned int vuint32_1 = vec_splat_u32(1);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
616
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
617 #define COMPARE(i) \
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
618 vector signed int sum##i; \
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
619 do { \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
620 const vector unsigned char cmp##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
621 (vector unsigned char)vec_cmpgt(src##i, v_avg); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
622 const vector unsigned short cmpHi##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
623 (vector unsigned short)vec_mergeh(cmp##i, cmp##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
624 const vector unsigned short cmpLi##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
625 (vector unsigned short)vec_mergel(cmp##i, cmp##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
626 const vector signed short cmpHf##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
627 (vector signed short)vec_and(cmpHi##i, mask1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
628 const vector signed short cmpLf##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
629 (vector signed short)vec_and(cmpLi##i, mask2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
630 const vector signed int sump##i = vec_sum4s(cmpHf##i, zero); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
631 const vector signed int sumq##i = vec_sum4s(cmpLf##i, sump##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
632 sum##i = vec_sums(sumq##i, zero); } while (0)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
633
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
634 COMPARE(0);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
635 COMPARE(1);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
636 COMPARE(2);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
637 COMPARE(3);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
638 COMPARE(4);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
639 COMPARE(5);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
640 COMPARE(6);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
641 COMPARE(7);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
642 COMPARE(8);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
643 COMPARE(9);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
644 #undef COMPARE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
645
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
646 vector signed int sumA2;
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
647 vector signed int sumB2;
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
648 {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
649 const vector signed int sump02 = vec_mergel(sum0, sum2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
650 const vector signed int sump13 = vec_mergel(sum1, sum3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
651 const vector signed int sumA = vec_mergel(sump02, sump13);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
652
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
653 const vector signed int sump46 = vec_mergel(sum4, sum6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
654 const vector signed int sump57 = vec_mergel(sum5, sum7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
655 const vector signed int sumB = vec_mergel(sump46, sump57);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
656
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
657 const vector signed int sump8A = vec_mergel(sum8, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
658 const vector signed int sump9B = vec_mergel(sum9, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
659 const vector signed int sumC = vec_mergel(sump8A, sump9B);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
660
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
661 const vector signed int tA = vec_sl(vec_nor(zero, sumA), vuint32_16);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
662 const vector signed int tB = vec_sl(vec_nor(zero, sumB), vuint32_16);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
663 const vector signed int tC = vec_sl(vec_nor(zero, sumC), vuint32_16);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
664 const vector signed int t2A = vec_or(sumA, tA);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
665 const vector signed int t2B = vec_or(sumB, tB);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
666 const vector signed int t2C = vec_or(sumC, tC);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
667 const vector signed int t3A = vec_and(vec_sra(t2A, vuint32_1),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
668 vec_sl(t2A, vuint32_1));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
669 const vector signed int t3B = vec_and(vec_sra(t2B, vuint32_1),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
670 vec_sl(t2B, vuint32_1));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
671 const vector signed int t3C = vec_and(vec_sra(t2C, vuint32_1),
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
672 vec_sl(t2C, vuint32_1));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
673 const vector signed int yA = vec_and(t2A, t3A);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
674 const vector signed int yB = vec_and(t2B, t3B);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
675 const vector signed int yC = vec_and(t2C, t3C);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
676
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
677 const vector unsigned char strangeperm1 = vec_lvsl(4, (unsigned char*)0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
678 const vector unsigned char strangeperm2 = vec_lvsl(8, (unsigned char*)0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
679 const vector signed int sumAd4 = vec_perm(yA, yB, strangeperm1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
680 const vector signed int sumAd8 = vec_perm(yA, yB, strangeperm2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
681 const vector signed int sumBd4 = vec_perm(yB, yC, strangeperm1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
682 const vector signed int sumBd8 = vec_perm(yB, yC, strangeperm2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
683 const vector signed int sumAp = vec_and(yA,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
684 vec_and(sumAd4,sumAd8));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
685 const vector signed int sumBp = vec_and(yB,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
686 vec_and(sumBd4,sumBd8));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
687 sumA2 = vec_or(sumAp,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
688 vec_sra(sumAp,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
689 vuint32_16));
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
690 sumB2 = vec_or(sumBp,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
691 vec_sra(sumBp,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
692 vuint32_16));
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
693 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
694 vec_st(sumA2, 0, S);
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
695 vec_st(sumB2, 16, S);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
696 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
697
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
698 /* I'm not sure the following is actually faster
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
699 than straight, unvectorized C code :-( */
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
700
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
701 DECLARE_ALIGNED(16, int, tQP2[4]);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
702 tQP2[0]= c->QP/2 + 1;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
703 vector signed int vQP2 = vec_ld(0, tQP2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
704 vQP2 = vec_splat(vQP2, 0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
705 const vector signed int vsint32_8 = vec_splat_s32(8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
706 const vector unsigned int vuint32_4 = vec_splat_u32(4);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
707
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
708 const vector unsigned char permA1 = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
709 AVV(0x00, 0x01, 0x02, 0x10, 0x11, 0x12, 0x1F, 0x1F,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
710 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
711 const vector unsigned char permA2 = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
712 AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x10, 0x11,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
713 0x12, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
714 const vector unsigned char permA1inc = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
715 AVV(0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
716 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
717 const vector unsigned char permA2inc = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
718 AVV(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
719 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
720 const vector unsigned char magic = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
721 AVV(0x01, 0x02, 0x01, 0x02, 0x04, 0x02, 0x01, 0x02,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
722 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
723 const vector unsigned char extractPerm = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
724 AVV(0x10, 0x10, 0x10, 0x01, 0x10, 0x10, 0x10, 0x01,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
725 0x10, 0x10, 0x10, 0x01, 0x10, 0x10, 0x10, 0x01);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
726 const vector unsigned char extractPermInc = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
727 AVV(0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
728 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
729 const vector unsigned char identity = vec_lvsl(0,(unsigned char *)0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
730 const vector unsigned char tenRight = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
731 AVV(0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
732 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
733 const vector unsigned char eightLeft = (vector unsigned char)
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
734 AVV(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
735 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
736
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
737
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
738 #define F_INIT(i) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
739 vector unsigned char tenRightM##i = tenRight; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
740 vector unsigned char permA1M##i = permA1; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
741 vector unsigned char permA2M##i = permA2; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
742 vector unsigned char extractPermM##i = extractPerm
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
743
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
744 #define F2(i, j, k, l) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
745 if (S[i] & (1 << (l+1))) { \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
746 const vector unsigned char a_##j##_A##l = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
747 vec_perm(src##i, src##j, permA1M##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
748 const vector unsigned char a_##j##_B##l = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
749 vec_perm(a_##j##_A##l, src##k, permA2M##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
750 const vector signed int a_##j##_sump##l = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
751 (vector signed int)vec_msum(a_##j##_B##l, magic, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
752 (vector unsigned int)zero); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
753 vector signed int F_##j##_##l = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
754 vec_sr(vec_sums(a_##j##_sump##l, vsint32_8), vuint32_4); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
755 F_##j##_##l = vec_splat(F_##j##_##l, 3); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
756 const vector signed int p_##j##_##l = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
757 (vector signed int)vec_perm(src##j, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
758 (vector unsigned char)zero, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
759 extractPermM##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
760 const vector signed int sum_##j##_##l = vec_add( p_##j##_##l, vQP2);\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
761 const vector signed int diff_##j##_##l = vec_sub( p_##j##_##l, vQP2);\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
762 vector signed int newpm_##j##_##l; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
763 if (vec_all_lt(sum_##j##_##l, F_##j##_##l)) \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
764 newpm_##j##_##l = sum_##j##_##l; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
765 else if (vec_all_gt(diff_##j##_##l, F_##j##_##l)) \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
766 newpm_##j##_##l = diff_##j##_##l; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
767 else newpm_##j##_##l = F_##j##_##l; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
768 const vector unsigned char newpm2_##j##_##l = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
769 vec_splat((vector unsigned char)newpm_##j##_##l, 15); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
770 const vector unsigned char mask##j##l = vec_add(identity, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
771 tenRightM##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
772 src##j = vec_perm(src##j, newpm2_##j##_##l, mask##j##l); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
773 } \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
774 permA1M##i = vec_add(permA1M##i, permA1inc); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
775 permA2M##i = vec_add(permA2M##i, permA2inc); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
776 tenRightM##i = vec_sro(tenRightM##i, eightLeft); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
777 extractPermM##i = vec_add(extractPermM##i, extractPermInc)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
778
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
779 #define ITER(i, j, k) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
780 F_INIT(i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
781 F2(i, j, k, 0); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
782 F2(i, j, k, 1); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
783 F2(i, j, k, 2); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
784 F2(i, j, k, 3); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
785 F2(i, j, k, 4); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
786 F2(i, j, k, 5); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
787 F2(i, j, k, 6); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
788 F2(i, j, k, 7)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
789
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
790 ITER(0, 1, 2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
791 ITER(1, 2, 3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
792 ITER(2, 3, 4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
793 ITER(3, 4, 5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
794 ITER(4, 5, 6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
795 ITER(5, 6, 7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
796 ITER(6, 7, 8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
797 ITER(7, 8, 9);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
798
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
799 const vector signed char neg1 = vec_splat_s8(-1);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
800
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
801 #define STORE_LINE(i) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
802 const vector unsigned char permST##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
803 vec_lvsr(i * stride, srcCopy); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
804 const vector unsigned char maskST##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
805 vec_perm((vector unsigned char)zero, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
806 (vector unsigned char)neg1, permST##i);\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
807 src##i = vec_perm(src##i ,src##i, permST##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
808 sA##i= vec_sel(sA##i, src##i, maskST##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
809 sB##i= vec_sel(src##i, sB##i, maskST##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
810 vec_st(sA##i, i * stride, srcCopy); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
811 vec_st(sB##i, i * stride + 16, srcCopy)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
812
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
813 STORE_LINE(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
814 STORE_LINE(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
815 STORE_LINE(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
816 STORE_LINE(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
817 STORE_LINE(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
818 STORE_LINE(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
819 STORE_LINE(7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
820 STORE_LINE(8);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
821
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
822 #undef STORE_LINE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
823 #undef ITER
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
824 #undef F2
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
825 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
826
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
827 #define doHorizLowPass_altivec(a...) doHorizLowPass_C(a)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
828 #define doHorizDefFilter_altivec(a...) doHorizDefFilter_C(a)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
829 #define do_a_deblock_altivec(a...) do_a_deblock_C(a)
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
830
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
831 static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
832 uint8_t *tempBlurred, uint32_t *tempBlurredPast, int *maxNoise)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
833 {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
834 const vector signed int zero = vec_splat_s32(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
835 const vector signed short vsint16_1 = vec_splat_s16(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
836 vector signed int v_dp = zero;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
837 vector signed int v_sysdp = zero;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
838 int d, sysd, i;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
839
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
840 tempBlurredPast[127]= maxNoise[0];
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
841 tempBlurredPast[128]= maxNoise[1];
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
842 tempBlurredPast[129]= maxNoise[2];
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
843
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
844 #define LOAD_LINE(src, i) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
845 register int j##src##i = i * stride; \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
846 vector unsigned char perm##src##i = vec_lvsl(j##src##i, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
847 const vector unsigned char v_##src##A1##i = vec_ld(j##src##i, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
848 const vector unsigned char v_##src##A2##i = vec_ld(j##src##i + 16, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
849 const vector unsigned char v_##src##A##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
850 vec_perm(v_##src##A1##i, v_##src##A2##i, perm##src##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
851 vector signed short v_##src##Ass##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
852 (vector signed short)vec_mergeh((vector signed char)zero, \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
853 (vector signed char)v_##src##A##i)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
854
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
855 LOAD_LINE(src, 0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
856 LOAD_LINE(src, 1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
857 LOAD_LINE(src, 2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
858 LOAD_LINE(src, 3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
859 LOAD_LINE(src, 4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
860 LOAD_LINE(src, 5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
861 LOAD_LINE(src, 6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
862 LOAD_LINE(src, 7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
863
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
864 LOAD_LINE(tempBlurred, 0);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
865 LOAD_LINE(tempBlurred, 1);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
866 LOAD_LINE(tempBlurred, 2);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
867 LOAD_LINE(tempBlurred, 3);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
868 LOAD_LINE(tempBlurred, 4);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
869 LOAD_LINE(tempBlurred, 5);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
870 LOAD_LINE(tempBlurred, 6);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
871 LOAD_LINE(tempBlurred, 7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
872 #undef LOAD_LINE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
873
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
874 #define ACCUMULATE_DIFFS(i) \
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
875 vector signed short v_d##i = vec_sub(v_tempBlurredAss##i, \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
876 v_srcAss##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
877 v_dp = vec_msums(v_d##i, v_d##i, v_dp); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
878 v_sysdp = vec_msums(v_d##i, vsint16_1, v_sysdp)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
879
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
880 ACCUMULATE_DIFFS(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
881 ACCUMULATE_DIFFS(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
882 ACCUMULATE_DIFFS(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
883 ACCUMULATE_DIFFS(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
884 ACCUMULATE_DIFFS(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
885 ACCUMULATE_DIFFS(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
886 ACCUMULATE_DIFFS(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
887 ACCUMULATE_DIFFS(7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
888 #undef ACCUMULATE_DIFFS
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
889
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
890 v_dp = vec_sums(v_dp, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
891 v_sysdp = vec_sums(v_sysdp, zero);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
892
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
893 v_dp = vec_splat(v_dp, 3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
894 v_sysdp = vec_splat(v_sysdp, 3);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
895
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
896 vec_ste(v_dp, 0, &d);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
897 vec_ste(v_sysdp, 0, &sysd);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
898
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
899 i = d;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
900 d = (4*d
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
901 +(*(tempBlurredPast-256))
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
902 +(*(tempBlurredPast-1))+ (*(tempBlurredPast+1))
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
903 +(*(tempBlurredPast+256))
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
904 +4)>>3;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
905
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
906 *tempBlurredPast=i;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
907
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
908 if (d > maxNoise[1]) {
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
909 if (d < maxNoise[2]) {
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
910 #define OP(i) v_tempBlurredAss##i = vec_avg(v_tempBlurredAss##i, v_srcAss##i);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
911
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
912 OP(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
913 OP(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
914 OP(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
915 OP(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
916 OP(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
917 OP(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
918 OP(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
919 OP(7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
920 #undef OP
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
921 } else {
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
922 #define OP(i) v_tempBlurredAss##i = v_srcAss##i;
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
923
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
924 OP(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
925 OP(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
926 OP(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
927 OP(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
928 OP(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
929 OP(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
930 OP(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
931 OP(7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
932 #undef OP
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
933 }
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
934 } else {
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
935 if (d < maxNoise[0]) {
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
936 const vector signed short vsint16_7 = vec_splat_s16(7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
937 const vector signed short vsint16_4 = vec_splat_s16(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
938 const vector unsigned short vuint16_3 = vec_splat_u16(3);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
939
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
940 #define OP(i) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
941 const vector signed short v_temp##i = \
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
942 vec_mladd(v_tempBlurredAss##i, \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
943 vsint16_7, v_srcAss##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
944 const vector signed short v_temp2##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
945 vec_add(v_temp##i, vsint16_4); \
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
946 v_tempBlurredAss##i = vec_sr(v_temp2##i, vuint16_3)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
947
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
948 OP(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
949 OP(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
950 OP(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
951 OP(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
952 OP(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
953 OP(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
954 OP(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
955 OP(7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
956 #undef OP
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
957 } else {
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
958 const vector signed short vsint16_3 = vec_splat_s16(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
959 const vector signed short vsint16_2 = vec_splat_s16(2);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
960
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
961 #define OP(i) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
962 const vector signed short v_temp##i = \
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
963 vec_mladd(v_tempBlurredAss##i, \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
964 vsint16_3, v_srcAss##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
965 const vector signed short v_temp2##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
966 vec_add(v_temp##i, vsint16_2); \
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
967 v_tempBlurredAss##i = vec_sr(v_temp2##i, (vector unsigned short)vsint16_2)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
968
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
969 OP(0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
970 OP(1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
971 OP(2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
972 OP(3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
973 OP(4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
974 OP(5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
975 OP(6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
976 OP(7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
977 #undef OP
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
978 }
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
979 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
980
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
981 const vector signed char neg1 = vec_splat_s8(-1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
982 const vector unsigned char permHH = (const vector unsigned char)AVV(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
983 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
984
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
985 #define PACK_AND_STORE(src, i) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
986 const vector unsigned char perms##src##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
987 vec_lvsr(i * stride, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
988 const vector unsigned char vf##src##i = \
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
989 vec_packsu(v_tempBlurredAss##i, (vector signed short)zero); \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
990 const vector unsigned char vg##src##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
991 vec_perm(vf##src##i, v_##src##A##i, permHH); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
992 const vector unsigned char mask##src##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
993 vec_perm((vector unsigned char)zero, (vector unsigned char)neg1, perms##src##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
994 const vector unsigned char vg2##src##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
995 vec_perm(vg##src##i, vg##src##i, perms##src##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
996 const vector unsigned char svA##src##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
997 vec_sel(v_##src##A1##i, vg2##src##i, mask##src##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
998 const vector unsigned char svB##src##i = \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
999 vec_sel(vg2##src##i, v_##src##A2##i, mask##src##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1000 vec_st(svA##src##i, i * stride, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1001 vec_st(svB##src##i, i * stride + 16, src)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1002
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1003 PACK_AND_STORE(src, 0);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1004 PACK_AND_STORE(src, 1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1005 PACK_AND_STORE(src, 2);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1006 PACK_AND_STORE(src, 3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1007 PACK_AND_STORE(src, 4);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1008 PACK_AND_STORE(src, 5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1009 PACK_AND_STORE(src, 6);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1010 PACK_AND_STORE(src, 7);
98
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
1011 PACK_AND_STORE(tempBlurred, 0);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
1012 PACK_AND_STORE(tempBlurred, 1);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
1013 PACK_AND_STORE(tempBlurred, 2);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
1014 PACK_AND_STORE(tempBlurred, 3);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
1015 PACK_AND_STORE(tempBlurred, 4);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
1016 PACK_AND_STORE(tempBlurred, 5);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
1017 PACK_AND_STORE(tempBlurred, 6);
e565483b1193 typo fixes: tempBlured --> tempBlurred
diego
parents: 95
diff changeset
1018 PACK_AND_STORE(tempBlurred, 7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1019 #undef PACK_AND_STORE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1020 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1021
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1022 static inline void transpose_16x8_char_toPackedAlign_altivec(unsigned char* dst, unsigned char* src, int stride) {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1023 const vector unsigned char zero = vec_splat_u8(0);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1024
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1025 #define LOAD_DOUBLE_LINE(i, j) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1026 vector unsigned char perm1##i = vec_lvsl(i * stride, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1027 vector unsigned char perm2##i = vec_lvsl(j * stride, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1028 vector unsigned char srcA##i = vec_ld(i * stride, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1029 vector unsigned char srcB##i = vec_ld(i * stride + 16, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1030 vector unsigned char srcC##i = vec_ld(j * stride, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1031 vector unsigned char srcD##i = vec_ld(j * stride+ 16, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1032 vector unsigned char src##i = vec_perm(srcA##i, srcB##i, perm1##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1033 vector unsigned char src##j = vec_perm(srcC##i, srcD##i, perm2##i)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1034
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1035 LOAD_DOUBLE_LINE(0, 1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1036 LOAD_DOUBLE_LINE(2, 3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1037 LOAD_DOUBLE_LINE(4, 5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1038 LOAD_DOUBLE_LINE(6, 7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1039 #undef LOAD_DOUBLE_LINE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1040
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1041 vector unsigned char tempA = vec_mergeh(src0, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1042 vector unsigned char tempB = vec_mergel(src0, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1043 vector unsigned char tempC = vec_mergeh(src1, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1044 vector unsigned char tempD = vec_mergel(src1, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1045 vector unsigned char tempE = vec_mergeh(src2, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1046 vector unsigned char tempF = vec_mergel(src2, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1047 vector unsigned char tempG = vec_mergeh(src3, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1048 vector unsigned char tempH = vec_mergel(src3, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1049 vector unsigned char tempI = vec_mergeh(src4, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1050 vector unsigned char tempJ = vec_mergel(src4, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1051 vector unsigned char tempK = vec_mergeh(src5, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1052 vector unsigned char tempL = vec_mergel(src5, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1053 vector unsigned char tempM = vec_mergeh(src6, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1054 vector unsigned char tempN = vec_mergel(src6, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1055 vector unsigned char tempO = vec_mergeh(src7, zero);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1056 vector unsigned char tempP = vec_mergel(src7, zero);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1057
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1058 vector unsigned char temp0 = vec_mergeh(tempA, tempI);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1059 vector unsigned char temp1 = vec_mergel(tempA, tempI);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1060 vector unsigned char temp2 = vec_mergeh(tempB, tempJ);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1061 vector unsigned char temp3 = vec_mergel(tempB, tempJ);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1062 vector unsigned char temp4 = vec_mergeh(tempC, tempK);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1063 vector unsigned char temp5 = vec_mergel(tempC, tempK);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1064 vector unsigned char temp6 = vec_mergeh(tempD, tempL);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1065 vector unsigned char temp7 = vec_mergel(tempD, tempL);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1066 vector unsigned char temp8 = vec_mergeh(tempE, tempM);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1067 vector unsigned char temp9 = vec_mergel(tempE, tempM);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1068 vector unsigned char temp10 = vec_mergeh(tempF, tempN);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1069 vector unsigned char temp11 = vec_mergel(tempF, tempN);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1070 vector unsigned char temp12 = vec_mergeh(tempG, tempO);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1071 vector unsigned char temp13 = vec_mergel(tempG, tempO);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1072 vector unsigned char temp14 = vec_mergeh(tempH, tempP);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1073 vector unsigned char temp15 = vec_mergel(tempH, tempP);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1074
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1075 tempA = vec_mergeh(temp0, temp8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1076 tempB = vec_mergel(temp0, temp8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1077 tempC = vec_mergeh(temp1, temp9);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1078 tempD = vec_mergel(temp1, temp9);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1079 tempE = vec_mergeh(temp2, temp10);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1080 tempF = vec_mergel(temp2, temp10);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1081 tempG = vec_mergeh(temp3, temp11);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1082 tempH = vec_mergel(temp3, temp11);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1083 tempI = vec_mergeh(temp4, temp12);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1084 tempJ = vec_mergel(temp4, temp12);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1085 tempK = vec_mergeh(temp5, temp13);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1086 tempL = vec_mergel(temp5, temp13);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1087 tempM = vec_mergeh(temp6, temp14);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1088 tempN = vec_mergel(temp6, temp14);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1089 tempO = vec_mergeh(temp7, temp15);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1090 tempP = vec_mergel(temp7, temp15);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1091
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1092 temp0 = vec_mergeh(tempA, tempI);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1093 temp1 = vec_mergel(tempA, tempI);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1094 temp2 = vec_mergeh(tempB, tempJ);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1095 temp3 = vec_mergel(tempB, tempJ);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1096 temp4 = vec_mergeh(tempC, tempK);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1097 temp5 = vec_mergel(tempC, tempK);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1098 temp6 = vec_mergeh(tempD, tempL);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1099 temp7 = vec_mergel(tempD, tempL);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1100 temp8 = vec_mergeh(tempE, tempM);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1101 temp9 = vec_mergel(tempE, tempM);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1102 temp10 = vec_mergeh(tempF, tempN);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1103 temp11 = vec_mergel(tempF, tempN);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1104 temp12 = vec_mergeh(tempG, tempO);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1105 temp13 = vec_mergel(tempG, tempO);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1106 temp14 = vec_mergeh(tempH, tempP);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1107 temp15 = vec_mergel(tempH, tempP);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1108
104
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1109 vec_st(temp0, 0, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1110 vec_st(temp1, 16, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1111 vec_st(temp2, 32, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1112 vec_st(temp3, 48, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1113 vec_st(temp4, 64, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1114 vec_st(temp5, 80, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1115 vec_st(temp6, 96, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1116 vec_st(temp7, 112, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1117 vec_st(temp8, 128, dst);
883d75fc0712 cosmetics: prettyprinting
diego
parents: 103
diff changeset
1118 vec_st(temp9, 144, dst);
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1119 vec_st(temp10, 160, dst);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1120 vec_st(temp11, 176, dst);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1121 vec_st(temp12, 192, dst);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1122 vec_st(temp13, 208, dst);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1123 vec_st(temp14, 224, dst);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1124 vec_st(temp15, 240, dst);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1125 }
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1126
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1127 static inline void transpose_8x16_char_fromPackedAlign_altivec(unsigned char* dst, unsigned char* src, int stride) {
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1128 const vector unsigned char zero = vec_splat_u8(0);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1129
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1130 #define LOAD_DOUBLE_LINE(i, j) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1131 vector unsigned char src##i = vec_ld(i * 16, src); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1132 vector unsigned char src##j = vec_ld(j * 16, src)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1133
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1134 LOAD_DOUBLE_LINE(0, 1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1135 LOAD_DOUBLE_LINE(2, 3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1136 LOAD_DOUBLE_LINE(4, 5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1137 LOAD_DOUBLE_LINE(6, 7);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1138 LOAD_DOUBLE_LINE(8, 9);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1139 LOAD_DOUBLE_LINE(10, 11);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1140 LOAD_DOUBLE_LINE(12, 13);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1141 LOAD_DOUBLE_LINE(14, 15);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1142 #undef LOAD_DOUBLE_LINE
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1143
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1144 vector unsigned char tempA = vec_mergeh(src0, src8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1145 vector unsigned char tempB;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1146 vector unsigned char tempC = vec_mergeh(src1, src9);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1147 vector unsigned char tempD;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1148 vector unsigned char tempE = vec_mergeh(src2, src10);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1149 vector unsigned char tempG = vec_mergeh(src3, src11);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1150 vector unsigned char tempI = vec_mergeh(src4, src12);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1151 vector unsigned char tempJ;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1152 vector unsigned char tempK = vec_mergeh(src5, src13);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1153 vector unsigned char tempL;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1154 vector unsigned char tempM = vec_mergeh(src6, src14);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1155 vector unsigned char tempO = vec_mergeh(src7, src15);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1156
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1157 vector unsigned char temp0 = vec_mergeh(tempA, tempI);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1158 vector unsigned char temp1 = vec_mergel(tempA, tempI);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1159 vector unsigned char temp2;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1160 vector unsigned char temp3;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1161 vector unsigned char temp4 = vec_mergeh(tempC, tempK);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1162 vector unsigned char temp5 = vec_mergel(tempC, tempK);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1163 vector unsigned char temp6;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1164 vector unsigned char temp7;
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1165 vector unsigned char temp8 = vec_mergeh(tempE, tempM);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1166 vector unsigned char temp9 = vec_mergel(tempE, tempM);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1167 vector unsigned char temp12 = vec_mergeh(tempG, tempO);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1168 vector unsigned char temp13 = vec_mergel(tempG, tempO);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1169
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1170 tempA = vec_mergeh(temp0, temp8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1171 tempB = vec_mergel(temp0, temp8);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1172 tempC = vec_mergeh(temp1, temp9);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1173 tempD = vec_mergel(temp1, temp9);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1174 tempI = vec_mergeh(temp4, temp12);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1175 tempJ = vec_mergel(temp4, temp12);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1176 tempK = vec_mergeh(temp5, temp13);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1177 tempL = vec_mergel(temp5, temp13);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1178
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1179 temp0 = vec_mergeh(tempA, tempI);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1180 temp1 = vec_mergel(tempA, tempI);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1181 temp2 = vec_mergeh(tempB, tempJ);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1182 temp3 = vec_mergel(tempB, tempJ);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1183 temp4 = vec_mergeh(tempC, tempK);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1184 temp5 = vec_mergel(tempC, tempK);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1185 temp6 = vec_mergeh(tempD, tempL);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1186 temp7 = vec_mergel(tempD, tempL);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1187
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1188
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1189 const vector signed char neg1 = vec_splat_s8(-1);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1190 #define STORE_DOUBLE_LINE(i, j) \
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1191 vector unsigned char dstA##i = vec_ld(i * stride, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1192 vector unsigned char dstB##i = vec_ld(i * stride + 16, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1193 vector unsigned char dstA##j = vec_ld(j * stride, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1194 vector unsigned char dstB##j = vec_ld(j * stride+ 16, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1195 vector unsigned char align##i = vec_lvsr(i * stride, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1196 vector unsigned char align##j = vec_lvsr(j * stride, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1197 vector unsigned char mask##i = vec_perm(zero, (vector unsigned char)neg1, align##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1198 vector unsigned char mask##j = vec_perm(zero, (vector unsigned char)neg1, align##j); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1199 vector unsigned char dstR##i = vec_perm(temp##i, temp##i, align##i);\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1200 vector unsigned char dstR##j = vec_perm(temp##j, temp##j, align##j);\
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1201 vector unsigned char dstAF##i = vec_sel(dstA##i, dstR##i, mask##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1202 vector unsigned char dstBF##i = vec_sel(dstR##i, dstB##i, mask##i); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1203 vector unsigned char dstAF##j = vec_sel(dstA##j, dstR##j, mask##j); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1204 vector unsigned char dstBF##j = vec_sel(dstR##j, dstB##j, mask##j); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1205 vec_st(dstAF##i, i * stride, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1206 vec_st(dstBF##i, i * stride + 16, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1207 vec_st(dstAF##j, j * stride, dst); \
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1208 vec_st(dstBF##j, j * stride + 16, dst)
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1209
95
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1210 STORE_DOUBLE_LINE(0,1);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1211 STORE_DOUBLE_LINE(2,3);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1212 STORE_DOUBLE_LINE(4,5);
c24dab9bca80 cosmetics: Fix indentation to be 4 spaces and consistently place {}.
diego
parents: 88
diff changeset
1213 STORE_DOUBLE_LINE(6,7);
0
7c419ceafa6a libavcodec/libpostproc ---> libpostproc
diego
parents:
diff changeset
1214 }