From 3b7ebeb4d52a25c7e1038ae90c6c19b0d6f11877 Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Wed, 29 Jun 2011 13:27:36 -0700 Subject: H.264: faster write_back_* Avoid aliasing, unroll loops, and inline more functions. --- libavcodec/h264_cabac.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'libavcodec/h264_cabac.c') diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index f30f4e1c9c..a643297f8a 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -1999,7 +1999,7 @@ decode_intra_mb: //av_log( s->avctx, AV_LOG_ERROR, "i4x4 pred=%d mode=%d\n", pred, h->intra4x4_pred_mode_cache[ scan8[i] ] ); } } - ff_h264_write_back_intra_pred_mode(h); + write_back_intra_pred_mode(h); if( ff_h264_check_intra4x4_pred_mode(h) < 0 ) return -1; } else { h->intra16x16_pred_mode= ff_h264_check_intra_pred_mode( h, h->intra16x16_pred_mode ); @@ -2248,21 +2248,22 @@ decode_intra_mb: * the transform mode of the current macroblock there. */ if (CHROMA444 && IS_8x8DCT(mb_type)){ int i; + uint8_t *nnz_cache = h->non_zero_count_cache; for (i = 0; i < 2; i++){ if (h->left_type[i] && !IS_8x8DCT(h->left_type[i])){ - h->non_zero_count_cache[3+8* 1 + 2*8*i]= - h->non_zero_count_cache[3+8* 2 + 2*8*i]= - h->non_zero_count_cache[3+8* 6 + 2*8*i]= - h->non_zero_count_cache[3+8* 7 + 2*8*i]= - h->non_zero_count_cache[3+8*11 + 2*8*i]= - h->non_zero_count_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0; + nnz_cache[3+8* 1 + 2*8*i]= + nnz_cache[3+8* 2 + 2*8*i]= + nnz_cache[3+8* 6 + 2*8*i]= + nnz_cache[3+8* 7 + 2*8*i]= + nnz_cache[3+8*11 + 2*8*i]= + nnz_cache[3+8*12 + 2*8*i]= IS_INTRA(mb_type) ? 64 : 0; } } if (h->top_type && !IS_8x8DCT(h->top_type)){ uint32_t top_empty = CABAC && !IS_INTRA(mb_type) ? 0 : 0x40404040; - AV_WN32A(&h->non_zero_count_cache[4+8* 0], top_empty); - AV_WN32A(&h->non_zero_count_cache[4+8* 5], top_empty); - AV_WN32A(&h->non_zero_count_cache[4+8*10], top_empty); + AV_WN32A(&nnz_cache[4+8* 0], top_empty); + AV_WN32A(&nnz_cache[4+8* 5], top_empty); + AV_WN32A(&nnz_cache[4+8*10], top_empty); } } s->current_picture.mb_type[mb_xy]= mb_type; -- cgit v1.2.3