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
cb56c396
Commit
cb56c396
authored
Nov 08, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h263dsp: K&R formatting cosmetics
Also remove array element numbering comments.
parent
0338c396
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
47 deletions
+63
-47
h263dsp.c
libavcodec/h263dsp.c
+63
-47
No files found.
libavcodec/h263dsp.c
View file @
cb56c396
...
...
@@ -23,78 +23,94 @@
#include "config.h"
#include "h263dsp.h"
const
uint8_t
ff_h263_loop_filter_strength
[
32
]
=
{
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0
,
1
,
1
,
2
,
2
,
3
,
3
,
4
,
4
,
4
,
5
,
5
,
6
,
6
,
7
,
7
,
7
,
8
,
8
,
8
,
9
,
9
,
9
,
10
,
10
,
10
,
11
,
11
,
11
,
12
,
12
,
12
const
uint8_t
ff_h263_loop_filter_strength
[
32
]
=
{
0
,
1
,
1
,
2
,
2
,
3
,
3
,
4
,
4
,
4
,
5
,
5
,
6
,
6
,
7
,
7
,
7
,
8
,
8
,
8
,
9
,
9
,
9
,
10
,
10
,
10
,
11
,
11
,
11
,
12
,
12
,
12
};
static
void
h263_h_loop_filter_c
(
uint8_t
*
src
,
int
stride
,
int
qscale
){
static
void
h263_h_loop_filter_c
(
uint8_t
*
src
,
int
stride
,
int
qscale
)
{
int
y
;
const
int
strength
=
ff_h263_loop_filter_strength
[
qscale
];
const
int
strength
=
ff_h263_loop_filter_strength
[
qscale
];
for
(
y
=
0
;
y
<
8
;
y
++
)
{
for
(
y
=
0
;
y
<
8
;
y
++
)
{
int
d1
,
d2
,
ad1
;
int
p0
=
src
[
y
*
stride
-
2
];
int
p1
=
src
[
y
*
stride
-
1
];
int
p2
=
src
[
y
*
stride
+
0
];
int
p3
=
src
[
y
*
stride
+
1
];
int
d
=
(
p0
-
p3
+
4
*
(
p2
-
p1
))
/
8
;
if
(
d
<-
2
*
strength
)
d1
=
0
;
else
if
(
d
<-
strength
)
d1
=-
2
*
strength
-
d
;
else
if
(
d
<
strength
)
d1
=
d
;
else
if
(
d
<
2
*
strength
)
d1
=
2
*
strength
-
d
;
else
d1
=
0
;
int
p0
=
src
[
y
*
stride
-
2
];
int
p1
=
src
[
y
*
stride
-
1
];
int
p2
=
src
[
y
*
stride
+
0
];
int
p3
=
src
[
y
*
stride
+
1
];
int
d
=
(
p0
-
p3
+
4
*
(
p2
-
p1
))
/
8
;
if
(
d
<
-
2
*
strength
)
d1
=
0
;
else
if
(
d
<
-
strength
)
d1
=
-
2
*
strength
-
d
;
else
if
(
d
<
strength
)
d1
=
d
;
else
if
(
d
<
2
*
strength
)
d1
=
2
*
strength
-
d
;
else
d1
=
0
;
p1
+=
d1
;
p2
-=
d1
;
if
(
p1
&
256
)
p1
=
~
(
p1
>>
31
);
if
(
p2
&
256
)
p2
=
~
(
p2
>>
31
);
if
(
p1
&
256
)
p1
=
~
(
p1
>>
31
);
if
(
p2
&
256
)
p2
=
~
(
p2
>>
31
);
src
[
y
*
stride
-
1
]
=
p1
;
src
[
y
*
stride
+
0
]
=
p2
;
src
[
y
*
stride
-
1
]
=
p1
;
src
[
y
*
stride
+
0
]
=
p2
;
ad1
=
FFABS
(
d1
)
>>
1
;
ad1
=
FFABS
(
d1
)
>>
1
;
d2
=
av_clip
((
p0
-
p3
)
/
4
,
-
ad1
,
ad1
);
d2
=
av_clip
((
p0
-
p3
)
/
4
,
-
ad1
,
ad1
);
src
[
y
*
stride
-
2
]
=
p0
-
d2
;
src
[
y
*
stride
+
1
]
=
p3
+
d2
;
src
[
y
*
stride
-
2
]
=
p0
-
d2
;
src
[
y
*
stride
+
1
]
=
p3
+
d2
;
}
}
static
void
h263_v_loop_filter_c
(
uint8_t
*
src
,
int
stride
,
int
qscale
){
static
void
h263_v_loop_filter_c
(
uint8_t
*
src
,
int
stride
,
int
qscale
)
{
int
x
;
const
int
strength
=
ff_h263_loop_filter_strength
[
qscale
];
const
int
strength
=
ff_h263_loop_filter_strength
[
qscale
];
for
(
x
=
0
;
x
<
8
;
x
++
)
{
for
(
x
=
0
;
x
<
8
;
x
++
)
{
int
d1
,
d2
,
ad1
;
int
p0
=
src
[
x
-
2
*
stride
];
int
p1
=
src
[
x
-
1
*
stride
];
int
p2
=
src
[
x
+
0
*
stride
];
int
p3
=
src
[
x
+
1
*
stride
];
int
d
=
(
p0
-
p3
+
4
*
(
p2
-
p1
))
/
8
;
if
(
d
<-
2
*
strength
)
d1
=
0
;
else
if
(
d
<-
strength
)
d1
=-
2
*
strength
-
d
;
else
if
(
d
<
strength
)
d1
=
d
;
else
if
(
d
<
2
*
strength
)
d1
=
2
*
strength
-
d
;
else
d1
=
0
;
int
p0
=
src
[
x
-
2
*
stride
];
int
p1
=
src
[
x
-
1
*
stride
];
int
p2
=
src
[
x
+
0
*
stride
];
int
p3
=
src
[
x
+
1
*
stride
];
int
d
=
(
p0
-
p3
+
4
*
(
p2
-
p1
))
/
8
;
if
(
d
<
-
2
*
strength
)
d1
=
0
;
else
if
(
d
<
-
strength
)
d1
=
-
2
*
strength
-
d
;
else
if
(
d
<
strength
)
d1
=
d
;
else
if
(
d
<
2
*
strength
)
d1
=
2
*
strength
-
d
;
else
d1
=
0
;
p1
+=
d1
;
p2
-=
d1
;
if
(
p1
&
256
)
p1
=
~
(
p1
>>
31
);
if
(
p2
&
256
)
p2
=
~
(
p2
>>
31
);
if
(
p1
&
256
)
p1
=
~
(
p1
>>
31
);
if
(
p2
&
256
)
p2
=
~
(
p2
>>
31
);
src
[
x
-
1
*
stride
]
=
p1
;
src
[
x
+
0
*
stride
]
=
p2
;
src
[
x
-
1
*
stride
]
=
p1
;
src
[
x
+
0
*
stride
]
=
p2
;
ad1
=
FFABS
(
d1
)
>>
1
;
ad1
=
FFABS
(
d1
)
>>
1
;
d2
=
av_clip
((
p0
-
p3
)
/
4
,
-
ad1
,
ad1
);
d2
=
av_clip
((
p0
-
p3
)
/
4
,
-
ad1
,
ad1
);
src
[
x
-
2
*
stride
]
=
p0
-
d2
;
src
[
x
+
stride
]
=
p3
+
d2
;
src
[
x
-
2
*
stride
]
=
p0
-
d2
;
src
[
x
+
stride
]
=
p3
+
d2
;
}
}
...
...
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