Revision ce5e49b0 libavcodec/mpeg4videoenc.c

View differences:

libavcodec/mpeg4videoenc.c
205 205

  
206 206
    ff_clean_h263_qscales(s);
207 207

  
208
    if(s->pict_type== FF_B_TYPE){
208
    if(s->pict_type== AV_PICTURE_TYPE_B){
209 209
        int odd=0;
210 210
        /* ok, come on, this isn't funny anymore, there's more code for handling this mpeg4 mess than for the actual adaptive quantization */
211 211

  
......
497 497
{
498 498
    int cbpc, cbpy, pred_x, pred_y;
499 499
    PutBitContext * const pb2    = s->data_partitioning                         ? &s->pb2    : &s->pb;
500
    PutBitContext * const tex_pb = s->data_partitioning && s->pict_type!=FF_B_TYPE ? &s->tex_pb : &s->pb;
501
    PutBitContext * const dc_pb  = s->data_partitioning && s->pict_type!=FF_I_TYPE ? &s->pb2    : &s->pb;
500
    PutBitContext * const tex_pb = s->data_partitioning && s->pict_type!=AV_PICTURE_TYPE_B ? &s->tex_pb : &s->pb;
501
    PutBitContext * const dc_pb  = s->data_partitioning && s->pict_type!=AV_PICTURE_TYPE_I ? &s->pb2    : &s->pb;
502 502
    const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0;
503 503

  
504 504
    if (!s->mb_intra) {
505 505
        int i, cbp;
506 506

  
507
        if(s->pict_type==FF_B_TYPE){
507
        if(s->pict_type==AV_PICTURE_TYPE_B){
508 508
            static const int mb_type_table[8]= {-1, 3, 2, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */
509 509
            int mb_type=  mb_type_table[s->mv_dir];
510 510

  
......
637 637
                s->p_tex_bits+= get_bits_diff(s);
638 638
            }
639 639

  
640
        }else{ /* s->pict_type==FF_B_TYPE */
640
        }else{ /* s->pict_type==AV_PICTURE_TYPE_B */
641 641
            cbp= get_p_cbp(s, block, motion_x, motion_y);
642 642

  
643 643
            if ((cbp | motion_x | motion_y | s->dquant) == 0 && s->mv_type==MV_TYPE_16X16) {
......
660 660
                        int diff;
661 661
                        Picture *pic= s->reordered_input_picture[i+1];
662 662

  
663
                        if(pic==NULL || pic->pict_type!=FF_B_TYPE) break;
663
                        if(pic==NULL || pic->pict_type!=AV_PICTURE_TYPE_B) break;
664 664

  
665 665
                        b_pic= pic->data[0] + offset;
666 666
                        if(pic->type != FF_BUFFER_TYPE_SHARED)
......
824 824
        }
825 825

  
826 826
        cbpc = cbp & 3;
827
        if (s->pict_type == FF_I_TYPE) {
827
        if (s->pict_type == AV_PICTURE_TYPE_I) {
828 828
            if(s->dquant) cbpc+=4;
829 829
            put_bits(&s->pb,
830 830
                ff_h263_intra_MCBPC_bits[cbpc],
......
876 876

  
877 877
/* must be called before writing the header */
878 878
void ff_set_mpeg4_time(MpegEncContext * s){
879
    if(s->pict_type==FF_B_TYPE){
879
    if(s->pict_type==AV_PICTURE_TYPE_B){
880 880
        ff_mpeg4_init_direct_mv(s);
881 881
    }else{
882 882
        s->last_time_base= s->time_base;
......
1066 1066
    int time_incr;
1067 1067
    int time_div, time_mod;
1068 1068

  
1069
    if(s->pict_type==FF_I_TYPE){
1069
    if(s->pict_type==AV_PICTURE_TYPE_I){
1070 1070
        if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){
1071 1071
            if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy
1072 1072
                mpeg4_encode_visual_object_header(s);
......
1077 1077
            mpeg4_encode_gop_header(s);
1078 1078
    }
1079 1079

  
1080
    s->partitioned_frame= s->data_partitioning && s->pict_type!=FF_B_TYPE;
1080
    s->partitioned_frame= s->data_partitioning && s->pict_type!=AV_PICTURE_TYPE_B;
1081 1081

  
1082 1082
    put_bits(&s->pb, 16, 0);                /* vop header */
1083 1083
    put_bits(&s->pb, 16, VOP_STARTCODE);    /* vop header */
......
1097 1097
    put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */
1098 1098
    put_bits(&s->pb, 1, 1);                             /* marker */
1099 1099
    put_bits(&s->pb, 1, 1);                             /* vop coded */
1100
    if (    s->pict_type == FF_P_TYPE
1101
        || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
1100
    if (    s->pict_type == AV_PICTURE_TYPE_P
1101
        || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE)) {
1102 1102
        put_bits(&s->pb, 1, s->no_rounding);    /* rounding type */
1103 1103
    }
1104 1104
    put_bits(&s->pb, 3, 0);     /* intra dc VLC threshold */
......
1110 1110

  
1111 1111
    put_bits(&s->pb, 5, s->qscale);
1112 1112

  
1113
    if (s->pict_type != FF_I_TYPE)
1113
    if (s->pict_type != AV_PICTURE_TYPE_I)
1114 1114
        put_bits(&s->pb, 3, s->f_code); /* fcode_for */
1115
    if (s->pict_type == FF_B_TYPE)
1115
    if (s->pict_type == AV_PICTURE_TYPE_B)
1116 1116
        put_bits(&s->pb, 3, s->b_code); /* fcode_back */
1117 1117
}
1118 1118

  
......
1317 1317
    const int tex_pb_len= put_bits_count(&s->tex_pb);
1318 1318
    const int bits= put_bits_count(&s->pb);
1319 1319

  
1320
    if(s->pict_type==FF_I_TYPE){
1320
    if(s->pict_type==AV_PICTURE_TYPE_I){
1321 1321
        put_bits(&s->pb, 19, DC_MARKER);
1322 1322
        s->misc_bits+=19 + pb2_len + bits - s->last_bits;
1323 1323
        s->i_tex_bits+= tex_pb_len;

Also available in: Unified diff