summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.h
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2015-07-02 19:13:05 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-07-05 16:39:06 +0200
commit38fd4c2e664a38e17663d2d469c5e0f1ecec3269 (patch)
treea52d7532668bd48330f1a5270cc619fbfc6a3ca9 /libavcodec/aacenc.h
parent117b15f4a8d96b8ef9bb41e9bcc88a1ee693334a (diff)
downloadffmpeg-38fd4c2e664a38e17663d2d469c5e0f1ecec3269.tar.gz
aaccoder: add a new perceptual noise substitution implementation
This commit finalizes the PNS implementation previously added to the encoder by moving it to a seperate function search_for_pns() and thus making it coder-generic. This new implementation makes use of the spread field of the psy bands and the lambda quality feedback paremeter. The spread of the spectrum in a band prevents PNS from being used excessively and thus preserve more phase information in high frequencies. The lambda parameter allows the number of PNS-marked bands to vary based on the lambda parameter and the amount of bits available, making better choices on which bands are to be marked as noise. Comparisons with the previous PNS implementation can be found here: https://trac.ffmpeg.org/attachment/wiki/Encode/AAC/ This is V2 of the patch, the changes from the previous version being that this version uses the new band->spread metric from aacpsy and normalizes the energy using the group size. These changes were suggested by Claudio Freire on the mailing list. Another change is the use of lambda to alter the frequency threshold. This change makes the actual threshold frequencies vary between +-2Khz of what's specified, depending on frame encoding performance. Reviewed-by: Claudio Freire <klaussfreire@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacenc.h')
-rw-r--r--libavcodec/aacenc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h
index cc1b06afac..8ba58174a4 100644
--- a/libavcodec/aacenc.h
+++ b/libavcodec/aacenc.h
@@ -55,6 +55,7 @@ typedef struct AACCoefficientsEncoder {
void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
int scale_idx, int cb, const float lambda);
void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
+ void (*search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce, const float lambda);
void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe, const float lambda);
} AACCoefficientsEncoder;