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
668afae4
Commit
668afae4
authored
Jun 27, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ac3enc: merge log2_tab() into normalize_samples()
parent
7dcdf974
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
ac3enc_fixed.c
libavcodec/ac3enc_fixed.c
+2
-14
No files found.
libavcodec/ac3enc_fixed.c
View file @
668afae4
...
...
@@ -71,19 +71,6 @@ void AC3_NAME(apply_window)(DSPContext *dsp, int16_t *output,
}
/**
* Calculate the log2() of the maximum absolute value in an array.
* @param tab input array
* @param n number of values in the array
* @return log2(max(abs(tab[])))
*/
static
int
log2_tab
(
AC3EncodeContext
*
s
,
int16_t
*
src
,
int
len
)
{
int
v
=
s
->
ac3dsp
.
ac3_max_msb_abs_int16
(
src
,
len
);
return
av_log2
(
v
);
}
/**
* Normalize the input samples to use the maximum available precision.
* This assumes signed 16-bit input samples.
...
...
@@ -92,7 +79,8 @@ static int log2_tab(AC3EncodeContext *s, int16_t *src, int len)
*/
int
AC3_NAME
(
normalize_samples
)(
AC3EncodeContext
*
s
)
{
int
v
=
14
-
log2_tab
(
s
,
s
->
windowed_samples
,
AC3_WINDOW_SIZE
);
int
v
=
s
->
ac3dsp
.
ac3_max_msb_abs_int16
(
s
->
windowed_samples
,
AC3_WINDOW_SIZE
);
v
=
14
-
av_log2
(
v
);
if
(
v
>
0
)
s
->
ac3dsp
.
ac3_lshift_int16
(
s
->
windowed_samples
,
AC3_WINDOW_SIZE
,
v
);
/* +6 to right-shift from 31-bit to 25-bit */
...
...
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