Commit 43b378a0 authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov

aaccoder: move the quantization functions to a separate file

This commit moves the quantizer to a separate header file.
This allows the quantizer to be used from a separate files outside
of aaccoder without having to put another function pointer and will
result in a slight speedup as the compiler can do more optimizations.

This is required for commits following.
Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
parent b47a1e5c
......@@ -254,6 +254,7 @@ typedef struct SingleChannelElement {
DECLARE_ALIGNED(32, INTFLOAT, saved)[1536]; ///< overlap
DECLARE_ALIGNED(32, INTFLOAT, ret_buf)[2048]; ///< PCM output buffer
DECLARE_ALIGNED(16, INTFLOAT, ltp_state)[3072]; ///< time signal for LTP
DECLARE_ALIGNED(32, AAC_FLOAT, pqcoeffs)[1024]; ///< quantization error of coefs (used by encoder)
PredictorState predictor_state[MAX_PREDICTORS];
INTFLOAT *ret; ///< PCM output
} SingleChannelElement;
......
This diff is collapsed.
......@@ -355,11 +355,14 @@ static void encode_spectral_coeffs(AACEncContext *s, SingleChannelElement *sce)
continue;
}
for (w2 = w; w2 < w + sce->ics.group_len[w]; w2++)
s->coder->quantize_and_encode_band(s, &s->pb, sce->coeffs + start + w2*128,
s->coder->quantize_and_encode_band(s, &s->pb,
&sce->coeffs[start + w2*128],
&sce->pqcoeffs[start + w2*128],
sce->ics.swb_sizes[i],
sce->sf_idx[w*16 + i],
sce->band_type[w*16 + i],
s->lambda, sce->ics.window_clipping[w]);
s->lambda,
sce->ics.window_clipping[w]);
start += sce->ics.swb_sizes[i];
}
}
......
......@@ -55,7 +55,7 @@ typedef struct AACCoefficientsEncoder {
SingleChannelElement *sce, const float lambda);
void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce,
int win, int group_len, const float lambda);
void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, int size,
void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, int size,
int scale_idx, int cb, const float lambda, int rtz);
void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
void (*search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment