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
538a3841
Commit
538a3841
authored
Apr 05, 2005
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
10% faster unpack_coeffs
Originally committed as revision 4108 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3cff4572
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
18 deletions
+38
-18
snow.c
libavcodec/snow.c
+31
-11
ffmpeg.regression.ref
tests/ffmpeg.regression.ref
+4
-4
rotozoom.regression.ref
tests/rotozoom.regression.ref
+3
-3
No files found.
libavcodec/snow.c
View file @
538a3841
...
...
@@ -71,6 +71,24 @@ static const int8_t quant3b[256]={
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
-
1
,
};
static
const
int8_t
quant3bA
[
256
]
=
{
0
,
0
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1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
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
1
,
-
1
,
};
static
const
int8_t
quant5
[
256
]
=
{
0
,
1
,
1
,
1
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
2
,
...
...
@@ -373,7 +391,7 @@ typedef struct BlockNode{
typedef
struct
x_and_coeff
{
int16_t
x
;
int16_t
coeff
;
u
int16_t
coeff
;
}
x_and_coeff
;
typedef
struct
SubBand
{
...
...
@@ -1702,9 +1720,11 @@ static int encode_subband_c0run(SnowContext *s, SubBand *b, DWTELEM *src, DWTELE
}
if
(
v
){
int
context
=
av_log2
(
/*ABS(ll) + */
3
*
ABS
(
l
)
+
ABS
(
lt
)
+
2
*
ABS
(
t
)
+
ABS
(
rt
)
+
ABS
(
p
));
int
l2
=
2
*
ABS
(
l
)
+
(
l
<
0
);
int
t2
=
2
*
ABS
(
t
)
+
(
t
<
0
);
put_symbol2
(
&
s
->
c
,
b
->
state
[
context
+
2
],
ABS
(
v
)
-
1
,
context
-
4
);
put_rac
(
&
s
->
c
,
&
b
->
state
[
0
][
16
+
1
+
3
+
quant3b
[
l
&
0xFF
]
+
3
*
quant3b
[
t
&
0xFF
]],
v
<
0
);
put_rac
(
&
s
->
c
,
&
b
->
state
[
0
][
16
+
1
+
3
+
quant3b
A
[
l2
&
0xFF
]
+
3
*
quant3bA
[
t2
&
0xFF
]],
v
<
0
);
}
}
}
...
...
@@ -1763,7 +1783,7 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
}
}
if
(
/*ll|*/
l
|
lt
|
t
|
rt
|
p
){
int
context
=
av_log2
(
/*ABS(ll) + */
3
*
ABS
(
l
)
+
ABS
(
lt
)
+
2
*
ABS
(
t
)
+
ABS
(
rt
)
+
ABS
(
p
));
int
context
=
av_log2
(
/*ABS(ll) + */
3
*
(
l
>>
1
)
+
(
lt
>>
1
)
+
(
t
&~
1
)
+
(
rt
>>
1
)
+
(
p
>>
1
));
v
=
get_rac
(
&
s
->
c
,
&
b
->
state
[
0
][
context
]);
}
else
{
...
...
@@ -1785,10 +1805,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
}
}
if
(
v
){
int
context
=
av_log2
(
/*ABS(ll) + */
3
*
ABS
(
l
)
+
ABS
(
lt
)
+
2
*
ABS
(
t
)
+
ABS
(
rt
)
+
ABS
(
p
));
v
=
get_symbol2
(
&
s
->
c
,
b
->
state
[
context
+
2
],
context
-
4
)
+
1
;
if
(
get_rac
(
&
s
->
c
,
&
b
->
state
[
0
][
16
+
1
+
3
+
quant3b
[
l
&
0xFF
]
+
3
*
quant3b
[
t
&
0xFF
]]))
v
*=
-
1
;
int
context
=
av_log2
(
/*ABS(ll) + */
3
*
(
l
>>
1
)
+
(
lt
>>
1
)
+
(
t
&~
1
)
+
(
rt
>>
1
)
+
(
p
>>
1
));
v
=
2
*
(
get_symbol2
(
&
s
->
c
,
b
->
state
[
context
+
2
],
context
-
4
)
+
1
)
;
v
+=
get_rac
(
&
s
->
c
,
&
b
->
state
[
0
][
16
+
1
+
3
+
quant3bA
[
l
&
0xFF
]
+
3
*
quant3bA
[
t
&
0xFF
]]);
b
->
x_coeff
[
index
].
x
=
x
;
b
->
x_coeff
[
index
++
].
coeff
=
v
;
}
...
...
@@ -1842,10 +1862,10 @@ static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, sli
x
=
b
->
x_coeff
[
new_index
++
].
x
;
while
(
x
<
w
)
{
if
(
v
<
0
)
line
[
x
]
=
-
((
-
v
*
qmul
+
qadd
)
>>
(
QEXPSHIFT
)
);
else
line
[
x
]
=
((
v
*
qmul
+
qadd
)
>>
(
QEXPSHIFT
));
register
int
t
=
(
(
v
>>
1
)
*
qmul
+
qadd
)
>>
QEXPSHIFT
;
register
int
u
=
-
(
v
&
1
);
line
[
x
]
=
(
t
^
u
)
-
u
;
v
=
b
->
x_coeff
[
new_index
].
coeff
;
x
=
b
->
x_coeff
[
new_index
++
].
x
;
}
...
...
tests/ffmpeg.regression.ref
View file @
538a3841
...
...
@@ -119,12 +119,12 @@ a7ef4746f27be309138c188e327d3ebe *./data/a-ffv1.avi
2653642 ./data/a-ffv1.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
ba3d08fe9c54acb58cb72e02476849d7
*./data/a-snow.avi
128060
0
./data/a-snow.avi
3e7738ae0429e48d3465d4f941eb7448
*./data/a-snow.avi
128060
2
./data/a-snow.avi
e4b8c83278efee032a84569c25593937 *./data/out.yuv
stddev: 2.92 PSNR:38.79 bytes:7602176
7acf773e701b92dbc15a6852aac329b6
*./data/a-snow53.avi
3537
41
2 ./data/a-snow53.avi
45687368463932f08dbc74c973ad32dd
*./data/a-snow53.avi
3537
04
2 ./data/a-snow53.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
b5b6275f58f012de73644bbaa9080097 *./data/a-svq1.mov
...
...
tests/rotozoom.regression.ref
View file @
538a3841
...
...
@@ -119,12 +119,12 @@ d0831a8339491fd680b650f05262e5d9 *./data/a-ffv1.avi
3524768 ./data/a-ffv1.avi
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
440794294cc44c4cb25e32b947ba3311
*./data/a-snow.avi
6e0ea3a5128f54f42e5fdb81532d95fe
*./data/a-snow.avi
332700 ./data/a-snow.avi
1f3439e1b3ff09492f196a024d7119e3 *./data/out.yuv
stddev: 2.37 PSNR:40.60 bytes:7602176
eaea93acf339ad2a7349dc5d0872e870
*./data/a-snow53.avi
272457
4
./data/a-snow53.avi
92ab639886be86087942dd76cfd91bf3
*./data/a-snow53.avi
272457
2
./data/a-snow53.avi
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
920c610ec324b772d882b0717e375943 *./data/a-svq1.mov
...
...
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