[FFmpeg-devel] [PATCH] Common ACELP routines (2/3) - filters
Vladimir Voroshilov
voroshil
Thu Apr 24 03:38:29 CEST 2008
Robert Swain wrote:
> On 23 Apr 2008, at 22:07, Michael Niedermayer wrote:
> > On Thu, Apr 24, 2008 at 02:15:51AM +0700, Vladimir Voroshilov wrote:
> >> Michael Niedermayer wrote:
> > [...]
> >>>> + v=0;
> >>>> + for(i=0; i<10; i++)
> >>>> + {
> >>>
> >>>> + /* R(x):=ac_v[-k+x] */
> >>>> + v += ac_v[n - pitch_delay_int - i ] *
> >>>> ff_g729_interp_filter[i][ pitch_delay_frac];
> >>>> + v = av_clip(v, -0x40000000, 0x3fffffff); //v += R(n-
> >>>> i)*ff_g729_interp_filter(t+3i)
> >>>> + v += ac_v[n - pitch_delay_int + i + 1] *
> >>>> ff_g729_interp_filter[i][3 - pitch_delay_frac];
> >>>> + v = av_clip(v, -0x40000000, 0x3fffffff); //v += R(n+i
> >>>> +1)*ff_g729_interp_filter(3-t+3i)
> >>>
> >>> The cliping is incorrect for generic code. Also i doubt g729
> >>> really needs
> >>> it. What happens without that cliping or at least with it at the
> >>> end, just
> >>> before storing in ac_v?
> >>
> >> Removing those line breaks OVERFLOW test (regardless of clipping
> >> outside loop),
> >> significantly reduces PSNR from bitexact's 99,99 to 18,54 without
> >> outside
> >> clipping and to 26,01 with it.
> >
> > What is the OVERFLOW test anyway? Is this a normal valid bitstream
> > generated
> > from a pcm wave? Or some sythetic overflow excercise which cannot be
> > generated
> > by any input wave?
> > (If you dont know you can test it by encoding the wave from overflow
> > to see if
> > there are still any overflows happening from the resulting bitstream)
>
> AMR does some overflow detection during synthesis.
>
> http://wiki.multimedia.cx/index.php?title=AMR-NB#Additional_instability_protection
>
> "If an overflow occurs during synthesis, the pitch vector, v(n), is
> scaled down by a factor of 4 and synthesis is conducted again
> bypassing emphasising the pitch vector contribution and adaptive gain
> control."
This check presents in ff_acelp_lp_synthesis routine as well.
This filter is the same for G.729, AMR, SIPR and may be others.
OVERFLOW test in G.729 is synthetic test vector for checking for
integer/short overflows in various places of decoder.
--
Regards,
Vladimir Voroshilov mailto:voroshil at gmail.com
Omsk State University
JID: voroshil at jabber.ru
ICQ: 95587719
More information about the ffmpeg-devel
mailing list