On Wed, Jan 18, 2012 at 01:39:54AM -0700, Nathan Caldwell wrote:
>
> --- a/libavcodec/aac_tablegen.c
> +++ b/libavcodec/aac_tablegen.c
> @@ -32,6 +32,9 @@ int main(void)
>
> WRITE_ARRAY("const", float, ff_aac_pow2sf_tab);
> +#if CONFIG_AAC_ENCODER
> + WRITE_ARRAY("const", float, ff_aac_pow34sf_tab);
> +#endif /* CONFIG_AAC_ENCODER */
>
> return 0;
> --- a/libavcodec/aac_tablegen.h
> +++ b/libavcodec/aac_tablegen.h
> @@ -31,12 +31,19 @@
> float ff_aac_pow2sf_tab[428];
> +#if CONFIG_AAC_ENCODER
> +float ff_aac_pow34sf_tab[428];
> +#endif /* CONFIG_AAC_ENCODER */
>
> void ff_aac_tableinit(void)
> {
> int i;
> - for (i = 0; i < 428; i++)
> + for (i = 0; i < 428; i++) {
> ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.);
> +#if CONFIG_AAC_ENCODER
> + ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] *
> sqrt(ff_aac_pow2sf_tab[i]));
> +#endif /* CONFIG_AAC_ENCODER */
> + }
> }
What are you intending to achieve with all the ifdeffery?
Generating the tables will not hurt - the build may take
slightly longer, but the table will not end up in any
binary. Not worth any ifdeffery IMO.
Also note that these files lack config.h #includes, so I very
much wonder how the #ifdef ever worked in the first place.
> --- a/libavcodec/aac_tablegen_decl.h
> +++ b/libavcodec/aac_tablegen_decl.h
> @@ -26,9 +26,15 @@
> #if CONFIG_HARDCODED_TABLES
> #define ff_aac_tableinit()
> extern const float ff_aac_pow2sf_tab[428];
> +#if CONFIG_AAC_ENCODER
> +extern const float ff_aac_pow34sf_tab[428];
> +#endif /* CONFIG_AAC_ENCODER */
> #else
> void ff_aac_tableinit(void);
> extern float ff_aac_pow2sf_tab[428];
> +#if CONFIG_AAC_ENCODER
> +extern float ff_aac_pow34sf_tab[428];
> +#endif /* CONFIG_AAC_ENCODER */
> #endif /* CONFIG_HARDCODED_TABLES */
These are completely unnecessary.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel