[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [6/7] - G.729 postfilter
Diego Biurrun
diego
Wed May 14 19:52:46 CEST 2008
On Sun, May 11, 2008 at 10:01:41PM +0700, Vladimir Voroshilov wrote:
>
> --- /dev/null
> +++ b/libavcodec/g729postfilter.c
> @@ -0,0 +1,705 @@
> +
> + /*
> + 4.2.1, Equation 79 Residual signal calculation
> + ( filtering through A(z/FORMANT_PP_FACTOR_NUM) , one half of short-term filter)
> + */
Stray space after the "("; this could be on just two lines.
> + /*
> + Compute denominator of pseudo-normalized correlation R'(0)
> + */
.
> + /*
> + Compute signals with non-integer delay k (with 1/8 precision), where k is in [0;6] range.
> + Entire delay is qual to best_delay+(k+1)/8
> + This is archieved by applying an interpolation filter of legth 33
> + to source signal.
> + */
> + Compute also maximum value of above denominators over all k.
Also compute
> + Search is done in [int(T0)-1; intT(0)+1] range with 1/8 precision
.
> + /*
> + Compute numerator of pseudo-normalized correlation R'(k)
> + (4.2.1, Equation 81)
.
> + Recompute delayed signal with an interpolation filter of length 129
.
> + Compute R'(k) correlation's numerator
.
> + Compute R'(k) correlation's denominator
.
> + Delayed signal will be selected if it increases R'(k)
> + correlation
.
> + //Checking if longer filter increases the values of R'(k)
Check, .
> + Filtering through selected filter
filter
> + * \brief calculate reflection coefficient for tilt compensation filter (4.2.3)
Capitalize, add period.
> + * \remark routine also calculate
> + * gain term for short-term filter (gf) and multiply speech
> + * data by 1/gf
The routine also calculates the gain term for the short-term filter (gf)
and multiplies the speech data by 1/gf.
> + * \note all members of lp_gn, except 10-19 must be equal to zero
Capitalize, add period.
> + * \brief apply tilt compensation filter (4.2.3)
ditto
> +int16_t g729_adaptive_gain_control(int gain_before, int gain_after, int16_t *speech, int subframe_size, int16_t gain_prev)
That's a very long line..
> --- /dev/null
> +++ b/libavcodec/g729postfilter.h
> @@ -0,0 +1,119 @@
> +
> +/**
> + * Tilt compensation factor (G.729, k1>0)
lowercase, same below
> + * 1.0 / (1.0 + 0.5) in Q15
> + * where 0.5 is minimum value of
is the
> + * At second stage long-term postfilter searches best fractional pitch
> + * delay with 1/(1+ANALYZED_FRAC_DELAYS) resolution around found at first stage
> + * integer pitch delay.
Ummm, "around" what?
Diego
More information about the ffmpeg-devel
mailing list