changeset 8355:179f8e1327ce libavcodec

Factorize 3 multiplications out, code becomes 3 cpu cycles faster. (not significant as thats just per MB)
author michael
date Tue, 16 Dec 2008 21:08:16 +0000
parents 5e6f65181881
children 0030146fc2ba
files h264.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Tue Dec 16 20:43:39 2008 +0000
+++ b/h264.c	Tue Dec 16 21:08:16 2008 +0000
@@ -2371,9 +2371,9 @@
     void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);
     void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
 
-    dest_y  = s->current_picture.data[0] + (mb_y * 16* s->linesize  ) + mb_x * 16;
-    dest_cb = s->current_picture.data[1] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
-    dest_cr = s->current_picture.data[2] + (mb_y * 8 * s->uvlinesize) + mb_x * 8;
+    dest_y  = s->current_picture.data[0] + (mb_x + mb_y * s->linesize  ) * 16;
+    dest_cb = s->current_picture.data[1] + (mb_x + mb_y * s->uvlinesize) * 8;
+    dest_cr = s->current_picture.data[2] + (mb_x + mb_y * s->uvlinesize) * 8;
 
     s->dsp.prefetch(dest_y + (s->mb_x&3)*4*s->linesize + 64, s->linesize, 4);
     s->dsp.prefetch(dest_cb + (s->mb_x&7)*s->uvlinesize + 64, dest_cr - dest_cb, 2);