[FFmpeg-devel] [PATCH] ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext
Christophe Gisquet
christophe.gisquet at gmail.com
Fri Mar 13 22:46:11 CET 2015
Hi,
2015-03-13 22:28 GMT+01:00 Andreas Cadhalpun <andreas.cadhalpun at googlemail.com>:
> -int ff_eac3_parse_header(AC3DecodeContext *s);
> +static int ff_eac3_parse_header(AC3DecodeContext *s);
It's somewhat cosmetics, but if these functions become static, they
would better drop the ff_ prefix.
> - float accum = 0.0f;
> + INTFLOAT accum = 0.0f;
[...]
> for (i = 0; i < bandsize; i++) {
> - float coeff = s->transform_coeffs[ch][bin++];
> + INTFLOAT coeff = s->transform_coeffs[ch][bin++];
> accum += coeff * coeff;
[...]
> - float nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN);
> - float sscale = s->spx_signal_blend[ch][bnd];
> + INTFLOAT nscale = s->spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN);
> + INTFLOAT sscale = s->spx_signal_blend[ch][bnd];
> for (i = 0; i < s->spx_band_sizes[bnd]; i++) {
> - float noise = nscale * (int32_t)av_lfg_get(&s->dith_state);
> + INTFLOAT noise = nscale * (int32_t)av_lfg_get(&s->dith_state);
Does that work at all? I mean, if it's fixedpoint, I would have
expected some renormalization, various things to avoid overflows,
potential warnings because of casts, etc.
And is the output on eac3 samples, eg here:
http://samples.mplayerhq.hu/A-codecs/AC3/eac3/
(particularly the spx ones)
anything listenable?
Maybe the extensions should simply be declared as unsupported by the fp version?
--
Christophe
More information about the ffmpeg-devel
mailing list