[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [3/7] - vectors operations

Diego Biurrun diego
Sat May 3 12:46:27 CEST 2008


On Sat, May 03, 2008 at 02:53:40PM +0700, Vladimir Voroshilov wrote:
> 
> --- /dev/null
> +++ b/libavcodec/acelp_vectors.c
> @@ -0,0 +1,243 @@
> +/*
> + * Operations with adaptive and fixed codebook vectors for ACELP-based codecs

adaptive and fixed codebook vector operations for ACELP-based codecs

> +/*
> +  (EE) This table (from reference code) does not comply with specifiation !
> +  Specification contains following table:

(EE) This table (from reference code) does not comply with the specification!
The specification contains the following table:

> +/**
> + * Low-pass FIR (Finite Impulse Response) filter coefficients

low-pass

> + *     b30 is based on Hamming windowed sinc functions, truncated at +/-29 and
> + *     padded with zeros at +/-30 b30[30]=0

.

> +            /* Reference G.729 and AMR fixed point code performs clipping after
> +               each of the two following accumulations.

The reference G.729 and AMR fixed point code performs clipping
after each of the two following accumulations.

> +               Since clipping affects only synthetic OVERFLOW test and still not
> +               cause int type oveflow, it was moved outside loop. */

Since clipping affects only the synthetic OVERFLOW test without
causing an int type oveRflow, it was moved outside the loop.

> + * Tables differs only by width, so can be handled via common routine.

differ, so they can be handled by a common routine

> +    //clipping required here. breaks OVERFLOW test

Clipping required here; breaks OVERFLOW test.

> --- /dev/null
> +++ b/libavcodec/acelp_vectors.h
> @@ -0,0 +1,172 @@
> +/*
> + * Operations with adaptive and fixed codebook vectors for ACELP-based codecs

adaptive and fixed codebook vector operations for ACELP-based codecs

> + * \brief Decode the adaptive-codebook (pitch) vector (4.1.3 of G.729)

.

> + * The routine can be used for 1/3 precision too, by
> + * passing 2*pitch_delay_frac as third parameter

.

> + * \brief Decode fixed-codebook vector (3.8 of G.729, 5.7.1 of AMR)

.

> + * \param pulses_signs Signs of the excitation pulses (0 bit value means negative sign)

long line

> + * \remark last track in table should be read up-to-down, left-to-right

The last track in the table should be read top-to-bottom, left-to-right.

> + * \brief Decode fixed-codebook vector (D.5.8 of G.729)

.

> + * \param pulses_signs Signs of the excitation pulses (0 bit value means negative sign)
> + *
> + * \remark each track in table should be read up-to-down, left-to-right

see above

> + * \note (EE.1) This table (got from reference code) does not comply with specification

the specification.

> + * \note (EE.2) Reference G.729D code also uses gray decoding for each pulse index before
> + *              looking up value in the table.

the value, long line

> + * \brief Decode fixed-codebook vector (G.729, not standard)
> + * \param pulses_signs Signs of the excitation pulses (0 bit value means negative sign)
> + *
> + * \remark last track in table should be read up-to-down, left-to-right

see above

> + * Used in G.729 @4.4k

.

> + * \brief Enchance harmonic components of the fixed codevector (4.1.4 and 3.8 of G.729, 5.7.2 of AMR)

.

> + * \param fc_v [in/out] fixed codebook vector to enchance (-0x8000 <= (2.13) < 0x8000)

enHance

> + * This filter enchances harmonic components of the fixed codebook vector to
> + * improve the quaity of the reconstructed speech.

quaLity

> + * \brief Build excitation signal from pitch and innovation vectors (3.10 of G.729, 5.9 of AMR)

.

> + * \note it is safe to pass the same buffer for exc and av_c or fc_v

Capitalize, add period at the end.

May I suggest that you quickly run your stuff through a spellchecker,
that should catch a lot of mistakes :)

Diego




More information about the ffmpeg-devel mailing list