[FFmpeg-devel] [PATCH 09/10] dcadsp: perform linear access with offset

Christophe Gisquet christophe.gisquet at gmail.com
Fri Feb 14 17:00:53 CET 2014


This seems to simplify noticeably the addressing. Timings before/after
for respectively win32 and win64 are 260/222 and 242/231.
---
 libavcodec/dcadsp.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/libavcodec/dcadsp.c b/libavcodec/dcadsp.c
index 0abd804..5b38fc5 100644
--- a/libavcodec/dcadsp.c
+++ b/libavcodec/dcadsp.c
@@ -30,14 +30,17 @@ static void decode_hf_c(float dst[DCA_SUBBANDS][8],
                         int32_t scale[DCA_SUBBANDS][2],
                         intptr_t start, intptr_t end)
 {
-    int l;
+    int i, l;
+    const int8_t *pvq = hf_vq[0] + vq_offset;
     for (l = start; l < end; l++) {
         /* 1 vector -> 32 samples but we only need the 8 samples
          * for this subsubframe. */
-        int   i, hfvq = vq_num[l];
-        float fscale = scale[l][0] / 16.0;
-        for (i = 0; i < 8; i++)
-            dst[l][i] = hf_vq[hfvq][vq_offset + i] * fscale;
+        const int8_t *ptr = pvq + vq_num[l]*sizeof(hf_vq[0]);
+        float fscale = scale[l][0] * (1 / 16.0);
+        for (i = 0; i < 8; i++) {
+            /* hf_vq[hfvq][vq_offset + i] * fscale */
+            dst[l][i] = ptr[i] * fscale;
+        }
     }
 }
 
-- 
1.8.0.msysgit.0



More information about the ffmpeg-devel mailing list