Browse code

Replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*.

Signed-off-by: Diego Biurrun <diego@biurrun.de>

Stefano Sabatini authored on 2011/04/30 01:53:57
Showing 137 changed files
... ...
@@ -1198,7 +1198,7 @@ static void do_video_out(AVFormatContext *s,
1198 1198
 //av_log(NULL, AV_LOG_DEBUG, "%"PRId64" -> encoder\n", ost->sync_opts);
1199 1199
             if (ost->forced_kf_index < ost->forced_kf_count &&
1200 1200
                 big_picture.pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
1201
-                big_picture.pict_type = FF_I_TYPE;
1201
+                big_picture.pict_type = AV_PICTURE_TYPE_I;
1202 1202
                 ost->forced_kf_index++;
1203 1203
             }
1204 1204
             ret = avcodec_encode_video(enc,
... ...
@@ -783,11 +783,11 @@ static int decode_frame(AVCodecContext *avctx,
783 783
     }
784 784
 
785 785
     if(frame_4cc == AV_RL32("ifr2")){
786
-        p->pict_type= FF_I_TYPE;
786
+        p->pict_type= AV_PICTURE_TYPE_I;
787 787
         if(decode_i2_frame(f, buf-4, frame_size) < 0)
788 788
             return -1;
789 789
     }else if(frame_4cc == AV_RL32("ifrm")){
790
-        p->pict_type= FF_I_TYPE;
790
+        p->pict_type= AV_PICTURE_TYPE_I;
791 791
         if(decode_i_frame(f, buf, frame_size) < 0)
792 792
             return -1;
793 793
     }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
... ...
@@ -799,7 +799,7 @@ static int decode_frame(AVCodecContext *avctx,
799 799
             }
800 800
         }
801 801
 
802
-        p->pict_type= FF_P_TYPE;
802
+        p->pict_type= AV_PICTURE_TYPE_P;
803 803
         if(decode_p_frame(f, buf, frame_size) < 0)
804 804
             return -1;
805 805
     }else if(frame_4cc == AV_RL32("snd_")){
... ...
@@ -808,7 +808,7 @@ static int decode_frame(AVCodecContext *avctx,
808 808
         av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n", buf_size);
809 809
     }
810 810
 
811
-    p->key_frame= p->pict_type == FF_I_TYPE;
811
+    p->key_frame= p->pict_type == AV_PICTURE_TYPE_I;
812 812
 
813 813
     *picture= *p;
814 814
     *data_size = sizeof(AVPicture);
... ...
@@ -216,7 +216,7 @@ static av_cold int a64multi_init_encoder(AVCodecContext *avctx)
216 216
 
217 217
     avcodec_get_frame_defaults(&c->picture);
218 218
     avctx->coded_frame            = &c->picture;
219
-    avctx->coded_frame->pict_type = FF_I_TYPE;
219
+    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
220 220
     avctx->coded_frame->key_frame = 1;
221 221
     if (!avctx->codec_tag)
222 222
          avctx->codec_tag = AV_RL32("a64m");
... ...
@@ -290,7 +290,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, unsigned char *buf,
290 290
         /* fill up mc_meta_charset with data until lifetime exceeds */
291 291
         if (c->mc_frame_counter < c->mc_lifetime) {
292 292
             *p = *pict;
293
-            p->pict_type = FF_I_TYPE;
293
+            p->pict_type = AV_PICTURE_TYPE_I;
294 294
             p->key_frame = 1;
295 295
             to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter);
296 296
             c->mc_frame_counter++;
... ...
@@ -226,7 +226,7 @@ static int execute_code(AVCodecContext * avctx, int c)
226 226
                 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
227 227
                 return ret;
228 228
             }
229
-            s->frame.pict_type           = FF_I_TYPE;
229
+            s->frame.pict_type           = AV_PICTURE_TYPE_I;
230 230
             s->frame.palette_has_changed = 1;
231 231
             memcpy(s->frame.data[1], ff_cga_palette, 16 * 4);
232 232
             erase_screen(avctx);
... ...
@@ -323,7 +323,7 @@ static int decode_frame(AVCodecContext *avctx,
323 323
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
324 324
         return ret;
325 325
     }
326
-    s->frame.pict_type           = FF_I_TYPE;
326
+    s->frame.pict_type           = AV_PICTURE_TYPE_I;
327 327
     s->frame.palette_has_changed = 1;
328 328
     memcpy(s->frame.data[1], ff_cga_palette, 16 * 4);
329 329
 
... ...
@@ -405,7 +405,7 @@ static int decode_frame(AVCodecContext *avctx,
405 405
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
406 406
         return -1;
407 407
     }
408
-    p->pict_type= FF_I_TYPE;
408
+    p->pict_type= AV_PICTURE_TYPE_I;
409 409
     p->key_frame= 1;
410 410
 
411 411
     av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
... ...
@@ -470,7 +470,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
470 470
     init_put_bits(&a->pb, buf, buf_size);
471 471
 
472 472
     *p = *pict;
473
-    p->pict_type= FF_I_TYPE;
473
+    p->pict_type= AV_PICTURE_TYPE_I;
474 474
     p->key_frame= 1;
475 475
 
