comparison motion_est.c @ 2354:643724c609ff libavcodec

overflow fix
author michael
date Tue, 16 Nov 2004 13:40:56 +0000
parents 5e5cf598a48b
children e25782262d7d
comparison
equal deleted inserted replaced
2353:444b9ff022a3 2354:643724c609ff
1015 me_cmp_func cmpf= s->dsp.sse[0]; 1015 me_cmp_func cmpf= s->dsp.sse[0];
1016 me_cmp_func chroma_cmpf= s->dsp.sse[1]; 1016 me_cmp_func chroma_cmpf= s->dsp.sse[1];
1017 1017
1018 if(p_type && USES_LIST(mb_type, 1)){ 1018 if(p_type && USES_LIST(mb_type, 1)){
1019 av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n"); 1019 av_log(c->avctx, AV_LOG_ERROR, "backward motion vector in P frame\n");
1020 return INT_MAX; 1020 return INT_MAX/4;
1021 } 1021 }
1022 assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1)); 1022 assert(IS_INTRA(mb_type) || USES_LIST(mb_type,0) || USES_LIST(mb_type,1));
1023 1023
1024 for(i=0; i<4; i++){ 1024 for(i=0; i<4; i++){
1025 int xy= s->block_index[i]; 1025 int xy= s->block_index[i];
1033 c->stride<<=1; 1033 c->stride<<=1;
1034 c->uvstride<<=1; 1034 c->uvstride<<=1;
1035 1035
1036 if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){ 1036 if(!(s->flags & CODEC_FLAG_INTERLACED_ME)){
1037 av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n"); 1037 av_log(c->avctx, AV_LOG_ERROR, "Interlaced macroblock selected but interlaced motion estimation disabled\n");
1038 return INT_MAX; 1038 return INT_MAX/4;
1039 } 1039 }
1040 1040
1041 if(USES_LIST(mb_type, 0)){ 1041 if(USES_LIST(mb_type, 0)){
1042 int field_select0= p->ref_index[0][xy ]; 1042 int field_select0= p->ref_index[0][xy ];
1043 int field_select1= p->ref_index[0][xy2]; 1043 int field_select1= p->ref_index[0][xy2];
1094 c->stride>>=1; 1094 c->stride>>=1;
1095 c->uvstride>>=1; 1095 c->uvstride>>=1;
1096 }else if(IS_8X8(mb_type)){ 1096 }else if(IS_8X8(mb_type)){
1097 if(!(s->flags & CODEC_FLAG_4MV)){ 1097 if(!(s->flags & CODEC_FLAG_4MV)){
1098 av_log(c->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n"); 1098 av_log(c->avctx, AV_LOG_ERROR, "4MV macroblock selected but 4MV encoding disabled\n");
1099 return INT_MAX; 1099 return INT_MAX/4;
1100 } 1100 }
1101 cmpf= s->dsp.sse[1]; 1101 cmpf= s->dsp.sse[1];
1102 chroma_cmpf= s->dsp.sse[1]; 1102 chroma_cmpf= s->dsp.sse[1];
1103 init_mv4_ref(c); 1103 init_mv4_ref(c);
1104 for(i=0; i<4; i++){ 1104 for(i=0; i<4; i++){