Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
f50d9377
Commit
f50d9377
authored
13 years ago
by
Nathan Caldwell
Committed by
Martin Storsjö
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
aacenc: Fix whitespace after last commit.
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
62582a69
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/aacpsy.c
+13
-10
13 additions, 10 deletions
libavcodec/aacpsy.c
with
13 additions
and
10 deletions
libavcodec/aacpsy.c
+
13
−
10
View file @
f50d9377
...
...
@@ -100,9 +100,9 @@ enum {
* information for single band used by 3GPP TS26.403-inspired psychoacoustic model
*/
typedef
struct
AacPsyBand
{
float
energy
;
///< band energy
float
thr
;
///< energy threshold
float
thr_quiet
;
///< threshold in quiet
float
energy
;
///< band energy
float
thr
;
///< energy threshold
float
thr_quiet
;
///< threshold in quiet
float
nz_lines
;
///< number of non-zero spectral lines
float
active_lines
;
///< number of active spectral lines
float
pe
;
///< perceptual entropy
...
...
@@ -566,43 +566,46 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
float
desired_bits
,
desired_pe
,
delta_pe
,
reduction
,
spread_en
[
128
]
=
{
0
};
float
a
=
0
.
0
f
,
active_lines
=
0
.
0
f
,
norm_fac
=
0
.
0
f
;
float
pe
=
pctx
->
chan_bitrate
>
32000
?
0
.
0
f
:
FFMAX
(
50
.
0
f
,
100
.
0
f
-
pctx
->
chan_bitrate
*
100
.
0
f
/
32000
.
0
f
);
const
int
num_bands
=
ctx
->
num_bands
[
wi
->
num_windows
==
8
];
const
uint8_t
*
band_sizes
=
ctx
->
bands
[
wi
->
num_windows
==
8
];
AacPsyCoeffs
*
coeffs
=
pctx
->
psy_coef
[
wi
->
num_windows
==
8
];
const
int
num_bands
=
ctx
->
num_bands
[
wi
->
num_windows
==
8
];
const
uint8_t
*
band_sizes
=
ctx
->
bands
[
wi
->
num_windows
==
8
];
AacPsyCoeffs
*
coeffs
=
pctx
->
psy_coef
[
wi
->
num_windows
==
8
];
const
float
avoid_hole_thr
=
wi
->
num_windows
==
8
?
PSY_3GPP_AH_THR_SHORT
:
PSY_3GPP_AH_THR_LONG
;
//calculate energies, initial thresholds and related values - 5.4.2 "Threshold Calculation"
for
(
w
=
0
;
w
<
wi
->
num_windows
*
16
;
w
+=
16
)
{
for
(
g
=
0
;
g
<
num_bands
;
g
++
)
{
AacPsyBand
*
band
=
&
pch
->
band
[
w
+
g
];
float
form_factor
=
0
.
0
f
;
band
->
energy
=
0
.
0
f
;
for
(
i
=
0
;
i
<
band_sizes
[
g
];
i
++
)
{
band
->
energy
+=
coefs
[
start
+
i
]
*
coefs
[
start
+
i
];
form_factor
+=
sqrtf
(
fabs
(
coefs
[
start
+
i
]));
}
band
->
thr
=
band
->
energy
*
0
.
00125
8925
f
;
band
->
thr
=
band
->
energy
*
0
.
00125
8925
f
;
band
->
nz_lines
=
form_factor
/
powf
(
band
->
energy
/
band_sizes
[
g
],
0
.
25
f
);
start
+=
band_sizes
[
g
];
start
+=
band_sizes
[
g
];
}
}
//modify thresholds and energies - spread, threshold in quiet, pre-echo control
for
(
w
=
0
;
w
<
wi
->
num_windows
*
16
;
w
+=
16
)
{
AacPsyBand
*
bands
=
&
pch
->
band
[
w
];
//5.4.2.3 "Spreading" & 5.4.3 "Spreaded Energy Calculation"
spread_en
[
0
]
=
bands
[
0
].
energy
;
for
(
g
=
1
;
g
<
num_bands
;
g
++
)
{
bands
[
g
].
thr
=
FFMAX
(
bands
[
g
].
thr
,
bands
[
g
-
1
].
thr
*
coeffs
[
g
].
spread_hi
[
0
]);
bands
[
g
].
thr
=
FFMAX
(
bands
[
g
].
thr
,
bands
[
g
-
1
].
thr
*
coeffs
[
g
].
spread_hi
[
0
]);
spread_en
[
w
+
g
]
=
FFMAX
(
bands
[
g
].
energy
,
spread_en
[
w
+
g
-
1
]
*
coeffs
[
g
].
spread_hi
[
1
]);
}
for
(
g
=
num_bands
-
2
;
g
>=
0
;
g
--
)
{
bands
[
g
].
thr
=
FFMAX
(
bands
[
g
].
thr
,
bands
[
g
+
1
].
thr
*
coeffs
[
g
].
spread_low
[
0
]);
bands
[
g
].
thr
=
FFMAX
(
bands
[
g
].
thr
,
bands
[
g
+
1
].
thr
*
coeffs
[
g
].
spread_low
[
0
]);
spread_en
[
w
+
g
]
=
FFMAX
(
spread_en
[
w
+
g
],
spread_en
[
w
+
g
+
1
]
*
coeffs
[
g
].
spread_low
[
1
]);
}
//5.4.2.4 "Threshold in quiet"
for
(
g
=
0
;
g
<
num_bands
;
g
++
)
{
AacPsyBand
*
band
=
&
bands
[
g
];
band
->
thr_quiet
=
band
->
thr
=
FFMAX
(
band
->
thr
,
coeffs
[
g
].
ath
);
//5.4.2.5 "Pre-echo control"
if
(
!
(
wi
->
window_type
[
0
]
==
LONG_STOP_SEQUENCE
||
(
wi
->
window_type
[
1
]
==
LONG_START_SEQUENCE
&&
!
w
)))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment