comparison h264.c @ 2650:d321fbf0b2ce libavcodec

reverse 1 hunk from 1.96->1.97, fixes decoding of (MR1_BT_A.h264 and MR1_MW_A.264)
author michael
date Sat, 07 May 2005 11:07:47 +0000
parents b2e6c5e9240b
children a4e3a37ed57b
comparison
equal deleted inserted replaced
2649:b2e6c5e9240b 2650:d321fbf0b2ce
3299 3299
3300 if(reordering_of_pic_nums_idc == 0) pred-= abs_diff_pic_num; 3300 if(reordering_of_pic_nums_idc == 0) pred-= abs_diff_pic_num;
3301 else pred+= abs_diff_pic_num; 3301 else pred+= abs_diff_pic_num;
3302 pred &= h->max_pic_num - 1; 3302 pred &= h->max_pic_num - 1;
3303 3303
3304 for(i= h->short_ref_count-1; i>=0; i--){ 3304 for(i= h->ref_count[list]-1; i>=0; i--){
3305 ref = h->short_ref[i]; 3305 if(h->ref_list[list][i].data[0] != NULL && h->ref_list[list][i].pic_id == pred && h->ref_list[list][i].long_ref==0) // ignore non existing pictures by testing data[0] pointer
3306 if(ref->data[0] != NULL && ref->frame_num == pred && ref->long_ref == 0) // ignore non existing pictures by testing data[0] pointer
3307 break; 3306 break;
3308 } 3307 }
3309 }else{ 3308 }else{
3310 pic_id= get_ue_golomb(&s->gb); //long_term_pic_idx 3309 pic_id= get_ue_golomb(&s->gb); //long_term_pic_idx
3311 ref = h->long_ref[pic_id]; 3310
3311 for(i= h->ref_count[list]-1; i>=0; i--){
3312 if(h->ref_list[list][i].pic_id == pic_id && h->ref_list[list][i].long_ref==1) // no need to ignore non existing pictures as non existing pictures have long_ref==0
3313 break;
3314 }
3312 } 3315 }
3313 3316
3314 if (i < 0) { 3317 if (i < 0) {
3315 av_log(h->s.avctx, AV_LOG_ERROR, "reference picture missing during reorder\n"); 3318 av_log(h->s.avctx, AV_LOG_ERROR, "reference picture missing during reorder\n");
3316 memset(&h->ref_list[list][index], 0, sizeof(Picture)); //FIXME 3319 memset(&h->ref_list[list][index], 0, sizeof(Picture)); //FIXME
3317 } else { 3320 } else if (i != index) /* this test is not necessary, it is only an optimisation to skip double copy of Picture structure in this case */ {
3318 h->ref_list[list][index]= *ref; 3321 Picture tmp= h->ref_list[list][i];
3322 if (i < index) {
3323 i = h->ref_count[list];
3324 }
3325 for(; i > index; i--){
3326 h->ref_list[list][i]= h->ref_list[list][i-1];
3327 }
3328 h->ref_list[list][index]= tmp;
3319 } 3329 }
3320 }else{ 3330 }else{
3321 av_log(h->s.avctx, AV_LOG_ERROR, "illegal reordering_of_pic_nums_idc\n"); 3331 av_log(h->s.avctx, AV_LOG_ERROR, "illegal reordering_of_pic_nums_idc\n");
3322 return -1; 3332 return -1;
3323 } 3333 }