[FFmpeg-devel] [PATCH] Common ACELP code & G.729 [5/7] - G.729 tables
Michael Niedermayer
michaelni
Tue Sep 2 14:06:59 CEST 2008
On Wed, Aug 27, 2008 at 03:09:38AM +0700, Vladimir Voroshilov wrote:
> 2008/8/26 Michael Niedermayer <michaelni at gmx.at>:
> > On Sat, Aug 23, 2008 at 08:40:35PM +0700, Vladimir Voroshilov wrote:
>
> [...]
>
> >> @@ -203,4 +211,97 @@ static const int16_t cb_lsp_2nd[1<<VQ_2ND_BITS][10] =
> >> { -163, 674, -11, -886, 531, -1125, -265, -242, 724, 934}
> >> };
> >>
> >
> >> +/**
> >> + * gain codebook (first stage), 8k mode (3.9.2 of G.729)
> >> + */
> >> +static const int16_t cb_gain_1st_8k[1<<GC_1ST_IDX_BITS_8K][2] =
> >> +{ /*(1.14) (2.13) */
> >> + { 3242 , 9949 }, //5
> >> + { 1551 , 2425 }, //1
> >> + { 2678 , 27162 }, //7
> >> + { 1921 , 9291 }, //4
> >> + { 1831 , 5022 }, //2
> >> + { 1 , 1516 }, //0
> >> + { 356 , 14756 }, //6
> >> + { 57 , 5404 }, //3
> >> +};
> >
> > 1.14 is wrong
>
> replaced with 0.14
>
> > and what do the comments on the right mean?
>
> Row order in original table from g.729 reference code.
> Those code uses tab[map[index]] expression for this tables.
> I decided to remove "map" table and reorder rows.
> Comment removed in updated patch, since it really does not look useful.
>
>
> Updated patch is attached.
>
> --
> Regards,
> Vladimir Voroshilov mailto:voroshil at gmail.com
> JID: voroshil at gmail.com, voroshil at jabber.ru
> ICQ: 95587719
> diff --git a/libavcodec/g729data.h b/libavcodec/g729data.h
> index 6c73952..7434b80 100644
> --- a/libavcodec/g729data.h
> +++ b/libavcodec/g729data.h
> @@ -211,4 +211,97 @@ static const int16_t cb_lsp_2nd[1<<VQ_2ND_BITS][10] =
> { -163, 674, -11, -886, 531, -1125, -265, -242, 724, 934}
> };
>
> +/**
> + * gain codebook (first stage), 8k mode (3.9.2 of G.729)
> + */
> +static const int16_t cb_gain_1st_8k[1<<GC_1ST_IDX_BITS_8K][2] =
> +{ /*(0.14) (2.13) */
> + { 3242 , 9949 },
> + { 1551 , 2425 },
> + { 2678 , 27162 },
> + { 1921 , 9291 },
> + { 1831 , 5022 },
> + { 1 , 1516 },
> + { 356 , 14756 },
> + { 57 , 5404 },
> +};
ok
> +
> +/**
> + * gain codebook (second stage), 8k mode (3.9.2 of G.729)
> + */
> +static const int16_t cb_gain_2nd_8k[1<<GC_2ND_IDX_BITS_8K][2] =
> +{ /*(1.14) (2.13) */
> + { 5142 , 592 },
> + { 17299 , 1861 },
> + { 6160 , 2395 },
> + { 16112 , 3392 },
> + { 826 , 2005 },
> + { 18973 , 5935 },
> + { 1994 , 0 },
> + { 15434 , 237 },
> + { 10573 , 2966 },
> + { 15132 , 4914 },
> + { 11569 , 1196 },
> + { 14194 , 1630 },
> + { 8091 , 4861 },
> + { 15161 , 14276 },
> + { 9120 , 525 },
> + { 13260 , 3256 },
2.13 is wrong
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.
-------------- 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/20080902/7febd7a3/attachment.pgp>
More information about the ffmpeg-devel
mailing list