diff h264.c @ 11283:853e93a50fe5 libavcodec

Cut the size of mvd_table by yet another factor of 2. The code read/write code itself was 1 cycle faster, overall its likely more due to cache effects
author michael
date Thu, 25 Feb 2010 04:11:33 +0000
parents cf41a3e8e14e
children 613370892df2
line wrap: on
line diff
--- a/h264.c	Thu Feb 25 02:42:25 2010 +0000
+++ b/h264.c	Thu Feb 25 04:11:33 2010 +0000
@@ -757,8 +757,8 @@
     FF_ALLOCZ_OR_GOTO(h->s.avctx, h->cbp_table, big_mb_num * sizeof(uint16_t), fail)
 
     FF_ALLOCZ_OR_GOTO(h->s.avctx, h->chroma_pred_mode_table, big_mb_num * sizeof(uint8_t), fail)
-    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[0], 32*big_mb_num * sizeof(uint8_t), fail);
-    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[1], 32*big_mb_num * sizeof(uint8_t), fail);
+    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[0], 16*big_mb_num * sizeof(uint8_t), fail);
+    FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[1], 16*big_mb_num * sizeof(uint8_t), fail);
     FF_ALLOCZ_OR_GOTO(h->s.avctx, h->direct_table, 32*big_mb_num * sizeof(uint8_t) , fail);
     FF_ALLOCZ_OR_GOTO(h->s.avctx, h->list_counts, big_mb_num * sizeof(uint8_t), fail)
 
@@ -775,7 +775,7 @@
             const int b8_xy= 2*x + 2*y*h->b8_stride;
 
             h->mb2b_xy [mb_xy]= b_xy;
-            h->mb2br_xy[mb_xy]= FMO ? b_xy : (b_xy % (8*h->b_stride));
+            h->mb2br_xy[mb_xy]= 8*(FMO ? mb_xy : (mb_xy % (2*s->mb_stride)));
             h->mb2b8_xy[mb_xy]= b8_xy;
         }
     }