[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [4/7] - G.729 core
Sun May 4 12:20:30 CEST 2008
On Fri, May 02, 2008 at 06:45:53PM +0700, Vladimir Voroshilov wrote:
> Patch contains latest version of G.729 decoder (without tables and postfilter).
> --- /dev/null
> +++ b/libavcodec/g729.h
> @@ -0,0 +1,138 @@
> +/// Interpolation filter length
There is no reason to capitalize here, same below.
> + uint8_t quantizer_2nd_lo; ///< second stage lowervector of quantizer (size in bits)
> + uint8_t pulses_signs; ///< fixed-codebook vectors pulses' signs
fixed-codebook vector pulse signs
> + uint8_t input_frame_size; ///< Size (in bytes) of input frame
> + uint8_t output_frame_size;///< Size (in bytes) of output frame
input/output frame size (in bytes)
> --- /dev/null
> +++ b/libavcodec/g729dec.c
> @@ -0,0 +1,788 @@
> + Results are bit-exact equal with reference fixed-point G729.A decoder
> + over all ITU's test vectors.
> +no prefix : common routines for miscelaneous tasks (e.g. fixed-point math operations)
> + int16_t gain_pitch; ///< (Q14) Pitch gain of previous subframe (3.8) [SHARP_MIN ... SHARP_MAX]
> + int16_t gain_code; ///< (Q1) Gain code of previous subframe
> + * \brief save quantized LSF coefficients for using in next frame
use, add period
> + * \brief Decode LSP coefficients from L0-L3 (3.2.4)
> + * \param lsfq [out] (Q13) Decoded LSP coefficients
> + * \param lq_prev [in/out] (Q13) quantized LSF coefficients from previous frames
> + * \param lsf_prev [in/out] (Q13) LSF coefficients from previous frame
> + * \param ma_predictor Switched MA predictor of LSP quantizer
> + * \param vq_1st First stage vector of quantizer
> + * \param vq_2nd_low Second stage lower vector of LSP quantizer
> + * \param vq_2nd_high Second stage higher vector of LSP quantizer
> + //Save LSF for using when error occured in next frames
Save LSF for use when error occurs in next frames.
> + * \brief Decode of the adaptive codebook gain and add correction (4.1.5 and 3.9.1)
> + /*
> + Reference code uses constant instead of two previous lines.
The reference code uses a constant instead of the two previous lines.
> + Those value (due to 2^6 rounding) differs by 2 from code above.
Those valueS (due to 2^6 rounding) differ by 2 from above code.
> + Substracting 2 from energy makes result to be bit-equal with
> + reference code.
SuBTracting 2 from energy makes the result be bit-equal with the
> + Following code will calculate energy*2^14 instead of energy*2^exp
> + due to recent change of energy_int's integer part.
due to the recent change of the integer part of energy_int.
> + This is done to avoid overflow. Result fits into 16-bit.
> + (EE) This does not comply with specification, but reference
> + and Intel decoder uses here minimum sharpen value instead of maximum.
(EE) This does not comply with the specification, but the reference
and the Intel decoder use the minimum instead of the maximum
sharpen value here.
> + // Save data (without postfilter) for using in next subframe
> + /* Calculate gain of unfiltered signal for using in AGC */
> + /* Call postfiltering and also update voicing decision for using in next frame */
> + /* Calculate gain of filtered signal for using in AGC */
> + //Save signal for using in next frame
More information about the ffmpeg-devel