Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
514294e8
Commit
514294e8
authored
Dec 20, 2011
by
Mans Rullgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
postproc: altivec: fix remaining mixed declarations and code
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
b49b836f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
postprocess_altivec_template.c
libpostproc/postprocess_altivec_template.c
+14
-16
No files found.
libpostproc/postprocess_altivec_template.c
View file @
514294e8
...
@@ -572,11 +572,9 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
...
@@ -572,11 +572,9 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
src & stride :-(
src & stride :-(
*/
*/
uint8_t
*
srcCopy
=
src
;
uint8_t
*
srcCopy
=
src
;
DECLARE_ALIGNED
(
16
,
uint8_t
,
dt
)[
16
];
DECLARE_ALIGNED
(
16
,
uint8_t
,
dt
)[
16
]
=
{
deringThreshold
}
;
const
vector
signed
int
zero
=
vec_splat_s32
(
0
);
const
vector
signed
int
zero
=
vec_splat_s32
(
0
);
vector
unsigned
char
v_dt
;
vector
unsigned
char
v_dt
=
vec_splat
(
vec_ld
(
0
,
dt
),
0
);
dt
[
0
]
=
deringThreshold
;
v_dt
=
vec_splat
(
vec_ld
(
0
,
dt
),
0
);
#define LOAD_LINE(i) \
#define LOAD_LINE(i) \
const vector unsigned char perm##i = \
const vector unsigned char perm##i = \
...
@@ -599,6 +597,10 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
...
@@ -599,6 +597,10 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
vector
unsigned
char
v_avg
;
vector
unsigned
char
v_avg
;
DECLARE_ALIGNED
(
16
,
signed
int
,
S
)[
8
];
DECLARE_ALIGNED
(
16
,
signed
int
,
S
)[
8
];
DECLARE_ALIGNED
(
16
,
int
,
tQP2
)[
4
]
=
{
c
->
QP
/
2
+
1
};
vector
signed
int
vQP2
=
vec_ld
(
0
,
tQP2
);
vQP2
=
vec_splat
(
vQP2
,
0
);
{
{
const
vector
unsigned
char
trunc_perm
=
(
vector
unsigned
char
)
const
vector
unsigned
char
trunc_perm
=
(
vector
unsigned
char
)
{
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
{
0x01
,
0x02
,
0x03
,
0x04
,
0x05
,
0x06
,
0x07
,
0x08
,
...
@@ -736,10 +738,6 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
...
@@ -736,10 +738,6 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
/* I'm not sure the following is actually faster
/* I'm not sure the following is actually faster
than straight, unvectorized C code :-( */
than straight, unvectorized C code :-( */
DECLARE_ALIGNED
(
16
,
int
,
tQP2
)[
4
];
tQP2
[
0
]
=
c
->
QP
/
2
+
1
;
vector
signed
int
vQP2
=
vec_ld
(
0
,
tQP2
);
vQP2
=
vec_splat
(
vQP2
,
0
);
#define F_INIT() \
#define F_INIT() \
vector unsigned char tenRightM = tenRight; \
vector unsigned char tenRightM = tenRight; \
vector unsigned char permA1M = permA1; \
vector unsigned char permA1M = permA1; \
...
@@ -753,21 +751,21 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
...
@@ -753,21 +751,21 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) {
const vector signed int a_sump = \
const vector signed int a_sump = \
(vector signed int)vec_msum(a_B, magic, (vector unsigned int)zero);\
(vector signed int)vec_msum(a_B, magic, (vector unsigned int)zero);\
vector signed int F = vec_sr(vec_sums(a_sump, vsint32_8), vuint32_4); \
vector signed int F = vec_sr(vec_sums(a_sump, vsint32_8), vuint32_4); \
F = vec_splat(F, 3); \
const vector signed int p = \
const vector signed int p = \
(vector signed int)vec_perm(src##j, (vector unsigned char)zero, \
(vector signed int)vec_perm(src##j, (vector unsigned char)zero, \
extractPermM); \
extractPermM); \
const vector signed int sum = vec_add(p, vQP2); \
const vector signed int sum = vec_add(p, vQP2); \
const vector signed int diff = vec_sub(p, vQP2); \
const vector signed int diff = vec_sub(p, vQP2); \
vector signed int newpm; \
vector signed int newpm; \
vector unsigned char newpm2, mask; \
F = vec_splat(F, 3); \
if (vec_all_lt(sum, F)) \
if (vec_all_lt(sum, F)) \
newpm = sum; \
newpm = sum; \
else if (vec_all_gt(diff, F)) \
else if (vec_all_gt(diff, F)) \
newpm = diff; \
newpm = diff; \
else newpm = F; \
else newpm = F; \
const vector unsigned char newpm2 = \
newpm2 = vec_splat((vector unsigned char)newpm, 15); \
vec_splat((vector unsigned char)newpm, 15); \
mask = vec_add(identity, tenRightM); \
const vector unsigned char mask = vec_add(identity, tenRightM); \
src##j = vec_perm(src##j, newpm2, mask); \
src##j = vec_perm(src##j, newpm2, mask); \
} \
} \
permA1M = vec_add(permA1M, permA1inc); \
permA1M = vec_add(permA1M, permA1inc); \
...
@@ -840,10 +838,6 @@ static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
...
@@ -840,10 +838,6 @@ static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
vector
signed
int
v_sysdp
=
zero
;
vector
signed
int
v_sysdp
=
zero
;
int
d
,
sysd
,
i
;
int
d
,
sysd
,
i
;
tempBlurredPast
[
127
]
=
maxNoise
[
0
];
tempBlurredPast
[
128
]
=
maxNoise
[
1
];
tempBlurredPast
[
129
]
=
maxNoise
[
2
];
#define LOAD_LINE(src, i) \
#define LOAD_LINE(src, i) \
register int j##src##i = i * stride; \
register int j##src##i = i * stride; \
vector unsigned char perm##src##i = vec_lvsl(j##src##i, src); \
vector unsigned char perm##src##i = vec_lvsl(j##src##i, src); \
...
@@ -891,6 +885,10 @@ static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
...
@@ -891,6 +885,10 @@ static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
ACCUMULATE_DIFFS
(
7
);
ACCUMULATE_DIFFS
(
7
);
#undef ACCUMULATE_DIFFS
#undef ACCUMULATE_DIFFS
tempBlurredPast
[
127
]
=
maxNoise
[
0
];
tempBlurredPast
[
128
]
=
maxNoise
[
1
];
tempBlurredPast
[
129
]
=
maxNoise
[
2
];
v_dp
=
vec_sums
(
v_dp
,
zero
);
v_dp
=
vec_sums
(
v_dp
,
zero
);
v_sysdp
=
vec_sums
(
v_sysdp
,
zero
);
v_sysdp
=
vec_sums
(
v_sysdp
,
zero
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment