Mercurial > libavcodec.hg
comparison h264.c @ 3927:f44a3341bfdf libavcodec
simplify write_back_motion for skip mbs
author | lorenm |
---|---|
date | Wed, 04 Oct 2006 07:08:26 +0000 |
parents | 6a40092eb9e6 |
children | c8c591fe26f8 |
comparison
equal
deleted
inserted
replaced
3926:e308e12ac596 | 3927:f44a3341bfdf |
---|---|
1712 for(y=0; y<4; y++){ | 1712 for(y=0; y<4; y++){ |
1713 *(uint64_t*)s->current_picture.motion_val[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+0 + 8*y]; | 1713 *(uint64_t*)s->current_picture.motion_val[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+0 + 8*y]; |
1714 *(uint64_t*)s->current_picture.motion_val[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+2 + 8*y]; | 1714 *(uint64_t*)s->current_picture.motion_val[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+2 + 8*y]; |
1715 } | 1715 } |
1716 if( h->pps.cabac ) { | 1716 if( h->pps.cabac ) { |
1717 if(IS_SKIP(mb_type)) | |
1718 fill_rectangle(h->mvd_table[list][b_xy], 4, 4, h->b_stride, 0, 4); | |
1719 else | |
1717 for(y=0; y<4; y++){ | 1720 for(y=0; y<4; y++){ |
1718 *(uint64_t*)h->mvd_table[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mvd_cache[list][scan8[0]+0 + 8*y]; | 1721 *(uint64_t*)h->mvd_table[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mvd_cache[list][scan8[0]+0 + 8*y]; |
1719 *(uint64_t*)h->mvd_table[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mvd_cache[list][scan8[0]+2 + 8*y]; | 1722 *(uint64_t*)h->mvd_table[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mvd_cache[list][scan8[0]+2 + 8*y]; |
1720 } | 1723 } |
1721 } | 1724 } |
5108 // just for fill_caches. pred_direct_motion will set the real mb_type | 5111 // just for fill_caches. pred_direct_motion will set the real mb_type |
5109 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP; | 5112 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP; |
5110 | 5113 |
5111 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ... | 5114 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ... |
5112 pred_direct_motion(h, &mb_type); | 5115 pred_direct_motion(h, &mb_type); |
5113 if(h->pps.cabac){ | 5116 mb_type|= MB_TYPE_SKIP; |
5114 fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 4); | |
5115 fill_rectangle(h->mvd_cache[1][scan8[0]], 4, 4, 8, 0, 4); | |
5116 } | |
5117 } | 5117 } |
5118 else | 5118 else |
5119 { | 5119 { |
5120 int mx, my; | 5120 int mx, my; |
5121 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP; | 5121 mb_type|= MB_TYPE_16x16|MB_TYPE_P0L0|MB_TYPE_P1L0|MB_TYPE_SKIP; |
5122 | 5122 |
5123 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ... | 5123 fill_caches(h, mb_type, 0); //FIXME check what is needed and what not ... |
5124 pred_pskip_motion(h, &mx, &my); | 5124 pred_pskip_motion(h, &mx, &my); |
5125 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1); | 5125 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1); |
5126 fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4); | 5126 fill_rectangle( h->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx,my), 4); |
5127 if(h->pps.cabac) | |
5128 fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 4); | |
5129 } | 5127 } |
5130 | 5128 |
5131 write_back_motion(h, mb_type); | 5129 write_back_motion(h, mb_type); |
5132 s->current_picture.mb_type[mb_xy]= mb_type|MB_TYPE_SKIP; | 5130 s->current_picture.mb_type[mb_xy]= mb_type; |
5133 s->current_picture.qscale_table[mb_xy]= s->qscale; | 5131 s->current_picture.qscale_table[mb_xy]= s->qscale; |
5134 h->slice_table[ mb_xy ]= h->slice_num; | 5132 h->slice_table[ mb_xy ]= h->slice_num; |
5135 h->prev_mb_skipped= 1; | 5133 h->prev_mb_skipped= 1; |
5136 } | 5134 } |
5137 | 5135 |