[FFmpeg-soc] [soc]: r3723 - in eac3: ac3dec.c ffmpeg.patch

jbr subversion at mplayerhq.hu
Sun Sep 7 23:25:55 CEST 2008


Author: jbr
Date: Sun Sep  7 23:25:55 2008
New Revision: 3723

Log:
more accurate fixed-point sqrt

Modified:
   eac3/ac3dec.c
   eac3/ffmpeg.patch

Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c	(original)
+++ eac3/ac3dec.c	Sun Sep  7 23:25:55 2008
@@ -857,8 +857,8 @@ static int decode_audio_block(AC3DecodeC
                         int bandsize = s->spx_band_sizes[bnd];
                         int nratio = (((bin + (bandsize >> 1)) << 23) / s->spx_end_freq) - spx_blend;
                         nratio = av_clip(nratio, 0, INT24_MAX);
-                        s->spx_noise_blend [ch][bnd] = ff_sqrt(            nratio) * M_SQRT_INT24_MAX;
-                        s->spx_signal_blend[ch][bnd] = ff_sqrt(INT24_MAX - nratio) * M_SQRT_INT24_MAX;
+                        s->spx_noise_blend [ch][bnd] = ff_sqrt((            nratio) << 8) * M_SQRT_POW2_15;
+                        s->spx_signal_blend[ch][bnd] = ff_sqrt((INT24_MAX - nratio) << 8) * M_SQRT_POW2_15;
                         bin += bandsize;
 
                         skip_bits(gbc, 4); // skip spx coord exponent

Modified: eac3/ffmpeg.patch
==============================================================================
--- eac3/ffmpeg.patch	(original)
+++ eac3/ffmpeg.patch	Sun Sep  7 23:25:55 2008
@@ -11,7 +11,7 @@ Index: libavcodec/ac3dec.h
  
 +#define INT24_MIN -8388608
 +#define INT24_MAX  8388607
-+#define M_SQRT_INT24_MAX 2896
++#define M_SQRT_POW2_15 181
 +
  typedef struct {
      AVCodecContext *avctx;                  ///< parent context



More information about the FFmpeg-soc mailing list