Removing yet another weird field pic special case,

now related to SHORT2LONG MMCOs.

Originally committed as revision 14394 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 17 years ago
parent 9c0e46242f
commit 472c9a58a8
  1. 24
      libavcodec/h264.c

@ -3453,26 +3453,25 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
if(s->avctx->debug&FF_DEBUG_MMCO)
av_log(h->s.avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode, h->mmco[i].short_pic_num, h->mmco[i].long_arg);
if( mmco[i].opcode == MMCO_SHORT2UNUSED
|| mmco[i].opcode == MMCO_SHORT2LONG){
frame_num = pic_num_extract(h, mmco[i].short_pic_num, &structure);
pic = find_short(h, frame_num, &j);
if(!pic){
av_log(h->s.avctx, AV_LOG_ERROR, "mmco: unref short failure\n");
continue;
}
}
switch(mmco[i].opcode){
case MMCO_SHORT2UNUSED:
if(s->avctx->debug&FF_DEBUG_MMCO)
av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: unref short %d count %d\n", h->mmco[i].short_pic_num, h->short_ref_count);
frame_num = pic_num_extract(h, mmco[i].short_pic_num, &structure);
pic = find_short(h, frame_num, &j);
if (pic) {
if (unreference_pic(h, pic, structure ^ PICT_FRAME))
remove_short_at_index(h, j);
} else if(s->avctx->debug&FF_DEBUG_MMCO)
av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: unref short failure\n");
break;
case MMCO_SHORT2LONG:
if (FIELD_PICTURE && mmco[i].long_arg < h->long_ref_count &&
h->long_ref[mmco[i].long_arg]->frame_num ==
mmco[i].short_pic_num / 2) {
/* do nothing, we've already moved this field pair. */
} else {
int frame_num = mmco[i].short_pic_num >> FIELD_PICTURE;
if (h->long_ref[mmco[i].long_arg] != pic)
remove_long(h, mmco[i].long_arg, 0);
h->long_ref[ mmco[i].long_arg ]= remove_short(h, frame_num);
@ -3480,7 +3479,6 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
h->long_ref[ mmco[i].long_arg ]->long_ref=1;
h->long_ref_count++;
}
}
break;
case MMCO_LONG2UNUSED:
j = pic_num_extract(h, mmco[i].long_arg, &structure);

Loading…
Cancel
Save