diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-02-14 14:41:27 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-02-14 14:41:27 +0000 |
commit | 2dc380ca8ea9d161c337a47a111f83d2e84ceb9c (patch) | |
tree | 2b040dcab1ad5b8330adc5b8b186b90fec2ea12f /libavcodec/h264.h | |
parent | d3037bbe6b35ab7d416561905f547ecb227e7db4 (diff) | |
download | ffmpeg-2dc380ca8ea9d161c337a47a111f83d2e84ceb9c.tar.gz |
Store sub_mb_type in direct_cache/direct_table.
This is equal complexity but could be more usefull.
Originally committed as revision 21821 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r-- | libavcodec/h264.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h index f5eb17bbd7..cc308ea003 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -1060,31 +1060,31 @@ static void fill_decode_caches(H264Context *h, int mb_type){ *(uint32_t*)h->mvd_cache [list][scan8[12]]= 0; if(h->slice_type_nos == FF_B_TYPE){ - fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, 0, 1); + fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1); if(IS_DIRECT(top_type)){ - *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0x01010101; + *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0x01010101*(MB_TYPE_DIRECT2>>1); }else if(IS_8X8(top_type)){ int b8_xy = h->mb2b8_xy[top_xy] + h->b8_stride; h->direct_cache[scan8[0] + 0 - 1*8]= h->direct_table[b8_xy]; h->direct_cache[scan8[0] + 2 - 1*8]= h->direct_table[b8_xy + 1]; }else{ - *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0; + *(uint32_t*)&h->direct_cache[scan8[0] - 1*8]= 0x01010101*(MB_TYPE_16x16>>1); } if(IS_DIRECT(left_type[0])) - h->direct_cache[scan8[0] - 1 + 0*8]= 1; + h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_DIRECT2>>1; else if(IS_8X8(left_type[0])) h->direct_cache[scan8[0] - 1 + 0*8]= h->direct_table[h->mb2b8_xy[left_xy[0]] + 1 + h->b8_stride*(left_block[0]>>1)]; else - h->direct_cache[scan8[0] - 1 + 0*8]= 0; + h->direct_cache[scan8[0] - 1 + 0*8]= MB_TYPE_16x16>>1; if(IS_DIRECT(left_type[1])) - h->direct_cache[scan8[0] - 1 + 2*8]= 1; + h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_DIRECT2>>1; else if(IS_8X8(left_type[1])) h->direct_cache[scan8[0] - 1 + 2*8]= h->direct_table[h->mb2b8_xy[left_xy[1]] + 1 + h->b8_stride*(left_block[2]>>1)]; else - h->direct_cache[scan8[0] - 1 + 2*8]= 0; + h->direct_cache[scan8[0] - 1 + 2*8]= MB_TYPE_16x16>>1; } } } @@ -1409,9 +1409,9 @@ static inline void write_back_motion(H264Context *h, int mb_type){ if(h->slice_type_nos == FF_B_TYPE && CABAC){ if(IS_8X8(mb_type)){ uint8_t *direct_table = &h->direct_table[b8_xy]; - direct_table[1+0*h->b8_stride] = IS_DIRECT(h->sub_mb_type[1]) ? 1 : 0; - direct_table[0+1*h->b8_stride] = IS_DIRECT(h->sub_mb_type[2]) ? 1 : 0; - direct_table[1+1*h->b8_stride] = IS_DIRECT(h->sub_mb_type[3]) ? 1 : 0; + direct_table[1+0*h->b8_stride] = h->sub_mb_type[1]>>1; + direct_table[0+1*h->b8_stride] = h->sub_mb_type[2]>>1; + direct_table[1+1*h->b8_stride] = h->sub_mb_type[3]>>1; } } } |