476 476
     for(mb_y=0; mb_y<a->mb_height2; mb_y++){
... ...
@@ -3842,7 +3842,7 @@ typedef struct AVCodecParserContext {
3842 3842
     /*!
3843 3843
      * Set by parser to 1 for key frames and 0 for non-key frames.
3844 3844
      * It is initialized to -1, so if the parser doesn't set this flag,
3845
-     * old-style fallback using FF_I_TYPE picture type as key frames
3845
+     * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
3846 3846
      * will be used.
3847 3847
      */
3848 3848
     int key_frame;
... ...
@@ -63,7 +63,7 @@ avs_decode_frame(AVCodecContext * avctx,
63 63
         return -1;
64 64
     }
65 65
     p->reference = 1;
66
-    p->pict_type = FF_P_TYPE;
66
+    p->pict_type = AV_PICTURE_TYPE_P;
67 67
     p->key_frame = 0;
68 68
 
69 69
     out = avs->picture.data[0];
... ...
@@ -93,7 +93,7 @@ avs_decode_frame(AVCodecContext * avctx,
93 93
 
94 94
     switch (sub_type) {
95 95
     case AVS_I_FRAME:
96
-        p->pict_type = FF_I_TYPE;
96
+        p->pict_type = AV_PICTURE_TYPE_I;
97 97
         p->key_frame = 1;
98 98
     case AVS_P_FRAME_3X3:
99 99
         vect_w = 3;
... ...
@@ -68,7 +68,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
68 68
 
69 69
     /* Set frame parameters and palette, if necessary */
70 70
     if (!avctx->frame_number) {
71
-        bfi->frame.pict_type = FF_I_TYPE;
71
+        bfi->frame.pict_type = AV_PICTURE_TYPE_I;
72 72
         bfi->frame.key_frame = 1;
73 73
         /* Setting the palette */
74 74
         if(avctx->extradata_size>768) {
... ...
@@ -87,7 +87,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
87 87
         }
88 88
         bfi->frame.palette_has_changed = 1;
89 89
     } else {
90
-        bfi->frame.pict_type = FF_P_TYPE;
90
+        bfi->frame.pict_type = AV_PICTURE_TYPE_P;
91 91
         bfi->frame.key_frame = 0;
92 92
     }
93 93
 
... ...
@@ -200,7 +200,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
200 200
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
201 201
         return -1;
202 202
     }
203
-    p->pict_type = FF_I_TYPE;
203
+    p->pict_type = AV_PICTURE_TYPE_I;
204 204
     p->key_frame = 1;
205 205
 
206 206
     buf = buf0 + hsize;
... ...
@@ -74,7 +74,7 @@ static int bmp_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_s
74 74
     uint8_t *ptr;
75 75
     unsigned char* buf0 = buf;
76 76
     *p = *pict;
77
-    p->pict_type= FF_I_TYPE;
77
+    p->pict_type= AV_PICTURE_TYPE_I;
78 78
     p->key_frame= 1;
79 79
     switch (avctx->pix_fmt) {
80 80
     case PIX_FMT_RGB565:
... ...
@@ -137,10 +137,10 @@ static int decode_frame(AVCodecContext *avctx, void *data,
137 137
     stride = newpic->linesize[0];
138 138
 
139 139
     if (buf[0] & C93_FIRST_FRAME) {
140
-        newpic->pict_type = FF_I_TYPE;
140
+        newpic->pict_type = AV_PICTURE_TYPE_I;
141 141
         newpic->key_frame = 1;
142 142
     } else {
143
-        newpic->pict_type = FF_P_TYPE;
143
+        newpic->pict_type = AV_PICTURE_TYPE_P;
144 144
         newpic->key_frame = 0;
145 145
     }
146 146
 
... ...
@@ -278,7 +278,7 @@ static inline void set_mv_intra(AVSContext *h) {
278 278
     set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
279 279
     h->mv[MV_BWD_X0] = ff_cavs_intra_mv;
280 280
     set_mvs(&h->mv[MV_BWD_X0], BLK_16X16);
281
-    if(h->pic_type != FF_B_TYPE)
281
+    if(h->pic_type != AV_PICTURE_TYPE_B)
282 282
         h->col_type_base[h->mbidx] = I_8X8;
283 283
 }
284 284
 
... ...
@@ -220,7 +220,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code) {
220 220
     ff_cavs_modify_mb_i(h, &pred_mode_uv);
221 221
 
222 222
     /* get coded block pattern */
223
-    if(h->pic_type == FF_I_TYPE)
223
+    if(h->pic_type == AV_PICTURE_TYPE_I)
224 224
         cbp_code = get_ue_golomb(gb);
225 225
     if(cbp_code > 63){
226 226
         av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n");
... ...
@@ -424,7 +424,7 @@ static inline int decode_slice_header(AVSContext *h, GetBitContext *gb) {
424 424
         h->qp = get_bits(gb,6);
425 425
     }
426 426
     /* inter frame or second slice can have weighting params */
427
-    if((h->pic_type != FF_I_TYPE) || (!h->pic_structure && h->mby >= h->mb_width/2))
427
+    if((h->pic_type != AV_PICTURE_TYPE_I) || (!h->pic_structure && h->mby >= h->mb_width/2))
428 428
         if(get_bits1(gb)) { //slice_weighting_flag
429 429
             av_log(h->s.avctx, AV_LOG_ERROR,
430 430
                    "weighted prediction not yet supported\n");
... ...
@@ -470,17 +470,17 @@ static int decode_pic(AVSContext *h) {
470 470
     }
471 471
     skip_bits(&s->gb,16);//bbv_dwlay
472 472
     if(h->stc == PIC_PB_START_CODE) {
473
-        h->pic_type = get_bits(&s->gb,2) + FF_I_TYPE;
474
-        if(h->pic_type > FF_B_TYPE) {
473
+        h->pic_type = get_bits(&s->gb,2) + AV_PICTURE_TYPE_I;
474
+        if(h->pic_type > AV_PICTURE_TYPE_B) {
475 475
             av_log(s->avctx, AV_LOG_ERROR, "illegal picture type\n");
476 476
             return -1;
477 477
         }
478 478
         /* make sure we have the reference frames we need */
479 479
         if(!h->DPB[0].data[0] ||
480
-          (!h->DPB[1].data[0] && h->pic_type == FF_B_TYPE))
480
+          (!h->DPB[1].data[0] && h->pic_type == AV_PICTURE_TYPE_B))
481 481
             return -1;
482 482
     } else {
483
-        h->pic_type = FF_I_TYPE;
483
+        h->pic_type = AV_PICTURE_TYPE_I;
484 484
         if(get_bits1(&s->gb))
485 485
             skip_bits(&s->gb,24);//time_code
486 486
         /* old sample clips were all progressive and no low_delay,
... ...
@@ -502,7 +502,7 @@ static int decode_pic(AVSContext *h) {
502 502
     h->picture.poc = get_bits(&s->gb,8)*2;
503 503
 
504 504
     /* get temporal distances and MV scaling factors */
505
-    if(h->pic_type != FF_B_TYPE) {
505
+    if(h->pic_type != AV_PICTURE_TYPE_B) {
506 506
         h->dist[0] = (h->picture.poc - h->DPB[0].poc  + 512) % 512;
507 507
     } else {
508 508
         h->dist[0] = (h->DPB[0].poc  - h->picture.poc + 512) % 512;
... ...
@@ -510,7 +510,7 @@ static int decode_pic(AVSContext *h) {
510 510
     h->dist[1] = (h->picture.poc - h->DPB[1].poc  + 512) % 512;
511 511
     h->scale_den[0] = h->dist[0] ? 512/h->dist[0] : 0;
512 512
     h->scale_den[1] = h->dist[1] ? 512/h->dist[1] : 0;
513
-    if(h->pic_type == FF_B_TYPE) {
513
+    if(h->pic_type == AV_PICTURE_TYPE_B) {
514 514
         h->sym_factor = h->dist[0]*h->scale_den[1];
515 515
     } else {
516 516
         h->direct_den[0] = h->dist[0] ? 16384/h->dist[0] : 0;
... ...
@@ -529,12 +529,12 @@ static int decode_pic(AVSContext *h) {
529 529
     skip_bits1(&s->gb);        //repeat_first_field
530 530
     h->qp_fixed                = get_bits1(&s->gb);
531 531
     h->qp                      = get_bits(&s->gb,6);
532
-    if(h->pic_type == FF_I_TYPE) {
532
+    if(h->pic_type == AV_PICTURE_TYPE_I) {
533 533
         if(!h->progressive && !h->pic_structure)
534 534
             skip_bits1(&s->gb);//what is this?
535 535
         skip_bits(&s->gb,4);   //reserved bits
536 536
     } else {
537
-        if(!(h->pic_type == FF_B_TYPE && h->pic_structure == 1))
537
+        if(!(h->pic_type == AV_PICTURE_TYPE_B && h->pic_structure == 1))
538 538
             h->ref_flag        = get_bits1(&s->gb);
539 539
         skip_bits(&s->gb,4);   //reserved bits
540 540
         h->skip_mode_flag      = get_bits1(&s->gb);
... ...
@@ -546,12 +546,12 @@ static int decode_pic(AVSContext *h) {
546 546
     } else {
547 547
         h->alpha_offset = h->beta_offset  = 0;
548 548
     }
549
-    if(h->pic_type == FF_I_TYPE) {
549
+    if(h->pic_type == AV_PICTURE_TYPE_I) {
550 550
         do {
551 551
             check_for_slice(h);
552 552
             decode_mb_i(h, 0);
553 553
         } while(ff_cavs_next_mb(h));
554
-    } else if(h->pic_type == FF_P_TYPE) {
554
+    } else if(h->pic_type == AV_PICTURE_TYPE_P) {
555 555
         do {
556 556
             if(check_for_slice(h))
557 557
                 skip_count = -1;
... ...
@@ -567,7 +567,7 @@ static int decode_pic(AVSContext *h) {
567 567
                     decode_mb_p(h,mb_type);
568 568
             }
569 569
         } while(ff_cavs_next_mb(h));
570
-    } else { /* FF_B_TYPE */
570
+    } else { /* AV_PICTURE_TYPE_B */
571 571
         do {
572 572
             if(check_for_slice(h))
573 573
                 skip_count = -1;
... ...
@@ -584,7 +584,7 @@ static int decode_pic(AVSContext *h) {
584 584
             }
585 585
         } while(ff_cavs_next_mb(h));
586 586
     }
587
-    if(h->pic_type != FF_B_TYPE) {
587
+    if(h->pic_type != AV_PICTURE_TYPE_B) {
588 588
         if(h->DPB[1].data[0])
589 589
             s->avctx->release_buffer(s->avctx, (AVFrame *)&h->DPB[1]);
590 590
         h->DPB[1] = h->DPB[0];
... ...
@@ -684,7 +684,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
684 684
             if(decode_pic(h))
685 685
                 break;
686 686
             *data_size = sizeof(AVPicture);
687
-            if(h->pic_type != FF_B_TYPE) {
687
+            if(h->pic_type != AV_PICTURE_TYPE_B) {
688 688
                 if(h->DPB[1].data[0]) {
689 689
                     *picture = *(AVFrame *) &h->DPB[1];
690 690
                 } else {
... ...
@@ -64,7 +64,7 @@ static int decode_frame(AVCodecContext *avctx,
64 64
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
65 65
         return -1;
66 66
     }
67
-    p->pict_type= FF_I_TYPE;
67
+    p->pict_type= AV_PICTURE_TYPE_I;
68 68
     p->key_frame= 1;
69 69
 
70 70
     init_get_bits(&a->gb, buf, buf_size);
... ...
@@ -100,7 +100,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
100 100
     int size;
101 101
 
102 102
     *p = *pict;
103
-    p->pict_type= FF_I_TYPE;
103
+    p->pict_type= AV_PICTURE_TYPE_I;
104 104
     p->key_frame= 1;
105 105
 
106 106
     emms_c();
... ...
@@ -183,7 +183,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
183 183
 
184 184
     // flip upside down, add difference frame
185 185
     if (buf[0] & 1) { // keyframe
186
-        c->pic.pict_type = FF_I_TYPE;
186
+        c->pic.pict_type = AV_PICTURE_TYPE_I;
187 187
         c->pic.key_frame = 1;
188 188
         switch (c->bpp) {
189 189
           case 16:
... ...
@@ -197,7 +197,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
197 197
                                  c->linelen, c->height);
198 198
         }
199 199
     } else {
200
-        c->pic.pict_type = FF_P_TYPE;
200
+        c->pic.pict_type = AV_PICTURE_TYPE_P;
201 201
         c->pic.key_frame = 0;
202 202
         switch (c->bpp) {
203 203
           case 16:
... ...
@@ -194,7 +194,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx,
194 194
                 avctx->has_b_frames = 1;
195 195
         }
196 196
         if (avctx->has_b_frames && s->pts == s->dts)
197
-             s->pict_type = FF_B_TYPE;
197
+             s->pict_type = AV_PICTURE_TYPE_B;
198 198
 
199 199
         /* Finally have a complete Dirac data unit */
200 200
         *buf      = pc->dirac_unit;
... ...
@@ -55,7 +55,7 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
55 55
     ctx->avctx = avctx;
56 56
     dsputil_init(&ctx->dsp, avctx);
57 57
     avctx->coded_frame = &ctx->picture;
58
-    ctx->picture.type = FF_I_TYPE;
58
+    ctx->picture.type = AV_PICTURE_TYPE_I;
59 59
     ctx->picture.key_frame = 1;
60 60
     return 0;
61 61
 }
... ...
@@ -222,7 +222,7 @@ static int dnxhd_encode_init(AVCodecContext *avctx)
222 222
     FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_qscale,  ctx->m.mb_num   *sizeof(uint8_t) , fail);
223 223
 
224 224
     ctx->frame.key_frame = 1;
225
-    ctx->frame.pict_type = FF_I_TYPE;
225
+    ctx->frame.pict_type = AV_PICTURE_TYPE_I;
226 226
     ctx->m.avctx->coded_frame = &ctx->frame;
227 227
 
228 228
     if (avctx->thread_count > MAX_THREADS) {
... ...
@@ -1095,7 +1095,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
1095 1095
 
1096 1096
     s->picture.reference = 0;
1097 1097
     s->picture.key_frame = 1;
1098
-    s->picture.pict_type = FF_I_TYPE;
1098
+    s->picture.pict_type = AV_PICTURE_TYPE_I;
1099 1099
     avctx->pix_fmt   = s->sys->pix_fmt;
1100 1100
     avctx->time_base = s->sys->time_base;
1101 1101
     avcodec_set_dimensions(avctx, s->sys->width, s->sys->height);
... ...
@@ -1264,7 +1264,7 @@ static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size,
1264 1264
     c->pix_fmt           = s->sys->pix_fmt;
1265 1265
     s->picture           = *((AVFrame *)data);
1266 1266
     s->picture.key_frame = 1;
1267
-    s->picture.pict_type = FF_I_TYPE;
1267
+    s->picture.pict_type = AV_PICTURE_TYPE_I;
1268 1268
 
1269 1269
     s->buf = buf;
1270 1270
     c->execute(c, dv_encode_video_segment, s->sys->work_chunks, NULL,
... ...
@@ -240,13 +240,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
240 240
     switch(compr){
241 241
     case -1:
242 242
         c->pic.key_frame = 0;
243
-        c->pic.pict_type = FF_P_TYPE;
243
+        c->pic.pict_type = AV_PICTURE_TYPE_P;
244 244
         if(c->prev.data[0])
245 245
             memcpy(c->pic.data[0], c->prev.data[0], c->pic.linesize[0] * avctx->height);
246 246
         else{ // Should happen only when first frame is 'NULL'
247 247
             memset(c->pic.data[0], 0, c->pic.linesize[0] * avctx->height);
248 248
             c->pic.key_frame = 1;
249
-            c->pic.pict_type = FF_I_TYPE;
249
+            c->pic.pict_type = AV_PICTURE_TYPE_I;
250 250
         }
251 251
         break;
252 252
     case 2:
... ...
@@ -254,7 +254,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
254 254
     case 4:
255 255
     case 5:
256 256
         c->pic.key_frame = !(compr & 1);
257
-        c->pic.pict_type = (compr & 1) ? FF_P_TYPE : FF_I_TYPE;
257
+        c->pic.pict_type = (compr & 1) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
258 258
         for(j = 0; j < avctx->height; j++){
259 259
             if(compr & 1){
260 260
                 for(i = 0; i < avctx->width; i++)
... ...
@@ -269,7 +269,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
269 269
     case 12: // ScummVM coding
270 270
     case 13:
271 271
         c->pic.key_frame = 0;
272
-        c->pic.pict_type = FF_P_TYPE;
272
+        c->pic.pict_type = AV_PICTURE_TYPE_P;
273 273
         decode_13(avctx, c, c->pic.data[0], srcptr, c->prev.data[0]);
274 274
         break;
275 275
     default:
... ...
@@ -246,7 +246,7 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
246 246
     slice->slice_qs_delta    = 0; /* XXX not implemented by Libav */
247 247
     slice->slice_qp_delta    = s->qscale - h->pps.init_qp;
248 248
     slice->redundant_pic_cnt = h->redundant_pic_count;
249
-    if (h->slice_type == FF_B_TYPE)
249
+    if (h->slice_type == AV_PICTURE_TYPE_B)
250 250
         slice->direct_spatial_mv_pred_flag = h->direct_spatial_mv_pred;
251 251
     slice->cabac_init_idc = h->pps.cabac ? h->cabac_init_idc : 0;
252 252
     if (h->deblocking_filter < 2)
... ...
@@ -403,7 +403,7 @@ static int decode_slice(AVCodecContext *avctx,
403 403
                         position, size);
404 404
     ctx_pic->slice_count++;
405 405
 
406
-    if (h->slice_type != FF_I_TYPE && h->slice_type != FF_SI_TYPE)
406
+    if (h->slice_type != AV_PICTURE_TYPE_I && h->slice_type != AV_PICTURE_TYPE_SI)
407 407
         ctx_pic->pp.wBitFields &= ~(1 << 15); /* Set IntraPicFlag to 0 */
408 408
     return 0;
409 409
 }
... ...
@@ -44,11 +44,11 @@ static void fill_picture_parameters(AVCodecContext *avctx,
44 44
     memset(pp, 0, sizeof(*pp));
45 45
     pp->wDecodedPictureIndex         = ff_dxva2_get_surface_index(ctx, current_picture);
46 46
     pp->wDeblockedPictureIndex       = 0;
47
-    if (s->pict_type != FF_I_TYPE)
47
+    if (s->pict_type != AV_PICTURE_TYPE_I)
48 48
         pp->wForwardRefPictureIndex  = ff_dxva2_get_surface_index(ctx, &s->last_picture);
49 49
     else
50 50
         pp->wForwardRefPictureIndex  = 0xffff;
51
-    if (s->pict_type == FF_B_TYPE)
51
+    if (s->pict_type == AV_PICTURE_TYPE_B)
52 52
         pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture);
53 53
     else
54 54
         pp->wBackwardRefPictureIndex = 0xffff;
... ...
@@ -61,8 +61,8 @@ static void fill_picture_parameters(AVCodecContext *avctx,
61 61
     pp->bBPPminus1                   = 7;
62 62
     pp->bPicStructure                = s->picture_structure;
63 63
     pp->bSecondField                 = is_field && !s->first_field;
64
-    pp->bPicIntra                    = s->pict_type == FF_I_TYPE;
65
-    pp->bPicBackwardPrediction       = s->pict_type == FF_B_TYPE;
64
+    pp->bPicIntra                    = s->pict_type == AV_PICTURE_TYPE_I;
65
+    pp->bPicBackwardPrediction       = s->pict_type == AV_PICTURE_TYPE_B;
66 66
     pp->bBidirectionalAveragingMode  = 0;
67 67
     pp->bMVprecisionAndChromaRelation= 0; /* FIXME */
68 68
     pp->bChromaFormat                = s->chroma_format;
... ...
@@ -42,11 +42,11 @@ static void fill_picture_parameters(AVCodecContext *avctx,
42 42
     memset(pp, 0, sizeof(*pp));
43 43
     pp->wDecodedPictureIndex    =
44 44
     pp->wDeblockedPictureIndex  = ff_dxva2_get_surface_index(ctx, current_picture);
45
-    if (s->pict_type != FF_I_TYPE)
45
+    if (s->pict_type != AV_PICTURE_TYPE_I)
46 46
         pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture);
47 47
     else
48 48
         pp->wForwardRefPictureIndex = 0xffff;
49
-    if (s->pict_type == FF_B_TYPE)
49
+    if (s->pict_type == AV_PICTURE_TYPE_B)
50 50
         pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture);
51 51
     else
52 52
         pp->wBackwardRefPictureIndex = 0xffff;
... ...
@@ -69,8 +69,8 @@ static void fill_picture_parameters(AVCodecContext *avctx,
69 69
     if (s->picture_structure & PICT_BOTTOM_FIELD)
70 70
         pp->bPicStructure      |= 0x02;
71 71
     pp->bSecondField            = v->interlace && v->fcm != 0x03 && !s->first_field;
72
-    pp->bPicIntra               = s->pict_type == FF_I_TYPE;
73
-    pp->bPicBackwardPrediction  = s->pict_type == FF_B_TYPE;
72
+    pp->bPicIntra               = s->pict_type == AV_PICTURE_TYPE_I;
73
+    pp->bPicBackwardPrediction  = s->pict_type == AV_PICTURE_TYPE_B;
74 74
     pp->bBidirectionalAveragingMode = (1                                           << 7) |
75 75
                                       ((ctx->cfg->ConfigIntraResidUnsigned != 0)   << 6) |
76 76
                                       ((ctx->cfg->ConfigResidDiffAccelerator != 0) << 5) |
... ...
@@ -108,10 +108,10 @@ static void fill_picture_parameters(AVCodecContext *avctx,
108 108
                                   (v->interlace                << 5) |
109 109
                                   (v->tfcntrflag               << 4) |
110 110
                                   (v->finterpflag              << 3) |
111
-                                  ((s->pict_type != FF_B_TYPE) << 2) |
111
+                                  ((s->pict_type != AV_PICTURE_TYPE_B) << 2) |
112 112
                                   (v->psf                      << 1) |
113 113
                                   (v->extended_dmv                 );
114
-    if (s->pict_type != FF_I_TYPE)
114
+    if (s->pict_type != AV_PICTURE_TYPE_I)
115 115
         pp->bPic4MVallowed      = v->mv_mode == MV_PMODE_MIXED_MV ||
116 116
                                   (v->mv_mode == MV_PMODE_INTENSITY_COMP &&
117 117
                                    v->mv_mode2 == MV_PMODE_MIXED_MV);
... ...
@@ -180,10 +180,10 @@ static int cmv_decode_frame(AVCodecContext *avctx,
180 180
     if ((buf[0]&1)) {  // subtype
181 181
         cmv_decode_inter(s, buf+2, buf_end);
182 182
         s->frame.key_frame = 0;
183
-        s->frame.pict_type = FF_P_TYPE;
183
+        s->frame.pict_type = AV_PICTURE_TYPE_P;
184 184
     }else{
185 185
         s->frame.key_frame = 1;
186
-        s->frame.pict_type = FF_I_TYPE;
186
+        s->frame.pict_type = AV_PICTURE_TYPE_I;
187 187
         cmv_decode_intra(s, buf+2, buf_end);
188 188
     }
189 189
 
... ...
@@ -218,7 +218,7 @@ static int tgq_decode_frame(AVCodecContext *avctx,
218 218
 
219 219
     if (!s->frame.data[0]) {
220 220
         s->frame.key_frame = 1;
221
-        s->frame.pict_type = FF_I_TYPE;
221
+        s->frame.pict_type = AV_PICTURE_TYPE_I;
222 222
         s->frame.buffer_hints = FF_BUFFER_HINTS_VALID;
223 223
         if (avctx->get_buffer(avctx, &s->frame)) {
224 224
             av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
... ...
@@ -300,7 +300,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
300 300
 
301 301
     if(chunk_type==kVGT_TAG) {
302 302
         s->frame.key_frame = 1;
303
-        s->frame.pict_type = FF_I_TYPE;
303
+        s->frame.pict_type = AV_PICTURE_TYPE_I;
304 304
         if (unpack(buf, buf_end, s->frame.data[0], s->avctx->width, s->avctx->height)<0) {
305 305
             av_log(avctx, AV_LOG_WARNING, "truncated intra frame\n");
306 306
             return -1;
... ...
@@ -311,7 +311,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
311 311
             return buf_size;
312 312
         }
313 313
         s->frame.key_frame = 0;
314
-        s->frame.pict_type = FF_P_TYPE;
314
+        s->frame.pict_type = AV_PICTURE_TYPE_P;
315 315
         if (tgv_decode_inter(s, buf, buf_end)<0) {
316 316
             av_log(avctx, AV_LOG_WARNING, "truncated inter frame\n");
317 317
             return -1;
... ...
@@ -639,7 +639,7 @@ static int is_intra_more_likely(MpegEncContext *s){
639 639
     if(undamaged_count < 5) return 0; //almost all MBs damaged -> use temporal prediction
640 640
 
641 641
     //prevent dsp.sad() check, that requires access to the image
642
-    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration && s->pict_type == FF_I_TYPE)
642
+    if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration && s->pict_type == AV_PICTURE_TYPE_I)
643 643
         return 1;
644 644
 
645 645
     skip_amount= FFMAX(undamaged_count/50, 1); //check only upto 50 MBs
... ...
@@ -658,7 +658,7 @@ static int is_intra_more_likely(MpegEncContext *s){
658 658
             j++;
659 659
             if((j%skip_amount) != 0) continue; //skip a few to speed things up
660 660
 
661
-            if(s->pict_type==FF_I_TYPE){
661
+            if(s->pict_type==AV_PICTURE_TYPE_I){
662 662
                 uint8_t *mb_ptr     = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
663 663
                 uint8_t *last_mb_ptr= s->last_picture.data   [0] + mb_x*16 + mb_y*16*s->linesize;
664 664
 
... ...
@@ -972,7 +972,7 @@ void ff_er_frame_end(MpegEncContext *s){
972 972
     }
973 973
 
974 974
     /* guess MVs */
975
-    if(s->pict_type==FF_B_TYPE){
975
+    if(s->pict_type==AV_PICTURE_TYPE_B){
976 976
         for(mb_y=0; mb_y<s->mb_height; mb_y++){
977 977
             for(mb_x=0; mb_x<s->mb_width; mb_x++){
978 978
                 int xy= mb_x*2 + mb_y*2*s->b8_stride;
... ...
@@ -1107,7 +1107,7 @@ ec_clean:
1107 1107
         const int mb_xy= s->mb_index2xy[i];
1108 1108
         int error= s->error_status_table[mb_xy];
1109 1109
 
1110
-        if(s->pict_type!=FF_B_TYPE && (error&(DC_ERROR|MV_ERROR|AC_ERROR))){
1110
+        if(s->pict_type!=AV_PICTURE_TYPE_B && (error&(DC_ERROR|MV_ERROR|AC_ERROR))){
1111 1111
             s->mbskip_table[mb_xy]=0;
1112 1112
         }
1113 1113
         s->mbintra_table[mb_xy]=1;
... ...
@@ -1160,7 +1160,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
1160 1160
     ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
1161 1161
 
1162 1162
     *p = *pict;
1163
-    p->pict_type= FF_I_TYPE;
1163
+    p->pict_type= AV_PICTURE_TYPE_I;
1164 1164
 
1165 1165
     if(avctx->gop_size==0 || f->picture_number % avctx->gop_size == 0){
1166 1166
         put_rac(c, &keystate, 1);
... ...
@@ -1723,7 +1723,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
1723 1723
     ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
1724 1724
 
1725 1725
 
1726
-    p->pict_type= FF_I_TYPE; //FIXME I vs. P
1726
+    p->pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P
1727 1727
     if(get_rac(c, &keystate)){
1728 1728
         p->key_frame= 1;
1729 1729
         if(read_header(f) < 0)
... ...
@@ -260,12 +260,12 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf,
260 260
 
261 261
     //mark the frame type so the muxer can mux it correctly
262 262
     if (I_frame) {
263
-        p->pict_type = FF_I_TYPE;
263
+        p->pict_type = AV_PICTURE_TYPE_I;
264 264
         p->key_frame = 1;
265 265
         s->last_key_frame = avctx->frame_number;
266 266
         av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %d\n", avctx->frame_number);
267 267
     } else {
268
-        p->pict_type = FF_P_TYPE;
268
+        p->pict_type = AV_PICTURE_TYPE_P;
269 269
         p->key_frame = 0;
270 270
     }
271 271
 
... ...
@@ -88,10 +88,10 @@ int ff_flv_decode_picture_header(MpegEncContext *s)
88 88
     s->width = width;
89 89
     s->height = height;
90 90
 
91
-    s->pict_type = FF_I_TYPE + get_bits(&s->gb, 2);
92
-    s->dropable= s->pict_type > FF_P_TYPE;
91
+    s->pict_type = AV_PICTURE_TYPE_I + get_bits(&s->gb, 2);
92
+    s->dropable= s->pict_type > AV_PICTURE_TYPE_P;
93 93
     if (s->dropable)
94
-        s->pict_type = FF_P_TYPE;
94
+        s->pict_type = AV_PICTURE_TYPE_P;
95 95
 
96 96
     skip_bits1(&s->gb); /* deblocking flag */
97 97
     s->chroma_qscale= s->qscale = get_bits(&s->gb, 5);
... ...
@@ -53,7 +53,7 @@ void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number)
53 53
         put_bits(&s->pb, 16, s->width);
54 54
         put_bits(&s->pb, 16, s->height);
55 55
       }
56
-      put_bits(&s->pb, 2, s->pict_type == FF_P_TYPE); /* PictureType */
56
+      put_bits(&s->pb, 2, s->pict_type == AV_PICTURE_TYPE_P); /* PictureType */
57 57
       put_bits(&s->pb, 1, 1); /* DeblockingFlag: on */
58 58
       put_bits(&s->pb, 5, s->qscale); /* Quantizer */
59 59
       put_bits(&s->pb, 1, 0); /* ExtraInformation */
... ...
@@ -180,10 +180,10 @@ static int decode_frame(AVCodecContext *avctx,
180 180
             return -1;
181 181
         }
182 182
         /* bit 31 means same as previous pic */
183
-        f->pict_type = (header & (1U<<31))? FF_P_TYPE : FF_I_TYPE;
184
-        f->key_frame = f->pict_type == FF_I_TYPE;
183
+        f->pict_type = (header & (1U<<31))? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
184
+        f->key_frame = f->pict_type == AV_PICTURE_TYPE_I;
185 185
 
186
-        if (f->pict_type == FF_I_TYPE) {
186
+        if (f->pict_type == AV_PICTURE_TYPE_I) {
187 187
             buf32=(const uint32_t*)buf;
188 188
             for(y=0; y<avctx->height/2; y++){
189 189
                 luma1=(uint32_t*)&f->data[0][ y*2*f->linesize[0] ];
... ...
@@ -223,10 +223,10 @@ static int decode_frame(AVCodecContext *avctx,
223 223
             return -1;
224 224
         }
225 225
         /* bit 31 means same as previous pic */
226
-        f->pict_type = (header & (1U<<31))? FF_P_TYPE : FF_I_TYPE;
227
-        f->key_frame = f->pict_type == FF_I_TYPE;
226
+        f->pict_type = (header & (1U<<31))? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
227
+        f->key_frame = f->pict_type == AV_PICTURE_TYPE_I;
228 228
 
229
-        if (f->pict_type == FF_I_TYPE) {
229
+        if (f->pict_type == AV_PICTURE_TYPE_I) {
230 230
             for(y=0; y<avctx->height; y++)
231 231
                 memcpy(&f->data[0][ (avctx->height-y)*f->linesize[0] ],
232 232
                        &buf[y*avctx->width*3],
... ...
@@ -252,11 +252,11 @@ static int decode_frame(AVCodecContext *avctx,
252 252
         }
253 253
         /* skip frame */
254 254
         if(buf_size == 8) {
255
-            f->pict_type = FF_P_TYPE;
255
+            f->pict_type = AV_PICTURE_TYPE_P;
256 256
             f->key_frame = 0;
257 257
             break;
258 258
         }
259
-        f->pict_type = FF_I_TYPE;
259
+        f->pict_type = AV_PICTURE_TYPE_I;
260 260
         f->key_frame = 1;
261 261
         if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) {
262 262
             av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n");
... ...
@@ -295,11 +295,11 @@ static int decode_frame(AVCodecContext *avctx,
295 295
         }
296 296
         /* skip frame */
297 297
         if(buf_size == 8) {
298
-            f->pict_type = FF_P_TYPE;
298
+            f->pict_type = AV_PICTURE_TYPE_P;
299 299
             f->key_frame = 0;
300 300
             break;
301 301
         }
302
-        f->pict_type = FF_I_TYPE;
302
+        f->pict_type = AV_PICTURE_TYPE_I;
303 303
         f->key_frame = 1;
304 304
         if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) {
305 305
             av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n");
... ...
@@ -61,7 +61,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
61 61
     if (avctx->get_buffer(avctx, pic) < 0)
62 62
         return -1;
63 63
 
64
-    pic->pict_type = FF_I_TYPE;
64
+    pic->pict_type = AV_PICTURE_TYPE_I;
65 65
     pic->key_frame = 1;
66 66
     pic->interlaced_frame = 1;
67 67
     pic->top_field_first = 1;
... ...
@@ -150,7 +150,7 @@ static int gif_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu
150 150
     uint8_t *end = outbuf + buf_size;
151 151
 
152 152
     *p = *pict;
153
-    p->pict_type = FF_I_TYPE;
153
+    p->pict_type = AV_PICTURE_TYPE_I;
154 154
     p->key_frame = 1;
155 155
     gif_image_write_header(avctx, &outbuf_ptr, (uint32_t *)pict->data[1]);
156 156
     gif_image_write_image(avctx, &outbuf_ptr, end, pict->data[0], pict->linesize[0]);
... ...
@@ -497,9 +497,9 @@ static int h261_decode_picture_header(H261Context *h){
497 497
         skip_bits(&s->gb, 8);
498 498
     }
499 499
 
500
-    // h261 has no I-FRAMES, but if we pass FF_I_TYPE for the first frame, the codec crashes if it does
500
+    // h261 has no I-FRAMES, but if we pass AV_PICTURE_TYPE_I for the first frame, the codec crashes if it does
501 501
     // not contain all I-blocks (e.g. when a packet is lost)
502
-    s->pict_type = FF_P_TYPE;
502
+    s->pict_type = AV_PICTURE_TYPE_P;
503 503
 
504 504
     h->gob_number = 0;
505 505
     return 0;
... ...
@@ -597,10 +597,10 @@ retry:
597 597
 
598 598
     // for skipping the frame
599 599
     s->current_picture.pict_type= s->pict_type;
600
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
600
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
601 601
 
602
-    if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
603
-       ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
602
+    if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
603
+       ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
604 604
        || avctx->skip_frame >= AVDISCARD_ALL)
605 605
         return get_consumed_bytes(s, buf_size);
606 606
 
... ...
@@ -148,7 +148,7 @@ void ff_h263_loop_filter(MpegEncContext * s){
148 148
     uint8_t *dest_cb= s->dest[1];
149 149
     uint8_t *dest_cr= s->dest[2];
150 150
 
151
-//    if(s->pict_type==FF_B_TYPE && !s->readable) return;
151
+//    if(s->pict_type==AV_PICTURE_TYPE_B && !s->readable) return;
152 152
 
153 153
     /*
154 154
        Diag Top
... ...
@@ -217,7 +217,7 @@ static int decode_slice(MpegEncContext *s){
217 217
 //printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
218 218
             ret= s->decode_mb(s, s->block);
219 219
 
220
-            if (s->pict_type!=FF_B_TYPE)
220
+            if (s->pict_type!=AV_PICTURE_TYPE_B)
221 221
                 ff_h263_update_motion_val(s);
222 222
 
223 223
             if(ret<0){
... ...
@@ -307,7 +307,7 @@ static int decode_slice(MpegEncContext *s){
307 307
         int max_extra=7;
308 308
 
309 309
         /* no markers in M$ crap */
310
-        if(s->msmpeg4_version && s->pict_type==FF_I_TYPE)
310
+        if(s->msmpeg4_version && s->pict_type==AV_PICTURE_TYPE_I)
311 311
             max_extra+= 17;
312 312
 
313 313
         /* buggy padding but the frame should still end approximately at the bitstream end */
... ...
@@ -585,26 +585,26 @@ retry:
585 585
 
586 586
     // for skipping the frame
587 587
     s->current_picture.pict_type= s->pict_type;
588
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
588
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
589 589
 
590 590
     /* skip B-frames if we don't have reference frames */
591
-    if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size);
592
-    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
593
-       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
591
+    if(s->last_picture_ptr==NULL && (s->pict_type==AV_PICTURE_TYPE_B || s->dropable)) return get_consumed_bytes(s, buf_size);
592
+    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
593
+       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
594 594
        ||  avctx->skip_frame >= AVDISCARD_ALL)
595 595
         return get_consumed_bytes(s, buf_size);
596 596
 
597 597
     if(s->next_p_frame_damaged){
598
-        if(s->pict_type==FF_B_TYPE)
598
+        if(s->pict_type==AV_PICTURE_TYPE_B)
599 599
             return get_consumed_bytes(s, buf_size);
600 600
         else
601 601
             s->next_p_frame_damaged=0;
602 602
     }
603 603
 
604
-    if((s->avctx->flags2 & CODEC_FLAG2_FAST) && s->pict_type==FF_B_TYPE){
604
+    if((s->avctx->flags2 & CODEC_FLAG2_FAST) && s->pict_type==AV_PICTURE_TYPE_B){
605 605
         s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
606 606
         s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
607
-    }else if((!s->no_rounding) || s->pict_type==FF_B_TYPE){
607
+    }else if((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){
608 608
         s->me.qpel_put= s->dsp.put_qpel_pixels_tab;
609 609
         s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
610 610
     }else{
... ...
@@ -655,7 +655,7 @@ retry:
655 655
         decode_slice(s);
656 656
     }
657 657
 
658
-    if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==FF_I_TYPE)
658
+    if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==AV_PICTURE_TYPE_I)
659 659
         if(!CONFIG_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){
660 660
             s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR;
661 661
         }
... ...
@@ -705,7 +705,7 @@ intrax8_decoded:
705 705
 
706 706
 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
707 707
 assert(s->current_picture.pict_type == s->pict_type);
708
-    if (s->pict_type == FF_B_TYPE || s->low_delay) {
708
+    if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
709 709
         *pict= *(AVFrame*)s->current_picture_ptr;
710 710
     } else if (s->last_picture_ptr != NULL) {
711 711
         *pict= *(AVFrame*)s->last_picture_ptr;
... ...
@@ -1389,7 +1389,7 @@ static int pred_weight_table(H264Context *h){
1389 1389
                 }
1390 1390
             }
1391 1391
         }
1392
-        if(h->slice_type_nos != FF_B_TYPE) break;
1392
+        if(h->slice_type_nos != AV_PICTURE_TYPE_B) break;
1393 1393
     }
1394 1394
     h->use_weight= h->use_weight || h->use_weight_chroma;
1395 1395
     return 0;
... ...
@@ -1753,7 +1753,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
1753 1753
         h->slice_type_fixed=0;
1754 1754
 
1755 1755
     slice_type= golomb_to_pict_type[ slice_type ];
1756
-    if (slice_type == FF_I_TYPE
1756
+    if (slice_type == AV_PICTURE_TYPE_I
1757 1757
         || (h0->current_slice != 0 && slice_type == h0->last_slice_type) ) {
1758 1758
         default_ref_list_done = 1;
1759 1759
     }
... ...
@@ -2010,15 +2010,15 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2010 2010
     h->ref_count[0]= h->pps.ref_count[0];
2011 2011
     h->ref_count[1]= h->pps.ref_count[1];
2012 2012
 
2013
-    if(h->slice_type_nos != FF_I_TYPE){
2014
-        if(h->slice_type_nos == FF_B_TYPE){
2013
+    if(h->slice_type_nos != AV_PICTURE_TYPE_I){
2014
+        if(h->slice_type_nos == AV_PICTURE_TYPE_B){
2015 2015
             h->direct_spatial_mv_pred= get_bits1(&s->gb);
2016 2016
         }
2017 2017
         num_ref_idx_active_override_flag= get_bits1(&s->gb);
2018 2018
 
2019 2019
         if(num_ref_idx_active_override_flag){
2020 2020
             h->ref_count[0]= get_ue_golomb(&s->gb) + 1;
2021
-            if(h->slice_type_nos==FF_B_TYPE)
2021
+            if(h->slice_type_nos==AV_PICTURE_TYPE_B)
2022 2022
                 h->ref_count[1]= get_ue_golomb(&s->gb) + 1;
2023 2023
 
2024 2024
             if(h->ref_count[0]-1 > 32-1 || h->ref_count[1]-1 > 32-1){
... ...
@@ -2027,7 +2027,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2027 2027
                 return -1;
2028 2028
             }
2029 2029
         }
2030
-        if(h->slice_type_nos == FF_B_TYPE)
2030
+        if(h->slice_type_nos == AV_PICTURE_TYPE_B)
2031 2031
             h->list_count= 2;
2032 2032
         else
2033 2033
             h->list_count= 1;
... ...
@@ -2038,22 +2038,22 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2038 2038
         ff_h264_fill_default_ref_list(h);
2039 2039
     }
2040 2040
 
2041
-    if(h->slice_type_nos!=FF_I_TYPE && ff_h264_decode_ref_pic_list_reordering(h) < 0)
2041
+    if(h->slice_type_nos!=AV_PICTURE_TYPE_I && ff_h264_decode_ref_pic_list_reordering(h) < 0)
2042 2042
         return -1;
2043 2043
 
2044
-    if(h->slice_type_nos!=FF_I_TYPE){
2044
+    if(h->slice_type_nos!=AV_PICTURE_TYPE_I){
2045 2045
         s->last_picture_ptr= &h->ref_list[0][0];
2046 2046
         ff_copy_picture(&s->last_picture, s->last_picture_ptr);
2047 2047
     }
2048
-    if(h->slice_type_nos==FF_B_TYPE){
2048
+    if(h->slice_type_nos==AV_PICTURE_TYPE_B){
2049 2049
         s->next_picture_ptr= &h->ref_list[1][0];
2050 2050
         ff_copy_picture(&s->next_picture, s->next_picture_ptr);
2051 2051
     }
2052 2052
 
2053
-    if(   (h->pps.weighted_pred          && h->slice_type_nos == FF_P_TYPE )
2054
-       ||  (h->pps.weighted_bipred_idc==1 && h->slice_type_nos== FF_B_TYPE ) )
2053
+    if(   (h->pps.weighted_pred          && h->slice_type_nos == AV_PICTURE_TYPE_P )
2054
+       ||  (h->pps.weighted_bipred_idc==1 && h->slice_type_nos== AV_PICTURE_TYPE_B ) )
2055 2055
         pred_weight_table(h);
2056
-    else if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== FF_B_TYPE){
2056
+    else if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== AV_PICTURE_TYPE_B){
2057 2057
         implicit_weight_table(h, -1);
2058 2058
     }else {
2059 2059
         h->use_weight = 0;
... ...
@@ -2069,17 +2069,17 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2069 2069
     if(FRAME_MBAFF){
2070 2070
         ff_h264_fill_mbaff_ref_list(h);
2071 2071
 
2072
-        if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== FF_B_TYPE){
2072
+        if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== AV_PICTURE_TYPE_B){
2073 2073
             implicit_weight_table(h, 0);
2074 2074
             implicit_weight_table(h, 1);
2075 2075
         }
2076 2076
     }
2077 2077
 
2078
-    if(h->slice_type_nos==FF_B_TYPE && !h->direct_spatial_mv_pred)
2078
+    if(h->slice_type_nos==AV_PICTURE_TYPE_B && !h->direct_spatial_mv_pred)
2079 2079
         ff_h264_direct_dist_scale_factor(h);
2080 2080
     ff_h264_direct_ref_list_init(h);
2081 2081
 
2082
-    if( h->slice_type_nos != FF_I_TYPE && h->pps.cabac ){
2082
+    if( h->slice_type_nos != AV_PICTURE_TYPE_I && h->pps.cabac ){
2083 2083
         tmp = get_ue_golomb_31(&s->gb);
2084 2084
         if(tmp > 2){
2085 2085
             av_log(s->avctx, AV_LOG_ERROR, "cabac_init_idc overflow\n");
... ...
@@ -2098,10 +2098,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2098 2098
     h->chroma_qp[0] = get_chroma_qp(h, 0, s->qscale);
2099 2099
     h->chroma_qp[1] = get_chroma_qp(h, 1, s->qscale);
2100 2100
     //FIXME qscale / qp ... stuff
2101
-    if(h->slice_type == FF_SP_TYPE){
2101
+    if(h->slice_type == AV_PICTURE_TYPE_SP){
2102 2102
         get_bits1(&s->gb); /* sp_for_switch_flag */
2103 2103
     }
2104
-    if(h->slice_type==FF_SP_TYPE || h->slice_type == FF_SI_TYPE){
2104
+    if(h->slice_type==AV_PICTURE_TYPE_SP || h->slice_type == AV_PICTURE_TYPE_SI){
2105 2105
         get_se_golomb(&s->gb); /* slice_qs_delta */
2106 2106
     }
2107 2107
 
... ...
@@ -2130,8 +2130,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2130 2130
     }
2131 2131
 
2132 2132
     if(   s->avctx->skip_loop_filter >= AVDISCARD_ALL
2133
-       ||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type_nos != FF_I_TYPE)
2134
-       ||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR  && h->slice_type_nos == FF_B_TYPE)
2133
+       ||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type_nos != AV_PICTURE_TYPE_I)
2134
+       ||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR  && h->slice_type_nos == AV_PICTURE_TYPE_B)
2135 2135
        ||(s->avctx->skip_loop_filter >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
2136 2136
         h->deblocking_filter= 0;
2137 2137
 
... ...
@@ -2212,7 +2212,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2212 2212
                h->deblocking_filter, h->slice_alpha_c0_offset/2-26, h->slice_beta_offset/2-26,
2213 2213
                h->use_weight,
2214 2214
                h->use_weight==1 && h->use_weight_chroma ? "c" : "",
2215
-               h->slice_type == FF_B_TYPE ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : ""
2215
+               h->slice_type == AV_PICTURE_TYPE_B ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : ""
2216 2216
                );
2217 2217
     }
2218 2218
 
... ...
@@ -2222,11 +2222,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2222 2222
 int ff_h264_get_slice_type(const H264Context *h)
2223 2223
 {
2224 2224
     switch (h->slice_type) {
2225
-    case FF_P_TYPE:  return 0;
2226
-    case FF_B_TYPE:  return 1;
2227
-    case FF_I_TYPE:  return 2;
2228
-    case FF_SP_TYPE: return 3;
2229
-    case FF_SI_TYPE: return 4;
2225
+    case AV_PICTURE_TYPE_P:  return 0;
2226
+    case AV_PICTURE_TYPE_B:  return 1;
2227
+    case AV_PICTURE_TYPE_I:  return 2;
2228
+    case AV_PICTURE_TYPE_SP: return 3;
2229
+    case AV_PICTURE_TYPE_SI: return 4;
2230 2230
     default:         return -1;
2231 2231
     }
2232 2232
 }
... ...
@@ -2844,8 +2844,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
2844 2844
                     (h->sei_recovery_frame_cnt >= 0);
2845 2845
             if(hx->redundant_pic_count==0
2846 2846
                && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
2847
-               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=FF_B_TYPE)
2848
-               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE)
2847
+               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=AV_PICTURE_TYPE_B)
2848
+               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==AV_PICTURE_TYPE_I)
2849 2849
                && avctx->skip_frame < AVDISCARD_ALL){
2850 2850
                 if(avctx->hwaccel) {
2851 2851
                     if (avctx->hwaccel->decode_slice(avctx, &buf[buf_index - consumed], consumed) < 0)
... ...
@@ -2881,8 +2881,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
2881 2881
             if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning
2882 2882
                && s->context_initialized
2883 2883
                && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
2884
-               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=FF_B_TYPE)
2885
-               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE)
2884
+               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=AV_PICTURE_TYPE_B)
2885
+               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==AV_PICTURE_TYPE_I)
2886 2886
                && avctx->skip_frame < AVDISCARD_ALL)
2887 2887
                 context_count++;
2888 2888
             break;
... ...
@@ -3122,7 +3122,7 @@ static int decode_frame(AVCodecContext *avctx,
3122 3122
             else if((out_of_order && pics-1 == s->avctx->has_b_frames && s->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT)
3123 3123
                || (s->low_delay &&
3124 3124
                 ((h->outputed_poc != INT_MIN && out->poc > h->outputed_poc + 2)
3125
-                 || cur->pict_type == FF_B_TYPE)))
3125
+                 || cur->pict_type == AV_PICTURE_TYPE_B)))
3126 3126
             {
3127 3127
                 s->low_delay = 0;
3128 3128
                 s->avctx->has_b_frames++;
... ...
@@ -1108,7 +1108,7 @@ static void fill_decode_caches(H264Context *h, int mb_type){
1108 1108
                 }
1109 1109
                 AV_ZERO16(h->mvd_cache [list][scan8[4 ]]);
1110 1110
                 AV_ZERO16(h->mvd_cache [list][scan8[12]]);
1111
-                if(h->slice_type_nos == FF_B_TYPE){
1111
+                if(h->slice_type_nos == AV_PICTURE_TYPE_B){
1112 1112
                     fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1);
1113 1113
 
1114 1114
                     if(IS_DIRECT(top_type)){
... ...
@@ -1245,7 +1245,7 @@ static inline void write_back_motion(H264Context *h, int mb_type){
1245 1245
         }
1246 1246
     }
1247 1247
 
1248
-    if(h->slice_type_nos == FF_B_TYPE && CABAC){
1248
+    if(h->slice_type_nos == AV_PICTURE_TYPE_B && CABAC){
1249 1249
         if(IS_8X8(mb_type)){
1250 1250
             uint8_t *direct_table = &h->direct_table[4*h->mb_xy];
1251 1251
             direct_table[1] = h->sub_mb_type[1]>>1;
... ...
@@ -1276,7 +1276,7 @@ static void av_unused decode_mb_skip(H264Context *h){
1276 1276
     if(MB_FIELD)
1277 1277
         mb_type|= MB_TYPE_INTERLACED;
1278 1278
 
1279
-    if( h->slice_type_nos == FF_B_TYPE )
1279
+    if( h->slice_type_nos == AV_PICTURE_TYPE_B )
1280 1280
     {
1281 1281
         // just for fill_caches. pred_direct_motion will set the real mb_type
1282 1282
         mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
... ...
@@ -690,7 +690,7 @@ void ff_h264_init_cabac_states(H264Context *h) {
690 690
     int i;
691 691
     const int8_t (*tab)[2];
692 692
 
693
-    if( h->slice_type_nos == FF_I_TYPE ) tab = cabac_context_init_I;
693
+    if( h->slice_type_nos == AV_PICTURE_TYPE_I ) tab = cabac_context_init_I;
694 694
     else                                 tab = cabac_context_init_PB[h->cabac_init_idc];
695 695
 
696 696
     /* calculate pre-state */
... ...
@@ -778,7 +778,7 @@ static int decode_cabac_mb_skip( H264Context *h, int mb_x, int mb_y ) {
778 778
     if( h->slice_table[mbb_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mbb_xy] ))
779 779
         ctx++;
780 780
 
781
-    if( h->slice_type_nos == FF_B_TYPE )
781
+    if( h->slice_type_nos == AV_PICTURE_TYPE_B )
782 782
         ctx += 13;
783 783
     return get_cabac_noinline( &h->cabac, &h->cabac_state[11+ctx] );
784 784
 }
... ...
@@ -887,7 +887,7 @@ static int decode_cabac_mb_ref( H264Context *h, int list, int n ) {
887 887
     int ref  = 0;
888 888
     int ctx  = 0;
889 889
 
890
-    if( h->slice_type_nos == FF_B_TYPE) {
890
+    if( h->slice_type_nos == AV_PICTURE_TYPE_B) {
891 891
         if( refa > 0 && !(h->direct_cache[scan8[n] - 1]&(MB_TYPE_DIRECT2>>1)) )
892 892
             ctx++;
893 893
         if( refb > 0 && !(h->direct_cache[scan8[n] - 8]&(MB_TYPE_DIRECT2>>1)) )
... ...
@@ -1200,7 +1200,7 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
1200 1200
     mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride;
1201 1201
 
1202 1202
     tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y);
1203
-    if( h->slice_type_nos != FF_I_TYPE ) {
1203
+    if( h->slice_type_nos != AV_PICTURE_TYPE_I ) {
1204 1204
         int skip;
1205 1205
         /* a skipped mb needs the aff flag from the following mb */
1206 1206
         if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped )
... ...
@@ -1236,9 +1236,9 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
1236 1236
 
1237 1237
     fill_decode_neighbors(h, -(MB_FIELD));
1238 1238
 
1239
-    if( h->slice_type_nos == FF_B_TYPE ) {
1239
+    if( h->slice_type_nos == AV_PICTURE_TYPE_B ) {
1240 1240
         int ctx = 0;
1241
-        assert(h->slice_type_nos == FF_B_TYPE);
1241
+        assert(h->slice_type_nos == AV_PICTURE_TYPE_B);
1242 1242
 
1243 1243
         if( !IS_DIRECT( h->left_type[0]-1 ) )
1244 1244
             ctx++;
... ...
@@ -1271,7 +1271,7 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
1271 1271
         }
1272 1272
             partition_count= b_mb_type_info[mb_type].partition_count;
1273 1273
             mb_type=         b_mb_type_info[mb_type].type;
1274
-    } else if( h->slice_type_nos == FF_P_TYPE ) {
1274
+    } else if( h->slice_type_nos == AV_PICTURE_TYPE_P ) {
1275 1275
         if( get_cabac_noinline( &h->cabac, &h->cabac_state[14] ) == 0 ) {
1276 1276
             /* P-type */
1277 1277
             if( get_cabac_noinline( &h->cabac, &h->cabac_state[15] ) == 0 ) {
... ...
@@ -1289,9 +1289,9 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
1289 1289
         }
1290 1290
     } else {
1291 1291
         mb_type= decode_cabac_intra_mb_type(h, 3, 1);
1292
-        if(h->slice_type == FF_SI_TYPE && mb_type)
1292
+        if(h->slice_type == AV_PICTURE_TYPE_SI && mb_type)
1293 1293
             mb_type--;
1294
-        assert(h->slice_type_nos == FF_I_TYPE);
1294
+        assert(h->slice_type_nos == AV_PICTURE_TYPE_I);
1295 1295
 decode_intra_mb:
1296 1296
         partition_count = 0;
1297 1297
         cbp= i_mb_type_info[mb_type].cbp;
... ...
@@ -1379,7 +1379,7 @@ decode_intra_mb:
1379 1379
     } else if( partition_count == 4 ) {
1380 1380
         int i, j, sub_partition_count[4], list, ref[2][4];
1381 1381
 
1382
-        if( h->slice_type_nos == FF_B_TYPE ) {
1382
+        if( h->slice_type_nos == AV_PICTURE_TYPE_B ) {
1383 1383
             for( i = 0; i < 4; i++ ) {
1384 1384
                 h->sub_mb_type[i] = decode_cabac_b_mb_sub_type( h );
1385 1385
                 sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
... ...
@@ -541,7 +541,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
541 541
     tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y);
542 542
     cbp = 0; /* avoid warning. FIXME: find a solution without slowing
543 543
                 down the code */
544
-    if(h->slice_type_nos != FF_I_TYPE){
544
+    if(h->slice_type_nos != AV_PICTURE_TYPE_I){
545 545
         if(s->mb_skip_run==-1)
546 546
             s->mb_skip_run= get_ue_golomb(&s->gb);
547 547
 
... ...
@@ -562,7 +562,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
562 562
     h->prev_mb_skipped= 0;
563 563
 
564 564
     mb_type= get_ue_golomb(&s->gb);
565
-    if(h->slice_type_nos == FF_B_TYPE){
565
+    if(h->slice_type_nos == AV_PICTURE_TYPE_B){
566 566
         if(mb_type < 23){
567 567
             partition_count= b_mb_type_info[mb_type].partition_count;
568 568
             mb_type=         b_mb_type_info[mb_type].type;
... ...
@@ -570,7 +570,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
570 570
             mb_type -= 23;
571 571
             goto decode_intra_mb;
572 572
         }
573
-    }else if(h->slice_type_nos == FF_P_TYPE){
573
+    }else if(h->slice_type_nos == AV_PICTURE_TYPE_P){
574 574
         if(mb_type < 5){
575 575
             partition_count= p_mb_type_info[mb_type].partition_count;
576 576
             mb_type=         p_mb_type_info[mb_type].type;
... ...
@@ -579,8 +579,8 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
579 579
             goto decode_intra_mb;
580 580
         }
581 581
     }else{
582
-       assert(h->slice_type_nos == FF_I_TYPE);
583
-        if(h->slice_type == FF_SI_TYPE && mb_type)
582
+       assert(h->slice_type_nos == AV_PICTURE_TYPE_I);
583
+        if(h->slice_type == AV_PICTURE_TYPE_SI && mb_type)
584 584
             mb_type--;
585 585
 decode_intra_mb:
586 586
         if(mb_type > 25){
... ...
@@ -671,7 +671,7 @@ decode_intra_mb:
671 671
     }else if(partition_count==4){
672 672
         int i, j, sub_partition_count[4], list, ref[2][4];
673 673
 
674
-        if(h->slice_type_nos == FF_B_TYPE){
674
+        if(h->slice_type_nos == AV_PICTURE_TYPE_B){
675 675
             for(i=0; i<4; i++){
676 676
                 h->sub_mb_type[i]= get_ue_golomb_31(&s->gb);
677 677
                 if(h->sub_mb_type[i] >=13){
... ...
@@ -689,7 +689,7 @@ decode_intra_mb:
689 689
                 h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
690 690
             }
691 691
         }else{
692
-            assert(h->slice_type_nos == FF_P_TYPE); //FIXME SP correct ?
692
+            assert(h->slice_type_nos == AV_PICTURE_TYPE_P); //FIXME SP correct ?
693 693
             for(i=0; i<4; i++){
694 694
                 h->sub_mb_type[i]= get_ue_golomb_31(&s->gb);
695 695
                 if(h->sub_mb_type[i] >=4){
... ...
@@ -129,7 +129,7 @@ void ff_h264_direct_ref_list_init(H264Context * const h){
129 129
         h->col_fieldoff= s->mb_stride*(2*(h->ref_list[1][0].reference) - 3);
130 130
     }
131 131
 
132
-    if(cur->pict_type != FF_B_TYPE || h->direct_spatial_mv_pred)
132
+    if(cur->pict_type != AV_PICTURE_TYPE_B || h->direct_spatial_mv_pred)
133 133
         return;
134 134
 
135 135
     for(list=0; list<2; list++){
... ...
@@ -117,7 +117,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
117 117
     const uint8_t *ptr;
118 118
 
119 119
     /* set some sane default values */
120
-    s->pict_type = FF_I_TYPE;
120
+    s->pict_type = AV_PICTURE_TYPE_I;
121 121
     s->key_frame = 0;
122 122
 
123 123
     h->s.avctx= avctx;
... ...
@@ -109,7 +109,7 @@ int ff_h264_fill_default_ref_list(H264Context *h){
109 109
     MpegEncContext * const s = &h->s;
110 110
     int i, len;
111 111
 
112
-    if(h->slice_type_nos==FF_B_TYPE){
112
+    if(h->slice_type_nos==AV_PICTURE_TYPE_B){
113 113
         Picture *sorted[32];
114 114
         int cur_poc, list;
115 115
         int lens[2];
... ...
@@ -148,7 +148,7 @@ int ff_h264_fill_default_ref_list(H264Context *h){
148 148
     for (i=0; i<h->ref_count[0]; i++) {
149 149
         tprintf(h->s.avctx, "List0: %s fn:%d 0x%p\n", (h->default_ref_list[0][i].long_ref ? "LT" : "ST"), h->default_ref_list[0][i].pic_id, h->default_ref_list[0][i].data[0]);
150 150
     }
151
-    if(h->slice_type_nos==FF_B_TYPE){
151
+    if(h->slice_type_nos==AV_PICTURE_TYPE_B){
152 152
         for (i=0; i<h->ref_count[1]; i++) {
153 153
             tprintf(h->s.avctx, "List1: %s fn:%d 0x%p\n", (h->default_ref_list[1][i].long_ref ? "LT" : "ST"), h->default_ref_list[1][i].pic_id, h->default_ref_list[1][i].data[0]);
154 154
         }
... ...
@@ -36,7 +36,7 @@
36 36
 
37 37
 
38 38
 static const uint8_t golomb_to_pict_type[5]=
39
-{FF_P_TYPE, FF_B_TYPE, FF_I_TYPE, FF_SP_TYPE, FF_SI_TYPE};
39
+{AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_SP, AV_PICTURE_TYPE_SI};
40 40
 
41 41
 static const uint8_t golomb_to_intra4x4_cbp[48]={
42 42
  47, 31, 15,  0, 23, 27, 29, 30,  7, 11, 13, 14, 39, 43, 45, 46,
... ...
@@ -1238,7 +1238,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
1238 1238
     int i, j, size=0;
1239 1239
 
1240 1240
     *p = *pict;
1241
-    p->pict_type= FF_I_TYPE;
1241
+    p->pict_type= AV_PICTURE_TYPE_I;
1242 1242
     p->key_frame= 1;
1243 1243
 
1244 1244
     if(s->context){
... ...
@@ -52,7 +52,7 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
52 52
     }
53 53
     s->h263_plus = 0;
54 54
 
55
-    s->pict_type = FF_I_TYPE + get_bits1(&s->gb);
55
+    s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb);
56 56
 
57 57
     s->unrestricted_mv = get_bits1(&s->gb);
58 58
     s->h263_long_vectors = s->unrestricted_mv;
... ...
@@ -347,7 +347,7 @@ static void preview_obmc(MpegEncContext *s){
347 347
         s->block_index[i]+= 1;
348 348
     s->mb_x++;
349 349
 
350
-    assert(s->pict_type == FF_P_TYPE);
350
+    assert(s->pict_type == AV_PICTURE_TYPE_P);
351 351
 
352 352
     do{
353 353
         if (get_bits1(&s->gb)) {
... ...
@@ -460,7 +460,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
460 460
         /* DC coef */
461 461
         if(s->codec_id == CODEC_ID_RV10){
462 462
 #if CONFIG_RV10_DECODER
463
-          if (s->rv10_version == 3 && s->pict_type == FF_I_TYPE) {
463
+          if (s->rv10_version == 3 && s->pict_type == AV_PICTURE_TYPE_I) {
464 464
             int component, diff;
465 465
             component = (n <= 3 ? 0 : n - 4 + 1);
466 466
             level = s->last_dc[component];
... ...
@@ -608,7 +608,7 @@ int ff_h263_decode_mb(MpegEncContext *s,
608 608
 
609 609
     assert(!s->h263_pred);
610 610
 
611
-    if (s->pict_type == FF_P_TYPE) {
611
+    if (s->pict_type == AV_PICTURE_TYPE_P) {
612 612
         do{
613 613
             if (get_bits1(&s->gb)) {
614 614
                 /* skip mb */
... ...
@@ -700,7 +700,7 @@ int ff_h263_decode_mb(MpegEncContext *s,
700 700
                 mot_val[1] = my;
701 701
             }
702 702
         }
703
-    } else if(s->pict_type==FF_B_TYPE) {
703
+    } else if(s->pict_type==AV_PICTURE_TYPE_B) {
704 704
         int mb_type;
705 705
         const int stride= s->b8_stride;
706 706
         int16_t *mot_val0 = s->current_picture.motion_val[0][ 2*(s->mb_x + s->mb_y*stride) ];
... ...
@@ -843,7 +843,7 @@ intra:
843 843
     if(s->pb_frame && h263_skip_b_part(s, cbpb) < 0)
844 844
         return -1;
845 845
     if(s->obmc && !s->mb_intra){
846
-        if(s->pict_type == FF_P_TYPE && s->mb_x+1<s->mb_width && s->mb_num_left != 1)
846
+        if(s->pict_type == AV_PICTURE_TYPE_P && s->mb_x+1<s->mb_width && s->mb_num_left != 1)
847 847
             preview_obmc(s);
848 848
     }
849 849
 end:
... ...
@@ -921,7 +921,7 @@ int h263_decode_picture_header(MpegEncContext *s)
921 921
         if (!width)
922 922
             return -1;
923 923
 
924
-        s->pict_type = FF_I_TYPE + get_bits1(&s->gb);
924
+        s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb);
925 925
 
926 926
         s->h263_long_vectors = get_bits1(&s->gb);
927 927
 
... ...
@@ -985,11 +985,11 @@ int h263_decode_picture_header(MpegEncContext *s)
985 985
         /* MPPTYPE */
986 986
         s->pict_type = get_bits(&s->gb, 3);
987 987
         switch(s->pict_type){
988
-        case 0: s->pict_type= FF_I_TYPE;break;
989
-        case 1: s->pict_type= FF_P_TYPE;break;
990
-        case 2: s->pict_type= FF_P_TYPE;s->pb_frame = 3;break;
991
-        case 3: s->pict_type= FF_B_TYPE;break;
992
-        case 7: s->pict_type= FF_I_TYPE;break; //ZYGO
988
+        case 0: s->pict_type= AV_PICTURE_TYPE_I;break;
989
+        case 1: s->pict_type= AV_PICTURE_TYPE_P;break;
990
+        case 2: s->pict_type= AV_PICTURE_TYPE_P;s->pb_frame = 3;break;
991
+        case 3: s->pict_type= AV_PICTURE_TYPE_B;break;
992
+        case 7: s->pict_type= AV_PICTURE_TYPE_I;break; //ZYGO
993 993
         default:
994 994
             return -1;
995 995
         }
... ...
@@ -1112,7 +1112,7 @@ int h263_decode_picture_header(MpegEncContext *s)
1112 1112
     }
1113 1113
 
1114 1114
         ff_h263_show_pict_info(s);
1115
-    if (s->pict_type == FF_I_TYPE && s->codec_tag == AV_RL32("ZYGO")){
1115
+    if (s->pict_type == AV_PICTURE_TYPE_I && s->codec_tag == AV_RL32("ZYGO")){
1116 1116
         int i,j;
1117 1117
         for(i=0; i<85; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb));
1118 1118
         av_log(s->avctx, AV_LOG_DEBUG, "\n");
... ...
@@ -145,7 +145,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
145 145
     if (!s->h263_plus) {
146 146
         /* H.263v1 */
147 147
         put_bits(&s->pb, 3, format);
148
-        put_bits(&s->pb, 1, (s->pict_type == FF_P_TYPE));
148
+        put_bits(&s->pb, 1, (s->pict_type == AV_PICTURE_TYPE_P));
149 149
         /* By now UMV IS DISABLED ON H.263v1, since the restrictions
150 150
         of H.263v1 UMV implies to check the predicted MV after
151 151
         calculation of the current MB to see if we're on the limits */
... ...
@@ -181,7 +181,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
181 181
         put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */
182 182
         put_bits(&s->pb,3,0); /* Reserved */
183 183
 
184
-        put_bits(&s->pb, 3, s->pict_type == FF_P_TYPE);
184
+        put_bits(&s->pb, 3, s->pict_type == AV_PICTURE_TYPE_P);
185 185
 
186 186
         put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */
187 187
         put_bits(&s->pb,1,0); /* Reduced-Resolution Update: off */
... ...
@@ -260,12 +260,12 @@ void h263_encode_gob_header(MpegEncContext * s, int mb_line)
260 260
             put_bits(&s->pb, 1, 1);
261 261
         put_bits(&s->pb, 5, s->qscale); /* GQUANT */
262 262
         put_bits(&s->pb, 1, 1);
263
-        put_bits(&s->pb, 2, s->pict_type == FF_I_TYPE); /* GFID */
263
+        put_bits(&s->pb, 2, s->pict_type == AV_PICTURE_TYPE_I); /* GFID */
264 264
     }else{
265 265
         int gob_number= mb_line / s->gob_index;
266 266
 
267 267
         put_bits(&s->pb, 5, gob_number); /* GN */
268
-        put_bits(&s->pb, 2, s->pict_type == FF_I_TYPE); /* GFID */
268
+        put_bits(&s->pb, 2, s->pict_type == AV_PICTURE_TYPE_I); /* GFID */
269 269
         put_bits(&s->pb, 5, s->qscale); /* GQUANT */
270 270
     }
271 271
 }
... ...
@@ -607,7 +607,7 @@ void h263_encode_mb(MpegEncContext * s,
607 607
         }
608 608
 
609 609
         cbpc = cbp & 3;
610
-        if (s->pict_type == FF_I_TYPE) {
610
+        if (s->pict_type == AV_PICTURE_TYPE_I) {
611 611
             if(s->dquant) cbpc+=4;
612 612
             put_bits(&s->pb,
613 613
                 ff_h263_intra_MCBPC_bits[cbpc],
... ...
@@ -245,7 +245,7 @@ static int encode_picture_ls(AVCodecContext *avctx, unsigned char *buf, int buf_
245 245
     init_put_bits(&pb2, buf2, buf_size);
246 246
 
247 247
     *p = *pict;
248
-    p->pict_type= FF_I_TYPE;
248
+    p->pict_type= AV_PICTURE_TYPE_I;
249 249
     p->key_frame= 1;
250 250
 
251 251
     if(avctx->pix_fmt == PIX_FMT_GRAY8 || avctx->pix_fmt == PIX_FMT_GRAY16)
... ...
@@ -180,7 +180,7 @@ static int decode_frame(AVCodecContext *avctx,
180 180
 
181 181
     if (video_size) {
182 182
         s->frame.key_frame           = 1;
183
-        s->frame.pict_type           = FF_I_TYPE;
183
+        s->frame.pict_type           = AV_PICTURE_TYPE_I;
184 184
         s->frame.palette_has_changed = s->palette_has_changed;
185 185
         s->palette_has_changed       = 0;
186 186
         memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE);
... ...
@@ -259,10 +259,10 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
259 259
 
260 260
     if (header & KMVC_KEYFRAME) {
261 261
         ctx->pic.key_frame = 1;
262
-        ctx->pic.pict_type = FF_I_TYPE;
262
+        ctx->pic.pict_type = AV_PICTURE_TYPE_I;
263 263
     } else {
264 264
         ctx->pic.key_frame = 0;
265
-        ctx->pic.pict_type = FF_P_TYPE;
265
+        ctx->pic.pict_type = AV_PICTURE_TYPE_P;
266 266
     }
267 267
 
268 268
     if (header & KMVC_PALETTE) {
... ...
@@ -76,7 +76,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
76 76
     int zret; // Zlib return code
77 77
 
78 78
     *p = *pict;
79
-    p->pict_type= FF_I_TYPE;
79
+    p->pict_type= AV_PICTURE_TYPE_I;
80 80
     p->key_frame= 1;
81 81
 
82 82
     if(avctx->pix_fmt != PIX_FMT_BGR24){
... ...
@@ -353,9 +353,9 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
353 353
         coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
354 354
 
355 355
         if (coded_frame->key_frame)
356
-            coded_frame->pict_type = FF_I_TYPE;
356
+            coded_frame->pict_type = AV_PICTURE_TYPE_I;
357 357
         else
358
-            coded_frame->pict_type = FF_P_TYPE;
358
+            coded_frame->pict_type = AV_PICTURE_TYPE_P;
359 359
     } else {
360 360
         av_log(avctx, AV_LOG_ERROR,
361 361
                "Compressed frame larger than storage provided! (%zu/%d)\n",
... ...
@@ -101,9 +101,9 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
101 101
 
102 102
         x4->pic.i_pts  = frame->pts;
103 103
         x4->pic.i_type =
104
-            frame->pict_type == FF_I_TYPE ? X264_TYPE_KEYFRAME :
105
-            frame->pict_type == FF_P_TYPE ? X264_TYPE_P :
106
-            frame->pict_type == FF_B_TYPE ? X264_TYPE_B :
104
+            frame->pict_type == AV_PICTURE_TYPE_I ? X264_TYPE_KEYFRAME :
105
+            frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
106
+            frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
107 107
                                             X264_TYPE_AUTO;
108 108
         if (x4->params.b_tff != frame->top_field_first) {
109 109
             x4->params.b_tff = frame->top_field_first;
... ...
@@ -126,14 +126,14 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
126 126
     switch (pic_out.i_type) {
127 127
     case X264_TYPE_IDR:
128 128
     case X264_TYPE_I:
129
-        x4->out_pic.pict_type = FF_I_TYPE;
129
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_I;
130 130
         break;
131 131
     case X264_TYPE_P:
132
-        x4->out_pic.pict_type = FF_P_TYPE;
132
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_P;
133 133
         break;
134 134
     case X264_TYPE_B:
135 135
     case X264_TYPE_BREF:
136
-        x4->out_pic.pict_type = FF_B_TYPE;
136
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_B;
137 137
         break;
138 138
     }
139 139
 
... ...
@@ -138,14 +138,14 @@ static int XAVS_frame(AVCodecContext *ctx, uint8_t *buf,
138 138
     switch (pic_out.i_type) {
139 139
     case XAVS_TYPE_IDR:
140 140
     case XAVS_TYPE_I:
141
-        x4->out_pic.pict_type = FF_I_TYPE;
141
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_I;
142 142
         break;
143 143
     case XAVS_TYPE_P:
144
-        x4->out_pic.pict_type = FF_P_TYPE;
144
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_P;
145 145
         break;
146 146
     case XAVS_TYPE_B:
147 147
     case XAVS_TYPE_BREF:
148
-        x4->out_pic.pict_type = FF_B_TYPE;
148
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_B;
149 149
         break;
150 150
     }
151 151
 
... ...
@@ -134,7 +134,7 @@ float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run){
134 134
     if(!dry_run)
135 135
         s->rc_context.dry_run_qscale= 0;
136 136
 
137
-    if(s->pict_type == FF_B_TYPE) //FIXME this is not exactly identical to xvid
137
+    if(s->pict_type == AV_PICTURE_TYPE_B) //FIXME this is not exactly identical to xvid
138 138
         return xvid_plg_data.quant * FF_QP2LAMBDA * s->avctx->b_quant_factor + s->avctx->b_quant_offset;
139 139
     else
140 140
         return xvid_plg_data.quant * FF_QP2LAMBDA;
... ...
@@ -450,9 +450,9 @@ static int xvid_encode_frame(AVCodecContext *avctx,
450 450
     xvid_enc_frame.vol_flags = x->vol_flags;
451 451
     xvid_enc_frame.motion = x->me_flags;
452 452
     xvid_enc_frame.type =
453
-        picture->pict_type == FF_I_TYPE ? XVID_TYPE_IVOP :
454
-        picture->pict_type == FF_P_TYPE ? XVID_TYPE_PVOP :
455
-        picture->pict_type == FF_B_TYPE ? XVID_TYPE_BVOP :
453
+        picture->pict_type == AV_PICTURE_TYPE_I ? XVID_TYPE_IVOP :
454
+        picture->pict_type == AV_PICTURE_TYPE_P ? XVID_TYPE_PVOP :
455
+        picture->pict_type == AV_PICTURE_TYPE_B ? XVID_TYPE_BVOP :
456 456
                                           XVID_TYPE_AUTO;
457 457
 
458 458
     /* Pixel aspect ratio setting */
... ...
@@ -493,13 +493,13 @@ static int xvid_encode_frame(AVCodecContext *avctx,
493 493
     if( 0 <= xerr ) {
494 494
         p->quality = xvid_enc_stats.quant * FF_QP2LAMBDA;
495 495
         if( xvid_enc_stats.type == XVID_TYPE_PVOP )
496
-            p->pict_type = FF_P_TYPE;
496
+            p->pict_type = AV_PICTURE_TYPE_P;
497 497
         else if( xvid_enc_stats.type == XVID_TYPE_BVOP )
498
-            p->pict_type = FF_B_TYPE;
498
+            p->pict_type = AV_PICTURE_TYPE_B;
499 499
         else if( xvid_enc_stats.type == XVID_TYPE_SVOP )
500
-            p->pict_type = FF_S_TYPE;
500
+            p->pict_type = AV_PICTURE_TYPE_S;
501 501
         else
502
-            p->pict_type = FF_I_TYPE;
502
+            p->pict_type = AV_PICTURE_TYPE_I;
503 503
         if( xvid_enc_frame.out_flags & XVID_KEYFRAME ) {
504 504
             p->key_frame = 1;
505 505
             if( x->quicktime_format )
... ...
@@ -49,7 +49,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in
49 49
     init_put_bits(&s->pb, buf, buf_size);
50 50
 
51 51
     *p = *pict;
52
-    p->pict_type= FF_I_TYPE;
52
+    p->pict_type= AV_PICTURE_TYPE_I;
53 53
     p->key_frame= 1;
54 54
 
55 55
     ff_mjpeg_encode_picture_header(s);
... ...
@@ -169,7 +169,7 @@ static int decode_frame(AVCodecContext *avctx,
169 169
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
170 170
         return -1;
171 171
     }
172
-    p->pict_type= FF_I_TYPE;
172
+    p->pict_type= AV_PICTURE_TYPE_I;
173 173
     p->key_frame= 1;
174 174
 
175 175
     av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
... ...
@@ -352,7 +352,7 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data,
352 352
     }
353 353
 
354 354
     ctx->buf_ptrs[ctx->cur_index].reference = 1;
355
-    ctx->buf_ptrs[ctx->cur_index].pict_type = is_pframe ? FF_P_TYPE:FF_I_TYPE;
355
+    ctx->buf_ptrs[ctx->cur_index].pict_type = is_pframe ? AV_PICTURE_TYPE_P:AV_PICTURE_TYPE_I;
356 356
     if(ff_thread_get_buffer(avctx, &ctx->buf_ptrs[ctx->cur_index])) {
357 357
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
358 358
         return -1;
... ...
@@ -352,7 +352,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
352 352
         av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
353 353
         return -1;
354 354
     }
355
-    s->picture_ptr->pict_type= FF_I_TYPE;
355
+    s->picture_ptr->pict_type= AV_PICTURE_TYPE_I;
356 356
     s->picture_ptr->key_frame= 1;
357 357
     s->got_picture = 1;
358 358
 
... ...
@@ -1893,7 +1893,7 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
1893 1893
                             continue;
1894 1894
 
1895 1895
                     for(j=0; j<fcode && j<8; j++){
1896
-                        if(s->pict_type==FF_B_TYPE || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy])
1896
+                        if(s->pict_type==AV_PICTURE_TYPE_B || s->current_picture.mc_mb_var[xy] < s->current_picture.mb_var[xy])
1897 1897
                             score[j]-= 170;
1898 1898
                     }
1899 1899
                 }
... ...
@@ -1925,7 +1925,7 @@ void ff_fix_long_p_mvs(MpegEncContext * s)
1925 1925
     MotionEstContext * const c= &s->me;
1926 1926
     const int f_code= s->f_code;
1927 1927
     int y, range;
1928
-    assert(s->pict_type==FF_P_TYPE);
1928
+    assert(s->pict_type==AV_PICTURE_TYPE_P);
1929 1929
 
1930 1930
     range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code);
1931 1931
 
... ...
@@ -1035,7 +1035,7 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int
1035 1035
     score_map[0]= dmin;
1036 1036
 
1037 1037
     //FIXME precalc first term below?
1038
-    if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
1038
+    if((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
1039 1039
         dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
1040 1040
 
1041 1041
     /* first line */
... ...
@@ -218,7 +218,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
218 218
     assert(s->mb_skipped==0);
219 219
 
220 220
     if (s->mb_skip_run-- != 0) {
221
-        if (s->pict_type == FF_P_TYPE) {
221
+        if (s->pict_type == AV_PICTURE_TYPE_P) {
222 222
             s->mb_skipped = 1;
223 223
             s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]= MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
224 224
         } else {
... ...
@@ -244,7 +244,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
244 244
 
245 245
     switch(s->pict_type) {
246 246
     default:
247
-    case FF_I_TYPE:
247
+    case AV_PICTURE_TYPE_I:
248 248
         if (get_bits1(&s->gb) == 0) {
249 249
             if (get_bits1(&s->gb) == 0){
250 250
                 av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in I Frame at %d %d\n", s->mb_x, s->mb_y);
... ...
@@ -255,7 +255,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
255 255
             mb_type = MB_TYPE_INTRA;
256 256
         }
257 257
         break;
258
-    case FF_P_TYPE:
258
+    case AV_PICTURE_TYPE_P:
259 259
         mb_type = get_vlc2(&s->gb, mb_ptype_vlc.table, MB_PTYPE_VLC_BITS, 1);
260 260
         if (mb_type < 0){
261 261
             av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in P Frame at %d %d\n", s->mb_x, s->mb_y);
... ...
@@ -263,7 +263,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
263 263
         }
264 264
         mb_type = ptype2mb_type[ mb_type ];
265 265
         break;
266
-    case FF_B_TYPE:
266
+    case AV_PICTURE_TYPE_B:
267 267
         mb_type = get_vlc2(&s->gb, mb_btype_vlc.table, MB_BTYPE_VLC_BITS, 1);
268 268
         if (mb_type < 0){
269 269
             av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in B Frame at %d %d\n", s->mb_x, s->mb_y);
... ...
@@ -1333,7 +1333,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
1333 1333
         return -1;
1334 1334
 
1335 1335
     vbv_delay= get_bits(&s->gb, 16);
1336
-    if (s->pict_type == FF_P_TYPE || s->pict_type == FF_B_TYPE) {
1336
+    if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) {
1337 1337
         s->full_pel[0] = get_bits1(&s->gb);
1338 1338
         f_code = get_bits(&s->gb, 3);
1339 1339
         if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
... ...
@@ -1341,7 +1341,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
1341 1341
         s->mpeg_f_code[0][0] = f_code;
1342 1342
         s->mpeg_f_code[0][1] = f_code;
1343 1343
     }
1344
-    if (s->pict_type == FF_B_TYPE) {
1344
+    if (s->pict_type == AV_PICTURE_TYPE_B) {
1345 1345
         s->full_pel[1] = get_bits1(&s->gb);
1346 1346
         f_code = get_bits(&s->gb, 3);
1347 1347
         if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
... ...
@@ -1350,7 +1350,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
1350 1350
         s->mpeg_f_code[1][1] = f_code;
1351 1351
     }
1352 1352
     s->current_picture.pict_type= s->pict_type;
1353
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
1353
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
1354 1354
 
1355 1355
     if(avctx->debug & FF_DEBUG_PICT_INFO)
1356 1356
         av_log(avctx, AV_LOG_DEBUG, "vbv_delay %d, ref %d type:%d\n", vbv_delay, ref, s->pict_type);
... ...
@@ -1498,13 +1498,13 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
1498 1498
         av_log(s->avctx, AV_LOG_ERROR, "Missing picture start code, guessing missing values\n");
1499 1499
         if(s->mpeg_f_code[1][0] == 15 && s->mpeg_f_code[1][1]==15){
1500 1500
             if(s->mpeg_f_code[0][0] == 15 && s->mpeg_f_code[0][1] == 15)
1501
-                s->pict_type= FF_I_TYPE;
1501
+                s->pict_type= AV_PICTURE_TYPE_I;
1502 1502
             else
1503
-                s->pict_type= FF_P_TYPE;
1503
+                s->pict_type= AV_PICTURE_TYPE_P;
1504 1504
         }else
1505
-            s->pict_type= FF_B_TYPE;
1505
+            s->pict_type= AV_PICTURE_TYPE_B;
1506 1506
         s->current_picture.pict_type= s->pict_type;
1507
-        s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
1507
+        s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
1508 1508
     }
1509 1509
     s->intra_dc_precision = get_bits(&s->gb, 2);
1510 1510
     s->picture_structure = get_bits(&s->gb, 2);
... ...
@@ -1713,7 +1713,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1713 1713
         if(s->avctx->debug&FF_DEBUG_PICT_INFO){
1714 1714
              av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%2d%2d%2d%2d %s %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n",
1715 1715
                  s->qscale, s->mpeg_f_code[0][0],s->mpeg_f_code[0][1],s->mpeg_f_code[1][0],s->mpeg_f_code[1][1],
1716
-                 s->pict_type == FF_I_TYPE ? "I" : (s->pict_type == FF_P_TYPE ? "P" : (s->pict_type == FF_B_TYPE ? "B" : "S")),
1716
+                 s->pict_type == AV_PICTURE_TYPE_I ? "I" : (s->pict_type == AV_PICTURE_TYPE_P ? "P" : (s->pict_type == AV_PICTURE_TYPE_B ? "B" : "S")),
1717 1717
                  s->progressive_sequence ? "ps" :"", s->progressive_frame ? "pf" : "", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"",
1718 1718
                  s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors,
1719 1719
                  s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :"");
... ...
@@ -1736,7 +1736,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1736 1736
 
1737 1737
             for(i=0; i<2; i++){
1738 1738
                 for(dir=0; dir<2; dir++){
1739
-                    if (s->mb_intra || (dir==1 && s->pict_type != FF_B_TYPE)) {
1739
+                    if (s->mb_intra || (dir==1 && s->pict_type != AV_PICTURE_TYPE_B)) {
1740 1740
                         motion_x = motion_y = 0;
1741 1741
                     }else if (s->mv_type == MV_TYPE_16X16 || (s->mv_type == MV_TYPE_FIELD && field_pic)){
1742 1742
                         motion_x = s->mv[dir][0][0];
... ...
@@ -1775,7 +1775,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1775 1775
 
1776 1776
             if(s->mb_y >= s->mb_height){
1777 1777
                 int left= get_bits_left(&s->gb);
1778
-                int is_d10= s->chroma_format==2 && s->pict_type==FF_I_TYPE && avctx->profile==0 && avctx->level==5
1778
+                int is_d10= s->chroma_format==2 && s->pict_type==AV_PICTURE_TYPE_I && avctx->profile==0 && avctx->level==5
1779 1779
                             && s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0
1780 1780
                             && s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/;
1781 1781
 
... ...
@@ -1818,7 +1818,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1818 1818
             }
1819 1819
             if(s->mb_skip_run){
1820 1820
                 int i;
1821
-                if(s->pict_type == FF_I_TYPE){
1821
+                if(s->pict_type == AV_PICTURE_TYPE_I){
1822 1822
                     av_log(s->avctx, AV_LOG_ERROR, "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y);
1823 1823
                     return -1;
1824 1824
                 }
... ...
@@ -1831,7 +1831,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1831 1831
                     s->mv_type = MV_TYPE_16X16;
1832 1832
                 else
1833 1833
                     s->mv_type = MV_TYPE_FIELD;
1834
-                if (s->pict_type == FF_P_TYPE) {
1834
+                if (s->pict_type == AV_PICTURE_TYPE_P) {
1835 1835
                     /* if P type, zero motion vector is implied */
1836 1836
                     s->mv_dir = MV_DIR_FORWARD;
1837 1837
                     s->mv[0][0][0] = s->mv[0][0][1] = 0;
... ...
@@ -1922,7 +1922,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
1922 1922
 
1923 1923
         MPV_frame_end(s);
1924 1924
 
1925
-        if (s->pict_type == FF_B_TYPE || s->low_delay) {
1925
+        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
1926 1926
             *pict= *(AVFrame*)s->current_picture_ptr;
1927 1927
             ff_print_debug_info(s, pict);
1928 1928
         } else {
... ...
@@ -2261,7 +2261,7 @@ static int decode_chunks(AVCodecContext *avctx,
2261 2261
         uint32_t start_code = -1;
2262 2262
         buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code);
2263 2263
         if (start_code > 0x1ff){
2264
-            if(s2->pict_type != FF_B_TYPE || avctx->skip_frame <= AVDISCARD_DEFAULT){
2264
+            if(s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT){
2265 2265
                 if(avctx->thread_count > 1){
2266 2266
                     int i;
2267 2267
 
... ...
@@ -2387,19 +2387,19 @@ static int decode_chunks(AVCodecContext *avctx,
2387 2387
 
2388 2388
                 if(s2->last_picture_ptr==NULL){
2389 2389
                 /* Skip B-frames if we do not have reference frames and gop is not closed */
2390
-                    if(s2->pict_type==FF_B_TYPE){
2390
+                    if(s2->pict_type==AV_PICTURE_TYPE_B){
2391 2391
                         if(!s2->closed_gop)
2392 2392
                             break;
2393 2393
                     }
2394 2394
                 }
2395
-                if(s2->pict_type==FF_I_TYPE)
2395
+                if(s2->pict_type==AV_PICTURE_TYPE_I)
2396 2396
                     s->sync=1;
2397 2397
                 if(s2->next_picture_ptr==NULL){
2398 2398
                 /* Skip P-frames if we do not have a reference frame or we have an invalid header. */
2399
-                    if(s2->pict_type==FF_P_TYPE && !s->sync) break;
2399
+                    if(s2->pict_type==AV_PICTURE_TYPE_P && !s->sync) break;
2400 2400
                 }
2401
-                if(  (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==FF_B_TYPE)
2402
-                    ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=FF_I_TYPE)
2401
+                if(  (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==AV_PICTURE_TYPE_B)
2402
+                    ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=AV_PICTURE_TYPE_I)
2403 2403
                     || avctx->skip_frame >= AVDISCARD_ALL)
2404 2404
                     break;
2405 2405
 
... ...
@@ -354,7 +354,7 @@ void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
354 354
     put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */
355 355
 
356 356
     // RAL: Forward f_code also needed for B frames
357
-    if (s->pict_type == FF_P_TYPE || s->pict_type == FF_B_TYPE) {
357
+    if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) {
358 358
         put_bits(&s->pb, 1, 0); /* half pel coordinates */
359 359
         if(s->codec_id == CODEC_ID_MPEG1VIDEO)
360 360
             put_bits(&s->pb, 3, s->f_code); /* forward_f_code */
... ...
@@ -363,7 +363,7 @@ void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
363 363
     }
364 364
 
365 365
     // RAL: Backward f_code necessary for B frames
366
-    if (s->pict_type == FF_B_TYPE) {
366
+    if (s->pict_type == AV_PICTURE_TYPE_B) {
367 367
         put_bits(&s->pb, 1, 0); /* half pel coordinates */
368 368
         if(s->codec_id == CODEC_ID_MPEG1VIDEO)
369 369
             put_bits(&s->pb, 3, s->b_code); /* backward_f_code */
... ...
@@ -377,13 +377,13 @@ void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number)
377 377
     if(s->codec_id == CODEC_ID_MPEG2VIDEO){
378 378
         put_header(s, EXT_START_CODE);
379 379
         put_bits(&s->pb, 4, 8); //pic ext
380
-        if (s->pict_type == FF_P_TYPE || s->pict_type == FF_B_TYPE) {
380
+        if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) {
381 381
             put_bits(&s->pb, 4, s->f_code);
382 382
             put_bits(&s->pb, 4, s->f_code);
383 383
         }else{
384 384
             put_bits(&s->pb, 8, 255);
385 385
         }
386
-        if (s->pict_type == FF_B_TYPE) {
386
+        if (s->pict_type == AV_PICTURE_TYPE_B) {
387 387
             put_bits(&s->pb, 4, s->b_code);
388 388
             put_bits(&s->pb, 4, s->b_code);
389 389
         }else{
... ...
@@ -456,15 +456,15 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
456 456
 
457 457
     if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 &&
458 458
         (mb_x != s->mb_width - 1 || (mb_y != s->mb_height - 1 && s->codec_id == CODEC_ID_MPEG1VIDEO)) &&
459
-        ((s->pict_type == FF_P_TYPE && (motion_x | motion_y) == 0) ||
460
-        (s->pict_type == FF_B_TYPE && s->mv_dir == s->last_mv_dir && (((s->mv_dir & MV_DIR_FORWARD) ? ((s->mv[0][0][0] - s->last_mv[0][0][0])|(s->mv[0][0][1] - s->last_mv[0][0][1])) : 0) |
459
+        ((s->pict_type == AV_PICTURE_TYPE_P && (motion_x | motion_y) == 0) ||
460
+        (s->pict_type == AV_PICTURE_TYPE_B && s->mv_dir == s->last_mv_dir && (((s->mv_dir & MV_DIR_FORWARD) ? ((s->mv[0][0][0] - s->last_mv[0][0][0])|(s->mv[0][0][1] - s->last_mv[0][0][1])) : 0) |
461 461
         ((s->mv_dir & MV_DIR_BACKWARD) ? ((s->mv[1][0][0] - s->last_mv[1][0][0])|(s->mv[1][0][1] - s->last_mv[1][0][1])) : 0)) == 0))) {
462 462
         s->mb_skip_run++;
463 463
         s->qscale -= s->dquant;
464 464
         s->skip_count++;
465 465
         s->misc_bits++;
466 466
         s->last_bits++;
467
-        if(s->pict_type == FF_P_TYPE){
467
+        if(s->pict_type == AV_PICTURE_TYPE_P){
468 468
             s->last_mv[0][1][0]= s->last_mv[0][0][0]=
469 469
             s->last_mv[0][1][1]= s->last_mv[0][0][1]= 0;
470 470
         }
... ...
@@ -476,7 +476,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
476 476
             encode_mb_skip_run(s, s->mb_skip_run);
477 477
         }
478 478
 
479
-        if (s->pict_type == FF_I_TYPE) {
479
+        if (s->pict_type == AV_PICTURE_TYPE_I) {
480 480
             if(s->dquant && cbp){
481 481
                 put_mb_modes(s, 2, 1, 0, 0); /* macroblock_type : macroblock_quant = 1 */
482 482
                 put_qscale(s);
... ...
@@ -497,7 +497,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
497 497
             s->misc_bits+= get_bits_diff(s);
498 498
             s->i_count++;
499 499
             memset(s->last_mv, 0, sizeof(s->last_mv));
500
-        } else if (s->pict_type == FF_P_TYPE) {
500
+        } else if (s->pict_type == AV_PICTURE_TYPE_P) {
501 501
             if(s->mv_type == MV_TYPE_16X16){
502 502
                 if (cbp != 0) {
503 503
                     if ((motion_x|motion_y) == 0) {
... ...
@@ -28,12 +28,12 @@ uint8_t ff_mpeg4_static_rl_table_store[3][2][2*MAX_RUN + MAX_LEVEL + 3];
28 28
 
29 29
 int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s){
30 30
     switch(s->pict_type){
31
-        case FF_I_TYPE:
31
+        case AV_PICTURE_TYPE_I:
32 32
             return 16;
33
-        case FF_P_TYPE:
34
-        case FF_S_TYPE:
33
+        case AV_PICTURE_TYPE_P:
34
+        case AV_PICTURE_TYPE_S:
35 35
             return s->f_code+15;
36
-        case FF_B_TYPE:
36
+        case AV_PICTURE_TYPE_B:
37 37
             return FFMAX3(s->f_code, s->b_code, 2) + 15;
38 38
         default:
39 39
             return -1;
... ...
@@ -117,7 +117,7 @@ static inline int mpeg4_is_resync(MpegEncContext *s){
117 117
     }
118 118
 
119 119
     while(v<=0xFF){
120
-        if(s->pict_type==FF_B_TYPE || (v>>(8-s->pict_type)!=1) || s->partitioned_frame)
120
+        if(s->pict_type==AV_PICTURE_TYPE_B || (v>>(8-s->pict_type)!=1) || s->partitioned_frame)
121 121
             break;
122 122
         skip_bits(&s->gb, 8+s->pict_type);
123 123
         bits_count+= 8+s->pict_type;
... ...
@@ -372,7 +372,7 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s)
372 372
         av_log(s->avctx, AV_LOG_ERROR, "illegal mb_num in video packet (%d %d) \n", mb_num, s->mb_num);
373 373
         return -1;
374 374
     }
375
-    if(s->pict_type == FF_B_TYPE){
375
+    if(s->pict_type == AV_PICTURE_TYPE_B){
376 376
         while(s->next_picture.mbskip_table[ s->mb_index2xy[ mb_num ] ]) mb_num++;
377 377
         if(mb_num >= s->mb_num) return -1; // slice contains just skipped MBs which where already decoded
378 378
     }
... ...
@@ -406,20 +406,20 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s)
406 406
         if(s->shape != BIN_ONLY_SHAPE){
407 407
             skip_bits(&s->gb, 3); /* intra dc vlc threshold */
408 408
 //FIXME don't just ignore everything
409
-            if(s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
409
+            if(s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
410 410
                 mpeg4_decode_sprite_trajectory(s, &s->gb);
411 411
                 av_log(s->avctx, AV_LOG_ERROR, "untested\n");
412 412
             }
413 413
 
414 414
             //FIXME reduced res stuff here
415 415
 
416
-            if (s->pict_type != FF_I_TYPE) {
416
+            if (s->pict_type != AV_PICTURE_TYPE_I) {
417 417
                 int f_code = get_bits(&s->gb, 3);       /* fcode_for */
418 418
                 if(f_code==0){
419 419
                     av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (f_code=0)\n");
420 420
                 }
421 421
             }
422
-            if (s->pict_type == FF_B_TYPE) {
422
+            if (s->pict_type == AV_PICTURE_TYPE_B) {
423 423
                 int b_code = get_bits(&s->gb, 3);
424 424
                 if(b_code==0){
425 425
                     av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (b_code=0)\n");
... ...
@@ -548,7 +548,7 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
548 548
             if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1)
549 549
                 s->first_slice_line=0;
550 550
 
551
-            if(s->pict_type==FF_I_TYPE){
551
+            if(s->pict_type==AV_PICTURE_TYPE_I){
552 552
                 int i;
553 553
 
554 554
                 do{
... ...
@@ -597,7 +597,7 @@ try_again:
597 597
                 skip_bits1(&s->gb);
598 598
                 if(bits&0x10000){
599 599
                     /* skip mb */
600
-                    if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
600
+                    if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
601 601
                         s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0;
602 602
                         mx= get_amv(s, 0);
603 603
                         my= get_amv(s, 1);
... ...
@@ -638,7 +638,7 @@ try_again:
638 638
                     if(s->mbintra_table[xy])
639 639
                         ff_clean_intra_table_entries(s);
640 640
 
641
-                    if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
641
+                    if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
642 642
                         s->mcsel= get_bits1(&s->gb);
643 643
                     else s->mcsel= 0;
644 644
 
... ...
@@ -710,7 +710,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
710 710
             if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1)
711 711
                 s->first_slice_line=0;
712 712
 
713
-            if(s->pict_type==FF_I_TYPE){
713
+            if(s->pict_type==AV_PICTURE_TYPE_I){
714 714
                 int ac_pred= get_bits1(&s->gb);
715 715
                 int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
716 716
                 if(cbpy<0){
... ...
@@ -784,8 +784,8 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
784 784
 int ff_mpeg4_decode_partitions(MpegEncContext *s)
785 785
 {
786 786
     int mb_num;
787
-    const int part_a_error= s->pict_type==FF_I_TYPE ? (DC_ERROR|MV_ERROR) : MV_ERROR;
788
-    const int part_a_end  = s->pict_type==FF_I_TYPE ? (DC_END  |MV_END)   : MV_END;
787
+    const int part_a_error= s->pict_type==AV_PICTURE_TYPE_I ? (DC_ERROR|MV_ERROR) : MV_ERROR;
788
+    const int part_a_end  = s->pict_type==AV_PICTURE_TYPE_I ? (DC_END  |MV_END)   : MV_END;
789 789
 
790 790
     mb_num= mpeg4_decode_partition_a(s);
791 791
     if(mb_num<0){
... ...
@@ -801,7 +801,7 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s)
801 801
 
802 802
     s->mb_num_left= mb_num;
803 803
 
804
-    if(s->pict_type==FF_I_TYPE){
804
+    if(s->pict_type==AV_PICTURE_TYPE_I){
805 805
         while(show_bits(&s->gb, 9) == 1)
806 806
             skip_bits(&s->gb, 9);
807 807
         if(get_bits_long(&s->gb, 19)!=DC_MARKER){
... ...
@@ -819,11 +819,11 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s)
819 819
     ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, part_a_end);
820 820
 
821 821
     if( mpeg4_decode_partition_b(s, mb_num) < 0){
822
-        if(s->pict_type==FF_P_TYPE)
822
+        if(s->pict_type==AV_PICTURE_TYPE_P)
823 823
             ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, DC_ERROR);
824 824
         return -1;
825 825
     }else{
826
-        if(s->pict_type==FF_P_TYPE)
826
+        if(s->pict_type==AV_PICTURE_TYPE_P)
827 827
             ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, DC_END);
828 828
     }
829 829
 
... ...
@@ -1094,7 +1094,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
1094 1094
         ff_set_qscale(s, s->current_picture.qscale_table[xy] );
1095 1095
     }
1096 1096
 
1097
-    if (s->pict_type == FF_P_TYPE || s->pict_type==FF_S_TYPE) {
1097
+    if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) {
1098 1098
         int i;
1099 1099
         for(i=0; i<4; i++){
1100 1100
             s->mv[0][i][0] = s->current_picture.motion_val[0][ s->block_index[i] ][0];
... ...
@@ -1108,7 +1108,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
1108 1108
                 s->block_last_index[i] = -1;
1109 1109
             s->mv_dir = MV_DIR_FORWARD;
1110 1110
             s->mv_type = MV_TYPE_16X16;
1111
-            if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
1111
+            if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
1112 1112
                 s->mcsel=1;
1113 1113
                 s->mb_skipped = 0;
1114 1114
             }else{
... ...
@@ -1172,7 +1172,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1172 1172
 
1173 1173
     assert(s->h263_pred);
1174 1174
 
1175
-    if (s->pict_type == FF_P_TYPE || s->pict_type==FF_S_TYPE) {
1175
+    if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) {
1176 1176
         do{
1177 1177
             if (get_bits1(&s->gb)) {
1178 1178
                 /* skip mb */
... ...
@@ -1181,7 +1181,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1181 1181
                     s->block_last_index[i] = -1;
1182 1182
                 s->mv_dir = MV_DIR_FORWARD;
1183 1183
                 s->mv_type = MV_TYPE_16X16;
1184
-                if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
1184
+                if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
1185 1185
                     s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0;
1186 1186
                     s->mcsel=1;
1187 1187
                     s->mv[0][0][0]= get_amv(s, 0);
... ...
@@ -1209,7 +1209,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1209 1209
         s->mb_intra = ((cbpc & 4) != 0);
1210 1210
         if (s->mb_intra) goto intra;
1211 1211
 
1212
-        if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
1212
+        if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
1213 1213
             s->mcsel= get_bits1(&s->gb);
1214 1214
         else s->mcsel= 0;
1215 1215
         cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F;
... ...
@@ -1288,7 +1288,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1288 1288
                 mot_val[1] = my;
1289 1289
             }
1290 1290
         }
1291
-    } else if(s->pict_type==FF_B_TYPE) {
1291
+    } else if(s->pict_type==AV_PICTURE_TYPE_B) {
1292 1292
         int modb1; // first bit of modb
1293 1293
         int modb2; // second bit of modb
1294 1294
         int mb_type;
... ...
@@ -1482,7 +1482,7 @@ end:
1482 1482
     if(s->codec_id==CODEC_ID_MPEG4){
1483 1483
         if(mpeg4_is_resync(s)){
1484 1484
             const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1;
1485
-            if(s->pict_type==FF_B_TYPE && s->next_picture.mbskip_table[xy + delta])
1485
+            if(s->pict_type==AV_PICTURE_TYPE_B && s->next_picture.mbskip_table[xy + delta])
1486 1486
                 return SLICE_OK;
1487 1487
             return SLICE_END;
1488 1488
         }
... ...
@@ -1878,13 +1878,13 @@ static int decode_user_data(MpegEncContext *s, GetBitContext *gb){
1878 1878
 static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1879 1879
     int time_incr, time_increment;
1880 1880
 
1881
-    s->pict_type = get_bits(gb, 2) + FF_I_TYPE;        /* pict type: I = 0 , P = 1 */
1882
-    if(s->pict_type==FF_B_TYPE && s->low_delay && s->vol_control_parameters==0 && !(s->flags & CODEC_FLAG_LOW_DELAY)){
1881
+    s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I;        /* pict type: I = 0 , P = 1 */
1882
+    if(s->pict_type==AV_PICTURE_TYPE_B && s->low_delay && s->vol_control_parameters==0 && !(s->flags & CODEC_FLAG_LOW_DELAY)){
1883 1883
         av_log(s->avctx, AV_LOG_ERROR, "low_delay flag incorrectly, clearing it\n");
1884 1884
         s->low_delay=0;
1885 1885
     }
1886 1886
 
1887
-    s->partitioned_frame= s->data_partitioning && s->pict_type!=FF_B_TYPE;
1887
+    s->partitioned_frame= s->data_partitioning && s->pict_type!=AV_PICTURE_TYPE_B;
1888 1888
     if(s->partitioned_frame)
1889 1889
         s->decode_mb= mpeg4_decode_partitioned_mb;
1890 1890
     else
... ...
@@ -1900,8 +1900,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1900 1900
         av_log(s->avctx, AV_LOG_ERROR, "hmm, seems the headers are not complete, trying to guess time_increment_bits\n");
1901 1901
 
1902 1902
         for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){
1903
-            if (    s->pict_type == FF_P_TYPE
1904
-                || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
1903
+            if (    s->pict_type == AV_PICTURE_TYPE_P
1904
+                || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE)) {
1905 1905
                 if((show_bits(gb, s->time_increment_bits+6)&0x37) == 0x30) break;
1906 1906
             }else
1907 1907
                 if((show_bits(gb, s->time_increment_bits+5)&0x1F) == 0x18) break;
... ...
@@ -1913,7 +1913,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1913 1913
     if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further
1914 1914
     else time_increment= get_bits(gb, s->time_increment_bits);
1915 1915
 
1916
-    if(s->pict_type!=FF_B_TYPE){
1916
+    if(s->pict_type!=AV_PICTURE_TYPE_B){
1917 1917
         s->last_time_base= s->time_base;
1918 1918
         s->time_base+= time_incr;
1919 1919
         s->time= s->time_base*s->avctx->time_base.den + time_increment;
... ...
@@ -1963,8 +1963,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1963 1963
             av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n");
1964 1964
         return FRAME_SKIPPED;
1965 1965
     }
1966
-    if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == FF_P_TYPE
1967
-                          || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE))) {
1966
+    if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == AV_PICTURE_TYPE_P
1967
+                          || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE))) {
1968 1968
         /* rounding type for motion estimation */
1969 1969
         s->no_rounding = get_bits1(gb);
1970 1970
     } else {
... ...
@@ -1973,7 +1973,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1973 1973
 //FIXME reduced res stuff
1974 1974
 
1975 1975
      if (s->shape != RECT_SHAPE) {
1976
-         if (s->vol_sprite_usage != 1 || s->pict_type != FF_I_TYPE) {
1976
+         if (s->vol_sprite_usage != 1 || s->pict_type != AV_PICTURE_TYPE_I) {
1977 1977
              int width, height, hor_spat_ref, ver_spat_ref;
1978 1978
 
1979 1979
              width = get_bits(gb, 13);
... ...
@@ -1994,9 +1994,9 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1994 1994
 
1995 1995
      if (s->shape != BIN_ONLY_SHAPE) {
1996 1996
          skip_bits_long(gb, s->cplx_estimation_trash_i);
1997
-         if(s->pict_type != FF_I_TYPE)
1997
+         if(s->pict_type != AV_PICTURE_TYPE_I)
1998 1998
             skip_bits_long(gb, s->cplx_estimation_trash_p);
1999
-         if(s->pict_type == FF_B_TYPE)
1999
+         if(s->pict_type == AV_PICTURE_TYPE_B)
2000 2000
             skip_bits_long(gb, s->cplx_estimation_trash_b);
2001 2001
 
2002 2002
          s->intra_dc_threshold= mpeg4_dc_threshold[ get_bits(gb, 3) ];
... ...
@@ -2019,7 +2019,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2019 2019
          ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
2020 2020
      }
2021 2021
 
2022
-     if(s->pict_type == FF_S_TYPE && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
2022
+     if(s->pict_type == AV_PICTURE_TYPE_S && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
2023 2023
          mpeg4_decode_sprite_trajectory(s, gb);
2024 2024
          if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n");
2025 2025
          if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n");
... ...
@@ -2032,7 +2032,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2032 2032
              return -1; // makes no sense to continue, as there is nothing left from the image then
2033 2033
          }
2034 2034
 
2035
-         if (s->pict_type != FF_I_TYPE) {
2035
+         if (s->pict_type != AV_PICTURE_TYPE_I) {
2036 2036
              s->f_code = get_bits(gb, 3);       /* fcode_for */
2037 2037
              if(s->f_code==0){
2038 2038
                  av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG4 header (f_code=0)\n");
... ...
@@ -2041,7 +2041,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2041 2041
          }else
2042 2042
              s->f_code=1;
2043 2043
 
2044
-         if (s->pict_type == FF_B_TYPE) {
2044
+         if (s->pict_type == AV_PICTURE_TYPE_B) {
2045 2045
              s->b_code = get_bits(gb, 3);
2046 2046
          }else
2047 2047
              s->b_code=1;
... ...
@@ -2049,14 +2049,14 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2049 2049
          if(s->avctx->debug&FF_DEBUG_PICT_INFO){
2050 2050
              av_log(s->avctx, AV_LOG_DEBUG, "qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s dc:%d ce:%d/%d/%d\n",
2051 2051
                  s->qscale, s->f_code, s->b_code,
2052
-                 s->pict_type == FF_I_TYPE ? "I" : (s->pict_type == FF_P_TYPE ? "P" : (s->pict_type == FF_B_TYPE ? "B" : "S")),
2052
+                 s->pict_type == AV_PICTURE_TYPE_I ? "I" : (s->pict_type == AV_PICTURE_TYPE_P ? "P" : (s->pict_type == AV_PICTURE_TYPE_B ? "B" : "S")),
2053 2053
                  gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first,
2054 2054
                  s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points,
2055 2055
                  s->sprite_warping_accuracy, 1-s->no_rounding, s->vo_type, s->vol_control_parameters ? " VOLC" : " ", s->intra_dc_threshold, s->cplx_estimation_trash_i, s->cplx_estimation_trash_p, s->cplx_estimation_trash_b);
2056 2056
          }
2057 2057
 
2058 2058
          if(!s->scalability){
2059
-             if (s->shape!=RECT_SHAPE && s->pict_type!=FF_I_TYPE) {
2059
+             if (s->shape!=RECT_SHAPE && s->pict_type!=AV_PICTURE_TYPE_I) {
2060 2060
                  skip_bits1(gb); // vop shape coding type
2061 2061
              }
2062 2062
          }else{
... ...
@@ -205,7 +205,7 @@ void ff_clean_mpeg4_qscales(MpegEncContext *s){
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,14 +497,14 @@ void mpeg4_encode_mb(MpegEncContext * s,
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,7 +637,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
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) {
... ...
@@ -662,7 +662,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
662 662
                         int diff;
663 663
                         Picture *pic= s->reordered_input_picture[i+1];
664 664
 
665
-                        if(pic==NULL || pic->pict_type!=FF_B_TYPE) break;
665
+                        if(pic==NULL || pic->pict_type!=AV_PICTURE_TYPE_B) break;
666 666
 
667 667
                         b_pic= pic->data[0] + offset;
668 668
                         if(pic->type != FF_BUFFER_TYPE_SHARED)
... ...
@@ -812,7 +812,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
812 812
         }
813 813
 
814 814
         cbpc = cbp & 3;
815
-        if (s->pict_type == FF_I_TYPE) {
815
+        if (s->pict_type == AV_PICTURE_TYPE_I) {
816 816
             if(s->dquant) cbpc+=4;
817 817
             put_bits(&s->pb,
818 818
                 ff_h263_intra_MCBPC_bits[cbpc],
... ...
@@ -864,7 +864,7 @@ void ff_mpeg4_stuffing(PutBitContext * pbc)
864 864
 
865 865
 /* must be called before writing the header */
866 866
 void ff_set_mpeg4_time(MpegEncContext * s){
867
-    if(s->pict_type==FF_B_TYPE){
867
+    if(s->pict_type==AV_PICTURE_TYPE_B){
868 868
         ff_mpeg4_init_direct_mv(s);
869 869
     }else{
870 870
         s->last_time_base= s->time_base;
... ...
@@ -1054,7 +1054,7 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1054 1054
     int time_incr;
1055 1055
     int time_div, time_mod;
1056 1056
 
1057
-    if(s->pict_type==FF_I_TYPE){
1057
+    if(s->pict_type==AV_PICTURE_TYPE_I){
1058 1058
         if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){
1059 1059
             if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy
1060 1060
                 mpeg4_encode_visual_object_header(s);
... ...
@@ -1065,7 +1065,7 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1065 1065
             mpeg4_encode_gop_header(s);
1066 1066
     }
1067 1067
 
1068
-    s->partitioned_frame= s->data_partitioning && s->pict_type!=FF_B_TYPE;
1068
+    s->partitioned_frame= s->data_partitioning && s->pict_type!=AV_PICTURE_TYPE_B;
1069 1069
 
1070 1070
     put_bits(&s->pb, 16, 0);                /* vop header */
1071 1071
     put_bits(&s->pb, 16, VOP_STARTCODE);    /* vop header */
... ...
@@ -1085,8 +1085,8 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1085 1085
     put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */
1086 1086
     put_bits(&s->pb, 1, 1);                             /* marker */
1087 1087
     put_bits(&s->pb, 1, 1);                             /* vop coded */
1088
-    if (    s->pict_type == FF_P_TYPE
1089
-        || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
1088
+    if (    s->pict_type == AV_PICTURE_TYPE_P
1089
+        || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE)) {
1090 1090
         put_bits(&s->pb, 1, s->no_rounding);    /* rounding type */
1091 1091
     }
1092 1092
     put_bits(&s->pb, 3, 0);     /* intra dc VLC threshold */
... ...
@@ -1098,9 +1098,9 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1098 1098
 
1099 1099
     put_bits(&s->pb, 5, s->qscale);
1100 1100
 
1101
-    if (s->pict_type != FF_I_TYPE)
1101
+    if (s->pict_type != AV_PICTURE_TYPE_I)
1102 1102
         put_bits(&s->pb, 3, s->f_code); /* fcode_for */
1103
-    if (s->pict_type == FF_B_TYPE)
1103
+    if (s->pict_type == AV_PICTURE_TYPE_B)
1104 1104
         put_bits(&s->pb, 3, s->b_code); /* fcode_back */
1105 1105
 }
1106 1106
 
... ...
@@ -1305,7 +1305,7 @@ void ff_mpeg4_merge_partitions(MpegEncContext *s)
1305 1305
     const int tex_pb_len= put_bits_count(&s->tex_pb);
1306 1306
     const int bits= put_bits_count(&s->pb);
1307 1307
 
1308
-    if(s->pict_type==FF_I_TYPE){
1308
+    if(s->pict_type==AV_PICTURE_TYPE_I){
1309 1309
         put_bits(&s->pb, 19, DC_MARKER);
1310 1310
         s->misc_bits+=19 + pb2_len + bits - s->last_bits;
1311 1311
         s->i_tex_bits+= tex_pb_len;
... ...
@@ -312,8 +312,8 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){
312 312
     /* It might be nicer if the application would keep track of these
313 313
      * but it would require an API change. */
314 314
     memmove(s->prev_pict_types+1, s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE-1);
315
-    s->prev_pict_types[0]= s->dropable ? FF_B_TYPE : s->pict_type;
316
-    if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == FF_B_TYPE)
315
+    s->prev_pict_types[0]= s->dropable ? AV_PICTURE_TYPE_B : s->pict_type;
316
+    if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == AV_PICTURE_TYPE_B)
317 317
         pic->age= INT_MAX; // Skipped MBs in B-frames are quite rare in MPEG-1/2 and it is a bit tricky to skip them anyway.
318 318
 
319 319
     return 0;
... ...
@@ -917,7 +917,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
917 917
     assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3);
918 918
 
919 919
     /* mark&release old frames */
920
-    if (s->pict_type != FF_B_TYPE && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->data[0]) {
920
+    if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->data[0]) {
921 921
       if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){
922 922
           free_frame_buffer(s, s->last_picture_ptr);
923 923
 
... ...
@@ -953,7 +953,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
953 953
         if (!s->dropable){
954 954
             if (s->codec_id == CODEC_ID_H264)
955 955
                 pic->reference = s->picture_structure;
956
-            else if (s->pict_type != FF_B_TYPE)
956
+            else if (s->pict_type != AV_PICTURE_TYPE_B)
957 957
                 pic->reference = 3;
958 958
         }
959 959
 
... ...
@@ -975,11 +975,11 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
975 975
     s->current_picture_ptr->pict_type= s->pict_type;
976 976
 //    if(s->flags && CODEC_FLAG_QSCALE)
977 977
   //      s->current_picture_ptr->quality= s->new_picture_ptr->quality;
978
-    s->current_picture_ptr->key_frame= s->pict_type == FF_I_TYPE;
978
+    s->current_picture_ptr->key_frame= s->pict_type == AV_PICTURE_TYPE_I;
979 979
 
980 980
     ff_copy_picture(&s->current_picture, s->current_picture_ptr);
981 981
 
982
-    if (s->pict_type != FF_B_TYPE) {
982
+    if (s->pict_type != AV_PICTURE_TYPE_B) {
983 983
         s->last_picture_ptr= s->next_picture_ptr;
984 984
         if(!s->dropable)
985 985
             s->next_picture_ptr= s->current_picture_ptr;
... ...
@@ -991,7 +991,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
991 991
         s->pict_type, s->dropable);*/
992 992
 
993 993
     if(s->codec_id != CODEC_ID_H264){
994
-        if((s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) && s->pict_type!=FF_I_TYPE){
994
+        if((s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) && s->pict_type!=AV_PICTURE_TYPE_I){
995 995
             av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
996 996
             /* Allocate a dummy frame */
997 997
             i= ff_find_unused_picture(s, 0);
... ...
@@ -999,7 +999,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
999 999
             if(ff_alloc_picture(s, s->last_picture_ptr, 0) < 0)
1000 1000
                 return -1;
1001 1001
         }
1002
-        if((s->next_picture_ptr==NULL || s->next_picture_ptr->data[0]==NULL) && s->pict_type==FF_B_TYPE){
1002
+        if((s->next_picture_ptr==NULL || s->next_picture_ptr->data[0]==NULL) && s->pict_type==AV_PICTURE_TYPE_B){
1003 1003
             /* Allocate a dummy frame */
1004 1004
             i= ff_find_unused_picture(s, 0);
1005 1005
             s->next_picture_ptr= &s->picture[i];
... ...
@@ -1011,7 +1011,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1011 1011
     if(s->last_picture_ptr) ff_copy_picture(&s->last_picture, s->last_picture_ptr);
1012 1012
     if(s->next_picture_ptr) ff_copy_picture(&s->next_picture, s->next_picture_ptr);
1013 1013
 
1014
-    assert(s->pict_type == FF_I_TYPE || (s->last_picture_ptr && s->last_picture_ptr->data[0]));
1014
+    assert(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr && s->last_picture_ptr->data[0]));
1015 1015
 
1016 1016
     if(s->picture_structure!=PICT_FRAME && s->out_format != FMT_H264){
1017 1017
         int i;
... ...
@@ -1080,7 +1080,7 @@ void MPV_frame_end(MpegEncContext *s)
1080 1080
 
1081 1081
     s->last_pict_type    = s->pict_type;
1082 1082
     s->last_lambda_for[s->pict_type]= s->current_picture_ptr->quality;
1083
-    if(s->pict_type!=FF_B_TYPE){
1083
+    if(s->pict_type!=AV_PICTURE_TYPE_B){
1084 1084
         s->last_non_b_pict_type= s->pict_type;
1085 1085
     }
1086 1086
 #if 0
... ...
@@ -1205,12 +1205,12 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
1205 1205
 
1206 1206
         av_log(s->avctx,AV_LOG_DEBUG,"New frame, type: ");
1207 1207
         switch (pict->pict_type) {
1208
-            case FF_I_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"I\n"); break;
1209
-            case FF_P_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"P\n"); break;
1210
-            case FF_B_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"B\n"); break;
1211
-            case FF_S_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"S\n"); break;
1212
-            case FF_SI_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SI\n"); break;
1213
-            case FF_SP_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SP\n"); break;
1208
+            case AV_PICTURE_TYPE_I: av_log(s->avctx,AV_LOG_DEBUG,"I\n"); break;
1209
+            case AV_PICTURE_TYPE_P: av_log(s->avctx,AV_LOG_DEBUG,"P\n"); break;
1210
+            case AV_PICTURE_TYPE_B: av_log(s->avctx,AV_LOG_DEBUG,"B\n"); break;
1211
+            case AV_PICTURE_TYPE_S: av_log(s->avctx,AV_LOG_DEBUG,"S\n"); break;
1212
+            case AV_PICTURE_TYPE_SI: av_log(s->avctx,AV_LOG_DEBUG,"SI\n"); break;
1213
+            case AV_PICTURE_TYPE_SP: av_log(s->avctx,AV_LOG_DEBUG,"SP\n"); break;
1214 1214
         }
1215 1215
         for(y=0; y<s->mb_height; y++){
1216 1216
             for(x=0; x<s->mb_width; x++){
... ...
@@ -1306,15 +1306,15 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
1306 1306
                   for(type=0; type<3; type++){
1307 1307
                     int direction = 0;
1308 1308
                     switch (type) {
1309
-                      case 0: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_P_FOR)) || (pict->pict_type!=FF_P_TYPE))
1309
+                      case 0: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_P_FOR)) || (pict->pict_type!=AV_PICTURE_TYPE_P))
1310 1310
                                 continue;
1311 1311
                               direction = 0;
1312 1312
                               break;
1313
-                      case 1: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_FOR)) || (pict->pict_type!=FF_B_TYPE))
1313
+                      case 1: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_FOR)) || (pict->pict_type!=AV_PICTURE_TYPE_B))
1314 1314
                                 continue;
1315 1315
                               direction = 0;
1316 1316
                               break;
1317
-                      case 2: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_BACK)) || (pict->pict_type!=FF_B_TYPE))
1317
+                      case 2: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_BACK)) || (pict->pict_type!=AV_PICTURE_TYPE_B))
1318 1318
                                 continue;
1319 1319
                               direction = 1;
1320 1320
                               break;
... ...
@@ -1710,7 +1710,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
1710 1710
                         ref_picture, pix_op,
1711 1711
                         s->mv[dir][1][0], s->mv[dir][1][1], block_s, mb_y);
1712 1712
         } else {
1713
-            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != FF_B_TYPE && !s->first_field){
1713
+            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field){
1714 1714
                 ref_picture= s->current_picture_ptr->data;
1715 1715
             }
1716 1716
 
... ...
@@ -1724,7 +1724,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
1724 1724
         for(i=0; i<2; i++){
1725 1725
             uint8_t ** ref2picture;
1726 1726
 
1727
-            if(s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == FF_B_TYPE || s->first_field){
1727
+            if(s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == AV_PICTURE_TYPE_B || s->first_field){
1728 1728
                 ref2picture= ref_picture;
1729 1729
             }else{
1730 1730
                 ref2picture= s->current_picture_ptr->data;
... ...
@@ -1878,14 +1878,14 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
1878 1878
     else if (!is_mpeg12 && (s->h263_pred || s->h263_aic))
1879 1879
         s->mbintra_table[mb_xy]=1;
1880 1880
 
1881
-    if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==FF_B_TYPE) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { //FIXME precalc
1881
+    if ((s->flags&CODEC_FLAG_PSNR) || !(s->encoding && (s->intra_only || s->pict_type==AV_PICTURE_TYPE_B) && s->avctx->mb_decision != FF_MB_DECISION_RD)) { //FIXME precalc
1882 1882
         uint8_t *dest_y, *dest_cb, *dest_cr;
1883 1883
         int dct_linesize, dct_offset;
1884 1884
         op_pixels_func (*op_pix)[4];
1885 1885
         qpel_mc_func (*op_qpix)[16];
1886 1886
         const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics
1887 1887
         const int uvlinesize= s->current_picture.linesize[1];
1888
-        const int readable= s->pict_type != FF_B_TYPE || s->encoding || s->avctx->draw_horiz_band || lowres_flag;
1888
+        const int readable= s->pict_type != AV_PICTURE_TYPE_B || s->encoding || s->avctx->draw_horiz_band || lowres_flag;
1889 1889
         const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8;
1890 1890
 
1891 1891
         /* avoid copy if macroblock skipped in last frame too */
... ...
@@ -1898,7 +1898,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
1898 1898
 
1899 1899
             if (s->mb_skipped) {
1900 1900
                 s->mb_skipped= 0;
1901
-                assert(s->pict_type!=FF_I_TYPE);
1901
+                assert(s->pict_type!=AV_PICTURE_TYPE_I);
1902 1902
 
1903 1903
                 (*mbskip_ptr) ++; /* indicate that this time we skipped it */
1904 1904
                 if(*mbskip_ptr >99) *mbskip_ptr= 99;
... ...
@@ -1944,7 +1944,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
1944 1944
                     }
1945 1945
                 }else{
1946 1946
                     op_qpix= s->me.qpel_put;
1947
-                    if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){
1947
+                    if ((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){
1948 1948
                         op_pix = s->dsp.put_pixels_tab;
1949 1949
                     }else{
1950 1950
                         op_pix = s->dsp.put_no_rnd_pixels_tab;
... ...
@@ -1962,8 +1962,8 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
1962 1962
 
1963 1963
             /* skip dequant / idct if we are really late ;) */
1964 1964
             if(s->avctx->skip_idct){
1965
-                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE)
1966
-                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE)
1965
+                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B)
1966
+                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I)
1967 1967
                    || s->avctx->skip_idct >= AVDISCARD_ALL)
1968 1968
                     goto skip_idct;
1969 1969
             }
... ...
@@ -2108,14 +2108,14 @@ void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
2108 2108
             if(s->first_field) return;
2109 2109
         }
2110 2110
 
2111
-        if(s->pict_type==FF_B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
2111
+        if(s->pict_type==AV_PICTURE_TYPE_B || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
2112 2112
             src= (AVFrame*)s->current_picture_ptr;
2113 2113
         else if(s->last_picture_ptr)
2114 2114
             src= (AVFrame*)s->last_picture_ptr;
2115 2115
         else
2116 2116
             return;
2117 2117
 
2118
-        if(s->pict_type==FF_B_TYPE && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
2118
+        if(s->pict_type==AV_PICTURE_TYPE_B && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
2119 2119
             offset[0]=
2120 2120
             offset[1]=
2121 2121
             offset[2]=
... ...
@@ -2151,7 +2151,7 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
2151 2151
     s->dest[1] = s->current_picture.data[1] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
2152 2152
     s->dest[2] = s->current_picture.data[2] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
2153 2153
 
2154
-    if(!(s->pict_type==FF_B_TYPE && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
2154
+    if(!(s->pict_type==AV_PICTURE_TYPE_B && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
2155 2155
     {
2156 2156
         if(s->picture_structure==PICT_FRAME){
2157 2157
         s->dest[0] += s->mb_y *   linesize << mb_size;
... ...
@@ -326,7 +326,7 @@ typedef struct MpegEncContext {
326 326
     int adaptive_quant;         ///< use adaptive quantization
327 327
     int dquant;                 ///< qscale difference to prev qscale
328 328
     int closed_gop;             ///< MPEG1/2 GOP is closed
329
-    int pict_type;              ///< FF_I_TYPE, FF_P_TYPE, FF_B_TYPE, ...
329
+    int pict_type;              ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
330 330
     int last_pict_type; //FIXME removes
331 331
     int last_non_b_pict_type;   ///< used for mpeg4 gmc b-frames & ratecontrol
332 332
     int dropable;
... ...
@@ -649,7 +649,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
649 649
 
650 650
     prefetch_motion(s, ref_picture, dir);
651 651
 
652
-    if(!is_mpeg12 && s->obmc && s->pict_type != FF_B_TYPE){
652
+    if(!is_mpeg12 && s->obmc && s->pict_type != AV_PICTURE_TYPE_B){
653 653
         int16_t mv_cache[4][4][2];
654 654
         const int xy= s->mb_x + s->mb_y*s->mb_stride;
655 655
         const int mot_stride= s->b8_stride;
... ...
@@ -816,7 +816,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
816 816
                             s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y);
817 817
             }
818 818
         } else {
819
-            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != FF_B_TYPE && !s->first_field){
819
+            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field){
820 820
                 ref_picture= s->current_picture_ptr->data;
821 821
             }
822 822
 
... ...
@@ -831,7 +831,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s,
831 831
             uint8_t ** ref2picture;
832 832
 
833 833
             if(s->picture_structure == s->field_select[dir][i] + 1
834
-               || s->pict_type == FF_B_TYPE || s->first_field){
834
+               || s->pict_type == AV_PICTURE_TYPE_B || s->first_field){
835 835
                 ref2picture= ref_picture;
836 836
             }else{
837 837
                 ref2picture= s->current_picture_ptr->data;
... ...
@@ -967,8 +967,8 @@ static int estimate_best_b_count(MpegEncContext *s){
967 967
     assert(scale>=0 && scale <=3);
968 968
 
969 969
 //    emms_c();
970
-    p_lambda= s->last_lambda_for[FF_P_TYPE]; //s->next_picture_ptr->quality;
971
-    b_lambda= s->last_lambda_for[FF_B_TYPE]; //p_lambda *FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
970
+    p_lambda= s->last_lambda_for[AV_PICTURE_TYPE_P]; //s->next_picture_ptr->quality;
971
+    b_lambda= s->last_lambda_for[AV_PICTURE_TYPE_B]; //p_lambda *FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
972 972
     if(!b_lambda) b_lambda= p_lambda; //FIXME we should do this somewhere else
973 973
     lambda2= (b_lambda*b_lambda + (1<<FF_LAMBDA_SHIFT)/2 ) >> FF_LAMBDA_SHIFT;
974 974
 
... ...
@@ -1023,7 +1023,7 @@ static int estimate_best_b_count(MpegEncContext *s){
1023 1023
 
1024 1024
         c->error[0]= c->error[1]= c->error[2]= 0;
1025 1025
 
1026
-        input[0].pict_type= FF_I_TYPE;
1026
+        input[0].pict_type= AV_PICTURE_TYPE_I;
1027 1027
         input[0].quality= 1 * FF_QP2LAMBDA;
1028 1028
         out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[0]);
1029 1029
 //        rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT;
... ...
@@ -1031,7 +1031,7 @@ static int estimate_best_b_count(MpegEncContext *s){
1031 1031
         for(i=0; i<s->max_b_frames+1; i++){
1032 1032
             int is_p= i % (j+1) == j || i==s->max_b_frames;
1033 1033
 
1034
-            input[i+1].pict_type= is_p ? FF_P_TYPE : FF_B_TYPE;
1034
+            input[i+1].pict_type= is_p ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_B;
1035 1035
             input[i+1].quality= is_p ? p_lambda : b_lambda;
1036 1036
             out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[i+1]);
1037 1037
             rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
... ...
@@ -1073,7 +1073,7 @@ static int select_input_picture(MpegEncContext *s){
1073 1073
     if(s->reordered_input_picture[0]==NULL && s->input_picture[0]){
1074 1074
         if(/*s->picture_in_gop_number >= s->gop_size ||*/ s->next_picture_ptr==NULL || s->intra_only){
1075 1075
             s->reordered_input_picture[0]= s->input_picture[0];
1076
-            s->reordered_input_picture[0]->pict_type= FF_I_TYPE;
1076
+            s->reordered_input_picture[0]->pict_type= AV_PICTURE_TYPE_I;
1077 1077
             s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++;
1078 1078
         }else{
1079 1079
             int b_frames;
... ...
@@ -1108,7 +1108,7 @@ static int select_input_picture(MpegEncContext *s){
1108 1108
                     if(pict_num >= s->rc_context.num_entries)
1109 1109
                         break;
1110 1110
                     if(!s->input_picture[i]){
1111
-                        s->rc_context.entry[pict_num-1].new_pict_type = FF_P_TYPE;
1111
+                        s->rc_context.entry[pict_num-1].new_pict_type = AV_PICTURE_TYPE_P;
1112 1112
                         break;
1113 1113
                     }
1114 1114
 
... ...
@@ -1152,10 +1152,10 @@ static int select_input_picture(MpegEncContext *s){
1152 1152
 
1153 1153
             for(i= b_frames - 1; i>=0; i--){
1154 1154
                 int type= s->input_picture[i]->pict_type;
1155
-                if(type && type != FF_B_TYPE)
1155
+                if(type && type != AV_PICTURE_TYPE_B)
1156 1156
                     b_frames= i;
1157 1157
             }
1158
-            if(s->input_picture[b_frames]->pict_type == FF_B_TYPE && b_frames == s->max_b_frames){
1158
+            if(s->input_picture[b_frames]->pict_type == AV_PICTURE_TYPE_B && b_frames == s->max_b_frames){
1159 1159
                 av_log(s->avctx, AV_LOG_ERROR, "warning, too many b frames in a row\n");
1160 1160
             }
1161 1161
 
... ...
@@ -1165,29 +1165,29 @@ static int select_input_picture(MpegEncContext *s){
1165 1165
               }else{
1166 1166
                 if(s->flags & CODEC_FLAG_CLOSED_GOP)
1167 1167
                     b_frames=0;
1168
-                s->input_picture[b_frames]->pict_type= FF_I_TYPE;
1168
+                s->input_picture[b_frames]->pict_type= AV_PICTURE_TYPE_I;
1169 1169
               }
1170 1170
             }
1171 1171
 
1172 1172
             if(   (s->flags & CODEC_FLAG_CLOSED_GOP)
1173 1173
                && b_frames
1174
-               && s->input_picture[b_frames]->pict_type== FF_I_TYPE)
1174
+               && s->input_picture[b_frames]->pict_type== AV_PICTURE_TYPE_I)
1175 1175
                 b_frames--;
1176 1176
 
1177 1177
             s->reordered_input_picture[0]= s->input_picture[b_frames];
1178
-            if(s->reordered_input_picture[0]->pict_type != FF_I_TYPE)
1179
-                s->reordered_input_picture[0]->pict_type= FF_P_TYPE;
1178
+            if(s->reordered_input_picture[0]->pict_type != AV_PICTURE_TYPE_I)
1179
+                s->reordered_input_picture[0]->pict_type= AV_PICTURE_TYPE_P;
1180 1180
             s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++;
1181 1181
             for(i=0; i<b_frames; i++){
1182 1182
                 s->reordered_input_picture[i+1]= s->input_picture[i];
1183
-                s->reordered_input_picture[i+1]->pict_type= FF_B_TYPE;
1183
+                s->reordered_input_picture[i+1]->pict_type= AV_PICTURE_TYPE_B;
1184 1184
                 s->reordered_input_picture[i+1]->coded_picture_number= s->coded_picture_number++;
1185 1185
             }
1186 1186
         }
1187 1187
     }
1188 1188
 no_output_pic:
1189 1189
     if(s->reordered_input_picture[0]){
1190
-        s->reordered_input_picture[0]->reference= s->reordered_input_picture[0]->pict_type!=FF_B_TYPE ? 3 : 0;
1190
+        s->reordered_input_picture[0]->reference= s->reordered_input_picture[0]->pict_type!=AV_PICTURE_TYPE_B ? 3 : 0;
1191 1191
 
1192 1192
         ff_copy_picture(&s->new_picture, s->reordered_input_picture[0]);
1193 1193
 
... ...
@@ -1295,11 +1295,11 @@ vbv_retry:
1295 1295
                         s->lambda_table[i]= FFMAX(s->lambda_table[i]+1, s->lambda_table[i]*(s->qscale+1) / s->qscale);
1296 1296
                 }
1297 1297
                 s->mb_skipped = 0;        //done in MPV_frame_start()
1298
-                if(s->pict_type==FF_P_TYPE){ //done in encode_picture() so we must undo it
1298
+                if(s->pict_type==AV_PICTURE_TYPE_P){ //done in encode_picture() so we must undo it
1299 1299
                     if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)
1300 1300
                         s->no_rounding ^= 1;
1301 1301
                 }
1302
-                if(s->pict_type!=FF_B_TYPE){
1302
+                if(s->pict_type!=AV_PICTURE_TYPE_B){
1303 1303
                     s->time_base= s->last_time_base;
1304 1304
                     s->last_non_b_time= s->time - s->pp_time;
1305 1305
                 }
... ...
@@ -1527,7 +1527,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
1527 1527
 
1528 1528
                 if(s->codec_id==CODEC_ID_MPEG4){
1529 1529
                     if(!s->mb_intra){
1530
-                        if(s->pict_type == FF_B_TYPE){
1530
+                        if(s->pict_type == AV_PICTURE_TYPE_B){
1531 1531
                             if(s->dquant&1 || s->mv_dir&MV_DIRECT)
1532 1532
                                 s->dquant= 0;
1533 1533
                         }
... ...
@@ -1604,7 +1604,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
1604 1604
         dest_cb = s->dest[1];
1605 1605
         dest_cr = s->dest[2];
1606 1606
 
1607
-        if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){
1607
+        if ((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){
1608 1608
             op_pix = s->dsp.put_pixels_tab;
1609 1609
             op_qpix= s->dsp.put_qpel_pixels_tab;
1610 1610
         }else{
... ...
@@ -1994,7 +1994,7 @@ static int estimate_motion_thread(AVCodecContext *c, void *arg){
1994 1994
             s->block_index[3]+=2;
1995 1995
 
1996 1996
             /* compute motion vector & mb_type and store in context */
1997
-            if(s->pict_type==FF_B_TYPE)
1997
+            if(s->pict_type==AV_PICTURE_TYPE_B)
1998 1998
                 ff_estimate_b_frame_motion(s, s->mb_x, s->mb_y);
1999 1999
             else
2000 2000
                 ff_estimate_p_frame_motion(s, s->mb_x, s->mb_y);
... ...
@@ -2392,7 +2392,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2392 2392
                         s->mv[1][0][0] = best_s.mv[1][0][0];
2393 2393
                         s->mv[1][0][1] = best_s.mv[1][0][1];
2394 2394
 
2395
-                        qpi = s->pict_type == FF_B_TYPE ? 2 : 0;
2395
+                        qpi = s->pict_type == AV_PICTURE_TYPE_B ? 2 : 0;
2396 2396
                         for(; qpi<4; qpi++){
2397 2397
                             int dquant= dquant_tab[qpi];
2398 2398
                             qp= last_qp + dquant;
... ...
@@ -2494,7 +2494,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2494 2494
                 s->last_bits= put_bits_count(&s->pb);
2495 2495
 
2496 2496
                 if (CONFIG_H263_ENCODER &&
2497
-                    s->out_format == FMT_H263 && s->pict_type!=FF_B_TYPE)
2497
+                    s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B)
2498 2498
                     ff_h263_update_motion_val(s);
2499 2499
 
2500 2500
                 if(next_block==0){ //FIXME 16 vs linesize16
... ...
@@ -2621,7 +2621,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2621 2621
                 s->last_mv_dir = s->mv_dir;
2622 2622
 
2623 2623
                 if (CONFIG_H263_ENCODER &&
2624
-                    s->out_format == FMT_H263 && s->pict_type!=FF_B_TYPE)
2624
+                    s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B)
2625 2625
                     ff_h263_update_motion_val(s);
2626 2626
 
2627 2627
                 MPV_decode_mb(s, s->block);
... ...
@@ -2659,7 +2659,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2659 2659
     }
2660 2660
 
2661 2661
     //not beautiful here but we must write it before flushing so it has to be here
2662
-    if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == FF_I_TYPE)
2662
+    if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I)
2663 2663
         msmpeg4_encode_ext_header(s);
2664 2664
 
2665 2665
     write_slice_end(s);
... ...
@@ -2757,7 +2757,7 @@ static void set_frame_distances(MpegEncContext * s){
2757 2757
     assert(s->current_picture_ptr->pts != AV_NOPTS_VALUE);
2758 2758
     s->time= s->current_picture_ptr->pts*s->avctx->time_base.num;
2759 2759
 
2760
-    if(s->pict_type==FF_B_TYPE){
2760
+    if(s->pict_type==AV_PICTURE_TYPE_B){
2761 2761
         s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
2762 2762
         assert(s->pb_time > 0 && s->pb_time < s->pp_time);
2763 2763
     }else{
... ...
@@ -2789,10 +2789,10 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2789 2789
 
2790 2790
 //    s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME rate distortion
2791 2791
 
2792
-    if(s->pict_type==FF_I_TYPE){
2792
+    if(s->pict_type==AV_PICTURE_TYPE_I){
2793 2793
         if(s->msmpeg4_version >= 3) s->no_rounding=1;
2794 2794
         else                        s->no_rounding=0;
2795
-    }else if(s->pict_type!=FF_B_TYPE){
2795
+    }else if(s->pict_type!=AV_PICTURE_TYPE_B){
2796 2796
         if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)
2797 2797
             s->no_rounding ^= 1;
2798 2798
     }
... ...
@@ -2802,7 +2802,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2802 2802
             return -1;
2803 2803
         ff_get_2pass_fcode(s);
2804 2804
     }else if(!(s->flags & CODEC_FLAG_QSCALE)){
2805
-        if(s->pict_type==FF_B_TYPE)
2805
+        if(s->pict_type==AV_PICTURE_TYPE_B)
2806 2806
             s->lambda= s->last_lambda_for[s->pict_type];
2807 2807
         else
2808 2808
             s->lambda= s->last_lambda_for[s->last_non_b_pict_type];
... ...
@@ -2818,17 +2818,17 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2818 2818
         return -1;
2819 2819
 
2820 2820
     /* Estimate motion for every MB */
2821
-    if(s->pict_type != FF_I_TYPE){
2821
+    if(s->pict_type != AV_PICTURE_TYPE_I){
2822 2822
         s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8;
2823 2823
         s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8;
2824
-        if(s->pict_type != FF_B_TYPE && s->avctx->me_threshold==0){
2825
-            if((s->avctx->pre_me && s->last_non_b_pict_type==FF_I_TYPE) || s->avctx->pre_me==2){
2824
+        if(s->pict_type != AV_PICTURE_TYPE_B && s->avctx->me_threshold==0){
2825
+            if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){
2826 2826
                 s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, s->avctx->thread_count, sizeof(void*));
2827 2827
             }
2828 2828
         }
2829 2829
 
2830 2830
         s->avctx->execute(s->avctx, estimate_motion_thread, &s->thread_context[0], NULL, s->avctx->thread_count, sizeof(void*));
2831
-    }else /* if(s->pict_type == FF_I_TYPE) */{
2831
+    }else /* if(s->pict_type == AV_PICTURE_TYPE_I) */{
2832 2832
         /* I-Frame */
2833 2833
         for(i=0; i<s->mb_stride*s->mb_height; i++)
2834 2834
             s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
... ...
@@ -2845,15 +2845,15 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2845 2845
     s->current_picture.   mb_var_sum= s->current_picture_ptr->   mb_var_sum= s->me.   mb_var_sum_temp;
2846 2846
     emms_c();
2847 2847
 
2848
-    if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == FF_P_TYPE){
2849
-        s->pict_type= FF_I_TYPE;
2848
+    if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == AV_PICTURE_TYPE_P){
2849
+        s->pict_type= AV_PICTURE_TYPE_I;
2850 2850
         for(i=0; i<s->mb_stride*s->mb_height; i++)
2851 2851
             s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
2852 2852
 //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
2853 2853
     }
2854 2854
 
2855 2855
     if(!s->umvplus){
2856
-        if(s->pict_type==FF_P_TYPE || s->pict_type==FF_S_TYPE) {
2856
+        if(s->pict_type==AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) {
2857 2857
             s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER);
2858 2858
 
2859 2859
             if(s->flags & CODEC_FLAG_INTERLACED_ME){
... ...
@@ -2875,7 +2875,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2875 2875
             }
2876 2876
         }
2877 2877
 
2878
-        if(s->pict_type==FF_B_TYPE){
2878
+        if(s->pict_type==AV_PICTURE_TYPE_B){
2879 2879
             int a, b;
2880 2880
 
2881 2881
             a = ff_get_best_fcode(s, s->b_forw_mv_table, CANDIDATE_MB_TYPE_FORWARD);
... ...
@@ -2909,7 +2909,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2909 2909
     if (estimate_qp(s, 0) < 0)
2910 2910
         return -1;
2911 2911
 
2912
-    if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==FF_I_TYPE && !(s->flags & CODEC_FLAG_QSCALE))
2912
+    if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==AV_PICTURE_TYPE_I && !(s->flags & CODEC_FLAG_QSCALE))
2913 2913
         s->qscale= 3; //reduce clipping problems
2914 2914
 
2915 2915
     if (s->out_format == FMT_MJPEG) {
... ...
@@ -2929,7 +2929,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2929 2929
 
2930 2930
     //FIXME var duplication
2931 2931
     s->current_picture_ptr->key_frame=
2932
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE; //FIXME pic_ptr
2932
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I; //FIXME pic_ptr
2933 2933
     s->current_picture_ptr->pict_type=
2934 2934
     s->current_picture.pict_type= s->pict_type;
2935 2935
 
... ...
@@ -110,9 +110,9 @@ int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx)
110 110
     render->p_past_surface    = NULL;
111 111
 
112 112
     switch(s->pict_type) {
113
-        case  FF_I_TYPE:
113
+        case  AV_PICTURE_TYPE_I:
114 114
             return 0; // no prediction from other frames
115
-        case  FF_B_TYPE:
115
+        case  AV_PICTURE_TYPE_B:
116 116
             next = (struct xvmc_pix_fmt*)s->next_picture.data[2];
117 117
             if (!next)
118 118
                 return -1;
... ...
@@ -120,7 +120,7 @@ int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx)
120 120
                 return -1;
121 121
             render->p_future_surface = next->p_surface;
122 122
             // no return here, going to set forward prediction
123
-        case  FF_P_TYPE:
123
+        case  AV_PICTURE_TYPE_P:
124 124
             last = (struct xvmc_pix_fmt*)s->last_picture.data[2];
125 125
             if (!last)
126 126
                 last = render; // predict second field from the first
... ...
@@ -308,7 +308,7 @@ static void find_best_tables(MpegEncContext * s)
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,7 +333,7 @@ static void find_best_tables(MpegEncContext * s)
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,7 +342,7 @@ static void find_best_tables(MpegEncContext * s)
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,10 +369,10 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
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,7 +619,7 @@ void msmpeg4_encode_mb(MpegEncContext * s,
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,7 +634,7 @@ void msmpeg4_encode_mb(MpegEncContext * s,
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,7 +1094,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
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,7 +1161,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
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,7 +1182,7 @@ static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
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,15 +1390,15 @@ int msmpeg4_decode_picture_header(MpegEncContext * s)
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,7 +1408,7 @@ int msmpeg4_decode_picture_header(MpegEncContext * s)
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){
... ...
@@ -255,11 +255,11 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
255 255
                         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
256 256
                         return AVERROR(ENOMEM);
257 257
                     }
258
-                    jpg->picture_ptr->pict_type = FF_P_TYPE;
258
+                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_P;
259 259
                     jpg->picture_ptr->key_frame = 0;
260 260
                     jpg->got_picture = 1;
261 261
                 } else {
262
-                    jpg->picture_ptr->pict_type = FF_I_TYPE;
262
+                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
263 263
                     jpg->picture_ptr->key_frame = 1;
264 264
                 }
265 265
 
... ...
@@ -208,7 +208,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
208 208
         return -1;
209 209
     }
210 210
 
211
-    c->pic.pict_type = keyframe ? FF_I_TYPE : FF_P_TYPE;
211
+    c->pic.pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
212 212
     c->pic.key_frame = keyframe;
213 213
     // decompress/copy/whatever data
214 214
     switch (comptype) {
... ...
@@ -40,7 +40,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
40 40
     }
41 41
 
42 42
     *p           = *pict;
43
-    p->pict_type = FF_I_TYPE;
43
+    p->pict_type = AV_PICTURE_TYPE_I;
44 44
     p->key_frame = 1;
45 45
 
46 46
     s->bytestream_start =
... ...
@@ -74,7 +74,7 @@ AVCodecParserContext *av_parser_init(int codec_id)
74 74
         }
75 75
     }
76 76
     s->fetch_timestamp=1;
77
-    s->pict_type = FF_I_TYPE;
77
+    s->pict_type = AV_PICTURE_TYPE_I;
78 78
     s->key_frame = -1;
79 79
     s->convergence_duration = 0;
80 80
     s->dts_sync_point       = INT_MIN;
... ...
@@ -188,7 +188,7 @@ int av_parser_change(AVCodecParserContext *s,
188 188
     *poutbuf_size= buf_size;
189 189
     if(avctx->extradata){
190 190
         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
191
-            /*||(s->pict_type != FF_I_TYPE && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
191
+            /*||(s->pict_type != AV_PICTURE_TYPE_I && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
192 192
             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
193 193
             int size= buf_size + avctx->extradata_size;
194 194
             *poutbuf_size= size;
... ...
@@ -152,7 +152,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
152 152
         return -1;
153 153
     }
154 154
 
155
-    p->pict_type = FF_I_TYPE;
155
+    p->pict_type = AV_PICTURE_TYPE_I;
156 156
 
157 157
     ptr    = p->data[0];
158 158
     stride = p->linesize[0];
... ...
@@ -108,7 +108,7 @@ static int pcx_encode_frame(AVCodecContext *avctx,
108 108
     const uint8_t *src;
109 109
 
110 110
     *pict = *(AVFrame *)data;
111
-    pict->pict_type = FF_I_TYPE;
111
+    pict->pict_type = AV_PICTURE_TYPE_I;
112 112
     pict->key_frame = 1;
113 113
 
114 114
     if (avctx->width > 65535 || avctx->height > 65535) {
... ...
@@ -148,7 +148,7 @@ static int decode_frame(AVCodecContext *avctx,
148 148
         return -1;
149 149
     }
150 150
     memset(s->frame.data[0], 0, s->height * s->frame.linesize[0]);
151
-    s->frame.pict_type           = FF_I_TYPE;
151
+    s->frame.pict_type           = AV_PICTURE_TYPE_I;
152 152
     s->frame.palette_has_changed = 1;
153 153
 
154 154
     palette = (uint32_t*)s->frame.data[1];
... ...
@@ -503,7 +503,7 @@ static int decode_frame(AVCodecContext *avctx,
503 503
                     av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
504 504
                     goto fail;
505 505
                 }
506
-                p->pict_type= FF_I_TYPE;
506
+                p->pict_type= AV_PICTURE_TYPE_I;
507 507
                 p->key_frame= 1;
508 508
                 p->interlaced_frame = !!s->interlace_type;
509 509
 
... ...
@@ -243,7 +243,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
243 243
     uint8_t *top_buf = NULL;
244 244
 
245 245
     *p = *pict;
246
-    p->pict_type= FF_I_TYPE;
246
+    p->pict_type= AV_PICTURE_TYPE_I;
247 247
     p->key_frame= 1;
248 248
 
249 249
     s->bytestream_start=
... ...
@@ -52,7 +52,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data,
52 52
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
53 53
         return -1;
54 54
     }
55
-    p->pict_type = FF_I_TYPE;
55
+    p->pict_type = AV_PICTURE_TYPE_I;
56 56
     p->key_frame = 1;
57 57
 
58 58
     switch (avctx->pix_fmt) {
... ...
@@ -39,7 +39,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf,
39 39
     }
40 40
 
41 41
     *p           = *pict;
42
-    p->pict_type = FF_I_TYPE;
42
+    p->pict_type = AV_PICTURE_TYPE_I;
43 43
     p->key_frame = 1;
44 44
 
45 45
     s->bytestream_start =
... ...
@@ -74,7 +74,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
74 74
         return -1;
75 75
     }
76 76
 
77
-    p->pict_type = FF_I_TYPE;
77
+    p->pict_type = AV_PICTURE_TYPE_I;
78 78
 
79 79
     ptr    = p->data[0];
80 80
     stride = p->linesize[0];
... ...
@@ -54,7 +54,7 @@ static int decode_frame(AVCodecContext *avctx,
54 54
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
55 55
         return -1;
56 56
     }
57
-    p->pict_type= FF_I_TYPE;
57
+    p->pict_type= AV_PICTURE_TYPE_I;
58 58
     p->key_frame= 1;
59 59
 
60 60
     outdata = a->pic.data[0];
... ...
@@ -295,11 +295,11 @@ static int qtrle_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size,
295 295
 
296 296
     if (avctx->gop_size == 0 || (s->avctx->frame_number % avctx->gop_size) == 0) {
297 297
         /* I-Frame */
298
-        p->pict_type = FF_I_TYPE;
298
+        p->pict_type = AV_PICTURE_TYPE_I;
299 299
         p->key_frame = 1;
300 300
     } else {
301 301
         /* P-Frame */
302
-        p->pict_type = FF_P_TYPE;
302
+        p->pict_type = AV_PICTURE_TYPE_P;
303 303
         p->key_frame = 0;
304 304
     }
305 305
 
... ...
@@ -54,7 +54,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
54 54
     if (avctx->get_buffer(avctx, pic) < 0)
55 55
         return -1;
56 56
 
57
-    pic->pict_type = FF_I_TYPE;
57
+    pic->pict_type = AV_PICTURE_TYPE_I;
58 58
     pic->key_frame = 1;
59 59
     dst_line = pic->data[0];
60 60
 
... ...
@@ -144,7 +144,7 @@ int ff_rate_control_init(MpegEncContext *s)
144 144
         /* init all to skipped p frames (with b frames we might have a not encoded frame at the end FIXME) */
145 145
         for(i=0; i<rcc->num_entries; i++){
146 146
             RateControlEntry *rce= &rcc->entry[i];
147
-            rce->pict_type= rce->new_pict_type=FF_P_TYPE;
147
+            rce->pict_type= rce->new_pict_type=AV_PICTURE_TYPE_P;
148 148
             rce->qscale= rce->new_qscale=FF_QP2LAMBDA * 2;
149 149
             rce->misc_bits= s->mb_num + 10;
150 150
             rce->mb_var_sum= s->mb_num*100;
... ...
@@ -211,9 +211,9 @@ int ff_rate_control_init(MpegEncContext *s)
211 211
                 double bits= s->avctx->rc_initial_cplx * (i/10000.0 + 1.0)*s->mb_num;
212 212
                 RateControlEntry rce;
213 213
 
214
-                if     (i%((s->gop_size+3)/4)==0) rce.pict_type= FF_I_TYPE;
215
-                else if(i%(s->max_b_frames+1))    rce.pict_type= FF_B_TYPE;
216
-                else                              rce.pict_type= FF_P_TYPE;
214
+                if     (i%((s->gop_size+3)/4)==0) rce.pict_type= AV_PICTURE_TYPE_I;
215
+                else if(i%(s->max_b_frames+1))    rce.pict_type= AV_PICTURE_TYPE_B;
216
+                else                              rce.pict_type= AV_PICTURE_TYPE_P;
217 217
 
218 218
                 rce.new_pict_type= rce.pict_type;
219 219
                 rce.mc_mb_var_sum= bits*s->mb_num/100000;
... ...
@@ -223,7 +223,7 @@ int ff_rate_control_init(MpegEncContext *s)
223 223
                 rce.b_code   = 1;
224 224
                 rce.misc_bits= 1;
225 225
 
226
-                if(s->pict_type== FF_I_TYPE){
226
+                if(s->pict_type== AV_PICTURE_TYPE_I){
227 227
                     rce.i_count   = s->mb_num;
228 228
                     rce.i_tex_bits= bits;
229 229
                     rce.p_tex_bits= 0;
... ...
@@ -317,23 +317,23 @@ static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_f
317 317
         rce->p_tex_bits*rce->qscale,
318 318
         (rce->i_tex_bits + rce->p_tex_bits)*(double)rce->qscale,
319 319
         rce->mv_bits/mb_num,
320
-        rce->pict_type == FF_B_TYPE ? (rce->f_code + rce->b_code)*0.5 : rce->f_code,
320
+        rce->pict_type == AV_PICTURE_TYPE_B ? (rce->f_code + rce->b_code)*0.5 : rce->f_code,
321 321
         rce->i_count/mb_num,
322 322
         rce->mc_mb_var_sum/mb_num,
323 323
         rce->mb_var_sum/mb_num,
324
-        rce->pict_type == FF_I_TYPE,
325
-        rce->pict_type == FF_P_TYPE,
326
-        rce->pict_type == FF_B_TYPE,
324
+        rce->pict_type == AV_PICTURE_TYPE_I,
325
+        rce->pict_type == AV_PICTURE_TYPE_P,
326
+        rce->pict_type == AV_PICTURE_TYPE_B,
327 327
         rcc->qscale_sum[pict_type] / (double)rcc->frame_count[pict_type],
328 328
         a->qcompress,
329
-/*        rcc->last_qscale_for[FF_I_TYPE],
330
-        rcc->last_qscale_for[FF_P_TYPE],
331
-        rcc->last_qscale_for[FF_B_TYPE],
329
+/*        rcc->last_qscale_for[AV_PICTURE_TYPE_I],
330
+        rcc->last_qscale_for[AV_PICTURE_TYPE_P],
331
+        rcc->last_qscale_for[AV_PICTURE_TYPE_B],
332 332
         rcc->next_non_b_qscale,*/
333
-        rcc->i_cplx_sum[FF_I_TYPE] / (double)rcc->frame_count[FF_I_TYPE],
334
-        rcc->i_cplx_sum[FF_P_TYPE] / (double)rcc->frame_count[FF_P_TYPE],
335
-        rcc->p_cplx_sum[FF_P_TYPE] / (double)rcc->frame_count[FF_P_TYPE],
336
-        rcc->p_cplx_sum[FF_B_TYPE] / (double)rcc->frame_count[FF_B_TYPE],
333
+        rcc->i_cplx_sum[AV_PICTURE_TYPE_I] / (double)rcc->frame_count[AV_PICTURE_TYPE_I],
334
+        rcc->i_cplx_sum[AV_PICTURE_TYPE_P] / (double)rcc->frame_count[AV_PICTURE_TYPE_P],
335
+        rcc->p_cplx_sum[AV_PICTURE_TYPE_P] / (double)rcc->frame_count[AV_PICTURE_TYPE_P],
336
+        rcc->p_cplx_sum[AV_PICTURE_TYPE_B] / (double)rcc->frame_count[AV_PICTURE_TYPE_B],
337 337
         (rcc->i_cplx_sum[pict_type] + rcc->p_cplx_sum[pict_type]) / (double)rcc->frame_count[pict_type],
338 338
         0
339 339
     };
... ...
@@ -364,9 +364,9 @@ static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_f
364 364
     q= bits2qp(rce, bits);
365 365
 
366 366
     /* I/B difference */
367
-    if     (pict_type==FF_I_TYPE && s->avctx->i_quant_factor<0.0)
367
+    if     (pict_type==AV_PICTURE_TYPE_I && s->avctx->i_quant_factor<0.0)
368 368
         q= -q*s->avctx->i_quant_factor + s->avctx->i_quant_offset;
369
-    else if(pict_type==FF_B_TYPE && s->avctx->b_quant_factor<0.0)
369
+    else if(pict_type==AV_PICTURE_TYPE_B && s->avctx->b_quant_factor<0.0)
370 370
         q= -q*s->avctx->b_quant_factor + s->avctx->b_quant_offset;
371 371
     if(q<1) q=1;
372 372
 
... ...
@@ -377,17 +377,17 @@ static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, doubl
377 377
     RateControlContext *rcc= &s->rc_context;
378 378
     AVCodecContext *a= s->avctx;
379 379
     const int pict_type= rce->new_pict_type;
380
-    const double last_p_q    = rcc->last_qscale_for[FF_P_TYPE];
380
+    const double last_p_q    = rcc->last_qscale_for[AV_PICTURE_TYPE_P];
381 381
     const double last_non_b_q= rcc->last_qscale_for[rcc->last_non_b_pict_type];
382 382
 
383
-    if     (pict_type==FF_I_TYPE && (a->i_quant_factor>0.0 || rcc->last_non_b_pict_type==FF_P_TYPE))
383
+    if     (pict_type==AV_PICTURE_TYPE_I && (a->i_quant_factor>0.0 || rcc->last_non_b_pict_type==AV_PICTURE_TYPE_P))
384 384
         q= last_p_q    *FFABS(a->i_quant_factor) + a->i_quant_offset;
385
-    else if(pict_type==FF_B_TYPE && a->b_quant_factor>0.0)
385
+    else if(pict_type==AV_PICTURE_TYPE_B && a->b_quant_factor>0.0)
386 386
         q= last_non_b_q*    a->b_quant_factor  + a->b_quant_offset;
387 387
     if(q<1) q=1;
388 388
 
389 389
     /* last qscale / qdiff stuff */
390
-    if(rcc->last_non_b_pict_type==pict_type || pict_type!=FF_I_TYPE){
390
+    if(rcc->last_non_b_pict_type==pict_type || pict_type!=AV_PICTURE_TYPE_I){
391 391
         double last_q= rcc->last_qscale_for[pict_type];
392 392
         const int maxdiff= FF_QP2LAMBDA * a->max_qdiff;
393 393
 
... ...
@@ -397,7 +397,7 @@ static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, doubl
397 397
 
398 398
     rcc->last_qscale_for[pict_type]= q; //Note we cannot do that after blurring
399 399
 
400
-    if(pict_type!=FF_B_TYPE)
400
+    if(pict_type!=AV_PICTURE_TYPE_B)
401 401
         rcc->last_non_b_pict_type= pict_type;
402 402
 
403 403
     return q;
... ...
@@ -412,10 +412,10 @@ static void get_qminmax(int *qmin_ret, int *qmax_ret, MpegEncContext *s, int pic
412 412
 
413 413
     assert(qmin <= qmax);
414 414
 
415
-    if(pict_type==FF_B_TYPE){
415
+    if(pict_type==AV_PICTURE_TYPE_B){
416 416
         qmin= (int)(qmin*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5);
417 417
         qmax= (int)(qmax*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5);
418
-    }else if(pict_type==FF_I_TYPE){
418
+    }else if(pict_type==AV_PICTURE_TYPE_I){
419 419
         qmin= (int)(qmin*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5);
420 420
         qmax= (int)(qmax*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5);
421 421
     }
... ...
@@ -441,7 +441,7 @@ static double modify_qscale(MpegEncContext *s, RateControlEntry *rce, double q,
441 441
     get_qminmax(&qmin, &qmax, s, pict_type);
442 442
 
443 443
     /* modulation */
444
-    if(s->avctx->rc_qmod_freq && frame_num%s->avctx->rc_qmod_freq==0 && pict_type==FF_P_TYPE)
444
+    if(s->avctx->rc_qmod_freq && frame_num%s->avctx->rc_qmod_freq==0 && pict_type==AV_PICTURE_TYPE_P)
445 445
         q*= s->avctx->rc_qmod_amp;
446 446
 
447 447
 //printf("q:%f\n", q);
... ...
@@ -684,7 +684,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
684 684
 //printf("input_pic_num:%d pic_num:%d frame_rate:%d\n", s->input_picture_number, s->picture_number, s->frame_rate);
685 685
         /* update predictors */
686 686
     if(picture_number>2 && !dry_run){
687
-        const int last_var= s->last_pict_type == FF_I_TYPE ? rcc->last_mb_var_sum : rcc->last_mc_mb_var_sum;
687
+        const int last_var= s->last_pict_type == AV_PICTURE_TYPE_I ? rcc->last_mb_var_sum : rcc->last_mc_mb_var_sum;
688 688
         update_predictor(&rcc->pred[s->last_pict_type], rcc->last_qscale, sqrt(last_var), s->frame_bits);
689 689
     }
690 690
 
... ...
@@ -699,7 +699,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
699 699
 
700 700
         //FIXME add a dts field to AVFrame and ensure its set and use it here instead of reordering
701 701
         //but the reordering is simpler for now until h.264 b pyramid must be handeld
702
-        if(s->pict_type == FF_B_TYPE || s->low_delay)
702
+        if(s->pict_type == AV_PICTURE_TYPE_B || s->low_delay)
703 703
             dts_pic= s->current_picture_ptr;
704 704
         else
705 705
             dts_pic= s->last_picture_ptr;
... ...
@@ -717,11 +717,11 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
717 717
     br_compensation= (a->bit_rate_tolerance - diff)/a->bit_rate_tolerance;
718 718
     if(br_compensation<=0.0) br_compensation=0.001;
719 719
 
720
-    var= pict_type == FF_I_TYPE ? pic->mb_var_sum : pic->mc_mb_var_sum;
720
+    var= pict_type == AV_PICTURE_TYPE_I ? pic->mb_var_sum : pic->mc_mb_var_sum;
721 721
 
722 722
     short_term_q = 0; /* avoid warning */
723 723
     if(s->flags&CODEC_FLAG_PASS2){
724
-        if(pict_type!=FF_I_TYPE)
724
+        if(pict_type!=AV_PICTURE_TYPE_I)
725 725
             assert(pict_type == rce->new_pict_type);
726 726
 
727 727
         q= rce->new_qscale / br_compensation;
... ...
@@ -737,7 +737,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
737 737
         rce->misc_bits= 1;
738 738
 
739 739
         bits= predict_size(&rcc->pred[pict_type], rce->qscale, sqrt(var));
740
-        if(pict_type== FF_I_TYPE){
740
+        if(pict_type== AV_PICTURE_TYPE_I){
741 741
             rce->i_count   = s->mb_num;
742 742
             rce->i_tex_bits= bits;
743 743
             rce->p_tex_bits= 0;
... ...
@@ -767,7 +767,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run)
767 767
 //printf("%f ", q);
768 768
         assert(q>0.0);
769 769
 
770
-        if(pict_type==FF_P_TYPE || s->intra_only){ //FIXME type dependent blur like in 2-pass
770
+        if(pict_type==AV_PICTURE_TYPE_P || s->intra_only){ //FIXME type dependent blur like in 2-pass
771 771
             rcc->short_term_qsum*=a->qblur;
772 772
             rcc->short_term_qcount*=a->qblur;
773 773
 
... ...
@@ -842,7 +842,7 @@ static int init_pass2(MpegEncContext *s)
842 842
         complexity[rce->new_pict_type]+= (rce->i_tex_bits+ rce->p_tex_bits)*(double)rce->qscale;
843 843
         const_bits[rce->new_pict_type]+= rce->mv_bits + rce->misc_bits;
844 844
     }
845
-    all_const_bits= const_bits[FF_I_TYPE] + const_bits[FF_P_TYPE] + const_bits[FF_B_TYPE];
845
+    all_const_bits= const_bits[AV_PICTURE_TYPE_I] + const_bits[AV_PICTURE_TYPE_P] + const_bits[AV_PICTURE_TYPE_B];
846 846
 
847 847
     if(all_available_bits < all_const_bits){
848 848
         av_log(s->avctx, AV_LOG_ERROR, "requested bitrate is too low\n");
... ...
@@ -92,7 +92,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
92 92
         if (!context->buffer)
93 93
             return -1;
94 94
     }
95
-    context->pic.pict_type = FF_I_TYPE;
95
+    context->pic.pict_type = AV_PICTURE_TYPE_I;
96 96
     context->pic.key_frame = 1;
97 97
 
98 98
     avctx->coded_frame= &context->pic;
... ...
@@ -32,7 +32,7 @@
32 32
 static av_cold int raw_init_encoder(AVCodecContext *avctx)
33 33
 {
34 34
     avctx->coded_frame = (AVFrame *)avctx->priv_data;
35
-    avctx->coded_frame->pict_type = FF_I_TYPE;
35
+    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
36 36
     avctx->coded_frame->key_frame = 1;
37 37
     avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]);
38 38
     if(!avctx->codec_tag)
... ...
@@ -240,9 +240,9 @@ static int rv10_decode_picture_header(MpegEncContext *s)
240 240
     marker = get_bits1(&s->gb);
241 241
 
242 242
     if (get_bits1(&s->gb))
243
-        s->pict_type = FF_P_TYPE;
243
+        s->pict_type = AV_PICTURE_TYPE_P;
244 244
     else
245
-        s->pict_type = FF_I_TYPE;
245
+        s->pict_type = AV_PICTURE_TYPE_I;
246 246
     if(!marker) av_log(s->avctx, AV_LOG_ERROR, "marker missing\n");
247 247
     pb_frame = get_bits1(&s->gb);
248 248
 
... ...
@@ -259,7 +259,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
259 259
         return -1;
260 260
     }
261 261
 
262
-    if (s->pict_type == FF_I_TYPE) {
262
+    if (s->pict_type == AV_PICTURE_TYPE_I) {
263 263
         if (s->rv10_version == 3) {
264 264
             /* specific MPEG like DC coding not used */
265 265
             s->last_dc[0] = get_bits(&s->gb, 8);
... ...
@@ -302,16 +302,16 @@ static int rv20_decode_picture_header(MpegEncContext *s)
302 302
 
303 303
     i= get_bits(&s->gb, 2);
304 304
     switch(i){
305
-    case 0: s->pict_type= FF_I_TYPE; break;
306
-    case 1: s->pict_type= FF_I_TYPE; break; //hmm ...
307
-    case 2: s->pict_type= FF_P_TYPE; break;
308
-    case 3: s->pict_type= FF_B_TYPE; break;
305
+    case 0: s->pict_type= AV_PICTURE_TYPE_I; break;
306
+    case 1: s->pict_type= AV_PICTURE_TYPE_I; break; //hmm ...
307
+    case 2: s->pict_type= AV_PICTURE_TYPE_P; break;
308
+    case 3: s->pict_type= AV_PICTURE_TYPE_B; break;
309 309
     default:
310 310
         av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n");
311 311
         return -1;
312 312
     }
313 313
 
314
-    if(s->last_picture_ptr==NULL && s->pict_type==FF_B_TYPE){
314
+    if(s->last_picture_ptr==NULL && s->pict_type==AV_PICTURE_TYPE_B){
315 315
         av_log(s->avctx, AV_LOG_ERROR, "early B pix\n");
316 316
         return -1;
317 317
     }
... ...
@@ -382,7 +382,7 @@ static int rv20_decode_picture_header(MpegEncContext *s)
382 382
     if(seq - s->time >  0x4000) seq -= 0x8000;
383 383
     if(seq - s->time < -0x4000) seq += 0x8000;
384 384
     if(seq != s->time){
385
-        if(s->pict_type!=FF_B_TYPE){
385
+        if(s->pict_type!=AV_PICTURE_TYPE_B){
386 386
             s->time= seq;
387 387
             s->pp_time= s->time - s->last_non_b_time;
388 388
             s->last_non_b_time= s->time;
... ...
@@ -405,7 +405,7 @@ av_log(s->avctx, AV_LOG_DEBUG, "\n");*/
405 405
 
406 406
     s->f_code = 1;
407 407
     s->unrestricted_mv = 1;
408
-    s->h263_aic= s->pict_type == FF_I_TYPE;
408
+    s->h263_aic= s->pict_type == AV_PICTURE_TYPE_I;
409 409
 //    s->alt_inter_vlc=1;
410 410
 //    s->obmc=1;
411 411
 //    s->umvplus=1;
... ...
@@ -418,7 +418,7 @@ av_log(s->avctx, AV_LOG_DEBUG, "\n");*/
418 418
                    seq, s->mb_x, s->mb_y, s->pict_type, s->qscale, s->no_rounding);
419 419
     }
420 420
 
421
-    assert(s->pict_type != FF_B_TYPE || !s->low_delay);
421
+    assert(s->pict_type != AV_PICTURE_TYPE_B || !s->low_delay);
422 422
 
423 423
     return s->mb_width*s->mb_height - mb_pos;
424 424
 }
... ...
@@ -599,7 +599,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
599 599
             av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y);
600 600
             return -1;
601 601
         }
602
-        if(s->pict_type != FF_B_TYPE)
602
+        if(s->pict_type != AV_PICTURE_TYPE_B)
603 603
             ff_h263_update_motion_val(s);
604 604
         MPV_decode_mb(s, s->block);
605 605
         if(s->loop_filter)
... ...
@@ -674,7 +674,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
674 674
         ff_er_frame_end(s);
675 675
         MPV_frame_end(s);
676 676
 
677
-        if (s->pict_type == FF_B_TYPE || s->low_delay) {
677
+        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
678 678
             *pict= *(AVFrame*)s->current_picture_ptr;
679 679
         } else if (s->last_picture_ptr != NULL) {
680 680
             *pict= *(AVFrame*)s->last_picture_ptr;
... ...
@@ -36,13 +36,13 @@ void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
36 36
 
37 37
     put_bits(&s->pb, 1, 1);     /* marker */
38 38
 
39
-    put_bits(&s->pb, 1, (s->pict_type == FF_P_TYPE));
39
+    put_bits(&s->pb, 1, (s->pict_type == AV_PICTURE_TYPE_P));
40 40
 
41 41
     put_bits(&s->pb, 1, 0);     /* not PB frame */
42 42
 
43 43
     put_bits(&s->pb, 5, s->qscale);
44 44
 
45
-    if (s->pict_type == FF_I_TYPE) {
45
+    if (s->pict_type == AV_PICTURE_TYPE_I) {
46 46
         /* specific MPEG like DC coding not used */
47 47
     }
48 48
     /* if multiple packets per frame are sent, the position at which
... ...
@@ -47,7 +47,7 @@ void rv20_encode_picture_header(MpegEncContext *s, int picture_number){
47 47
     assert(s->modified_quant==1);
48 48
     assert(s->loop_filter==1);
49 49
 
50
-    s->h263_aic= s->pict_type == FF_I_TYPE;
50
+    s->h263_aic= s->pict_type == AV_PICTURE_TYPE_I;
51 51
     if(s->h263_aic){
52 52
         s->y_dc_scale_table=
53 53
         s->c_dc_scale_table= ff_aic_dc_scale_table;
... ...
@@ -111,7 +111,7 @@ static int rv30_decode_mb_info(RV34DecContext *r)
111 111
         av_log(s->avctx, AV_LOG_ERROR, "dquant needed\n");
112 112
         code -= 6;
113 113
     }
114
-    if(s->pict_type != FF_B_TYPE)
114
+    if(s->pict_type != AV_PICTURE_TYPE_B)
115 115
         return rv30_p_types[code];
116 116
     else
117 117
         return rv30_b_types[code];
... ...
@@ -816,7 +816,7 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type)
816 816
         ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride);
817 817
         return 0;
818 818
     case RV34_MB_SKIP:
819
-        if(s->pict_type == FF_P_TYPE){
819
+        if(s->pict_type == AV_PICTURE_TYPE_P){
820 820
             ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride);
821 821
             rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0);
822 822
             break;
... ...
@@ -1055,9 +1055,9 @@ static int rv34_decode_mb_header(RV34DecContext *r, int8_t *intra_types)
1055 1055
         s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type];
1056 1056
         r->mb_type[mb_pos] = r->block_type;
1057 1057
         if(r->block_type == RV34_MB_SKIP){
1058
-            if(s->pict_type == FF_P_TYPE)
1058
+            if(s->pict_type == AV_PICTURE_TYPE_P)
1059 1059
                 r->mb_type[mb_pos] = RV34_MB_P_16x16;
1060
-            if(s->pict_type == FF_B_TYPE)
1060
+            if(s->pict_type == AV_PICTURE_TYPE_B)
1061 1061
                 r->mb_type[mb_pos] = RV34_MB_B_DIRECT;
1062 1062
         }
1063 1063
         r->is16 = !!IS_INTRA16x16(s->current_picture_ptr->mb_type[mb_pos]);
... ...
@@ -1197,7 +1197,7 @@ static int rv34_decode_macroblock(RV34DecContext *r, int8_t *intra_types)
1197 1197
     cbp = cbp2 = rv34_decode_mb_header(r, intra_types);
1198 1198
     r->cbp_luma  [mb_pos] = cbp;
1199 1199
     r->cbp_chroma[mb_pos] = cbp >> 16;
1200
-    if(s->pict_type == FF_I_TYPE)
1200
+    if(s->pict_type == AV_PICTURE_TYPE_I)
1201 1201
         r->deblock_coefs[mb_pos] = 0xFFFF;
1202 1202
     else
1203 1203
         r->deblock_coefs[mb_pos] = rv34_set_deblock_coef(r) | r->cbp_luma[mb_pos];
... ...
@@ -1298,12 +1298,12 @@ static int rv34_decode_slice(RV34DecContext *r, int end, const uint8_t* buf, int
1298 1298
             r->cbp_chroma = av_realloc(r->cbp_chroma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma));
1299 1299
             r->deblock_coefs = av_realloc(r->deblock_coefs, r->s.mb_stride * r->s.mb_height * sizeof(*r->deblock_coefs));
1300 1300
         }
1301
-        s->pict_type = r->si.type ? r->si.type : FF_I_TYPE;
1301
+        s->pict_type = r->si.type ? r->si.type : AV_PICTURE_TYPE_I;
1302 1302
         if(MPV_frame_start(s, s->avctx) < 0)
1303 1303
             return -1;
1304 1304
         ff_er_frame_start(s);
1305 1305
         r->cur_pts = r->si.pts;
1306
-        if(s->pict_type != FF_B_TYPE){
1306
+        if(s->pict_type != AV_PICTURE_TYPE_B){
1307 1307
             r->last_pts = r->next_pts;
1308 1308
             r->next_pts = r->cur_pts;
1309 1309
         }
... ...
@@ -1452,10 +1452,10 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
1452 1452
         av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n");
1453 1453
         return -1;
1454 1454
     }
1455
-    if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_B_TYPE)
1455
+    if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == AV_PICTURE_TYPE_B)
1456 1456
         return -1;
1457
-    if(   (avctx->skip_frame >= AVDISCARD_NONREF && si.type==FF_B_TYPE)
1458
-       || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=FF_I_TYPE)
1457
+    if(   (avctx->skip_frame >= AVDISCARD_NONREF && si.type==AV_PICTURE_TYPE_B)
1458
+       || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=AV_PICTURE_TYPE_I)
1459 1459
        ||  avctx->skip_frame >= AVDISCARD_ALL)
1460 1460
         return buf_size;
1461 1461
 
... ...
@@ -1494,7 +1494,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx,
1494 1494
             r->loop_filter(r, s->mb_height - 1);
1495 1495
         ff_er_frame_end(s);
1496 1496
         MPV_frame_end(s);
1497
-        if (s->pict_type == FF_B_TYPE || s->low_delay) {
1497
+        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
1498 1498
             *pict= *(AVFrame*)s->current_picture_ptr;
1499 1499
         } else if (s->last_picture_ptr != NULL) {
1500 1500
             *pict= *(AVFrame*)s->last_picture_ptr;
... ...
@@ -253,7 +253,7 @@ static int rv40_decode_mb_info(RV34DecContext *r)
253 253
             prev_type = i;
254 254
         }
255 255
     }
256
-    if(s->pict_type == FF_P_TYPE){
256
+    if(s->pict_type == AV_PICTURE_TYPE_P){
257 257
         prev_type = block_num_to_ptype_vlc_num[prev_type];
258 258
         q = get_vlc2(gb, ptype_vlc[prev_type].table, PTYPE_VLC_BITS, 1);
259 259
         if(q < PBTYPE_ESCAPE)
... ...
@@ -215,7 +215,7 @@ static int decode_frame(AVCodecContext *avctx,
215 215
         return -1;
216 216
     }
217 217
 
218
-    p->pict_type = FF_I_TYPE;
218
+    p->pict_type = AV_PICTURE_TYPE_I;
219 219
     p->key_frame = 1;
220 220
     out_buf = p->data[0];
221 221
 
... ...
@@ -52,7 +52,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
52 52
     unsigned char *orig_buf = buf, *end_buf = buf + buf_size;
53 53
 
54 54
     *p = *(AVFrame*)data;
55
-    p->pict_type = FF_I_TYPE;
55
+    p->pict_type = AV_PICTURE_TYPE_I;
56 56
     p->key_frame = 1;
57 57
 
58 58
     width  = avctx->width;
... ...
@@ -373,9 +373,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
373 373
     smk->pic.palette_has_changed = buf[0] & 1;
374 374
     smk->pic.key_frame = !!(buf[0] & 2);
375 375
     if(smk->pic.key_frame)
376
-        smk->pic.pict_type = FF_I_TYPE;
376
+        smk->pic.pict_type = AV_PICTURE_TYPE_I;
377 377
     else
378
-        smk->pic.pict_type = FF_P_TYPE;
378
+        smk->pic.pict_type = AV_PICTURE_TYPE_P;
379 379
 
380 380
     buf++;
381 381
     for(i = 0; i < 256; i++)
... ...
@@ -2080,7 +2080,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
2080 2080
     ff_init_range_decoder(c, buf, buf_size);
2081 2081
     ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
2082 2082
 
2083
-    s->current_picture.pict_type= FF_I_TYPE; //FIXME I vs. P
2083
+    s->current_picture.pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P
2084 2084
     if(decode_header(s)<0)
2085 2085
         return -1;
2086 2086
     common_init_after_header(avctx);
... ...
@@ -3657,7 +3657,7 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict)
3657 3657
     coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
3658 3658
     assert(coef_sum < INT_MAX);
3659 3659
 
3660
-    if(pict->pict_type == FF_I_TYPE){
3660
+    if(pict->pict_type == AV_PICTURE_TYPE_I){
3661 3661
         s->m.current_picture.mb_var_sum= coef_sum;
3662 3662
         s->m.current_picture.mc_mb_var_sum= 0;
3663 3663
     }else{
... ...
@@ -3726,7 +3726,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
3726 3726
     if(avctx->flags&CODEC_FLAG_PASS2){
3727 3727
         s->m.pict_type =
3728 3728
         pict->pict_type= s->m.rc_context.entry[avctx->frame_number].new_pict_type;
3729
-        s->keyframe= pict->pict_type==FF_I_TYPE;
3729
+        s->keyframe= pict->pict_type==AV_PICTURE_TYPE_I;
3730 3730
         if(!(avctx->flags&CODEC_FLAG_QSCALE)) {
3731 3731
             pict->quality= ff_rate_estimate_qscale(&s->m, 0);
3732 3732
             if (pict->quality < 0)
... ...
@@ -3735,7 +3735,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
3735 3735
     }else{
3736 3736
         s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0;
3737 3737
         s->m.pict_type=
3738
-        pict->pict_type= s->keyframe ? FF_I_TYPE : FF_P_TYPE;
3738
+        pict->pict_type= s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
3739 3739
     }
3740 3740
 
3741 3741
     if(s->pass1_rc && avctx->frame_number == 0)
... ...
@@ -3754,7 +3754,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
3754 3754
     s->m.current_picture_ptr= &s->m.current_picture;
3755 3755
     s->m.last_picture.pts= s->m.current_picture.pts;
3756 3756
     s->m.current_picture.pts= pict->pts;
3757
-    if(pict->pict_type == FF_P_TYPE){
3757
+    if(pict->pict_type == AV_PICTURE_TYPE_P){
3758 3758
         int block_width = (width +15)>>4;
3759 3759
         int block_height= (height+15)>>4;
3760 3760
         int stride= s->current_picture.linesize[0];
... ...
@@ -3803,13 +3803,13 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
3803 3803
 
3804 3804
 redo_frame:
3805 3805
 
3806
-    if(pict->pict_type == FF_I_TYPE)
3806
+    if(pict->pict_type == AV_PICTURE_TYPE_I)
3807 3807
         s->spatial_decomposition_count= 5;
3808 3808
     else
3809 3809
         s->spatial_decomposition_count= 5;
3810 3810
 
3811 3811
     s->m.pict_type = pict->pict_type;
3812
-    s->qbias= pict->pict_type == FF_P_TYPE ? 2 : 0;
3812
+    s->qbias= pict->pict_type == AV_PICTURE_TYPE_P ? 2 : 0;
3813 3813
 
3814 3814
     common_init_after_header(avctx);
3815 3815
 
... ...
@@ -3842,12 +3842,12 @@ redo_frame:
3842 3842
             predict_plane(s, s->spatial_idwt_buffer, plane_index, 0);
3843 3843
 
3844 3844
             if(   plane_index==0
3845
-               && pict->pict_type == FF_P_TYPE
3845
+               && pict->pict_type == AV_PICTURE_TYPE_P
3846 3846
                && !(avctx->flags&CODEC_FLAG_PASS2)
3847 3847
                && s->m.me.scene_change_score > s->avctx->scenechange_threshold){
3848 3848
                 ff_init_range_encoder(c, buf, buf_size);
3849 3849
                 ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
3850
-                pict->pict_type= FF_I_TYPE;
3850
+                pict->pict_type= AV_PICTURE_TYPE_I;
3851 3851
                 s->keyframe=1;
3852 3852
                 s->current_picture.key_frame=1;
3853 3853
                 goto redo_frame;
... ...
@@ -3893,7 +3893,7 @@ redo_frame:
3893 3893
                     if(!QUANTIZE2)
3894 3894
                         quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias);
3895 3895
                     if(orientation==0)
3896
-                        decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == FF_P_TYPE, 0);
3896
+                        decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == AV_PICTURE_TYPE_P, 0);
3897 3897
                     encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation);
3898 3898
                     assert(b->parent==NULL || b->parent->stride == b->stride*2);
3899 3899
                     if(orientation==0)
... ...
@@ -3920,7 +3920,7 @@ redo_frame:
3920 3920
             predict_plane(s, s->spatial_idwt_buffer, plane_index, 1);
3921 3921
         }else{
3922 3922
             //ME/MC only
3923
-            if(pict->pict_type == FF_I_TYPE){
3923
+            if(pict->pict_type == AV_PICTURE_TYPE_I){
3924 3924
                 for(y=0; y<h; y++){
3925 3925
                     for(x=0; x<w; x++){
3926 3926
                         s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]=
... ...
@@ -107,7 +107,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
107 107
         return -1;
108 108
     }
109 109
 
110
-    p->pict_type = FF_I_TYPE;
110
+    p->pict_type = AV_PICTURE_TYPE_I;
111 111
 
112 112
     if (depth != 8 && maplength) {
113 113
         av_log(avctx, AV_LOG_WARNING, "useless colormap found or file is corrupted, trying to recover\n");
... ...
@@ -563,7 +563,7 @@ static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) {
563 563
   if(s->pict_type==4)
564 564
       return -1;
565 565
 
566
-  if (s->pict_type == FF_I_TYPE) {
566
+  if (s->pict_type == AV_PICTURE_TYPE_I) {
567 567
 
568 568
     /* unknown fields */
569 569
     if (s->f_code == 0x50 || s->f_code == 0x60) {
... ...
@@ -669,10 +669,10 @@ static int svq1_decode_frame(AVCodecContext *avctx,
669 669
 
670 670
   //FIXME this avoids some confusion for "B frames" without 2 references
671 671
   //this should be removed after libavcodec can handle more flexible picture types & ordering
672
-  if(s->pict_type==FF_B_TYPE && s->last_picture_ptr==NULL) return buf_size;
672
+  if(s->pict_type==AV_PICTURE_TYPE_B && s->last_picture_ptr==NULL) return buf_size;
673 673
 
674
-  if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
675
-     ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
674
+  if(  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
675
+     ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
676 676
      || avctx->skip_frame >= AVDISCARD_ALL)
677 677
       return buf_size;
678 678
 
... ...
@@ -699,13 +699,13 @@ static int svq1_decode_frame(AVCodecContext *avctx,
699 699
 
700 700
     current  = s->current_picture.data[i];
701 701
 
702
-    if(s->pict_type==FF_B_TYPE){
702
+    if(s->pict_type==AV_PICTURE_TYPE_B){
703 703
         previous = s->next_picture.data[i];
704 704
     }else{
705 705
         previous = s->last_picture.data[i];
706 706
     }
707 707
 
708
-    if (s->pict_type == FF_I_TYPE) {
708
+    if (s->pict_type == AV_PICTURE_TYPE_I) {
709 709
       /* keyframe */
710 710
       for (y=0; y < height; y+=16) {
711 711
         for (x=0; x < width; x+=16) {
... ...
@@ -86,7 +86,7 @@ static void svq1_write_header(SVQ1Context *s, int frame_type)
86 86
     /* frame type */
87 87
     put_bits(&s->pb, 2, frame_type - 1);
88 88
 
89
-    if (frame_type == FF_I_TYPE) {
89
+    if (frame_type == AV_PICTURE_TYPE_I) {
90 90
 
91 91
         /* no checksum since frame code is 0x20 */
92 92
 
... ...
@@ -280,7 +280,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane
280 280
     block_width = (width + 15) / 16;
281 281
     block_height = (height + 15) / 16;
282 282
 
283
-    if(s->picture.pict_type == FF_P_TYPE){
283
+    if(s->picture.pict_type == AV_PICTURE_TYPE_P){
284 284
         s->m.avctx= s->avctx;
285 285
         s->m.current_picture_ptr= &s->m.current_picture;
286 286
         s->m.last_picture_ptr   = &s->m.last_picture;
... ...
@@ -382,11 +382,11 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane
382 382
             ff_init_block_index(&s->m);
383 383
             ff_update_block_index(&s->m);
384 384
 
385
-            if(s->picture.pict_type == FF_I_TYPE || (s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTRA)){
385
+            if(s->picture.pict_type == AV_PICTURE_TYPE_I || (s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTRA)){
386 386
                 for(i=0; i<6; i++){
387 387
                     init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i], 7*32);
388 388
                 }
389
-                if(s->picture.pict_type == FF_P_TYPE){
389
+                if(s->picture.pict_type == AV_PICTURE_TYPE_P){
390 390
                     const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA];
391 391
                     put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
392 392
                     score[0]= vlc[1]*lambda;
... ...
@@ -401,7 +401,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane
401 401
 
402 402
             best=0;
403 403
 
404
-            if(s->picture.pict_type == FF_P_TYPE){
404
+            if(s->picture.pict_type == AV_PICTURE_TYPE_P){
405 405
                 const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER];
406 406
                 int mx, my, pred_x, pred_y, dxy;
407 407
                 int16_t *motion_ptr;
... ...
@@ -528,8 +528,8 @@ static int svq1_encode_frame(AVCodecContext *avctx, unsigned char *buf,
528 528
     init_put_bits(&s->pb, buf, buf_size);
529 529
 
530 530
     *p = *pict;
531
-    p->pict_type = avctx->gop_size && avctx->frame_number % avctx->gop_size ? FF_P_TYPE : FF_I_TYPE;
532
-    p->key_frame = p->pict_type == FF_I_TYPE;
531
+    p->pict_type = avctx->gop_size && avctx->frame_number % avctx->gop_size ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
532
+    p->key_frame = p->pict_type == AV_PICTURE_TYPE_I;
533 533
 
534 534
     svq1_write_header(s, p->pict_type);
535 535
     for(i=0; i<3; i++){
... ...
@@ -438,10 +438,10 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type)
438 438
     h->topright_samples_available = 0xFFFF;
439 439
 
440 440
     if (mb_type == 0) {           /* SKIP */
441
-        if (s->pict_type == FF_P_TYPE || s->next_picture.mb_type[mb_xy] == -1) {
441
+        if (s->pict_type == AV_PICTURE_TYPE_P || s->next_picture.mb_type[mb_xy] == -1) {
442 442
             svq3_mc_dir_part(s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 0, 0);
443 443
 
444
-            if (s->pict_type == FF_B_TYPE) {
444
+            if (s->pict_type == AV_PICTURE_TYPE_B) {
445 445
                 svq3_mc_dir_part(s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 1, 1);
446 446
             }
447 447
 
... ...
@@ -502,15 +502,15 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type)
502 502
             }else
503 503
                 memset(&h->ref_cache[m][scan8[0] - 1*8 - 1], PART_NOT_AVAILABLE, 8);
504 504
 
505
-            if (s->pict_type != FF_B_TYPE)
505
+            if (s->pict_type != AV_PICTURE_TYPE_B)
506 506
                 break;
507 507
         }
508 508
 
509 509
         /* decode motion vector(s) and form prediction(s) */
510
-        if (s->pict_type == FF_P_TYPE) {
510
+        if (s->pict_type == AV_PICTURE_TYPE_P) {
511 511
             if (svq3_mc_dir(h, (mb_type - 1), mode, 0, 0) < 0)
512 512
                 return -1;
513
-        } else {        /* FF_B_TYPE */
513
+        } else {        /* AV_PICTURE_TYPE_B */
514 514
             if (mb_type != 2) {
515 515
                 if (svq3_mc_dir(h, 0, mode, 0, 0) < 0)
516 516
                     return -1;
... ...
@@ -609,11 +609,11 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type)
609 609
         mb_type = MB_TYPE_INTRA16x16;
610 610
     }
611 611
 
612
-    if (!IS_INTER(mb_type) && s->pict_type != FF_I_TYPE) {
612
+    if (!IS_INTER(mb_type) && s->pict_type != AV_PICTURE_TYPE_I) {
613 613
         for (i = 0; i < 4; i++) {
614 614
             memset(s->current_picture.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
615 615
         }
616
-        if (s->pict_type == FF_B_TYPE) {
616
+        if (s->pict_type == AV_PICTURE_TYPE_B) {
617 617
             for (i = 0; i < 4; i++) {
618 618
                 memset(s->current_picture.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t));
619 619
             }
... ...
@@ -622,12 +622,12 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type)
622 622
     if (!IS_INTRA4x4(mb_type)) {
623 623
         memset(h->intra4x4_pred_mode+h->mb2br_xy[mb_xy], DC_PRED, 8);
624 624
     }
625
-    if (!IS_SKIP(mb_type) || s->pict_type == FF_B_TYPE) {
625
+    if (!IS_SKIP(mb_type) || s->pict_type == AV_PICTURE_TYPE_B) {
626 626
         memset(h->non_zero_count_cache + 8, 0, 4*9*sizeof(uint8_t));
627 627
         s->dsp.clear_blocks(h->mb);
628 628
     }
629 629
 
630
-    if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == FF_B_TYPE)) {
630
+    if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == AV_PICTURE_TYPE_B)) {
631 631
         if ((vlc = svq3_get_ue_golomb(&s->gb)) >= 48){
632 632
             av_log(h->s.avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
633 633
             return -1;
... ...
@@ -635,7 +635,7 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type)
635 635
 
636 636
         cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc] : golomb_to_inter_cbp[vlc];
637 637
     }
638
-    if (IS_INTRA16x16(mb_type) || (s->pict_type != FF_I_TYPE && s->adaptive_quant && cbp)) {
638
+    if (IS_INTRA16x16(mb_type) || (s->pict_type != AV_PICTURE_TYPE_I && s->adaptive_quant && cbp)) {
639 639
         s->qscale += svq3_get_se_golomb(&s->gb);
640 640
 
641 641
         if (s->qscale > 31){
... ...
@@ -947,18 +947,18 @@ static int svq3_decode_frame(AVCodecContext *avctx,
947 947
 
948 948
     /* for skipping the frame */
949 949
     s->current_picture.pict_type = s->pict_type;
950
-    s->current_picture.key_frame = (s->pict_type == FF_I_TYPE);
950
+    s->current_picture.key_frame = (s->pict_type == AV_PICTURE_TYPE_I);
951 951
 
952 952
     /* Skip B-frames if we do not have reference frames. */
953
-    if (s->last_picture_ptr == NULL && s->pict_type == FF_B_TYPE)
953
+    if (s->last_picture_ptr == NULL && s->pict_type == AV_PICTURE_TYPE_B)
954 954
         return 0;
955
-    if (  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE)
956
-        ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE)
955
+    if (  (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B)
956
+        ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I)
957 957
         || avctx->skip_frame >= AVDISCARD_ALL)
958 958
         return 0;
959 959
 
960 960
     if (s->next_p_frame_damaged) {
961
-        if (s->pict_type == FF_B_TYPE)
961
+        if (s->pict_type == AV_PICTURE_TYPE_B)
962 962
             return 0;
963 963
         else
964 964
             s->next_p_frame_damaged = 0;
... ...
@@ -967,7 +967,7 @@ static int svq3_decode_frame(AVCodecContext *avctx,
967 967
     if (ff_h264_frame_start(h) < 0)
968 968
         return -1;
969 969
 
970
-    if (s->pict_type == FF_B_TYPE) {
970
+    if (s->pict_type == AV_PICTURE_TYPE_B) {
971 971
         h->frame_num_offset = (h->slice_num - h->prev_frame_num);
972 972
 
973 973
         if (h->frame_num_offset < 0) {
... ...
@@ -1016,9 +1016,9 @@ static int svq3_decode_frame(AVCodecContext *avctx,
1016 1016
 
1017 1017
             mb_type = svq3_get_ue_golomb(&s->gb);
1018 1018
 
1019
-            if (s->pict_type == FF_I_TYPE) {
1019
+            if (s->pict_type == AV_PICTURE_TYPE_I) {
1020 1020
                 mb_type += 8;
1021
-            } else if (s->pict_type == FF_B_TYPE && mb_type >= 4) {
1021
+            } else if (s->pict_type == AV_PICTURE_TYPE_B && mb_type >= 4) {
1022 1022
                 mb_type += 4;
1023 1023
             }
1024 1024
             if (mb_type > 33 || svq3_decode_mb(h, mb_type)) {
... ...
@@ -1030,9 +1030,9 @@ static int svq3_decode_frame(AVCodecContext *avctx,
1030 1030
                 ff_h264_hl_decode_mb (h);
1031 1031
             }
1032 1032
 
1033
-            if (s->pict_type != FF_B_TYPE && !s->low_delay) {
1033
+            if (s->pict_type != AV_PICTURE_TYPE_B && !s->low_delay) {
1034 1034
                 s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride] =
1035
-                    (s->pict_type == FF_P_TYPE && mb_type < 8) ? (mb_type - 1) : -1;
1035
+                    (s->pict_type == AV_PICTURE_TYPE_P && mb_type < 8) ? (mb_type - 1) : -1;
1036 1036
             }
1037 1037
         }
1038 1038
 
... ...
@@ -1041,7 +1041,7 @@ static int svq3_decode_frame(AVCodecContext *avctx,
1041 1041
 
1042 1042
     MPV_frame_end(s);
1043 1043
 
1044
-    if (s->pict_type == FF_B_TYPE || s->low_delay) {
1044
+    if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
1045 1045
         *(AVFrame *) data = *(AVFrame *) &s->current_picture;
1046 1046
     } else {
1047 1047
         *(AVFrame *) data = *(AVFrame *) &s->last_picture;
... ...
@@ -90,7 +90,7 @@ static int targa_encode_frame(AVCodecContext *avctx,
90 90
         return AVERROR(EINVAL);
91 91
     }
92 92
 
93
-    p->pict_type= FF_I_TYPE;
93
+    p->pict_type= AV_PICTURE_TYPE_I;
94 94
     p->key_frame= 1;
95 95
 
96 96
     /* zero out the header and only set applicable fields */
... ...
@@ -221,7 +221,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf,
221 221
     s->buf_size = buf_size;
222 222
 
223 223
     *p = *pict;
224
-    p->pict_type = FF_I_TYPE;
224
+    p->pict_type = AV_PICTURE_TYPE_I;
225 225
     p->key_frame = 1;
226 226
     avctx->coded_frame= &s->picture;
227 227
 
... ...
@@ -59,7 +59,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data,
59 59
         return -1;
60 60
     }
61 61
 
62
-    tmv->pic.pict_type = FF_I_TYPE;
62
+    tmv->pic.pict_type = AV_PICTURE_TYPE_I;
63 63
     tmv->pic.key_frame = 1;
64 64
     dst                = tmv->pic.data[0];
65 65
 
... ...
@@ -807,9 +807,9 @@ static int decode_frame(AVCodecContext *avctx,
807 807
     }
808 808
     p->key_frame = tm2_decode_blocks(l, p);
809 809
     if(p->key_frame)
810
-        p->pict_type = FF_I_TYPE;
810
+        p->pict_type = AV_PICTURE_TYPE_I;
811 811
     else
812
-        p->pict_type = FF_P_TYPE;
812
+        p->pict_type = AV_PICTURE_TYPE_P;
813 813
 
814 814
     l->cur = !l->cur;
815 815
     *data_size = sizeof(AVFrame);
... ...
@@ -89,7 +89,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
89 89
         return -1;
90 90
     }
91 91
 
92
-    p->pict_type = FF_I_TYPE;
92
+    p->pict_type = AV_PICTURE_TYPE_I;
93 93
 
94 94
     ptr    = p->data[0];
95 95
     stride = p->linesize[0];
... ...
@@ -63,7 +63,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
63 63
     y = (uint16_t*)pic->data[0];
64 64
     u = (uint16_t*)pic->data[1];
65 65
     v = (uint16_t*)pic->data[2];
66
-    pic->pict_type = FF_I_TYPE;
66
+    pic->pict_type = AV_PICTURE_TYPE_I;
67 67
     pic->key_frame = 1;
68 68
 
69 69
 #define READ_PIXELS(a, b, c)         \
... ...
@@ -43,7 +43,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
43 43
     avctx->coded_frame = avcodec_alloc_frame();
44 44
 
45 45
     avctx->coded_frame->key_frame = 1;
46
-    avctx->coded_frame->pict_type = FF_I_TYPE;
46
+    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
47 47
 
48 48
     return 0;
49 49
 }
... ...
@@ -63,7 +63,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
63 63
     udst= (uint16_t *)pic->data[1];
64 64
     vdst= (uint16_t *)pic->data[2];
65 65
     yend= ydst + width;
66
-    pic->pict_type= FF_I_TYPE;
66
+    pic->pict_type= AV_PICTURE_TYPE_I;
67 67
     pic->key_frame= 1;
68 68
 
69 69
     for(;;){
... ...
@@ -312,7 +312,7 @@ static int decode_slice(AVCodecContext *avctx,
312 312
     slice_param->slice_data_bit_offset          = get_bits_count(&h->s.gb) + 8; /* bit buffer started beyond nal_unit_type */
313 313
     slice_param->first_mb_in_slice              = (s->mb_y >> FIELD_OR_MBAFF_PICTURE) * s->mb_width + s->mb_x;
314 314
     slice_param->slice_type                     = ff_h264_get_slice_type(h);
315
-    slice_param->direct_spatial_mv_pred_flag    = h->slice_type == FF_B_TYPE ? h->direct_spatial_mv_pred : 0;
315
+    slice_param->direct_spatial_mv_pred_flag    = h->slice_type == AV_PICTURE_TYPE_B ? h->direct_spatial_mv_pred : 0;
316 316
     slice_param->num_ref_idx_l0_active_minus1   = h->list_count > 0 ? h->ref_count[0] - 1 : 0;
317 317
     slice_param->num_ref_idx_l1_active_minus1   = h->list_count > 1 ? h->ref_count[1] - 1 : 0;
318 318
     slice_param->cabac_init_idc                 = h->cabac_init_idc;
... ...
@@ -72,10 +72,10 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_
72 72
     pic_param->picture_coding_extension.bits.is_first_field     = mpeg2_get_is_frame_start(s);
73 73
 
74 74
     switch (s->pict_type) {
75
-    case FF_B_TYPE:
75
+    case AV_PICTURE_TYPE_B:
76 76
         pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
77 77
         // fall-through
78
-    case FF_P_TYPE:
78
+    case AV_PICTURE_TYPE_P:
79 79
         pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
80 80
         break;
81 81
     }
... ...
@@ -78,8 +78,8 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
78 78
     }
79 79
     pic_param->quant_precision                          = s->quant_precision;
80 80
     pic_param->vop_fields.value                         = 0; /* reset all bits */
81
-    pic_param->vop_fields.bits.vop_coding_type          = s->pict_type - FF_I_TYPE;
82
-    pic_param->vop_fields.bits.backward_reference_vop_coding_type = s->pict_type == FF_B_TYPE ? s->next_picture.pict_type - FF_I_TYPE : 0;
81
+    pic_param->vop_fields.bits.vop_coding_type          = s->pict_type - AV_PICTURE_TYPE_I;
82
+    pic_param->vop_fields.bits.backward_reference_vop_coding_type = s->pict_type == AV_PICTURE_TYPE_B ? s->next_picture.pict_type - AV_PICTURE_TYPE_I : 0;
83 83
     pic_param->vop_fields.bits.vop_rounding_type        = s->no_rounding;
84 84
     pic_param->vop_fields.bits.intra_dc_vlc_thr         = mpeg4_get_intra_dc_vlc_thr(s);
85 85
     pic_param->vop_fields.bits.top_field_first          = s->top_field_first;
... ...
@@ -92,9 +92,9 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
92 92
     pic_param->TRB                                      = s->pb_time;
93 93
     pic_param->TRD                                      = s->pp_time;
94 94
 
95
-    if (s->pict_type == FF_B_TYPE)
95
+    if (s->pict_type == AV_PICTURE_TYPE_B)
96 96
         pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
97
-    if (s->pict_type != FF_I_TYPE)
97
+    if (s->pict_type != AV_PICTURE_TYPE_I)
98 98
         pic_param->forward_reference_picture  = ff_vaapi_get_surface_id(&s->last_picture);
99 99
 
100 100
     /* Fill in VAIQMatrixBufferMPEG4 */
... ...
@@ -42,7 +42,7 @@ static inline int vc1_has_MVTYPEMB_bitplane(VC1Context *v)
42 42
 {
43 43
     if (v->mv_type_is_raw)
44 44
         return 0;
45
-    return (v->s.pict_type == FF_P_TYPE &&
45
+    return (v->s.pict_type == AV_PICTURE_TYPE_P &&
46 46
             (v->mv_mode == MV_PMODE_MIXED_MV ||
47 47
              (v->mv_mode == MV_PMODE_INTENSITY_COMP &&
48 48
               v->mv_mode2 == MV_PMODE_MIXED_MV)));
... ...
@@ -53,8 +53,8 @@ static inline int vc1_has_SKIPMB_bitplane(VC1Context *v)
53 53
 {
54 54
     if (v->skip_is_raw)
55 55
         return 0;
56
-    return (v->s.pict_type == FF_P_TYPE ||
57
-            (v->s.pict_type == FF_B_TYPE && !v->bi_type));
56
+    return (v->s.pict_type == AV_PICTURE_TYPE_P ||
57
+            (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type));
58 58
 }
59 59
 
60 60
 /** Check whether the DIRECTMB bitplane is present */
... ...
@@ -62,7 +62,7 @@ static inline int vc1_has_DIRECTMB_bitplane(VC1Context *v)
62 62
 {
63 63
     if (v->dmb_is_raw)
64 64
         return 0;
65
-    return v->s.pict_type == FF_B_TYPE && !v->bi_type;
65
+    return v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type;
66 66
 }
67 67
 
68 68
 /** Check whether the ACPRED bitplane is present */
... ...
@@ -71,8 +71,8 @@ static inline int vc1_has_ACPRED_bitplane(VC1Context *v)
71 71
     if (v->acpred_is_raw)
72 72
         return 0;
73 73
     return (v->profile == PROFILE_ADVANCED &&
74
-            (v->s.pict_type == FF_I_TYPE ||
75
-             (v->s.pict_type == FF_B_TYPE && v->bi_type)));
74
+            (v->s.pict_type == AV_PICTURE_TYPE_I ||
75
+             (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type)));
76 76
 }
77 77
 
78 78
 /** Check whether the OVERFLAGS bitplane is present */
... ...
@@ -81,8 +81,8 @@ static inline int vc1_has_OVERFLAGS_bitplane(VC1Context *v)
81 81
     if (v->overflg_is_raw)
82 82
         return 0;
83 83
     return (v->profile == PROFILE_ADVANCED &&
84
-            (v->s.pict_type == FF_I_TYPE ||
85
-             (v->s.pict_type == FF_B_TYPE && v->bi_type)) &&
84
+            (v->s.pict_type == AV_PICTURE_TYPE_I ||
85
+             (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type)) &&
86 86
             (v->overlap && v->pq <= 8) &&
87 87
             v->condover == CONDOVER_SELECT);
88 88
 }
... ...
@@ -92,9 +92,9 @@ static int vc1_get_PTYPE(VC1Context *v)
92 92
 {
93 93
     MpegEncContext * const s = &v->s;
94 94
     switch (s->pict_type) {
95
-    case FF_I_TYPE: return 0;
96
-    case FF_P_TYPE: return v->p_frame_skipped ? 4 : 1;
97
-    case FF_B_TYPE: return v->bi_type         ? 3 : 2;
95
+    case AV_PICTURE_TYPE_I: return 0;
96
+    case AV_PICTURE_TYPE_P: return v->p_frame_skipped ? 4 : 1;
97
+    case AV_PICTURE_TYPE_B: return v->bi_type         ? 3 : 2;
98 98
     }
99 99
     return 0;
100 100
 }
... ...
@@ -102,8 +102,8 @@ static int vc1_get_PTYPE(VC1Context *v)
102 102
 /** Reconstruct bitstream MVMODE (7.1.1.32) */
103 103
 static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v)
104 104
 {
105
-    if (v->s.pict_type == FF_P_TYPE ||
106
-        (v->s.pict_type == FF_B_TYPE && !v->bi_type))
105
+    if (v->s.pict_type == AV_PICTURE_TYPE_P ||
106
+        (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type))
107 107
         return get_VAMvModeVC1(v->mv_mode);
108 108
     return 0;
109 109
 }
... ...
@@ -111,7 +111,7 @@ static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v)
111 111
 /** Reconstruct bitstream MVMODE2 (7.1.1.33) */
112 112
 static inline VAMvModeVC1 vc1_get_MVMODE2(VC1Context *v)
113 113
 {
114
-    if (v->s.pict_type == FF_P_TYPE && v->mv_mode == MV_PMODE_INTENSITY_COMP)
114
+    if (v->s.pict_type == AV_PICTURE_TYPE_P && v->mv_mode == MV_PMODE_INTENSITY_COMP)
115 115
         return get_VAMvModeVC1(v->mv_mode2);
116 116
     return 0;
117 117
 }
... ...
@@ -245,10 +245,10 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
245 245
     pic_param->transform_fields.bits.intra_transform_dc_table       = v->s.dc_table_index;
246 246
 
247 247
     switch (s->pict_type) {
248
-    case FF_B_TYPE:
248
+    case AV_PICTURE_TYPE_B:
249 249
         pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
250 250
         // fall-through
251
-    case FF_P_TYPE:
251
+    case AV_PICTURE_TYPE_P:
252 252
         pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
253 253
         break;
254 254
     }
... ...
@@ -259,12 +259,12 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
259 259
         int x, y, n;
260 260
 
261 261
         switch (s->pict_type) {
262
-        case FF_P_TYPE:
262
+        case AV_PICTURE_TYPE_P:
263 263
             ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb  ? v->direct_mb_plane    : NULL;
264 264
             ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb    ? s->mbskip_table       : NULL;
265 265
             ff_bp[2] = pic_param->bitplane_present.flags.bp_mv_type_mb ? v->mv_type_mb_plane   : NULL;
266 266
             break;
267
-        case FF_B_TYPE:
267
+        case AV_PICTURE_TYPE_B:
268 268
             if (!v->bi_type) {
269 269
                 ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL;
270 270
                 ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb   ? s->mbskip_table    : NULL;
... ...
@@ -272,7 +272,7 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
272 272
                 break;
273 273
             }
274 274
             /* fall-through (BI-type) */
275
-        case FF_I_TYPE:
275
+        case AV_PICTURE_TYPE_I:
276 276
             ff_bp[0] = NULL; /* XXX: interlaced frame (FIELDTX plane) */
277 277
             ff_bp[1] = pic_param->bitplane_present.flags.bp_ac_pred    ? v->acpred_plane       : NULL;
278 278
             ff_bp[2] = pic_param->bitplane_present.flags.bp_overflags  ? v->over_flags_plane   : NULL;
... ...
@@ -612,29 +612,29 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
612 612
     v->s.pict_type = get_bits1(gb);
613 613
     if (v->s.avctx->max_b_frames) {
614 614
         if (!v->s.pict_type) {
615
-            if (get_bits1(gb)) v->s.pict_type = FF_I_TYPE;
616
-            else v->s.pict_type = FF_B_TYPE;
617
-        } else v->s.pict_type = FF_P_TYPE;
618
-    } else v->s.pict_type = v->s.pict_type ? FF_P_TYPE : FF_I_TYPE;
615
+            if (get_bits1(gb)) v->s.pict_type = AV_PICTURE_TYPE_I;
616
+            else v->s.pict_type = AV_PICTURE_TYPE_B;
617
+        } else v->s.pict_type = AV_PICTURE_TYPE_P;
618
+    } else v->s.pict_type = v->s.pict_type ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
619 619
 
620 620
     v->bi_type = 0;
621
-    if(v->s.pict_type == FF_B_TYPE) {
621
+    if(v->s.pict_type == AV_PICTURE_TYPE_B) {
622 622
         v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
623 623
         v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index];
624 624
         if(v->bfraction == 0) {
625
-            v->s.pict_type = FF_BI_TYPE;
625
+            v->s.pict_type = AV_PICTURE_TYPE_BI;
626 626
         }
627 627
     }
628
-    if(v->s.pict_type == FF_I_TYPE || v->s.pict_type == FF_BI_TYPE)
628
+    if(v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)
629 629
         skip_bits(gb, 7); // skip buffer fullness
630 630
 
631 631
     if(v->parse_only)
632 632
         return 0;
633 633
 
634 634
     /* calculate RND */
635
-    if(v->s.pict_type == FF_I_TYPE || v->s.pict_type == FF_BI_TYPE)
635
+    if(v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)
636 636
         v->rnd = 1;
637
-    if(v->s.pict_type == FF_P_TYPE)
637
+    if(v->s.pict_type == AV_PICTURE_TYPE_P)
638 638
         v->rnd ^= 1;
639 639
 
640 640
     /* Quantizer stuff */
... ...
@@ -661,18 +661,18 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
661 661
     v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11
662 662
     v->range_x = 1 << (v->k_x - 1);
663 663
     v->range_y = 1 << (v->k_y - 1);
664
-    if (v->multires && v->s.pict_type != FF_B_TYPE) v->respic = get_bits(gb, 2);
664
+    if (v->multires && v->s.pict_type != AV_PICTURE_TYPE_B) v->respic = get_bits(gb, 2);
665 665
 
666
-    if(v->res_x8 && (v->s.pict_type == FF_I_TYPE || v->s.pict_type == FF_BI_TYPE)){
666
+    if(v->res_x8 && (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)){
667 667
         v->x8_type = get_bits1(gb);
668 668
     }else v->x8_type = 0;
669 669
 //av_log(v->s.avctx, AV_LOG_INFO, "%c Frame: QP=[%i]%i (+%i/2) %i\n",
670
-//        (v->s.pict_type == FF_P_TYPE) ? 'P' : ((v->s.pict_type == FF_I_TYPE) ? 'I' : 'B'), pqindex, v->pq, v->halfpq, v->rangeredfrm);
670
+//        (v->s.pict_type == AV_PICTURE_TYPE_P) ? 'P' : ((v->s.pict_type == AV_PICTURE_TYPE_I) ? 'I' : 'B'), pqindex, v->pq, v->halfpq, v->rangeredfrm);
671 671
 
672
-    if(v->s.pict_type == FF_I_TYPE || v->s.pict_type == FF_P_TYPE) v->use_ic = 0;
672
+    if(v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_P) v->use_ic = 0;
673 673
 
674 674
     switch(v->s.pict_type) {
675
-    case FF_P_TYPE:
675
+    case AV_PICTURE_TYPE_P:
676 676
         if (v->pq < 5) v->tt_index = 0;
677 677
         else if(v->pq < 13) v->tt_index = 1;
678 678
         else v->tt_index = 2;
... ...
@@ -755,7 +755,7 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
755 755
             v->ttfrm = TT_8X8;
756 756
         }
757 757
         break;
758
-    case FF_B_TYPE:
758
+    case AV_PICTURE_TYPE_B:
759 759
         if (v->pq < 5) v->tt_index = 0;
760 760
         else if(v->pq < 13) v->tt_index = 1;
761 761
         else v->tt_index = 2;
... ...
@@ -801,7 +801,7 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
801 801
     {
802 802
         /* AC Syntax */
803 803
         v->c_ac_table_index = decode012(gb);
804
-        if (v->s.pict_type == FF_I_TYPE || v->s.pict_type == FF_BI_TYPE)
804
+        if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)
805 805
         {
806 806
             v->y_ac_table_index = decode012(gb);
807 807
         }
... ...
@@ -809,8 +809,8 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb)
809 809
         v->s.dc_table_index = get_bits1(gb);
810 810
     }
811 811
 
812
-    if(v->s.pict_type == FF_BI_TYPE) {
813
-        v->s.pict_type = FF_B_TYPE;
812
+    if(v->s.pict_type == AV_PICTURE_TYPE_BI) {
813
+        v->s.pict_type = AV_PICTURE_TYPE_B;
814 814
         v->bi_type = 1;
815 815
     }
816 816
     return 0;
... ...
@@ -833,19 +833,19 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
833 833
     }
834 834
     switch(get_unary(gb, 0, 4)) {
835 835
     case 0:
836
-        v->s.pict_type = FF_P_TYPE;
836
+        v->s.pict_type = AV_PICTURE_TYPE_P;
837 837
         break;
838 838
     case 1:
839
-        v->s.pict_type = FF_B_TYPE;
839
+        v->s.pict_type = AV_PICTURE_TYPE_B;
840 840
         break;
841 841
     case 2:
842
-        v->s.pict_type = FF_I_TYPE;
842
+        v->s.pict_type = AV_PICTURE_TYPE_I;
843 843
         break;
844 844
     case 3:
845
-        v->s.pict_type = FF_BI_TYPE;
845
+        v->s.pict_type = AV_PICTURE_TYPE_BI;
846 846
         break;
847 847
     case 4:
848
-        v->s.pict_type = FF_P_TYPE; // skipped pic
848
+        v->s.pict_type = AV_PICTURE_TYPE_P; // skipped pic
849 849
         v->p_frame_skipped = 1;
850 850
         return 0;
851 851
     }
... ...
@@ -867,11 +867,11 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
867 867
     if(v->interlace)
868 868
         v->uvsamp = get_bits1(gb);
869 869
     if(v->finterpflag) v->interpfrm = get_bits1(gb);
870
-    if(v->s.pict_type == FF_B_TYPE) {
870
+    if(v->s.pict_type == AV_PICTURE_TYPE_B) {
871 871
         v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1);
872 872
         v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index];
873 873
         if(v->bfraction == 0) {
874
-            v->s.pict_type = FF_BI_TYPE; /* XXX: should not happen here */
874
+            v->s.pict_type = AV_PICTURE_TYPE_BI; /* XXX: should not happen here */
875 875
         }
876 876
     }
877 877
     pqindex = get_bits(gb, 5);
... ...
@@ -895,14 +895,14 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
895 895
     if(v->postprocflag)
896 896
         v->postproc = get_bits(gb, 2);
897 897
 
898
-    if(v->s.pict_type == FF_I_TYPE || v->s.pict_type == FF_P_TYPE) v->use_ic = 0;
898
+    if(v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_P) v->use_ic = 0;
899 899
 
900 900
     if(v->parse_only)
901 901
         return 0;
902 902
 
903 903
     switch(v->s.pict_type) {
904
-    case FF_I_TYPE:
905
-    case FF_BI_TYPE:
904
+    case AV_PICTURE_TYPE_I:
905
+    case AV_PICTURE_TYPE_BI:
906 906
         status = bitplane_decoding(v->acpred_plane, &v->acpred_is_raw, v);
907 907
         if (status < 0) return -1;
908 908
         av_log(v->s.avctx, AV_LOG_DEBUG, "ACPRED plane encoding: "
... ...
@@ -918,7 +918,7 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
918 918
             }
919 919
         }
920 920
         break;
921
-    case FF_P_TYPE:
921
+    case AV_PICTURE_TYPE_P:
922 922
         if (v->extended_mv) v->mvrange = get_unary(gb, 0, 3);
923 923
         else v->mvrange = 0;
924 924
         v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
... ...
@@ -1007,7 +1007,7 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
1007 1007
             v->ttfrm = TT_8X8;
1008 1008
         }
1009 1009
         break;
1010
-    case FF_B_TYPE:
1010
+    case AV_PICTURE_TYPE_B:
1011 1011
         if (v->extended_mv) v->mvrange = get_unary(gb, 0, 3);
1012 1012
         else v->mvrange = 0;
1013 1013
         v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13
... ...
@@ -1058,20 +1058,20 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
1058 1058
 
1059 1059
     /* AC Syntax */
1060 1060
     v->c_ac_table_index = decode012(gb);
1061
-    if (v->s.pict_type == FF_I_TYPE || v->s.pict_type == FF_BI_TYPE)
1061
+    if (v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI)
1062 1062
     {
1063 1063
         v->y_ac_table_index = decode012(gb);
1064 1064
     }
1065 1065
     /* DC Syntax */
1066 1066
     v->s.dc_table_index = get_bits1(gb);
1067
-    if ((v->s.pict_type == FF_I_TYPE || v->s.pict_type == FF_BI_TYPE) && v->dquant) {
1067
+    if ((v->s.pict_type == AV_PICTURE_TYPE_I || v->s.pict_type == AV_PICTURE_TYPE_BI) && v->dquant) {
1068 1068
         av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n");
1069 1069
         vop_dquant_decoding(v);
1070 1070
     }
1071 1071
 
1072 1072
     v->bi_type = 0;
1073
-    if(v->s.pict_type == FF_BI_TYPE) {
1074
-        v->s.pict_type = FF_B_TYPE;
1073
+    if(v->s.pict_type == AV_PICTURE_TYPE_BI) {
1074
+        v->s.pict_type = AV_PICTURE_TYPE_B;
1075 1075
         v->bi_type = 1;
1076 1076
     }
1077 1077
     return 0;
... ...
@@ -67,9 +67,9 @@ static void vc1_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx,
67 67
             else
68 68
                 vc1_parse_frame_header_adv(&vpc->v, &gb);
69 69
 
70
-            /* keep FF_BI_TYPE internal to VC1 */
71
-            if (vpc->v.s.pict_type == FF_BI_TYPE)
72
-                s->pict_type = FF_B_TYPE;
70
+            /* keep AV_PICTURE_TYPE_BI internal to VC1 */
71
+            if (vpc->v.s.pict_type == AV_PICTURE_TYPE_BI)
72
+                s->pict_type = AV_PICTURE_TYPE_B;
73 73
             else
74 74
                 s->pict_type = vpc->v.s.pict_type;
75 75
 
... ...
@@ -203,7 +203,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
203 203
     my = s->mv[dir][0][1];
204 204
 
205 205
     // store motion vectors for further use in B frames
206
-    if(s->pict_type == FF_P_TYPE) {
206
+    if(s->pict_type == AV_PICTURE_TYPE_P) {
207 207
         s->current_picture.motion_val[1][s->block_index[0]][0] = mx;
208 208
         s->current_picture.motion_val[1][s->block_index[0]][1] = my;
209 209
     }
... ...
@@ -3061,7 +3061,7 @@ static void vc1_decode_skip_blocks(VC1Context *v)
3061 3061
         ff_draw_horiz_band(s, s->mb_y * 16, 16);
3062 3062
         s->first_slice_line = 0;
3063 3063
     }
3064
-    s->pict_type = FF_P_TYPE;
3064
+    s->pict_type = AV_PICTURE_TYPE_P;
3065 3065
 }
3066 3066
 
3067 3067
 static void vc1_decode_blocks(VC1Context *v, int mby_start, int mby_end)
... ...
@@ -3072,19 +3072,19 @@ static void vc1_decode_blocks(VC1Context *v, int mby_start, int mby_end)
3072 3072
         ff_intrax8_decode_picture(&v->x8, 2*v->pq+v->halfpq, v->pq*(!v->pquantizer) );
3073 3073
     }else{
3074 3074
         switch(v->s.pict_type) {
3075
-        case FF_I_TYPE:
3075
+        case AV_PICTURE_TYPE_I:
3076 3076
             if(v->profile == PROFILE_ADVANCED)
3077 3077
                 vc1_decode_i_blocks_adv(v, mby_start, mby_end);
3078 3078
             else
3079 3079
                 vc1_decode_i_blocks(v);
3080 3080
             break;
3081
-        case FF_P_TYPE:
3081
+        case AV_PICTURE_TYPE_P:
3082 3082
             if(v->p_frame_skipped)
3083 3083
                 vc1_decode_skip_blocks(v);
3084 3084
             else
3085 3085
                 vc1_decode_p_blocks(v, mby_start, mby_end);
3086 3086
             break;
3087
-        case FF_B_TYPE:
3087
+        case AV_PICTURE_TYPE_B:
3088 3088
             if(v->bi_type){
3089 3089
                 if(v->profile == PROFILE_ADVANCED)
3090 3090
                     vc1_decode_i_blocks_adv(v, mby_start, mby_end);
... ...
@@ -3498,26 +3498,26 @@ static int vc1_decode_frame(AVCodecContext *avctx,
3498 3498
         }
3499 3499
     }
3500 3500
 
3501
-    if (v->res_sprite && s->pict_type!=FF_I_TYPE) {
3501
+    if (v->res_sprite && s->pict_type!=AV_PICTURE_TYPE_I) {
3502 3502
         av_log(v->s.avctx, AV_LOG_WARNING, "Sprite decoder: expected I-frame\n");
3503 3503
     }
3504 3504
 
3505 3505
     // for skipping the frame
3506 3506
     s->current_picture.pict_type= s->pict_type;
3507
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
3507
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
3508 3508
 
3509 3509
     /* skip B-frames if we don't have reference frames */
3510
-    if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)){
3510
+    if(s->last_picture_ptr==NULL && (s->pict_type==AV_PICTURE_TYPE_B || s->dropable)){
3511 3511
         goto err;
3512 3512
     }
3513
-    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
3514
-       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
3513
+    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
3514
+       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
3515 3515
        ||  avctx->skip_frame >= AVDISCARD_ALL) {
3516 3516
         goto end;
3517 3517
     }
3518 3518
 
3519 3519
     if(s->next_p_frame_damaged){
3520
-        if(s->pict_type==FF_B_TYPE)
3520
+        if(s->pict_type==AV_PICTURE_TYPE_B)
3521 3521
             goto end;
3522 3522
         else
3523 3523
             s->next_p_frame_damaged=0;
... ...
@@ -3561,7 +3561,7 @@ static int vc1_decode_frame(AVCodecContext *avctx,
3561 3561
 
3562 3562
 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
3563 3563
 assert(s->current_picture.pict_type == s->pict_type);
3564
-    if (s->pict_type == FF_B_TYPE || s->low_delay) {
3564
+    if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
3565 3565
         *pict= *(AVFrame*)s->current_picture_ptr;
3566 3566
     } else if (s->last_picture_ptr != NULL) {
3567 3567
         *pict= *(AVFrame*)s->last_picture_ptr;
... ...
@@ -61,7 +61,7 @@ static int decode_frame(AVCodecContext *avctx,
61 61
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
62 62
         return -1;
63 63
     }
64
-    p->pict_type= FF_I_TYPE;
64
+    p->pict_type= AV_PICTURE_TYPE_I;
65 65
     p->key_frame= 1;
66 66
 
67 67
     for(i=0; i<16; i++){
... ...
@@ -127,7 +127,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
127 127
     int size;
128 128
 
129 129
     *p = *pict;
130
-    p->pict_type= FF_I_TYPE;
130
+    p->pict_type= AV_PICTURE_TYPE_I;
131 131
     p->key_frame= 1;
132 132
 
133 133
     emms_c();
... ...
@@ -225,12 +225,12 @@ void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
225 225
     render->info.mpeg.backward_reference         = VDP_INVALID_HANDLE;
226 226
 
227 227
     switch(s->pict_type){
228
-    case  FF_B_TYPE:
228
+    case  AV_PICTURE_TYPE_B:
229 229
         next = (struct vdpau_render_state *)s->next_picture.data[0];
230 230
         assert(next);
231 231
         render->info.mpeg.backward_reference     = next->surface;
232 232
         // no return here, going to set forward prediction
233
-    case  FF_P_TYPE:
233
+    case  AV_PICTURE_TYPE_P:
234 234
         last = (struct vdpau_render_state *)s->last_picture.data[0];
235 235
         if (!last) // FIXME: Does this test make sense?
236 236
             last = render; // predict second field from the first
... ...
@@ -295,12 +295,12 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
295 295
         render->info.vc1.picture_type = s->pict_type - 1 + s->pict_type / 3;
296 296
 
297 297
     switch(s->pict_type){
298
-    case  FF_B_TYPE:
298
+    case  AV_PICTURE_TYPE_B:
299 299
         next = (struct vdpau_render_state *)s->next_picture.data[0];
300 300
         assert(next);
301 301
         render->info.vc1.backward_reference = next->surface;
302 302
         // no break here, going to set forward prediction
303
-    case  FF_P_TYPE:
303
+    case  AV_PICTURE_TYPE_P:
304 304
         last = (struct vdpau_render_state *)s->last_picture.data[0];
305 305
         if (!last) // FIXME: Does this test make sense?
306 306
             last = render; // predict second field from the first
... ...
@@ -351,13 +351,13 @@ void ff_vdpau_mpeg4_decode_picture(MpegEncContext *s, const uint8_t *buf,
351 351
     render->info.mpeg4.backward_reference                = VDP_INVALID_HANDLE;
352 352
 
353 353
     switch (s->pict_type) {
354
-    case FF_B_TYPE:
354
+    case AV_PICTURE_TYPE_B:
355 355
         next = (struct vdpau_render_state *)s->next_picture.data[0];
356 356
         assert(next);
357 357
         render->info.mpeg4.backward_reference     = next->surface;
358 358
         render->info.mpeg4.vop_coding_type        = 2;
359 359
         // no break here, going to set forward prediction
360
-    case FF_P_TYPE:
360
+    case AV_PICTURE_TYPE_P:
361 361
         last = (struct vdpau_render_state *)s->last_picture.data[0];
362 362
         assert(last);
363 363
         render->info.mpeg4.forward_reference      = last->surface;
... ...
@@ -301,7 +301,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
301 301
     }
302 302
 
303 303
     c->pic.key_frame = 0;
304
-    c->pic.pict_type = FF_P_TYPE;
304
+    c->pic.pict_type = AV_PICTURE_TYPE_P;
305 305
 
306 306
     //restore screen after cursor
307 307
     if(c->screendta) {
... ...
@@ -374,7 +374,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
374 374
             break;
375 375
         case MAGIC_WMVi: // ServerInitialization struct
376 376
             c->pic.key_frame = 1;
377
-            c->pic.pict_type = FF_I_TYPE;
377
+            c->pic.pict_type = AV_PICTURE_TYPE_I;
378 378
             depth = *src++;
379 379
             if(depth != c->bpp) {
380 380
                 av_log(avctx, AV_LOG_INFO, "Depth mismatch. Container %i bpp, Frame data: %i bpp\n", c->bpp, depth);
... ...
@@ -1876,7 +1876,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
1876 1876
         return buf_size;
1877 1877
 
1878 1878
     s->current_frame.reference = 3;
1879
-    s->current_frame.pict_type = s->keyframe ? FF_I_TYPE : FF_P_TYPE;
1879
+    s->current_frame.pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
1880 1880
     if (ff_thread_get_buffer(avctx, &s->current_frame) < 0) {
1881 1881
         av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
1882 1882
         goto error;
... ...
@@ -1908,7 +1908,7 @@ static int vp3_decode_frame(AVCodecContext *avctx,
1908 1908
             av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n");
1909 1909
 
1910 1910
             s->golden_frame.reference = 3;
1911
-            s->golden_frame.pict_type = FF_I_TYPE;
1911
+            s->golden_frame.pict_type = AV_PICTURE_TYPE_I;
1912 1912
             if (ff_thread_get_buffer(avctx, &s->golden_frame) < 0) {
1913 1913
                 av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
1914 1914
                 goto error;
... ...
@@ -26,9 +26,9 @@ static int parse(AVCodecParserContext *s,
26 26
                            const uint8_t *buf, int buf_size)
27 27
 {
28 28
     if(avctx->codec_id == CODEC_ID_THEORA)
29
-        s->pict_type= (buf[0]&0x40) ? FF_P_TYPE : FF_I_TYPE;
29
+        s->pict_type= (buf[0]&0x40) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
30 30
     else
31
-        s->pict_type= (buf[0]&0x80) ? FF_P_TYPE : FF_I_TYPE;
31
+        s->pict_type= (buf[0]&0x80) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
32 32
 
33 33
     *poutbuf = buf;
34 34
     *poutbuf_size = buf_size;
... ...
@@ -526,12 +526,12 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
526 526
         }
527 527
 
528 528
         if (p->key_frame) {
529
-            p->pict_type = FF_I_TYPE;
529
+            p->pict_type = AV_PICTURE_TYPE_I;
530 530
             s->default_models_init(s);
531 531
             for (block=0; block<s->mb_height*s->mb_width; block++)
532 532
                 s->macroblocks[block].type = VP56_MB_INTRA;
533 533
         } else {
534
-            p->pict_type = FF_P_TYPE;
534
+            p->pict_type = AV_PICTURE_TYPE_P;
535 535
             vp56_parse_mb_type_models(s);
536 536
             s->parse_vector_models(s);
537 537
             s->mb_type = VP56_MB_INTER_NOVEC_PF;
... ...
@@ -1493,7 +1493,7 @@ static int vp8_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
1493 1493
         avctx->release_buffer(avctx, curframe);
1494 1494
 
1495 1495
     curframe->key_frame = s->keyframe;
1496
-    curframe->pict_type = s->keyframe ? FF_I_TYPE : FF_P_TYPE;
1496
+    curframe->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
1497 1497
     curframe->reference = referenced ? 3 : 0;
1498 1498
     if ((ret = avctx->get_buffer(avctx, curframe))) {
1499 1499
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed!\n");
... ...
@@ -25,7 +25,7 @@ static int parse(AVCodecParserContext *s,
25 25
                            const uint8_t **poutbuf, int *poutbuf_size,
26 26
                            const uint8_t *buf, int buf_size)
27 27
 {
28
-    s->pict_type= (buf[0]&0x01) ? FF_P_TYPE : FF_I_TYPE;
28
+    s->pict_type= (buf[0]&0x01) ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
29 29
 
30 30
     *poutbuf = buf;
31 31
     *poutbuf_size = buf_size;
... ...
@@ -120,7 +120,7 @@ int ff_wmv2_decode_picture_header(MpegEncContext * s)
120 120
         decode_ext_header(w);
121 121
 
122 122
     s->pict_type = get_bits1(&s->gb) + 1;
123
-    if(s->pict_type == FF_I_TYPE){
123
+    if(s->pict_type == AV_PICTURE_TYPE_I){
124 124
         code = get_bits(&s->gb, 7);
125 125
         av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code);
126 126
     }
... ...
@@ -135,7 +135,7 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s)
135 135
 {
136 136
     Wmv2Context * const w= (Wmv2Context*)s;
137 137
 
138
-    if (s->pict_type == FF_I_TYPE) {
138
+    if (s->pict_type == AV_PICTURE_TYPE_I) {
139 139
         if(w->j_type_bit) w->j_type= get_bits1(&s->gb);
140 140
         else              w->j_type= 0; //FIXME check
141 141
 
... ...
@@ -342,7 +342,7 @@ int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
342 342
 
343 343
     if(w->j_type) return 0;
344 344
 
345
-    if (s->pict_type == FF_P_TYPE) {
345
+    if (s->pict_type == AV_PICTURE_TYPE_P) {
346 346
         if(IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])){
347 347
             /* skip mb */
348 348
             s->mb_intra = 0;
... ...
@@ -419,7 +419,7 @@ int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
419 419
             }
420 420
         }
421 421
     } else {
422
-//if(s->pict_type==FF_P_TYPE)
422
+//if(s->pict_type==AV_PICTURE_TYPE_P)
423 423
 //   printf("%d%d ", s->inter_intra_pred, cbp);
424 424
 //printf("I at %d %d %d %06X\n", s->mb_x, s->mb_y, ((cbp&3)? 1 : 0) +((cbp&0x3C)? 2 : 0), show_bits(&s->gb, 24));
425 425
         s->ac_pred = get_bits1(&s->gb);
... ...
@@ -72,7 +72,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number)
72 72
     Wmv2Context * const w= (Wmv2Context*)s;
73 73
 
74 74
     put_bits(&s->pb, 1, s->pict_type - 1);
75
-    if(s->pict_type == FF_I_TYPE){
75
+    if(s->pict_type == AV_PICTURE_TYPE_I){
76 76
         put_bits(&s->pb, 7, 0);
77 77
     }
78 78
     put_bits(&s->pb, 5, s->qscale);
... ...
@@ -87,7 +87,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number)
87 87
 
88 88
     assert(s->flipflop_rounding);
89 89
 
90
-    if (s->pict_type == FF_I_TYPE) {
90
+    if (s->pict_type == AV_PICTURE_TYPE_I) {
91 91
         assert(s->no_rounding==1);
92 92
         if(w->j_type_bit) put_bits(&s->pb, 1, w->j_type);
93 93
 
... ...
@@ -191,7 +191,7 @@ void ff_wmv2_encode_mb(MpegEncContext * s,
191 191
             coded_cbp |= val << (5 - i);
192 192
         }
193 193
 
194
-        if (s->pict_type == FF_I_TYPE) {
194
+        if (s->pict_type == AV_PICTURE_TYPE_I) {
195 195
             put_bits(&s->pb,
196 196
                      ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
197 197
         } else {
... ...
@@ -60,7 +60,7 @@ static int decode_frame(AVCodecContext *avctx,
60 60
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
61 61
         return -1;
62 62
     }
63
-    p->pict_type= FF_I_TYPE;
63
+    p->pict_type= AV_PICTURE_TYPE_I;
64 64
     p->key_frame= 1;
65 65
 
66 66
     Y = a->pic.data[0];
... ...
@@ -500,11 +500,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
500 500
     }
501 501
     if(c->flags & ZMBV_KEYFRAME) {
502 502
         c->pic.key_frame = 1;
503
-        c->pic.pict_type = FF_I_TYPE;
503
+        c->pic.pict_type = AV_PICTURE_TYPE_I;
504 504
         c->decode_intra(c);
505 505
     } else {
506 506
         c->pic.key_frame = 0;
507
-        c->pic.pict_type = FF_P_TYPE;
507
+        c->pic.pict_type = AV_PICTURE_TYPE_P;
508 508
         if(c->decomp_len)
509 509
             c->decode_xor(c);
510 510
     }
... ...
@@ -134,7 +134,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void
134 134
     if(c->curfrm == c->keyint)
135 135
         c->curfrm = 0;
136 136
     *p = *pict;
137
-    p->pict_type= keyframe ? FF_I_TYPE : FF_P_TYPE;
137
+    p->pict_type= keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
138 138
     p->key_frame= keyframe;
139 139
     chpal = !keyframe && memcmp(p->data[1], c->pal2, 1024);
140 140
 
... ...
@@ -834,10 +834,10 @@ static int gxf_write_media_preamble(AVFormatContext *s, AVPacket *pkt, int size)
834 834
         avio_wb16(pb, size / 2);
835 835
     } else if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO) {
836 836
         int frame_type = gxf_parse_mpeg_frame(sc, pkt->data, pkt->size);
837
-        if (frame_type == FF_I_TYPE) {
837
+        if (frame_type == AV_PICTURE_TYPE_I) {
838 838
             avio_w8(pb, 0x0d);
839 839
             sc->iframes++;
840
-        } else if (frame_type == FF_B_TYPE) {
840
+        } else if (frame_type == AV_PICTURE_TYPE_B) {
841 841
             avio_w8(pb, 0x0f);
842 842
             sc->bframes++;
843 843
         } else {
... ...
@@ -868,7 +868,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
868 868
     if((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE)
869 869
         pkt->dts= AV_NOPTS_VALUE;
870 870
 
871
-    if (st->codec->codec_id != CODEC_ID_H264 && pc && pc->pict_type == FF_B_TYPE)
871
+    if (st->codec->codec_id != CODEC_ID_H264 && pc && pc->pict_type == AV_PICTURE_TYPE_B)
872 872
         //FIXME Set low_delay = 0 when has_b_frames = 1
873 873
         st->codec->has_b_frames = 1;
874 874
 
... ...
@@ -884,7 +884,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
884 884
     /* XXX: need has_b_frame, but cannot get it if the codec is
885 885
         not initialized */
886 886
     if (delay &&
887
-        pc && pc->pict_type != FF_B_TYPE)
887
+        pc && pc->pict_type != AV_PICTURE_TYPE_B)
888 888
         presentation_delayed = 1;
889 889
 
890 890
     if(pkt->pts != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE && pkt->dts > pkt->pts && st->pts_wrap_bits<63
... ...
@@ -1012,7 +1012,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
1012 1012
         /* keyframe computation */
1013 1013
         if (pc->key_frame == 1)
1014 1014
             pkt->flags |= AV_PKT_FLAG_KEY;
1015
-        else if (pc->key_frame == -1 && pc->pict_type == FF_I_TYPE)
1015
+        else if (pc->key_frame == -1 && pc->pict_type == AV_PICTURE_TYPE_I)
1016 1016
             pkt->flags |= AV_PKT_FLAG_KEY;
1017 1017
     }
1018 1018
     if (pc)