On Tue, Apr 05, 2011 at 03:30:10AM -0600, Nathan Caldwell wrote:
>
> --- a/libavcodec/aacpsy.c
> +++ b/libavcodec/aacpsy.c
> @@ -235,16 +287,33 @@ static av_cold int psy_3gpp_init(FFPsyContext *ctx) {
> + const int chan_bitrate = ctx->avctx->bit_rate / ctx->avctx->channels;
> + const int bandwidth = ctx->avctx->cutoff ? ctx->avctx->cutoff :
> ctx->avctx->sample_rate / 2;
> + const float num_bark = calc_bark((float)bandwidth);
nit: align the =
> + pctx->chan_bitrate = chan_bitrate;
> + pctx->frame_bits = chan_bitrate * AAC_BLOCK_SIZE_LONG /
> ctx->avctx->sample_rate;
> + pctx->pe.min = 8.0f * AAC_BLOCK_SIZE_LONG * bandwidth /
> (ctx->avctx->sample_rate * 2.0f);
> + pctx->pe.max = 12.0f * AAC_BLOCK_SIZE_LONG * bandwidth /
> (ctx->avctx->sample_rate * 2.0f);
> + ctx->bitres.size = 6144 - pctx->frame_bits;
> + ctx->bitres.size -= ctx->bitres.size % 8;
> + pctx->fill_level = ctx->bitres.size;
ditto
> @@ -385,6 +460,88 @@ static FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
>
> +/* 5.6.1.2 "Calculation of Bit Demand" */
> +static int calc_bit_demand(AacPsyContext *ctx, float pe, int bits, int size,
> int short_window)
nit: long line
> + band->pe = 0.0f;
> + band->pe_const = 0.0f;
> + band->active_lines = 0.0f;
nit: alignment
> +static float calc_reduction_3gpp(float a, float desired_pe, float pe, float
> active_lines)
nit: long line
> +static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr, float
> reduction)
ditto
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel