Mercurial > libavcodec.hg
comparison motion_est.c @ 2576:e237d9bd0f8c libavcodec
check mb/me_threshold range, fixes assertion failure
author | michael |
---|---|
date | Sat, 26 Mar 2005 18:10:44 +0000 |
parents | e25782262d7d |
children | 511e3afc43e1 |
comparison
equal
deleted
inserted
replaced
2575:0afef2899701 | 2576:e237d9bd0f8c |
---|---|
1014 me_cmp_func cmpf= s->dsp.sse[0]; | 1014 me_cmp_func cmpf= s->dsp.sse[0]; |
1015 me_cmp_func chroma_cmpf= s->dsp.sse[1]; | 1015 me_cmp_func chroma_cmpf= s->dsp.sse[1]; |
1016 | 1016 |
1017 if(p_type && USES_LIST(mb_type, 1)){ | 1017 if(p_type && USES_LIST(mb_type, 1)){ |
1018 av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n"); | 1018 av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n"); |
1019 return INT_MAX/4; | 1019 return INT_MAX/2; |
1020 } | 1020 } |
1021 assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1)); | 1021 assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1)); |
1022 | 1022 |
1023 for(i=0; i<4; i++){ | 1023 for(i=0; i<4; i++){ |
1024 int xy= s->block_index[i]; | 1024 int xy= s->block_index[i]; |
1032 c->stride<<=1; | 1032 c->stride<<=1; |
1033 c->uvstride<<=1; | 1033 c->uvstride<<=1; |
1034 | 1034 |
1035 if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){ | 1035 if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){ |
1036 av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n"); | 1036 av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n"); |
1037 return INT_MAX/4; | 1037 return INT_MAX/2; |
1038 } | 1038 } |
1039 | 1039 |
1040 if(USES_LIST(mb_type, 0)){ | 1040 if(USES_LIST(mb_type, 0)){ |
1041 int field_select0= p->ref_index[0][xy ]; | 1041 int field_select0= p->ref_index[0][xy ]; |
1042 int field_select1= p->ref_index[0][xy2]; | 1042 int field_select1= p->ref_index[0][xy2]; |
1093 c->stride>>=1; | 1093 c->stride>>=1; |
1094 c->uvstride>>=1; | 1094 c->uvstride>>=1; |
1095 }else if(IS_8X8(mb_type)){ | 1095 }else if(IS_8X8(mb_type)){ |
1096 if(!(s->flags & CODEC_FLAG_4MV)){ | 1096 if(!(s->flags & CODEC_FLAG_4MV)){ |
1097 av_log(c->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n"); | 1097 av_log(c->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n"); |
1098 return INT_MAX/4; | 1098 return INT_MAX/2; |
1099 } | 1099 } |
1100 cmpf= s->dsp.sse[1]; | 1100 cmpf= s->dsp.sse[1]; |
1101 chroma_cmpf= s->dsp.sse[1]; | 1101 chroma_cmpf= s->dsp.sse[1]; |
1102 init_mv4_ref(c); | 1102 init_mv4_ref(c); |
1103 for(i=0; i<4; i++){ | 1103 for(i=0; i<4; i++){ |