1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-11 03:16:59 +02:00
Commit Graph

6 Commits

Author SHA1 Message Date
Rostislav Pehlivanov
1956cfbaed aacenc_is: take absolute coefficient value upon energy calculations
This was an oversight when the IS system was being first implemented.
The ener01 part was largely a result of trial and error and the fact
that the sum of coef0 and coef1 could result in a zero was
overlooked. Once ener01 turns to zero it's used to divide the left
channel energy which doesn't turn out so well as it fills IS[]
with -nan's and inf's which in turn confused the quantize_band_cost.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-06 18:36:42 +01:00
Rostislav Pehlivanov
a71f7de95b aacenc_is: ignore PNS band types
It's better to trust that the coefficients generated will be
closer than the coefficients derived, and the new PNS implementation
makes sure that this happens.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-06 15:30:26 +01:00
Rostislav Pehlivanov
4565611b04 aacenc_is: add a flag to use pure coefficients instead
This commit adds a flag to use the pure coefficients instead
of the processed ones (sce->coeffs). This is needed because
IS will apply the changes to the coefficients immediately
before the adjust_common_prediction function and it doesn't
make sense to measure stereo channel coefficient difference
when one of the channels coefficients are all zero.

Therefore add a flag to use pure coefficients in that case.
TNS is the only thing touching the coefficients before IS
so common window prediction will not take that into account
but the effect of the TNS filter per coefficient can be small
(a few percent) so to some approximation it's fine to just
ignore that.

Also fixed a small error which doesn't alter the results
that much. pow(sqrt(number), 3.0/4.0) == pow(number, 3.0/8.0) !=
pow(number, 3.0/4.0).

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-09-05 08:32:09 +01:00
Rostislav Pehlivanov
2c94e45fad aacenc_is: rename struct to follow guidelines
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-08-22 06:47:14 +01:00
Timothy Gu
21dd5279c3 aacenc: Add missing ff_ prefixes
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
2015-08-22 06:11:23 +01:00
Rostislav Pehlivanov
d1ca7142ac aaccoder: move the Intensity Stereo implementation out
This commit moves the intensity stereo implementation
out from aaccoder and into a separate file. This was
possible using the previous commits.

This commit also drastically improves the IS implementation
by making it phase invariant e.g. it will always choose the
best possible phase regardless of whether M/S coding is on
or most of the coefficients have identical phases.
This also increases the quality and reduces any distortions
introduced by enablind intensity stereo.

Users are encouraged to test it out using the -aac_is 1
parameter as it has always been.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2015-08-21 19:13:26 +01:00