Commit 65d50c31 authored by reimar's avatar reimar

Change code so it uses 2 adds instead of one FFABS.

About 1% faster ff_ac3_bit_alloc_calc_psd on Intel Atom, overall speedup
not measurable though.
Should have a bigger effect on systems without cmov or with very slow cmov.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21214 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 90db229e
...@@ -112,9 +112,10 @@ void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd, ...@@ -112,9 +112,10 @@ void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd,
int v = psd[bin++]; int v = psd[bin++];
int band_end = FFMIN(band_start_tab[band+1], end); int band_end = FFMIN(band_start_tab[band+1], end);
for (; bin < band_end; bin++) { for (; bin < band_end; bin++) {
int max = FFMAX(v, psd[bin]);
/* logadd */ /* logadd */
int adr = FFMIN(FFABS(v - psd[bin]) >> 1, 255); int adr = FFMIN(max - ((v + psd[bin] + 1) >> 1), 255);
v = FFMAX(v, psd[bin]) + ff_ac3_log_add_tab[adr]; v = max + ff_ac3_log_add_tab[adr];
} }
band_psd[band++] = v; band_psd[band++] = v;
} while (end > band_start_tab[band]); } while (end > band_start_tab[band]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment