Mercurial > libavcodec.hg
comparison motion_est.c @ 4317:5a2ee0bc2739 libavcodec
skip motion estimation and encoding of non direct-0,0 MBs if the next MB is skiped (mpeg4 doesnt allow such MBs and in the past we did ME and encoding until at the end we droped them, so this should be faster though i didnt benchmark it, benchmark welcome)
author | michael |
---|---|
date | Thu, 21 Dec 2006 15:20:02 +0000 |
parents | 649e51394b6f |
children | ad27265d0c15 |
comparison
equal
deleted
inserted
replaced
4316:fabb67829f3f | 4317:5a2ee0bc2739 |
---|---|
1841 init_ref(c, s->new_picture.data, s->last_picture.data, s->next_picture.data, 16*mb_x, 16*mb_y, 2); | 1841 init_ref(c, s->new_picture.data, s->last_picture.data, s->next_picture.data, 16*mb_x, 16*mb_y, 2); |
1842 | 1842 |
1843 get_limits(s, 16*mb_x, 16*mb_y); | 1843 get_limits(s, 16*mb_x, 16*mb_y); |
1844 | 1844 |
1845 c->skip=0; | 1845 c->skip=0; |
1846 | |
1847 if(s->codec_id == CODEC_ID_MPEG4 && s->next_picture.mbskip_table[xy]){ | |
1848 int score= direct_search(s, mb_x, mb_y); //FIXME just check 0,0 | |
1849 | |
1850 score= ((unsigned)(score*score + 128*256))>>16; | |
1851 c->mc_mb_var_sum_temp += score; | |
1852 s->current_picture.mc_mb_var[mb_y*s->mb_stride + mb_x] = score; //FIXME use SSE | |
1853 s->mb_type[mb_y*s->mb_stride + mb_x]= CANDIDATE_MB_TYPE_DIRECT0; | |
1854 | |
1855 return; | |
1856 } | |
1857 | |
1846 if(c->avctx->me_threshold){ | 1858 if(c->avctx->me_threshold){ |
1847 int vard= check_input_motion(s, mb_x, mb_y, 0); | 1859 int vard= check_input_motion(s, mb_x, mb_y, 0); |
1848 | 1860 |
1849 if((vard+128)>>8 < c->avctx->me_threshold){ | 1861 if((vard+128)>>8 < c->avctx->me_threshold){ |
1850 // pix = c->src[0][0]; | 1862 // pix = c->src[0][0]; |