summaryrefslogtreecommitdiff
path: root/libavcodec/aacpsy.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-30 04:20:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-30 04:32:24 +0200
commit8c0cbb0848430e4de7182dc2fa2f70262d8c77c7 (patch)
treed08758ea987f08f1d5a8caf44f082adc5586e815 /libavcodec/aacpsy.c
parent623bf96678d2009d34e88ed7c2b73c00930cebae (diff)
parent812f2376eecc19c40a95ade1f7a43b762106e0f7 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rational-test: Add proper main() declaration to fix gcc warnings. configure: Add vdpau and dxva2 to configure results output. Remove unused, never built libavutil/pca.[ch] matroskadec: forward parsing errors to caller. av_find_stream_info: simplify EAGAIN handling. aacenc: Fix determination of Mid/Side Mode. psymodel: Remove the single channel analysis function aacenc: Implement dummy channel group analysis that just calls the single channel analysis for each channel. psymodel: Add channels and channel groups to the psymodel. ARM: remove check for PLD instruction fate: move amr[nw]b test rules into separate files ogg: fix double free when finding length of small chained oggs. swscale: implement >8bit scaling support. build: fix creation of tools dir with make 3.81 build: Mark all-yes Makefile target as phony. pixfmt: fix YUV422/444 wrong endian comment build: create output directories as needed Add new yuv444 pixfmts to avcodec_align_dimensions2 Conflicts: Makefile configure libavutil/pca.c libavutil/pca.h libavutil/pixfmt.h libswscale/swscale.c libswscale/utils.c libswscale/x86/swscale_template.c tests/ref/lavfi/pixdesc tests/ref/lavfi/pixfmts_copy tests/ref/lavfi/pixfmts_null tests/ref/lavfi/pixfmts_scale tests/ref/lavfi/pixfmts_vflip Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacpsy.c')
-rw-r--r--libavcodec/aacpsy.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index f2b525694b..4152b70bbf 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -557,8 +557,8 @@ static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
/**
* Calculate band thresholds as suggested in 3GPP TS26.403
*/
-static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
- const float *coefs, const FFPsyWindowInfo *wi)
+static void psy_3gpp_analyze_channel(FFPsyContext *ctx, int channel,
+ const float *coefs, const FFPsyWindowInfo *wi)
{
AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
AacPsyChannel *pch = &pctx->ch[channel];
@@ -627,7 +627,7 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
}
/* 5.6.1.3.2 "Calculation of the desired perceptual entropy" */
- ctx->pe[channel] = pe;
+ ctx->ch[channel].entropy = pe;
desired_bits = calc_bit_demand(pctx, pe, ctx->bitres.bits, ctx->bitres.size, wi->num_windows == 8);
desired_pe = PSY_3GPP_BITS_TO_PE(desired_bits);
/* NOTE: PE correction is kept simple. During initial testing it had very
@@ -731,7 +731,7 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
for (w = 0; w < wi->num_windows*16; w += 16) {
for (g = 0; g < num_bands; g++) {
AacPsyBand *band = &pch->band[w+g];
- FFPsyBand *psy_band = &ctx->psy_bands[channel*PSY_MAX_BANDS+w+g];
+ FFPsyBand *psy_band = &ctx->ch[channel].psy_bands[w+g];
psy_band->threshold = band->thr;
psy_band->energy = band->energy;
@@ -741,6 +741,16 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
memcpy(pch->prev_band, pch->band, sizeof(pch->band));
}
+static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
+ const float **coeffs, const FFPsyWindowInfo *wi)
+{
+ int ch;
+ FFPsyChannelGroup *group = ff_psy_find_group(ctx, channel);
+
+ for (ch = 0; ch < group->num_ch; ch++)
+ psy_3gpp_analyze_channel(ctx, channel + ch, coeffs[ch], &wi[ch]);
+}
+
static av_cold void psy_3gpp_end(FFPsyContext *apc)
{
AacPsyContext *pctx = (AacPsyContext*) apc->model_priv_data;