Browse code

replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*

Stefano Sabatini authored on 2011/04/28 08:40:44
Showing 138 changed files
... ...
@@ -1270,7 +1270,7 @@ static void do_video_out(AVFormatContext *s,
1270 1270
 //av_log(NULL, AV_LOG_DEBUG, "%"PRId64" -> encoder\n", ost->sync_opts);
1271 1271
             if (ost->forced_kf_index < ost->forced_kf_count &&
1272 1272
                 big_picture.pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
1273
-                big_picture.pict_type = FF_I_TYPE;
1273
+                big_picture.pict_type = AV_PICTURE_TYPE_I;
1274 1274
                 ost->forced_kf_index++;
1275 1275
             }
1276 1276
             ret = avcodec_encode_video(enc,
... ...
@@ -780,11 +780,11 @@ static int decode_frame(AVCodecContext *avctx,
780 780
     }
781 781
 
782 782
     if(frame_4cc == AV_RL32("ifr2")){
783
-        p->pict_type= FF_I_TYPE;
783
+        p->pict_type= AV_PICTURE_TYPE_I;
784 784
         if(decode_i2_frame(f, buf-4, frame_size) < 0)
785 785
             return -1;
786 786
     }else if(frame_4cc == AV_RL32("ifrm")){
787
-        p->pict_type= FF_I_TYPE;
787
+        p->pict_type= AV_PICTURE_TYPE_I;
788 788
         if(decode_i_frame(f, buf, frame_size) < 0)
789 789
             return -1;
790 790
     }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){
... ...
@@ -796,7 +796,7 @@ static int decode_frame(AVCodecContext *avctx,
796 796
             }
797 797
         }
798 798
 
799
-        p->pict_type= FF_P_TYPE;
799
+        p->pict_type= AV_PICTURE_TYPE_P;
800 800
         if(decode_p_frame(f, buf, frame_size) < 0)
801 801
             return -1;
802 802
     }else if(frame_4cc == AV_RL32("snd_")){
... ...
@@ -805,7 +805,7 @@ static int decode_frame(AVCodecContext *avctx,
805 805
         av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n", buf_size);
806 806
     }
807 807
 
808
-    p->key_frame= p->pict_type == FF_I_TYPE;
808
+    p->key_frame= p->pict_type == AV_PICTURE_TYPE_I;
809 809
 
810 810
     *picture= *p;
811 811
     *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++){
... ...
@@ -3920,7 +3920,7 @@ typedef struct AVCodecParserContext {
3920 3920
     /*!
3921 3921
      * Set by parser to 1 for key frames and 0 for non-key frames.
3922 3922
      * It is initialized to -1, so if the parser doesn't set this flag,
3923
-     * old-style fallback using FF_I_TYPE picture type as key frames
3923
+     * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
3924 3924
      * will be used.
3925 3925
      */
3926 3926
     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;
... ...
@@ -69,7 +69,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
69 69
 
70 70
     /* Set frame parameters and palette, if necessary */
71 71
     if (!avctx->frame_number) {
72
-        bfi->frame.pict_type = FF_I_TYPE;
72
+        bfi->frame.pict_type = AV_PICTURE_TYPE_I;
73 73
         bfi->frame.key_frame = 1;
74 74
         /* Setting the palette */
75 75
         if(avctx->extradata_size>768) {
... ...
@@ -89,7 +89,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data,
89 89
         memcpy(bfi->pal, bfi->frame.data[1], sizeof(bfi->pal));
90 90
         bfi->frame.palette_has_changed = 1;
91 91
     } else {
92
-        bfi->frame.pict_type = FF_P_TYPE;
92
+        bfi->frame.pict_type = AV_PICTURE_TYPE_P;
93 93
         bfi->frame.key_frame = 0;
94 94
         bfi->frame.palette_has_changed = 0;
95 95
         memcpy(bfi->frame.data[1], bfi->pal, sizeof(bfi->pal));
... ...
@@ -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) {
... ...
@@ -35,7 +35,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
35 35
     DPXContext *s = avctx->priv_data;
36 36
 
37 37
     avctx->coded_frame = &s->picture;
38
-    avctx->coded_frame->pict_type = FF_I_TYPE;
38
+    avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
39 39
     avctx->coded_frame->key_frame = 1;
40 40
 
41 41
     s->big_endian         = 1;
... ...
@@ -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 FFmpeg */
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
 
... ...
@@ -977,7 +977,7 @@ void ff_er_frame_end(MpegEncContext *s){
977 977
     }
978 978
 
979 979
     /* guess MVs */
980
-    if(s->pict_type==FF_B_TYPE){
980
+    if(s->pict_type==AV_PICTURE_TYPE_B){
981 981
         for(mb_y=0; mb_y<s->mb_height; mb_y++){
982 982
             for(mb_x=0; mb_x<s->mb_width; mb_x++){
983 983
                 int xy= mb_x*2 + mb_y*2*s->b8_stride;
... ...
@@ -1114,7 +1114,7 @@ ec_clean:
1114 1114
         const int mb_xy= s->mb_index2xy[i];
1115 1115
         int error= s->error_status_table[mb_xy];
1116 1116
 
1117
-        if(s->pict_type!=FF_B_TYPE && (error&(DC_ERROR|MV_ERROR|AC_ERROR))){
1117
+        if(s->pict_type!=AV_PICTURE_TYPE_B && (error&(DC_ERROR|MV_ERROR|AC_ERROR))){
1118 1118
             s->mbskip_table[mb_xy]=0;
1119 1119
         }
1120 1120
         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");
... ...
@@ -297,11 +297,11 @@ static int decode_frame(AVCodecContext *avctx,
297 297
         }
298 298
         /* skip frame */
299 299
         if(buf_size == 8) {
300
-            f->pict_type = FF_P_TYPE;
300
+            f->pict_type = AV_PICTURE_TYPE_P;
301 301
             f->key_frame = 0;
302 302
             break;
303 303
         }
304
-        f->pict_type = FF_I_TYPE;
304
+        f->pict_type = AV_PICTURE_TYPE_I;
305 305
         f->key_frame = 1;
306 306
         if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) {
307 307
             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
... ...
@@ -218,7 +218,7 @@ static int decode_slice(MpegEncContext *s){
218 218
 //printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24));
219 219
             ret= s->decode_mb(s, s->block);
220 220
 
221
-            if (s->pict_type!=FF_B_TYPE)
221
+            if (s->pict_type!=AV_PICTURE_TYPE_B)
222 222
                 ff_h263_update_motion_val(s);
223 223
 
224 224
             if(ret<0){
... ...
@@ -310,7 +310,7 @@ static int decode_slice(MpegEncContext *s){
310 310
         int max_extra=7;
311 311
 
312 312
         /* no markers in M$ crap */
313
-        if(s->msmpeg4_version && s->pict_type==FF_I_TYPE)
313
+        if(s->msmpeg4_version && s->pict_type==AV_PICTURE_TYPE_I)
314 314
             max_extra+= 17;
315 315
 
316 316
         /* buggy padding but the frame should still end approximately at the bitstream end */
... ...
@@ -600,26 +600,26 @@ retry:
600 600
 
601 601
     // for skipping the frame
602 602
     s->current_picture.pict_type= s->pict_type;
603
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
603
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
604 604
 
605 605
     /* skip B-frames if we don't have reference frames */
606
-    if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size);
607
-    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
608
-       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
606
+    if(s->last_picture_ptr==NULL && (s->pict_type==AV_PICTURE_TYPE_B || s->dropable)) return get_consumed_bytes(s, buf_size);
607
+    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
608
+       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
609 609
        ||  avctx->skip_frame >= AVDISCARD_ALL)
610 610
         return get_consumed_bytes(s, buf_size);
611 611
 
612 612
     if(s->next_p_frame_damaged){
613
-        if(s->pict_type==FF_B_TYPE)
613
+        if(s->pict_type==AV_PICTURE_TYPE_B)
614 614
             return get_consumed_bytes(s, buf_size);
615 615
         else
616 616
             s->next_p_frame_damaged=0;
617 617
     }
618 618
 
619
-    if((s->avctx->flags2 & CODEC_FLAG2_FAST) && s->pict_type==FF_B_TYPE){
619
+    if((s->avctx->flags2 & CODEC_FLAG2_FAST) && s->pict_type==AV_PICTURE_TYPE_B){
620 620
         s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab;
621 621
         s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab;
622
-    }else if((!s->no_rounding) || s->pict_type==FF_B_TYPE){
622
+    }else if((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){
623 623
         s->me.qpel_put= s->dsp.put_qpel_pixels_tab;
624 624
         s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
625 625
     }else{
... ...
@@ -672,7 +672,7 @@ retry:
672 672
         decode_slice(s);
673 673
     }
674 674
 
675
-    if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==FF_I_TYPE)
675
+    if (s->h263_msmpeg4 && s->msmpeg4_version<4 && s->pict_type==AV_PICTURE_TYPE_I)
676 676
         if(!CONFIG_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){
677 677
             s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR;
678 678
         }
... ...
@@ -722,7 +722,7 @@ intrax8_decoded:
722 722
 
723 723
 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
724 724
 assert(s->current_picture.pict_type == s->pict_type);
725
-    if (s->pict_type == FF_B_TYPE || s->low_delay) {
725
+    if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
726 726
         *pict= *(AVFrame*)s->current_picture_ptr;
727 727
     } else if (s->last_picture_ptr != NULL) {
728 728
         *pict= *(AVFrame*)s->last_picture_ptr;
... ...
@@ -918,7 +918,7 @@ static void decode_postinit(H264Context *h){
918 918
     else if((out_of_order && pics-1 == s->avctx->has_b_frames && s->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT)
919 919
        || (s->low_delay &&
920 920
         ((h->next_outputed_poc != INT_MIN && out->poc > h->next_outputed_poc + 2)
921
-         || cur->pict_type == FF_B_TYPE)))
921
+         || cur->pict_type == AV_PICTURE_TYPE_B)))
922 922
     {
923 923
         s->low_delay = 0;
924 924
         s->avctx->has_b_frames++;
... ...
@@ -1449,7 +1449,7 @@ static int pred_weight_table(H264Context *h){
1449 1449
                 }
1450 1450
             }
1451 1451
         }
1452
-        if(h->slice_type_nos != FF_B_TYPE) break;
1452
+        if(h->slice_type_nos != AV_PICTURE_TYPE_B) break;
1453 1453
     }
1454 1454
     h->use_weight= h->use_weight || h->use_weight_chroma;
1455 1455
     return 0;
... ...
@@ -1817,7 +1817,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
1817 1817
         h->slice_type_fixed=0;
1818 1818
 
1819 1819
     slice_type= golomb_to_pict_type[ slice_type ];
1820
-    if (slice_type == FF_I_TYPE
1820
+    if (slice_type == AV_PICTURE_TYPE_I
1821 1821
         || (h0->current_slice != 0 && slice_type == h0->last_slice_type) ) {
1822 1822
         default_ref_list_done = 1;
1823 1823
     }
... ...
@@ -2110,15 +2110,15 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2110 2110
     h->ref_count[0]= h->pps.ref_count[0];
2111 2111
     h->ref_count[1]= h->pps.ref_count[1];
2112 2112
 
2113
-    if(h->slice_type_nos != FF_I_TYPE){
2114
-        if(h->slice_type_nos == FF_B_TYPE){
2113
+    if(h->slice_type_nos != AV_PICTURE_TYPE_I){
2114
+        if(h->slice_type_nos == AV_PICTURE_TYPE_B){
2115 2115
             h->direct_spatial_mv_pred= get_bits1(&s->gb);
2116 2116
         }
2117 2117
         num_ref_idx_active_override_flag= get_bits1(&s->gb);
2118 2118
 
2119 2119
         if(num_ref_idx_active_override_flag){
2120 2120
             h->ref_count[0]= get_ue_golomb(&s->gb) + 1;
2121
-            if(h->slice_type_nos==FF_B_TYPE)
2121
+            if(h->slice_type_nos==AV_PICTURE_TYPE_B)
2122 2122
                 h->ref_count[1]= get_ue_golomb(&s->gb) + 1;
2123 2123
 
2124 2124
             if(h->ref_count[0]-1 > 32-1 || h->ref_count[1]-1 > 32-1){
... ...
@@ -2127,7 +2127,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2127 2127
                 return -1;
2128 2128
             }
2129 2129
         }
2130
-        if(h->slice_type_nos == FF_B_TYPE)
2130
+        if(h->slice_type_nos == AV_PICTURE_TYPE_B)
2131 2131
             h->list_count= 2;
2132 2132
         else
2133 2133
             h->list_count= 1;
... ...
@@ -2138,22 +2138,22 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2138 2138
         ff_h264_fill_default_ref_list(h);
2139 2139
     }
2140 2140
 
2141
-    if(h->slice_type_nos!=FF_I_TYPE && ff_h264_decode_ref_pic_list_reordering(h) < 0)
2141
+    if(h->slice_type_nos!=AV_PICTURE_TYPE_I && ff_h264_decode_ref_pic_list_reordering(h) < 0)
2142 2142
         return -1;
2143 2143
 
2144
-    if(h->slice_type_nos!=FF_I_TYPE){
2144
+    if(h->slice_type_nos!=AV_PICTURE_TYPE_I){
2145 2145
         s->last_picture_ptr= &h->ref_list[0][0];
2146 2146
         ff_copy_picture(&s->last_picture, s->last_picture_ptr);
2147 2147
     }
2148
-    if(h->slice_type_nos==FF_B_TYPE){
2148
+    if(h->slice_type_nos==AV_PICTURE_TYPE_B){
2149 2149
         s->next_picture_ptr= &h->ref_list[1][0];
2150 2150
         ff_copy_picture(&s->next_picture, s->next_picture_ptr);
2151 2151
     }
2152 2152
 
2153
-    if(   (h->pps.weighted_pred          && h->slice_type_nos == FF_P_TYPE )
2154
-       ||  (h->pps.weighted_bipred_idc==1 && h->slice_type_nos== FF_B_TYPE ) )
2153
+    if(   (h->pps.weighted_pred          && h->slice_type_nos == AV_PICTURE_TYPE_P )
2154
+       ||  (h->pps.weighted_bipred_idc==1 && h->slice_type_nos== AV_PICTURE_TYPE_B ) )
2155 2155
         pred_weight_table(h);
2156
-    else if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== FF_B_TYPE){
2156
+    else if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== AV_PICTURE_TYPE_B){
2157 2157
         implicit_weight_table(h, -1);
2158 2158
     }else {
2159 2159
         h->use_weight = 0;
... ...
@@ -2169,17 +2169,17 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2169 2169
     if(FRAME_MBAFF){
2170 2170
         ff_h264_fill_mbaff_ref_list(h);
2171 2171
 
2172
-        if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== FF_B_TYPE){
2172
+        if(h->pps.weighted_bipred_idc==2 && h->slice_type_nos== AV_PICTURE_TYPE_B){
2173 2173
             implicit_weight_table(h, 0);
2174 2174
             implicit_weight_table(h, 1);
2175 2175
         }
2176 2176
     }
2177 2177
 
2178
-    if(h->slice_type_nos==FF_B_TYPE && !h->direct_spatial_mv_pred)
2178
+    if(h->slice_type_nos==AV_PICTURE_TYPE_B && !h->direct_spatial_mv_pred)
2179 2179
         ff_h264_direct_dist_scale_factor(h);
2180 2180
     ff_h264_direct_ref_list_init(h);
2181 2181
 
2182
-    if( h->slice_type_nos != FF_I_TYPE && h->pps.cabac ){
2182
+    if( h->slice_type_nos != AV_PICTURE_TYPE_I && h->pps.cabac ){
2183 2183
         tmp = get_ue_golomb_31(&s->gb);
2184 2184
         if(tmp > 2){
2185 2185
             av_log(s->avctx, AV_LOG_ERROR, "cabac_init_idc overflow\n");
... ...
@@ -2198,10 +2198,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2198 2198
     h->chroma_qp[0] = get_chroma_qp(h, 0, s->qscale);
2199 2199
     h->chroma_qp[1] = get_chroma_qp(h, 1, s->qscale);
2200 2200
     //FIXME qscale / qp ... stuff
2201
-    if(h->slice_type == FF_SP_TYPE){
2201
+    if(h->slice_type == AV_PICTURE_TYPE_SP){
2202 2202
         get_bits1(&s->gb); /* sp_for_switch_flag */
2203 2203
     }
2204
-    if(h->slice_type==FF_SP_TYPE || h->slice_type == FF_SI_TYPE){
2204
+    if(h->slice_type==AV_PICTURE_TYPE_SP || h->slice_type == AV_PICTURE_TYPE_SI){
2205 2205
         get_se_golomb(&s->gb); /* slice_qs_delta */
2206 2206
     }
2207 2207
 
... ...
@@ -2230,8 +2230,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2230 2230
     }
2231 2231
 
2232 2232
     if(   s->avctx->skip_loop_filter >= AVDISCARD_ALL
2233
-       ||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type_nos != FF_I_TYPE)
2234
-       ||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR  && h->slice_type_nos == FF_B_TYPE)
2233
+       ||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type_nos != AV_PICTURE_TYPE_I)
2234
+       ||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR  && h->slice_type_nos == AV_PICTURE_TYPE_B)
2235 2235
        ||(s->avctx->skip_loop_filter >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
2236 2236
         h->deblocking_filter= 0;
2237 2237
 
... ...
@@ -2315,7 +2315,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2315 2315
                h->deblocking_filter, h->slice_alpha_c0_offset/2-26, h->slice_beta_offset/2-26,
2316 2316
                h->use_weight,
2317 2317
                h->use_weight==1 && h->use_weight_chroma ? "c" : "",
2318
-               h->slice_type == FF_B_TYPE ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : ""
2318
+               h->slice_type == AV_PICTURE_TYPE_B ? (h->direct_spatial_mv_pred ? "SPAT" : "TEMP") : ""
2319 2319
                );
2320 2320
     }
2321 2321
 
... ...
@@ -2325,11 +2325,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
2325 2325
 int ff_h264_get_slice_type(const H264Context *h)
2326 2326
 {
2327 2327
     switch (h->slice_type) {
2328
-    case FF_P_TYPE:  return 0;
2329
-    case FF_B_TYPE:  return 1;
2330
-    case FF_I_TYPE:  return 2;
2331
-    case FF_SP_TYPE: return 3;
2332
-    case FF_SI_TYPE: return 4;
2328
+    case AV_PICTURE_TYPE_P:  return 0;
2329
+    case AV_PICTURE_TYPE_B:  return 1;
2330
+    case AV_PICTURE_TYPE_I:  return 2;
2331
+    case AV_PICTURE_TYPE_SP: return 3;
2332
+    case AV_PICTURE_TYPE_SI: return 4;
2333 2333
     default:         return -1;
2334 2334
     }
2335 2335
 }
... ...
@@ -3000,8 +3000,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
3000 3000
 
3001 3001
             if(hx->redundant_pic_count==0
3002 3002
                && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
3003
-               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=FF_B_TYPE)
3004
-               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE)
3003
+               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=AV_PICTURE_TYPE_B)
3004
+               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==AV_PICTURE_TYPE_I)
3005 3005
                && avctx->skip_frame < AVDISCARD_ALL){
3006 3006
                 if(avctx->hwaccel) {
3007 3007
                     if (avctx->hwaccel->decode_slice(avctx, &buf[buf_index - consumed], consumed) < 0)
... ...
@@ -3037,8 +3037,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
3037 3037
             if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning
3038 3038
                && s->context_initialized
3039 3039
                && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
3040
-               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=FF_B_TYPE)
3041
-               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE)
3040
+               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=AV_PICTURE_TYPE_B)
3041
+               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==AV_PICTURE_TYPE_I)
3042 3042
                && avctx->skip_frame < AVDISCARD_ALL)
3043 3043
                 context_count++;
3044 3044
             break;
... ...
@@ -1118,7 +1118,7 @@ static void fill_decode_caches(H264Context *h, int mb_type){
1118 1118
                 }
1119 1119
                 AV_ZERO16(h->mvd_cache [list][scan8[4 ]]);
1120 1120
                 AV_ZERO16(h->mvd_cache [list][scan8[12]]);
1121
-                if(h->slice_type_nos == FF_B_TYPE){
1121
+                if(h->slice_type_nos == AV_PICTURE_TYPE_B){
1122 1122
                     fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1);
1123 1123
 
1124 1124
                     if(IS_DIRECT(top_type)){
... ...
@@ -1255,7 +1255,7 @@ static inline void write_back_motion(H264Context *h, int mb_type){
1255 1255
         }
1256 1256
     }
1257 1257
 
1258
-    if(h->slice_type_nos == FF_B_TYPE && CABAC){
1258
+    if(h->slice_type_nos == AV_PICTURE_TYPE_B && CABAC){
1259 1259
         if(IS_8X8(mb_type)){
1260 1260
             uint8_t *direct_table = &h->direct_table[4*h->mb_xy];
1261 1261
             direct_table[1] = h->sub_mb_type[1]>>1;
... ...
@@ -1286,7 +1286,7 @@ static void av_unused decode_mb_skip(H264Context *h){
1286 1286
     if(MB_FIELD)
1287 1287
         mb_type|= MB_TYPE_INTERLACED;
1288 1288
 
1289
-    if( h->slice_type_nos == FF_B_TYPE )
1289
+    if( h->slice_type_nos == AV_PICTURE_TYPE_B )
1290 1290
     {
1291 1291
         // just for fill_caches. pred_direct_motion will set the real mb_type
1292 1292
         mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP;
... ...
@@ -691,7 +691,7 @@ void ff_h264_init_cabac_states(H264Context *h) {
691 691
     const int8_t (*tab)[2];
692 692
     const int slice_qp = av_clip(s->qscale - 6*(h->sps.bit_depth_luma-8), 0, 51);
693 693
 
694
-    if( h->slice_type_nos == FF_I_TYPE ) tab = cabac_context_init_I;
694
+    if( h->slice_type_nos == AV_PICTURE_TYPE_I ) tab = cabac_context_init_I;
695 695
     else                                 tab = cabac_context_init_PB[h->cabac_init_idc];
696 696
 
697 697
     /* calculate pre-state */
... ...
@@ -779,7 +779,7 @@ static int decode_cabac_mb_skip( H264Context *h, int mb_x, int mb_y ) {
779 779
     if( h->slice_table[mbb_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mbb_xy] ))
780 780
         ctx++;
781 781
 
782
-    if( h->slice_type_nos == FF_B_TYPE )
782
+    if( h->slice_type_nos == AV_PICTURE_TYPE_B )
783 783
         ctx += 13;
784 784
     return get_cabac_noinline( &h->cabac, &h->cabac_state[11+ctx] );
785 785
 }
... ...
@@ -888,7 +888,7 @@ static int decode_cabac_mb_ref( H264Context *h, int list, int n ) {
888 888
     int ref  = 0;
889 889
     int ctx  = 0;
890 890
 
891
-    if( h->slice_type_nos == FF_B_TYPE) {
891
+    if( h->slice_type_nos == AV_PICTURE_TYPE_B) {
892 892
         if( refa > 0 && !(h->direct_cache[scan8[n] - 1]&(MB_TYPE_DIRECT2>>1)) )
893 893
             ctx++;
894 894
         if( refb > 0 && !(h->direct_cache[scan8[n] - 8]&(MB_TYPE_DIRECT2>>1)) )
... ...
@@ -1208,7 +1208,7 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
1208 1208
     mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride;
1209 1209
 
1210 1210
     tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y);
1211
-    if( h->slice_type_nos != FF_I_TYPE ) {
1211
+    if( h->slice_type_nos != AV_PICTURE_TYPE_I ) {
1212 1212
         int skip;
1213 1213
         /* a skipped mb needs the aff flag from the following mb */
1214 1214
         if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped )
... ...
@@ -1244,9 +1244,9 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
1244 1244
 
1245 1245
     fill_decode_neighbors(h, -(MB_FIELD));
1246 1246
 
1247
-    if( h->slice_type_nos == FF_B_TYPE ) {
1247
+    if( h->slice_type_nos == AV_PICTURE_TYPE_B ) {
1248 1248
         int ctx = 0;
1249
-        assert(h->slice_type_nos == FF_B_TYPE);
1249
+        assert(h->slice_type_nos == AV_PICTURE_TYPE_B);
1250 1250
 
1251 1251
         if( !IS_DIRECT( h->left_type[0]-1 ) )
1252 1252
             ctx++;
... ...
@@ -1279,7 +1279,7 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
1279 1279
         }
1280 1280
             partition_count= b_mb_type_info[mb_type].partition_count;
1281 1281
             mb_type=         b_mb_type_info[mb_type].type;
1282
-    } else if( h->slice_type_nos == FF_P_TYPE ) {
1282
+    } else if( h->slice_type_nos == AV_PICTURE_TYPE_P ) {
1283 1283
         if( get_cabac_noinline( &h->cabac, &h->cabac_state[14] ) == 0 ) {
1284 1284
             /* P-type */
1285 1285
             if( get_cabac_noinline( &h->cabac, &h->cabac_state[15] ) == 0 ) {
... ...
@@ -1297,9 +1297,9 @@ int ff_h264_decode_mb_cabac(H264Context *h) {
1297 1297
         }
1298 1298
     } else {
1299 1299
         mb_type= decode_cabac_intra_mb_type(h, 3, 1);
1300
-        if(h->slice_type == FF_SI_TYPE && mb_type)
1300
+        if(h->slice_type == AV_PICTURE_TYPE_SI && mb_type)
1301 1301
             mb_type--;
1302
-        assert(h->slice_type_nos == FF_I_TYPE);
1302
+        assert(h->slice_type_nos == AV_PICTURE_TYPE_I);
1303 1303
 decode_intra_mb:
1304 1304
         partition_count = 0;
1305 1305
         cbp= i_mb_type_info[mb_type].cbp;
... ...
@@ -1388,7 +1388,7 @@ decode_intra_mb:
1388 1388
     } else if( partition_count == 4 ) {
1389 1389
         int i, j, sub_partition_count[4], list, ref[2][4];
1390 1390
 
1391
-        if( h->slice_type_nos == FF_B_TYPE ) {
1391
+        if( h->slice_type_nos == AV_PICTURE_TYPE_B ) {
1392 1392
             for( i = 0; i < 4; i++ ) {
1393 1393
                 h->sub_mb_type[i] = decode_cabac_b_mb_sub_type( h );
1394 1394
                 sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
... ...
@@ -548,7 +548,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
548 548
     tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y);
549 549
     cbp = 0; /* avoid warning. FIXME: find a solution without slowing
550 550
                 down the code */
551
-    if(h->slice_type_nos != FF_I_TYPE){
551
+    if(h->slice_type_nos != AV_PICTURE_TYPE_I){
552 552
         if(s->mb_skip_run==-1)
553 553
             s->mb_skip_run= get_ue_golomb(&s->gb);
554 554
 
... ...
@@ -569,7 +569,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
569 569
     h->prev_mb_skipped= 0;
570 570
 
571 571
     mb_type= get_ue_golomb(&s->gb);
572
-    if(h->slice_type_nos == FF_B_TYPE){
572
+    if(h->slice_type_nos == AV_PICTURE_TYPE_B){
573 573
         if(mb_type < 23){
574 574
             partition_count= b_mb_type_info[mb_type].partition_count;
575 575
             mb_type=         b_mb_type_info[mb_type].type;
... ...
@@ -577,7 +577,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
577 577
             mb_type -= 23;
578 578
             goto decode_intra_mb;
579 579
         }
580
-    }else if(h->slice_type_nos == FF_P_TYPE){
580
+    }else if(h->slice_type_nos == AV_PICTURE_TYPE_P){
581 581
         if(mb_type < 5){
582 582
             partition_count= p_mb_type_info[mb_type].partition_count;
583 583
             mb_type=         p_mb_type_info[mb_type].type;
... ...
@@ -586,8 +586,8 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
586 586
             goto decode_intra_mb;
587 587
         }
588 588
     }else{
589
-       assert(h->slice_type_nos == FF_I_TYPE);
590
-        if(h->slice_type == FF_SI_TYPE && mb_type)
589
+       assert(h->slice_type_nos == AV_PICTURE_TYPE_I);
590
+        if(h->slice_type == AV_PICTURE_TYPE_SI && mb_type)
591 591
             mb_type--;
592 592
 decode_intra_mb:
593 593
         if(mb_type > 25){
... ...
@@ -678,7 +678,7 @@ decode_intra_mb:
678 678
     }else if(partition_count==4){
679 679
         int i, j, sub_partition_count[4], list, ref[2][4];
680 680
 
681
-        if(h->slice_type_nos == FF_B_TYPE){
681
+        if(h->slice_type_nos == AV_PICTURE_TYPE_B){
682 682
             for(i=0; i<4; i++){
683 683
                 h->sub_mb_type[i]= get_ue_golomb_31(&s->gb);
684 684
                 if(h->sub_mb_type[i] >=13){
... ...
@@ -696,7 +696,7 @@ decode_intra_mb:
696 696
                 h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
697 697
             }
698 698
         }else{
699
-            assert(h->slice_type_nos == FF_P_TYPE); //FIXME SP correct ?
699
+            assert(h->slice_type_nos == AV_PICTURE_TYPE_P); //FIXME SP correct ?
700 700
             for(i=0; i<4; i++){
701 701
                 h->sub_mb_type[i]= get_ue_golomb_31(&s->gb);
702 702
                 if(h->sub_mb_type[i] >=4){
... ...
@@ -130,7 +130,7 @@ void ff_h264_direct_ref_list_init(H264Context * const h){
130 130
         h->col_fieldoff= 2*(h->ref_list[1][0].reference) - 3;
131 131
     }
132 132
 
133
-    if(cur->pict_type != FF_B_TYPE || h->direct_spatial_mv_pred)
133
+    if(cur->pict_type != AV_PICTURE_TYPE_B || h->direct_spatial_mv_pred)
134 134
         return;
135 135
 
136 136
     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;
... ...
@@ -110,7 +110,7 @@ int ff_h264_fill_default_ref_list(H264Context *h){
110 110
     MpegEncContext * const s = &h->s;
111 111
     int i, len;
112 112
 
113
-    if(h->slice_type_nos==FF_B_TYPE){
113
+    if(h->slice_type_nos==AV_PICTURE_TYPE_B){
114 114
         Picture *sorted[32];
115 115
         int cur_poc, list;
116 116
         int lens[2];
... ...
@@ -149,7 +149,7 @@ int ff_h264_fill_default_ref_list(H264Context *h){
149 149
     for (i=0; i<h->ref_count[0]; i++) {
150 150
         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]);
151 151
     }
152
-    if(h->slice_type_nos==FF_B_TYPE){
152
+    if(h->slice_type_nos==AV_PICTURE_TYPE_B){
153 153
         for (i=0; i<h->ref_count[1]; i++) {
154 154
             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]);
155 155
         }
... ...
@@ -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){
... ...
@@ -358,9 +358,9 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame,
358 358
         coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY);
359 359
 
360 360
         if (coded_frame->key_frame)
361
-            coded_frame->pict_type = FF_I_TYPE;
361
+            coded_frame->pict_type = AV_PICTURE_TYPE_I;
362 362
         else
363
-            coded_frame->pict_type = FF_P_TYPE;
363
+            coded_frame->pict_type = AV_PICTURE_TYPE_P;
364 364
     } else {
365 365
         av_log(avctx, AV_LOG_ERROR,
366 366
                "Compressed frame larger than storage provided! (%zu/%d)\n",
... ...
@@ -110,9 +110,9 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
110 110
 
111 111
         x4->pic.i_pts  = frame->pts;
112 112
         x4->pic.i_type =
113
-            frame->pict_type == FF_I_TYPE ? X264_TYPE_KEYFRAME :
114
-            frame->pict_type == FF_P_TYPE ? X264_TYPE_P :
115
-            frame->pict_type == FF_B_TYPE ? X264_TYPE_B :
113
+            frame->pict_type == AV_PICTURE_TYPE_I ? X264_TYPE_KEYFRAME :
114
+            frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
115
+            frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
116 116
                                             X264_TYPE_AUTO;
117 117
         if (x4->params.b_tff != frame->top_field_first) {
118 118
             x4->params.b_tff = frame->top_field_first;
... ...
@@ -135,14 +135,14 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
135 135
     switch (pic_out.i_type) {
136 136
     case X264_TYPE_IDR:
137 137
     case X264_TYPE_I:
138
-        x4->out_pic.pict_type = FF_I_TYPE;
138
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_I;
139 139
         break;
140 140
     case X264_TYPE_P:
141
-        x4->out_pic.pict_type = FF_P_TYPE;
141
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_P;
142 142
         break;
143 143
     case X264_TYPE_B:
144 144
     case X264_TYPE_BREF:
145
-        x4->out_pic.pict_type = FF_B_TYPE;
145
+        x4->out_pic.pict_type = AV_PICTURE_TYPE_B;
146 146
         break;
147 147
     }
148 148
 
... ...
@@ -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);
... ...
@@ -170,7 +170,7 @@ static int decode_frame(AVCodecContext *avctx,
170 170
         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
171 171
         return -1;
172 172
     }
173
-    p->pict_type= FF_I_TYPE;
173
+    p->pict_type= AV_PICTURE_TYPE_I;
174 174
     p->key_frame= 1;
175 175
 
176 176
     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;
... ...
@@ -353,7 +353,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
353 353
         av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
354 354
         return -1;
355 355
     }
356
-    s->picture_ptr->pict_type= FF_I_TYPE;
356
+    s->picture_ptr->pict_type= AV_PICTURE_TYPE_I;
357 357
     s->picture_ptr->key_frame= 1;
358 358
     s->got_picture = 1;
359 359
 
... ...
@@ -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
 
... ...
@@ -1037,7 +1037,7 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int
1037 1037
     score_map[0]= dmin;
1038 1038
 
1039 1039
     //FIXME precalc first term below?
1040
-    if((s->pict_type == FF_B_TYPE && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
1040
+    if((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
1041 1041
         dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
1042 1042
 
1043 1043
     /* first line */
... ...
@@ -214,7 +214,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
214 214
     assert(s->mb_skipped==0);
215 215
 
216 216
     if (s->mb_skip_run-- != 0) {
217
-        if (s->pict_type == FF_P_TYPE) {
217
+        if (s->pict_type == AV_PICTURE_TYPE_P) {
218 218
             s->mb_skipped = 1;
219 219
             s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]= MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16;
220 220
         } else {
... ...
@@ -240,7 +240,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
240 240
 
241 241
     switch(s->pict_type) {
242 242
     default:
243
-    case FF_I_TYPE:
243
+    case AV_PICTURE_TYPE_I:
244 244
         if (get_bits1(&s->gb) == 0) {
245 245
             if (get_bits1(&s->gb) == 0){
246 246
                 av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in I Frame at %d %d\n", s->mb_x, s->mb_y);
... ...
@@ -251,7 +251,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
251 251
             mb_type = MB_TYPE_INTRA;
252 252
         }
253 253
         break;
254
-    case FF_P_TYPE:
254
+    case AV_PICTURE_TYPE_P:
255 255
         mb_type = get_vlc2(&s->gb, mb_ptype_vlc.table, MB_PTYPE_VLC_BITS, 1);
256 256
         if (mb_type < 0){
257 257
             av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in P Frame at %d %d\n", s->mb_x, s->mb_y);
... ...
@@ -259,7 +259,7 @@ static int mpeg_decode_mb(MpegEncContext *s,
259 259
         }
260 260
         mb_type = ptype2mb_type[ mb_type ];
261 261
         break;
262
-    case FF_B_TYPE:
262
+    case AV_PICTURE_TYPE_B:
263 263
         mb_type = get_vlc2(&s->gb, mb_btype_vlc.table, MB_BTYPE_VLC_BITS, 1);
264 264
         if (mb_type < 0){
265 265
             av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in B Frame at %d %d\n", s->mb_x, s->mb_y);
... ...
@@ -1198,7 +1198,7 @@ static int mpeg_decode_update_thread_context(AVCodecContext *avctx, const AVCode
1198 1198
     if(!ctx->mpeg_enc_ctx_allocated)
1199 1199
         memcpy(s + 1, s1 + 1, sizeof(Mpeg1Context) - sizeof(MpegEncContext));
1200 1200
 
1201
-    if(!(s->pict_type == FF_B_TYPE || s->low_delay))
1201
+    if(!(s->pict_type == AV_PICTURE_TYPE_B || s->low_delay))
1202 1202
         s->picture_number++;
1203 1203
 
1204 1204
     return 0;
... ...
@@ -1408,7 +1408,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
1408 1408
         return -1;
1409 1409
 
1410 1410
     vbv_delay= get_bits(&s->gb, 16);
1411
-    if (s->pict_type == FF_P_TYPE || s->pict_type == FF_B_TYPE) {
1411
+    if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type == AV_PICTURE_TYPE_B) {
1412 1412
         s->full_pel[0] = get_bits1(&s->gb);
1413 1413
         f_code = get_bits(&s->gb, 3);
1414 1414
         if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
... ...
@@ -1416,7 +1416,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
1416 1416
         s->mpeg_f_code[0][0] = f_code;
1417 1417
         s->mpeg_f_code[0][1] = f_code;
1418 1418
     }
1419
-    if (s->pict_type == FF_B_TYPE) {
1419
+    if (s->pict_type == AV_PICTURE_TYPE_B) {
1420 1420
         s->full_pel[1] = get_bits1(&s->gb);
1421 1421
         f_code = get_bits(&s->gb, 3);
1422 1422
         if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT)
... ...
@@ -1425,7 +1425,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
1425 1425
         s->mpeg_f_code[1][1] = f_code;
1426 1426
     }
1427 1427
     s->current_picture.pict_type= s->pict_type;
1428
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
1428
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
1429 1429
 
1430 1430
     if(avctx->debug & FF_DEBUG_PICT_INFO)
1431 1431
         av_log(avctx, AV_LOG_DEBUG, "vbv_delay %d, ref %d type:%d\n", vbv_delay, ref, s->pict_type);
... ...
@@ -1573,13 +1573,13 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1)
1573 1573
         av_log(s->avctx, AV_LOG_ERROR, "Missing picture start code, guessing missing values\n");
1574 1574
         if(s->mpeg_f_code[1][0] == 15 && s->mpeg_f_code[1][1]==15){
1575 1575
             if(s->mpeg_f_code[0][0] == 15 && s->mpeg_f_code[0][1] == 15)
1576
-                s->pict_type= FF_I_TYPE;
1576
+                s->pict_type= AV_PICTURE_TYPE_I;
1577 1577
             else
1578
-                s->pict_type= FF_P_TYPE;
1578
+                s->pict_type= AV_PICTURE_TYPE_P;
1579 1579
         }else
1580
-            s->pict_type= FF_B_TYPE;
1580
+            s->pict_type= AV_PICTURE_TYPE_B;
1581 1581
         s->current_picture.pict_type= s->pict_type;
1582
-        s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
1582
+        s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
1583 1583
     }
1584 1584
     s->intra_dc_precision = get_bits(&s->gb, 2);
1585 1585
     s->picture_structure = get_bits(&s->gb, 2);
... ...
@@ -1790,7 +1790,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1790 1790
         if(s->avctx->debug&FF_DEBUG_PICT_INFO){
1791 1791
              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",
1792 1792
                  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],
1793
-                 s->pict_type == FF_I_TYPE ? "I" : (s->pict_type == FF_P_TYPE ? "P" : (s->pict_type == FF_B_TYPE ? "B" : "S")),
1793
+                 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")),
1794 1794
                  s->progressive_sequence ? "ps" :"", s->progressive_frame ? "pf" : "", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"",
1795 1795
                  s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors,
1796 1796
                  s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :"");
... ...
@@ -1813,7 +1813,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1813 1813
 
1814 1814
             for(i=0; i<2; i++){
1815 1815
                 for(dir=0; dir<2; dir++){
1816
-                    if (s->mb_intra || (dir==1 && s->pict_type != FF_B_TYPE)) {
1816
+                    if (s->mb_intra || (dir==1 && s->pict_type != AV_PICTURE_TYPE_B)) {
1817 1817
                         motion_x = motion_y = 0;
1818 1818
                     }else if (s->mv_type == MV_TYPE_16X16 || (s->mv_type == MV_TYPE_FIELD && field_pic)){
1819 1819
                         motion_x = s->mv[dir][0][0];
... ...
@@ -1853,7 +1853,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1853 1853
 
1854 1854
             if(s->mb_y >= s->mb_height){
1855 1855
                 int left= get_bits_left(&s->gb);
1856
-                int is_d10= s->chroma_format==2 && s->pict_type==FF_I_TYPE && avctx->profile==0 && avctx->level==5
1856
+                int is_d10= s->chroma_format==2 && s->pict_type==AV_PICTURE_TYPE_I && avctx->profile==0 && avctx->level==5
1857 1857
                             && s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0
1858 1858
                             && s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/;
1859 1859
 
... ...
@@ -1896,7 +1896,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1896 1896
             }
1897 1897
             if(s->mb_skip_run){
1898 1898
                 int i;
1899
-                if(s->pict_type == FF_I_TYPE){
1899
+                if(s->pict_type == AV_PICTURE_TYPE_I){
1900 1900
                     av_log(s->avctx, AV_LOG_ERROR, "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y);
1901 1901
                     return -1;
1902 1902
                 }
... ...
@@ -1909,7 +1909,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y,
1909 1909
                     s->mv_type = MV_TYPE_16X16;
1910 1910
                 else
1911 1911
                     s->mv_type = MV_TYPE_FIELD;
1912
-                if (s->pict_type == FF_P_TYPE) {
1912
+                if (s->pict_type == AV_PICTURE_TYPE_P) {
1913 1913
                     /* if P type, zero motion vector is implied */
1914 1914
                     s->mv_dir = MV_DIR_FORWARD;
1915 1915
                     s->mv[0][0][0] = s->mv[0][0][1] = 0;
... ...
@@ -2000,7 +2000,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict)
2000 2000
 
2001 2001
         MPV_frame_end(s);
2002 2002
 
2003
-        if (s->pict_type == FF_B_TYPE || s->low_delay) {
2003
+        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
2004 2004
             *pict= *(AVFrame*)s->current_picture_ptr;
2005 2005
             ff_print_debug_info(s, pict);
2006 2006
         } else {
... ...
@@ -2339,7 +2339,7 @@ static int decode_chunks(AVCodecContext *avctx,
2339 2339
         uint32_t start_code = -1;
2340 2340
         buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code);
2341 2341
         if (start_code > 0x1ff){
2342
-            if(s2->pict_type != FF_B_TYPE || avctx->skip_frame <= AVDISCARD_DEFAULT){
2342
+            if(s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT){
2343 2343
                 if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){
2344 2344
                     int i;
2345 2345
 
... ...
@@ -2465,19 +2465,19 @@ static int decode_chunks(AVCodecContext *avctx,
2465 2465
 
2466 2466
                 if(s2->last_picture_ptr==NULL){
2467 2467
                 /* Skip B-frames if we do not have reference frames and gop is not closed */
2468
-                    if(s2->pict_type==FF_B_TYPE){
2468
+                    if(s2->pict_type==AV_PICTURE_TYPE_B){
2469 2469
                         if(!s2->closed_gop)
2470 2470
                             break;
2471 2471
                     }
2472 2472
                 }
2473
-                if(s2->pict_type==FF_I_TYPE)
2473
+                if(s2->pict_type==AV_PICTURE_TYPE_I)
2474 2474
                     s->sync=1;
2475 2475
                 if(s2->next_picture_ptr==NULL){
2476 2476
                 /* Skip P-frames if we do not have a reference frame or we have an invalid header. */
2477
-                    if(s2->pict_type==FF_P_TYPE && !s->sync) break;
2477
+                    if(s2->pict_type==AV_PICTURE_TYPE_P && !s->sync) break;
2478 2478
                 }
2479
-                if(  (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==FF_B_TYPE)
2480
-                    ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=FF_I_TYPE)
2479
+                if(  (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==AV_PICTURE_TYPE_B)
2480
+                    ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=AV_PICTURE_TYPE_I)
2481 2481
                     || avctx->skip_frame >= AVDISCARD_ALL)
2482 2482
                     break;
2483 2483
 
... ...
@@ -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;
... ...
@@ -118,7 +118,7 @@ static inline int mpeg4_is_resync(MpegEncContext *s){
118 118
     }
119 119
 
120 120
     while(v<=0xFF){
121
-        if(s->pict_type==FF_B_TYPE || (v>>(8-s->pict_type)!=1) || s->partitioned_frame)
121
+        if(s->pict_type==AV_PICTURE_TYPE_B || (v>>(8-s->pict_type)!=1) || s->partitioned_frame)
122 122
             break;
123 123
         skip_bits(&s->gb, 8+s->pict_type);
124 124
         bits_count+= 8+s->pict_type;
... ...
@@ -373,7 +373,7 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s)
373 373
         av_log(s->avctx, AV_LOG_ERROR, "illegal mb_num in video packet (%d %d) \n", mb_num, s->mb_num);
374 374
         return -1;
375 375
     }
376
-    if(s->pict_type == FF_B_TYPE){
376
+    if(s->pict_type == AV_PICTURE_TYPE_B){
377 377
         int mb_x = 0, mb_y = 0;
378 378
 
379 379
         while(s->next_picture.mbskip_table[ s->mb_index2xy[ mb_num ] ]) {
... ...
@@ -413,20 +413,20 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s)
413 413
         if(s->shape != BIN_ONLY_SHAPE){
414 414
             skip_bits(&s->gb, 3); /* intra dc vlc threshold */
415 415
 //FIXME don't just ignore everything
416
-            if(s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
416
+            if(s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
417 417
                 mpeg4_decode_sprite_trajectory(s, &s->gb);
418 418
                 av_log(s->avctx, AV_LOG_ERROR, "untested\n");
419 419
             }
420 420
 
421 421
             //FIXME reduced res stuff here
422 422
 
423
-            if (s->pict_type != FF_I_TYPE) {
423
+            if (s->pict_type != AV_PICTURE_TYPE_I) {
424 424
                 int f_code = get_bits(&s->gb, 3);       /* fcode_for */
425 425
                 if(f_code==0){
426 426
                     av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (f_code=0)\n");
427 427
                 }
428 428
             }
429
-            if (s->pict_type == FF_B_TYPE) {
429
+            if (s->pict_type == AV_PICTURE_TYPE_B) {
430 430
                 int b_code = get_bits(&s->gb, 3);
431 431
                 if(b_code==0){
432 432
                     av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (b_code=0)\n");
... ...
@@ -555,7 +555,7 @@ static int mpeg4_decode_partition_a(MpegEncContext *s){
555 555
             if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1)
556 556
                 s->first_slice_line=0;
557 557
 
558
-            if(s->pict_type==FF_I_TYPE){
558
+            if(s->pict_type==AV_PICTURE_TYPE_I){
559 559
                 int i;
560 560
 
561 561
                 do{
... ...
@@ -604,7 +604,7 @@ try_again:
604 604
                 skip_bits1(&s->gb);
605 605
                 if(bits&0x10000){
606 606
                     /* skip mb */
607
-                    if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
607
+                    if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
608 608
                         s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0;
609 609
                         mx= get_amv(s, 0);
610 610
                         my= get_amv(s, 1);
... ...
@@ -645,7 +645,7 @@ try_again:
645 645
                     if(s->mbintra_table[xy])
646 646
                         ff_clean_intra_table_entries(s);
647 647
 
648
-                    if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
648
+                    if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
649 649
                         s->mcsel= get_bits1(&s->gb);
650 650
                     else s->mcsel= 0;
651 651
 
... ...
@@ -717,7 +717,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
717 717
             if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1)
718 718
                 s->first_slice_line=0;
719 719
 
720
-            if(s->pict_type==FF_I_TYPE){
720
+            if(s->pict_type==AV_PICTURE_TYPE_I){
721 721
                 int ac_pred= get_bits1(&s->gb);
722 722
                 int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
723 723
                 if(cbpy<0){
... ...
@@ -791,8 +791,8 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){
791 791
 int ff_mpeg4_decode_partitions(MpegEncContext *s)
792 792
 {
793 793
     int mb_num;
794
-    const int part_a_error= s->pict_type==FF_I_TYPE ? (DC_ERROR|MV_ERROR) : MV_ERROR;
795
-    const int part_a_end  = s->pict_type==FF_I_TYPE ? (DC_END  |MV_END)   : MV_END;
794
+    const int part_a_error= s->pict_type==AV_PICTURE_TYPE_I ? (DC_ERROR|MV_ERROR) : MV_ERROR;
795
+    const int part_a_end  = s->pict_type==AV_PICTURE_TYPE_I ? (DC_END  |MV_END)   : MV_END;
796 796
 
797 797
     mb_num= mpeg4_decode_partition_a(s);
798 798
     if(mb_num<0){
... ...
@@ -808,7 +808,7 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s)
808 808
 
809 809
     s->mb_num_left= mb_num;
810 810
 
811
-    if(s->pict_type==FF_I_TYPE){
811
+    if(s->pict_type==AV_PICTURE_TYPE_I){
812 812
         while(show_bits(&s->gb, 9) == 1)
813 813
             skip_bits(&s->gb, 9);
814 814
         if(get_bits_long(&s->gb, 19)!=DC_MARKER){
... ...
@@ -826,11 +826,11 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s)
826 826
     ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, part_a_end);
827 827
 
828 828
     if( mpeg4_decode_partition_b(s, mb_num) < 0){
829
-        if(s->pict_type==FF_P_TYPE)
829
+        if(s->pict_type==AV_PICTURE_TYPE_P)
830 830
             ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, DC_ERROR);
831 831
         return -1;
832 832
     }else{
833
-        if(s->pict_type==FF_P_TYPE)
833
+        if(s->pict_type==AV_PICTURE_TYPE_P)
834 834
             ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, DC_END);
835 835
     }
836 836
 
... ...
@@ -1101,7 +1101,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
1101 1101
         ff_set_qscale(s, s->current_picture.qscale_table[xy] );
1102 1102
     }
1103 1103
 
1104
-    if (s->pict_type == FF_P_TYPE || s->pict_type==FF_S_TYPE) {
1104
+    if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) {
1105 1105
         int i;
1106 1106
         for(i=0; i<4; i++){
1107 1107
             s->mv[0][i][0] = s->current_picture.motion_val[0][ s->block_index[i] ][0];
... ...
@@ -1115,7 +1115,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
1115 1115
                 s->block_last_index[i] = -1;
1116 1116
             s->mv_dir = MV_DIR_FORWARD;
1117 1117
             s->mv_type = MV_TYPE_16X16;
1118
-            if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
1118
+            if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
1119 1119
                 s->mcsel=1;
1120 1120
                 s->mb_skipped = 0;
1121 1121
             }else{
... ...
@@ -1179,7 +1179,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1179 1179
 
1180 1180
     assert(s->h263_pred);
1181 1181
 
1182
-    if (s->pict_type == FF_P_TYPE || s->pict_type==FF_S_TYPE) {
1182
+    if (s->pict_type == AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) {
1183 1183
         do{
1184 1184
             if (get_bits1(&s->gb)) {
1185 1185
                 /* skip mb */
... ...
@@ -1188,7 +1188,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1188 1188
                     s->block_last_index[i] = -1;
1189 1189
                 s->mv_dir = MV_DIR_FORWARD;
1190 1190
                 s->mv_type = MV_TYPE_16X16;
1191
-                if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE){
1191
+                if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE){
1192 1192
                     s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0;
1193 1193
                     s->mcsel=1;
1194 1194
                     s->mv[0][0][0]= get_amv(s, 0);
... ...
@@ -1216,7 +1216,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1216 1216
         s->mb_intra = ((cbpc & 4) != 0);
1217 1217
         if (s->mb_intra) goto intra;
1218 1218
 
1219
-        if(s->pict_type==FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
1219
+        if(s->pict_type==AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE && (cbpc & 16) == 0)
1220 1220
             s->mcsel= get_bits1(&s->gb);
1221 1221
         else s->mcsel= 0;
1222 1222
         cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F;
... ...
@@ -1295,7 +1295,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
1295 1295
                 mot_val[1] = my;
1296 1296
             }
1297 1297
         }
1298
-    } else if(s->pict_type==FF_B_TYPE) {
1298
+    } else if(s->pict_type==AV_PICTURE_TYPE_B) {
1299 1299
         int modb1; // first bit of modb
1300 1300
         int modb2; // second bit of modb
1301 1301
         int mb_type;
... ...
@@ -1492,12 +1492,12 @@ end:
1492 1492
         if(mpeg4_is_resync(s)){
1493 1493
             const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1;
1494 1494
 
1495
-            if(s->pict_type==FF_B_TYPE){
1495
+            if(s->pict_type==AV_PICTURE_TYPE_B){
1496 1496
                 ff_thread_await_progress((AVFrame*)s->next_picture_ptr,
1497 1497
                                         (s->mb_x + delta >= s->mb_width) ? FFMIN(s->mb_y+1, s->mb_height-1) : s->mb_y, 0);
1498 1498
             }
1499 1499
 
1500
-            if(s->pict_type==FF_B_TYPE && s->next_picture.mbskip_table[xy + delta])
1500
+            if(s->pict_type==AV_PICTURE_TYPE_B && s->next_picture.mbskip_table[xy + delta])
1501 1501
                 return SLICE_OK;
1502 1502
             return SLICE_END;
1503 1503
         }
... ...
@@ -1897,13 +1897,13 @@ static int decode_user_data(MpegEncContext *s, GetBitContext *gb){
1897 1897
 static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1898 1898
     int time_incr, time_increment;
1899 1899
 
1900
-    s->pict_type = get_bits(gb, 2) + FF_I_TYPE;        /* pict type: I = 0 , P = 1 */
1901
-    if(s->pict_type==FF_B_TYPE && s->low_delay && s->vol_control_parameters==0 && !(s->flags & CODEC_FLAG_LOW_DELAY)){
1900
+    s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I;        /* pict type: I = 0 , P = 1 */
1901
+    if(s->pict_type==AV_PICTURE_TYPE_B && s->low_delay && s->vol_control_parameters==0 && !(s->flags & CODEC_FLAG_LOW_DELAY)){
1902 1902
         av_log(s->avctx, AV_LOG_ERROR, "low_delay flag incorrectly, clearing it\n");
1903 1903
         s->low_delay=0;
1904 1904
     }
1905 1905
 
1906
-    s->partitioned_frame= s->data_partitioning && s->pict_type!=FF_B_TYPE;
1906
+    s->partitioned_frame= s->data_partitioning && s->pict_type!=AV_PICTURE_TYPE_B;
1907 1907
     if(s->partitioned_frame)
1908 1908
         s->decode_mb= mpeg4_decode_partitioned_mb;
1909 1909
     else
... ...
@@ -1919,8 +1919,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1919 1919
         av_log(s->avctx, AV_LOG_ERROR, "hmm, seems the headers are not complete, trying to guess time_increment_bits\n");
1920 1920
 
1921 1921
         for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){
1922
-            if (    s->pict_type == FF_P_TYPE
1923
-                || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
1922
+            if (    s->pict_type == AV_PICTURE_TYPE_P
1923
+                || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE)) {
1924 1924
                 if((show_bits(gb, s->time_increment_bits+6)&0x37) == 0x30) break;
1925 1925
             }else
1926 1926
                 if((show_bits(gb, s->time_increment_bits+5)&0x1F) == 0x18) break;
... ...
@@ -1932,7 +1932,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1932 1932
     if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further
1933 1933
     else time_increment= get_bits(gb, s->time_increment_bits);
1934 1934
 
1935
-    if(s->pict_type!=FF_B_TYPE){
1935
+    if(s->pict_type!=AV_PICTURE_TYPE_B){
1936 1936
         s->last_time_base= s->time_base;
1937 1937
         s->time_base+= time_incr;
1938 1938
         s->time= s->time_base*s->avctx->time_base.den + time_increment;
... ...
@@ -1982,8 +1982,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1982 1982
             av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n");
1983 1983
         return FRAME_SKIPPED;
1984 1984
     }
1985
-    if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == FF_P_TYPE
1986
-                          || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE))) {
1985
+    if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == AV_PICTURE_TYPE_P
1986
+                          || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE))) {
1987 1987
         /* rounding type for motion estimation */
1988 1988
         s->no_rounding = get_bits1(gb);
1989 1989
     } else {
... ...
@@ -1992,7 +1992,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
1992 1992
 //FIXME reduced res stuff
1993 1993
 
1994 1994
      if (s->shape != RECT_SHAPE) {
1995
-         if (s->vol_sprite_usage != 1 || s->pict_type != FF_I_TYPE) {
1995
+         if (s->vol_sprite_usage != 1 || s->pict_type != AV_PICTURE_TYPE_I) {
1996 1996
              int width, height, hor_spat_ref, ver_spat_ref;
1997 1997
 
1998 1998
              width = get_bits(gb, 13);
... ...
@@ -2013,9 +2013,9 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2013 2013
 
2014 2014
      if (s->shape != BIN_ONLY_SHAPE) {
2015 2015
          skip_bits_long(gb, s->cplx_estimation_trash_i);
2016
-         if(s->pict_type != FF_I_TYPE)
2016
+         if(s->pict_type != AV_PICTURE_TYPE_I)
2017 2017
             skip_bits_long(gb, s->cplx_estimation_trash_p);
2018
-         if(s->pict_type == FF_B_TYPE)
2018
+         if(s->pict_type == AV_PICTURE_TYPE_B)
2019 2019
             skip_bits_long(gb, s->cplx_estimation_trash_b);
2020 2020
 
2021 2021
          s->intra_dc_threshold= mpeg4_dc_threshold[ get_bits(gb, 3) ];
... ...
@@ -2038,7 +2038,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2038 2038
          ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan);
2039 2039
      }
2040 2040
 
2041
-     if(s->pict_type == FF_S_TYPE && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
2041
+     if(s->pict_type == AV_PICTURE_TYPE_S && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
2042 2042
          mpeg4_decode_sprite_trajectory(s, gb);
2043 2043
          if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n");
2044 2044
          if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n");
... ...
@@ -2051,7 +2051,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2051 2051
              return -1; // makes no sense to continue, as there is nothing left from the image then
2052 2052
          }
2053 2053
 
2054
-         if (s->pict_type != FF_I_TYPE) {
2054
+         if (s->pict_type != AV_PICTURE_TYPE_I) {
2055 2055
              s->f_code = get_bits(gb, 3);       /* fcode_for */
2056 2056
              if(s->f_code==0){
2057 2057
                  av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG4 header (f_code=0)\n");
... ...
@@ -2060,7 +2060,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2060 2060
          }else
2061 2061
              s->f_code=1;
2062 2062
 
2063
-         if (s->pict_type == FF_B_TYPE) {
2063
+         if (s->pict_type == AV_PICTURE_TYPE_B) {
2064 2064
              s->b_code = get_bits(gb, 3);
2065 2065
          }else
2066 2066
              s->b_code=1;
... ...
@@ -2068,14 +2068,14 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
2068 2068
          if(s->avctx->debug&FF_DEBUG_PICT_INFO){
2069 2069
              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",
2070 2070
                  s->qscale, s->f_code, s->b_code,
2071
-                 s->pict_type == FF_I_TYPE ? "I" : (s->pict_type == FF_P_TYPE ? "P" : (s->pict_type == FF_B_TYPE ? "B" : "S")),
2071
+                 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")),
2072 2072
                  gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first,
2073 2073
                  s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points,
2074 2074
                  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);
2075 2075
          }
2076 2076
 
2077 2077
          if(!s->scalability){
2078
-             if (s->shape!=RECT_SHAPE && s->pict_type!=FF_I_TYPE) {
2078
+             if (s->shape!=RECT_SHAPE && s->pict_type!=AV_PICTURE_TYPE_I) {
2079 2079
                  skip_bits1(gb); // vop shape coding type
2080 2080
              }
2081 2081
          }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) {
... ...
@@ -660,7 +660,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
660 660
                         int diff;
661 661
                         Picture *pic= s->reordered_input_picture[i+1];
662 662
 
663
-                        if(pic==NULL || pic->pict_type!=FF_B_TYPE) break;
663
+                        if(pic==NULL || pic->pict_type!=AV_PICTURE_TYPE_B) break;
664 664
 
665 665
                         b_pic= pic->data[0] + offset;
666 666
                         if(pic->type != FF_BUFFER_TYPE_SHARED)
... ...
@@ -824,7 +824,7 @@ void mpeg4_encode_mb(MpegEncContext * s,
824 824
         }
825 825
 
826 826
         cbpc = cbp & 3;
827
-        if (s->pict_type == FF_I_TYPE) {
827
+        if (s->pict_type == AV_PICTURE_TYPE_I) {
828 828
             if(s->dquant) cbpc+=4;
829 829
             put_bits(&s->pb,
830 830
                 ff_h263_intra_MCBPC_bits[cbpc],
... ...
@@ -876,7 +876,7 @@ void ff_mpeg4_stuffing(PutBitContext * pbc)
876 876
 
877 877
 /* must be called before writing the header */
878 878
 void ff_set_mpeg4_time(MpegEncContext * s){
879
-    if(s->pict_type==FF_B_TYPE){
879
+    if(s->pict_type==AV_PICTURE_TYPE_B){
880 880
         ff_mpeg4_init_direct_mv(s);
881 881
     }else{
882 882
         s->last_time_base= s->time_base;
... ...
@@ -1066,7 +1066,7 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1066 1066
     int time_incr;
1067 1067
     int time_div, time_mod;
1068 1068
 
1069
-    if(s->pict_type==FF_I_TYPE){
1069
+    if(s->pict_type==AV_PICTURE_TYPE_I){
1070 1070
         if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){
1071 1071
             if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy
1072 1072
                 mpeg4_encode_visual_object_header(s);
... ...
@@ -1077,7 +1077,7 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1077 1077
             mpeg4_encode_gop_header(s);
1078 1078
     }
1079 1079
 
1080
-    s->partitioned_frame= s->data_partitioning && s->pict_type!=FF_B_TYPE;
1080
+    s->partitioned_frame= s->data_partitioning && s->pict_type!=AV_PICTURE_TYPE_B;
1081 1081
 
1082 1082
     put_bits(&s->pb, 16, 0);                /* vop header */
1083 1083
     put_bits(&s->pb, 16, VOP_STARTCODE);    /* vop header */
... ...
@@ -1097,8 +1097,8 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1097 1097
     put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */
1098 1098
     put_bits(&s->pb, 1, 1);                             /* marker */
1099 1099
     put_bits(&s->pb, 1, 1);                             /* vop coded */
1100
-    if (    s->pict_type == FF_P_TYPE
1101
-        || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {
1100
+    if (    s->pict_type == AV_PICTURE_TYPE_P
1101
+        || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE)) {
1102 1102
         put_bits(&s->pb, 1, s->no_rounding);    /* rounding type */
1103 1103
     }
1104 1104
     put_bits(&s->pb, 3, 0);     /* intra dc VLC threshold */
... ...
@@ -1110,9 +1110,9 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number)
1110 1110
 
1111 1111
     put_bits(&s->pb, 5, s->qscale);
1112 1112
 
1113
-    if (s->pict_type != FF_I_TYPE)
1113
+    if (s->pict_type != AV_PICTURE_TYPE_I)
1114 1114
         put_bits(&s->pb, 3, s->f_code); /* fcode_for */
1115
-    if (s->pict_type == FF_B_TYPE)
1115
+    if (s->pict_type == AV_PICTURE_TYPE_B)
1116 1116
         put_bits(&s->pb, 3, s->b_code); /* fcode_back */
1117 1117
 }
1118 1118
 
... ...
@@ -1317,7 +1317,7 @@ void ff_mpeg4_merge_partitions(MpegEncContext *s)
1317 1317
     const int tex_pb_len= put_bits_count(&s->tex_pb);
1318 1318
     const int bits= put_bits_count(&s->pb);
1319 1319
 
1320
-    if(s->pict_type==FF_I_TYPE){
1320
+    if(s->pict_type==AV_PICTURE_TYPE_I){
1321 1321
         put_bits(&s->pb, 19, DC_MARKER);
1322 1322
         s->misc_bits+=19 + pb2_len + bits - s->last_bits;
1323 1323
         s->i_tex_bits+= tex_pb_len;
... ...
@@ -313,8 +313,8 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){
313 313
     /* It might be nicer if the application would keep track of these
314 314
      * but it would require an API change. */
315 315
     memmove(s->prev_pict_types+1, s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE-1);
316
-    s->prev_pict_types[0]= s->dropable ? FF_B_TYPE : s->pict_type;
317
-    if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == FF_B_TYPE)
316
+    s->prev_pict_types[0]= s->dropable ? AV_PICTURE_TYPE_B : s->pict_type;
317
+    if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == AV_PICTURE_TYPE_B)
318 318
         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.
319 319
     pic->owner2 = s;
320 320
 
... ...
@@ -527,7 +527,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src
527 527
         s->last_pict_type= s1->pict_type;
528 528
         if (s1->current_picture_ptr) s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->quality;
529 529
 
530
-        if(s1->pict_type!=FF_B_TYPE){
530
+        if(s1->pict_type!=AV_PICTURE_TYPE_B){
531 531
             s->last_non_b_pict_type= s1->pict_type;
532 532
         }
533 533
     }
... ...
@@ -1023,7 +1023,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1023 1023
     assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3);
1024 1024
 
1025 1025
     /* mark&release old frames */
1026
-    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]) {
1026
+    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]) {
1027 1027
       if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){
1028 1028
           free_frame_buffer(s, s->last_picture_ptr);
1029 1029
 
... ...
@@ -1054,7 +1054,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1054 1054
         if (!s->dropable){
1055 1055
             if (s->codec_id == CODEC_ID_H264)
1056 1056
                 pic->reference = s->picture_structure;
1057
-            else if (s->pict_type != FF_B_TYPE)
1057
+            else if (s->pict_type != AV_PICTURE_TYPE_B)
1058 1058
                 pic->reference = 3;
1059 1059
         }
1060 1060
 
... ...
@@ -1077,11 +1077,11 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1077 1077
     s->current_picture_ptr->pict_type= s->pict_type;
1078 1078
 //    if(s->flags && CODEC_FLAG_QSCALE)
1079 1079
   //      s->current_picture_ptr->quality= s->new_picture_ptr->quality;
1080
-    s->current_picture_ptr->key_frame= s->pict_type == FF_I_TYPE;
1080
+    s->current_picture_ptr->key_frame= s->pict_type == AV_PICTURE_TYPE_I;
1081 1081
 
1082 1082
     ff_copy_picture(&s->current_picture, s->current_picture_ptr);
1083 1083
 
1084
-    if (s->pict_type != FF_B_TYPE) {
1084
+    if (s->pict_type != AV_PICTURE_TYPE_B) {
1085 1085
         s->last_picture_ptr= s->next_picture_ptr;
1086 1086
         if(!s->dropable)
1087 1087
             s->next_picture_ptr= s->current_picture_ptr;
... ...
@@ -1093,7 +1093,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1093 1093
         s->pict_type, s->dropable);*/
1094 1094
 
1095 1095
     if(s->codec_id != CODEC_ID_H264){
1096
-        if((s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) && s->pict_type!=FF_I_TYPE){
1096
+        if((s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL) && s->pict_type!=AV_PICTURE_TYPE_I){
1097 1097
             av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
1098 1098
             /* Allocate a dummy frame */
1099 1099
             i= ff_find_unused_picture(s, 0);
... ...
@@ -1103,7 +1103,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1103 1103
             ff_thread_report_progress((AVFrame*)s->last_picture_ptr, INT_MAX, 0);
1104 1104
             ff_thread_report_progress((AVFrame*)s->last_picture_ptr, INT_MAX, 1);
1105 1105
         }
1106
-        if((s->next_picture_ptr==NULL || s->next_picture_ptr->data[0]==NULL) && s->pict_type==FF_B_TYPE){
1106
+        if((s->next_picture_ptr==NULL || s->next_picture_ptr->data[0]==NULL) && s->pict_type==AV_PICTURE_TYPE_B){
1107 1107
             /* Allocate a dummy frame */
1108 1108
             i= ff_find_unused_picture(s, 0);
1109 1109
             s->next_picture_ptr= &s->picture[i];
... ...
@@ -1117,7 +1117,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
1117 1117
     if(s->last_picture_ptr) ff_copy_picture(&s->last_picture, s->last_picture_ptr);
1118 1118
     if(s->next_picture_ptr) ff_copy_picture(&s->next_picture, s->next_picture_ptr);
1119 1119
 
1120
-    assert(s->pict_type == FF_I_TYPE || (s->last_picture_ptr && s->last_picture_ptr->data[0]));
1120
+    assert(s->pict_type == AV_PICTURE_TYPE_I || (s->last_picture_ptr && s->last_picture_ptr->data[0]));
1121 1121
 
1122 1122
     if(s->picture_structure!=PICT_FRAME && s->out_format != FMT_H264){
1123 1123
         int i;
... ...
@@ -1185,7 +1185,7 @@ void MPV_frame_end(MpegEncContext *s)
1185 1185
 
1186 1186
     s->last_pict_type    = s->pict_type;
1187 1187
     s->last_lambda_for[s->pict_type]= s->current_picture_ptr->quality;
1188
-    if(s->pict_type!=FF_B_TYPE){
1188
+    if(s->pict_type!=AV_PICTURE_TYPE_B){
1189 1189
         s->last_non_b_pict_type= s->pict_type;
1190 1190
     }
1191 1191
 #if 0
... ...
@@ -1314,12 +1314,12 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
1314 1314
 
1315 1315
         av_log(s->avctx,AV_LOG_DEBUG,"New frame, type: ");
1316 1316
         switch (pict->pict_type) {
1317
-            case FF_I_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"I\n"); break;
1318
-            case FF_P_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"P\n"); break;
1319
-            case FF_B_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"B\n"); break;
1320
-            case FF_S_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"S\n"); break;
1321
-            case FF_SI_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SI\n"); break;
1322
-            case FF_SP_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"SP\n"); break;
1317
+            case AV_PICTURE_TYPE_I: av_log(s->avctx,AV_LOG_DEBUG,"I\n"); break;
1318
+            case AV_PICTURE_TYPE_P: av_log(s->avctx,AV_LOG_DEBUG,"P\n"); break;
1319
+            case AV_PICTURE_TYPE_B: av_log(s->avctx,AV_LOG_DEBUG,"B\n"); break;
1320
+            case AV_PICTURE_TYPE_S: av_log(s->avctx,AV_LOG_DEBUG,"S\n"); break;
1321
+            case AV_PICTURE_TYPE_SI: av_log(s->avctx,AV_LOG_DEBUG,"SI\n"); break;
1322
+            case AV_PICTURE_TYPE_SP: av_log(s->avctx,AV_LOG_DEBUG,"SP\n"); break;
1323 1323
         }
1324 1324
         for(y=0; y<s->mb_height; y++){
1325 1325
             for(x=0; x<s->mb_width; x++){
... ...
@@ -1415,15 +1415,15 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){
1415 1415
                   for(type=0; type<3; type++){
1416 1416
                     int direction = 0;
1417 1417
                     switch (type) {
1418
-                      case 0: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_P_FOR)) || (pict->pict_type!=FF_P_TYPE))
1418
+                      case 0: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_P_FOR)) || (pict->pict_type!=AV_PICTURE_TYPE_P))
1419 1419
                                 continue;
1420 1420
                               direction = 0;
1421 1421
                               break;
1422
-                      case 1: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_FOR)) || (pict->pict_type!=FF_B_TYPE))
1422
+                      case 1: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_FOR)) || (pict->pict_type!=AV_PICTURE_TYPE_B))
1423 1423
                                 continue;
1424 1424
                               direction = 0;
1425 1425
                               break;
1426
-                      case 2: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_BACK)) || (pict->pict_type!=FF_B_TYPE))
1426
+                      case 2: if ((!(s->avctx->debug_mv&FF_DEBUG_VIS_MV_B_BACK)) || (pict->pict_type!=AV_PICTURE_TYPE_B))
1427 1427
                                 continue;
1428 1428
                               direction = 1;
1429 1429
                               break;
... ...
@@ -1819,7 +1819,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
1819 1819
                         ref_picture, pix_op,
1820 1820
                         s->mv[dir][1][0], s->mv[dir][1][1], block_s, mb_y);
1821 1821
         } else {
1822
-            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != FF_B_TYPE && !s->first_field){
1822
+            if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field){
1823 1823
                 ref_picture= s->current_picture_ptr->data;
1824 1824
             }
1825 1825
 
... ...
@@ -1833,7 +1833,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s,
1833 1833
         for(i=0; i<2; i++){
1834 1834
             uint8_t ** ref2picture;
1835 1835
 
1836
-            if(s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == FF_B_TYPE || s->first_field){
1836
+            if(s->picture_structure == s->field_select[dir][i] + 1 || s->pict_type == AV_PICTURE_TYPE_B || s->first_field){
1837 1837
                 ref2picture= ref_picture;
1838 1838
             }else{
1839 1839
                 ref2picture= s->current_picture_ptr->data;
... ...
@@ -2029,14 +2029,14 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
2029 2029
     else if (!is_mpeg12 && (s->h263_pred || s->h263_aic))
2030 2030
         s->mbintra_table[mb_xy]=1;
2031 2031
 
2032
-    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
2032
+    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
2033 2033
         uint8_t *dest_y, *dest_cb, *dest_cr;
2034 2034
         int dct_linesize, dct_offset;
2035 2035
         op_pixels_func (*op_pix)[4];
2036 2036
         qpel_mc_func (*op_qpix)[16];
2037 2037
         const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics
2038 2038
         const int uvlinesize= s->current_picture.linesize[1];
2039
-        const int readable= s->pict_type != FF_B_TYPE || s->encoding || s->avctx->draw_horiz_band || lowres_flag;
2039
+        const int readable= s->pict_type != AV_PICTURE_TYPE_B || s->encoding || s->avctx->draw_horiz_band || lowres_flag;
2040 2040
         const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8;
2041 2041
 
2042 2042
         /* avoid copy if macroblock skipped in last frame too */
... ...
@@ -2049,7 +2049,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
2049 2049
 
2050 2050
             if (s->mb_skipped) {
2051 2051
                 s->mb_skipped= 0;
2052
-                assert(s->pict_type!=FF_I_TYPE);
2052
+                assert(s->pict_type!=AV_PICTURE_TYPE_I);
2053 2053
 
2054 2054
                 (*mbskip_ptr) ++; /* indicate that this time we skipped it */
2055 2055
                 if(*mbskip_ptr >99) *mbskip_ptr= 99;
... ...
@@ -2105,7 +2105,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
2105 2105
                     }
2106 2106
                 }else{
2107 2107
                     op_qpix= s->me.qpel_put;
2108
-                    if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){
2108
+                    if ((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){
2109 2109
                         op_pix = s->dsp.put_pixels_tab;
2110 2110
                     }else{
2111 2111
                         op_pix = s->dsp.put_no_rnd_pixels_tab;
... ...
@@ -2123,8 +2123,8 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
2123 2123
 
2124 2124
             /* skip dequant / idct if we are really late ;) */
2125 2125
             if(s->avctx->skip_idct){
2126
-                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE)
2127
-                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE)
2126
+                if(  (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B)
2127
+                   ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I)
2128 2128
                    || s->avctx->skip_idct >= AVDISCARD_ALL)
2129 2129
                     goto skip_idct;
2130 2130
             }
... ...
@@ -2287,14 +2287,14 @@ void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
2287 2287
         AVFrame *src;
2288 2288
         int offset[4];
2289 2289
 
2290
-        if(s->pict_type==FF_B_TYPE || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
2290
+        if(s->pict_type==AV_PICTURE_TYPE_B || s->low_delay || (s->avctx->slice_flags&SLICE_FLAG_CODED_ORDER))
2291 2291
             src= (AVFrame*)s->current_picture_ptr;
2292 2292
         else if(s->last_picture_ptr)
2293 2293
             src= (AVFrame*)s->last_picture_ptr;
2294 2294
         else
2295 2295
             return;
2296 2296
 
2297
-        if(s->pict_type==FF_B_TYPE && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
2297
+        if(s->pict_type==AV_PICTURE_TYPE_B && s->picture_structure == PICT_FRAME && s->out_format != FMT_H264){
2298 2298
             offset[0]=
2299 2299
             offset[1]=
2300 2300
             offset[2]=
... ...
@@ -2330,7 +2330,7 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
2330 2330
     s->dest[1] = s->current_picture.data[1] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
2331 2331
     s->dest[2] = s->current_picture.data[2] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift));
2332 2332
 
2333
-    if(!(s->pict_type==FF_B_TYPE && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
2333
+    if(!(s->pict_type==AV_PICTURE_TYPE_B && s->avctx->draw_horiz_band && s->picture_structure==PICT_FRAME))
2334 2334
     {
2335 2335
         if(s->picture_structure==PICT_FRAME){
2336 2336
         s->dest[0] += s->mb_y *   linesize << mb_size;
... ...
@@ -2609,6 +2609,6 @@ void ff_set_qscale(MpegEncContext * s, int qscale)
2609 2609
 
2610 2610
 void MPV_report_decode_progress(MpegEncContext *s)
2611 2611
 {
2612
-    if (s->pict_type != FF_B_TYPE && !s->partitioned_frame)
2612
+    if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame)
2613 2613
         ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0);
2614 2614
 }
... ...
@@ -330,7 +330,7 @@ typedef struct MpegEncContext {
330 330
     int adaptive_quant;         ///< use adaptive quantization
331 331
     int dquant;                 ///< qscale difference to prev qscale
332 332
     int closed_gop;             ///< MPEG1/2 GOP is closed
333
-    int pict_type;              ///< FF_I_TYPE, FF_P_TYPE, FF_B_TYPE, ...
333
+    int pict_type;              ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
334 334
     int last_pict_type; //FIXME removes
335 335
     int last_non_b_pict_type;   ///< used for mpeg4 gmc b-frames & ratecontrol
336 336
     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;
... ...
@@ -968,8 +968,8 @@ static int estimate_best_b_count(MpegEncContext *s){
968 968
     assert(scale>=0 && scale <=3);
969 969
 
970 970
 //    emms_c();
971
-    p_lambda= s->last_lambda_for[FF_P_TYPE]; //s->next_picture_ptr->quality;
972
-    b_lambda= s->last_lambda_for[FF_B_TYPE]; //p_lambda *FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
971
+    p_lambda= s->last_lambda_for[AV_PICTURE_TYPE_P]; //s->next_picture_ptr->quality;
972
+    b_lambda= s->last_lambda_for[AV_PICTURE_TYPE_B]; //p_lambda *FFABS(s->avctx->b_quant_factor) + s->avctx->b_quant_offset;
973 973
     if(!b_lambda) b_lambda= p_lambda; //FIXME we should do this somewhere else
974 974
     lambda2= (b_lambda*b_lambda + (1<<FF_LAMBDA_SHIFT)/2 ) >> FF_LAMBDA_SHIFT;
975 975
 
... ...
@@ -1024,7 +1024,7 @@ static int estimate_best_b_count(MpegEncContext *s){
1024 1024
 
1025 1025
         c->error[0]= c->error[1]= c->error[2]= 0;
1026 1026
 
1027
-        input[0].pict_type= FF_I_TYPE;
1027
+        input[0].pict_type= AV_PICTURE_TYPE_I;
1028 1028
         input[0].quality= 1 * FF_QP2LAMBDA;
1029 1029
         out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[0]);
1030 1030
 //        rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT;
... ...
@@ -1032,7 +1032,7 @@ static int estimate_best_b_count(MpegEncContext *s){
1032 1032
         for(i=0; i<s->max_b_frames+1; i++){
1033 1033
             int is_p= i % (j+1) == j || i==s->max_b_frames;
1034 1034
 
1035
-            input[i+1].pict_type= is_p ? FF_P_TYPE : FF_B_TYPE;
1035
+            input[i+1].pict_type= is_p ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_B;
1036 1036
             input[i+1].quality= is_p ? p_lambda : b_lambda;
1037 1037
             out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[i+1]);
1038 1038
             rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
... ...
@@ -1074,7 +1074,7 @@ static int select_input_picture(MpegEncContext *s){
1074 1074
     if(s->reordered_input_picture[0]==NULL && s->input_picture[0]){
1075 1075
         if(/*s->picture_in_gop_number >= s->gop_size ||*/ s->next_picture_ptr==NULL || s->intra_only){
1076 1076
             s->reordered_input_picture[0]= s->input_picture[0];
1077
-            s->reordered_input_picture[0]->pict_type= FF_I_TYPE;
1077
+            s->reordered_input_picture[0]->pict_type= AV_PICTURE_TYPE_I;
1078 1078
             s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++;
1079 1079
         }else{
1080 1080
             int b_frames;
... ...
@@ -1109,7 +1109,7 @@ static int select_input_picture(MpegEncContext *s){
1109 1109
                     if(pict_num >= s->rc_context.num_entries)
1110 1110
                         break;
1111 1111
                     if(!s->input_picture[i]){
1112
-                        s->rc_context.entry[pict_num-1].new_pict_type = FF_P_TYPE;
1112
+                        s->rc_context.entry[pict_num-1].new_pict_type = AV_PICTURE_TYPE_P;
1113 1113
                         break;
1114 1114
                     }
1115 1115
 
... ...
@@ -1153,10 +1153,10 @@ static int select_input_picture(MpegEncContext *s){
1153 1153
 
1154 1154
             for(i= b_frames - 1; i>=0; i--){
1155 1155
                 int type= s->input_picture[i]->pict_type;
1156
-                if(type && type != FF_B_TYPE)
1156
+                if(type && type != AV_PICTURE_TYPE_B)
1157 1157
                     b_frames= i;
1158 1158
             }
1159
-            if(s->input_picture[b_frames]->pict_type == FF_B_TYPE && b_frames == s->max_b_frames){
1159
+            if(s->input_picture[b_frames]->pict_type == AV_PICTURE_TYPE_B && b_frames == s->max_b_frames){
1160 1160
                 av_log(s->avctx, AV_LOG_ERROR, "warning, too many b frames in a row\n");
1161 1161
             }
1162 1162
 
... ...
@@ -1166,29 +1166,29 @@ static int select_input_picture(MpegEncContext *s){
1166 1166
               }else{
1167 1167
                 if(s->flags & CODEC_FLAG_CLOSED_GOP)
1168 1168
                     b_frames=0;
1169
-                s->input_picture[b_frames]->pict_type= FF_I_TYPE;
1169
+                s->input_picture[b_frames]->pict_type= AV_PICTURE_TYPE_I;
1170 1170
               }
1171 1171
             }
1172 1172
 
1173 1173
             if(   (s->flags & CODEC_FLAG_CLOSED_GOP)
1174 1174
                && b_frames
1175
-               && s->input_picture[b_frames]->pict_type== FF_I_TYPE)
1175
+               && s->input_picture[b_frames]->pict_type== AV_PICTURE_TYPE_I)
1176 1176
                 b_frames--;
1177 1177
 
1178 1178
             s->reordered_input_picture[0]= s->input_picture[b_frames];
1179
-            if(s->reordered_input_picture[0]->pict_type != FF_I_TYPE)
1180
-                s->reordered_input_picture[0]->pict_type= FF_P_TYPE;
1179
+            if(s->reordered_input_picture[0]->pict_type != AV_PICTURE_TYPE_I)
1180
+                s->reordered_input_picture[0]->pict_type= AV_PICTURE_TYPE_P;
1181 1181
             s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++;
1182 1182
             for(i=0; i<b_frames; i++){
1183 1183
                 s->reordered_input_picture[i+1]= s->input_picture[i];
1184
-                s->reordered_input_picture[i+1]->pict_type= FF_B_TYPE;
1184
+                s->reordered_input_picture[i+1]->pict_type= AV_PICTURE_TYPE_B;
1185 1185
                 s->reordered_input_picture[i+1]->coded_picture_number= s->coded_picture_number++;
1186 1186
             }
1187 1187
         }
1188 1188
     }
1189 1189
 no_output_pic:
1190 1190
     if(s->reordered_input_picture[0]){
1191
-        s->reordered_input_picture[0]->reference= s->reordered_input_picture[0]->pict_type!=FF_B_TYPE ? 3 : 0;
1191
+        s->reordered_input_picture[0]->reference= s->reordered_input_picture[0]->pict_type!=AV_PICTURE_TYPE_B ? 3 : 0;
1192 1192
 
1193 1193
         ff_copy_picture(&s->new_picture, s->reordered_input_picture[0]);
1194 1194
 
... ...
@@ -1296,11 +1296,11 @@ vbv_retry:
1296 1296
                         s->lambda_table[i]= FFMAX(s->lambda_table[i]+1, s->lambda_table[i]*(s->qscale+1) / s->qscale);
1297 1297
                 }
1298 1298
                 s->mb_skipped = 0;        //done in MPV_frame_start()
1299
-                if(s->pict_type==FF_P_TYPE){ //done in encode_picture() so we must undo it
1299
+                if(s->pict_type==AV_PICTURE_TYPE_P){ //done in encode_picture() so we must undo it
1300 1300
                     if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)
1301 1301
                         s->no_rounding ^= 1;
1302 1302
                 }
1303
-                if(s->pict_type!=FF_B_TYPE){
1303
+                if(s->pict_type!=AV_PICTURE_TYPE_B){
1304 1304
                     s->time_base= s->last_time_base;
1305 1305
                     s->last_non_b_time= s->time - s->pp_time;
1306 1306
                 }
... ...
@@ -1528,7 +1528,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
1528 1528
 
1529 1529
                 if(s->codec_id==CODEC_ID_MPEG4){
1530 1530
                     if(!s->mb_intra){
1531
-                        if(s->pict_type == FF_B_TYPE){
1531
+                        if(s->pict_type == AV_PICTURE_TYPE_B){
1532 1532
                             if(s->dquant&1 || s->mv_dir&MV_DIRECT)
1533 1533
                                 s->dquant= 0;
1534 1534
                         }
... ...
@@ -1605,7 +1605,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x,
1605 1605
         dest_cb = s->dest[1];
1606 1606
         dest_cr = s->dest[2];
1607 1607
 
1608
-        if ((!s->no_rounding) || s->pict_type==FF_B_TYPE){
1608
+        if ((!s->no_rounding) || s->pict_type==AV_PICTURE_TYPE_B){
1609 1609
             op_pix = s->dsp.put_pixels_tab;
1610 1610
             op_qpix= s->dsp.put_qpel_pixels_tab;
1611 1611
         }else{
... ...
@@ -1995,7 +1995,7 @@ static int estimate_motion_thread(AVCodecContext *c, void *arg){
1995 1995
             s->block_index[3]+=2;
1996 1996
 
1997 1997
             /* compute motion vector & mb_type and store in context */
1998
-            if(s->pict_type==FF_B_TYPE)
1998
+            if(s->pict_type==AV_PICTURE_TYPE_B)
1999 1999
                 ff_estimate_b_frame_motion(s, s->mb_x, s->mb_y);
2000 2000
             else
2001 2001
                 ff_estimate_p_frame_motion(s, s->mb_x, s->mb_y);
... ...
@@ -2393,7 +2393,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2393 2393
                         s->mv[1][0][0] = best_s.mv[1][0][0];
2394 2394
                         s->mv[1][0][1] = best_s.mv[1][0][1];
2395 2395
 
2396
-                        qpi = s->pict_type == FF_B_TYPE ? 2 : 0;
2396
+                        qpi = s->pict_type == AV_PICTURE_TYPE_B ? 2 : 0;
2397 2397
                         for(; qpi<4; qpi++){
2398 2398
                             int dquant= dquant_tab[qpi];
2399 2399
                             qp= last_qp + dquant;
... ...
@@ -2495,7 +2495,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2495 2495
                 s->last_bits= put_bits_count(&s->pb);
2496 2496
 
2497 2497
                 if (CONFIG_H263_ENCODER &&
2498
-                    s->out_format == FMT_H263 && s->pict_type!=FF_B_TYPE)
2498
+                    s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B)
2499 2499
                     ff_h263_update_motion_val(s);
2500 2500
 
2501 2501
                 if(next_block==0){ //FIXME 16 vs linesize16
... ...
@@ -2622,7 +2622,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2622 2622
                 s->last_mv_dir = s->mv_dir;
2623 2623
 
2624 2624
                 if (CONFIG_H263_ENCODER &&
2625
-                    s->out_format == FMT_H263 && s->pict_type!=FF_B_TYPE)
2625
+                    s->out_format == FMT_H263 && s->pict_type!=AV_PICTURE_TYPE_B)
2626 2626
                     ff_h263_update_motion_val(s);
2627 2627
 
2628 2628
                 MPV_decode_mb(s, s->block);
... ...
@@ -2660,7 +2660,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
2660 2660
     }
2661 2661
 
2662 2662
     //not beautiful here but we must write it before flushing so it has to be here
2663
-    if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == FF_I_TYPE)
2663
+    if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == AV_PICTURE_TYPE_I)
2664 2664
         msmpeg4_encode_ext_header(s);
2665 2665
 
2666 2666
     write_slice_end(s);
... ...
@@ -2758,7 +2758,7 @@ static void set_frame_distances(MpegEncContext * s){
2758 2758
     assert(s->current_picture_ptr->pts != AV_NOPTS_VALUE);
2759 2759
     s->time= s->current_picture_ptr->pts*s->avctx->time_base.num;
2760 2760
 
2761
-    if(s->pict_type==FF_B_TYPE){
2761
+    if(s->pict_type==AV_PICTURE_TYPE_B){
2762 2762
         s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
2763 2763
         assert(s->pb_time > 0 && s->pb_time < s->pp_time);
2764 2764
     }else{
... ...
@@ -2791,10 +2791,10 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2791 2791
 
2792 2792
 //    s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME rate distortion
2793 2793
 
2794
-    if(s->pict_type==FF_I_TYPE){
2794
+    if(s->pict_type==AV_PICTURE_TYPE_I){
2795 2795
         if(s->msmpeg4_version >= 3) s->no_rounding=1;
2796 2796
         else                        s->no_rounding=0;
2797
-    }else if(s->pict_type!=FF_B_TYPE){
2797
+    }else if(s->pict_type!=AV_PICTURE_TYPE_B){
2798 2798
         if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4)
2799 2799
             s->no_rounding ^= 1;
2800 2800
     }
... ...
@@ -2804,7 +2804,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2804 2804
             return -1;
2805 2805
         ff_get_2pass_fcode(s);
2806 2806
     }else if(!(s->flags & CODEC_FLAG_QSCALE)){
2807
-        if(s->pict_type==FF_B_TYPE)
2807
+        if(s->pict_type==AV_PICTURE_TYPE_B)
2808 2808
             s->lambda= s->last_lambda_for[s->pict_type];
2809 2809
         else
2810 2810
             s->lambda= s->last_lambda_for[s->last_non_b_pict_type];
... ...
@@ -2820,17 +2820,17 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2820 2820
         return -1;
2821 2821
 
2822 2822
     /* Estimate motion for every MB */
2823
-    if(s->pict_type != FF_I_TYPE){
2823
+    if(s->pict_type != AV_PICTURE_TYPE_I){
2824 2824
         s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8;
2825 2825
         s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8;
2826
-        if(s->pict_type != FF_B_TYPE && s->avctx->me_threshold==0){
2827
-            if((s->avctx->pre_me && s->last_non_b_pict_type==FF_I_TYPE) || s->avctx->pre_me==2){
2826
+        if(s->pict_type != AV_PICTURE_TYPE_B && s->avctx->me_threshold==0){
2827
+            if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){
2828 2828
                 s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
2829 2829
             }
2830 2830
         }
2831 2831
 
2832 2832
         s->avctx->execute(s->avctx, estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
2833
-    }else /* if(s->pict_type == FF_I_TYPE) */{
2833
+    }else /* if(s->pict_type == AV_PICTURE_TYPE_I) */{
2834 2834
         /* I-Frame */
2835 2835
         for(i=0; i<s->mb_stride*s->mb_height; i++)
2836 2836
             s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
... ...
@@ -2847,15 +2847,15 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2847 2847
     s->current_picture.   mb_var_sum= s->current_picture_ptr->   mb_var_sum= s->me.   mb_var_sum_temp;
2848 2848
     emms_c();
2849 2849
 
2850
-    if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == FF_P_TYPE){
2851
-        s->pict_type= FF_I_TYPE;
2850
+    if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == AV_PICTURE_TYPE_P){
2851
+        s->pict_type= AV_PICTURE_TYPE_I;
2852 2852
         for(i=0; i<s->mb_stride*s->mb_height; i++)
2853 2853
             s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA;
2854 2854
 //printf("Scene change detected, encoding as I Frame %d %d\n", s->current_picture.mb_var_sum, s->current_picture.mc_mb_var_sum);
2855 2855
     }
2856 2856
 
2857 2857
     if(!s->umvplus){
2858
-        if(s->pict_type==FF_P_TYPE || s->pict_type==FF_S_TYPE) {
2858
+        if(s->pict_type==AV_PICTURE_TYPE_P || s->pict_type==AV_PICTURE_TYPE_S) {
2859 2859
             s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER);
2860 2860
 
2861 2861
             if(s->flags & CODEC_FLAG_INTERLACED_ME){
... ...
@@ -2877,7 +2877,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2877 2877
             }
2878 2878
         }
2879 2879
 
2880
-        if(s->pict_type==FF_B_TYPE){
2880
+        if(s->pict_type==AV_PICTURE_TYPE_B){
2881 2881
             int a, b;
2882 2882
 
2883 2883
             a = ff_get_best_fcode(s, s->b_forw_mv_table, CANDIDATE_MB_TYPE_FORWARD);
... ...
@@ -2911,7 +2911,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2911 2911
     if (estimate_qp(s, 0) < 0)
2912 2912
         return -1;
2913 2913
 
2914
-    if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==FF_I_TYPE && !(s->flags & CODEC_FLAG_QSCALE))
2914
+    if(s->qscale < 3 && s->max_qcoeff<=128 && s->pict_type==AV_PICTURE_TYPE_I && !(s->flags & CODEC_FLAG_QSCALE))
2915 2915
         s->qscale= 3; //reduce clipping problems
2916 2916
 
2917 2917
     if (s->out_format == FMT_MJPEG) {
... ...
@@ -2931,7 +2931,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
2931 2931
 
2932 2932
     //FIXME var duplication
2933 2933
     s->current_picture_ptr->key_frame=
2934
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE; //FIXME pic_ptr
2934
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I; //FIXME pic_ptr
2935 2935
     s->current_picture_ptr->pict_type=
2936 2936
     s->current_picture.pict_type= s->pict_type;
2937 2937
 
... ...
@@ -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){
... ...
@@ -256,11 +256,11 @@ static int mxpeg_decode_frame(AVCodecContext *avctx,
256 256
                         av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
257 257
                         return AVERROR(ENOMEM);
258 258
                     }
259
-                    jpg->picture_ptr->pict_type = FF_P_TYPE;
259
+                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_P;
260 260
                     jpg->picture_ptr->key_frame = 0;
261 261
                     jpg->got_picture = 1;
262 262
                 } else {
263
-                    jpg->picture_ptr->pict_type = FF_I_TYPE;
263
+                    jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
264 264
                     jpg->picture_ptr->key_frame = 1;
265 265
                 }
266 266
 
... ...
@@ -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 =
... ...
@@ -72,7 +72,7 @@ AVCodecParserContext *av_parser_init(int codec_id)
72 72
         }
73 73
     }
74 74
     s->fetch_timestamp=1;
75
-    s->pict_type = FF_I_TYPE;
75
+    s->pict_type = AV_PICTURE_TYPE_I;
76 76
     s->key_frame = -1;
77 77
     s->convergence_duration = 0;
78 78
     s->dts_sync_point       = INT_MIN;
... ...
@@ -186,7 +186,7 @@ int av_parser_change(AVCodecParserContext *s,
186 186
     *poutbuf_size= buf_size;
187 187
     if(avctx->extradata){
188 188
         if(  (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
189
-            /*||(s->pict_type != FF_I_TYPE && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
189
+            /*||(s->pict_type != AV_PICTURE_TYPE_I && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
190 190
             /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
191 191
             int size= buf_size + avctx->extradata_size;
192 192
             *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];
... ...
@@ -485,7 +485,7 @@ static int decode_frame(AVCodecContext *avctx,
485 485
                     av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
486 486
                     goto fail;
487 487
                 }
488
-                p->pict_type= FF_I_TYPE;
488
+                p->pict_type= AV_PICTURE_TYPE_I;
489 489
                 p->key_frame= 1;
490 490
                 p->interlaced_frame = !!s->interlace_type;
491 491
 
... ...
@@ -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);
... ...
@@ -319,16 +319,16 @@ static int rv20_decode_picture_header(MpegEncContext *s)
319 319
 
320 320
     i= get_bits(&s->gb, 2);
321 321
     switch(i){
322
-    case 0: s->pict_type= FF_I_TYPE; break;
323
-    case 1: s->pict_type= FF_I_TYPE; break; //hmm ...
324
-    case 2: s->pict_type= FF_P_TYPE; break;
325
-    case 3: s->pict_type= FF_B_TYPE; break;
322
+    case 0: s->pict_type= AV_PICTURE_TYPE_I; break;
323
+    case 1: s->pict_type= AV_PICTURE_TYPE_I; break; //hmm ...
324
+    case 2: s->pict_type= AV_PICTURE_TYPE_P; break;
325
+    case 3: s->pict_type= AV_PICTURE_TYPE_B; break;
326 326
     default:
327 327
         av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n");
328 328
         return -1;
329 329
     }
330 330
 
331
-    if(s->last_picture_ptr==NULL && s->pict_type==FF_B_TYPE){
331
+    if(s->last_picture_ptr==NULL && s->pict_type==AV_PICTURE_TYPE_B){
332 332
         av_log(s->avctx, AV_LOG_ERROR, "early B pix\n");
333 333
         return -1;
334 334
     }
... ...
@@ -399,7 +399,7 @@ static int rv20_decode_picture_header(MpegEncContext *s)
399 399
     if(seq - s->time >  0x4000) seq -= 0x8000;
400 400
     if(seq - s->time < -0x4000) seq += 0x8000;
401 401
     if(seq != s->time){
402
-        if(s->pict_type!=FF_B_TYPE){
402
+        if(s->pict_type!=AV_PICTURE_TYPE_B){
403 403
             s->time= seq;
404 404
             s->pp_time= s->time - s->last_non_b_time;
405 405
             s->last_non_b_time= s->time;
... ...
@@ -422,7 +422,7 @@ av_log(s->avctx, AV_LOG_DEBUG, "\n");*/
422 422
 
423 423
     s->f_code = 1;
424 424
     s->unrestricted_mv = 1;
425
-    s->h263_aic= s->pict_type == FF_I_TYPE;
425
+    s->h263_aic= s->pict_type == AV_PICTURE_TYPE_I;
426 426
 //    s->alt_inter_vlc=1;
427 427
 //    s->obmc=1;
428 428
 //    s->umvplus=1;
... ...
@@ -435,7 +435,7 @@ av_log(s->avctx, AV_LOG_DEBUG, "\n");*/
435 435
                    seq, s->mb_x, s->mb_y, s->pict_type, s->qscale, s->no_rounding);
436 436
     }
437 437
 
438
-    assert(s->pict_type != FF_B_TYPE || !s->low_delay);
438
+    assert(s->pict_type != AV_PICTURE_TYPE_B || !s->low_delay);
439 439
 
440 440
     return s->mb_width*s->mb_height - mb_pos;
441 441
 }
... ...
@@ -616,7 +616,7 @@ static int rv10_decode_packet(AVCodecContext *avctx,
616 616
             av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y);
617 617
             return -1;
618 618
         }
619
-        if(s->pict_type != FF_B_TYPE)
619
+        if(s->pict_type != AV_PICTURE_TYPE_B)
620 620
             ff_h263_update_motion_val(s);
621 621
         MPV_decode_mb(s, s->block);
622 622
         if(s->loop_filter)
... ...
@@ -693,7 +693,7 @@ static int rv10_decode_frame(AVCodecContext *avctx,
693 693
         ff_er_frame_end(s);
694 694
         MPV_frame_end(s);
695 695
 
696
-        if (s->pict_type == FF_B_TYPE || s->low_delay) {
696
+        if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
697 697
             *pict= *(AVFrame*)s->current_picture_ptr;
698 698
         } else if (s->last_picture_ptr != NULL) {
699 699
             *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++)
... ...
@@ -2074,7 +2074,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
2074 2074
     ff_init_range_decoder(c, buf, buf_size);
2075 2075
     ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
2076 2076
 
2077
-    s->current_picture.pict_type= FF_I_TYPE; //FIXME I vs. P
2077
+    s->current_picture.pict_type= AV_PICTURE_TYPE_I; //FIXME I vs. P
2078 2078
     if(decode_header(s)<0)
2079 2079
         return -1;
2080 2080
     common_init_after_header(avctx);
... ...
@@ -3651,7 +3651,7 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict)
3651 3651
     coef_sum = (uint64_t)coef_sum * coef_sum >> 16;
3652 3652
     assert(coef_sum < INT_MAX);
3653 3653
 
3654
-    if(pict->pict_type == FF_I_TYPE){
3654
+    if(pict->pict_type == AV_PICTURE_TYPE_I){
3655 3655
         s->m.current_picture.mb_var_sum= coef_sum;
3656 3656
         s->m.current_picture.mc_mb_var_sum= 0;
3657 3657
     }else{
... ...
@@ -3720,7 +3720,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
3720 3720
     if(avctx->flags&CODEC_FLAG_PASS2){
3721 3721
         s->m.pict_type =
3722 3722
         pict->pict_type= s->m.rc_context.entry[avctx->frame_number].new_pict_type;
3723
-        s->keyframe= pict->pict_type==FF_I_TYPE;
3723
+        s->keyframe= pict->pict_type==AV_PICTURE_TYPE_I;
3724 3724
         if(!(avctx->flags&CODEC_FLAG_QSCALE)) {
3725 3725
             pict->quality= ff_rate_estimate_qscale(&s->m, 0);
3726 3726
             if (pict->quality < 0)
... ...
@@ -3729,7 +3729,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
3729 3729
     }else{
3730 3730
         s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0;
3731 3731
         s->m.pict_type=
3732
-        pict->pict_type= s->keyframe ? FF_I_TYPE : FF_P_TYPE;
3732
+        pict->pict_type= s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
3733 3733
     }
3734 3734
 
3735 3735
     if(s->pass1_rc && avctx->frame_number == 0)
... ...
@@ -3748,7 +3748,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
3748 3748
     s->m.current_picture_ptr= &s->m.current_picture;
3749 3749
     s->m.last_picture.pts= s->m.current_picture.pts;
3750 3750
     s->m.current_picture.pts= pict->pts;
3751
-    if(pict->pict_type == FF_P_TYPE){
3751
+    if(pict->pict_type == AV_PICTURE_TYPE_P){
3752 3752
         int block_width = (width +15)>>4;
3753 3753
         int block_height= (height+15)>>4;
3754 3754
         int stride= s->current_picture.linesize[0];
... ...
@@ -3797,13 +3797,13 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
3797 3797
 
3798 3798
 redo_frame:
3799 3799
 
3800
-    if(pict->pict_type == FF_I_TYPE)
3800
+    if(pict->pict_type == AV_PICTURE_TYPE_I)
3801 3801
         s->spatial_decomposition_count= 5;
3802 3802
     else
3803 3803
         s->spatial_decomposition_count= 5;
3804 3804
 
3805 3805
     s->m.pict_type = pict->pict_type;
3806
-    s->qbias= pict->pict_type == FF_P_TYPE ? 2 : 0;
3806
+    s->qbias= pict->pict_type == AV_PICTURE_TYPE_P ? 2 : 0;
3807 3807
 
3808 3808
     common_init_after_header(avctx);
3809 3809
 
... ...
@@ -3836,12 +3836,12 @@ redo_frame:
3836 3836
             predict_plane(s, s->spatial_idwt_buffer, plane_index, 0);
3837 3837
 
3838 3838
             if(   plane_index==0
3839
-               && pict->pict_type == FF_P_TYPE
3839
+               && pict->pict_type == AV_PICTURE_TYPE_P
3840 3840
                && !(avctx->flags&CODEC_FLAG_PASS2)
3841 3841
                && s->m.me.scene_change_score > s->avctx->scenechange_threshold){
3842 3842
                 ff_init_range_encoder(c, buf, buf_size);
3843 3843
                 ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
3844
-                pict->pict_type= FF_I_TYPE;
3844
+                pict->pict_type= AV_PICTURE_TYPE_I;
3845 3845
                 s->keyframe=1;
3846 3846
                 s->current_picture.key_frame=1;
3847 3847
                 goto redo_frame;
... ...
@@ -3887,7 +3887,7 @@ redo_frame:
3887 3887
                     if(!QUANTIZE2)
3888 3888
                         quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias);
3889 3889
                     if(orientation==0)
3890
-                        decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == FF_P_TYPE, 0);
3890
+                        decorrelate(s, b, b->ibuf, b->stride, pict->pict_type == AV_PICTURE_TYPE_P, 0);
3891 3891
                     encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation);
3892 3892
                     assert(b->parent==NULL || b->parent->stride == b->stride*2);
3893 3893
                     if(orientation==0)
... ...
@@ -3914,7 +3914,7 @@ redo_frame:
3914 3914
             predict_plane(s, s->spatial_idwt_buffer, plane_index, 1);
3915 3915
         }else{
3916 3916
             //ME/MC only
3917
-            if(pict->pict_type == FF_I_TYPE){
3917
+            if(pict->pict_type == AV_PICTURE_TYPE_I){
3918 3918
                 for(y=0; y<h; y++){
3919 3919
                     for(x=0; x<w; x++){
3920 3920
                         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,7 +3498,7 @@ 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
 
... ...
@@ -3513,20 +3513,20 @@ static int vc1_decode_frame(AVCodecContext *avctx,
3513 3513
 
3514 3514
     // for skipping the frame
3515 3515
     s->current_picture.pict_type= s->pict_type;
3516
-    s->current_picture.key_frame= s->pict_type == FF_I_TYPE;
3516
+    s->current_picture.key_frame= s->pict_type == AV_PICTURE_TYPE_I;
3517 3517
 
3518 3518
     /* skip B-frames if we don't have reference frames */
3519
-    if(s->last_picture_ptr==NULL && (s->pict_type==FF_B_TYPE || s->dropable)){
3519
+    if(s->last_picture_ptr==NULL && (s->pict_type==AV_PICTURE_TYPE_B || s->dropable)){
3520 3520
         goto err;
3521 3521
     }
3522
-    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE)
3523
-       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE)
3522
+    if(   (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B)
3523
+       || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I)
3524 3524
        ||  avctx->skip_frame >= AVDISCARD_ALL) {
3525 3525
         goto end;
3526 3526
     }
3527 3527
 
3528 3528
     if(s->next_p_frame_damaged){
3529
-        if(s->pict_type==FF_B_TYPE)
3529
+        if(s->pict_type==AV_PICTURE_TYPE_B)
3530 3530
             goto end;
3531 3531
         else
3532 3532
             s->next_p_frame_damaged=0;
... ...
@@ -3570,7 +3570,7 @@ static int vc1_decode_frame(AVCodecContext *avctx,
3570 3570
 
3571 3571
 assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
3572 3572
 assert(s->current_picture.pict_type == s->pict_type);
3573
-    if (s->pict_type == FF_B_TYPE || s->low_delay) {
3573
+    if (s->pict_type == AV_PICTURE_TYPE_B || s->low_delay) {
3574 3574
         *pict= *(AVFrame*)s->current_picture_ptr;
3575 3575
     } else if (s->last_picture_ptr != NULL) {
3576 3576
         *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 {
... ...
@@ -896,7 +896,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
896 896
     if((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE)
897 897
         pkt->dts= AV_NOPTS_VALUE;
898 898
 
899
-    if (st->codec->codec_id != CODEC_ID_H264 && pc && pc->pict_type == FF_B_TYPE)
899
+    if (st->codec->codec_id != CODEC_ID_H264 && pc && pc->pict_type == AV_PICTURE_TYPE_B)
900 900
         //FIXME Set low_delay = 0 when has_b_frames = 1
901 901
         st->codec->has_b_frames = 1;
902 902
 
... ...
@@ -912,7 +912,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
912 912
     /* XXX: need has_b_frame, but cannot get it if the codec is
913 913
         not initialized */
914 914
     if (delay &&
915
-        pc && pc->pict_type != FF_B_TYPE)
915
+        pc && pc->pict_type != AV_PICTURE_TYPE_B)
916 916
         presentation_delayed = 1;
917 917
 
918 918
     if(pkt->pts != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE && pkt->dts > pkt->pts && st->pts_wrap_bits<63
... ...
@@ -1040,7 +1040,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
1040 1040
         /* keyframe computation */
1041 1041
         if (pc->key_frame == 1)
1042 1042
             pkt->flags |= AV_PKT_FLAG_KEY;
1043
-        else if (pc->key_frame == -1 && pc->pict_type == FF_I_TYPE)
1043
+        else if (pc->key_frame == -1 && pc->pict_type == AV_PICTURE_TYPE_I)
1044 1044
             pkt->flags |= AV_PKT_FLAG_KEY;
1045 1045
     }
1046 1046
     if (pc)