Mercurial > libavcodec.hg
comparison psymodel.c @ 9937:3e39dbd2d9eb libavcodec
cosmetics: prettyprinting, K&R style, break overly long lines
author | diego |
---|---|
date | Wed, 08 Jul 2009 21:16:06 +0000 |
parents | 7f42ae22c351 |
children | 6c1ac45b3097 |
comparison
equal
deleted
inserted
replaced
9936:7f42ae22c351 | 9937:3e39dbd2d9eb |
---|---|
79 av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *avctx) | 79 av_cold struct FFPsyPreprocessContext* ff_psy_preprocess_init(AVCodecContext *avctx) |
80 { | 80 { |
81 FFPsyPreprocessContext *ctx; | 81 FFPsyPreprocessContext *ctx; |
82 int i; | 82 int i; |
83 float cutoff_coeff; | 83 float cutoff_coeff; |
84 ctx = av_mallocz(sizeof(FFPsyPreprocessContext)); | 84 ctx = av_mallocz(sizeof(FFPsyPreprocessContext)); |
85 ctx->avctx = avctx; | 85 ctx->avctx = avctx; |
86 | 86 |
87 if (avctx->flags & CODEC_FLAG_QSCALE) | 87 if (avctx->flags & CODEC_FLAG_QSCALE) |
88 cutoff_coeff = 1.0f / av_clip(1 + avctx->global_quality / FF_QUALITY_SCALE, 1, 8); | 88 cutoff_coeff = 1.0f / av_clip(1 + avctx->global_quality / FF_QUALITY_SCALE, 1, 8); |
89 else | 89 else |
90 cutoff_coeff = avctx->bit_rate / (4.0f * avctx->sample_rate * avctx->channels); | 90 cutoff_coeff = avctx->bit_rate / (4.0f * avctx->sample_rate * avctx->channels); |
91 | 91 |
92 ctx->fcoeffs = ff_iir_filter_init_coeffs(FF_FILTER_TYPE_BUTTERWORTH, FF_FILTER_MODE_LOWPASS, | 92 ctx->fcoeffs = ff_iir_filter_init_coeffs(FF_FILTER_TYPE_BUTTERWORTH, FF_FILTER_MODE_LOWPASS, |
93 FILT_ORDER, cutoff_coeff, 0.0, 0.0); | 93 FILT_ORDER, cutoff_coeff, 0.0, 0.0); |
94 if (ctx->fcoeffs) { | 94 if (ctx->fcoeffs) { |
95 ctx->fstate = av_mallocz(sizeof(ctx->fstate[0]) * avctx->channels); | 95 ctx->fstate = av_mallocz(sizeof(ctx->fstate[0]) * avctx->channels); |
96 for (i = 0; i < avctx->channels; i++) | 96 for (i = 0; i < avctx->channels; i++) |
97 ctx->fstate[i] = ff_iir_filter_init_state(FILT_ORDER); | 97 ctx->fstate[i] = ff_iir_filter_init_state(FILT_ORDER); |
98 } | 98 } |