[FFmpeg-devel] [PATCH] G.729 parameters decoding

Michael Niedermayer michaelni
Thu Jun 18 12:23:34 CEST 2009


On Thu, Jun 18, 2009 at 07:43:31AM +0700, Vladimir Voroshilov wrote:
> 2009/6/18 Michael Niedermayer <michaelni at gmx.at>:
> > On Thu, Jun 18, 2009 at 06:55:09AM +0700, Vladimir Voroshilov wrote:
> >> 2009/6/18 Michael Niedermayer <michaelni at gmx.at>:
> >> > On Sat, Jun 13, 2009 at 01:21:24AM +0700, Vladimir Voroshilov wrote:
> >> >
> >> > [...]
> >> >> + ? ?for (i = 0; i < 2; i++) {
> >> >> + ? ? ? ?uint8_t ac_index; ? ? ?///< adaptive codebook index
> >> >> + ? ? ? ?uint8_t pulses_signs; ?///< fixed-codebook vector pulse signs
> >> >> + ? ? ? ?int fc_indexes; ? ? ? ?///< fixed-codebook indexes
> >> >> + ? ? ? ?uint8_t gc_1st_index; ?///< gain codebook (first stage) index
> >> >> + ? ? ? ?uint8_t gc_2nd_index; ?///< gain codebook (second stage) index
> >> >> +
> >> >> + ? ? ? ?ac_index ? ? ?= get_bits(&gb, format.ac_index_bits[i]);
> >> >
> >> >> + ? ? ? ?if(!i && format.parity_bits) {
> >> >> + ? ? ? ? ? ?int parity = get_bits(&gb, format.parity_bits);
> >> >> + ? ? ? ? ? ?bad_pitch = get_parity(ac_index) == parity;
> >> >> + ? ? ? ?}
> >> >
> >> > uhm ugh
> >> >
> >> > bad_pitch = get_parity(show_bits(format.ac_index_bits[0] + format.parity_bits);
> >> > prior to the loop
> >>
> >> If format.parity_bits==0 this code will become to:
> >> ?bad_pitch = get_parity(show_bits(format.ac_index_bits[0]);
> >
> > if(format.parity_bits)
> > ? ?...
> >
> > and its actually parity_bit not bits
> 
> 
> ...and i still have to check parity_bits inside for() too,
> since get_bits(pgb, 0) does not work. don't know why.
> Where is benefit ?

maybe none, the code feels just really ugly
anyway at the least you can change it to
? ? ?if(!i && format.parity_bits) 
 ? ? ? ?bad_pitch = get_parity(ac_index) == get_bits1(&gb);

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 
-------------- 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/20090618/3802b129/attachment.pgp>



More information about the ffmpeg-devel mailing list