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
63744d8a
Commit
63744d8a
authored
Apr 03, 2017
by
Rostislav Pehlivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opusenc: remove unused header entries and simplify normalization
Signed-off-by:
Rostislav Pehlivanov
<
atomnuker@gmail.com
>
parent
a66121d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
14 deletions
+7
-14
opus_celt.h
libavcodec/opus_celt.h
+0
-3
opusenc.c
libavcodec/opusenc.c
+7
-11
No files found.
libavcodec/opus_celt.h
View file @
63744d8a
...
...
@@ -67,9 +67,6 @@ typedef struct CeltBlock {
uint8_t
collapse_masks
[
CELT_MAX_BANDS
];
int
band_bins
[
CELT_MAX_BANDS
];
/* MDCT bins per band */
float
*
band_coeffs
[
CELT_MAX_BANDS
];
/* buffer for mdct output + postfilter */
DECLARE_ALIGNED
(
32
,
float
,
buf
)[
2048
];
DECLARE_ALIGNED
(
32
,
float
,
coeffs
)[
CELT_MAX_FRAME_SIZE
];
...
...
libavcodec/opusenc.c
View file @
63744d8a
...
...
@@ -255,24 +255,20 @@ static int celt_frame_map_norm_bands(OpusEncContext *s, CeltFrame *f)
for
(
ch
=
0
;
ch
<
f
->
channels
;
ch
++
)
{
CeltBlock
*
block
=
&
f
->
block
[
ch
];
float
*
start
=
block
->
coeffs
;
for
(
i
=
0
;
i
<
CELT_MAX_BANDS
;
i
++
)
{
float
ener
=
0
.
0
f
;
int
band_offset
=
ff_celt_freq_bands
[
i
]
<<
f
->
size
;
int
band_size
=
ff_celt_freq_range
[
i
]
<<
f
->
size
;
float
*
coeffs
=
&
block
->
coeffs
[
band_offset
];
/* Calculate band bins */
block
->
band_bins
[
i
]
=
ff_celt_freq_range
[
i
]
<<
f
->
size
;
block
->
band_coeffs
[
i
]
=
start
;
start
+=
block
->
band_bins
[
i
];
/* Normalize band energy */
for
(
j
=
0
;
j
<
block
->
band_bins
[
i
];
j
++
)
ener
+=
block
->
band_coeffs
[
i
][
j
]
*
block
->
band_coeffs
[
i
][
j
];
for
(
j
=
0
;
j
<
band_size
;
j
++
)
ener
+=
coeffs
[
j
]
*
coeffs
[
j
];
block
->
lin_energy
[
i
]
=
sqrtf
(
ener
)
+
FLT_EPSILON
;
ener
=
1
.
0
f
/
block
->
lin_energy
[
i
];
for
(
j
=
0
;
j
<
b
lock
->
band_bins
[
i
]
;
j
++
)
block
->
band_coeffs
[
i
]
[
j
]
*=
ener
;
for
(
j
=
0
;
j
<
b
and_size
;
j
++
)
coeffs
[
j
]
*=
ener
;
block
->
energy
[
i
]
=
log2f
(
block
->
lin_energy
[
i
])
-
ff_celt_mean_energy
[
i
];
...
...
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