From e1c88a2138c2bb1f79f5b97b86fac8664f1c5bc7 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 25 Feb 2010 04:11:33 +0000 Subject: 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 Originally committed as revision 22048 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/h264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavcodec/h264.c') diff --git a/libavcodec/h264.c b/libavcodec/h264.c index cd3ae6d155..fc39bdb49d 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -757,8 +757,8 @@ int ff_h264_alloc_tables(H264Context *h){ 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 @@ int ff_h264_alloc_tables(H264Context *h){ 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; } } -- cgit v1.2.3