comparison 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
comparison
equal deleted inserted replaced
11282:cf41a3e8e14e 11283:853e93a50fe5
755 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->non_zero_count , big_mb_num * 32 * sizeof(uint8_t), fail) 755 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->non_zero_count , big_mb_num * 32 * sizeof(uint8_t), fail)
756 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->slice_table_base , (big_mb_num+s->mb_stride) * sizeof(*h->slice_table_base), fail) 756 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->slice_table_base , (big_mb_num+s->mb_stride) * sizeof(*h->slice_table_base), fail)
757 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->cbp_table, big_mb_num * sizeof(uint16_t), fail) 757 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->cbp_table, big_mb_num * sizeof(uint16_t), fail)
758 758
759 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->chroma_pred_mode_table, big_mb_num * sizeof(uint8_t), fail) 759 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->chroma_pred_mode_table, big_mb_num * sizeof(uint8_t), fail)
760 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[0], 32*big_mb_num * sizeof(uint8_t), fail); 760 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[0], 16*big_mb_num * sizeof(uint8_t), fail);
761 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[1], 32*big_mb_num * sizeof(uint8_t), fail); 761 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->mvd_table[1], 16*big_mb_num * sizeof(uint8_t), fail);
762 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->direct_table, 32*big_mb_num * sizeof(uint8_t) , fail); 762 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->direct_table, 32*big_mb_num * sizeof(uint8_t) , fail);
763 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->list_counts, big_mb_num * sizeof(uint8_t), fail) 763 FF_ALLOCZ_OR_GOTO(h->s.avctx, h->list_counts, big_mb_num * sizeof(uint8_t), fail)
764 764
765 memset(h->slice_table_base, -1, (big_mb_num+s->mb_stride) * sizeof(*h->slice_table_base)); 765 memset(h->slice_table_base, -1, (big_mb_num+s->mb_stride) * sizeof(*h->slice_table_base));
766 h->slice_table= h->slice_table_base + s->mb_stride*2 + 1; 766 h->slice_table= h->slice_table_base + s->mb_stride*2 + 1;
773 const int mb_xy= x + y*s->mb_stride; 773 const int mb_xy= x + y*s->mb_stride;
774 const int b_xy = 4*x + 4*y*h->b_stride; 774 const int b_xy = 4*x + 4*y*h->b_stride;
775 const int b8_xy= 2*x + 2*y*h->b8_stride; 775 const int b8_xy= 2*x + 2*y*h->b8_stride;
776 776
777 h->mb2b_xy [mb_xy]= b_xy; 777 h->mb2b_xy [mb_xy]= b_xy;
778 h->mb2br_xy[mb_xy]= FMO ? b_xy : (b_xy % (8*h->b_stride)); 778 h->mb2br_xy[mb_xy]= 8*(FMO ? mb_xy : (mb_xy % (2*s->mb_stride)));
779 h->mb2b8_xy[mb_xy]= b8_xy; 779 h->mb2b8_xy[mb_xy]= b8_xy;
780 } 780 }
781 } 781 }
782 782
783 s->obmc_scratchpad = NULL; 783 s->obmc_scratchpad = NULL;