Revision ce5e49b0 libavcodec/msmpeg4.c

View differences:

libavcodec/msmpeg4.c
308 308
                    int intra_luma_count  = s->ac_stats[1][0][level][run][last];
309 309
                    int intra_chroma_count= s->ac_stats[1][1][level][run][last];
310 310

  
311
                    if(s->pict_type==FF_I_TYPE){
311
                    if(s->pict_type==AV_PICTURE_TYPE_I){
312 312
                        size       += intra_luma_count  *rl_length[i  ][level][run][last];
313 313
                        chroma_size+= intra_chroma_count*rl_length[i+3][level][run][last];
314 314
                    }else{
......
333 333
//    printf("type:%d, best:%d, qp:%d, var:%d, mcvar:%d, size:%d //\n",
334 334
//           s->pict_type, best, s->qscale, s->mb_var_sum, s->mc_mb_var_sum, best_size);
335 335

  
336
    if(s->pict_type==FF_P_TYPE) chroma_best= best;
336
    if(s->pict_type==AV_PICTURE_TYPE_P) chroma_best= best;
337 337

  
338 338
    memset(s->ac_stats, 0, sizeof(int)*(MAX_LEVEL+1)*(MAX_RUN+1)*2*2*2);
339 339

  
......
342 342

  
343 343
    if(s->pict_type != s->last_non_b_pict_type){
344 344
        s->rl_table_index= 2;
345
        if(s->pict_type==FF_I_TYPE)
345
        if(s->pict_type==AV_PICTURE_TYPE_I)
346 346
            s->rl_chroma_table_index= 1;
347 347
        else
348 348
            s->rl_chroma_table_index= 2;
......
369 369
    s->use_skip_mb_code = 1; /* only if P frame */
370 370
    s->per_mb_rl_table = 0;
371 371
    if(s->msmpeg4_version==4)
372
        s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==FF_P_TYPE);
372
        s->inter_intra_pred= (s->width*s->height < 320*240 && s->bit_rate<=II_BITRATE && s->pict_type==AV_PICTURE_TYPE_P);
373 373
//printf("%d %d %d %d %d\n", s->pict_type, s->bit_rate, s->inter_intra_pred, s->width, s->height);
374 374

  
375
    if (s->pict_type == FF_I_TYPE) {
375
    if (s->pict_type == AV_PICTURE_TYPE_I) {
376 376
        s->slice_height= s->mb_height/1;
377 377
        put_bits(&s->pb, 5, 0x16 + s->mb_height/s->slice_height);
378 378

  
......
619 619
        }
620 620

  
621 621
        if(s->msmpeg4_version<=2){
622
            if (s->pict_type == FF_I_TYPE) {
622
            if (s->pict_type == AV_PICTURE_TYPE_I) {
623 623
                put_bits(&s->pb,
624 624
                         v2_intra_cbpc[cbp&3][1], v2_intra_cbpc[cbp&3][0]);
625 625
            } else {
......
634 634
                     ff_h263_cbpy_tab[cbp>>2][1],
635 635
                     ff_h263_cbpy_tab[cbp>>2][0]);
636 636
        }else{
637
            if (s->pict_type == FF_I_TYPE) {
637
            if (s->pict_type == AV_PICTURE_TYPE_I) {
638 638
                put_bits(&s->pb,
639 639
                         ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
640 640
            } else {
......
1094 1094
{
1095 1095
    int cbp, code, i;
1096 1096

  
1097
    if (s->pict_type == FF_P_TYPE) {
1097
    if (s->pict_type == AV_PICTURE_TYPE_P) {
1098 1098
        if (s->use_skip_mb_code) {
1099 1099
            if (get_bits1(&s->gb)) {
1100 1100
                /* skip mb */
......
1161 1161
        } else{
1162 1162
            s->ac_pred = 0;
1163 1163
            cbp|= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors
1164
            if(s->pict_type==FF_P_TYPE) cbp^=0x3C;
1164
            if(s->pict_type==AV_PICTURE_TYPE_P) cbp^=0x3C;
1165 1165
        }
1166 1166
    }
1167 1167

  
......
1182 1182
    uint8_t *coded_val;
1183 1183
    uint32_t * const mb_type_ptr= &s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ];
1184 1184

  
1185
    if (s->pict_type == FF_P_TYPE) {
1185
    if (s->pict_type == AV_PICTURE_TYPE_P) {
1186 1186
        if (s->use_skip_mb_code) {
1187 1187
            if (get_bits1(&s->gb)) {
1188 1188
                /* skip mb */
......
1390 1390
    }
1391 1391

  
1392 1392
    s->pict_type = get_bits(&s->gb, 2) + 1;
1393
    if (s->pict_type != FF_I_TYPE &&
1394
        s->pict_type != FF_P_TYPE){
1393
    if (s->pict_type != AV_PICTURE_TYPE_I &&
1394
        s->pict_type != AV_PICTURE_TYPE_P){
1395 1395
        av_log(s->avctx, AV_LOG_ERROR, "invalid picture type\n");
1396 1396
        return -1;
1397 1397
    }
1398 1398
#if 0
1399 1399
{
1400 1400
    static int had_i=0;
1401
    if(s->pict_type == FF_I_TYPE) had_i=1;
1401
    if(s->pict_type == AV_PICTURE_TYPE_I) had_i=1;
1402 1402
    if(!had_i) return -1;
1403 1403
}
1404 1404
#endif
......
1408 1408
        return -1;
1409 1409
    }
1410 1410

  
1411
    if (s->pict_type == FF_I_TYPE) {
1411
    if (s->pict_type == AV_PICTURE_TYPE_I) {
1412 1412
        code = get_bits(&s->gb, 5);
1413 1413
        if(s->msmpeg4_version==1){
1414 1414
            if(code==0 || code>s->mb_height){

Also available in: Unified diff