History

Define POW_SF2_ZERO in aac.h and use for ff_aac_pow2sf_tabp[] offsets instead of hardcoding 200 everywhere.

Alex Converse committed 15 years ago

Commit d70fa4c1 parent e4744b54 files · +10 −8Browse files

Showing the changes to libavcodec/aaccoder.c (1 of 4 files). Show all

Unified · Split

libavcodec/aaccoder.c+4−4
@@ -108,8 +108,8 @@ static av_always_inline float quantize_and_encode_band_cost_template( · 107 unmodified lines
108108 int *bits, int BT_ZERO, int BT_UNSIGNED,
109109 int BT_PAIR, int BT_ESC)
110110 {
111− const float IQ = ff_aac_pow2sf_tab[200 + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
112− const float Q = ff_aac_pow2sf_tab[200 - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
111+ const float IQ = ff_aac_pow2sf_tab[POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512];
112+ const float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512];
113113 const float CLIPPED_ESCAPE = 165140.0f*IQ;
114114 int i, j;
115115 float cost = 0;
@@ -280,7 +280,7 @@ static float find_max_val(int group_len, int swb_size, const float *scaled) { · 164 unmodified lines
280280 }
281281
282282 static int find_min_book(float maxval, int sf) {
283− float Q = ff_aac_pow2sf_tab[200 - sf + SCALE_ONE_POS - SCALE_DIV_512];
283+ float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
284284 float Q34 = sqrtf(Q * sqrtf(Q));
285285 int qmaxval, cb;
286286 qmaxval = maxval * Q34 + 0.4054f;
@@ -955,7 +955,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s, · 668 unmodified lines
955955 dist -= b;
956956 }
957957 dist *= 1.0f / 512.0f / lambda;
958− quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[200 - scf + SCALE_ONE_POS - SCALE_DIV_512]);
958+ quant_max = quant(maxq[w*16+g], ff_aac_pow2sf_tab[POW_SF2_ZERO - scf + SCALE_ONE_POS - SCALE_DIV_512]);
959959 if (quant_max >= 8191) { // too much, return to the previous quantizer
960960 sce->sf_idx[w*16+g] = prev_scf;
961961 break;

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