[FFmpeg-devel] [PATCH 2/4] ac3_fixed: fix computation of spx_noise_blend

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Mar 14 23:00:28 CET 2015


On 14.03.2015, at 12:48, Christophe Gisquet <christophe.gisquet at gmail.com> wrote:

> It was set to 1 instead of sqrt(3)
> ---
> libavcodec/ac3dec.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
> index ce45186..ae4129f 100644
> --- a/libavcodec/ac3dec.c
> +++ b/libavcodec/ac3dec.c
> @@ -939,7 +939,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
>                             nblend = 0;
>                             sblend = 0x800000;
>                         } else if (nratio > 0x7fffff) {
> -                            nblend = 0x800000;
> +                            nblend = 14529495; // sqrt(3) in FP.23

Wouldn't it be slightly more readable in hexadecimal still?
Not that I expect anyone to recognize sqrt(3) either way, but sanity-checking the values (e.g. that it is somewhere between 1 and 1.5) seems much easier in hex.


More information about the ffmpeg-devel mailing list