[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [4/7] - G.729 core

Michael Niedermayer michaelni
Wed Aug 20 01:51:22 CEST 2008


On Sat, Aug 16, 2008 at 06:34:59PM +0700, Vladimir Voroshilov wrote:
> 2008/8/14 Michael Niedermayer <michaelni at gmx.at>:
> > On Sat, Jul 12, 2008 at 02:31:29PM +0700, Vladimir Voroshilov wrote:
[...]

> >
> >
> > [...]
> >> +/**
> >> + * \brief Decodes one G.729 frame (10 bytes long) into parameter vector.
> >> + * \param format used format (8k/4.4k/etc)
> >> + * \param buf 10 bytes of decoder parameters
> >> + * \param buf_size size of input buffer
> >> + * \param parm [out] decoded codec parameters
> >> + *
> >> + * \return 1 if frame erasure detected, 0 - otherwise
> >> + */
> >> +static int g729_bytes2parm(int format, const uint8_t *buf, int buf_size, G729_parameters *parm)
> >> +{
> >> +    GetBitContext gb;
> >> +    int i, frame_nonzero;
> >> +
> >> +    frame_nonzero = 0;
> >> +    for(i=0; i<buf_size; i++)
> >> +        frame_nonzero |= buf[i];
> >> +
> >> +    if(!frame_nonzero)
> >> +    {
> >> +        memset(parm, 0, sizeof(G729_parameters));
> >> +        return 1;
> >> +    }
> >> +
> >> +    init_get_bits(&gb, buf, buf_size);
> >> +
> >
> >> +    parm->ma_predictor     = get_bits(&gb, formats[format].ma_predictor_bits);
> >> +    parm->quantizer_1st    = get_bits(&gb, formats[format].vq_1st_bits);
> >> +    parm->quantizer_2nd_lo = get_bits(&gb, formats[format].vq_2nd_bits);
> >> +    parm->quantizer_2nd_hi = get_bits(&gb, formats[format].vq_2nd_bits);
> >> +
> >> +    parm->ac_index[0]      = get_bits(&gb, formats[format].ac_index_1st_bits);
> >> +    parm->parity           = get_bits(&gb, formats[format].parity_bits);
> >> +    parm->fc_indexes[0]    = get_bits(&gb, formats[format].fc_indexes_bits);
> >> +    parm->pulses_signs[0]  = get_bits(&gb, formats[format].fc_signs_bits);
> >> +    parm->gc_1st_index[0]  = get_bits(&gb, formats[format].gc_1st_index_bits);
> >> +    parm->gc_2nd_index[0]  = get_bits(&gb, formats[format].gc_2nd_index_bits);
> >> +
> >> +    parm->ac_index[1]      = get_bits(&gb, formats[format].ac_index_2nd_bits);
> >> +    parm->fc_indexes[1]    = get_bits(&gb, formats[format].fc_indexes_bits);
> >> +    parm->pulses_signs[1]  = get_bits(&gb, formats[format].fc_signs_bits);
> >> +    parm->gc_1st_index[1]  = get_bits(&gb, formats[format].gc_1st_index_bits);
> >> +    parm->gc_2nd_index[1]  = get_bits(&gb, formats[format].gc_2nd_index_bits);
> >
> > isnt it possible to read these values where they are needed like
> > in done in every other decoder ?
> 
> VOC format (based on G.729 AnnexD) uses slightly different packet coding.
> But it can be handled by my g729d code after replacing only this one routine.
> With inlined readings it will be harder to implement, imho.

elaborate on what is exactly different


> 
> Please answer on commit question.

i think aurel already did


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080820/0dcf0e2a/attachment.pgp>



More information about the ffmpeg-devel mailing list