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
bf5d814f
Commit
bf5d814f
authored
May 02, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/wavpackenc: use ff_clz()
parent
7eba2645
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
28 deletions
+3
-28
wavpackenc.c
libavcodec/wavpackenc.c
+3
-17
wavpackenc.h
libavcodec/wavpackenc.h
+0
-11
No files found.
libavcodec/wavpackenc.c
View file @
bf5d814f
...
...
@@ -637,21 +637,15 @@ static void reverse_mono_decorr(struct Decorr *dpp)
}
}
#define count_bits(av) ((av) ? 32 - ff_clz(av) : 0)
static
uint32_t
log2sample
(
uint32_t
v
,
int
limit
,
uint32_t
*
result
)
{
uint32_t
dbits
;
uint32_t
dbits
=
count_bits
(
v
)
;
if
((
v
+=
v
>>
9
)
<
(
1
<<
8
))
{
dbits
=
nbits_table
[
v
];
*
result
+=
(
dbits
<<
8
)
+
wp_log2_table
[(
v
<<
(
9
-
dbits
))
&
0xff
];
}
else
{
if
(
v
<
(
1
<<
16
))
dbits
=
nbits_table
[
v
>>
8
]
+
8
;
else
if
(
v
<
(
1
<<
24
))
dbits
=
nbits_table
[
v
>>
16
]
+
16
;
else
dbits
=
nbits_table
[
v
>>
24
]
+
24
;
*
result
+=
dbits
=
(
dbits
<<
8
)
+
wp_log2_table
[(
v
>>
(
dbits
-
9
))
&
0xff
];
if
(
limit
&&
dbits
>=
limit
)
...
...
@@ -1969,14 +1963,6 @@ static int wv_stereo(WavPackEncodeContext *s,
return
0
;
}
#define count_bits(av) ( \
(av) < (1 << 8) ? nbits_table[av] : \
( \
(av) < (1 << 16) ? nbits_table[(av) >> 8] + 8 : \
((av) < (1 << 24) ? nbits_table[(av) >> 16] + 16 : nbits_table[(av) >> 24] + 24) \
) \
)
static
void
encode_flush
(
WavPackEncodeContext
*
s
)
{
WavPackWords
*
w
=
&
s
->
w
;
...
...
libavcodec/wavpackenc.h
View file @
bf5d814f
...
...
@@ -650,15 +650,4 @@ static const uint16_t decorr_filter_sizes[] = {
static
const
uint8_t
decorr_filter_nterms
[]
=
{
2
,
5
,
10
,
16
};
static
const
int8_t
nbits_table
[]
=
{
0
,
1
,
2
,
2
,
3
,
3
,
3
,
3
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
5
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
};
#endif
/* AVCODEC_WAVPACKENC_H */
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