diff ac3dec.c @ 10865:bcdc5343a577 libavcodec

Use MULH instead of 64x64 multiplication, around 5% overall speedup on Intel Atom. Patch by myself and Yuriy Kaminskiy [yumkam mail ru]
author reimar
date Tue, 12 Jan 2010 23:02:07 +0000
parents f8fc0a56745e
children 621268959a5c
line wrap: on
line diff
--- a/ac3dec.c	Tue Jan 12 21:36:26 2010 +0000
+++ b/ac3dec.c	Tue Jan 12 23:02:07 2010 +0000
@@ -420,10 +420,9 @@
         int band_end = bin + s->cpl_band_sizes[band];
         for (ch = 1; ch <= s->fbw_channels; ch++) {
             if (s->channel_in_cpl[ch]) {
-                int64_t cpl_coord = s->cpl_coords[ch][band];
+                int cpl_coord = s->cpl_coords[ch][band] << 5;
                 for (bin = band_start; bin < band_end; bin++) {
-                    s->fixed_coeffs[ch][bin] = ((int64_t)s->fixed_coeffs[CPL_CH][bin] *
-                                                cpl_coord) >> 23;
+                    s->fixed_coeffs[ch][bin] = MULH(s->fixed_coeffs[CPL_CH][bin] << 4, cpl_coord);
                 }
                 if (ch == 2 && s->phase_flags[band]) {
                     for (bin = band_start; bin < band_end; bin++)