This fixes the following warning:
libavcodec/aacpsy.c:380:24: warning: ‘psy_3gpp_window’ defined but not used
[-Wunused-function]
---
libavcodec/aacpsy.c | 102 ---------------------------------------------------
1 files changed, 0 insertions(+), 102 deletions(-)
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c
index 5aea1fa..ae579a5 100644
--- a/libavcodec/aacpsy.c
+++ b/libavcodec/aacpsy.c
@@ -354,114 +354,12 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
}
/**
- * IIR filter used in block switching decision
- */
-static float iir_filter(int in, float state[2])
-{
- float ret;
-
- ret = 0.7548f * (in - state[0]) + 0.5095f * state[1];
- state[0] = in;
- state[1] = ret;
- return ret;
-}
-
-/**
* window grouping information stored as bits (0 - new group, 1 - group
continues)
*/
static const uint8_t window_grouping[9] = {
0xB6, 0x6C, 0xD8, 0xB2, 0x66, 0xC6, 0x96, 0x36, 0x36
};
-/**
- * Tell encoder which window types to use.
- * @see 3GPP TS26.403 5.4.1 "Blockswitching"
- */
-static FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
- const int16_t *audio, const int16_t *la,
- int channel, int prev_type)
-{
- int i, j;
- int br = ctx->avctx->bit_rate / ctx->avctx->channels;
- int attack_ratio = br <= 16000 ? 18 : 10;
- AacPsyContext *pctx = (AacPsyContext*) ctx->model_priv_data;
- AacPsyChannel *pch = &pctx->ch[channel];
- uint8_t grouping = 0;
- int next_type = pch->next_window_seq;
- FFPsyWindowInfo wi;
-
- memset(&wi, 0, sizeof(wi));
- if (la) {
- float s[8], v;
- int switch_to_eight = 0;
- float sum = 0.0, sum2 = 0.0;
- int attack_n = 0;
- int stay_short = 0;
- for (i = 0; i < 8; i++) {
- for (j = 0; j < 128; j++) {
- v = iir_filter(la[(i*128+j)*ctx->avctx->channels],
pch->iir_state);
- sum += v*v;
- }
- s[i] = sum;
- sum2 += sum;
- }
- for (i = 0; i < 8; i++) {
- if (s[i] > pch->win_energy * attack_ratio) {
- attack_n = i + 1;
- switch_to_eight = 1;
- break;
- }
- }
- pch->win_energy = pch->win_energy*7/8 + sum2/64;
-
- wi.window_type[1] = prev_type;
- switch (prev_type) {
- case ONLY_LONG_SEQUENCE:
- wi.window_type[0] = switch_to_eight ? LONG_START_SEQUENCE :
ONLY_LONG_SEQUENCE;
- next_type = switch_to_eight ? EIGHT_SHORT_SEQUENCE :
ONLY_LONG_SEQUENCE;
- break;
- case LONG_START_SEQUENCE:
- wi.window_type[0] = EIGHT_SHORT_SEQUENCE;
- grouping = pch->next_grouping;
- next_type = switch_to_eight ? EIGHT_SHORT_SEQUENCE :
LONG_STOP_SEQUENCE;
- break;
- case LONG_STOP_SEQUENCE:
- wi.window_type[0] = switch_to_eight ? LONG_START_SEQUENCE :
ONLY_LONG_SEQUENCE;
- next_type = switch_to_eight ? EIGHT_SHORT_SEQUENCE :
ONLY_LONG_SEQUENCE;
- break;
- case EIGHT_SHORT_SEQUENCE:
- stay_short = next_type == EIGHT_SHORT_SEQUENCE || switch_to_eight;
- wi.window_type[0] = stay_short ? EIGHT_SHORT_SEQUENCE :
LONG_STOP_SEQUENCE;
- grouping = next_type == EIGHT_SHORT_SEQUENCE ? pch->next_grouping
: 0;
- next_type = switch_to_eight ? EIGHT_SHORT_SEQUENCE :
LONG_STOP_SEQUENCE;
- break;
- }
-
- pch->next_grouping = window_grouping[attack_n];
- pch->next_window_seq = next_type;
- } else {
- for (i = 0; i < 3; i++)
- wi.window_type[i] = prev_type;
- grouping = (prev_type == EIGHT_SHORT_SEQUENCE) ? window_grouping[0] :
0;
- }
-
- wi.window_shape = 1;
- if (wi.window_type[0] != EIGHT_SHORT_SEQUENCE) {
- wi.num_windows = 1;
- wi.grouping[0] = 1;
- } else {
- int lastgrp = 0;
- wi.num_windows = 8;
- for (i = 0; i < 8; i++) {
- if (!((grouping >> i) & 1))
- lastgrp = i;
- wi.grouping[lastgrp]++;
- }
- }
-
- return wi;
-}
-
/* 5.6.1.2 "Calculation of Bit Demand" */
static int calc_bit_demand(AacPsyContext *ctx, float pe, int bits, int size,
int short_window)
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel