diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-07-04 00:34:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-07-04 00:45:21 +0200 |
commit | 976a8b217986fecdbe1fdcaa3e14ce9c3c92eb25 (patch) | |
tree | d31a42173318b29419733ec4634c1f6f07cdce6c /libavcodec/h264_cabac.c | |
parent | 2a375bb400febf8c1a2dfa87c29fd4185663454c (diff) | |
parent | 556f8a066cb33241bf29e85d7e24c9acf7ea9043 (diff) | |
download | ffmpeg-976a8b217986fecdbe1fdcaa3e14ce9c3c92eb25.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (40 commits)
H.264: template left MB handling
H.264: faster fill_decode_caches
H.264: faster write_back_*
H.264: faster fill_filter_caches
H.264: make filter_mb_fast support the case of unavailable top mb
Do not include log.h in avutil.h
Do not include pixfmt.h in avutil.h
Do not include rational.h in avutil.h
Do not include mathematics.h in avutil.h
Do not include intfloat_readwrite.h in avutil.h
Remove return statements following infinite loops without break
RTSP: Doxygen comment cleanup
doxygen: Escape '\' in Doxygen documentation.
md5: cosmetics
md5: use AV_WL32 to write result
md5: add fate test
md5: include correct headers
md5: fix test program
doxygen: Drop array size declarations from Doxygen parameter names.
doxygen: Fix parameter names to match the function prototypes.
...
Conflicts:
libavcodec/x86/dsputil_mmx.c
libavformat/flvenc.c
libavformat/oggenc.c
libavformat/wtv.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_cabac.c')
-rw-r--r-- | libavcodec/h264_cabac.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 3975a61699..325e15bc0a 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -1296,9 +1296,9 @@ static int decode_cabac_intra_mb_type(H264Context *h, int ctx_base, int intra_sl if(intra_slice){ int ctx=0; - if( h->left_type[0] & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)) + if( h->left_type[LTOP] & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)) ctx++; - if( h->top_type & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)) + if( h->top_type & (MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)) ctx++; if( get_cabac_noinline( &h->cabac, &state[ctx] ) == 0 ) return 0; /* I4x4 */ @@ -1376,10 +1376,10 @@ static int decode_cabac_mb_chroma_pre_mode( H264Context *h) { int ctx = 0; /* No need to test for IS_INTRA4x4 and IS_INTRA16x16, as we set chroma_pred_mode_table to 0 */ - if( h->left_type[0] && h->chroma_pred_mode_table[mba_xy] != 0 ) + if( h->left_type[LTOP] && h->chroma_pred_mode_table[mba_xy] != 0 ) ctx++; - if( h->top_type && h->chroma_pred_mode_table[mbb_xy] != 0 ) + if( h->top_type && h->chroma_pred_mode_table[mbb_xy] != 0 ) ctx++; if( get_cabac_noinline( &h->cabac, &h->cabac_state[64+ctx] ) == 0 ) @@ -1881,7 +1881,7 @@ int ff_h264_decode_mb_cabac(H264Context *h) { int ctx = 0; assert(h->slice_type_nos == AV_PICTURE_TYPE_B); - if( !IS_DIRECT( h->left_type[0]-1 ) ) + if( !IS_DIRECT( h->left_type[LTOP]-1 ) ) ctx++; if( !IS_DIRECT( h->top_type-1 ) ) ctx++; @@ -2000,7 +2000,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 ); @@ -2249,21 +2249,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; + if (h->left_type[LEFT(i)] && !IS_8x8DCT(h->left_type[LEFT(i)])){ + 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; |