History

aacenc: move the generation of ff_aac_pow34sf_tab[]

This commit moves the generation of ff_aac_pow34sf_tab[] out of the encoder and into the table generator. The original commit log for this table in 2011 actually mentions that it should be moved outside but this never happened. This is the first commit which cleans up the encoder a little.

Rostislav Pehlivanov committed 11 years ago

Commit 331c1e71 parent cee7acf6 files · +9 −7Browse files

Unified · Split

6 files
  1. libavcodec/aac_tablegen.c +2 −0
  2. libavcodec/aac_tablegen.h +4 −1
  3. libavcodec/aac_tablegen_decl.h +2 −0
  4. libavcodec/aaccoder.c +1 −0
  5. libavcodec/aacenc.c +0 −4
  6. libavcodec/aacenc.h +0 −2
libavcodec/aac_tablegen.c+2−0
@@ -33,5 +33,7 @@ int main(void) · 32 unmodified lines
3333
3434 WRITE_ARRAY("const", float, ff_aac_pow2sf_tab);
3535
36+ WRITE_ARRAY("const", float, ff_aac_pow34sf_tab);
37+
3638 return 0;
3739 }
libavcodec/aac_tablegen.h+4−1
@@ -30,12 +30,15 @@ · 29 unmodified lines
3030 #else
3131 #include "libavutil/mathematics.h"
3232 float ff_aac_pow2sf_tab[428];
33+float ff_aac_pow34sf_tab[428];
3334
3435 av_cold void ff_aac_tableinit(void)
3536 {
3637 int i;
37− for (i = 0; i < 428; i++)
38+ for (i = 0; i < 428; i++) {
3839 ff_aac_pow2sf_tab[i] = pow(2, (i - POW_SF2_ZERO) / 4.0);
40+ ff_aac_pow34sf_tab[i] = pow(ff_aac_pow2sf_tab[i], 3.0/4.0);
41+ }
3942 }
4043 #endif /* CONFIG_HARDCODED_TABLES */
4144
libavcodec/aac_tablegen_decl.h+2−0
@@ -28,9 +28,11 @@ · 27 unmodified lines
2828 #if CONFIG_HARDCODED_TABLES
2929 #define ff_aac_tableinit()
3030 extern const float ff_aac_pow2sf_tab[428];
31+extern const float ff_aac_pow34sf_tab[428];
3132 #else
3233 void ff_aac_tableinit(void);
3334 extern float ff_aac_pow2sf_tab[428];
35+extern float ff_aac_pow34sf_tab[428];
3436 #endif /* CONFIG_HARDCODED_TABLES */
3537
3638 #endif /* AVCODEC_AAC_TABLEGEN_DECL_H */
libavcodec/aaccoder.c+1−0
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include "aac.h"
4040 #include "aacenc.h"
4141 #include "aactab.h"
42+#include "aac_tablegen_decl.h"
4243
4344 /** Frequency in Hz for lower limit of noise substitution **/
4445 #define NOISE_LOW_LIMIT 4500
libavcodec/aacenc.c+0−4
@@ -58,7 +58,6 @@ · 57 unmodified lines
5858 av_log(avctx, AV_LOG_WARNING, __VA_ARGS__); \
5959 }
6060
61−float ff_aac_pow34sf_tab[428];
6261
6362 static const uint8_t swb_size_1024_96[] = {
6463 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8,
@@ -855,9 +854,6 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) · 790 unmodified lines
855854
856855 ff_aac_tableinit();
857856
858− for (i = 0; i < 428; i++)
859− ff_aac_pow34sf_tab[i] = sqrt(ff_aac_pow2sf_tab[i] * sqrt(ff_aac_pow2sf_tab[i]));
860−
861857 avctx->initial_padding = 1024;
862858 ff_af_queue_init(avctx, &s->afq);
863859
libavcodec/aacenc.h+0−2
@@ -95,8 +95,6 @@ typedef struct AACEncContext { · 94 unmodified lines
9595 } buffer;
9696 } AACEncContext;
9797
98−extern float ff_aac_pow34sf_tab[428];
99−
10098 void ff_aac_coder_init_mips(AACEncContext *c);
10199
102100 #endif /* AVCODEC_AACENC_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t