Revision bd31a775 libavcodec/mpegvideo.c

View differences:

libavcodec/mpegvideo.c
487 487
    } else {
488 488
        s->pict_type = I_TYPE;
489 489
    }
490
    avctx->key_frame = (s->pict_type == I_TYPE);
491 490
    
492 491
    MPV_frame_start(s);
493 492
    
......
518 517
    }
519 518

  
520 519
    encode_picture(s, s->picture_number);
520
    avctx->key_frame = (s->pict_type == I_TYPE);
521 521
    
522 522
    MPV_frame_end(s);
523 523
    s->picture_number++;
......
1078 1078
        }
1079 1079
    }
1080 1080

  
1081
    if(s->avg_mb_var < s->mc_mb_var && s->pict_type != B_TYPE){ //FIXME subtract MV bits
1082
        int i;
1083
        s->pict_type= I_TYPE;
1084
        for(i=0; i<s->mb_height*s->mb_width; i++){
1085
            s->mb_type[i] = I_TYPE;
1086
            s->mv_table[0][i] = 0;
1087
            s->mv_table[1][i] = 0;
1088
        }
1089
    }
1090
        
1091
//    printf("%d %d\n", s->avg_mb_var, s->mc_mb_var);
1092

  
1081 1093
    if (!s->fixed_qscale) 
1082 1094
        s->qscale = rate_estimate_qscale(s);
1083 1095

  

Also available in: Unified diff