From b629c67ddfceb7026e407685f04d1bb09cb08d31 Mon Sep 17 00:00:00 2001 From: Claudio Freire Date: Mon, 12 Oct 2015 03:56:22 -0300 Subject: AAC encoder: memoize quantize_band_cost The bulk of calls to quantize_band_cost are replaced by a call to a version that memoizes, greatly improving performance, since during coefficient search there is a great deal of repeat work. Memoization cannot always be applied, so do this in a different function, and leave the original as-is. --- libavcodec/mips/aaccoder_mips.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavcodec/mips/aaccoder_mips.c') diff --git a/libavcodec/mips/aaccoder_mips.c b/libavcodec/mips/aaccoder_mips.c index e85bf8c5ca..269a12465f 100644 --- a/libavcodec/mips/aaccoder_mips.c +++ b/libavcodec/mips/aaccoder_mips.c @@ -2388,6 +2388,8 @@ static float quantize_band_cost(struct AACEncContext *s, const float *in, return get_band_cost(s, NULL, in, scaled, size, scale_idx, cb, lambda, uplim, bits, energy); } +#include "libavcodec/aacenc_quantization_misc.h" + static float find_form_factor(int group_len, int swb_size, float thresh, const float *scaled, float nzslope) { const float iswb_size = 1.0f / swb_size; const float iswb_sizem1 = 1.0f / (swb_size - 1); -- cgit v1.2.3