Unified · Split
| @@ -1270,7 +1270,7 @@ static void do_video_out(AVFormatContext *s, · 1269 unmodified lines | |||
| 1270 | //av_log(NULL, AV_LOG_DEBUG, "%"PRId64" -> encoder\n", ost->sync_opts); | 1270 | //av_log(NULL, AV_LOG_DEBUG, "%"PRId64" -> encoder\n", ost->sync_opts); |
| 1271 | if (ost->forced_kf_index < ost->forced_kf_count && | 1271 | if (ost->forced_kf_index < ost->forced_kf_count && |
| 1272 | big_picture.pts >= ost->forced_kf_pts[ost->forced_kf_index]) { | 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 | ost->forced_kf_index++; | 1274 | ost->forced_kf_index++; |
| 1275 | } | 1275 | } |
| 1276 | ret = avcodec_encode_video(enc, | 1276 | ret = avcodec_encode_video(enc, |
| @@ -780,11 +780,11 @@ static int decode_frame(AVCodecContext *avctx, · 779 unmodified lines | |||
| 780 | } | 780 | } |
| 781 | 781 | ||
| 782 | if(frame_4cc == AV_RL32("ifr2")){ | 782 | if(frame_4cc == AV_RL32("ifr2")){ |
| 783 | p->pict_type= FF_I_TYPE; | 783 | p->pict_type= AV_PICTURE_TYPE_I; |
| 784 | if(decode_i2_frame(f, buf-4, frame_size) < 0) | 784 | if(decode_i2_frame(f, buf-4, frame_size) < 0) |
| 785 | return -1; | 785 | return -1; |
| 786 | }else if(frame_4cc == AV_RL32("ifrm")){ | 786 | }else if(frame_4cc == AV_RL32("ifrm")){ |
| 787 | p->pict_type= FF_I_TYPE; | 787 | p->pict_type= AV_PICTURE_TYPE_I; |
| 788 | if(decode_i_frame(f, buf, frame_size) < 0) | 788 | if(decode_i_frame(f, buf, frame_size) < 0) |
| 789 | return -1; | 789 | return -1; |
| 790 | }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){ | 790 | }else if(frame_4cc == AV_RL32("pfrm") || frame_4cc == AV_RL32("pfr2")){ |
| @@ -796,7 +796,7 @@ static int decode_frame(AVCodecContext *avctx, · 5 unmodified lines | |||
| 796 | } | 796 | } |
| 797 | } | 797 | } |
| 798 | 798 | ||
| 799 | p->pict_type= FF_P_TYPE; | 799 | p->pict_type= AV_PICTURE_TYPE_P; |
| 800 | if(decode_p_frame(f, buf, frame_size) < 0) | 800 | if(decode_p_frame(f, buf, frame_size) < 0) |
| 801 | return -1; | 801 | return -1; |
| 802 | }else if(frame_4cc == AV_RL32("snd_")){ | 802 | }else if(frame_4cc == AV_RL32("snd_")){ |
| @@ -805,7 +805,7 @@ static int decode_frame(AVCodecContext *avctx, · 2 unmodified lines | |||
| 805 | av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n", buf_size); | 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 | *picture= *p; | 810 | *picture= *p; |
| 811 | *data_size = sizeof(AVPicture); | 811 | *data_size = sizeof(AVPicture); |
| @@ -216,7 +216,7 @@ static av_cold int a64multi_init_encoder(AVCodecContext *avctx) · 215 unmodified lines | |||
| 216 | 216 | ||
| 217 | avcodec_get_frame_defaults(&c->picture); | 217 | avcodec_get_frame_defaults(&c->picture); |
| 218 | avctx->coded_frame = &c->picture; | 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 | avctx->coded_frame->key_frame = 1; | 220 | avctx->coded_frame->key_frame = 1; |
| 221 | if (!avctx->codec_tag) | 221 | if (!avctx->codec_tag) |
| 222 | avctx->codec_tag = AV_RL32("a64m"); | 222 | avctx->codec_tag = AV_RL32("a64m"); |
| @@ -290,7 +290,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, unsigned char *buf, · 67 unmodified lines | |||
| 290 | /* fill up mc_meta_charset with data until lifetime exceeds */ | 290 | /* fill up mc_meta_charset with data until lifetime exceeds */ |
| 291 | if (c->mc_frame_counter < c->mc_lifetime) { | 291 | if (c->mc_frame_counter < c->mc_lifetime) { |
| 292 | *p = *pict; | 292 | *p = *pict; |
| 293 | p->pict_type = FF_I_TYPE; | 293 | p->pict_type = AV_PICTURE_TYPE_I; |
| 294 | p->key_frame = 1; | 294 | p->key_frame = 1; |
| 295 | to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter); | 295 | to_meta_with_crop(avctx, p, meta + 32000 * c->mc_frame_counter); |
| 296 | c->mc_frame_counter++; | 296 | c->mc_frame_counter++; |
| @@ -226,7 +226,7 @@ static int execute_code(AVCodecContext * avctx, int c) · 225 unmodified lines | |||
| 226 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 226 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 227 | return ret; | 227 | return ret; |
| 228 | } | 228 | } |
| 229 | s->frame.pict_type = FF_I_TYPE; | 229 | s->frame.pict_type = AV_PICTURE_TYPE_I; |
| 230 | s->frame.palette_has_changed = 1; | 230 | s->frame.palette_has_changed = 1; |
| 231 | memcpy(s->frame.data[1], ff_cga_palette, 16 * 4); | 231 | memcpy(s->frame.data[1], ff_cga_palette, 16 * 4); |
| 232 | erase_screen(avctx); | 232 | erase_screen(avctx); |
| @@ -323,7 +323,7 @@ static int decode_frame(AVCodecContext *avctx, · 90 unmodified lines | |||
| 323 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 323 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 324 | return ret; | 324 | return ret; |
| 325 | } | 325 | } |
| 326 | s->frame.pict_type = FF_I_TYPE; | 326 | s->frame.pict_type = AV_PICTURE_TYPE_I; |
| 327 | s->frame.palette_has_changed = 1; | 327 | s->frame.palette_has_changed = 1; |
| 328 | memcpy(s->frame.data[1], ff_cga_palette, 16 * 4); | 328 | memcpy(s->frame.data[1], ff_cga_palette, 16 * 4); |
| 329 | 329 | ||
| @@ -405,7 +405,7 @@ static int decode_frame(AVCodecContext *avctx, · 404 unmodified lines | |||
| 405 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 405 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 406 | return -1; | 406 | return -1; |
| 407 | } | 407 | } |
| 408 | p->pict_type= FF_I_TYPE; | 408 | p->pict_type= AV_PICTURE_TYPE_I; |
| 409 | p->key_frame= 1; | 409 | p->key_frame= 1; |
| 410 | 410 | ||
| 411 | av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); | 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, · 58 unmodified lines | |||
| 470 | init_put_bits(&a->pb, buf, buf_size); | 470 | init_put_bits(&a->pb, buf, buf_size); |
| 471 | 471 | ||
| 472 | *p = *pict; | 472 | *p = *pict; |
| 473 | p->pict_type= FF_I_TYPE; | 473 | p->pict_type= AV_PICTURE_TYPE_I; |
| 474 | p->key_frame= 1; | 474 | p->key_frame= 1; |
| 475 | 475 | ||
| 476 | for(mb_y=0; mb_y<a->mb_height2; mb_y++){ | 476 | for(mb_y=0; mb_y<a->mb_height2; mb_y++){ |
| @@ -3920,7 +3920,7 @@ typedef struct AVCodecParserContext { · 3919 unmodified lines | |||
| 3920 | /*! | 3920 | /*! |
| 3921 | * Set by parser to 1 for key frames and 0 for non-key frames. | 3921 | * Set by parser to 1 for key frames and 0 for non-key frames. |
| 3922 | * It is initialized to -1, so if the parser doesn't set this flag, | 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 | * will be used. | 3924 | * will be used. |
| 3925 | */ | 3925 | */ |
| 3926 | int key_frame; | 3926 | int key_frame; |
| @@ -63,7 +63,7 @@ avs_decode_frame(AVCodecContext * avctx, · 62 unmodified lines | |||
| 63 | return -1; | 63 | return -1; |
| 64 | } | 64 | } |
| 65 | p->reference = 1; | 65 | p->reference = 1; |
| 66 | p->pict_type = FF_P_TYPE; | 66 | p->pict_type = AV_PICTURE_TYPE_P; |
| 67 | p->key_frame = 0; | 67 | p->key_frame = 0; |
| 68 | 68 | ||
| 69 | out = avs->picture.data[0]; | 69 | out = avs->picture.data[0]; |
| @@ -93,7 +93,7 @@ avs_decode_frame(AVCodecContext * avctx, · 23 unmodified lines | |||
| 93 | 93 | ||
| 94 | switch (sub_type) { | 94 | switch (sub_type) { |
| 95 | case AVS_I_FRAME: | 95 | case AVS_I_FRAME: |
| 96 | p->pict_type = FF_I_TYPE; | 96 | p->pict_type = AV_PICTURE_TYPE_I; |
| 97 | p->key_frame = 1; | 97 | p->key_frame = 1; |
| 98 | case AVS_P_FRAME_3X3: | 98 | case AVS_P_FRAME_3X3: |
| 99 | vect_w = 3; | 99 | vect_w = 3; |
| @@ -69,7 +69,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data, · 68 unmodified lines | |||
| 69 | 69 | ||
| 70 | /* Set frame parameters and palette, if necessary */ | 70 | /* Set frame parameters and palette, if necessary */ |
| 71 | if (!avctx->frame_number) { | 71 | if (!avctx->frame_number) { |
| 72 | bfi->frame.pict_type = FF_I_TYPE; | 72 | bfi->frame.pict_type = AV_PICTURE_TYPE_I; |
| 73 | bfi->frame.key_frame = 1; | 73 | bfi->frame.key_frame = 1; |
| 74 | /* Setting the palette */ | 74 | /* Setting the palette */ |
| 75 | if(avctx->extradata_size>768) { | 75 | if(avctx->extradata_size>768) { |
| @@ -89,7 +89,7 @@ static int bfi_decode_frame(AVCodecContext * avctx, void *data, · 13 unmodified lines | |||
| 89 | memcpy(bfi->pal, bfi->frame.data[1], sizeof(bfi->pal)); | 89 | memcpy(bfi->pal, bfi->frame.data[1], sizeof(bfi->pal)); |
| 90 | bfi->frame.palette_has_changed = 1; | 90 | bfi->frame.palette_has_changed = 1; |
| 91 | } else { | 91 | } else { |
| 92 | bfi->frame.pict_type = FF_P_TYPE; | 92 | bfi->frame.pict_type = AV_PICTURE_TYPE_P; |
| 93 | bfi->frame.key_frame = 0; | 93 | bfi->frame.key_frame = 0; |
| 94 | bfi->frame.palette_has_changed = 0; | 94 | bfi->frame.palette_has_changed = 0; |
| 95 | memcpy(bfi->frame.data[1], bfi->pal, sizeof(bfi->pal)); | 95 | memcpy(bfi->frame.data[1], bfi->pal, sizeof(bfi->pal)); |
| @@ -200,7 +200,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, · 199 unmodified lines | |||
| 200 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 200 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 201 | return -1; | 201 | return -1; |
| 202 | } | 202 | } |
| 203 | p->pict_type = FF_I_TYPE; | 203 | p->pict_type = AV_PICTURE_TYPE_I; |
| 204 | p->key_frame = 1; | 204 | p->key_frame = 1; |
| 205 | 205 | ||
| 206 | buf = buf0 + hsize; | 206 | buf = buf0 + hsize; |
| @@ -74,7 +74,7 @@ static int bmp_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_s · 73 unmodified lines | |||
| 74 | uint8_t *ptr; | 74 | uint8_t *ptr; |
| 75 | unsigned char* buf0 = buf; | 75 | unsigned char* buf0 = buf; |
| 76 | *p = *pict; | 76 | *p = *pict; |
| 77 | p->pict_type= FF_I_TYPE; | 77 | p->pict_type= AV_PICTURE_TYPE_I; |
| 78 | p->key_frame= 1; | 78 | p->key_frame= 1; |
| 79 | switch (avctx->pix_fmt) { | 79 | switch (avctx->pix_fmt) { |
| 80 | case PIX_FMT_RGB565: | 80 | case PIX_FMT_RGB565: |
| @@ -137,10 +137,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, · 136 unmodified lines | |||
| 137 | stride = newpic->linesize[0]; | 137 | stride = newpic->linesize[0]; |
| 138 | 138 | ||
| 139 | if (buf[0] & C93_FIRST_FRAME) { | 139 | if (buf[0] & C93_FIRST_FRAME) { |
| 140 | newpic->pict_type = FF_I_TYPE; | 140 | newpic->pict_type = AV_PICTURE_TYPE_I; |
| 141 | newpic->key_frame = 1; | 141 | newpic->key_frame = 1; |
| 142 | } else { | 142 | } else { |
| 143 | newpic->pict_type = FF_P_TYPE; | 143 | newpic->pict_type = AV_PICTURE_TYPE_P; |
| 144 | newpic->key_frame = 0; | 144 | newpic->key_frame = 0; |
| 145 | } | 145 | } |
| 146 | 146 | ||
| @@ -278,7 +278,7 @@ static inline void set_mv_intra(AVSContext *h) { · 277 unmodified lines | |||
| 278 | set_mvs(&h->mv[MV_FWD_X0], BLK_16X16); | 278 | set_mvs(&h->mv[MV_FWD_X0], BLK_16X16); |
| 279 | h->mv[MV_BWD_X0] = ff_cavs_intra_mv; | 279 | h->mv[MV_BWD_X0] = ff_cavs_intra_mv; |
| 280 | set_mvs(&h->mv[MV_BWD_X0], BLK_16X16); | 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 | h->col_type_base[h->mbidx] = I_8X8; | 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) { · 219 unmodified lines | |||
| 220 | ff_cavs_modify_mb_i(h, &pred_mode_uv); | 220 | ff_cavs_modify_mb_i(h, &pred_mode_uv); |
| 221 | 221 | ||
| 222 | /* get coded block pattern */ | 222 | /* get coded block pattern */ |
| 223 | if(h->pic_type == FF_I_TYPE) | 223 | if(h->pic_type == AV_PICTURE_TYPE_I) |
| 224 | cbp_code = get_ue_golomb(gb); | 224 | cbp_code = get_ue_golomb(gb); |
| 225 | if(cbp_code > 63){ | 225 | if(cbp_code > 63){ |
| 226 | av_log(h->s.avctx, AV_LOG_ERROR, "illegal intra cbp\n"); | 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) { · 197 unmodified lines | |||
| 424 | h->qp = get_bits(gb,6); | 424 | h->qp = get_bits(gb,6); |
| 425 | } | 425 | } |
| 426 | /* inter frame or second slice can have weighting params */ | 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 | if(get_bits1(gb)) { //slice_weighting_flag | 428 | if(get_bits1(gb)) { //slice_weighting_flag |
| 429 | av_log(h->s.avctx, AV_LOG_ERROR, | 429 | av_log(h->s.avctx, AV_LOG_ERROR, |
| 430 | "weighted prediction not yet supported\n"); | 430 | "weighted prediction not yet supported\n"); |
| @@ -470,17 +470,17 @@ static int decode_pic(AVSContext *h) { · 39 unmodified lines | |||
| 470 | } | 470 | } |
| 471 | skip_bits(&s->gb,16);//bbv_dwlay | 471 | skip_bits(&s->gb,16);//bbv_dwlay |
| 472 | if(h->stc == PIC_PB_START_CODE) { | 472 | if(h->stc == PIC_PB_START_CODE) { |
| 473 | h->pic_type = get_bits(&s->gb,2) + FF_I_TYPE; | 473 | h->pic_type = get_bits(&s->gb,2) + AV_PICTURE_TYPE_I; |
| 474 | if(h->pic_type > FF_B_TYPE) { | 474 | if(h->pic_type > AV_PICTURE_TYPE_B) { |
| 475 | av_log(s->avctx, AV_LOG_ERROR, "illegal picture type\n"); | 475 | av_log(s->avctx, AV_LOG_ERROR, "illegal picture type\n"); |
| 476 | return -1; | 476 | return -1; |
| 477 | } | 477 | } |
| 478 | /* make sure we have the reference frames we need */ | 478 | /* make sure we have the reference frames we need */ |
| 479 | if(!h->DPB[0].data[0] || | 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 | return -1; | 481 | return -1; |
| 482 | } else { | 482 | } else { |
| 483 | h->pic_type = FF_I_TYPE; | 483 | h->pic_type = AV_PICTURE_TYPE_I; |
| 484 | if(get_bits1(&s->gb)) | 484 | if(get_bits1(&s->gb)) |
| 485 | skip_bits(&s->gb,24);//time_code | 485 | skip_bits(&s->gb,24);//time_code |
| 486 | /* old sample clips were all progressive and no low_delay, | 486 | /* old sample clips were all progressive and no low_delay, |
| @@ -502,7 +502,7 @@ static int decode_pic(AVSContext *h) { · 15 unmodified lines | |||
| 502 | h->picture.poc = get_bits(&s->gb,8)*2; | 502 | h->picture.poc = get_bits(&s->gb,8)*2; |
| 503 | 503 | ||
| 504 | /* get temporal distances and MV scaling factors */ | 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 | h->dist[0] = (h->picture.poc - h->DPB[0].poc + 512) % 512; | 506 | h->dist[0] = (h->picture.poc - h->DPB[0].poc + 512) % 512; |
| 507 | } else { | 507 | } else { |
| 508 | h->dist[0] = (h->DPB[0].poc - h->picture.poc + 512) % 512; | 508 | h->dist[0] = (h->DPB[0].poc - h->picture.poc + 512) % 512; |
| @@ -510,7 +510,7 @@ static int decode_pic(AVSContext *h) { · 1 unmodified line | |||
| 510 | h->dist[1] = (h->picture.poc - h->DPB[1].poc + 512) % 512; | 510 | h->dist[1] = (h->picture.poc - h->DPB[1].poc + 512) % 512; |
| 511 | h->scale_den[0] = h->dist[0] ? 512/h->dist[0] : 0; | 511 | h->scale_den[0] = h->dist[0] ? 512/h->dist[0] : 0; |
| 512 | h->scale_den[1] = h->dist[1] ? 512/h->dist[1] : 0; | 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 | h->sym_factor = h->dist[0]*h->scale_den[1]; | 514 | h->sym_factor = h->dist[0]*h->scale_den[1]; |
| 515 | } else { | 515 | } else { |
| 516 | h->direct_den[0] = h->dist[0] ? 16384/h->dist[0] : 0; | 516 | h->direct_den[0] = h->dist[0] ? 16384/h->dist[0] : 0; |
| @@ -529,12 +529,12 @@ static int decode_pic(AVSContext *h) { · 12 unmodified lines | |||
| 529 | skip_bits1(&s->gb); //repeat_first_field | 529 | skip_bits1(&s->gb); //repeat_first_field |
| 530 | h->qp_fixed = get_bits1(&s->gb); | 530 | h->qp_fixed = get_bits1(&s->gb); |
| 531 | h->qp = get_bits(&s->gb,6); | 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 | if(!h->progressive && !h->pic_structure) | 533 | if(!h->progressive && !h->pic_structure) |
| 534 | skip_bits1(&s->gb);//what is this? | 534 | skip_bits1(&s->gb);//what is this? |
| 535 | skip_bits(&s->gb,4); //reserved bits | 535 | skip_bits(&s->gb,4); //reserved bits |
| 536 | } else { | 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 | h->ref_flag = get_bits1(&s->gb); | 538 | h->ref_flag = get_bits1(&s->gb); |
| 539 | skip_bits(&s->gb,4); //reserved bits | 539 | skip_bits(&s->gb,4); //reserved bits |
| 540 | h->skip_mode_flag = get_bits1(&s->gb); | 540 | h->skip_mode_flag = get_bits1(&s->gb); |
| @@ -546,12 +546,12 @@ static int decode_pic(AVSContext *h) { · 5 unmodified lines | |||
| 546 | } else { | 546 | } else { |
| 547 | h->alpha_offset = h->beta_offset = 0; | 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 | do { | 550 | do { |
| 551 | check_for_slice(h); | 551 | check_for_slice(h); |
| 552 | decode_mb_i(h, 0); | 552 | decode_mb_i(h, 0); |
| 553 | } while(ff_cavs_next_mb(h)); | 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 | do { | 555 | do { |
| 556 | if(check_for_slice(h)) | 556 | if(check_for_slice(h)) |
| 557 | skip_count = -1; | 557 | skip_count = -1; |
| @@ -567,7 +567,7 @@ static int decode_pic(AVSContext *h) { · 9 unmodified lines | |||
| 567 | decode_mb_p(h,mb_type); | 567 | decode_mb_p(h,mb_type); |
| 568 | } | 568 | } |
| 569 | } while(ff_cavs_next_mb(h)); | 569 | } while(ff_cavs_next_mb(h)); |
| 570 | } else { /* FF_B_TYPE */ | 570 | } else { /* AV_PICTURE_TYPE_B */ |
| 571 | do { | 571 | do { |
| 572 | if(check_for_slice(h)) | 572 | if(check_for_slice(h)) |
| 573 | skip_count = -1; | 573 | skip_count = -1; |
| @@ -584,7 +584,7 @@ static int decode_pic(AVSContext *h) { · 10 unmodified lines | |||
| 584 | } | 584 | } |
| 585 | } while(ff_cavs_next_mb(h)); | 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 | if(h->DPB[1].data[0]) | 588 | if(h->DPB[1].data[0]) |
| 589 | s->avctx->release_buffer(s->avctx, (AVFrame *)&h->DPB[1]); | 589 | s->avctx->release_buffer(s->avctx, (AVFrame *)&h->DPB[1]); |
| 590 | h->DPB[1] = h->DPB[0]; | 590 | h->DPB[1] = h->DPB[0]; |
| @@ -684,7 +684,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, · 93 unmodified lines | |||
| 684 | if(decode_pic(h)) | 684 | if(decode_pic(h)) |
| 685 | break; | 685 | break; |
| 686 | *data_size = sizeof(AVPicture); | 686 | *data_size = sizeof(AVPicture); |
| 687 | if(h->pic_type != FF_B_TYPE) { | 687 | if(h->pic_type != AV_PICTURE_TYPE_B) { |
| 688 | if(h->DPB[1].data[0]) { | 688 | if(h->DPB[1].data[0]) { |
| 689 | *picture = *(AVFrame *) &h->DPB[1]; | 689 | *picture = *(AVFrame *) &h->DPB[1]; |
| 690 | } else { | 690 | } else { |
| @@ -64,7 +64,7 @@ static int decode_frame(AVCodecContext *avctx, · 63 unmodified lines | |||
| 64 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 64 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 65 | return -1; | 65 | return -1; |
| 66 | } | 66 | } |
| 67 | p->pict_type= FF_I_TYPE; | 67 | p->pict_type= AV_PICTURE_TYPE_I; |
| 68 | p->key_frame= 1; | 68 | p->key_frame= 1; |
| 69 | 69 | ||
| 70 | init_get_bits(&a->gb, buf, buf_size); | 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, · 29 unmodified lines | |||
| 100 | int size; | 100 | int size; |
| 101 | 101 | ||
| 102 | *p = *pict; | 102 | *p = *pict; |
| 103 | p->pict_type= FF_I_TYPE; | 103 | p->pict_type= AV_PICTURE_TYPE_I; |
| 104 | p->key_frame= 1; | 104 | p->key_frame= 1; |
| 105 | 105 | ||
| 106 | emms_c(); | 106 | emms_c(); |
| @@ -183,7 +183,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 182 unmodified lines | |||
| 183 | 183 | ||
| 184 | // flip upside down, add difference frame | 184 | // flip upside down, add difference frame |
| 185 | if (buf[0] & 1) { // keyframe | 185 | if (buf[0] & 1) { // keyframe |
| 186 | c->pic.pict_type = FF_I_TYPE; | 186 | c->pic.pict_type = AV_PICTURE_TYPE_I; |
| 187 | c->pic.key_frame = 1; | 187 | c->pic.key_frame = 1; |
| 188 | switch (c->bpp) { | 188 | switch (c->bpp) { |
| 189 | case 16: | 189 | case 16: |
| @@ -197,7 +197,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 7 unmodified lines | |||
| 197 | c->linelen, c->height); | 197 | c->linelen, c->height); |
| 198 | } | 198 | } |
| 199 | } else { | 199 | } else { |
| 200 | c->pic.pict_type = FF_P_TYPE; | 200 | c->pic.pict_type = AV_PICTURE_TYPE_P; |
| 201 | c->pic.key_frame = 0; | 201 | c->pic.key_frame = 0; |
| 202 | switch (c->bpp) { | 202 | switch (c->bpp) { |
| 203 | case 16: | 203 | case 16: |
| @@ -194,7 +194,7 @@ static int dirac_combine_frame(AVCodecParserContext *s, AVCodecContext *avctx, · 193 unmodified lines | |||
| 194 | avctx->has_b_frames = 1; | 194 | avctx->has_b_frames = 1; |
| 195 | } | 195 | } |
| 196 | if (avctx->has_b_frames && s->pts == s->dts) | 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 | /* Finally have a complete Dirac data unit */ | 199 | /* Finally have a complete Dirac data unit */ |
| 200 | *buf = pc->dirac_unit; | 200 | *buf = pc->dirac_unit; |
| @@ -55,7 +55,7 @@ static av_cold int dnxhd_decode_init(AVCodecContext *avctx) · 54 unmodified lines | |||
| 55 | ctx->avctx = avctx; | 55 | ctx->avctx = avctx; |
| 56 | dsputil_init(&ctx->dsp, avctx); | 56 | dsputil_init(&ctx->dsp, avctx); |
| 57 | avctx->coded_frame = &ctx->picture; | 57 | avctx->coded_frame = &ctx->picture; |
| 58 | ctx->picture.type = FF_I_TYPE; | 58 | ctx->picture.type = AV_PICTURE_TYPE_I; |
| 59 | ctx->picture.key_frame = 1; | 59 | ctx->picture.key_frame = 1; |
| 60 | return 0; | 60 | return 0; |
| 61 | } | 61 | } |
| @@ -222,7 +222,7 @@ static int dnxhd_encode_init(AVCodecContext *avctx) · 221 unmodified lines | |||
| 222 | FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_qscale, ctx->m.mb_num *sizeof(uint8_t) , fail); | 222 | FF_ALLOCZ_OR_GOTO(ctx->m.avctx, ctx->mb_qscale, ctx->m.mb_num *sizeof(uint8_t) , fail); |
| 223 | 223 | ||
| 224 | ctx->frame.key_frame = 1; | 224 | ctx->frame.key_frame = 1; |
| 225 | ctx->frame.pict_type = FF_I_TYPE; | 225 | ctx->frame.pict_type = AV_PICTURE_TYPE_I; |
| 226 | ctx->m.avctx->coded_frame = &ctx->frame; | 226 | ctx->m.avctx->coded_frame = &ctx->frame; |
| 227 | 227 | ||
| 228 | if (avctx->thread_count > MAX_THREADS) { | 228 | if (avctx->thread_count > MAX_THREADS) { |
| @@ -35,7 +35,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 34 unmodified lines | |||
| 35 | DPXContext *s = avctx->priv_data; | 35 | DPXContext *s = avctx->priv_data; |
| 36 | 36 | ||
| 37 | avctx->coded_frame = &s->picture; | 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 | avctx->coded_frame->key_frame = 1; | 39 | avctx->coded_frame->key_frame = 1; |
| 40 | 40 | ||
| 41 | s->big_endian = 1; | 41 | s->big_endian = 1; |
| @@ -1095,7 +1095,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, · 1094 unmodified lines | |||
| 1095 | 1095 | ||
| 1096 | s->picture.reference = 0; | 1096 | s->picture.reference = 0; |
| 1097 | s->picture.key_frame = 1; | 1097 | s->picture.key_frame = 1; |
| 1098 | s->picture.pict_type = FF_I_TYPE; | 1098 | s->picture.pict_type = AV_PICTURE_TYPE_I; |
| 1099 | avctx->pix_fmt = s->sys->pix_fmt; | 1099 | avctx->pix_fmt = s->sys->pix_fmt; |
| 1100 | avctx->time_base = s->sys->time_base; | 1100 | avctx->time_base = s->sys->time_base; |
| 1101 | avcodec_set_dimensions(avctx, s->sys->width, s->sys->height); | 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, · 162 unmodified lines | |||
| 1264 | c->pix_fmt = s->sys->pix_fmt; | 1264 | c->pix_fmt = s->sys->pix_fmt; |
| 1265 | s->picture = *((AVFrame *)data); | 1265 | s->picture = *((AVFrame *)data); |
| 1266 | s->picture.key_frame = 1; | 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 | s->buf = buf; | 1269 | s->buf = buf; |
| 1270 | c->execute(c, dv_encode_video_segment, s->sys->work_chunks, NULL, | 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 · 239 unmodified lines | |||
| 240 | switch(compr){ | 240 | switch(compr){ |
| 241 | case -1: | 241 | case -1: |
| 242 | c->pic.key_frame = 0; | 242 | c->pic.key_frame = 0; |
| 243 | c->pic.pict_type = FF_P_TYPE; | 243 | c->pic.pict_type = AV_PICTURE_TYPE_P; |
| 244 | if(c->prev.data[0]) | 244 | if(c->prev.data[0]) |
| 245 | memcpy(c->pic.data[0], c->prev.data[0], c->pic.linesize[0] * avctx->height); | 245 | memcpy(c->pic.data[0], c->prev.data[0], c->pic.linesize[0] * avctx->height); |
| 246 | else{ // Should happen only when first frame is 'NULL' | 246 | else{ // Should happen only when first frame is 'NULL' |
| 247 | memset(c->pic.data[0], 0, c->pic.linesize[0] * avctx->height); | 247 | memset(c->pic.data[0], 0, c->pic.linesize[0] * avctx->height); |
| 248 | c->pic.key_frame = 1; | 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 | break; | 251 | break; |
| 252 | case 2: | 252 | case 2: |
| @@ -254,7 +254,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 1 unmodified line | |||
| 254 | case 4: | 254 | case 4: |
| 255 | case 5: | 255 | case 5: |
| 256 | c->pic.key_frame = !(compr & 1); | 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 | for(j = 0; j < avctx->height; j++){ | 258 | for(j = 0; j < avctx->height; j++){ |
| 259 | if(compr & 1){ | 259 | if(compr & 1){ |
| 260 | for(i = 0; i < avctx->width; i++) | 260 | for(i = 0; i < avctx->width; i++) |
| @@ -269,7 +269,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 8 unmodified lines | |||
| 269 | case 12: // ScummVM coding | 269 | case 12: // ScummVM coding |
| 270 | case 13: | 270 | case 13: |
| 271 | c->pic.key_frame = 0; | 271 | c->pic.key_frame = 0; |
| 272 | c->pic.pict_type = FF_P_TYPE; | 272 | c->pic.pict_type = AV_PICTURE_TYPE_P; |
| 273 | decode_13(avctx, c, c->pic.data[0], srcptr, c->prev.data[0]); | 273 | decode_13(avctx, c, c->pic.data[0], srcptr, c->prev.data[0]); |
| 274 | break; | 274 | break; |
| 275 | default: | 275 | default: |
| @@ -246,7 +246,7 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice, · 245 unmodified lines | |||
| 246 | slice->slice_qs_delta = 0; /* XXX not implemented by FFmpeg */ | 246 | slice->slice_qs_delta = 0; /* XXX not implemented by FFmpeg */ |
| 247 | slice->slice_qp_delta = s->qscale - h->pps.init_qp; | 247 | slice->slice_qp_delta = s->qscale - h->pps.init_qp; |
| 248 | slice->redundant_pic_cnt = h->redundant_pic_count; | 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 | slice->direct_spatial_mv_pred_flag = h->direct_spatial_mv_pred; | 250 | slice->direct_spatial_mv_pred_flag = h->direct_spatial_mv_pred; |
| 251 | slice->cabac_init_idc = h->pps.cabac ? h->cabac_init_idc : 0; | 251 | slice->cabac_init_idc = h->pps.cabac ? h->cabac_init_idc : 0; |
| 252 | if (h->deblocking_filter < 2) | 252 | if (h->deblocking_filter < 2) |
| @@ -403,7 +403,7 @@ static int decode_slice(AVCodecContext *avctx, · 150 unmodified lines | |||
| 403 | position, size); | 403 | position, size); |
| 404 | ctx_pic->slice_count++; | 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 | ctx_pic->pp.wBitFields &= ~(1 << 15); /* Set IntraPicFlag to 0 */ | 407 | ctx_pic->pp.wBitFields &= ~(1 << 15); /* Set IntraPicFlag to 0 */ |
| 408 | return 0; | 408 | return 0; |
| 409 | } | 409 | } |
| @@ -44,11 +44,11 @@ static void fill_picture_parameters(AVCodecContext *avctx, · 43 unmodified lines | |||
| 44 | memset(pp, 0, sizeof(*pp)); | 44 | memset(pp, 0, sizeof(*pp)); |
| 45 | pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture); | 45 | pp->wDecodedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture); |
| 46 | pp->wDeblockedPictureIndex = 0; | 46 | pp->wDeblockedPictureIndex = 0; |
| 47 | if (s->pict_type != FF_I_TYPE) | 47 | if (s->pict_type != AV_PICTURE_TYPE_I) |
| 48 | pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture); | 48 | pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture); |
| 49 | else | 49 | else |
| 50 | pp->wForwardRefPictureIndex = 0xffff; | 50 | pp->wForwardRefPictureIndex = 0xffff; |
| 51 | if (s->pict_type == FF_B_TYPE) | 51 | if (s->pict_type == AV_PICTURE_TYPE_B) |
| 52 | pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture); | 52 | pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture); |
| 53 | else | 53 | else |
| 54 | pp->wBackwardRefPictureIndex = 0xffff; | 54 | pp->wBackwardRefPictureIndex = 0xffff; |
| @@ -61,8 +61,8 @@ static void fill_picture_parameters(AVCodecContext *avctx, · 6 unmodified lines | |||
| 61 | pp->bBPPminus1 = 7; | 61 | pp->bBPPminus1 = 7; |
| 62 | pp->bPicStructure = s->picture_structure; | 62 | pp->bPicStructure = s->picture_structure; |
| 63 | pp->bSecondField = is_field && !s->first_field; | 63 | pp->bSecondField = is_field && !s->first_field; |
| 64 | pp->bPicIntra = s->pict_type == FF_I_TYPE; | 64 | pp->bPicIntra = s->pict_type == AV_PICTURE_TYPE_I; |
| 65 | pp->bPicBackwardPrediction = s->pict_type == FF_B_TYPE; | 65 | pp->bPicBackwardPrediction = s->pict_type == AV_PICTURE_TYPE_B; |
| 66 | pp->bBidirectionalAveragingMode = 0; | 66 | pp->bBidirectionalAveragingMode = 0; |
| 67 | pp->bMVprecisionAndChromaRelation= 0; /* FIXME */ | 67 | pp->bMVprecisionAndChromaRelation= 0; /* FIXME */ |
| 68 | pp->bChromaFormat = s->chroma_format; | 68 | pp->bChromaFormat = s->chroma_format; |
| @@ -42,11 +42,11 @@ static void fill_picture_parameters(AVCodecContext *avctx, · 41 unmodified lines | |||
| 42 | memset(pp, 0, sizeof(*pp)); | 42 | memset(pp, 0, sizeof(*pp)); |
| 43 | pp->wDecodedPictureIndex = | 43 | pp->wDecodedPictureIndex = |
| 44 | pp->wDeblockedPictureIndex = ff_dxva2_get_surface_index(ctx, current_picture); | 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 | pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture); | 46 | pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->last_picture); |
| 47 | else | 47 | else |
| 48 | pp->wForwardRefPictureIndex = 0xffff; | 48 | pp->wForwardRefPictureIndex = 0xffff; |
| 49 | if (s->pict_type == FF_B_TYPE) | 49 | if (s->pict_type == AV_PICTURE_TYPE_B) |
| 50 | pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture); | 50 | pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(ctx, &s->next_picture); |
| 51 | else | 51 | else |
| 52 | pp->wBackwardRefPictureIndex = 0xffff; | 52 | pp->wBackwardRefPictureIndex = 0xffff; |
| @@ -69,8 +69,8 @@ static void fill_picture_parameters(AVCodecContext *avctx, · 16 unmodified lines | |||
| 69 | if (s->picture_structure & PICT_BOTTOM_FIELD) | 69 | if (s->picture_structure & PICT_BOTTOM_FIELD) |
| 70 | pp->bPicStructure |= 0x02; | 70 | pp->bPicStructure |= 0x02; |
| 71 | pp->bSecondField = v->interlace && v->fcm != 0x03 && !s->first_field; | 71 | pp->bSecondField = v->interlace && v->fcm != 0x03 && !s->first_field; |
| 72 | pp->bPicIntra = s->pict_type == FF_I_TYPE; | 72 | pp->bPicIntra = s->pict_type == AV_PICTURE_TYPE_I; |
| 73 | pp->bPicBackwardPrediction = s->pict_type == FF_B_TYPE; | 73 | pp->bPicBackwardPrediction = s->pict_type == AV_PICTURE_TYPE_B; |
| 74 | pp->bBidirectionalAveragingMode = (1 << 7) | | 74 | pp->bBidirectionalAveragingMode = (1 << 7) | |
| 75 | ((ctx->cfg->ConfigIntraResidUnsigned != 0) << 6) | | 75 | ((ctx->cfg->ConfigIntraResidUnsigned != 0) << 6) | |
| 76 | ((ctx->cfg->ConfigResidDiffAccelerator != 0) << 5) | | 76 | ((ctx->cfg->ConfigResidDiffAccelerator != 0) << 5) | |
| @@ -108,10 +108,10 @@ static void fill_picture_parameters(AVCodecContext *avctx, · 31 unmodified lines | |||
| 108 | (v->interlace << 5) | | 108 | (v->interlace << 5) | |
| 109 | (v->tfcntrflag << 4) | | 109 | (v->tfcntrflag << 4) | |
| 110 | (v->finterpflag << 3) | | 110 | (v->finterpflag << 3) | |
| 111 | ((s->pict_type != FF_B_TYPE) << 2) | | 111 | ((s->pict_type != AV_PICTURE_TYPE_B) << 2) | |
| 112 | (v->psf << 1) | | 112 | (v->psf << 1) | |
| 113 | (v->extended_dmv ); | 113 | (v->extended_dmv ); |
| 114 | if (s->pict_type != FF_I_TYPE) | 114 | if (s->pict_type != AV_PICTURE_TYPE_I) |
| 115 | pp->bPic4MVallowed = v->mv_mode == MV_PMODE_MIXED_MV || | 115 | pp->bPic4MVallowed = v->mv_mode == MV_PMODE_MIXED_MV || |
| 116 | (v->mv_mode == MV_PMODE_INTENSITY_COMP && | 116 | (v->mv_mode == MV_PMODE_INTENSITY_COMP && |
| 117 | v->mv_mode2 == MV_PMODE_MIXED_MV); | 117 | v->mv_mode2 == MV_PMODE_MIXED_MV); |
| @@ -180,10 +180,10 @@ static int cmv_decode_frame(AVCodecContext *avctx, · 179 unmodified lines | |||
| 180 | if ((buf[0]&1)) { // subtype | 180 | if ((buf[0]&1)) { // subtype |
| 181 | cmv_decode_inter(s, buf+2, buf_end); | 181 | cmv_decode_inter(s, buf+2, buf_end); |
| 182 | s->frame.key_frame = 0; | 182 | s->frame.key_frame = 0; |
| 183 | s->frame.pict_type = FF_P_TYPE; | 183 | s->frame.pict_type = AV_PICTURE_TYPE_P; |
| 184 | }else{ | 184 | }else{ |
| 185 | s->frame.key_frame = 1; | 185 | s->frame.key_frame = 1; |
| 186 | s->frame.pict_type = FF_I_TYPE; | 186 | s->frame.pict_type = AV_PICTURE_TYPE_I; |
| 187 | cmv_decode_intra(s, buf+2, buf_end); | 187 | cmv_decode_intra(s, buf+2, buf_end); |
| 188 | } | 188 | } |
| 189 | 189 | ||
| @@ -218,7 +218,7 @@ static int tgq_decode_frame(AVCodecContext *avctx, · 217 unmodified lines | |||
| 218 | 218 | ||
| 219 | if (!s->frame.data[0]) { | 219 | if (!s->frame.data[0]) { |
| 220 | s->frame.key_frame = 1; | 220 | s->frame.key_frame = 1; |
| 221 | s->frame.pict_type = FF_I_TYPE; | 221 | s->frame.pict_type = AV_PICTURE_TYPE_I; |
| 222 | s->frame.buffer_hints = FF_BUFFER_HINTS_VALID; | 222 | s->frame.buffer_hints = FF_BUFFER_HINTS_VALID; |
| 223 | if (avctx->get_buffer(avctx, &s->frame)) { | 223 | if (avctx->get_buffer(avctx, &s->frame)) { |
| 224 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 224 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| @@ -300,7 +300,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, · 299 unmodified lines | |||
| 300 | 300 | ||
| 301 | if(chunk_type==kVGT_TAG) { | 301 | if(chunk_type==kVGT_TAG) { |
| 302 | s->frame.key_frame = 1; | 302 | s->frame.key_frame = 1; |
| 303 | s->frame.pict_type = FF_I_TYPE; | 303 | s->frame.pict_type = AV_PICTURE_TYPE_I; |
| 304 | if (unpack(buf, buf_end, s->frame.data[0], s->avctx->width, s->avctx->height)<0) { | 304 | if (unpack(buf, buf_end, s->frame.data[0], s->avctx->width, s->avctx->height)<0) { |
| 305 | av_log(avctx, AV_LOG_WARNING, "truncated intra frame\n"); | 305 | av_log(avctx, AV_LOG_WARNING, "truncated intra frame\n"); |
| 306 | return -1; | 306 | return -1; |
| @@ -311,7 +311,7 @@ static int tgv_decode_frame(AVCodecContext *avctx, · 4 unmodified lines | |||
| 311 | return buf_size; | 311 | return buf_size; |
| 312 | } | 312 | } |
| 313 | s->frame.key_frame = 0; | 313 | s->frame.key_frame = 0; |
| 314 | s->frame.pict_type = FF_P_TYPE; | 314 | s->frame.pict_type = AV_PICTURE_TYPE_P; |
| 315 | if (tgv_decode_inter(s, buf, buf_end)<0) { | 315 | if (tgv_decode_inter(s, buf, buf_end)<0) { |
| 316 | av_log(avctx, AV_LOG_WARNING, "truncated inter frame\n"); | 316 | av_log(avctx, AV_LOG_WARNING, "truncated inter frame\n"); |
| 317 | return -1; | 317 | return -1; |
| @@ -639,7 +639,7 @@ static int is_intra_more_likely(MpegEncContext *s){ · 638 unmodified lines | |||
| 639 | if(undamaged_count < 5) return 0; //almost all MBs damaged -> use temporal prediction | 639 | if(undamaged_count < 5) return 0; //almost all MBs damaged -> use temporal prediction |
| 640 | 640 | ||
| 641 | //prevent dsp.sad() check, that requires access to the image | 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 | return 1; | 643 | return 1; |
| 644 | 644 | ||
| 645 | skip_amount= FFMAX(undamaged_count/50, 1); //check only upto 50 MBs | 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){ · 12 unmodified lines | |||
| 658 | j++; | 658 | j++; |
| 659 | if((j%skip_amount) != 0) continue; //skip a few to speed things up | 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 | uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize; | 662 | uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize; |
| 663 | uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize; | 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){ · 312 unmodified lines | |||
| 977 | } | 977 | } |
| 978 | 978 | ||
| 979 | /* guess MVs */ | 979 | /* guess MVs */ |
| 980 | if(s->pict_type==FF_B_TYPE){ | 980 | if(s->pict_type==AV_PICTURE_TYPE_B){ |
| 981 | for(mb_y=0; mb_y<s->mb_height; mb_y++){ | 981 | for(mb_y=0; mb_y<s->mb_height; mb_y++){ |
| 982 | for(mb_x=0; mb_x<s->mb_width; mb_x++){ | 982 | for(mb_x=0; mb_x<s->mb_width; mb_x++){ |
| 983 | int xy= mb_x*2 + mb_y*2*s->b8_stride; | 983 | int xy= mb_x*2 + mb_y*2*s->b8_stride; |
| @@ -1114,7 +1114,7 @@ ec_clean: · 130 unmodified lines | |||
| 1114 | const int mb_xy= s->mb_index2xy[i]; | 1114 | const int mb_xy= s->mb_index2xy[i]; |
| 1115 | int error= s->error_status_table[mb_xy]; | 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 | s->mbskip_table[mb_xy]=0; | 1118 | s->mbskip_table[mb_xy]=0; |
| 1119 | } | 1119 | } |
| 1120 | s->mbintra_table[mb_xy]=1; | 1120 | s->mbintra_table[mb_xy]=1; |
| @@ -1160,7 +1160,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, · 1159 unmodified lines | |||
| 1160 | ff_build_rac_states(c, 0.05*(1LL<<32), 256-8); | 1160 | ff_build_rac_states(c, 0.05*(1LL<<32), 256-8); |
| 1161 | 1161 | ||
| 1162 | *p = *pict; | 1162 | *p = *pict; |
| 1163 | p->pict_type= FF_I_TYPE; | 1163 | p->pict_type= AV_PICTURE_TYPE_I; |
| 1164 | 1164 | ||
| 1165 | if(avctx->gop_size==0 || f->picture_number % avctx->gop_size == 0){ | 1165 | if(avctx->gop_size==0 || f->picture_number % avctx->gop_size == 0){ |
| 1166 | put_rac(c, &keystate, 1); | 1166 | put_rac(c, &keystate, 1); |
| @@ -1723,7 +1723,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 556 unmodified lines | |||
| 1723 | ff_build_rac_states(c, 0.05*(1LL<<32), 256-8); | 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 | if(get_rac(c, &keystate)){ | 1727 | if(get_rac(c, &keystate)){ |
| 1728 | p->key_frame= 1; | 1728 | p->key_frame= 1; |
| 1729 | if(read_header(f) < 0) | 1729 | if(read_header(f) < 0) |
| @@ -260,12 +260,12 @@ static int flashsv_encode_frame(AVCodecContext *avctx, uint8_t *buf, · 259 unmodified lines | |||
| 260 | 260 | ||
| 261 | //mark the frame type so the muxer can mux it correctly | 261 | //mark the frame type so the muxer can mux it correctly |
| 262 | if (I_frame) { | 262 | if (I_frame) { |
| 263 | p->pict_type = FF_I_TYPE; | 263 | p->pict_type = AV_PICTURE_TYPE_I; |
| 264 | p->key_frame = 1; | 264 | p->key_frame = 1; |
| 265 | s->last_key_frame = avctx->frame_number; | 265 | s->last_key_frame = avctx->frame_number; |
| 266 | av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %d\n", avctx->frame_number); | 266 | av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %d\n", avctx->frame_number); |
| 267 | } else { | 267 | } else { |
| 268 | p->pict_type = FF_P_TYPE; | 268 | p->pict_type = AV_PICTURE_TYPE_P; |
| 269 | p->key_frame = 0; | 269 | p->key_frame = 0; |
| 270 | } | 270 | } |
| 271 | 271 | ||
| @@ -88,10 +88,10 @@ int ff_flv_decode_picture_header(MpegEncContext *s) · 87 unmodified lines | |||
| 88 | s->width = width; | 88 | s->width = width; |
| 89 | s->height = height; | 89 | s->height = height; |
| 90 | 90 | ||
| 91 | s->pict_type = FF_I_TYPE + get_bits(&s->gb, 2); | 91 | s->pict_type = AV_PICTURE_TYPE_I + get_bits(&s->gb, 2); |
| 92 | s->dropable= s->pict_type > FF_P_TYPE; | 92 | s->dropable= s->pict_type > AV_PICTURE_TYPE_P; |
| 93 | if (s->dropable) | 93 | if (s->dropable) |
| 94 | s->pict_type = FF_P_TYPE; | 94 | s->pict_type = AV_PICTURE_TYPE_P; |
| 95 | 95 | ||
| 96 | skip_bits1(&s->gb); /* deblocking flag */ | 96 | skip_bits1(&s->gb); /* deblocking flag */ |
| 97 | s->chroma_qscale= s->qscale = get_bits(&s->gb, 5); | 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) · 52 unmodified lines | |||
| 53 | put_bits(&s->pb, 16, s->width); | 53 | put_bits(&s->pb, 16, s->width); |
| 54 | put_bits(&s->pb, 16, s->height); | 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 | put_bits(&s->pb, 1, 1); /* DeblockingFlag: on */ | 57 | put_bits(&s->pb, 1, 1); /* DeblockingFlag: on */ |
| 58 | put_bits(&s->pb, 5, s->qscale); /* Quantizer */ | 58 | put_bits(&s->pb, 5, s->qscale); /* Quantizer */ |
| 59 | put_bits(&s->pb, 1, 0); /* ExtraInformation */ | 59 | put_bits(&s->pb, 1, 0); /* ExtraInformation */ |
| @@ -180,10 +180,10 @@ static int decode_frame(AVCodecContext *avctx, · 179 unmodified lines | |||
| 180 | return -1; | 180 | return -1; |
| 181 | } | 181 | } |
| 182 | /* bit 31 means same as previous pic */ | 182 | /* bit 31 means same as previous pic */ |
| 183 | f->pict_type = (header & (1U<<31))? FF_P_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 == FF_I_TYPE; | 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 | buf32=(const uint32_t*)buf; | 187 | buf32=(const uint32_t*)buf; |
| 188 | for(y=0; y<avctx->height/2; y++){ | 188 | for(y=0; y<avctx->height/2; y++){ |
| 189 | luma1=(uint32_t*)&f->data[0][ y*2*f->linesize[0] ]; | 189 | luma1=(uint32_t*)&f->data[0][ y*2*f->linesize[0] ]; |
| @@ -223,10 +223,10 @@ static int decode_frame(AVCodecContext *avctx, · 33 unmodified lines | |||
| 223 | return -1; | 223 | return -1; |
| 224 | } | 224 | } |
| 225 | /* bit 31 means same as previous pic */ | 225 | /* bit 31 means same as previous pic */ |
| 226 | f->pict_type = (header & (1U<<31))? FF_P_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 == FF_I_TYPE; | 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 | for(y=0; y<avctx->height; y++) | 230 | for(y=0; y<avctx->height; y++) |
| 231 | memcpy(&f->data[0][ (avctx->height-y)*f->linesize[0] ], | 231 | memcpy(&f->data[0][ (avctx->height-y)*f->linesize[0] ], |
| 232 | &buf[y*avctx->width*3], | 232 | &buf[y*avctx->width*3], |
| @@ -252,11 +252,11 @@ static int decode_frame(AVCodecContext *avctx, · 19 unmodified lines | |||
| 252 | } | 252 | } |
| 253 | /* skip frame */ | 253 | /* skip frame */ |
| 254 | if(buf_size == 8) { | 254 | if(buf_size == 8) { |
| 255 | f->pict_type = FF_P_TYPE; | 255 | f->pict_type = AV_PICTURE_TYPE_P; |
| 256 | f->key_frame = 0; | 256 | f->key_frame = 0; |
| 257 | break; | 257 | break; |
| 258 | } | 258 | } |
| 259 | f->pict_type = FF_I_TYPE; | 259 | f->pict_type = AV_PICTURE_TYPE_I; |
| 260 | f->key_frame = 1; | 260 | f->key_frame = 1; |
| 261 | if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) { | 261 | if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) { |
| 262 | av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n"); | 262 | av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n"); |
| @@ -297,11 +297,11 @@ static int decode_frame(AVCodecContext *avctx, · 34 unmodified lines | |||
| 297 | } | 297 | } |
| 298 | /* skip frame */ | 298 | /* skip frame */ |
| 299 | if(buf_size == 8) { | 299 | if(buf_size == 8) { |
| 300 | f->pict_type = FF_P_TYPE; | 300 | f->pict_type = AV_PICTURE_TYPE_P; |
| 301 | f->key_frame = 0; | 301 | f->key_frame = 0; |
| 302 | break; | 302 | break; |
| 303 | } | 303 | } |
| 304 | f->pict_type = FF_I_TYPE; | 304 | f->pict_type = AV_PICTURE_TYPE_I; |
| 305 | f->key_frame = 1; | 305 | f->key_frame = 1; |
| 306 | if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) { | 306 | if ((AV_RL32(buf) != FPS_TAG)||(buf_size < (planes*1024 + 24))) { |
| 307 | av_log(avctx, AV_LOG_ERROR, "Fraps: error in data stream\n"); | 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, · 60 unmodified lines | |||
| 61 | if (avctx->get_buffer(avctx, pic) < 0) | 61 | if (avctx->get_buffer(avctx, pic) < 0) |
| 62 | return -1; | 62 | return -1; |
| 63 | 63 | ||
| 64 | pic->pict_type = FF_I_TYPE; | 64 | pic->pict_type = AV_PICTURE_TYPE_I; |
| 65 | pic->key_frame = 1; | 65 | pic->key_frame = 1; |
| 66 | pic->interlaced_frame = 1; | 66 | pic->interlaced_frame = 1; |
| 67 | pic->top_field_first = 1; | 67 | pic->top_field_first = 1; |
| @@ -150,7 +150,7 @@ static int gif_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, int bu · 149 unmodified lines | |||
| 150 | uint8_t *end = outbuf + buf_size; | 150 | uint8_t *end = outbuf + buf_size; |
| 151 | 151 | ||
| 152 | *p = *pict; | 152 | *p = *pict; |
| 153 | p->pict_type = FF_I_TYPE; | 153 | p->pict_type = AV_PICTURE_TYPE_I; |
| 154 | p->key_frame = 1; | 154 | p->key_frame = 1; |
| 155 | gif_image_write_header(avctx, &outbuf_ptr, (uint32_t *)pict->data[1]); | 155 | gif_image_write_header(avctx, &outbuf_ptr, (uint32_t *)pict->data[1]); |
| 156 | gif_image_write_image(avctx, &outbuf_ptr, end, pict->data[0], pict->linesize[0]); | 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){ · 496 unmodified lines | |||
| 497 | skip_bits(&s->gb, 8); | 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 | // not contain all I-blocks (e.g. when a packet is lost) | 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 | h->gob_number = 0; | 504 | h->gob_number = 0; |
| 505 | return 0; | 505 | return 0; |
| @@ -597,10 +597,10 @@ retry: · 91 unmodified lines | |||
| 597 | 597 | ||
| 598 | // for skipping the frame | 598 | // for skipping the frame |
| 599 | s->current_picture.pict_type= s->pict_type; | 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) | 602 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B) |
| 603 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE) | 603 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I) |
| 604 | || avctx->skip_frame >= AVDISCARD_ALL) | 604 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 605 | return get_consumed_bytes(s, buf_size); | 605 | return get_consumed_bytes(s, buf_size); |
| 606 | 606 | ||
| @@ -148,7 +148,7 @@ void ff_h263_loop_filter(MpegEncContext * s){ · 147 unmodified lines | |||
| 148 | uint8_t *dest_cb= s->dest[1]; | 148 | uint8_t *dest_cb= s->dest[1]; |
| 149 | uint8_t *dest_cr= s->dest[2]; | 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 | Diag Top | 154 | Diag Top |
| @@ -218,7 +218,7 @@ static int decode_slice(MpegEncContext *s){ · 217 unmodified lines | |||
| 218 | //printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24)); | 218 | //printf("%d %d %06X\n", ret, get_bits_count(&s->gb), show_bits(&s->gb, 24)); |
| 219 | ret= s->decode_mb(s, s->block); | 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 | ff_h263_update_motion_val(s); | 222 | ff_h263_update_motion_val(s); |
| 223 | 223 | ||
| 224 | if(ret<0){ | 224 | if(ret<0){ |
| @@ -310,7 +310,7 @@ static int decode_slice(MpegEncContext *s){ · 85 unmodified lines | |||
| 310 | int max_extra=7; | 310 | int max_extra=7; |
| 311 | 311 | ||
| 312 | /* no markers in M$ crap */ | 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 | max_extra+= 17; | 314 | max_extra+= 17; |
| 315 | 315 | ||
| 316 | /* buggy padding but the frame should still end approximately at the bitstream end */ | 316 | /* buggy padding but the frame should still end approximately at the bitstream end */ |
| @@ -600,26 +600,26 @@ retry: · 283 unmodified lines | |||
| 600 | 600 | ||
| 601 | // for skipping the frame | 601 | // for skipping the frame |
| 602 | s->current_picture.pict_type= s->pict_type; | 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 | /* skip B-frames if we don't have reference frames */ | 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); | 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==FF_B_TYPE) | 607 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B) |
| 608 | || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE) | 608 | || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I) |
| 609 | || avctx->skip_frame >= AVDISCARD_ALL) | 609 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 610 | return get_consumed_bytes(s, buf_size); | 610 | return get_consumed_bytes(s, buf_size); |
| 611 | 611 | ||
| 612 | if(s->next_p_frame_damaged){ | 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 | return get_consumed_bytes(s, buf_size); | 614 | return get_consumed_bytes(s, buf_size); |
| 615 | else | 615 | else |
| 616 | s->next_p_frame_damaged=0; | 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 | s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab; | 620 | s->me.qpel_put= s->dsp.put_2tap_qpel_pixels_tab; |
| 621 | s->me.qpel_avg= s->dsp.avg_2tap_qpel_pixels_tab; | 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 | s->me.qpel_put= s->dsp.put_qpel_pixels_tab; | 623 | s->me.qpel_put= s->dsp.put_qpel_pixels_tab; |
| 624 | s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab; | 624 | s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab; |
| 625 | }else{ | 625 | }else{ |
| @@ -672,7 +672,7 @@ retry: · 46 unmodified lines | |||
| 672 | decode_slice(s); | 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 | if(!CONFIG_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){ | 676 | if(!CONFIG_MSMPEG4_DECODER || msmpeg4_decode_ext_header(s, buf_size) < 0){ |
| 677 | s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR; | 677 | s->error_status_table[s->mb_num-1]= AC_ERROR|DC_ERROR|MV_ERROR; |
| 678 | } | 678 | } |
| @@ -722,7 +722,7 @@ intrax8_decoded: · 43 unmodified lines | |||
| 722 | 722 | ||
| 723 | assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type); | 723 | assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type); |
| 724 | assert(s->current_picture.pict_type == s->pict_type); | 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 | *pict= *(AVFrame*)s->current_picture_ptr; | 726 | *pict= *(AVFrame*)s->current_picture_ptr; |
| 727 | } else if (s->last_picture_ptr != NULL) { | 727 | } else if (s->last_picture_ptr != NULL) { |
| 728 | *pict= *(AVFrame*)s->last_picture_ptr; | 728 | *pict= *(AVFrame*)s->last_picture_ptr; |
| @@ -918,7 +918,7 @@ static void decode_postinit(H264Context *h){ · 917 unmodified lines | |||
| 918 | else if((out_of_order && pics-1 == s->avctx->has_b_frames && s->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT) | 918 | else if((out_of_order && pics-1 == s->avctx->has_b_frames && s->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT) |
| 919 | || (s->low_delay && | 919 | || (s->low_delay && |
| 920 | ((h->next_outputed_poc != INT_MIN && out->poc > h->next_outputed_poc + 2) | 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 | s->low_delay = 0; | 923 | s->low_delay = 0; |
| 924 | s->avctx->has_b_frames++; | 924 | s->avctx->has_b_frames++; |
| @@ -1449,7 +1449,7 @@ static int pred_weight_table(H264Context *h){ · 524 unmodified lines | |||
| 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 | h->use_weight= h->use_weight || h->use_weight_chroma; | 1454 | h->use_weight= h->use_weight || h->use_weight_chroma; |
| 1455 | return 0; | 1455 | return 0; |
| @@ -1817,7 +1817,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ · 361 unmodified lines | |||
| 1817 | h->slice_type_fixed=0; | 1817 | h->slice_type_fixed=0; |
| 1818 | 1818 | ||
| 1819 | slice_type= golomb_to_pict_type[ slice_type ]; | 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 | || (h0->current_slice != 0 && slice_type == h0->last_slice_type) ) { | 1821 | || (h0->current_slice != 0 && slice_type == h0->last_slice_type) ) { |
| 1822 | default_ref_list_done = 1; | 1822 | default_ref_list_done = 1; |
| 1823 | } | 1823 | } |
| @@ -2110,15 +2110,15 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ · 286 unmodified lines | |||
| 2110 | h->ref_count[0]= h->pps.ref_count[0]; | 2110 | h->ref_count[0]= h->pps.ref_count[0]; |
| 2111 | h->ref_count[1]= h->pps.ref_count[1]; | 2111 | h->ref_count[1]= h->pps.ref_count[1]; |
| 2112 | 2112 | ||
| 2113 | if(h->slice_type_nos != FF_I_TYPE){ | 2113 | if(h->slice_type_nos != AV_PICTURE_TYPE_I){ |
| 2114 | if(h->slice_type_nos == FF_B_TYPE){ | 2114 | if(h->slice_type_nos == AV_PICTURE_TYPE_B){ |
| 2115 | h->direct_spatial_mv_pred= get_bits1(&s->gb); | 2115 | h->direct_spatial_mv_pred= get_bits1(&s->gb); |
| 2116 | } | 2116 | } |
| 2117 | num_ref_idx_active_override_flag= get_bits1(&s->gb); | 2117 | num_ref_idx_active_override_flag= get_bits1(&s->gb); |
| 2118 | 2118 | ||
| 2119 | if(num_ref_idx_active_override_flag){ | 2119 | if(num_ref_idx_active_override_flag){ |
| 2120 | h->ref_count[0]= get_ue_golomb(&s->gb) + 1; | 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 | h->ref_count[1]= get_ue_golomb(&s->gb) + 1; | 2122 | h->ref_count[1]= get_ue_golomb(&s->gb) + 1; |
| 2123 | 2123 | ||
| 2124 | if(h->ref_count[0]-1 > 32-1 || h->ref_count[1]-1 > 32-1){ | 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){ · 2 unmodified lines | |||
| 2127 | return -1; | 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 | h->list_count= 2; | 2131 | h->list_count= 2; |
| 2132 | else | 2132 | else |
| 2133 | h->list_count= 1; | 2133 | h->list_count= 1; |
| @@ -2138,22 +2138,22 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ · 4 unmodified lines | |||
| 2138 | ff_h264_fill_default_ref_list(h); | 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 | return -1; | 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 | s->last_picture_ptr= &h->ref_list[0][0]; | 2145 | s->last_picture_ptr= &h->ref_list[0][0]; |
| 2146 | ff_copy_picture(&s->last_picture, s->last_picture_ptr); | 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 | s->next_picture_ptr= &h->ref_list[1][0]; | 2149 | s->next_picture_ptr= &h->ref_list[1][0]; |
| 2150 | ff_copy_picture(&s->next_picture, s->next_picture_ptr); | 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 ) | 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== FF_B_TYPE ) ) | 2154 | || (h->pps.weighted_bipred_idc==1 && h->slice_type_nos== AV_PICTURE_TYPE_B ) ) |
| 2155 | pred_weight_table(h); | 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 | implicit_weight_table(h, -1); | 2157 | implicit_weight_table(h, -1); |
| 2158 | }else { | 2158 | }else { |
| 2159 | h->use_weight = 0; | 2159 | h->use_weight = 0; |
| @@ -2169,17 +2169,17 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ · 9 unmodified lines | |||
| 2169 | if(FRAME_MBAFF){ | 2169 | if(FRAME_MBAFF){ |
| 2170 | ff_h264_fill_mbaff_ref_list(h); | 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 | implicit_weight_table(h, 0); | 2173 | implicit_weight_table(h, 0); |
| 2174 | implicit_weight_table(h, 1); | 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 | ff_h264_direct_dist_scale_factor(h); | 2179 | ff_h264_direct_dist_scale_factor(h); |
| 2180 | ff_h264_direct_ref_list_init(h); | 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 | tmp = get_ue_golomb_31(&s->gb); | 2183 | tmp = get_ue_golomb_31(&s->gb); |
| 2184 | if(tmp > 2){ | 2184 | if(tmp > 2){ |
| 2185 | av_log(s->avctx, AV_LOG_ERROR, "cabac_init_idc overflow\n"); | 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){ · 12 unmodified lines | |||
| 2198 | h->chroma_qp[0] = get_chroma_qp(h, 0, s->qscale); | 2198 | h->chroma_qp[0] = get_chroma_qp(h, 0, s->qscale); |
| 2199 | h->chroma_qp[1] = get_chroma_qp(h, 1, s->qscale); | 2199 | h->chroma_qp[1] = get_chroma_qp(h, 1, s->qscale); |
| 2200 | //FIXME qscale / qp ... stuff | 2200 | //FIXME qscale / qp ... stuff |
| 2201 | if(h->slice_type == FF_SP_TYPE){ | 2201 | if(h->slice_type == AV_PICTURE_TYPE_SP){ |
| 2202 | get_bits1(&s->gb); /* sp_for_switch_flag */ | 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 | get_se_golomb(&s->gb); /* slice_qs_delta */ | 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){ · 22 unmodified lines | |||
| 2230 | } | 2230 | } |
| 2231 | 2231 | ||
| 2232 | if( s->avctx->skip_loop_filter >= AVDISCARD_ALL | 2232 | if( s->avctx->skip_loop_filter >= AVDISCARD_ALL |
| 2233 | ||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type_nos != FF_I_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 == FF_B_TYPE) | 2234 | ||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR && h->slice_type_nos == AV_PICTURE_TYPE_B) |
| 2235 | ||(s->avctx->skip_loop_filter >= AVDISCARD_NONREF && h->nal_ref_idc == 0)) | 2235 | ||(s->avctx->skip_loop_filter >= AVDISCARD_NONREF && h->nal_ref_idc == 0)) |
| 2236 | h->deblocking_filter= 0; | 2236 | h->deblocking_filter= 0; |
| 2237 | 2237 | ||
| @@ -2315,7 +2315,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ · 77 unmodified lines | |||
| 2315 | h->deblocking_filter, h->slice_alpha_c0_offset/2-26, h->slice_beta_offset/2-26, | 2315 | h->deblocking_filter, h->slice_alpha_c0_offset/2-26, h->slice_beta_offset/2-26, |
| 2316 | h->use_weight, | 2316 | h->use_weight, |
| 2317 | h->use_weight==1 && h->use_weight_chroma ? "c" : "", | 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){ · 3 unmodified lines | |||
| 2325 | int ff_h264_get_slice_type(const H264Context *h) | 2325 | int ff_h264_get_slice_type(const H264Context *h) |
| 2326 | { | 2326 | { |
| 2327 | switch (h->slice_type) { | 2327 | switch (h->slice_type) { |
| 2328 | case FF_P_TYPE: return 0; | 2328 | case AV_PICTURE_TYPE_P: return 0; |
| 2329 | case FF_B_TYPE: return 1; | 2329 | case AV_PICTURE_TYPE_B: return 1; |
| 2330 | case FF_I_TYPE: return 2; | 2330 | case AV_PICTURE_TYPE_I: return 2; |
| 2331 | case FF_SP_TYPE: return 3; | 2331 | case AV_PICTURE_TYPE_SP: return 3; |
| 2332 | case FF_SI_TYPE: return 4; | 2332 | case AV_PICTURE_TYPE_SI: return 4; |
| 2333 | default: return -1; | 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){ · 664 unmodified lines | |||
| 3000 | 3000 | ||
| 3001 | if(hx->redundant_pic_count==0 | 3001 | if(hx->redundant_pic_count==0 |
| 3002 | && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) | 3002 | && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) |
| 3003 | && (avctx->skip_frame < AVDISCARD_BIDIR || hx->slice_type_nos!=FF_B_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==FF_I_TYPE) | 3004 | && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==AV_PICTURE_TYPE_I) |
| 3005 | && avctx->skip_frame < AVDISCARD_ALL){ | 3005 | && avctx->skip_frame < AVDISCARD_ALL){ |
| 3006 | if(avctx->hwaccel) { | 3006 | if(avctx->hwaccel) { |
| 3007 | if (avctx->hwaccel->decode_slice(avctx, &buf[buf_index - consumed], consumed) < 0) | 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){ · 29 unmodified lines | |||
| 3037 | if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning | 3037 | if(hx->redundant_pic_count==0 && hx->intra_gb_ptr && hx->s.data_partitioning |
| 3038 | && s->context_initialized | 3038 | && s->context_initialized |
| 3039 | && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) | 3039 | && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) |
| 3040 | && (avctx->skip_frame < AVDISCARD_BIDIR || hx->slice_type_nos!=FF_B_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==FF_I_TYPE) | 3041 | && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==AV_PICTURE_TYPE_I) |
| 3042 | && avctx->skip_frame < AVDISCARD_ALL) | 3042 | && avctx->skip_frame < AVDISCARD_ALL) |
| 3043 | context_count++; | 3043 | context_count++; |
| 3044 | break; | 3044 | break; |
| @@ -1118,7 +1118,7 @@ static void fill_decode_caches(H264Context *h, int mb_type){ · 1117 unmodified lines | |||
| 1118 | } | 1118 | } |
| 1119 | AV_ZERO16(h->mvd_cache [list][scan8[4 ]]); | 1119 | AV_ZERO16(h->mvd_cache [list][scan8[4 ]]); |
| 1120 | AV_ZERO16(h->mvd_cache [list][scan8[12]]); | 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 | fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1); | 1122 | fill_rectangle(&h->direct_cache[scan8[0]], 4, 4, 8, MB_TYPE_16x16>>1, 1); |
| 1123 | 1123 | ||
| 1124 | if(IS_DIRECT(top_type)){ | 1124 | if(IS_DIRECT(top_type)){ |
| @@ -1255,7 +1255,7 @@ static inline void write_back_motion(H264Context *h, int mb_type){ · 130 unmodified lines | |||
| 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 | if(IS_8X8(mb_type)){ | 1259 | if(IS_8X8(mb_type)){ |
| 1260 | uint8_t *direct_table = &h->direct_table[4*h->mb_xy]; | 1260 | uint8_t *direct_table = &h->direct_table[4*h->mb_xy]; |
| 1261 | direct_table[1] = h->sub_mb_type[1]>>1; | 1261 | direct_table[1] = h->sub_mb_type[1]>>1; |
| @@ -1286,7 +1286,7 @@ static void av_unused decode_mb_skip(H264Context *h){ · 24 unmodified lines | |||
| 1286 | if(MB_FIELD) | 1286 | if(MB_FIELD) |
| 1287 | mb_type|= MB_TYPE_INTERLACED; | 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 | // just for fill_caches. pred_direct_motion will set the real mb_type | 1291 | // just for fill_caches. pred_direct_motion will set the real mb_type |
| 1292 | mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP; | 1292 | mb_type|= MB_TYPE_L0L1|MB_TYPE_DIRECT2|MB_TYPE_SKIP; |
| @@ -691,7 +691,7 @@ void ff_h264_init_cabac_states(H264Context *h) { · 690 unmodified lines | |||
| 691 | const int8_t (*tab)[2]; | 691 | const int8_t (*tab)[2]; |
| 692 | const int slice_qp = av_clip(s->qscale - 6*(h->sps.bit_depth_luma-8), 0, 51); | 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 | else tab = cabac_context_init_PB[h->cabac_init_idc]; | 695 | else tab = cabac_context_init_PB[h->cabac_init_idc]; |
| 696 | 696 | ||
| 697 | /* calculate pre-state */ | 697 | /* calculate pre-state */ |
| @@ -779,7 +779,7 @@ static int decode_cabac_mb_skip( H264Context *h, int mb_x, int mb_y ) { · 81 unmodified lines | |||
| 779 | if( h->slice_table[mbb_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mbb_xy] )) | 779 | if( h->slice_table[mbb_xy] == h->slice_num && !IS_SKIP( s->current_picture.mb_type[mbb_xy] )) |
| 780 | ctx++; | 780 | ctx++; |
| 781 | 781 | ||
| 782 | if( h->slice_type_nos == FF_B_TYPE ) | 782 | if( h->slice_type_nos == AV_PICTURE_TYPE_B ) |
| 783 | ctx += 13; | 783 | ctx += 13; |
| 784 | return get_cabac_noinline( &h->cabac, &h->cabac_state[11+ctx] ); | 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 ) { · 102 unmodified lines | |||
| 888 | int ref = 0; | 888 | int ref = 0; |
| 889 | int ctx = 0; | 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 | if( refa > 0 && !(h->direct_cache[scan8[n] - 1]&(MB_TYPE_DIRECT2>>1)) ) | 892 | if( refa > 0 && !(h->direct_cache[scan8[n] - 1]&(MB_TYPE_DIRECT2>>1)) ) |
| 893 | ctx++; | 893 | ctx++; |
| 894 | if( refb > 0 && !(h->direct_cache[scan8[n] - 8]&(MB_TYPE_DIRECT2>>1)) ) | 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) { · 313 unmodified lines | |||
| 1208 | mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride; | 1208 | mb_xy = h->mb_xy = s->mb_x + s->mb_y*s->mb_stride; |
| 1209 | 1209 | ||
| 1210 | tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y); | 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 | int skip; | 1212 | int skip; |
| 1213 | /* a skipped mb needs the aff flag from the following mb */ | 1213 | /* a skipped mb needs the aff flag from the following mb */ |
| 1214 | if( FRAME_MBAFF && (s->mb_y&1)==1 && h->prev_mb_skipped ) | 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) { · 29 unmodified lines | |||
| 1244 | 1244 | ||
| 1245 | fill_decode_neighbors(h, -(MB_FIELD)); | 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 | int ctx = 0; | 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 | if( !IS_DIRECT( h->left_type[0]-1 ) ) | 1251 | if( !IS_DIRECT( h->left_type[0]-1 ) ) |
| 1252 | ctx++; | 1252 | ctx++; |
| @@ -1279,7 +1279,7 @@ int ff_h264_decode_mb_cabac(H264Context *h) { · 26 unmodified lines | |||
| 1279 | } | 1279 | } |
| 1280 | partition_count= b_mb_type_info[mb_type].partition_count; | 1280 | partition_count= b_mb_type_info[mb_type].partition_count; |
| 1281 | mb_type= b_mb_type_info[mb_type].type; | 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 | if( get_cabac_noinline( &h->cabac, &h->cabac_state[14] ) == 0 ) { | 1283 | if( get_cabac_noinline( &h->cabac, &h->cabac_state[14] ) == 0 ) { |
| 1284 | /* P-type */ | 1284 | /* P-type */ |
| 1285 | if( get_cabac_noinline( &h->cabac, &h->cabac_state[15] ) == 0 ) { | 1285 | if( get_cabac_noinline( &h->cabac, &h->cabac_state[15] ) == 0 ) { |
| @@ -1297,9 +1297,9 @@ int ff_h264_decode_mb_cabac(H264Context *h) { · 11 unmodified lines | |||
| 1297 | } | 1297 | } |
| 1298 | } else { | 1298 | } else { |
| 1299 | mb_type= decode_cabac_intra_mb_type(h, 3, 1); | 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 | mb_type--; | 1301 | mb_type--; |
| 1302 | assert(h->slice_type_nos == FF_I_TYPE); | 1302 | assert(h->slice_type_nos == AV_PICTURE_TYPE_I); |
| 1303 | decode_intra_mb: | 1303 | decode_intra_mb: |
| 1304 | partition_count = 0; | 1304 | partition_count = 0; |
| 1305 | cbp= i_mb_type_info[mb_type].cbp; | 1305 | cbp= i_mb_type_info[mb_type].cbp; |
| @@ -1388,7 +1388,7 @@ decode_intra_mb: · 82 unmodified lines | |||
| 1388 | } else if( partition_count == 4 ) { | 1388 | } else if( partition_count == 4 ) { |
| 1389 | int i, j, sub_partition_count[4], list, ref[2][4]; | 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 | for( i = 0; i < 4; i++ ) { | 1392 | for( i = 0; i < 4; i++ ) { |
| 1393 | h->sub_mb_type[i] = decode_cabac_b_mb_sub_type( h ); | 1393 | h->sub_mb_type[i] = decode_cabac_b_mb_sub_type( h ); |
| 1394 | sub_partition_count[i]= b_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count; | 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){ · 547 unmodified lines | |||
| 548 | tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y); | 548 | tprintf(s->avctx, "pic:%d mb:%d/%d\n", h->frame_num, s->mb_x, s->mb_y); |
| 549 | cbp = 0; /* avoid warning. FIXME: find a solution without slowing | 549 | cbp = 0; /* avoid warning. FIXME: find a solution without slowing |
| 550 | down the code */ | 550 | down the code */ |
| 551 | if(h->slice_type_nos != FF_I_TYPE){ | 551 | if(h->slice_type_nos != AV_PICTURE_TYPE_I){ |
| 552 | if(s->mb_skip_run==-1) | 552 | if(s->mb_skip_run==-1) |
| 553 | s->mb_skip_run= get_ue_golomb(&s->gb); | 553 | s->mb_skip_run= get_ue_golomb(&s->gb); |
| 554 | 554 | ||
| @@ -569,7 +569,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){ · 14 unmodified lines | |||
| 569 | h->prev_mb_skipped= 0; | 569 | h->prev_mb_skipped= 0; |
| 570 | 570 | ||
| 571 | mb_type= get_ue_golomb(&s->gb); | 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 | if(mb_type < 23){ | 573 | if(mb_type < 23){ |
| 574 | partition_count= b_mb_type_info[mb_type].partition_count; | 574 | partition_count= b_mb_type_info[mb_type].partition_count; |
| 575 | mb_type= b_mb_type_info[mb_type].type; | 575 | mb_type= b_mb_type_info[mb_type].type; |
| @@ -577,7 +577,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){ · 1 unmodified line | |||
| 577 | mb_type -= 23; | 577 | mb_type -= 23; |
| 578 | goto decode_intra_mb; | 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 | if(mb_type < 5){ | 581 | if(mb_type < 5){ |
| 582 | partition_count= p_mb_type_info[mb_type].partition_count; | 582 | partition_count= p_mb_type_info[mb_type].partition_count; |
| 583 | mb_type= p_mb_type_info[mb_type].type; | 583 | mb_type= p_mb_type_info[mb_type].type; |
| @@ -586,8 +586,8 @@ int ff_h264_decode_mb_cavlc(H264Context *h){ · 2 unmodified lines | |||
| 586 | goto decode_intra_mb; | 586 | goto decode_intra_mb; |
| 587 | } | 587 | } |
| 588 | }else{ | 588 | }else{ |
| 589 | assert(h->slice_type_nos == FF_I_TYPE); | 589 | assert(h->slice_type_nos == AV_PICTURE_TYPE_I); |
| 590 | if(h->slice_type == FF_SI_TYPE && mb_type) | 590 | if(h->slice_type == AV_PICTURE_TYPE_SI && mb_type) |
| 591 | mb_type--; | 591 | mb_type--; |
| 592 | decode_intra_mb: | 592 | decode_intra_mb: |
| 593 | if(mb_type > 25){ | 593 | if(mb_type > 25){ |
| @@ -678,7 +678,7 @@ decode_intra_mb: · 84 unmodified lines | |||
| 678 | }else if(partition_count==4){ | 678 | }else if(partition_count==4){ |
| 679 | int i, j, sub_partition_count[4], list, ref[2][4]; | 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 | for(i=0; i<4; i++){ | 682 | for(i=0; i<4; i++){ |
| 683 | h->sub_mb_type[i]= get_ue_golomb_31(&s->gb); | 683 | h->sub_mb_type[i]= get_ue_golomb_31(&s->gb); |
| 684 | if(h->sub_mb_type[i] >=13){ | 684 | if(h->sub_mb_type[i] >=13){ |
| @@ -696,7 +696,7 @@ decode_intra_mb: · 11 unmodified lines | |||
| 696 | h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE; | 696 | h->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE; |
| 697 | } | 697 | } |
| 698 | }else{ | 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 | for(i=0; i<4; i++){ | 700 | for(i=0; i<4; i++){ |
| 701 | h->sub_mb_type[i]= get_ue_golomb_31(&s->gb); | 701 | h->sub_mb_type[i]= get_ue_golomb_31(&s->gb); |
| 702 | if(h->sub_mb_type[i] >=4){ | 702 | if(h->sub_mb_type[i] >=4){ |
| @@ -130,7 +130,7 @@ void ff_h264_direct_ref_list_init(H264Context * const h){ · 129 unmodified lines | |||
| 130 | h->col_fieldoff= 2*(h->ref_list[1][0].reference) - 3; | 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 | return; | 134 | return; |
| 135 | 135 | ||
| 136 | for(list=0; list<2; list++){ | 136 | for(list=0; list<2; list++){ |
| @@ -117,7 +117,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, · 116 unmodified lines | |||
| 117 | const uint8_t *ptr; | 117 | const uint8_t *ptr; |
| 118 | 118 | ||
| 119 | /* set some sane default values */ | 119 | /* set some sane default values */ |
| 120 | s->pict_type = FF_I_TYPE; | 120 | s->pict_type = AV_PICTURE_TYPE_I; |
| 121 | s->key_frame = 0; | 121 | s->key_frame = 0; |
| 122 | 122 | ||
| 123 | h->s.avctx= avctx; | 123 | h->s.avctx= avctx; |
| @@ -110,7 +110,7 @@ int ff_h264_fill_default_ref_list(H264Context *h){ · 109 unmodified lines | |||
| 110 | MpegEncContext * const s = &h->s; | 110 | MpegEncContext * const s = &h->s; |
| 111 | int i, len; | 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 | Picture *sorted[32]; | 114 | Picture *sorted[32]; |
| 115 | int cur_poc, list; | 115 | int cur_poc, list; |
| 116 | int lens[2]; | 116 | int lens[2]; |
| @@ -149,7 +149,7 @@ int ff_h264_fill_default_ref_list(H264Context *h){ · 32 unmodified lines | |||
| 149 | for (i=0; i<h->ref_count[0]; i++) { | 149 | for (i=0; i<h->ref_count[0]; i++) { |
| 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]); | 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 | for (i=0; i<h->ref_count[1]; i++) { | 153 | for (i=0; i<h->ref_count[1]; i++) { |
| 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]); | 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 @@ · 35 unmodified lines | |||
| 36 | 36 | ||
| 37 | 37 | ||
| 38 | static const uint8_t golomb_to_pict_type[5]= | 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 | static const uint8_t golomb_to_intra4x4_cbp[48]={ | 41 | static const uint8_t golomb_to_intra4x4_cbp[48]={ |
| 42 | 47, 31, 15, 0, 23, 27, 29, 30, 7, 11, 13, 14, 39, 43, 45, 46, | 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, · 1237 unmodified lines | |||
| 1238 | int i, j, size=0; | 1238 | int i, j, size=0; |
| 1239 | 1239 | ||
| 1240 | *p = *pict; | 1240 | *p = *pict; |
| 1241 | p->pict_type= FF_I_TYPE; | 1241 | p->pict_type= AV_PICTURE_TYPE_I; |
| 1242 | p->key_frame= 1; | 1242 | p->key_frame= 1; |
| 1243 | 1243 | ||
| 1244 | if(s->context){ | 1244 | if(s->context){ |
| @@ -52,7 +52,7 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s) · 51 unmodified lines | |||
| 52 | } | 52 | } |
| 53 | s->h263_plus = 0; | 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 | s->unrestricted_mv = get_bits1(&s->gb); | 57 | s->unrestricted_mv = get_bits1(&s->gb); |
| 58 | s->h263_long_vectors = s->unrestricted_mv; | 58 | s->h263_long_vectors = s->unrestricted_mv; |
| @@ -347,7 +347,7 @@ static void preview_obmc(MpegEncContext *s){ · 346 unmodified lines | |||
| 347 | s->block_index[i]+= 1; | 347 | s->block_index[i]+= 1; |
| 348 | s->mb_x++; | 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 | do{ | 352 | do{ |
| 353 | if (get_bits1(&s->gb)) { | 353 | if (get_bits1(&s->gb)) { |
| @@ -460,7 +460,7 @@ static int h263_decode_block(MpegEncContext * s, DCTELEM * block, · 106 unmodified lines | |||
| 460 | /* DC coef */ | 460 | /* DC coef */ |
| 461 | if(s->codec_id == CODEC_ID_RV10){ | 461 | if(s->codec_id == CODEC_ID_RV10){ |
| 462 | #if CONFIG_RV10_DECODER | 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 | int component, diff; | 464 | int component, diff; |
| 465 | component = (n <= 3 ? 0 : n - 4 + 1); | 465 | component = (n <= 3 ? 0 : n - 4 + 1); |
| 466 | level = s->last_dc[component]; | 466 | level = s->last_dc[component]; |
| @@ -608,7 +608,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 141 unmodified lines | |||
| 608 | 608 | ||
| 609 | assert(!s->h263_pred); | 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 | do{ | 612 | do{ |
| 613 | if (get_bits1(&s->gb)) { | 613 | if (get_bits1(&s->gb)) { |
| 614 | /* skip mb */ | 614 | /* skip mb */ |
| @@ -700,7 +700,7 @@ int ff_h263_decode_mb(MpegEncContext *s, · 85 unmodified lines | |||
| 700 | mot_val[1] = my; | 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 | int mb_type; | 704 | int mb_type; |
| 705 | const int stride= s->b8_stride; | 705 | const int stride= s->b8_stride; |
| 706 | int16_t *mot_val0 = s->current_picture.motion_val[0][ 2*(s->mb_x + s->mb_y*stride) ]; | 706 | int16_t *mot_val0 = s->current_picture.motion_val[0][ 2*(s->mb_x + s->mb_y*stride) ]; |
| @@ -843,7 +843,7 @@ intra: · 136 unmodified lines | |||
| 843 | if(s->pb_frame && h263_skip_b_part(s, cbpb) < 0) | 843 | if(s->pb_frame && h263_skip_b_part(s, cbpb) < 0) |
| 844 | return -1; | 844 | return -1; |
| 845 | if(s->obmc && !s->mb_intra){ | 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 | preview_obmc(s); | 847 | preview_obmc(s); |
| 848 | } | 848 | } |
| 849 | end: | 849 | end: |
| @@ -921,7 +921,7 @@ int h263_decode_picture_header(MpegEncContext *s) · 71 unmodified lines | |||
| 921 | if (!width) | 921 | if (!width) |
| 922 | return -1; | 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 | s->h263_long_vectors = get_bits1(&s->gb); | 926 | s->h263_long_vectors = get_bits1(&s->gb); |
| 927 | 927 | ||
| @@ -985,11 +985,11 @@ int h263_decode_picture_header(MpegEncContext *s) · 57 unmodified lines | |||
| 985 | /* MPPTYPE */ | 985 | /* MPPTYPE */ |
| 986 | s->pict_type = get_bits(&s->gb, 3); | 986 | s->pict_type = get_bits(&s->gb, 3); |
| 987 | switch(s->pict_type){ | 987 | switch(s->pict_type){ |
| 988 | case 0: s->pict_type= FF_I_TYPE;break; | 988 | case 0: s->pict_type= AV_PICTURE_TYPE_I;break; |
| 989 | case 1: s->pict_type= FF_P_TYPE;break; | 989 | case 1: s->pict_type= AV_PICTURE_TYPE_P;break; |
| 990 | case 2: s->pict_type= FF_P_TYPE;s->pb_frame = 3;break; | 990 | case 2: s->pict_type= AV_PICTURE_TYPE_P;s->pb_frame = 3;break; |
| 991 | case 3: s->pict_type= FF_B_TYPE;break; | 991 | case 3: s->pict_type= AV_PICTURE_TYPE_B;break; |
| 992 | case 7: s->pict_type= FF_I_TYPE;break; //ZYGO | 992 | case 7: s->pict_type= AV_PICTURE_TYPE_I;break; //ZYGO |
| 993 | default: | 993 | default: |
| 994 | return -1; | 994 | return -1; |
| 995 | } | 995 | } |
| @@ -1112,7 +1112,7 @@ int h263_decode_picture_header(MpegEncContext *s) · 116 unmodified lines | |||
| 1112 | } | 1112 | } |
| 1113 | 1113 | ||
| 1114 | ff_h263_show_pict_info(s); | 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 | int i,j; | 1116 | int i,j; |
| 1117 | for(i=0; i<85; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb)); | 1117 | for(i=0; i<85; i++) av_log(s->avctx, AV_LOG_DEBUG, "%d", get_bits1(&s->gb)); |
| 1118 | av_log(s->avctx, AV_LOG_DEBUG, "\n"); | 1118 | av_log(s->avctx, AV_LOG_DEBUG, "\n"); |
| @@ -145,7 +145,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number) · 144 unmodified lines | |||
| 145 | if (!s->h263_plus) { | 145 | if (!s->h263_plus) { |
| 146 | /* H.263v1 */ | 146 | /* H.263v1 */ |
| 147 | put_bits(&s->pb, 3, format); | 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 | /* By now UMV IS DISABLED ON H.263v1, since the restrictions | 149 | /* By now UMV IS DISABLED ON H.263v1, since the restrictions |
| 150 | of H.263v1 UMV implies to check the predicted MV after | 150 | of H.263v1 UMV implies to check the predicted MV after |
| 151 | calculation of the current MB to see if we're on the limits */ | 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) · 29 unmodified lines | |||
| 181 | put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ | 181 | put_bits(&s->pb,1,1); /* "1" to prevent start code emulation */ |
| 182 | put_bits(&s->pb,3,0); /* Reserved */ | 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 | put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */ | 186 | put_bits(&s->pb,1,0); /* Reference Picture Resampling: off */ |
| 187 | put_bits(&s->pb,1,0); /* Reduced-Resolution Update: off */ | 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) · 72 unmodified lines | |||
| 260 | put_bits(&s->pb, 1, 1); | 260 | put_bits(&s->pb, 1, 1); |
| 261 | put_bits(&s->pb, 5, s->qscale); /* GQUANT */ | 261 | put_bits(&s->pb, 5, s->qscale); /* GQUANT */ |
| 262 | put_bits(&s->pb, 1, 1); | 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 | }else{ | 264 | }else{ |
| 265 | int gob_number= mb_line / s->gob_index; | 265 | int gob_number= mb_line / s->gob_index; |
| 266 | 266 | ||
| 267 | put_bits(&s->pb, 5, gob_number); /* GN */ | 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 | put_bits(&s->pb, 5, s->qscale); /* GQUANT */ | 269 | put_bits(&s->pb, 5, s->qscale); /* GQUANT */ |
| 270 | } | 270 | } |
| 271 | } | 271 | } |
| @@ -607,7 +607,7 @@ void h263_encode_mb(MpegEncContext * s, · 335 unmodified lines | |||
| 607 | } | 607 | } |
| 608 | 608 | ||
| 609 | cbpc = cbp & 3; | 609 | cbpc = cbp & 3; |
| 610 | if (s->pict_type == FF_I_TYPE) { | 610 | if (s->pict_type == AV_PICTURE_TYPE_I) { |
| 611 | if(s->dquant) cbpc+=4; | 611 | if(s->dquant) cbpc+=4; |
| 612 | put_bits(&s->pb, | 612 | put_bits(&s->pb, |
| 613 | ff_h263_intra_MCBPC_bits[cbpc], | 613 | ff_h263_intra_MCBPC_bits[cbpc], |
| @@ -245,7 +245,7 @@ static int encode_picture_ls(AVCodecContext *avctx, unsigned char *buf, int buf_ · 244 unmodified lines | |||
| 245 | init_put_bits(&pb2, buf2, buf_size); | 245 | init_put_bits(&pb2, buf2, buf_size); |
| 246 | 246 | ||
| 247 | *p = *pict; | 247 | *p = *pict; |
| 248 | p->pict_type= FF_I_TYPE; | 248 | p->pict_type= AV_PICTURE_TYPE_I; |
| 249 | p->key_frame= 1; | 249 | p->key_frame= 1; |
| 250 | 250 | ||
| 251 | if(avctx->pix_fmt == PIX_FMT_GRAY8 || avctx->pix_fmt == PIX_FMT_GRAY16) | 251 | if(avctx->pix_fmt == PIX_FMT_GRAY8 || avctx->pix_fmt == PIX_FMT_GRAY16) |
| @@ -180,7 +180,7 @@ static int decode_frame(AVCodecContext *avctx, · 179 unmodified lines | |||
| 180 | 180 | ||
| 181 | if (video_size) { | 181 | if (video_size) { |
| 182 | s->frame.key_frame = 1; | 182 | s->frame.key_frame = 1; |
| 183 | s->frame.pict_type = FF_I_TYPE; | 183 | s->frame.pict_type = AV_PICTURE_TYPE_I; |
| 184 | s->frame.palette_has_changed = s->palette_has_changed; | 184 | s->frame.palette_has_changed = s->palette_has_changed; |
| 185 | s->palette_has_changed = 0; | 185 | s->palette_has_changed = 0; |
| 186 | memcpy(s->frame.data[1], s->palette, AVPALETTE_SIZE); | 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 · 258 unmodified lines | |||
| 259 | 259 | ||
| 260 | if (header & KMVC_KEYFRAME) { | 260 | if (header & KMVC_KEYFRAME) { |
| 261 | ctx->pic.key_frame = 1; | 261 | ctx->pic.key_frame = 1; |
| 262 | ctx->pic.pict_type = FF_I_TYPE; | 262 | ctx->pic.pict_type = AV_PICTURE_TYPE_I; |
| 263 | } else { | 263 | } else { |
| 264 | ctx->pic.key_frame = 0; | 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 | if (header & KMVC_PALETTE) { | 268 | if (header & KMVC_PALETTE) { |
| @@ -76,7 +76,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, · 75 unmodified lines | |||
| 76 | int zret; // Zlib return code | 76 | int zret; // Zlib return code |
| 77 | 77 | ||
| 78 | *p = *pict; | 78 | *p = *pict; |
| 79 | p->pict_type= FF_I_TYPE; | 79 | p->pict_type= AV_PICTURE_TYPE_I; |
| 80 | p->key_frame= 1; | 80 | p->key_frame= 1; |
| 81 | 81 | ||
| 82 | if(avctx->pix_fmt != PIX_FMT_BGR24){ | 82 | if(avctx->pix_fmt != PIX_FMT_BGR24){ |
| @@ -358,9 +358,9 @@ static int storeframe(AVCodecContext *avctx, struct FrameListData *cx_frame, · 357 unmodified lines | |||
| 358 | coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY); | 358 | coded_frame->key_frame = !!(cx_frame->flags & VPX_FRAME_IS_KEY); |
| 359 | 359 | ||
| 360 | if (coded_frame->key_frame) | 360 | if (coded_frame->key_frame) |
| 361 | coded_frame->pict_type = FF_I_TYPE; | 361 | coded_frame->pict_type = AV_PICTURE_TYPE_I; |
| 362 | else | 362 | else |
| 363 | coded_frame->pict_type = FF_P_TYPE; | 363 | coded_frame->pict_type = AV_PICTURE_TYPE_P; |
| 364 | } else { | 364 | } else { |
| 365 | av_log(avctx, AV_LOG_ERROR, | 365 | av_log(avctx, AV_LOG_ERROR, |
| 366 | "Compressed frame larger than storage provided! (%zu/%d)\n", | 366 | "Compressed frame larger than storage provided! (%zu/%d)\n", |
| @@ -110,9 +110,9 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf, · 109 unmodified lines | |||
| 110 | 110 | ||
| 111 | x4->pic.i_pts = frame->pts; | 111 | x4->pic.i_pts = frame->pts; |
| 112 | x4->pic.i_type = | 112 | x4->pic.i_type = |
| 113 | frame->pict_type == FF_I_TYPE ? X264_TYPE_KEYFRAME : | 113 | frame->pict_type == AV_PICTURE_TYPE_I ? X264_TYPE_KEYFRAME : |
| 114 | frame->pict_type == FF_P_TYPE ? X264_TYPE_P : | 114 | frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P : |
| 115 | frame->pict_type == FF_B_TYPE ? X264_TYPE_B : | 115 | frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B : |
| 116 | X264_TYPE_AUTO; | 116 | X264_TYPE_AUTO; |
| 117 | if (x4->params.b_tff != frame->top_field_first) { | 117 | if (x4->params.b_tff != frame->top_field_first) { |
| 118 | x4->params.b_tff = frame->top_field_first; | 118 | x4->params.b_tff = frame->top_field_first; |
| @@ -135,14 +135,14 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf, · 16 unmodified lines | |||
| 135 | switch (pic_out.i_type) { | 135 | switch (pic_out.i_type) { |
| 136 | case X264_TYPE_IDR: | 136 | case X264_TYPE_IDR: |
| 137 | case X264_TYPE_I: | 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 | break; | 139 | break; |
| 140 | case X264_TYPE_P: | 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 | break; | 142 | break; |
| 143 | case X264_TYPE_B: | 143 | case X264_TYPE_B: |
| 144 | case X264_TYPE_BREF: | 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 | break; | 146 | break; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| @@ -138,14 +138,14 @@ static int XAVS_frame(AVCodecContext *ctx, uint8_t *buf, · 137 unmodified lines | |||
| 138 | switch (pic_out.i_type) { | 138 | switch (pic_out.i_type) { |
| 139 | case XAVS_TYPE_IDR: | 139 | case XAVS_TYPE_IDR: |
| 140 | case XAVS_TYPE_I: | 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 | break; | 142 | break; |
| 143 | case XAVS_TYPE_P: | 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 | break; | 145 | break; |
| 146 | case XAVS_TYPE_B: | 146 | case XAVS_TYPE_B: |
| 147 | case XAVS_TYPE_BREF: | 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 | break; | 149 | break; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| @@ -134,7 +134,7 @@ float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run){ · 133 unmodified lines | |||
| 134 | if(!dry_run) | 134 | if(!dry_run) |
| 135 | s->rc_context.dry_run_qscale= 0; | 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 | return xvid_plg_data.quant * FF_QP2LAMBDA * s->avctx->b_quant_factor + s->avctx->b_quant_offset; | 138 | return xvid_plg_data.quant * FF_QP2LAMBDA * s->avctx->b_quant_factor + s->avctx->b_quant_offset; |
| 139 | else | 139 | else |
| 140 | return xvid_plg_data.quant * FF_QP2LAMBDA; | 140 | return xvid_plg_data.quant * FF_QP2LAMBDA; |
| @@ -450,9 +450,9 @@ static int xvid_encode_frame(AVCodecContext *avctx, · 449 unmodified lines | |||
| 450 | xvid_enc_frame.vol_flags = x->vol_flags; | 450 | xvid_enc_frame.vol_flags = x->vol_flags; |
| 451 | xvid_enc_frame.motion = x->me_flags; | 451 | xvid_enc_frame.motion = x->me_flags; |
| 452 | xvid_enc_frame.type = | 452 | xvid_enc_frame.type = |
| 453 | picture->pict_type == FF_I_TYPE ? XVID_TYPE_IVOP : | 453 | picture->pict_type == AV_PICTURE_TYPE_I ? XVID_TYPE_IVOP : |
| 454 | picture->pict_type == FF_P_TYPE ? XVID_TYPE_PVOP : | 454 | picture->pict_type == AV_PICTURE_TYPE_P ? XVID_TYPE_PVOP : |
| 455 | picture->pict_type == FF_B_TYPE ? XVID_TYPE_BVOP : | 455 | picture->pict_type == AV_PICTURE_TYPE_B ? XVID_TYPE_BVOP : |
| 456 | XVID_TYPE_AUTO; | 456 | XVID_TYPE_AUTO; |
| 457 | 457 | ||
| 458 | /* Pixel aspect ratio setting */ | 458 | /* Pixel aspect ratio setting */ |
| @@ -493,13 +493,13 @@ static int xvid_encode_frame(AVCodecContext *avctx, · 34 unmodified lines | |||
| 493 | if( 0 <= xerr ) { | 493 | if( 0 <= xerr ) { |
| 494 | p->quality = xvid_enc_stats.quant * FF_QP2LAMBDA; | 494 | p->quality = xvid_enc_stats.quant * FF_QP2LAMBDA; |
| 495 | if( xvid_enc_stats.type == XVID_TYPE_PVOP ) | 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 | else if( xvid_enc_stats.type == XVID_TYPE_BVOP ) | 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 | else if( xvid_enc_stats.type == XVID_TYPE_SVOP ) | 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 | else | 501 | else |
| 502 | p->pict_type = FF_I_TYPE; | 502 | p->pict_type = AV_PICTURE_TYPE_I; |
| 503 | if( xvid_enc_frame.out_flags & XVID_KEYFRAME ) { | 503 | if( xvid_enc_frame.out_flags & XVID_KEYFRAME ) { |
| 504 | p->key_frame = 1; | 504 | p->key_frame = 1; |
| 505 | if( x->quicktime_format ) | 505 | if( x->quicktime_format ) |
| @@ -49,7 +49,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in · 48 unmodified lines | |||
| 49 | init_put_bits(&s->pb, buf, buf_size); | 49 | init_put_bits(&s->pb, buf, buf_size); |
| 50 | 50 | ||
| 51 | *p = *pict; | 51 | *p = *pict; |
| 52 | p->pict_type= FF_I_TYPE; | 52 | p->pict_type= AV_PICTURE_TYPE_I; |
| 53 | p->key_frame= 1; | 53 | p->key_frame= 1; |
| 54 | 54 | ||
| 55 | ff_mjpeg_encode_picture_header(s); | 55 | ff_mjpeg_encode_picture_header(s); |
| @@ -170,7 +170,7 @@ static int decode_frame(AVCodecContext *avctx, · 169 unmodified lines | |||
| 170 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 170 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 171 | return -1; | 171 | return -1; |
| 172 | } | 172 | } |
| 173 | p->pict_type= FF_I_TYPE; | 173 | p->pict_type= AV_PICTURE_TYPE_I; |
| 174 | p->key_frame= 1; | 174 | p->key_frame= 1; |
| 175 | 175 | ||
| 176 | av_fast_malloc(&a->bitstream_buffer, &a->bitstream_buffer_size, buf_size + FF_INPUT_BUFFER_PADDING_SIZE); | 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, · 351 unmodified lines | |||
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | ctx->buf_ptrs[ctx->cur_index].reference = 1; | 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 | if(ff_thread_get_buffer(avctx, &ctx->buf_ptrs[ctx->cur_index])) { | 356 | if(ff_thread_get_buffer(avctx, &ctx->buf_ptrs[ctx->cur_index])) { |
| 357 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 357 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 358 | return -1; | 358 | return -1; |
| @@ -353,7 +353,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) · 352 unmodified lines | |||
| 353 | av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 353 | av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 354 | return -1; | 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 | s->picture_ptr->key_frame= 1; | 357 | s->picture_ptr->key_frame= 1; |
| 358 | s->got_picture = 1; | 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) · 1892 unmodified lines | |||
| 1893 | continue; | 1893 | continue; |
| 1894 | 1894 | ||
| 1895 | for(j=0; j<fcode && j<8; j++){ | 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 | score[j]-= 170; | 1897 | score[j]-= 170; |
| 1898 | } | 1898 | } |
| 1899 | } | 1899 | } |
| @@ -1925,7 +1925,7 @@ void ff_fix_long_p_mvs(MpegEncContext * s) · 25 unmodified lines | |||
| 1925 | MotionEstContext * const c= &s->me; | 1925 | MotionEstContext * const c= &s->me; |
| 1926 | const int f_code= s->f_code; | 1926 | const int f_code= s->f_code; |
| 1927 | int y, range; | 1927 | int y, range; |
| 1928 | assert(s->pict_type==FF_P_TYPE); | 1928 | assert(s->pict_type==AV_PICTURE_TYPE_P); |
| 1929 | 1929 | ||
| 1930 | range = (((s->out_format == FMT_MPEG1 || s->msmpeg4_version) ? 8 : 16) << f_code); | 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 · 1036 unmodified lines | |||
| 1037 | score_map[0]= dmin; | 1037 | score_map[0]= dmin; |
| 1038 | 1038 | ||
| 1039 | //FIXME precalc first term below? | 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 | dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor; | 1041 | dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor; |
| 1042 | 1042 | ||
| 1043 | /* first line */ | 1043 | /* first line */ |
| @@ -214,7 +214,7 @@ static int mpeg_decode_mb(MpegEncContext *s, · 213 unmodified lines | |||
| 214 | assert(s->mb_skipped==0); | 214 | assert(s->mb_skipped==0); |
| 215 | 215 | ||
| 216 | if (s->mb_skip_run-- != 0) { | 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 | s->mb_skipped = 1; | 218 | s->mb_skipped = 1; |
| 219 | s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]= MB_TYPE_SKIP | MB_TYPE_L0 | MB_TYPE_16x16; | 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 | } else { | 220 | } else { |
| @@ -240,7 +240,7 @@ static int mpeg_decode_mb(MpegEncContext *s, · 19 unmodified lines | |||
| 240 | 240 | ||
| 241 | switch(s->pict_type) { | 241 | switch(s->pict_type) { |
| 242 | default: | 242 | default: |
| 243 | case FF_I_TYPE: | 243 | case AV_PICTURE_TYPE_I: |
| 244 | if (get_bits1(&s->gb) == 0) { | 244 | if (get_bits1(&s->gb) == 0) { |
| 245 | if (get_bits1(&s->gb) == 0){ | 245 | if (get_bits1(&s->gb) == 0){ |
| 246 | av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in I Frame at %d %d\n", s->mb_x, s->mb_y); | 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, · 4 unmodified lines | |||
| 251 | mb_type = MB_TYPE_INTRA; | 251 | mb_type = MB_TYPE_INTRA; |
| 252 | } | 252 | } |
| 253 | break; | 253 | break; |
| 254 | case FF_P_TYPE: | 254 | case AV_PICTURE_TYPE_P: |
| 255 | mb_type = get_vlc2(&s->gb, mb_ptype_vlc.table, MB_PTYPE_VLC_BITS, 1); | 255 | mb_type = get_vlc2(&s->gb, mb_ptype_vlc.table, MB_PTYPE_VLC_BITS, 1); |
| 256 | if (mb_type < 0){ | 256 | if (mb_type < 0){ |
| 257 | av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in P Frame at %d %d\n", s->mb_x, s->mb_y); | 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, · 1 unmodified line | |||
| 259 | } | 259 | } |
| 260 | mb_type = ptype2mb_type[ mb_type ]; | 260 | mb_type = ptype2mb_type[ mb_type ]; |
| 261 | break; | 261 | break; |
| 262 | case FF_B_TYPE: | 262 | case AV_PICTURE_TYPE_B: |
| 263 | mb_type = get_vlc2(&s->gb, mb_btype_vlc.table, MB_BTYPE_VLC_BITS, 1); | 263 | mb_type = get_vlc2(&s->gb, mb_btype_vlc.table, MB_BTYPE_VLC_BITS, 1); |
| 264 | if (mb_type < 0){ | 264 | if (mb_type < 0){ |
| 265 | av_log(s->avctx, AV_LOG_ERROR, "invalid mb type in B Frame at %d %d\n", s->mb_x, s->mb_y); | 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 · 932 unmodified lines | |||
| 1198 | if(!ctx->mpeg_enc_ctx_allocated) | 1198 | if(!ctx->mpeg_enc_ctx_allocated) |
| 1199 | memcpy(s + 1, s1 + 1, sizeof(Mpeg1Context) - sizeof(MpegEncContext)); | 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 | s->picture_number++; | 1202 | s->picture_number++; |
| 1203 | 1203 | ||
| 1204 | return 0; | 1204 | return 0; |
| @@ -1408,7 +1408,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, · 203 unmodified lines | |||
| 1408 | return -1; | 1408 | return -1; |
| 1409 | 1409 | ||
| 1410 | vbv_delay= get_bits(&s->gb, 16); | 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 | s->full_pel[0] = get_bits1(&s->gb); | 1412 | s->full_pel[0] = get_bits1(&s->gb); |
| 1413 | f_code = get_bits(&s->gb, 3); | 1413 | f_code = get_bits(&s->gb, 3); |
| 1414 | if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT) | 1414 | if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT) |
| @@ -1416,7 +1416,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, · 1 unmodified line | |||
| 1416 | s->mpeg_f_code[0][0] = f_code; | 1416 | s->mpeg_f_code[0][0] = f_code; |
| 1417 | s->mpeg_f_code[0][1] = f_code; | 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 | s->full_pel[1] = get_bits1(&s->gb); | 1420 | s->full_pel[1] = get_bits1(&s->gb); |
| 1421 | f_code = get_bits(&s->gb, 3); | 1421 | f_code = get_bits(&s->gb, 3); |
| 1422 | if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT) | 1422 | if (f_code == 0 && avctx->error_recognition >= FF_ER_COMPLIANT) |
| @@ -1425,7 +1425,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx, · 2 unmodified lines | |||
| 1425 | s->mpeg_f_code[1][1] = f_code; | 1425 | s->mpeg_f_code[1][1] = f_code; |
| 1426 | } | 1426 | } |
| 1427 | s->current_picture.pict_type= s->pict_type; | 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 | if(avctx->debug & FF_DEBUG_PICT_INFO) | 1430 | if(avctx->debug & FF_DEBUG_PICT_INFO) |
| 1431 | av_log(avctx, AV_LOG_DEBUG, "vbv_delay %d, ref %d type:%d\n", vbv_delay, ref, s->pict_type); | 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) · 141 unmodified lines | |||
| 1573 | av_log(s->avctx, AV_LOG_ERROR, "Missing picture start code, guessing missing values\n"); | 1573 | av_log(s->avctx, AV_LOG_ERROR, "Missing picture start code, guessing missing values\n"); |
| 1574 | if(s->mpeg_f_code[1][0] == 15 && s->mpeg_f_code[1][1]==15){ | 1574 | if(s->mpeg_f_code[1][0] == 15 && s->mpeg_f_code[1][1]==15){ |
| 1575 | if(s->mpeg_f_code[0][0] == 15 && s->mpeg_f_code[0][1] == 15) | 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 | else | 1577 | else |
| 1578 | s->pict_type= FF_P_TYPE; | 1578 | s->pict_type= AV_PICTURE_TYPE_P; |
| 1579 | }else | 1579 | }else |
| 1580 | s->pict_type= FF_B_TYPE; | 1580 | s->pict_type= AV_PICTURE_TYPE_B; |
| 1581 | s->current_picture.pict_type= s->pict_type; | 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 | s->intra_dc_precision = get_bits(&s->gb, 2); | 1584 | s->intra_dc_precision = get_bits(&s->gb, 2); |
| 1585 | s->picture_structure = get_bits(&s->gb, 2); | 1585 | s->picture_structure = get_bits(&s->gb, 2); |
| @@ -1790,7 +1790,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, · 204 unmodified lines | |||
| 1790 | if(s->avctx->debug&FF_DEBUG_PICT_INFO){ | 1790 | if(s->avctx->debug&FF_DEBUG_PICT_INFO){ |
| 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", | 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 | 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], | 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 | s->progressive_sequence ? "ps" :"", s->progressive_frame ? "pf" : "", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"", | 1794 | s->progressive_sequence ? "ps" :"", s->progressive_frame ? "pf" : "", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"", |
| 1795 | s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors, | 1795 | s->intra_dc_precision, s->picture_structure, s->frame_pred_frame_dct, s->concealment_motion_vectors, |
| 1796 | s->q_scale_type, s->intra_vlc_format, s->repeat_first_field, s->chroma_420_type ? "420" :""); | 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, · 16 unmodified lines | |||
| 1813 | 1813 | ||
| 1814 | for(i=0; i<2; i++){ | 1814 | for(i=0; i<2; i++){ |
| 1815 | for(dir=0; dir<2; dir++){ | 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 | motion_x = motion_y = 0; | 1817 | motion_x = motion_y = 0; |
| 1818 | }else if (s->mv_type == MV_TYPE_16X16 || (s->mv_type == MV_TYPE_FIELD && field_pic)){ | 1818 | }else if (s->mv_type == MV_TYPE_16X16 || (s->mv_type == MV_TYPE_FIELD && field_pic)){ |
| 1819 | motion_x = s->mv[dir][0][0]; | 1819 | motion_x = s->mv[dir][0][0]; |
| @@ -1853,7 +1853,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, · 33 unmodified lines | |||
| 1853 | 1853 | ||
| 1854 | if(s->mb_y >= s->mb_height){ | 1854 | if(s->mb_y >= s->mb_height){ |
| 1855 | int left= get_bits_left(&s->gb); | 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 | && s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0 | 1857 | && s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0 |
| 1858 | && s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/; | 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, · 36 unmodified lines | |||
| 1896 | } | 1896 | } |
| 1897 | if(s->mb_skip_run){ | 1897 | if(s->mb_skip_run){ |
| 1898 | int i; | 1898 | int i; |
| 1899 | if(s->pict_type == FF_I_TYPE){ | 1899 | if(s->pict_type == AV_PICTURE_TYPE_I){ |
| 1900 | av_log(s->avctx, AV_LOG_ERROR, "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y); | 1900 | av_log(s->avctx, AV_LOG_ERROR, "skipped MB in I frame at %d %d\n", s->mb_x, s->mb_y); |
| 1901 | return -1; | 1901 | return -1; |
| 1902 | } | 1902 | } |
| @@ -1909,7 +1909,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, · 6 unmodified lines | |||
| 1909 | s->mv_type = MV_TYPE_16X16; | 1909 | s->mv_type = MV_TYPE_16X16; |
| 1910 | else | 1910 | else |
| 1911 | s->mv_type = MV_TYPE_FIELD; | 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 | /* if P type, zero motion vector is implied */ | 1913 | /* if P type, zero motion vector is implied */ |
| 1914 | s->mv_dir = MV_DIR_FORWARD; | 1914 | s->mv_dir = MV_DIR_FORWARD; |
| 1915 | s->mv[0][0][0] = s->mv[0][0][1] = 0; | 1915 | s->mv[0][0][0] = s->mv[0][0][1] = 0; |
| @@ -2000,7 +2000,7 @@ static int slice_end(AVCodecContext *avctx, AVFrame *pict) · 84 unmodified lines | |||
| 2000 | 2000 | ||
| 2001 | MPV_frame_end(s); | 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 | *pict= *(AVFrame*)s->current_picture_ptr; | 2004 | *pict= *(AVFrame*)s->current_picture_ptr; |
| 2005 | ff_print_debug_info(s, pict); | 2005 | ff_print_debug_info(s, pict); |
| 2006 | } else { | 2006 | } else { |
| @@ -2339,7 +2339,7 @@ static int decode_chunks(AVCodecContext *avctx, · 332 unmodified lines | |||
| 2339 | uint32_t start_code = -1; | 2339 | uint32_t start_code = -1; |
| 2340 | buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code); | 2340 | buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code); |
| 2341 | if (start_code > 0x1ff){ | 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 | if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){ | 2343 | if(HAVE_THREADS && avctx->active_thread_type&FF_THREAD_SLICE){ |
| 2344 | int i; | 2344 | int i; |
| 2345 | 2345 | ||
| @@ -2465,19 +2465,19 @@ static int decode_chunks(AVCodecContext *avctx, · 119 unmodified lines | |||
| 2465 | 2465 | ||
| 2466 | if(s2->last_picture_ptr==NULL){ | 2466 | if(s2->last_picture_ptr==NULL){ |
| 2467 | /* Skip B-frames if we do not have reference frames and gop is not closed */ | 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 | if(!s2->closed_gop) | 2469 | if(!s2->closed_gop) |
| 2470 | break; | 2470 | break; |
| 2471 | } | 2471 | } |
| 2472 | } | 2472 | } |
| 2473 | if(s2->pict_type==FF_I_TYPE) | 2473 | if(s2->pict_type==AV_PICTURE_TYPE_I) |
| 2474 | s->sync=1; | 2474 | s->sync=1; |
| 2475 | if(s2->next_picture_ptr==NULL){ | 2475 | if(s2->next_picture_ptr==NULL){ |
| 2476 | /* Skip P-frames if we do not have a reference frame or we have an invalid header. */ | 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) | 2479 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==AV_PICTURE_TYPE_B) |
| 2480 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=FF_I_TYPE) | 2480 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=AV_PICTURE_TYPE_I) |
| 2481 | || avctx->skip_frame >= AVDISCARD_ALL) | 2481 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 2482 | break; | 2482 | break; |
| 2483 | 2483 | ||
| @@ -354,7 +354,7 @@ void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number) · 353 unmodified lines | |||
| 354 | put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */ | 354 | put_bits(&s->pb, 16, 0xFFFF); /* vbv_delay */ |
| 355 | 355 | ||
| 356 | // RAL: Forward f_code also needed for B frames | 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 | put_bits(&s->pb, 1, 0); /* half pel coordinates */ | 358 | put_bits(&s->pb, 1, 0); /* half pel coordinates */ |
| 359 | if(s->codec_id == CODEC_ID_MPEG1VIDEO) | 359 | if(s->codec_id == CODEC_ID_MPEG1VIDEO) |
| 360 | put_bits(&s->pb, 3, s->f_code); /* forward_f_code */ | 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) · 2 unmodified lines | |||
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | // RAL: Backward f_code necessary for B frames | 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 | put_bits(&s->pb, 1, 0); /* half pel coordinates */ | 367 | put_bits(&s->pb, 1, 0); /* half pel coordinates */ |
| 368 | if(s->codec_id == CODEC_ID_MPEG1VIDEO) | 368 | if(s->codec_id == CODEC_ID_MPEG1VIDEO) |
| 369 | put_bits(&s->pb, 3, s->b_code); /* backward_f_code */ | 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) · 7 unmodified lines | |||
| 377 | if(s->codec_id == CODEC_ID_MPEG2VIDEO){ | 377 | if(s->codec_id == CODEC_ID_MPEG2VIDEO){ |
| 378 | put_header(s, EXT_START_CODE); | 378 | put_header(s, EXT_START_CODE); |
| 379 | put_bits(&s->pb, 4, 8); //pic ext | 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 | put_bits(&s->pb, 4, s->f_code); | 381 | put_bits(&s->pb, 4, s->f_code); |
| 382 | put_bits(&s->pb, 4, s->f_code); | 382 | put_bits(&s->pb, 4, s->f_code); |
| 383 | }else{ | 383 | }else{ |
| 384 | put_bits(&s->pb, 8, 255); | 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 | put_bits(&s->pb, 4, s->b_code); | 387 | put_bits(&s->pb, 4, s->b_code); |
| 388 | put_bits(&s->pb, 4, s->b_code); | 388 | put_bits(&s->pb, 4, s->b_code); |
| 389 | }else{ | 389 | }else{ |
| @@ -456,15 +456,15 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, · 66 unmodified lines | |||
| 456 | 456 | ||
| 457 | if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 && | 457 | if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 && |
| 458 | (mb_x != s->mb_width - 1 || (mb_y != s->mb_height - 1 && s->codec_id == CODEC_ID_MPEG1VIDEO)) && | 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) || | 459 | ((s->pict_type == AV_PICTURE_TYPE_P && (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) | | 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 | ((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))) { | 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 | s->mb_skip_run++; | 462 | s->mb_skip_run++; |
| 463 | s->qscale -= s->dquant; | 463 | s->qscale -= s->dquant; |
| 464 | s->skip_count++; | 464 | s->skip_count++; |
| 465 | s->misc_bits++; | 465 | s->misc_bits++; |
| 466 | s->last_bits++; | 466 | s->last_bits++; |
| 467 | if(s->pict_type == FF_P_TYPE){ | 467 | if(s->pict_type == AV_PICTURE_TYPE_P){ |
| 468 | s->last_mv[0][1][0]= s->last_mv[0][0][0]= | 468 | s->last_mv[0][1][0]= s->last_mv[0][0][0]= |
| 469 | s->last_mv[0][1][1]= s->last_mv[0][0][1]= 0; | 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, · 5 unmodified lines | |||
| 476 | encode_mb_skip_run(s, s->mb_skip_run); | 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 | if(s->dquant && cbp){ | 480 | if(s->dquant && cbp){ |
| 481 | put_mb_modes(s, 2, 1, 0, 0); /* macroblock_type : macroblock_quant = 1 */ | 481 | put_mb_modes(s, 2, 1, 0, 0); /* macroblock_type : macroblock_quant = 1 */ |
| 482 | put_qscale(s); | 482 | put_qscale(s); |
| @@ -497,7 +497,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, · 14 unmodified lines | |||
| 497 | s->misc_bits+= get_bits_diff(s); | 497 | s->misc_bits+= get_bits_diff(s); |
| 498 | s->i_count++; | 498 | s->i_count++; |
| 499 | memset(s->last_mv, 0, sizeof(s->last_mv)); | 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 | if(s->mv_type == MV_TYPE_16X16){ | 501 | if(s->mv_type == MV_TYPE_16X16){ |
| 502 | if (cbp != 0) { | 502 | if (cbp != 0) { |
| 503 | if ((motion_x|motion_y) == 0) { | 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]; · 27 unmodified lines | |||
| 28 | 28 | ||
| 29 | int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s){ | 29 | int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s){ |
| 30 | switch(s->pict_type){ | 30 | switch(s->pict_type){ |
| 31 | case FF_I_TYPE: | 31 | case AV_PICTURE_TYPE_I: |
| 32 | return 16; | 32 | return 16; |
| 33 | case FF_P_TYPE: | 33 | case AV_PICTURE_TYPE_P: |
| 34 | case FF_S_TYPE: | 34 | case AV_PICTURE_TYPE_S: |
| 35 | return s->f_code+15; | 35 | return s->f_code+15; |
| 36 | case FF_B_TYPE: | 36 | case AV_PICTURE_TYPE_B: |
| 37 | return FFMAX3(s->f_code, s->b_code, 2) + 15; | 37 | return FFMAX3(s->f_code, s->b_code, 2) + 15; |
| 38 | default: | 38 | default: |
| 39 | return -1; | 39 | return -1; |
| @@ -118,7 +118,7 @@ static inline int mpeg4_is_resync(MpegEncContext *s){ · 117 unmodified lines | |||
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | while(v<=0xFF){ | 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 | break; | 122 | break; |
| 123 | skip_bits(&s->gb, 8+s->pict_type); | 123 | skip_bits(&s->gb, 8+s->pict_type); |
| 124 | bits_count+= 8+s->pict_type; | 124 | bits_count+= 8+s->pict_type; |
| @@ -373,7 +373,7 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s) · 248 unmodified lines | |||
| 373 | av_log(s->avctx, AV_LOG_ERROR, "illegal mb_num in video packet (%d %d) \n", mb_num, s->mb_num); | 373 | av_log(s->avctx, AV_LOG_ERROR, "illegal mb_num in video packet (%d %d) \n", mb_num, s->mb_num); |
| 374 | return -1; | 374 | return -1; |
| 375 | } | 375 | } |
| 376 | if(s->pict_type == FF_B_TYPE){ | 376 | if(s->pict_type == AV_PICTURE_TYPE_B){ |
| 377 | int mb_x = 0, mb_y = 0; | 377 | int mb_x = 0, mb_y = 0; |
| 378 | 378 | ||
| 379 | while(s->next_picture.mbskip_table[ s->mb_index2xy[ mb_num ] ]) { | 379 | while(s->next_picture.mbskip_table[ s->mb_index2xy[ mb_num ] ]) { |
| @@ -413,20 +413,20 @@ int mpeg4_decode_video_packet_header(MpegEncContext *s) · 33 unmodified lines | |||
| 413 | if(s->shape != BIN_ONLY_SHAPE){ | 413 | if(s->shape != BIN_ONLY_SHAPE){ |
| 414 | skip_bits(&s->gb, 3); /* intra dc vlc threshold */ | 414 | skip_bits(&s->gb, 3); /* intra dc vlc threshold */ |
| 415 | //FIXME don't just ignore everything | 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 | mpeg4_decode_sprite_trajectory(s, &s->gb); | 417 | mpeg4_decode_sprite_trajectory(s, &s->gb); |
| 418 | av_log(s->avctx, AV_LOG_ERROR, "untested\n"); | 418 | av_log(s->avctx, AV_LOG_ERROR, "untested\n"); |
| 419 | } | 419 | } |
| 420 | 420 | ||
| 421 | //FIXME reduced res stuff here | 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 | int f_code = get_bits(&s->gb, 3); /* fcode_for */ | 424 | int f_code = get_bits(&s->gb, 3); /* fcode_for */ |
| 425 | if(f_code==0){ | 425 | if(f_code==0){ |
| 426 | av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (f_code=0)\n"); | 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 | int b_code = get_bits(&s->gb, 3); | 430 | int b_code = get_bits(&s->gb, 3); |
| 431 | if(b_code==0){ | 431 | if(b_code==0){ |
| 432 | av_log(s->avctx, AV_LOG_ERROR, "Error, video packet header damaged (b_code=0)\n"); | 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){ · 122 unmodified lines | |||
| 555 | if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1) | 555 | if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1) |
| 556 | s->first_slice_line=0; | 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 | int i; | 559 | int i; |
| 560 | 560 | ||
| 561 | do{ | 561 | do{ |
| @@ -604,7 +604,7 @@ try_again: · 42 unmodified lines | |||
| 604 | skip_bits1(&s->gb); | 604 | skip_bits1(&s->gb); |
| 605 | if(bits&0x10000){ | 605 | if(bits&0x10000){ |
| 606 | /* skip mb */ | 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 | s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0; | 608 | s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_16x16 | MB_TYPE_GMC | MB_TYPE_L0; |
| 609 | mx= get_amv(s, 0); | 609 | mx= get_amv(s, 0); |
| 610 | my= get_amv(s, 1); | 610 | my= get_amv(s, 1); |
| @@ -645,7 +645,7 @@ try_again: · 34 unmodified lines | |||
| 645 | if(s->mbintra_table[xy]) | 645 | if(s->mbintra_table[xy]) |
| 646 | ff_clean_intra_table_entries(s); | 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 | s->mcsel= get_bits1(&s->gb); | 649 | s->mcsel= get_bits1(&s->gb); |
| 650 | else s->mcsel= 0; | 650 | else s->mcsel= 0; |
| 651 | 651 | ||
| @@ -717,7 +717,7 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){ · 65 unmodified lines | |||
| 717 | if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1) | 717 | if(s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y+1) |
| 718 | s->first_slice_line=0; | 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 | int ac_pred= get_bits1(&s->gb); | 721 | int ac_pred= get_bits1(&s->gb); |
| 722 | int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); | 722 | int cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1); |
| 723 | if(cbpy<0){ | 723 | if(cbpy<0){ |
| @@ -791,8 +791,8 @@ static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count){ · 67 unmodified lines | |||
| 791 | int ff_mpeg4_decode_partitions(MpegEncContext *s) | 791 | int ff_mpeg4_decode_partitions(MpegEncContext *s) |
| 792 | { | 792 | { |
| 793 | int mb_num; | 793 | int mb_num; |
| 794 | const int part_a_error= s->pict_type==FF_I_TYPE ? (DC_ERROR|MV_ERROR) : MV_ERROR; | 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==FF_I_TYPE ? (DC_END |MV_END) : MV_END; | 795 | const int part_a_end = s->pict_type==AV_PICTURE_TYPE_I ? (DC_END |MV_END) : MV_END; |
| 796 | 796 | ||
| 797 | mb_num= mpeg4_decode_partition_a(s); | 797 | mb_num= mpeg4_decode_partition_a(s); |
| 798 | if(mb_num<0){ | 798 | if(mb_num<0){ |
| @@ -808,7 +808,7 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s) · 9 unmodified lines | |||
| 808 | 808 | ||
| 809 | s->mb_num_left= mb_num; | 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 | while(show_bits(&s->gb, 9) == 1) | 812 | while(show_bits(&s->gb, 9) == 1) |
| 813 | skip_bits(&s->gb, 9); | 813 | skip_bits(&s->gb, 9); |
| 814 | if(get_bits_long(&s->gb, 19)!=DC_MARKER){ | 814 | if(get_bits_long(&s->gb, 19)!=DC_MARKER){ |
| @@ -826,11 +826,11 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s) · 11 unmodified lines | |||
| 826 | ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, part_a_end); | 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 | if( mpeg4_decode_partition_b(s, mb_num) < 0){ | 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 | ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, DC_ERROR); | 830 | ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, DC_ERROR); |
| 831 | return -1; | 831 | return -1; |
| 832 | }else{ | 832 | }else{ |
| 833 | if(s->pict_type==FF_P_TYPE) | 833 | if(s->pict_type==AV_PICTURE_TYPE_P) |
| 834 | ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, DC_END); | 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]) · 264 unmodified lines | |||
| 1101 | ff_set_qscale(s, s->current_picture.qscale_table[xy] ); | 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 | int i; | 1105 | int i; |
| 1106 | for(i=0; i<4; i++){ | 1106 | for(i=0; i<4; i++){ |
| 1107 | s->mv[0][i][0] = s->current_picture.motion_val[0][ s->block_index[i] ][0]; | 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]) · 7 unmodified lines | |||
| 1115 | s->block_last_index[i] = -1; | 1115 | s->block_last_index[i] = -1; |
| 1116 | s->mv_dir = MV_DIR_FORWARD; | 1116 | s->mv_dir = MV_DIR_FORWARD; |
| 1117 | s->mv_type = MV_TYPE_16X16; | 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 | s->mcsel=1; | 1119 | s->mcsel=1; |
| 1120 | s->mb_skipped = 0; | 1120 | s->mb_skipped = 0; |
| 1121 | }else{ | 1121 | }else{ |
| @@ -1179,7 +1179,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, · 57 unmodified lines | |||
| 1179 | 1179 | ||
| 1180 | assert(s->h263_pred); | 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 | do{ | 1183 | do{ |
| 1184 | if (get_bits1(&s->gb)) { | 1184 | if (get_bits1(&s->gb)) { |
| 1185 | /* skip mb */ | 1185 | /* skip mb */ |
| @@ -1188,7 +1188,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, · 2 unmodified lines | |||
| 1188 | s->block_last_index[i] = -1; | 1188 | s->block_last_index[i] = -1; |
| 1189 | s->mv_dir = MV_DIR_FORWARD; | 1189 | s->mv_dir = MV_DIR_FORWARD; |
| 1190 | s->mv_type = MV_TYPE_16X16; | 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 | s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0; | 1192 | s->current_picture.mb_type[xy]= MB_TYPE_SKIP | MB_TYPE_GMC | MB_TYPE_16x16 | MB_TYPE_L0; |
| 1193 | s->mcsel=1; | 1193 | s->mcsel=1; |
| 1194 | s->mv[0][0][0]= get_amv(s, 0); | 1194 | s->mv[0][0][0]= get_amv(s, 0); |
| @@ -1216,7 +1216,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, · 21 unmodified lines | |||
| 1216 | s->mb_intra = ((cbpc & 4) != 0); | 1216 | s->mb_intra = ((cbpc & 4) != 0); |
| 1217 | if (s->mb_intra) goto intra; | 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 | s->mcsel= get_bits1(&s->gb); | 1220 | s->mcsel= get_bits1(&s->gb); |
| 1221 | else s->mcsel= 0; | 1221 | else s->mcsel= 0; |
| 1222 | cbpy = get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1) ^ 0x0F; | 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, · 72 unmodified lines | |||
| 1295 | mot_val[1] = my; | 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 | int modb1; // first bit of modb | 1299 | int modb1; // first bit of modb |
| 1300 | int modb2; // second bit of modb | 1300 | int modb2; // second bit of modb |
| 1301 | int mb_type; | 1301 | int mb_type; |
| @@ -1492,12 +1492,12 @@ end: · 190 unmodified lines | |||
| 1492 | if(mpeg4_is_resync(s)){ | 1492 | if(mpeg4_is_resync(s)){ |
| 1493 | const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1; | 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 | ff_thread_await_progress((AVFrame*)s->next_picture_ptr, | 1496 | ff_thread_await_progress((AVFrame*)s->next_picture_ptr, |
| 1497 | (s->mb_x + delta >= s->mb_width) ? FFMIN(s->mb_y+1, s->mb_height-1) : s->mb_y, 0); | 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 | return SLICE_OK; | 1501 | return SLICE_OK; |
| 1502 | return SLICE_END; | 1502 | return SLICE_END; |
| 1503 | } | 1503 | } |
| @@ -1897,13 +1897,13 @@ static int decode_user_data(MpegEncContext *s, GetBitContext *gb){ · 393 unmodified lines | |||
| 1897 | static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ | 1897 | static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ |
| 1898 | int time_incr, time_increment; | 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 */ | 1900 | s->pict_type = get_bits(gb, 2) + AV_PICTURE_TYPE_I; /* 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)){ | 1901 | if(s->pict_type==AV_PICTURE_TYPE_B && s->low_delay && s->vol_control_parameters==0 && !(s->flags & CODEC_FLAG_LOW_DELAY)){ |
| 1902 | av_log(s->avctx, AV_LOG_ERROR, "low_delay flag incorrectly, clearing it\n"); | 1902 | av_log(s->avctx, AV_LOG_ERROR, "low_delay flag incorrectly, clearing it\n"); |
| 1903 | s->low_delay=0; | 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 | if(s->partitioned_frame) | 1907 | if(s->partitioned_frame) |
| 1908 | s->decode_mb= mpeg4_decode_partitioned_mb; | 1908 | s->decode_mb= mpeg4_decode_partitioned_mb; |
| 1909 | else | 1909 | else |
| @@ -1919,8 +1919,8 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ · 9 unmodified lines | |||
| 1919 | av_log(s->avctx, AV_LOG_ERROR, "hmm, seems the headers are not complete, trying to guess time_increment_bits\n"); | 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 | for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){ | 1921 | for(s->time_increment_bits=1 ;s->time_increment_bits<16; s->time_increment_bits++){ |
| 1922 | if ( s->pict_type == FF_P_TYPE | 1922 | if ( s->pict_type == AV_PICTURE_TYPE_P |
| 1923 | || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) { | 1923 | || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE)) { |
| 1924 | if((show_bits(gb, s->time_increment_bits+6)&0x37) == 0x30) break; | 1924 | if((show_bits(gb, s->time_increment_bits+6)&0x37) == 0x30) break; |
| 1925 | }else | 1925 | }else |
| 1926 | if((show_bits(gb, s->time_increment_bits+5)&0x1F) == 0x18) break; | 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){ · 5 unmodified lines | |||
| 1932 | if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further | 1932 | if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further |
| 1933 | else time_increment= get_bits(gb, s->time_increment_bits); | 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 | s->last_time_base= s->time_base; | 1936 | s->last_time_base= s->time_base; |
| 1937 | s->time_base+= time_incr; | 1937 | s->time_base+= time_incr; |
| 1938 | s->time= s->time_base*s->avctx->time_base.den + time_increment; | 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){ · 43 unmodified lines | |||
| 1982 | av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n"); | 1982 | av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n"); |
| 1983 | return FRAME_SKIPPED; | 1983 | return FRAME_SKIPPED; |
| 1984 | } | 1984 | } |
| 1985 | if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == FF_P_TYPE | 1985 | if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == AV_PICTURE_TYPE_P |
| 1986 | || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE))) { | 1986 | || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE))) { |
| 1987 | /* rounding type for motion estimation */ | 1987 | /* rounding type for motion estimation */ |
| 1988 | s->no_rounding = get_bits1(gb); | 1988 | s->no_rounding = get_bits1(gb); |
| 1989 | } else { | 1989 | } else { |
| @@ -1992,7 +1992,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ · 2 unmodified lines | |||
| 1992 | //FIXME reduced res stuff | 1992 | //FIXME reduced res stuff |
| 1993 | 1993 | ||
| 1994 | if (s->shape != RECT_SHAPE) { | 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 | int width, height, hor_spat_ref, ver_spat_ref; | 1996 | int width, height, hor_spat_ref, ver_spat_ref; |
| 1997 | 1997 | ||
| 1998 | width = get_bits(gb, 13); | 1998 | width = get_bits(gb, 13); |
| @@ -2013,9 +2013,9 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ · 14 unmodified lines | |||
| 2013 | 2013 | ||
| 2014 | if (s->shape != BIN_ONLY_SHAPE) { | 2014 | if (s->shape != BIN_ONLY_SHAPE) { |
| 2015 | skip_bits_long(gb, s->cplx_estimation_trash_i); | 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 | skip_bits_long(gb, s->cplx_estimation_trash_p); | 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 | skip_bits_long(gb, s->cplx_estimation_trash_b); | 2019 | skip_bits_long(gb, s->cplx_estimation_trash_b); |
| 2020 | 2020 | ||
| 2021 | s->intra_dc_threshold= mpeg4_dc_threshold[ get_bits(gb, 3) ]; | 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){ · 16 unmodified lines | |||
| 2038 | ff_init_scantable(s->dsp.idct_permutation, &s->intra_v_scantable, ff_alternate_vertical_scan); | 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 | mpeg4_decode_sprite_trajectory(s, gb); | 2042 | mpeg4_decode_sprite_trajectory(s, gb); |
| 2043 | if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n"); | 2043 | if(s->sprite_brightness_change) av_log(s->avctx, AV_LOG_ERROR, "sprite_brightness_change not supported\n"); |
| 2044 | if(s->vol_sprite_usage==STATIC_SPRITE) av_log(s->avctx, AV_LOG_ERROR, "static sprite not supported\n"); | 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){ · 6 unmodified lines | |||
| 2051 | return -1; // makes no sense to continue, as there is nothing left from the image then | 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 | s->f_code = get_bits(gb, 3); /* fcode_for */ | 2055 | s->f_code = get_bits(gb, 3); /* fcode_for */ |
| 2056 | if(s->f_code==0){ | 2056 | if(s->f_code==0){ |
| 2057 | av_log(s->avctx, AV_LOG_ERROR, "Error, header damaged or not MPEG4 header (f_code=0)\n"); | 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){ · 2 unmodified lines | |||
| 2060 | }else | 2060 | }else |
| 2061 | s->f_code=1; | 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 | s->b_code = get_bits(gb, 3); | 2064 | s->b_code = get_bits(gb, 3); |
| 2065 | }else | 2065 | }else |
| 2066 | s->b_code=1; | 2066 | s->b_code=1; |
| @@ -2068,14 +2068,14 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){ · 1 unmodified line | |||
| 2068 | if(s->avctx->debug&FF_DEBUG_PICT_INFO){ | 2068 | if(s->avctx->debug&FF_DEBUG_PICT_INFO){ |
| 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", | 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 | s->qscale, s->f_code, s->b_code, | 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 | gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first, | 2072 | gb->size_in_bits,s->progressive_sequence, s->alternate_scan, s->top_field_first, |
| 2073 | s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points, | 2073 | s->quarter_sample ? "q" : "h", s->data_partitioning, s->resync_marker, s->num_sprite_warping_points, |
| 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); | 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 | if(!s->scalability){ | 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 | skip_bits1(gb); // vop shape coding type | 2079 | skip_bits1(gb); // vop shape coding type |
| 2080 | } | 2080 | } |
| 2081 | }else{ | 2081 | }else{ |
| @@ -205,7 +205,7 @@ void ff_clean_mpeg4_qscales(MpegEncContext *s){ · 204 unmodified lines | |||
| 205 | 205 | ||
| 206 | ff_clean_h263_qscales(s); | 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 | int odd=0; | 209 | int odd=0; |
| 210 | /* ok, come on, this isn't funny anymore, there's more code for handling this mpeg4 mess than for the actual adaptive quantization */ | 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, · 285 unmodified lines | |||
| 497 | { | 497 | { |
| 498 | int cbpc, cbpy, pred_x, pred_y; | 498 | int cbpc, cbpy, pred_x, pred_y; |
| 499 | PutBitContext * const pb2 = s->data_partitioning ? &s->pb2 : &s->pb; | 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; | 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!=FF_I_TYPE ? &s->pb2 : &s->pb; | 501 | PutBitContext * const dc_pb = s->data_partitioning && s->pict_type!=AV_PICTURE_TYPE_I ? &s->pb2 : &s->pb; |
| 502 | const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0; | 502 | const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0; |
| 503 | 503 | ||
| 504 | if (!s->mb_intra) { | 504 | if (!s->mb_intra) { |
| 505 | int i, cbp; | 505 | int i, cbp; |
| 506 | 506 | ||
| 507 | if(s->pict_type==FF_B_TYPE){ | 507 | if(s->pict_type==AV_PICTURE_TYPE_B){ |
| 508 | static const int mb_type_table[8]= {-1, 3, 2, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */ | 508 | static const int mb_type_table[8]= {-1, 3, 2, 1,-1,-1,-1, 0}; /* convert from mv_dir to type */ |
| 509 | int mb_type= mb_type_table[s->mv_dir]; | 509 | int mb_type= mb_type_table[s->mv_dir]; |
| 510 | 510 | ||
| @@ -637,7 +637,7 @@ void mpeg4_encode_mb(MpegEncContext * s, · 126 unmodified lines | |||
| 637 | s->p_tex_bits+= get_bits_diff(s); | 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 | cbp= get_p_cbp(s, block, motion_x, motion_y); | 641 | cbp= get_p_cbp(s, block, motion_x, motion_y); |
| 642 | 642 | ||
| 643 | if ((cbp | motion_x | motion_y | s->dquant) == 0 && s->mv_type==MV_TYPE_16X16) { | 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, · 16 unmodified lines | |||
| 660 | int diff; | 660 | int diff; |
| 661 | Picture *pic= s->reordered_input_picture[i+1]; | 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 | b_pic= pic->data[0] + offset; | 665 | b_pic= pic->data[0] + offset; |
| 666 | if(pic->type != FF_BUFFER_TYPE_SHARED) | 666 | if(pic->type != FF_BUFFER_TYPE_SHARED) |
| @@ -824,7 +824,7 @@ void mpeg4_encode_mb(MpegEncContext * s, · 157 unmodified lines | |||
| 824 | } | 824 | } |
| 825 | 825 | ||
| 826 | cbpc = cbp & 3; | 826 | cbpc = cbp & 3; |
| 827 | if (s->pict_type == FF_I_TYPE) { | 827 | if (s->pict_type == AV_PICTURE_TYPE_I) { |
| 828 | if(s->dquant) cbpc+=4; | 828 | if(s->dquant) cbpc+=4; |
| 829 | put_bits(&s->pb, | 829 | put_bits(&s->pb, |
| 830 | ff_h263_intra_MCBPC_bits[cbpc], | 830 | ff_h263_intra_MCBPC_bits[cbpc], |
| @@ -876,7 +876,7 @@ void ff_mpeg4_stuffing(PutBitContext * pbc) · 45 unmodified lines | |||
| 876 | 876 | ||
| 877 | /* must be called before writing the header */ | 877 | /* must be called before writing the header */ |
| 878 | void ff_set_mpeg4_time(MpegEncContext * s){ | 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 | ff_mpeg4_init_direct_mv(s); | 880 | ff_mpeg4_init_direct_mv(s); |
| 881 | }else{ | 881 | }else{ |
| 882 | s->last_time_base= s->time_base; | 882 | s->last_time_base= s->time_base; |
| @@ -1066,7 +1066,7 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) · 183 unmodified lines | |||
| 1066 | int time_incr; | 1066 | int time_incr; |
| 1067 | int time_div, time_mod; | 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 | if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){ | 1070 | if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){ |
| 1071 | if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy | 1071 | if(s->strict_std_compliance < FF_COMPLIANCE_VERY_STRICT) //HACK, the reference sw is buggy |
| 1072 | mpeg4_encode_visual_object_header(s); | 1072 | mpeg4_encode_visual_object_header(s); |
| @@ -1077,7 +1077,7 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) · 4 unmodified lines | |||
| 1077 | mpeg4_encode_gop_header(s); | 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 | put_bits(&s->pb, 16, 0); /* vop header */ | 1082 | put_bits(&s->pb, 16, 0); /* vop header */ |
| 1083 | put_bits(&s->pb, 16, VOP_STARTCODE); /* vop header */ | 1083 | put_bits(&s->pb, 16, VOP_STARTCODE); /* vop header */ |
| @@ -1097,8 +1097,8 @@ void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number) · 13 unmodified lines | |||
| 1097 | put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */ | 1097 | put_bits(&s->pb, s->time_increment_bits, time_mod); /* time increment */ |
| 1098 | put_bits(&s->pb, 1, 1); /* marker */ | 1098 | put_bits(&s->pb, 1, 1); /* marker */ |
| 1099 | put_bits(&s->pb, 1, 1); /* vop coded */ | 1099 | put_bits(&s->pb, 1, 1); /* vop coded */ |
| 1100 | if ( s->pict_type == FF_P_TYPE | 1100 | if ( s->pict_type == AV_PICTURE_TYPE_P |
| 1101 | || (s->pict_type == FF_S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) { | 1101 | || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE)) { |
| 1102 | put_bits(&s->pb, 1, s->no_rounding); /* rounding type */ | 1102 | put_bits(&s->pb, 1, s->no_rounding); /* rounding type */ |
| 1103 | } | 1103 | } |
| 1104 | put_bits(&s->pb, 3, 0); /* intra dc VLC threshold */ | 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) · 5 unmodified lines | |||
| 1110 | 1110 | ||
| 1111 | put_bits(&s->pb, 5, s->qscale); | 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 | put_bits(&s->pb, 3, s->f_code); /* fcode_for */ | 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 | put_bits(&s->pb, 3, s->b_code); /* fcode_back */ | 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) · 198 unmodified lines | |||
| 1317 | const int tex_pb_len= put_bits_count(&s->tex_pb); | 1317 | const int tex_pb_len= put_bits_count(&s->tex_pb); |
| 1318 | const int bits= put_bits_count(&s->pb); | 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 | put_bits(&s->pb, 19, DC_MARKER); | 1321 | put_bits(&s->pb, 19, DC_MARKER); |
| 1322 | s->misc_bits+=19 + pb2_len + bits - s->last_bits; | 1322 | s->misc_bits+=19 + pb2_len + bits - s->last_bits; |
| 1323 | s->i_tex_bits+= tex_pb_len; | 1323 | s->i_tex_bits+= tex_pb_len; |
| @@ -313,8 +313,8 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){ · 312 unmodified lines | |||
| 313 | /* It might be nicer if the application would keep track of these | 313 | /* It might be nicer if the application would keep track of these |
| 314 | * but it would require an API change. */ | 314 | * but it would require an API change. */ |
| 315 | memmove(s->prev_pict_types+1, s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE-1); | 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; | 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] == FF_B_TYPE) | 317 | if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == AV_PICTURE_TYPE_B) |
| 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. | 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 | pic->owner2 = s; | 319 | pic->owner2 = s; |
| 320 | 320 | ||
| @@ -527,7 +527,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src · 206 unmodified lines | |||
| 527 | s->last_pict_type= s1->pict_type; | 527 | s->last_pict_type= s1->pict_type; |
| 528 | if (s1->current_picture_ptr) s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->quality; | 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 | s->last_non_b_pict_type= s1->pict_type; | 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) · 489 unmodified lines | |||
| 1023 | assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3); | 1023 | assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3); |
| 1024 | 1024 | ||
| 1025 | /* mark&release old frames */ | 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 | if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){ | 1027 | if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){ |
| 1028 | free_frame_buffer(s, s->last_picture_ptr); | 1028 | free_frame_buffer(s, s->last_picture_ptr); |
| 1029 | 1029 | ||
| @@ -1054,7 +1054,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 24 unmodified lines | |||
| 1054 | if (!s->dropable){ | 1054 | if (!s->dropable){ |
| 1055 | if (s->codec_id == CODEC_ID_H264) | 1055 | if (s->codec_id == CODEC_ID_H264) |
| 1056 | pic->reference = s->picture_structure; | 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 | pic->reference = 3; | 1058 | pic->reference = 3; |
| 1059 | } | 1059 | } |
| 1060 | 1060 | ||
| @@ -1077,11 +1077,11 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 16 unmodified lines | |||
| 1077 | s->current_picture_ptr->pict_type= s->pict_type; | 1077 | s->current_picture_ptr->pict_type= s->pict_type; |
| 1078 | // if(s->flags && CODEC_FLAG_QSCALE) | 1078 | // if(s->flags && CODEC_FLAG_QSCALE) |
| 1079 | // s->current_picture_ptr->quality= s->new_picture_ptr->quality; | 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 | ff_copy_picture(&s->current_picture, s->current_picture_ptr); | 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 | s->last_picture_ptr= s->next_picture_ptr; | 1085 | s->last_picture_ptr= s->next_picture_ptr; |
| 1086 | if(!s->dropable) | 1086 | if(!s->dropable) |
| 1087 | s->next_picture_ptr= s->current_picture_ptr; | 1087 | s->next_picture_ptr= s->current_picture_ptr; |
| @@ -1093,7 +1093,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 5 unmodified lines | |||
| 1093 | s->pict_type, s->dropable);*/ | 1093 | s->pict_type, s->dropable);*/ |
| 1094 | 1094 | ||
| 1095 | if(s->codec_id != CODEC_ID_H264){ | 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 | av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n"); | 1097 | av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n"); |
| 1098 | /* Allocate a dummy frame */ | 1098 | /* Allocate a dummy frame */ |
| 1099 | i= ff_find_unused_picture(s, 0); | 1099 | i= ff_find_unused_picture(s, 0); |
| @@ -1103,7 +1103,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 3 unmodified lines | |||
| 1103 | ff_thread_report_progress((AVFrame*)s->last_picture_ptr, INT_MAX, 0); | 1103 | ff_thread_report_progress((AVFrame*)s->last_picture_ptr, INT_MAX, 0); |
| 1104 | ff_thread_report_progress((AVFrame*)s->last_picture_ptr, INT_MAX, 1); | 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 | /* Allocate a dummy frame */ | 1107 | /* Allocate a dummy frame */ |
| 1108 | i= ff_find_unused_picture(s, 0); | 1108 | i= ff_find_unused_picture(s, 0); |
| 1109 | s->next_picture_ptr= &s->picture[i]; | 1109 | s->next_picture_ptr= &s->picture[i]; |
| @@ -1117,7 +1117,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) · 7 unmodified lines | |||
| 1117 | if(s->last_picture_ptr) ff_copy_picture(&s->last_picture, s->last_picture_ptr); | 1117 | if(s->last_picture_ptr) ff_copy_picture(&s->last_picture, s->last_picture_ptr); |
| 1118 | if(s->next_picture_ptr) ff_copy_picture(&s->next_picture, s->next_picture_ptr); | 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 | if(s->picture_structure!=PICT_FRAME && s->out_format != FMT_H264){ | 1122 | if(s->picture_structure!=PICT_FRAME && s->out_format != FMT_H264){ |
| 1123 | int i; | 1123 | int i; |
| @@ -1185,7 +1185,7 @@ void MPV_frame_end(MpegEncContext *s) · 61 unmodified lines | |||
| 1185 | 1185 | ||
| 1186 | s->last_pict_type = s->pict_type; | 1186 | s->last_pict_type = s->pict_type; |
| 1187 | s->last_lambda_for[s->pict_type]= s->current_picture_ptr->quality; | 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 | s->last_non_b_pict_type= s->pict_type; | 1189 | s->last_non_b_pict_type= s->pict_type; |
| 1190 | } | 1190 | } |
| 1191 | #if 0 | 1191 | #if 0 |
| @@ -1314,12 +1314,12 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){ · 122 unmodified lines | |||
| 1314 | 1314 | ||
| 1315 | av_log(s->avctx,AV_LOG_DEBUG,"New frame, type: "); | 1315 | av_log(s->avctx,AV_LOG_DEBUG,"New frame, type: "); |
| 1316 | switch (pict->pict_type) { | 1316 | switch (pict->pict_type) { |
| 1317 | case FF_I_TYPE: av_log(s->avctx,AV_LOG_DEBUG,"I\n"); break; | 1317 | case AV_PICTURE_TYPE_I: 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; | 1318 | case AV_PICTURE_TYPE_P: 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; | 1319 | case AV_PICTURE_TYPE_B: 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; | 1320 | case AV_PICTURE_TYPE_S: 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; | 1321 | case AV_PICTURE_TYPE_SI: 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; | 1322 | case AV_PICTURE_TYPE_SP: av_log(s->avctx,AV_LOG_DEBUG,"SP\n"); break; |
| 1323 | } | 1323 | } |
| 1324 | for(y=0; y<s->mb_height; y++){ | 1324 | for(y=0; y<s->mb_height; y++){ |
| 1325 | for(x=0; x<s->mb_width; x++){ | 1325 | for(x=0; x<s->mb_width; x++){ |
| @@ -1415,15 +1415,15 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict){ · 89 unmodified lines | |||
| 1415 | for(type=0; type<3; type++){ | 1415 | for(type=0; type<3; type++){ |
| 1416 | int direction = 0; | 1416 | int direction = 0; |
| 1417 | switch (type) { | 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 | continue; | 1419 | continue; |
| 1420 | direction = 0; | 1420 | direction = 0; |
| 1421 | break; | 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 | continue; | 1423 | continue; |
| 1424 | direction = 0; | 1424 | direction = 0; |
| 1425 | break; | 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 | continue; | 1427 | continue; |
| 1428 | direction = 1; | 1428 | direction = 1; |
| 1429 | break; | 1429 | break; |
| @@ -1819,7 +1819,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, · 389 unmodified lines | |||
| 1819 | ref_picture, pix_op, | 1819 | ref_picture, pix_op, |
| 1820 | s->mv[dir][1][0], s->mv[dir][1][1], block_s, mb_y); | 1820 | s->mv[dir][1][0], s->mv[dir][1][1], block_s, mb_y); |
| 1821 | } else { | 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 | ref_picture= s->current_picture_ptr->data; | 1823 | ref_picture= s->current_picture_ptr->data; |
| 1824 | } | 1824 | } |
| 1825 | 1825 | ||
| @@ -1833,7 +1833,7 @@ static inline void MPV_motion_lowres(MpegEncContext *s, · 7 unmodified lines | |||
| 1833 | for(i=0; i<2; i++){ | 1833 | for(i=0; i<2; i++){ |
| 1834 | uint8_t ** ref2picture; | 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 | ref2picture= ref_picture; | 1837 | ref2picture= ref_picture; |
| 1838 | }else{ | 1838 | }else{ |
| 1839 | ref2picture= s->current_picture_ptr->data; | 1839 | ref2picture= s->current_picture_ptr->data; |
| @@ -2029,14 +2029,14 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], · 189 unmodified lines | |||
| 2029 | else if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) | 2029 | else if (!is_mpeg12 && (s->h263_pred || s->h263_aic)) |
| 2030 | s->mbintra_table[mb_xy]=1; | 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 | uint8_t *dest_y, *dest_cb, *dest_cr; | 2033 | uint8_t *dest_y, *dest_cb, *dest_cr; |
| 2034 | int dct_linesize, dct_offset; | 2034 | int dct_linesize, dct_offset; |
| 2035 | op_pixels_func (*op_pix)[4]; | 2035 | op_pixels_func (*op_pix)[4]; |
| 2036 | qpel_mc_func (*op_qpix)[16]; | 2036 | qpel_mc_func (*op_qpix)[16]; |
| 2037 | const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics | 2037 | const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics |
| 2038 | const int uvlinesize= s->current_picture.linesize[1]; | 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 | const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8; | 2040 | const int block_size= lowres_flag ? 8>>s->avctx->lowres : 8; |
| 2041 | 2041 | ||
| 2042 | /* avoid copy if macroblock skipped in last frame too */ | 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], · 6 unmodified lines | |||
| 2049 | 2049 | ||
| 2050 | if (s->mb_skipped) { | 2050 | if (s->mb_skipped) { |
| 2051 | s->mb_skipped= 0; | 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 | (*mbskip_ptr) ++; /* indicate that this time we skipped it */ | 2054 | (*mbskip_ptr) ++; /* indicate that this time we skipped it */ |
| 2055 | if(*mbskip_ptr >99) *mbskip_ptr= 99; | 2055 | if(*mbskip_ptr >99) *mbskip_ptr= 99; |
| @@ -2105,7 +2105,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], · 49 unmodified lines | |||
| 2105 | } | 2105 | } |
| 2106 | }else{ | 2106 | }else{ |
| 2107 | op_qpix= s->me.qpel_put; | 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 | op_pix = s->dsp.put_pixels_tab; | 2109 | op_pix = s->dsp.put_pixels_tab; |
| 2110 | }else{ | 2110 | }else{ |
| 2111 | op_pix = s->dsp.put_no_rnd_pixels_tab; | 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], · 11 unmodified lines | |||
| 2123 | 2123 | ||
| 2124 | /* skip dequant / idct if we are really late ;) */ | 2124 | /* skip dequant / idct if we are really late ;) */ |
| 2125 | if(s->avctx->skip_idct){ | 2125 | if(s->avctx->skip_idct){ |
| 2126 | if( (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == FF_B_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 != FF_I_TYPE) | 2127 | ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) |
| 2128 | || s->avctx->skip_idct >= AVDISCARD_ALL) | 2128 | || s->avctx->skip_idct >= AVDISCARD_ALL) |
| 2129 | goto skip_idct; | 2129 | goto skip_idct; |
| 2130 | } | 2130 | } |
| @@ -2287,14 +2287,14 @@ void ff_draw_horiz_band(MpegEncContext *s, int y, int h){ · 156 unmodified lines | |||
| 2287 | AVFrame *src; | 2287 | AVFrame *src; |
| 2288 | int offset[4]; | 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 | src= (AVFrame*)s->current_picture_ptr; | 2291 | src= (AVFrame*)s->current_picture_ptr; |
| 2292 | else if(s->last_picture_ptr) | 2292 | else if(s->last_picture_ptr) |
| 2293 | src= (AVFrame*)s->last_picture_ptr; | 2293 | src= (AVFrame*)s->last_picture_ptr; |
| 2294 | else | 2294 | else |
| 2295 | return; | 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 | offset[0]= | 2298 | offset[0]= |
| 2299 | offset[1]= | 2299 | offset[1]= |
| 2300 | offset[2]= | 2300 | offset[2]= |
| @@ -2330,7 +2330,7 @@ void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename · 29 unmodified lines | |||
| 2330 | s->dest[1] = s->current_picture.data[1] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift)); | 2330 | s->dest[1] = s->current_picture.data[1] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift)); |
| 2331 | s->dest[2] = s->current_picture.data[2] + ((s->mb_x - 1) << (mb_size - s->chroma_x_shift)); | 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 | if(s->picture_structure==PICT_FRAME){ | 2335 | if(s->picture_structure==PICT_FRAME){ |
| 2336 | s->dest[0] += s->mb_y * linesize << mb_size; | 2336 | s->dest[0] += s->mb_y * linesize << mb_size; |
| @@ -2609,6 +2609,6 @@ void ff_set_qscale(MpegEncContext * s, int qscale) · 272 unmodified lines | |||
| 2609 | 2609 | ||
| 2610 | void MPV_report_decode_progress(MpegEncContext *s) | 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 | ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0); | 2613 | ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0); |
| 2614 | } | 2614 | } |
| @@ -330,7 +330,7 @@ typedef struct MpegEncContext { · 329 unmodified lines | |||
| 330 | int adaptive_quant; ///< use adaptive quantization | 330 | int adaptive_quant; ///< use adaptive quantization |
| 331 | int dquant; ///< qscale difference to prev qscale | 331 | int dquant; ///< qscale difference to prev qscale |
| 332 | int closed_gop; ///< MPEG1/2 GOP is closed | 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 | int last_pict_type; //FIXME removes | 334 | int last_pict_type; //FIXME removes |
| 335 | int last_non_b_pict_type; ///< used for mpeg4 gmc b-frames & ratecontrol | 335 | int last_non_b_pict_type; ///< used for mpeg4 gmc b-frames & ratecontrol |
| 336 | int dropable; | 336 | int dropable; |
| @@ -649,7 +649,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s, · 648 unmodified lines | |||
| 649 | 649 | ||
| 650 | prefetch_motion(s, ref_picture, dir); | 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 | int16_t mv_cache[4][4][2]; | 653 | int16_t mv_cache[4][4][2]; |
| 654 | const int xy= s->mb_x + s->mb_y*s->mb_stride; | 654 | const int xy= s->mb_x + s->mb_y*s->mb_stride; |
| 655 | const int mot_stride= s->b8_stride; | 655 | const int mot_stride= s->b8_stride; |
| @@ -816,7 +816,7 @@ static av_always_inline void MPV_motion_internal(MpegEncContext *s, · 160 unmodified lines | |||
| 816 | s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y); | 816 | s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y); |
| 817 | } | 817 | } |
| 818 | } else { | 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 | ref_picture= s->current_picture_ptr->data; | 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, · 8 unmodified lines | |||
| 831 | uint8_t ** ref2picture; | 831 | uint8_t ** ref2picture; |
| 832 | 832 | ||
| 833 | if(s->picture_structure == s->field_select[dir][i] + 1 | 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 | ref2picture= ref_picture; | 835 | ref2picture= ref_picture; |
| 836 | }else{ | 836 | }else{ |
| 837 | ref2picture= s->current_picture_ptr->data; | 837 | ref2picture= s->current_picture_ptr->data; |
| @@ -968,8 +968,8 @@ static int estimate_best_b_count(MpegEncContext *s){ · 967 unmodified lines | |||
| 968 | assert(scale>=0 && scale <=3); | 968 | assert(scale>=0 && scale <=3); |
| 969 | 969 | ||
| 970 | // emms_c(); | 970 | // emms_c(); |
| 971 | p_lambda= s->last_lambda_for[FF_P_TYPE]; //s->next_picture_ptr->quality; | 971 | p_lambda= s->last_lambda_for[AV_PICTURE_TYPE_P]; //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; | 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 | if(!b_lambda) b_lambda= p_lambda; //FIXME we should do this somewhere else | 973 | if(!b_lambda) b_lambda= p_lambda; //FIXME we should do this somewhere else |
| 974 | lambda2= (b_lambda*b_lambda + (1<<FF_LAMBDA_SHIFT)/2 ) >> FF_LAMBDA_SHIFT; | 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){ · 48 unmodified lines | |||
| 1024 | 1024 | ||
| 1025 | c->error[0]= c->error[1]= c->error[2]= 0; | 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 | input[0].quality= 1 * FF_QP2LAMBDA; | 1028 | input[0].quality= 1 * FF_QP2LAMBDA; |
| 1029 | out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[0]); | 1029 | out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[0]); |
| 1030 | // rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT; | 1030 | // rd += (out_size * lambda2) >> FF_LAMBDA_SHIFT; |
| @@ -1032,7 +1032,7 @@ static int estimate_best_b_count(MpegEncContext *s){ · 1 unmodified line | |||
| 1032 | for(i=0; i<s->max_b_frames+1; i++){ | 1032 | for(i=0; i<s->max_b_frames+1; i++){ |
| 1033 | int is_p= i % (j+1) == j || i==s->max_b_frames; | 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 | input[i+1].quality= is_p ? p_lambda : b_lambda; | 1036 | input[i+1].quality= is_p ? p_lambda : b_lambda; |
| 1037 | out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[i+1]); | 1037 | out_size = avcodec_encode_video(c, outbuf, outbuf_size, &input[i+1]); |
| 1038 | rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3); | 1038 | rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3); |
| @@ -1074,7 +1074,7 @@ static int select_input_picture(MpegEncContext *s){ · 35 unmodified lines | |||
| 1074 | if(s->reordered_input_picture[0]==NULL && s->input_picture[0]){ | 1074 | if(s->reordered_input_picture[0]==NULL && s->input_picture[0]){ |
| 1075 | if(/*s->picture_in_gop_number >= s->gop_size ||*/ s->next_picture_ptr==NULL || s->intra_only){ | 1075 | if(/*s->picture_in_gop_number >= s->gop_size ||*/ s->next_picture_ptr==NULL || s->intra_only){ |
| 1076 | s->reordered_input_picture[0]= s->input_picture[0]; | 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 | s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++; | 1078 | s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++; |
| 1079 | }else{ | 1079 | }else{ |
| 1080 | int b_frames; | 1080 | int b_frames; |
| @@ -1109,7 +1109,7 @@ static int select_input_picture(MpegEncContext *s){ · 28 unmodified lines | |||
| 1109 | if(pict_num >= s->rc_context.num_entries) | 1109 | if(pict_num >= s->rc_context.num_entries) |
| 1110 | break; | 1110 | break; |
| 1111 | if(!s->input_picture[i]){ | 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 | break; | 1113 | break; |
| 1114 | } | 1114 | } |
| 1115 | 1115 | ||
| @@ -1153,10 +1153,10 @@ static int select_input_picture(MpegEncContext *s){ · 37 unmodified lines | |||
| 1153 | 1153 | ||
| 1154 | for(i= b_frames - 1; i>=0; i--){ | 1154 | for(i= b_frames - 1; i>=0; i--){ |
| 1155 | int type= s->input_picture[i]->pict_type; | 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 | b_frames= i; | 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 | av_log(s->avctx, AV_LOG_ERROR, "warning, too many b frames in a row\n"); | 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){ · 3 unmodified lines | |||
| 1166 | }else{ | 1166 | }else{ |
| 1167 | if(s->flags & CODEC_FLAG_CLOSED_GOP) | 1167 | if(s->flags & CODEC_FLAG_CLOSED_GOP) |
| 1168 | b_frames=0; | 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 | if( (s->flags & CODEC_FLAG_CLOSED_GOP) | 1173 | if( (s->flags & CODEC_FLAG_CLOSED_GOP) |
| 1174 | && b_frames | 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 | b_frames--; | 1176 | b_frames--; |
| 1177 | 1177 | ||
| 1178 | s->reordered_input_picture[0]= s->input_picture[b_frames]; | 1178 | s->reordered_input_picture[0]= s->input_picture[b_frames]; |
| 1179 | if(s->reordered_input_picture[0]->pict_type != FF_I_TYPE) | 1179 | if(s->reordered_input_picture[0]->pict_type != AV_PICTURE_TYPE_I) |
| 1180 | s->reordered_input_picture[0]->pict_type= FF_P_TYPE; | 1180 | s->reordered_input_picture[0]->pict_type= AV_PICTURE_TYPE_P; |
| 1181 | s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++; | 1181 | s->reordered_input_picture[0]->coded_picture_number= s->coded_picture_number++; |
| 1182 | for(i=0; i<b_frames; i++){ | 1182 | for(i=0; i<b_frames; i++){ |
| 1183 | s->reordered_input_picture[i+1]= s->input_picture[i]; | 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 | s->reordered_input_picture[i+1]->coded_picture_number= s->coded_picture_number++; | 1185 | s->reordered_input_picture[i+1]->coded_picture_number= s->coded_picture_number++; |
| 1186 | } | 1186 | } |
| 1187 | } | 1187 | } |
| 1188 | } | 1188 | } |
| 1189 | no_output_pic: | 1189 | no_output_pic: |
| 1190 | if(s->reordered_input_picture[0]){ | 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 | ff_copy_picture(&s->new_picture, s->reordered_input_picture[0]); | 1193 | ff_copy_picture(&s->new_picture, s->reordered_input_picture[0]); |
| 1194 | 1194 | ||
| @@ -1296,11 +1296,11 @@ vbv_retry: · 101 unmodified lines | |||
| 1296 | s->lambda_table[i]= FFMAX(s->lambda_table[i]+1, s->lambda_table[i]*(s->qscale+1) / s->qscale); | 1296 | s->lambda_table[i]= FFMAX(s->lambda_table[i]+1, s->lambda_table[i]*(s->qscale+1) / s->qscale); |
| 1297 | } | 1297 | } |
| 1298 | s->mb_skipped = 0; //done in MPV_frame_start() | 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 | if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4) | 1300 | if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4) |
| 1301 | s->no_rounding ^= 1; | 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 | s->time_base= s->last_time_base; | 1304 | s->time_base= s->last_time_base; |
| 1305 | s->last_non_b_time= s->time - s->pp_time; | 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, · 221 unmodified lines | |||
| 1528 | 1528 | ||
| 1529 | if(s->codec_id==CODEC_ID_MPEG4){ | 1529 | if(s->codec_id==CODEC_ID_MPEG4){ |
| 1530 | if(!s->mb_intra){ | 1530 | if(!s->mb_intra){ |
| 1531 | if(s->pict_type == FF_B_TYPE){ | 1531 | if(s->pict_type == AV_PICTURE_TYPE_B){ |
| 1532 | if(s->dquant&1 || s->mv_dir&MV_DIRECT) | 1532 | if(s->dquant&1 || s->mv_dir&MV_DIRECT) |
| 1533 | s->dquant= 0; | 1533 | s->dquant= 0; |
| 1534 | } | 1534 | } |
| @@ -1605,7 +1605,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, · 70 unmodified lines | |||
| 1605 | dest_cb = s->dest[1]; | 1605 | dest_cb = s->dest[1]; |
| 1606 | dest_cr = s->dest[2]; | 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 | op_pix = s->dsp.put_pixels_tab; | 1609 | op_pix = s->dsp.put_pixels_tab; |
| 1610 | op_qpix= s->dsp.put_qpel_pixels_tab; | 1610 | op_qpix= s->dsp.put_qpel_pixels_tab; |
| 1611 | }else{ | 1611 | }else{ |
| @@ -1995,7 +1995,7 @@ static int estimate_motion_thread(AVCodecContext *c, void *arg){ · 383 unmodified lines | |||
| 1995 | s->block_index[3]+=2; | 1995 | s->block_index[3]+=2; |
| 1996 | 1996 | ||
| 1997 | /* compute motion vector & mb_type and store in context */ | 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 | ff_estimate_b_frame_motion(s, s->mb_x, s->mb_y); | 1999 | ff_estimate_b_frame_motion(s, s->mb_x, s->mb_y); |
| 2000 | else | 2000 | else |
| 2001 | ff_estimate_p_frame_motion(s, s->mb_x, s->mb_y); | 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){ · 391 unmodified lines | |||
| 2393 | s->mv[1][0][0] = best_s.mv[1][0][0]; | 2393 | s->mv[1][0][0] = best_s.mv[1][0][0]; |
| 2394 | s->mv[1][0][1] = best_s.mv[1][0][1]; | 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 | for(; qpi<4; qpi++){ | 2397 | for(; qpi<4; qpi++){ |
| 2398 | int dquant= dquant_tab[qpi]; | 2398 | int dquant= dquant_tab[qpi]; |
| 2399 | qp= last_qp + dquant; | 2399 | qp= last_qp + dquant; |
| @@ -2495,7 +2495,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 95 unmodified lines | |||
| 2495 | s->last_bits= put_bits_count(&s->pb); | 2495 | s->last_bits= put_bits_count(&s->pb); |
| 2496 | 2496 | ||
| 2497 | if (CONFIG_H263_ENCODER && | 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 | ff_h263_update_motion_val(s); | 2499 | ff_h263_update_motion_val(s); |
| 2500 | 2500 | ||
| 2501 | if(next_block==0){ //FIXME 16 vs linesize16 | 2501 | if(next_block==0){ //FIXME 16 vs linesize16 |
| @@ -2622,7 +2622,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 120 unmodified lines | |||
| 2622 | s->last_mv_dir = s->mv_dir; | 2622 | s->last_mv_dir = s->mv_dir; |
| 2623 | 2623 | ||
| 2624 | if (CONFIG_H263_ENCODER && | 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 | ff_h263_update_motion_val(s); | 2626 | ff_h263_update_motion_val(s); |
| 2627 | 2627 | ||
| 2628 | MPV_decode_mb(s, s->block); | 2628 | MPV_decode_mb(s, s->block); |
| @@ -2660,7 +2660,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 31 unmodified lines | |||
| 2660 | } | 2660 | } |
| 2661 | 2661 | ||
| 2662 | //not beautiful here but we must write it before flushing so it has to be here | 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 | msmpeg4_encode_ext_header(s); | 2664 | msmpeg4_encode_ext_header(s); |
| 2665 | 2665 | ||
| 2666 | write_slice_end(s); | 2666 | write_slice_end(s); |
| @@ -2758,7 +2758,7 @@ static void set_frame_distances(MpegEncContext * s){ · 91 unmodified lines | |||
| 2758 | assert(s->current_picture_ptr->pts != AV_NOPTS_VALUE); | 2758 | assert(s->current_picture_ptr->pts != AV_NOPTS_VALUE); |
| 2759 | s->time= s->current_picture_ptr->pts*s->avctx->time_base.num; | 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 | s->pb_time= s->pp_time - (s->last_non_b_time - s->time); | 2762 | s->pb_time= s->pp_time - (s->last_non_b_time - s->time); |
| 2763 | assert(s->pb_time > 0 && s->pb_time < s->pp_time); | 2763 | assert(s->pb_time > 0 && s->pb_time < s->pp_time); |
| 2764 | }else{ | 2764 | }else{ |
| @@ -2791,10 +2791,10 @@ static int encode_picture(MpegEncContext *s, int picture_number) · 26 unmodified lines | |||
| 2791 | 2791 | ||
| 2792 | // s->lambda= s->current_picture_ptr->quality; //FIXME qscale / ... stuff for ME rate distortion | 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 | if(s->msmpeg4_version >= 3) s->no_rounding=1; | 2795 | if(s->msmpeg4_version >= 3) s->no_rounding=1; |
| 2796 | else s->no_rounding=0; | 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 | if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4) | 2798 | if(s->flipflop_rounding || s->codec_id == CODEC_ID_H263P || s->codec_id == CODEC_ID_MPEG4) |
| 2799 | s->no_rounding ^= 1; | 2799 | s->no_rounding ^= 1; |
| 2800 | } | 2800 | } |
| @@ -2804,7 +2804,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) · 3 unmodified lines | |||
| 2804 | return -1; | 2804 | return -1; |
| 2805 | ff_get_2pass_fcode(s); | 2805 | ff_get_2pass_fcode(s); |
| 2806 | }else if(!(s->flags & CODEC_FLAG_QSCALE)){ | 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 | s->lambda= s->last_lambda_for[s->pict_type]; | 2808 | s->lambda= s->last_lambda_for[s->pict_type]; |
| 2809 | else | 2809 | else |
| 2810 | s->lambda= s->last_lambda_for[s->last_non_b_pict_type]; | 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) · 9 unmodified lines | |||
| 2820 | return -1; | 2820 | return -1; |
| 2821 | 2821 | ||
| 2822 | /* Estimate motion for every MB */ | 2822 | /* Estimate motion for every MB */ |
| 2823 | if(s->pict_type != FF_I_TYPE){ | 2823 | if(s->pict_type != AV_PICTURE_TYPE_I){ |
| 2824 | s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8; | 2824 | s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8; |
| 2825 | s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8; | 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){ | 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==FF_I_TYPE) || s->avctx->pre_me==2){ | 2827 | if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){ |
| 2828 | s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*)); | 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 | s->avctx->execute(s->avctx, estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*)); | 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 | /* I-Frame */ | 2834 | /* I-Frame */ |
| 2835 | for(i=0; i<s->mb_stride*s->mb_height; i++) | 2835 | for(i=0; i<s->mb_stride*s->mb_height; i++) |
| 2836 | s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA; | 2836 | s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA; |
| @@ -2847,15 +2847,15 @@ static int encode_picture(MpegEncContext *s, int picture_number) · 10 unmodified lines | |||
| 2847 | s->current_picture. mb_var_sum= s->current_picture_ptr-> mb_var_sum= s->me. mb_var_sum_temp; | 2847 | s->current_picture. mb_var_sum= s->current_picture_ptr-> mb_var_sum= s->me. mb_var_sum_temp; |
| 2848 | emms_c(); | 2848 | emms_c(); |
| 2849 | 2849 | ||
| 2850 | if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == FF_P_TYPE){ | 2850 | if(s->me.scene_change_score > s->avctx->scenechange_threshold && s->pict_type == AV_PICTURE_TYPE_P){ |
| 2851 | s->pict_type= FF_I_TYPE; | 2851 | s->pict_type= AV_PICTURE_TYPE_I; |
| 2852 | for(i=0; i<s->mb_stride*s->mb_height; i++) | 2852 | for(i=0; i<s->mb_stride*s->mb_height; i++) |
| 2853 | s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA; | 2853 | s->mb_type[i]= CANDIDATE_MB_TYPE_INTRA; |
| 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); | 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 | if(!s->umvplus){ | 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 | s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER); | 2859 | s->f_code= ff_get_best_fcode(s, s->p_mv_table, CANDIDATE_MB_TYPE_INTER); |
| 2860 | 2860 | ||
| 2861 | if(s->flags & CODEC_FLAG_INTERLACED_ME){ | 2861 | if(s->flags & CODEC_FLAG_INTERLACED_ME){ |
| @@ -2877,7 +2877,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) · 15 unmodified lines | |||
| 2877 | } | 2877 | } |
| 2878 | } | 2878 | } |
| 2879 | 2879 | ||
| 2880 | if(s->pict_type==FF_B_TYPE){ | 2880 | if(s->pict_type==AV_PICTURE_TYPE_B){ |
| 2881 | int a, b; | 2881 | int a, b; |
| 2882 | 2882 | ||
| 2883 | a = ff_get_best_fcode(s, s->b_forw_mv_table, CANDIDATE_MB_TYPE_FORWARD); | 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) · 27 unmodified lines | |||
| 2911 | if (estimate_qp(s, 0) < 0) | 2911 | if (estimate_qp(s, 0) < 0) |
| 2912 | return -1; | 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 | s->qscale= 3; //reduce clipping problems | 2915 | s->qscale= 3; //reduce clipping problems |
| 2916 | 2916 | ||
| 2917 | if (s->out_format == FMT_MJPEG) { | 2917 | if (s->out_format == FMT_MJPEG) { |
| @@ -2931,7 +2931,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) · 13 unmodified lines | |||
| 2931 | 2931 | ||
| 2932 | //FIXME var duplication | 2932 | //FIXME var duplication |
| 2933 | s->current_picture_ptr->key_frame= | 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 | s->current_picture_ptr->pict_type= | 2935 | s->current_picture_ptr->pict_type= |
| 2936 | s->current_picture.pict_type= s->pict_type; | 2936 | s->current_picture.pict_type= s->pict_type; |
| 2937 | 2937 | ||
| @@ -110,9 +110,9 @@ int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx) · 109 unmodified lines | |||
| 110 | render->p_past_surface = NULL; | 110 | render->p_past_surface = NULL; |
| 111 | 111 | ||
| 112 | switch(s->pict_type) { | 112 | switch(s->pict_type) { |
| 113 | case FF_I_TYPE: | 113 | case AV_PICTURE_TYPE_I: |
| 114 | return 0; // no prediction from other frames | 114 | return 0; // no prediction from other frames |
| 115 | case FF_B_TYPE: | 115 | case AV_PICTURE_TYPE_B: |
| 116 | next = (struct xvmc_pix_fmt*)s->next_picture.data[2]; | 116 | next = (struct xvmc_pix_fmt*)s->next_picture.data[2]; |
| 117 | if (!next) | 117 | if (!next) |
| 118 | return -1; | 118 | return -1; |
| @@ -120,7 +120,7 @@ int ff_xvmc_field_start(MpegEncContext *s, AVCodecContext *avctx) · 1 unmodified line | |||
| 120 | return -1; | 120 | return -1; |
| 121 | render->p_future_surface = next->p_surface; | 121 | render->p_future_surface = next->p_surface; |
| 122 | // no return here, going to set forward prediction | 122 | // no return here, going to set forward prediction |
| 123 | case FF_P_TYPE: | 123 | case AV_PICTURE_TYPE_P: |
| 124 | last = (struct xvmc_pix_fmt*)s->last_picture.data[2]; | 124 | last = (struct xvmc_pix_fmt*)s->last_picture.data[2]; |
| 125 | if (!last) | 125 | if (!last) |
| 126 | last = render; // predict second field from the first | 126 | last = render; // predict second field from the first |
| @@ -308,7 +308,7 @@ static void find_best_tables(MpegEncContext * s) · 307 unmodified lines | |||
| 308 | int intra_luma_count = s->ac_stats[1][0][level][run][last]; | 308 | int intra_luma_count = s->ac_stats[1][0][level][run][last]; |
| 309 | int intra_chroma_count= s->ac_stats[1][1][level][run][last]; | 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 | size += intra_luma_count *rl_length[i ][level][run][last]; | 312 | size += intra_luma_count *rl_length[i ][level][run][last]; |
| 313 | chroma_size+= intra_chroma_count*rl_length[i+3][level][run][last]; | 313 | chroma_size+= intra_chroma_count*rl_length[i+3][level][run][last]; |
| 314 | }else{ | 314 | }else{ |
| @@ -333,7 +333,7 @@ static void find_best_tables(MpegEncContext * s) · 18 unmodified lines | |||
| 333 | // printf("type:%d, best:%d, qp:%d, var:%d, mcvar:%d, size:%d //\n", | 333 | // printf("type:%d, best:%d, qp:%d, var:%d, mcvar:%d, size:%d //\n", |
| 334 | // s->pict_type, best, s->qscale, s->mb_var_sum, s->mc_mb_var_sum, best_size); | 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 | memset(s->ac_stats, 0, sizeof(int)*(MAX_LEVEL+1)*(MAX_RUN+1)*2*2*2); | 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) · 2 unmodified lines | |||
| 342 | 342 | ||
| 343 | if(s->pict_type != s->last_non_b_pict_type){ | 343 | if(s->pict_type != s->last_non_b_pict_type){ |
| 344 | s->rl_table_index= 2; | 344 | s->rl_table_index= 2; |
| 345 | if(s->pict_type==FF_I_TYPE) | 345 | if(s->pict_type==AV_PICTURE_TYPE_I) |
| 346 | s->rl_chroma_table_index= 1; | 346 | s->rl_chroma_table_index= 1; |
| 347 | else | 347 | else |
| 348 | s->rl_chroma_table_index= 2; | 348 | s->rl_chroma_table_index= 2; |
| @@ -369,10 +369,10 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number) · 20 unmodified lines | |||
| 369 | s->use_skip_mb_code = 1; /* only if P frame */ | 369 | s->use_skip_mb_code = 1; /* only if P frame */ |
| 370 | s->per_mb_rl_table = 0; | 370 | s->per_mb_rl_table = 0; |
| 371 | if(s->msmpeg4_version==4) | 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 | //printf("%d %d %d %d %d\n", s->pict_type, s->bit_rate, s->inter_intra_pred, s->width, s->height); | 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 | s->slice_height= s->mb_height/1; | 376 | s->slice_height= s->mb_height/1; |
| 377 | put_bits(&s->pb, 5, 0x16 + s->mb_height/s->slice_height); | 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, · 240 unmodified lines | |||
| 619 | } | 619 | } |
| 620 | 620 | ||
| 621 | if(s->msmpeg4_version<=2){ | 621 | if(s->msmpeg4_version<=2){ |
| 622 | if (s->pict_type == FF_I_TYPE) { | 622 | if (s->pict_type == AV_PICTURE_TYPE_I) { |
| 623 | put_bits(&s->pb, | 623 | put_bits(&s->pb, |
| 624 | v2_intra_cbpc[cbp&3][1], v2_intra_cbpc[cbp&3][0]); | 624 | v2_intra_cbpc[cbp&3][1], v2_intra_cbpc[cbp&3][0]); |
| 625 | } else { | 625 | } else { |
| @@ -634,7 +634,7 @@ void msmpeg4_encode_mb(MpegEncContext * s, · 8 unmodified lines | |||
| 634 | ff_h263_cbpy_tab[cbp>>2][1], | 634 | ff_h263_cbpy_tab[cbp>>2][1], |
| 635 | ff_h263_cbpy_tab[cbp>>2][0]); | 635 | ff_h263_cbpy_tab[cbp>>2][0]); |
| 636 | }else{ | 636 | }else{ |
| 637 | if (s->pict_type == FF_I_TYPE) { | 637 | if (s->pict_type == AV_PICTURE_TYPE_I) { |
| 638 | put_bits(&s->pb, | 638 | put_bits(&s->pb, |
| 639 | ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]); | 639 | ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]); |
| 640 | } else { | 640 | } else { |
| @@ -1094,7 +1094,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) · 453 unmodified lines | |||
| 1094 | { | 1094 | { |
| 1095 | int cbp, code, i; | 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 | if (s->use_skip_mb_code) { | 1098 | if (s->use_skip_mb_code) { |
| 1099 | if (get_bits1(&s->gb)) { | 1099 | if (get_bits1(&s->gb)) { |
| 1100 | /* skip mb */ | 1100 | /* skip mb */ |
| @@ -1161,7 +1161,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) · 60 unmodified lines | |||
| 1161 | } else{ | 1161 | } else{ |
| 1162 | s->ac_pred = 0; | 1162 | s->ac_pred = 0; |
| 1163 | cbp|= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors | 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]) · 14 unmodified lines | |||
| 1182 | uint8_t *coded_val; | 1182 | uint8_t *coded_val; |
| 1183 | uint32_t * const mb_type_ptr= &s->current_picture.mb_type[ s->mb_x + s->mb_y*s->mb_stride ]; | 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 | if (s->use_skip_mb_code) { | 1186 | if (s->use_skip_mb_code) { |
| 1187 | if (get_bits1(&s->gb)) { | 1187 | if (get_bits1(&s->gb)) { |
| 1188 | /* skip mb */ | 1188 | /* skip mb */ |
| @@ -1390,15 +1390,15 @@ int msmpeg4_decode_picture_header(MpegEncContext * s) · 201 unmodified lines | |||
| 1390 | } | 1390 | } |
| 1391 | 1391 | ||
| 1392 | s->pict_type = get_bits(&s->gb, 2) + 1; | 1392 | s->pict_type = get_bits(&s->gb, 2) + 1; |
| 1393 | if (s->pict_type != FF_I_TYPE && | 1393 | if (s->pict_type != AV_PICTURE_TYPE_I && |
| 1394 | s->pict_type != FF_P_TYPE){ | 1394 | s->pict_type != AV_PICTURE_TYPE_P){ |
| 1395 | av_log(s->avctx, AV_LOG_ERROR, "invalid picture type\n"); | 1395 | av_log(s->avctx, AV_LOG_ERROR, "invalid picture type\n"); |
| 1396 | return -1; | 1396 | return -1; |
| 1397 | } | 1397 | } |
| 1398 | #if 0 | 1398 | #if 0 |
| 1399 | { | 1399 | { |
| 1400 | static int had_i=0; | 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 | if(!had_i) return -1; | 1402 | if(!had_i) return -1; |
| 1403 | } | 1403 | } |
| 1404 | #endif | 1404 | #endif |
| @@ -1408,7 +1408,7 @@ int msmpeg4_decode_picture_header(MpegEncContext * s) · 3 unmodified lines | |||
| 1408 | return -1; | 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 | code = get_bits(&s->gb, 5); | 1412 | code = get_bits(&s->gb, 5); |
| 1413 | if(s->msmpeg4_version==1){ | 1413 | if(s->msmpeg4_version==1){ |
| 1414 | if(code==0 || code>s->mb_height){ | 1414 | if(code==0 || code>s->mb_height){ |
| @@ -256,11 +256,11 @@ static int mxpeg_decode_frame(AVCodecContext *avctx, · 255 unmodified lines | |||
| 256 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 256 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 257 | return AVERROR(ENOMEM); | 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 | jpg->picture_ptr->key_frame = 0; | 260 | jpg->picture_ptr->key_frame = 0; |
| 261 | jpg->got_picture = 1; | 261 | jpg->got_picture = 1; |
| 262 | } else { | 262 | } else { |
| 263 | jpg->picture_ptr->pict_type = FF_I_TYPE; | 263 | jpg->picture_ptr->pict_type = AV_PICTURE_TYPE_I; |
| 264 | jpg->picture_ptr->key_frame = 1; | 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, · 207 unmodified lines | |||
| 208 | return -1; | 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 | c->pic.key_frame = keyframe; | 212 | c->pic.key_frame = keyframe; |
| 213 | // decompress/copy/whatever data | 213 | // decompress/copy/whatever data |
| 214 | switch (comptype) { | 214 | switch (comptype) { |
| @@ -40,7 +40,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, · 39 unmodified lines | |||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | *p = *pict; | 42 | *p = *pict; |
| 43 | p->pict_type = FF_I_TYPE; | 43 | p->pict_type = AV_PICTURE_TYPE_I; |
| 44 | p->key_frame = 1; | 44 | p->key_frame = 1; |
| 45 | 45 | ||
| 46 | s->bytestream_start = | 46 | s->bytestream_start = |
| @@ -72,7 +72,7 @@ AVCodecParserContext *av_parser_init(int codec_id) · 71 unmodified lines | |||
| 72 | } | 72 | } |
| 73 | } | 73 | } |
| 74 | s->fetch_timestamp=1; | 74 | s->fetch_timestamp=1; |
| 75 | s->pict_type = FF_I_TYPE; | 75 | s->pict_type = AV_PICTURE_TYPE_I; |
| 76 | s->key_frame = -1; | 76 | s->key_frame = -1; |
| 77 | s->convergence_duration = 0; | 77 | s->convergence_duration = 0; |
| 78 | s->dts_sync_point = INT_MIN; | 78 | s->dts_sync_point = INT_MIN; |
| @@ -186,7 +186,7 @@ int av_parser_change(AVCodecParserContext *s, · 107 unmodified lines | |||
| 186 | *poutbuf_size= buf_size; | 186 | *poutbuf_size= buf_size; |
| 187 | if(avctx->extradata){ | 187 | if(avctx->extradata){ |
| 188 | if( (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)) | 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 | /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){ | 190 | /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){ |
| 191 | int size= buf_size + avctx->extradata_size; | 191 | int size= buf_size + avctx->extradata_size; |
| 192 | *poutbuf_size= size; | 192 | *poutbuf_size= size; |
| @@ -152,7 +152,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 151 unmodified lines | |||
| 152 | return -1; | 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 | ptr = p->data[0]; | 157 | ptr = p->data[0]; |
| 158 | stride = p->linesize[0]; | 158 | stride = p->linesize[0]; |
| @@ -108,7 +108,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, · 107 unmodified lines | |||
| 108 | const uint8_t *src; | 108 | const uint8_t *src; |
| 109 | 109 | ||
| 110 | *pict = *(AVFrame *)data; | 110 | *pict = *(AVFrame *)data; |
| 111 | pict->pict_type = FF_I_TYPE; | 111 | pict->pict_type = AV_PICTURE_TYPE_I; |
| 112 | pict->key_frame = 1; | 112 | pict->key_frame = 1; |
| 113 | 113 | ||
| 114 | if (avctx->width > 65535 || avctx->height > 65535) { | 114 | if (avctx->width > 65535 || avctx->height > 65535) { |
| @@ -148,7 +148,7 @@ static int decode_frame(AVCodecContext *avctx, · 147 unmodified lines | |||
| 148 | return -1; | 148 | return -1; |
| 149 | } | 149 | } |
| 150 | memset(s->frame.data[0], 0, s->height * s->frame.linesize[0]); | 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 | s->frame.palette_has_changed = 1; | 152 | s->frame.palette_has_changed = 1; |
| 153 | 153 | ||
| 154 | palette = (uint32_t*)s->frame.data[1]; | 154 | palette = (uint32_t*)s->frame.data[1]; |
| @@ -485,7 +485,7 @@ static int decode_frame(AVCodecContext *avctx, · 484 unmodified lines | |||
| 485 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 485 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 486 | goto fail; | 486 | goto fail; |
| 487 | } | 487 | } |
| 488 | p->pict_type= FF_I_TYPE; | 488 | p->pict_type= AV_PICTURE_TYPE_I; |
| 489 | p->key_frame= 1; | 489 | p->key_frame= 1; |
| 490 | p->interlaced_frame = !!s->interlace_type; | 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, · 242 unmodified lines | |||
| 243 | uint8_t *top_buf = NULL; | 243 | uint8_t *top_buf = NULL; |
| 244 | 244 | ||
| 245 | *p = *pict; | 245 | *p = *pict; |
| 246 | p->pict_type= FF_I_TYPE; | 246 | p->pict_type= AV_PICTURE_TYPE_I; |
| 247 | p->key_frame= 1; | 247 | p->key_frame= 1; |
| 248 | 248 | ||
| 249 | s->bytestream_start= | 249 | s->bytestream_start= |
| @@ -52,7 +52,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, · 51 unmodified lines | |||
| 52 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 52 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 53 | return -1; | 53 | return -1; |
| 54 | } | 54 | } |
| 55 | p->pict_type = FF_I_TYPE; | 55 | p->pict_type = AV_PICTURE_TYPE_I; |
| 56 | p->key_frame = 1; | 56 | p->key_frame = 1; |
| 57 | 57 | ||
| 58 | switch (avctx->pix_fmt) { | 58 | switch (avctx->pix_fmt) { |
| @@ -39,7 +39,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, · 38 unmodified lines | |||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | *p = *pict; | 41 | *p = *pict; |
| 42 | p->pict_type = FF_I_TYPE; | 42 | p->pict_type = AV_PICTURE_TYPE_I; |
| 43 | p->key_frame = 1; | 43 | p->key_frame = 1; |
| 44 | 44 | ||
| 45 | s->bytestream_start = | 45 | s->bytestream_start = |
| @@ -74,7 +74,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 73 unmodified lines | |||
| 74 | return -1; | 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 | ptr = p->data[0]; | 79 | ptr = p->data[0]; |
| 80 | stride = p->linesize[0]; | 80 | stride = p->linesize[0]; |
| @@ -54,7 +54,7 @@ static int decode_frame(AVCodecContext *avctx, · 53 unmodified lines | |||
| 54 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 54 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 55 | return -1; | 55 | return -1; |
| 56 | } | 56 | } |
| 57 | p->pict_type= FF_I_TYPE; | 57 | p->pict_type= AV_PICTURE_TYPE_I; |
| 58 | p->key_frame= 1; | 58 | p->key_frame= 1; |
| 59 | 59 | ||
| 60 | outdata = a->pic.data[0]; | 60 | outdata = a->pic.data[0]; |
| @@ -295,11 +295,11 @@ static int qtrle_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, · 294 unmodified lines | |||
| 295 | 295 | ||
| 296 | if (avctx->gop_size == 0 || (s->avctx->frame_number % avctx->gop_size) == 0) { | 296 | if (avctx->gop_size == 0 || (s->avctx->frame_number % avctx->gop_size) == 0) { |
| 297 | /* I-Frame */ | 297 | /* I-Frame */ |
| 298 | p->pict_type = FF_I_TYPE; | 298 | p->pict_type = AV_PICTURE_TYPE_I; |
| 299 | p->key_frame = 1; | 299 | p->key_frame = 1; |
| 300 | } else { | 300 | } else { |
| 301 | /* P-Frame */ | 301 | /* P-Frame */ |
| 302 | p->pict_type = FF_P_TYPE; | 302 | p->pict_type = AV_PICTURE_TYPE_P; |
| 303 | p->key_frame = 0; | 303 | p->key_frame = 0; |
| 304 | } | 304 | } |
| 305 | 305 | ||
| @@ -54,7 +54,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 53 unmodified lines | |||
| 54 | if (avctx->get_buffer(avctx, pic) < 0) | 54 | if (avctx->get_buffer(avctx, pic) < 0) |
| 55 | return -1; | 55 | return -1; |
| 56 | 56 | ||
| 57 | pic->pict_type = FF_I_TYPE; | 57 | pic->pict_type = AV_PICTURE_TYPE_I; |
| 58 | pic->key_frame = 1; | 58 | pic->key_frame = 1; |
| 59 | dst_line = pic->data[0]; | 59 | dst_line = pic->data[0]; |
| 60 | 60 | ||
| @@ -144,7 +144,7 @@ int ff_rate_control_init(MpegEncContext *s) · 143 unmodified lines | |||
| 144 | /* init all to skipped p frames (with b frames we might have a not encoded frame at the end FIXME) */ | 144 | /* init all to skipped p frames (with b frames we might have a not encoded frame at the end FIXME) */ |
| 145 | for(i=0; i<rcc->num_entries; i++){ | 145 | for(i=0; i<rcc->num_entries; i++){ |
| 146 | RateControlEntry *rce= &rcc->entry[i]; | 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 | rce->qscale= rce->new_qscale=FF_QP2LAMBDA * 2; | 148 | rce->qscale= rce->new_qscale=FF_QP2LAMBDA * 2; |
| 149 | rce->misc_bits= s->mb_num + 10; | 149 | rce->misc_bits= s->mb_num + 10; |
| 150 | rce->mb_var_sum= s->mb_num*100; | 150 | rce->mb_var_sum= s->mb_num*100; |
| @@ -211,9 +211,9 @@ int ff_rate_control_init(MpegEncContext *s) · 60 unmodified lines | |||
| 211 | double bits= s->avctx->rc_initial_cplx * (i/10000.0 + 1.0)*s->mb_num; | 211 | double bits= s->avctx->rc_initial_cplx * (i/10000.0 + 1.0)*s->mb_num; |
| 212 | RateControlEntry rce; | 212 | RateControlEntry rce; |
| 213 | 213 | ||
| 214 | if (i%((s->gop_size+3)/4)==0) rce.pict_type= FF_I_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= FF_B_TYPE; | 215 | else if(i%(s->max_b_frames+1)) rce.pict_type= AV_PICTURE_TYPE_B; |
| 216 | else rce.pict_type= FF_P_TYPE; | 216 | else rce.pict_type= AV_PICTURE_TYPE_P; |
| 217 | 217 | ||
| 218 | rce.new_pict_type= rce.pict_type; | 218 | rce.new_pict_type= rce.pict_type; |
| 219 | rce.mc_mb_var_sum= bits*s->mb_num/100000; | 219 | rce.mc_mb_var_sum= bits*s->mb_num/100000; |
| @@ -223,7 +223,7 @@ int ff_rate_control_init(MpegEncContext *s) · 3 unmodified lines | |||
| 223 | rce.b_code = 1; | 223 | rce.b_code = 1; |
| 224 | rce.misc_bits= 1; | 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 | rce.i_count = s->mb_num; | 227 | rce.i_count = s->mb_num; |
| 228 | rce.i_tex_bits= bits; | 228 | rce.i_tex_bits= bits; |
| 229 | rce.p_tex_bits= 0; | 229 | rce.p_tex_bits= 0; |
| @@ -317,23 +317,23 @@ static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_f · 87 unmodified lines | |||
| 317 | rce->p_tex_bits*rce->qscale, | 317 | rce->p_tex_bits*rce->qscale, |
| 318 | (rce->i_tex_bits + rce->p_tex_bits)*(double)rce->qscale, | 318 | (rce->i_tex_bits + rce->p_tex_bits)*(double)rce->qscale, |
| 319 | rce->mv_bits/mb_num, | 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 | rce->i_count/mb_num, | 321 | rce->i_count/mb_num, |
| 322 | rce->mc_mb_var_sum/mb_num, | 322 | rce->mc_mb_var_sum/mb_num, |
| 323 | rce->mb_var_sum/mb_num, | 323 | rce->mb_var_sum/mb_num, |
| 324 | rce->pict_type == FF_I_TYPE, | 324 | rce->pict_type == AV_PICTURE_TYPE_I, |
| 325 | rce->pict_type == FF_P_TYPE, | 325 | rce->pict_type == AV_PICTURE_TYPE_P, |
| 326 | rce->pict_type == FF_B_TYPE, | 326 | rce->pict_type == AV_PICTURE_TYPE_B, |
| 327 | rcc->qscale_sum[pict_type] / (double)rcc->frame_count[pict_type], | 327 | rcc->qscale_sum[pict_type] / (double)rcc->frame_count[pict_type], |
| 328 | a->qcompress, | 328 | a->qcompress, |
| 329 | /* rcc->last_qscale_for[FF_I_TYPE], | 329 | /* rcc->last_qscale_for[AV_PICTURE_TYPE_I], |
| 330 | rcc->last_qscale_for[FF_P_TYPE], | 330 | rcc->last_qscale_for[AV_PICTURE_TYPE_P], |
| 331 | rcc->last_qscale_for[FF_B_TYPE], | 331 | rcc->last_qscale_for[AV_PICTURE_TYPE_B], |
| 332 | rcc->next_non_b_qscale,*/ | 332 | rcc->next_non_b_qscale,*/ |
| 333 | rcc->i_cplx_sum[FF_I_TYPE] / (double)rcc->frame_count[FF_I_TYPE], | 333 | rcc->i_cplx_sum[AV_PICTURE_TYPE_I] / (double)rcc->frame_count[AV_PICTURE_TYPE_I], |
| 334 | rcc->i_cplx_sum[FF_P_TYPE] / (double)rcc->frame_count[FF_P_TYPE], | 334 | rcc->i_cplx_sum[AV_PICTURE_TYPE_P] / (double)rcc->frame_count[AV_PICTURE_TYPE_P], |
| 335 | rcc->p_cplx_sum[FF_P_TYPE] / (double)rcc->frame_count[FF_P_TYPE], | 335 | rcc->p_cplx_sum[AV_PICTURE_TYPE_P] / (double)rcc->frame_count[AV_PICTURE_TYPE_P], |
| 336 | rcc->p_cplx_sum[FF_B_TYPE] / (double)rcc->frame_count[FF_B_TYPE], | 336 | rcc->p_cplx_sum[AV_PICTURE_TYPE_B] / (double)rcc->frame_count[AV_PICTURE_TYPE_B], |
| 337 | (rcc->i_cplx_sum[pict_type] + rcc->p_cplx_sum[pict_type]) / (double)rcc->frame_count[pict_type], | 337 | (rcc->i_cplx_sum[pict_type] + rcc->p_cplx_sum[pict_type]) / (double)rcc->frame_count[pict_type], |
| 338 | 0 | 338 | 0 |
| 339 | }; | 339 | }; |
| @@ -364,9 +364,9 @@ static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_f · 24 unmodified lines | |||
| 364 | q= bits2qp(rce, bits); | 364 | q= bits2qp(rce, bits); |
| 365 | 365 | ||
| 366 | /* I/B difference */ | 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 | q= -q*s->avctx->i_quant_factor + s->avctx->i_quant_offset; | 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 | q= -q*s->avctx->b_quant_factor + s->avctx->b_quant_offset; | 370 | q= -q*s->avctx->b_quant_factor + s->avctx->b_quant_offset; |
| 371 | if(q<1) q=1; | 371 | if(q<1) q=1; |
| 372 | 372 | ||
| @@ -377,17 +377,17 @@ static double get_diff_limited_q(MpegEncContext *s, RateControlEntry *rce, doubl · 4 unmodified lines | |||
| 377 | RateControlContext *rcc= &s->rc_context; | 377 | RateControlContext *rcc= &s->rc_context; |
| 378 | AVCodecContext *a= s->avctx; | 378 | AVCodecContext *a= s->avctx; |
| 379 | const int pict_type= rce->new_pict_type; | 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 | const double last_non_b_q= rcc->last_qscale_for[rcc->last_non_b_pict_type]; | 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 | q= last_p_q *FFABS(a->i_quant_factor) + a->i_quant_offset; | 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 | q= last_non_b_q* a->b_quant_factor + a->b_quant_offset; | 386 | q= last_non_b_q* a->b_quant_factor + a->b_quant_offset; |
| 387 | if(q<1) q=1; | 387 | if(q<1) q=1; |
| 388 | 388 | ||
| 389 | /* last qscale / qdiff stuff */ | 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 | double last_q= rcc->last_qscale_for[pict_type]; | 391 | double last_q= rcc->last_qscale_for[pict_type]; |
| 392 | const int maxdiff= FF_QP2LAMBDA * a->max_qdiff; | 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 · 3 unmodified lines | |||
| 397 | 397 | ||
| 398 | rcc->last_qscale_for[pict_type]= q; //Note we cannot do that after blurring | 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 | rcc->last_non_b_pict_type= pict_type; | 401 | rcc->last_non_b_pict_type= pict_type; |
| 402 | 402 | ||
| 403 | return q; | 403 | return q; |
| @@ -412,10 +412,10 @@ static void get_qminmax(int *qmin_ret, int *qmax_ret, MpegEncContext *s, int pic · 8 unmodified lines | |||
| 412 | 412 | ||
| 413 | assert(qmin <= qmax); | 413 | assert(qmin <= qmax); |
| 414 | 414 | ||
| 415 | if(pict_type==FF_B_TYPE){ | 415 | if(pict_type==AV_PICTURE_TYPE_B){ |
| 416 | qmin= (int)(qmin*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5); | 416 | qmin= (int)(qmin*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5); |
| 417 | qmax= (int)(qmax*FFABS(s->avctx->b_quant_factor)+s->avctx->b_quant_offset + 0.5); | 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 | qmin= (int)(qmin*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5); | 419 | qmin= (int)(qmin*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5); |
| 420 | qmax= (int)(qmax*FFABS(s->avctx->i_quant_factor)+s->avctx->i_quant_offset + 0.5); | 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, · 19 unmodified lines | |||
| 441 | get_qminmax(&qmin, &qmax, s, pict_type); | 441 | get_qminmax(&qmin, &qmax, s, pict_type); |
| 442 | 442 | ||
| 443 | /* modulation */ | 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 | q*= s->avctx->rc_qmod_amp; | 445 | q*= s->avctx->rc_qmod_amp; |
| 446 | 446 | ||
| 447 | //printf("q:%f\n", q); | 447 | //printf("q:%f\n", q); |
| @@ -684,7 +684,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) · 236 unmodified lines | |||
| 684 | //printf("input_pic_num:%d pic_num:%d frame_rate:%d\n", s->input_picture_number, s->picture_number, s->frame_rate); | 684 | //printf("input_pic_num:%d pic_num:%d frame_rate:%d\n", s->input_picture_number, s->picture_number, s->frame_rate); |
| 685 | /* update predictors */ | 685 | /* update predictors */ |
| 686 | if(picture_number>2 && !dry_run){ | 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 | update_predictor(&rcc->pred[s->last_pict_type], rcc->last_qscale, sqrt(last_var), s->frame_bits); | 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) · 8 unmodified lines | |||
| 699 | 699 | ||
| 700 | //FIXME add a dts field to AVFrame and ensure its set and use it here instead of reordering | 700 | //FIXME add a dts field to AVFrame and ensure its set and use it here instead of reordering |
| 701 | //but the reordering is simpler for now until h.264 b pyramid must be handeld | 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 | dts_pic= s->current_picture_ptr; | 703 | dts_pic= s->current_picture_ptr; |
| 704 | else | 704 | else |
| 705 | dts_pic= s->last_picture_ptr; | 705 | dts_pic= s->last_picture_ptr; |
| @@ -717,11 +717,11 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) · 11 unmodified lines | |||
| 717 | br_compensation= (a->bit_rate_tolerance - diff)/a->bit_rate_tolerance; | 717 | br_compensation= (a->bit_rate_tolerance - diff)/a->bit_rate_tolerance; |
| 718 | if(br_compensation<=0.0) br_compensation=0.001; | 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 | short_term_q = 0; /* avoid warning */ | 722 | short_term_q = 0; /* avoid warning */ |
| 723 | if(s->flags&CODEC_FLAG_PASS2){ | 723 | if(s->flags&CODEC_FLAG_PASS2){ |
| 724 | if(pict_type!=FF_I_TYPE) | 724 | if(pict_type!=AV_PICTURE_TYPE_I) |
| 725 | assert(pict_type == rce->new_pict_type); | 725 | assert(pict_type == rce->new_pict_type); |
| 726 | 726 | ||
| 727 | q= rce->new_qscale / br_compensation; | 727 | q= rce->new_qscale / br_compensation; |
| @@ -737,7 +737,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) · 9 unmodified lines | |||
| 737 | rce->misc_bits= 1; | 737 | rce->misc_bits= 1; |
| 738 | 738 | ||
| 739 | bits= predict_size(&rcc->pred[pict_type], rce->qscale, sqrt(var)); | 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 | rce->i_count = s->mb_num; | 741 | rce->i_count = s->mb_num; |
| 742 | rce->i_tex_bits= bits; | 742 | rce->i_tex_bits= bits; |
| 743 | rce->p_tex_bits= 0; | 743 | rce->p_tex_bits= 0; |
| @@ -767,7 +767,7 @@ float ff_rate_estimate_qscale(MpegEncContext *s, int dry_run) · 23 unmodified lines | |||
| 767 | //printf("%f ", q); | 767 | //printf("%f ", q); |
| 768 | assert(q>0.0); | 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 | rcc->short_term_qsum*=a->qblur; | 771 | rcc->short_term_qsum*=a->qblur; |
| 772 | rcc->short_term_qcount*=a->qblur; | 772 | rcc->short_term_qcount*=a->qblur; |
| 773 | 773 | ||
| @@ -842,7 +842,7 @@ static int init_pass2(MpegEncContext *s) · 68 unmodified lines | |||
| 842 | complexity[rce->new_pict_type]+= (rce->i_tex_bits+ rce->p_tex_bits)*(double)rce->qscale; | 842 | complexity[rce->new_pict_type]+= (rce->i_tex_bits+ rce->p_tex_bits)*(double)rce->qscale; |
| 843 | const_bits[rce->new_pict_type]+= rce->mv_bits + rce->misc_bits; | 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 | if(all_available_bits < all_const_bits){ | 847 | if(all_available_bits < all_const_bits){ |
| 848 | av_log(s->avctx, AV_LOG_ERROR, "requested bitrate is too low\n"); | 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) · 91 unmodified lines | |||
| 92 | if (!context->buffer) | 92 | if (!context->buffer) |
| 93 | return -1; | 93 | return -1; |
| 94 | } | 94 | } |
| 95 | context->pic.pict_type = FF_I_TYPE; | 95 | context->pic.pict_type = AV_PICTURE_TYPE_I; |
| 96 | context->pic.key_frame = 1; | 96 | context->pic.key_frame = 1; |
| 97 | 97 | ||
| 98 | avctx->coded_frame= &context->pic; | 98 | avctx->coded_frame= &context->pic; |
| @@ -32,7 +32,7 @@ · 31 unmodified lines | |||
| 32 | static av_cold int raw_init_encoder(AVCodecContext *avctx) | 32 | static av_cold int raw_init_encoder(AVCodecContext *avctx) |
| 33 | { | 33 | { |
| 34 | avctx->coded_frame = (AVFrame *)avctx->priv_data; | 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 | avctx->coded_frame->key_frame = 1; | 36 | avctx->coded_frame->key_frame = 1; |
| 37 | avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]); | 37 | avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]); |
| 38 | if(!avctx->codec_tag) | 38 | if(!avctx->codec_tag) |
| @@ -240,9 +240,9 @@ static int rv10_decode_picture_header(MpegEncContext *s) · 239 unmodified lines | |||
| 240 | marker = get_bits1(&s->gb); | 240 | marker = get_bits1(&s->gb); |
| 241 | 241 | ||
| 242 | if (get_bits1(&s->gb)) | 242 | if (get_bits1(&s->gb)) |
| 243 | s->pict_type = FF_P_TYPE; | 243 | s->pict_type = AV_PICTURE_TYPE_P; |
| 244 | else | 244 | else |
| 245 | s->pict_type = FF_I_TYPE; | 245 | s->pict_type = AV_PICTURE_TYPE_I; |
| 246 | if(!marker) av_log(s->avctx, AV_LOG_ERROR, "marker missing\n"); | 246 | if(!marker) av_log(s->avctx, AV_LOG_ERROR, "marker missing\n"); |
| 247 | pb_frame = get_bits1(&s->gb); | 247 | pb_frame = get_bits1(&s->gb); |
| 248 | 248 | ||
| @@ -259,7 +259,7 @@ static int rv10_decode_picture_header(MpegEncContext *s) · 10 unmodified lines | |||
| 259 | return -1; | 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 | if (s->rv10_version == 3) { | 263 | if (s->rv10_version == 3) { |
| 264 | /* specific MPEG like DC coding not used */ | 264 | /* specific MPEG like DC coding not used */ |
| 265 | s->last_dc[0] = get_bits(&s->gb, 8); | 265 | s->last_dc[0] = get_bits(&s->gb, 8); |
| @@ -319,16 +319,16 @@ static int rv20_decode_picture_header(MpegEncContext *s) · 53 unmodified lines | |||
| 319 | 319 | ||
| 320 | i= get_bits(&s->gb, 2); | 320 | i= get_bits(&s->gb, 2); |
| 321 | switch(i){ | 321 | switch(i){ |
| 322 | case 0: s->pict_type= FF_I_TYPE; break; | 322 | case 0: s->pict_type= AV_PICTURE_TYPE_I; break; |
| 323 | case 1: s->pict_type= FF_I_TYPE; break; //hmm ... | 323 | case 1: s->pict_type= AV_PICTURE_TYPE_I; break; //hmm ... |
| 324 | case 2: s->pict_type= FF_P_TYPE; break; | 324 | case 2: s->pict_type= AV_PICTURE_TYPE_P; break; |
| 325 | case 3: s->pict_type= FF_B_TYPE; break; | 325 | case 3: s->pict_type= AV_PICTURE_TYPE_B; break; |
| 326 | default: | 326 | default: |
| 327 | av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n"); | 327 | av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n"); |
| 328 | return -1; | 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 | av_log(s->avctx, AV_LOG_ERROR, "early B pix\n"); | 332 | av_log(s->avctx, AV_LOG_ERROR, "early B pix\n"); |
| 333 | return -1; | 333 | return -1; |
| 334 | } | 334 | } |
| @@ -399,7 +399,7 @@ static int rv20_decode_picture_header(MpegEncContext *s) · 64 unmodified lines | |||
| 399 | if(seq - s->time > 0x4000) seq -= 0x8000; | 399 | if(seq - s->time > 0x4000) seq -= 0x8000; |
| 400 | if(seq - s->time < -0x4000) seq += 0x8000; | 400 | if(seq - s->time < -0x4000) seq += 0x8000; |
| 401 | if(seq != s->time){ | 401 | if(seq != s->time){ |
| 402 | if(s->pict_type!=FF_B_TYPE){ | 402 | if(s->pict_type!=AV_PICTURE_TYPE_B){ |
| 403 | s->time= seq; | 403 | s->time= seq; |
| 404 | s->pp_time= s->time - s->last_non_b_time; | 404 | s->pp_time= s->time - s->last_non_b_time; |
| 405 | s->last_non_b_time= s->time; | 405 | s->last_non_b_time= s->time; |
| @@ -422,7 +422,7 @@ av_log(s->avctx, AV_LOG_DEBUG, "\n");*/ · 16 unmodified lines | |||
| 422 | 422 | ||
| 423 | s->f_code = 1; | 423 | s->f_code = 1; |
| 424 | s->unrestricted_mv = 1; | 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 | // s->alt_inter_vlc=1; | 426 | // s->alt_inter_vlc=1; |
| 427 | // s->obmc=1; | 427 | // s->obmc=1; |
| 428 | // s->umvplus=1; | 428 | // s->umvplus=1; |
| @@ -435,7 +435,7 @@ av_log(s->avctx, AV_LOG_DEBUG, "\n");*/ · 6 unmodified lines | |||
| 435 | seq, s->mb_x, s->mb_y, s->pict_type, s->qscale, s->no_rounding); | 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 | return s->mb_width*s->mb_height - mb_pos; | 440 | return s->mb_width*s->mb_height - mb_pos; |
| 441 | } | 441 | } |
| @@ -616,7 +616,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, · 174 unmodified lines | |||
| 616 | av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y); | 616 | av_log(s->avctx, AV_LOG_ERROR, "ERROR at MB %d %d\n", s->mb_x, s->mb_y); |
| 617 | return -1; | 617 | return -1; |
| 618 | } | 618 | } |
| 619 | if(s->pict_type != FF_B_TYPE) | 619 | if(s->pict_type != AV_PICTURE_TYPE_B) |
| 620 | ff_h263_update_motion_val(s); | 620 | ff_h263_update_motion_val(s); |
| 621 | MPV_decode_mb(s, s->block); | 621 | MPV_decode_mb(s, s->block); |
| 622 | if(s->loop_filter) | 622 | if(s->loop_filter) |
| @@ -693,7 +693,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, · 70 unmodified lines | |||
| 693 | ff_er_frame_end(s); | 693 | ff_er_frame_end(s); |
| 694 | MPV_frame_end(s); | 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 | *pict= *(AVFrame*)s->current_picture_ptr; | 697 | *pict= *(AVFrame*)s->current_picture_ptr; |
| 698 | } else if (s->last_picture_ptr != NULL) { | 698 | } else if (s->last_picture_ptr != NULL) { |
| 699 | *pict= *(AVFrame*)s->last_picture_ptr; | 699 | *pict= *(AVFrame*)s->last_picture_ptr; |
| @@ -36,13 +36,13 @@ void rv10_encode_picture_header(MpegEncContext *s, int picture_number) · 35 unmodified lines | |||
| 36 | 36 | ||
| 37 | put_bits(&s->pb, 1, 1); /* marker */ | 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 | put_bits(&s->pb, 1, 0); /* not PB frame */ | 41 | put_bits(&s->pb, 1, 0); /* not PB frame */ |
| 42 | 42 | ||
| 43 | put_bits(&s->pb, 5, s->qscale); | 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 | /* specific MPEG like DC coding not used */ | 46 | /* specific MPEG like DC coding not used */ |
| 47 | } | 47 | } |
| 48 | /* if multiple packets per frame are sent, the position at which | 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){ · 46 unmodified lines | |||
| 47 | assert(s->modified_quant==1); | 47 | assert(s->modified_quant==1); |
| 48 | assert(s->loop_filter==1); | 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 | if(s->h263_aic){ | 51 | if(s->h263_aic){ |
| 52 | s->y_dc_scale_table= | 52 | s->y_dc_scale_table= |
| 53 | s->c_dc_scale_table= ff_aic_dc_scale_table; | 53 | s->c_dc_scale_table= ff_aic_dc_scale_table; |
| @@ -111,7 +111,7 @@ static int rv30_decode_mb_info(RV34DecContext *r) · 110 unmodified lines | |||
| 111 | av_log(s->avctx, AV_LOG_ERROR, "dquant needed\n"); | 111 | av_log(s->avctx, AV_LOG_ERROR, "dquant needed\n"); |
| 112 | code -= 6; | 112 | code -= 6; |
| 113 | } | 113 | } |
| 114 | if(s->pict_type != FF_B_TYPE) | 114 | if(s->pict_type != AV_PICTURE_TYPE_B) |
| 115 | return rv30_p_types[code]; | 115 | return rv30_p_types[code]; |
| 116 | else | 116 | else |
| 117 | return rv30_b_types[code]; | 117 | return rv30_b_types[code]; |
| @@ -816,7 +816,7 @@ static int rv34_decode_mv(RV34DecContext *r, int block_type) · 815 unmodified lines | |||
| 816 | ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | 816 | ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); |
| 817 | return 0; | 817 | return 0; |
| 818 | case RV34_MB_SKIP: | 818 | case RV34_MB_SKIP: |
| 819 | if(s->pict_type == FF_P_TYPE){ | 819 | if(s->pict_type == AV_PICTURE_TYPE_P){ |
| 820 | ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); | 820 | ZERO8x2(s->current_picture_ptr->motion_val[0][s->mb_x * 2 + s->mb_y * 2 * s->b8_stride], s->b8_stride); |
| 821 | rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0); | 821 | rv34_mc_1mv (r, block_type, 0, 0, 0, 2, 2, 0); |
| 822 | break; | 822 | break; |
| @@ -1055,9 +1055,9 @@ static int rv34_decode_mb_header(RV34DecContext *r, int8_t *intra_types) · 232 unmodified lines | |||
| 1055 | s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type]; | 1055 | s->current_picture_ptr->mb_type[mb_pos] = rv34_mb_type_to_lavc[r->block_type]; |
| 1056 | r->mb_type[mb_pos] = r->block_type; | 1056 | r->mb_type[mb_pos] = r->block_type; |
| 1057 | if(r->block_type == RV34_MB_SKIP){ | 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 | r->mb_type[mb_pos] = RV34_MB_P_16x16; | 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 | r->mb_type[mb_pos] = RV34_MB_B_DIRECT; | 1061 | r->mb_type[mb_pos] = RV34_MB_B_DIRECT; |
| 1062 | } | 1062 | } |
| 1063 | r->is16 = !!IS_INTRA16x16(s->current_picture_ptr->mb_type[mb_pos]); | 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) · 133 unmodified lines | |||
| 1197 | cbp = cbp2 = rv34_decode_mb_header(r, intra_types); | 1197 | cbp = cbp2 = rv34_decode_mb_header(r, intra_types); |
| 1198 | r->cbp_luma [mb_pos] = cbp; | 1198 | r->cbp_luma [mb_pos] = cbp; |
| 1199 | r->cbp_chroma[mb_pos] = cbp >> 16; | 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 | r->deblock_coefs[mb_pos] = 0xFFFF; | 1201 | r->deblock_coefs[mb_pos] = 0xFFFF; |
| 1202 | else | 1202 | else |
| 1203 | r->deblock_coefs[mb_pos] = rv34_set_deblock_coef(r) | r->cbp_luma[mb_pos]; | 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 · 94 unmodified lines | |||
| 1298 | r->cbp_chroma = av_realloc(r->cbp_chroma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma)); | 1298 | r->cbp_chroma = av_realloc(r->cbp_chroma, r->s.mb_stride * r->s.mb_height * sizeof(*r->cbp_chroma)); |
| 1299 | r->deblock_coefs = av_realloc(r->deblock_coefs, r->s.mb_stride * r->s.mb_height * sizeof(*r->deblock_coefs)); | 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 | if(MPV_frame_start(s, s->avctx) < 0) | 1302 | if(MPV_frame_start(s, s->avctx) < 0) |
| 1303 | return -1; | 1303 | return -1; |
| 1304 | ff_er_frame_start(s); | 1304 | ff_er_frame_start(s); |
| 1305 | r->cur_pts = r->si.pts; | 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 | r->last_pts = r->next_pts; | 1307 | r->last_pts = r->next_pts; |
| 1308 | r->next_pts = r->cur_pts; | 1308 | r->next_pts = r->cur_pts; |
| 1309 | } | 1309 | } |
| @@ -1452,10 +1452,10 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, · 142 unmodified lines | |||
| 1452 | av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n"); | 1452 | av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n"); |
| 1453 | return -1; | 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 | return -1; | 1456 | return -1; |
| 1457 | if( (avctx->skip_frame >= AVDISCARD_NONREF && si.type==FF_B_TYPE) | 1457 | if( (avctx->skip_frame >= AVDISCARD_NONREF && si.type==AV_PICTURE_TYPE_B) |
| 1458 | || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=FF_I_TYPE) | 1458 | || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=AV_PICTURE_TYPE_I) |
| 1459 | || avctx->skip_frame >= AVDISCARD_ALL) | 1459 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 1460 | return buf_size; | 1460 | return buf_size; |
| 1461 | 1461 | ||
| @@ -1494,7 +1494,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, · 32 unmodified lines | |||
| 1494 | r->loop_filter(r, s->mb_height - 1); | 1494 | r->loop_filter(r, s->mb_height - 1); |
| 1495 | ff_er_frame_end(s); | 1495 | ff_er_frame_end(s); |
| 1496 | MPV_frame_end(s); | 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 | *pict= *(AVFrame*)s->current_picture_ptr; | 1498 | *pict= *(AVFrame*)s->current_picture_ptr; |
| 1499 | } else if (s->last_picture_ptr != NULL) { | 1499 | } else if (s->last_picture_ptr != NULL) { |
| 1500 | *pict= *(AVFrame*)s->last_picture_ptr; | 1500 | *pict= *(AVFrame*)s->last_picture_ptr; |
| @@ -253,7 +253,7 @@ static int rv40_decode_mb_info(RV34DecContext *r) · 252 unmodified lines | |||
| 253 | prev_type = i; | 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 | prev_type = block_num_to_ptype_vlc_num[prev_type]; | 257 | prev_type = block_num_to_ptype_vlc_num[prev_type]; |
| 258 | q = get_vlc2(gb, ptype_vlc[prev_type].table, PTYPE_VLC_BITS, 1); | 258 | q = get_vlc2(gb, ptype_vlc[prev_type].table, PTYPE_VLC_BITS, 1); |
| 259 | if(q < PBTYPE_ESCAPE) | 259 | if(q < PBTYPE_ESCAPE) |
| @@ -215,7 +215,7 @@ static int decode_frame(AVCodecContext *avctx, · 214 unmodified lines | |||
| 215 | return -1; | 215 | return -1; |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | p->pict_type = FF_I_TYPE; | 218 | p->pict_type = AV_PICTURE_TYPE_I; |
| 219 | p->key_frame = 1; | 219 | p->key_frame = 1; |
| 220 | out_buf = p->data[0]; | 220 | out_buf = p->data[0]; |
| 221 | 221 | ||
| @@ -52,7 +52,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, · 51 unmodified lines | |||
| 52 | unsigned char *orig_buf = buf, *end_buf = buf + buf_size; | 52 | unsigned char *orig_buf = buf, *end_buf = buf + buf_size; |
| 53 | 53 | ||
| 54 | *p = *(AVFrame*)data; | 54 | *p = *(AVFrame*)data; |
| 55 | p->pict_type = FF_I_TYPE; | 55 | p->pict_type = AV_PICTURE_TYPE_I; |
| 56 | p->key_frame = 1; | 56 | p->key_frame = 1; |
| 57 | 57 | ||
| 58 | width = avctx->width; | 58 | width = avctx->width; |
| @@ -373,9 +373,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 372 unmodified lines | |||
| 373 | smk->pic.palette_has_changed = buf[0] & 1; | 373 | smk->pic.palette_has_changed = buf[0] & 1; |
| 374 | smk->pic.key_frame = !!(buf[0] & 2); | 374 | smk->pic.key_frame = !!(buf[0] & 2); |
| 375 | if(smk->pic.key_frame) | 375 | if(smk->pic.key_frame) |
| 376 | smk->pic.pict_type = FF_I_TYPE; | 376 | smk->pic.pict_type = AV_PICTURE_TYPE_I; |
| 377 | else | 377 | else |
| 378 | smk->pic.pict_type = FF_P_TYPE; | 378 | smk->pic.pict_type = AV_PICTURE_TYPE_P; |
| 379 | 379 | ||
| 380 | buf++; | 380 | buf++; |
| 381 | for(i = 0; i < 256; i++) | 381 | for(i = 0; i < 256; i++) |
| @@ -2074,7 +2074,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 2073 unmodified lines | |||
| 2074 | ff_init_range_decoder(c, buf, buf_size); | 2074 | ff_init_range_decoder(c, buf, buf_size); |
| 2075 | ff_build_rac_states(c, 0.05*(1LL<<32), 256-8); | 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 | if(decode_header(s)<0) | 2078 | if(decode_header(s)<0) |
| 2079 | return -1; | 2079 | return -1; |
| 2080 | common_init_after_header(avctx); | 2080 | common_init_after_header(avctx); |
| @@ -3651,7 +3651,7 @@ static int ratecontrol_1pass(SnowContext *s, AVFrame *pict) · 1570 unmodified lines | |||
| 3651 | coef_sum = (uint64_t)coef_sum * coef_sum >> 16; | 3651 | coef_sum = (uint64_t)coef_sum * coef_sum >> 16; |
| 3652 | assert(coef_sum < INT_MAX); | 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 | s->m.current_picture.mb_var_sum= coef_sum; | 3655 | s->m.current_picture.mb_var_sum= coef_sum; |
| 3656 | s->m.current_picture.mc_mb_var_sum= 0; | 3656 | s->m.current_picture.mc_mb_var_sum= 0; |
| 3657 | }else{ | 3657 | }else{ |
| @@ -3720,7 +3720,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, · 62 unmodified lines | |||
| 3720 | if(avctx->flags&CODEC_FLAG_PASS2){ | 3720 | if(avctx->flags&CODEC_FLAG_PASS2){ |
| 3721 | s->m.pict_type = | 3721 | s->m.pict_type = |
| 3722 | pict->pict_type= s->m.rc_context.entry[avctx->frame_number].new_pict_type; | 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 | if(!(avctx->flags&CODEC_FLAG_QSCALE)) { | 3724 | if(!(avctx->flags&CODEC_FLAG_QSCALE)) { |
| 3725 | pict->quality= ff_rate_estimate_qscale(&s->m, 0); | 3725 | pict->quality= ff_rate_estimate_qscale(&s->m, 0); |
| 3726 | if (pict->quality < 0) | 3726 | if (pict->quality < 0) |
| @@ -3729,7 +3729,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, · 2 unmodified lines | |||
| 3729 | }else{ | 3729 | }else{ |
| 3730 | s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0; | 3730 | s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0; |
| 3731 | s->m.pict_type= | 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 | if(s->pass1_rc && avctx->frame_number == 0) | 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, · 12 unmodified lines | |||
| 3748 | s->m.current_picture_ptr= &s->m.current_picture; | 3748 | s->m.current_picture_ptr= &s->m.current_picture; |
| 3749 | s->m.last_picture.pts= s->m.current_picture.pts; | 3749 | s->m.last_picture.pts= s->m.current_picture.pts; |
| 3750 | s->m.current_picture.pts= pict->pts; | 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 | int block_width = (width +15)>>4; | 3752 | int block_width = (width +15)>>4; |
| 3753 | int block_height= (height+15)>>4; | 3753 | int block_height= (height+15)>>4; |
| 3754 | int stride= s->current_picture.linesize[0]; | 3754 | int stride= s->current_picture.linesize[0]; |
| @@ -3797,13 +3797,13 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, · 42 unmodified lines | |||
| 3797 | 3797 | ||
| 3798 | redo_frame: | 3798 | redo_frame: |
| 3799 | 3799 | ||
| 3800 | if(pict->pict_type == FF_I_TYPE) | 3800 | if(pict->pict_type == AV_PICTURE_TYPE_I) |
| 3801 | s->spatial_decomposition_count= 5; | 3801 | s->spatial_decomposition_count= 5; |
| 3802 | else | 3802 | else |
| 3803 | s->spatial_decomposition_count= 5; | 3803 | s->spatial_decomposition_count= 5; |
| 3804 | 3804 | ||
| 3805 | s->m.pict_type = pict->pict_type; | 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 | common_init_after_header(avctx); | 3808 | common_init_after_header(avctx); |
| 3809 | 3809 | ||
| @@ -3836,12 +3836,12 @@ redo_frame: · 26 unmodified lines | |||
| 3836 | predict_plane(s, s->spatial_idwt_buffer, plane_index, 0); | 3836 | predict_plane(s, s->spatial_idwt_buffer, plane_index, 0); |
| 3837 | 3837 | ||
| 3838 | if( plane_index==0 | 3838 | if( plane_index==0 |
| 3839 | && pict->pict_type == FF_P_TYPE | 3839 | && pict->pict_type == AV_PICTURE_TYPE_P |
| 3840 | && !(avctx->flags&CODEC_FLAG_PASS2) | 3840 | && !(avctx->flags&CODEC_FLAG_PASS2) |
| 3841 | && s->m.me.scene_change_score > s->avctx->scenechange_threshold){ | 3841 | && s->m.me.scene_change_score > s->avctx->scenechange_threshold){ |
| 3842 | ff_init_range_encoder(c, buf, buf_size); | 3842 | ff_init_range_encoder(c, buf, buf_size); |
| 3843 | ff_build_rac_states(c, 0.05*(1LL<<32), 256-8); | 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 | s->keyframe=1; | 3845 | s->keyframe=1; |
| 3846 | s->current_picture.key_frame=1; | 3846 | s->current_picture.key_frame=1; |
| 3847 | goto redo_frame; | 3847 | goto redo_frame; |
| @@ -3887,7 +3887,7 @@ redo_frame: · 39 unmodified lines | |||
| 3887 | if(!QUANTIZE2) | 3887 | if(!QUANTIZE2) |
| 3888 | quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias); | 3888 | quantize(s, b, b->ibuf, b->buf, b->stride, s->qbias); |
| 3889 | if(orientation==0) | 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 | encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation); | 3891 | encode_subband(s, b, b->ibuf, b->parent ? b->parent->ibuf : NULL, b->stride, orientation); |
| 3892 | assert(b->parent==NULL || b->parent->stride == b->stride*2); | 3892 | assert(b->parent==NULL || b->parent->stride == b->stride*2); |
| 3893 | if(orientation==0) | 3893 | if(orientation==0) |
| @@ -3914,7 +3914,7 @@ redo_frame: · 20 unmodified lines | |||
| 3914 | predict_plane(s, s->spatial_idwt_buffer, plane_index, 1); | 3914 | predict_plane(s, s->spatial_idwt_buffer, plane_index, 1); |
| 3915 | }else{ | 3915 | }else{ |
| 3916 | //ME/MC only | 3916 | //ME/MC only |
| 3917 | if(pict->pict_type == FF_I_TYPE){ | 3917 | if(pict->pict_type == AV_PICTURE_TYPE_I){ |
| 3918 | for(y=0; y<h; y++){ | 3918 | for(y=0; y<h; y++){ |
| 3919 | for(x=0; x<w; x++){ | 3919 | for(x=0; x<w; x++){ |
| 3920 | s->current_picture.data[plane_index][y*s->current_picture.linesize[plane_index] + x]= | 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, · 106 unmodified lines | |||
| 107 | return -1; | 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 | if (depth != 8 && maplength) { | 112 | if (depth != 8 && maplength) { |
| 113 | av_log(avctx, AV_LOG_WARNING, "useless colormap found or file is corrupted, trying to recover\n"); | 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) { · 562 unmodified lines | |||
| 563 | if(s->pict_type==4) | 563 | if(s->pict_type==4) |
| 564 | return -1; | 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 | /* unknown fields */ | 568 | /* unknown fields */ |
| 569 | if (s->f_code == 0x50 || s->f_code == 0x60) { | 569 | if (s->f_code == 0x50 || s->f_code == 0x60) { |
| @@ -669,10 +669,10 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 99 unmodified lines | |||
| 669 | 669 | ||
| 670 | //FIXME this avoids some confusion for "B frames" without 2 references | 670 | //FIXME this avoids some confusion for "B frames" without 2 references |
| 671 | //this should be removed after libavcodec can handle more flexible picture types & ordering | 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) | 674 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B) |
| 675 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE) | 675 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I) |
| 676 | || avctx->skip_frame >= AVDISCARD_ALL) | 676 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 677 | return buf_size; | 677 | return buf_size; |
| 678 | 678 | ||
| @@ -699,13 +699,13 @@ static int svq1_decode_frame(AVCodecContext *avctx, · 20 unmodified lines | |||
| 699 | 699 | ||
| 700 | current = s->current_picture.data[i]; | 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 | previous = s->next_picture.data[i]; | 703 | previous = s->next_picture.data[i]; |
| 704 | }else{ | 704 | }else{ |
| 705 | previous = s->last_picture.data[i]; | 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 | /* keyframe */ | 709 | /* keyframe */ |
| 710 | for (y=0; y < height; y+=16) { | 710 | for (y=0; y < height; y+=16) { |
| 711 | for (x=0; x < width; x+=16) { | 711 | for (x=0; x < width; x+=16) { |
| @@ -86,7 +86,7 @@ static void svq1_write_header(SVQ1Context *s, int frame_type) · 85 unmodified lines | |||
| 86 | /* frame type */ | 86 | /* frame type */ |
| 87 | put_bits(&s->pb, 2, frame_type - 1); | 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 | /* no checksum since frame code is 0x20 */ | 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 · 187 unmodified lines | |||
| 280 | block_width = (width + 15) / 16; | 280 | block_width = (width + 15) / 16; |
| 281 | block_height = (height + 15) / 16; | 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 | s->m.avctx= s->avctx; | 284 | s->m.avctx= s->avctx; |
| 285 | s->m.current_picture_ptr= &s->m.current_picture; | 285 | s->m.current_picture_ptr= &s->m.current_picture; |
| 286 | s->m.last_picture_ptr = &s->m.last_picture; | 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 · 95 unmodified lines | |||
| 382 | ff_init_block_index(&s->m); | 382 | ff_init_block_index(&s->m); |
| 383 | ff_update_block_index(&s->m); | 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 | for(i=0; i<6; i++){ | 386 | for(i=0; i<6; i++){ |
| 387 | init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i], 7*32); | 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 | const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA]; | 390 | const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA]; |
| 391 | put_bits(&s->reorder_pb[5], vlc[1], vlc[0]); | 391 | put_bits(&s->reorder_pb[5], vlc[1], vlc[0]); |
| 392 | score[0]= vlc[1]*lambda; | 392 | score[0]= vlc[1]*lambda; |
| @@ -401,7 +401,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane · 8 unmodified lines | |||
| 401 | 401 | ||
| 402 | best=0; | 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 | const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER]; | 405 | const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER]; |
| 406 | int mx, my, pred_x, pred_y, dxy; | 406 | int mx, my, pred_x, pred_y, dxy; |
| 407 | int16_t *motion_ptr; | 407 | int16_t *motion_ptr; |
| @@ -528,8 +528,8 @@ static int svq1_encode_frame(AVCodecContext *avctx, unsigned char *buf, · 120 unmodified lines | |||
| 528 | init_put_bits(&s->pb, buf, buf_size); | 528 | init_put_bits(&s->pb, buf, buf_size); |
| 529 | 529 | ||
| 530 | *p = *pict; | 530 | *p = *pict; |
| 531 | p->pict_type = avctx->gop_size && avctx->frame_number % avctx->gop_size ? FF_P_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 == FF_I_TYPE; | 532 | p->key_frame = p->pict_type == AV_PICTURE_TYPE_I; |
| 533 | 533 | ||
| 534 | svq1_write_header(s, p->pict_type); | 534 | svq1_write_header(s, p->pict_type); |
| 535 | for(i=0; i<3; i++){ | 535 | for(i=0; i<3; i++){ |
| @@ -438,10 +438,10 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type) · 437 unmodified lines | |||
| 438 | h->topright_samples_available = 0xFFFF; | 438 | h->topright_samples_available = 0xFFFF; |
| 439 | 439 | ||
| 440 | if (mb_type == 0) { /* SKIP */ | 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 | svq3_mc_dir_part(s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 0, 0); | 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 | svq3_mc_dir_part(s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0, 1, 1); | 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) · 54 unmodified lines | |||
| 502 | }else | 502 | }else |
| 503 | memset(&h->ref_cache[m][scan8[0] - 1*8 - 1], PART_NOT_AVAILABLE, 8); | 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 | break; | 506 | break; |
| 507 | } | 507 | } |
| 508 | 508 | ||
| 509 | /* decode motion vector(s) and form prediction(s) */ | 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 | if (svq3_mc_dir(h, (mb_type - 1), mode, 0, 0) < 0) | 511 | if (svq3_mc_dir(h, (mb_type - 1), mode, 0, 0) < 0) |
| 512 | return -1; | 512 | return -1; |
| 513 | } else { /* FF_B_TYPE */ | 513 | } else { /* AV_PICTURE_TYPE_B */ |
| 514 | if (mb_type != 2) { | 514 | if (mb_type != 2) { |
| 515 | if (svq3_mc_dir(h, 0, mode, 0, 0) < 0) | 515 | if (svq3_mc_dir(h, 0, mode, 0, 0) < 0) |
| 516 | return -1; | 516 | return -1; |
| @@ -609,11 +609,11 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type) · 92 unmodified lines | |||
| 609 | mb_type = MB_TYPE_INTRA16x16; | 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 | for (i = 0; i < 4; i++) { | 613 | for (i = 0; i < 4; i++) { |
| 614 | memset(s->current_picture.motion_val[0][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t)); | 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 | for (i = 0; i < 4; i++) { | 617 | for (i = 0; i < 4; i++) { |
| 618 | memset(s->current_picture.motion_val[1][b_xy + i*h->b_stride], 0, 4*2*sizeof(int16_t)); | 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) · 2 unmodified lines | |||
| 622 | if (!IS_INTRA4x4(mb_type)) { | 622 | if (!IS_INTRA4x4(mb_type)) { |
| 623 | memset(h->intra4x4_pred_mode+h->mb2br_xy[mb_xy], DC_PRED, 8); | 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 | memset(h->non_zero_count_cache + 8, 0, 4*9*sizeof(uint8_t)); | 626 | memset(h->non_zero_count_cache + 8, 0, 4*9*sizeof(uint8_t)); |
| 627 | s->dsp.clear_blocks(h->mb); | 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 | if ((vlc = svq3_get_ue_golomb(&s->gb)) >= 48){ | 631 | if ((vlc = svq3_get_ue_golomb(&s->gb)) >= 48){ |
| 632 | av_log(h->s.avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc); | 632 | av_log(h->s.avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc); |
| 633 | return -1; | 633 | return -1; |
| @@ -635,7 +635,7 @@ static int svq3_decode_mb(H264Context *h, unsigned int mb_type) · 1 unmodified line | |||
| 635 | 635 | ||
| 636 | cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc] : golomb_to_inter_cbp[vlc]; | 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 | s->qscale += svq3_get_se_golomb(&s->gb); | 639 | s->qscale += svq3_get_se_golomb(&s->gb); |
| 640 | 640 | ||
| 641 | if (s->qscale > 31){ | 641 | if (s->qscale > 31){ |
| @@ -947,18 +947,18 @@ static int svq3_decode_frame(AVCodecContext *avctx, · 305 unmodified lines | |||
| 947 | 947 | ||
| 948 | /* for skipping the frame */ | 948 | /* for skipping the frame */ |
| 949 | s->current_picture.pict_type = s->pict_type; | 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 | /* Skip B-frames if we do not have reference frames. */ | 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 | return 0; | 954 | return 0; |
| 955 | if ( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == FF_B_TYPE) | 955 | if ( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) |
| 956 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != FF_I_TYPE) | 956 | ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != AV_PICTURE_TYPE_I) |
| 957 | || avctx->skip_frame >= AVDISCARD_ALL) | 957 | || avctx->skip_frame >= AVDISCARD_ALL) |
| 958 | return 0; | 958 | return 0; |
| 959 | 959 | ||
| 960 | if (s->next_p_frame_damaged) { | 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 | return 0; | 962 | return 0; |
| 963 | else | 963 | else |
| 964 | s->next_p_frame_damaged = 0; | 964 | s->next_p_frame_damaged = 0; |
| @@ -967,7 +967,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, · 2 unmodified lines | |||
| 967 | if (ff_h264_frame_start(h) < 0) | 967 | if (ff_h264_frame_start(h) < 0) |
| 968 | return -1; | 968 | return -1; |
| 969 | 969 | ||
| 970 | if (s->pict_type == FF_B_TYPE) { | 970 | if (s->pict_type == AV_PICTURE_TYPE_B) { |
| 971 | h->frame_num_offset = (h->slice_num - h->prev_frame_num); | 971 | h->frame_num_offset = (h->slice_num - h->prev_frame_num); |
| 972 | 972 | ||
| 973 | if (h->frame_num_offset < 0) { | 973 | if (h->frame_num_offset < 0) { |
| @@ -1016,9 +1016,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, · 42 unmodified lines | |||
| 1016 | 1016 | ||
| 1017 | mb_type = svq3_get_ue_golomb(&s->gb); | 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 | mb_type += 8; | 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 | mb_type += 4; | 1022 | mb_type += 4; |
| 1023 | } | 1023 | } |
| 1024 | if (mb_type > 33 || svq3_decode_mb(h, mb_type)) { | 1024 | if (mb_type > 33 || svq3_decode_mb(h, mb_type)) { |
| @@ -1030,9 +1030,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, · 5 unmodified lines | |||
| 1030 | ff_h264_hl_decode_mb (h); | 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 | s->current_picture.mb_type[s->mb_x + s->mb_y*s->mb_stride] = | 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, · 2 unmodified lines | |||
| 1041 | 1041 | ||
| 1042 | MPV_frame_end(s); | 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 | *(AVFrame *) data = *(AVFrame *) &s->current_picture; | 1045 | *(AVFrame *) data = *(AVFrame *) &s->current_picture; |
| 1046 | } else { | 1046 | } else { |
| 1047 | *(AVFrame *) data = *(AVFrame *) &s->last_picture; | 1047 | *(AVFrame *) data = *(AVFrame *) &s->last_picture; |
| @@ -90,7 +90,7 @@ static int targa_encode_frame(AVCodecContext *avctx, · 89 unmodified lines | |||
| 90 | return AVERROR(EINVAL); | 90 | return AVERROR(EINVAL); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | p->pict_type= FF_I_TYPE; | 93 | p->pict_type= AV_PICTURE_TYPE_I; |
| 94 | p->key_frame= 1; | 94 | p->key_frame= 1; |
| 95 | 95 | ||
| 96 | /* zero out the header and only set applicable fields */ | 96 | /* zero out the header and only set applicable fields */ |
| @@ -221,7 +221,7 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, · 220 unmodified lines | |||
| 221 | s->buf_size = buf_size; | 221 | s->buf_size = buf_size; |
| 222 | 222 | ||
| 223 | *p = *pict; | 223 | *p = *pict; |
| 224 | p->pict_type = FF_I_TYPE; | 224 | p->pict_type = AV_PICTURE_TYPE_I; |
| 225 | p->key_frame = 1; | 225 | p->key_frame = 1; |
| 226 | avctx->coded_frame= &s->picture; | 226 | avctx->coded_frame= &s->picture; |
| 227 | 227 | ||
| @@ -59,7 +59,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, · 58 unmodified lines | |||
| 59 | return -1; | 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 | tmv->pic.key_frame = 1; | 63 | tmv->pic.key_frame = 1; |
| 64 | dst = tmv->pic.data[0]; | 64 | dst = tmv->pic.data[0]; |
| 65 | 65 | ||
| @@ -807,9 +807,9 @@ static int decode_frame(AVCodecContext *avctx, · 806 unmodified lines | |||
| 807 | } | 807 | } |
| 808 | p->key_frame = tm2_decode_blocks(l, p); | 808 | p->key_frame = tm2_decode_blocks(l, p); |
| 809 | if(p->key_frame) | 809 | if(p->key_frame) |
| 810 | p->pict_type = FF_I_TYPE; | 810 | p->pict_type = AV_PICTURE_TYPE_I; |
| 811 | else | 811 | else |
| 812 | p->pict_type = FF_P_TYPE; | 812 | p->pict_type = AV_PICTURE_TYPE_P; |
| 813 | 813 | ||
| 814 | l->cur = !l->cur; | 814 | l->cur = !l->cur; |
| 815 | *data_size = sizeof(AVFrame); | 815 | *data_size = sizeof(AVFrame); |
| @@ -89,7 +89,7 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 88 unmodified lines | |||
| 89 | return -1; | 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 | ptr = p->data[0]; | 94 | ptr = p->data[0]; |
| 95 | stride = p->linesize[0]; | 95 | stride = p->linesize[0]; |
| @@ -63,7 +63,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 62 unmodified lines | |||
| 63 | y = (uint16_t*)pic->data[0]; | 63 | y = (uint16_t*)pic->data[0]; |
| 64 | u = (uint16_t*)pic->data[1]; | 64 | u = (uint16_t*)pic->data[1]; |
| 65 | v = (uint16_t*)pic->data[2]; | 65 | v = (uint16_t*)pic->data[2]; |
| 66 | pic->pict_type = FF_I_TYPE; | 66 | pic->pict_type = AV_PICTURE_TYPE_I; |
| 67 | pic->key_frame = 1; | 67 | pic->key_frame = 1; |
| 68 | 68 | ||
| 69 | #define READ_PIXELS(a, b, c) \ | 69 | #define READ_PIXELS(a, b, c) \ |
| @@ -43,7 +43,7 @@ static av_cold int encode_init(AVCodecContext *avctx) · 42 unmodified lines | |||
| 43 | avctx->coded_frame = avcodec_alloc_frame(); | 43 | avctx->coded_frame = avcodec_alloc_frame(); |
| 44 | 44 | ||
| 45 | avctx->coded_frame->key_frame = 1; | 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 | return 0; | 48 | return 0; |
| 49 | } | 49 | } |
| @@ -63,7 +63,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 62 unmodified lines | |||
| 63 | udst= (uint16_t *)pic->data[1]; | 63 | udst= (uint16_t *)pic->data[1]; |
| 64 | vdst= (uint16_t *)pic->data[2]; | 64 | vdst= (uint16_t *)pic->data[2]; |
| 65 | yend= ydst + width; | 65 | yend= ydst + width; |
| 66 | pic->pict_type= FF_I_TYPE; | 66 | pic->pict_type= AV_PICTURE_TYPE_I; |
| 67 | pic->key_frame= 1; | 67 | pic->key_frame= 1; |
| 68 | 68 | ||
| 69 | for(;;){ | 69 | for(;;){ |
| @@ -312,7 +312,7 @@ static int decode_slice(AVCodecContext *avctx, · 311 unmodified lines | |||
| 312 | slice_param->slice_data_bit_offset = get_bits_count(&h->s.gb) + 8; /* bit buffer started beyond nal_unit_type */ | 312 | slice_param->slice_data_bit_offset = get_bits_count(&h->s.gb) + 8; /* bit buffer started beyond nal_unit_type */ |
| 313 | slice_param->first_mb_in_slice = (s->mb_y >> FIELD_OR_MBAFF_PICTURE) * s->mb_width + s->mb_x; | 313 | slice_param->first_mb_in_slice = (s->mb_y >> FIELD_OR_MBAFF_PICTURE) * s->mb_width + s->mb_x; |
| 314 | slice_param->slice_type = ff_h264_get_slice_type(h); | 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 | slice_param->num_ref_idx_l0_active_minus1 = h->list_count > 0 ? h->ref_count[0] - 1 : 0; | 316 | slice_param->num_ref_idx_l0_active_minus1 = h->list_count > 0 ? h->ref_count[0] - 1 : 0; |
| 317 | slice_param->num_ref_idx_l1_active_minus1 = h->list_count > 1 ? h->ref_count[1] - 1 : 0; | 317 | slice_param->num_ref_idx_l1_active_minus1 = h->list_count > 1 ? h->ref_count[1] - 1 : 0; |
| 318 | slice_param->cabac_init_idc = h->cabac_init_idc; | 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_ · 71 unmodified lines | |||
| 72 | pic_param->picture_coding_extension.bits.is_first_field = mpeg2_get_is_frame_start(s); | 72 | pic_param->picture_coding_extension.bits.is_first_field = mpeg2_get_is_frame_start(s); |
| 73 | 73 | ||
| 74 | switch (s->pict_type) { | 74 | switch (s->pict_type) { |
| 75 | case FF_B_TYPE: | 75 | case AV_PICTURE_TYPE_B: |
| 76 | pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture); | 76 | pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture); |
| 77 | // fall-through | 77 | // fall-through |
| 78 | case FF_P_TYPE: | 78 | case AV_PICTURE_TYPE_P: |
| 79 | pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture); | 79 | pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture); |
| 80 | break; | 80 | break; |
| 81 | } | 81 | } |
| @@ -78,8 +78,8 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_ · 77 unmodified lines | |||
| 78 | } | 78 | } |
| 79 | pic_param->quant_precision = s->quant_precision; | 79 | pic_param->quant_precision = s->quant_precision; |
| 80 | pic_param->vop_fields.value = 0; /* reset all bits */ | 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; | 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 == FF_B_TYPE ? s->next_picture.pict_type - FF_I_TYPE : 0; | 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 | pic_param->vop_fields.bits.vop_rounding_type = s->no_rounding; | 83 | pic_param->vop_fields.bits.vop_rounding_type = s->no_rounding; |
| 84 | pic_param->vop_fields.bits.intra_dc_vlc_thr = mpeg4_get_intra_dc_vlc_thr(s); | 84 | pic_param->vop_fields.bits.intra_dc_vlc_thr = mpeg4_get_intra_dc_vlc_thr(s); |
| 85 | pic_param->vop_fields.bits.top_field_first = s->top_field_first; | 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_ · 6 unmodified lines | |||
| 92 | pic_param->TRB = s->pb_time; | 92 | pic_param->TRB = s->pb_time; |
| 93 | pic_param->TRD = s->pp_time; | 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 | pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture); | 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 | pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture); | 98 | pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture); |
| 99 | 99 | ||
| 100 | /* Fill in VAIQMatrixBufferMPEG4 */ | 100 | /* Fill in VAIQMatrixBufferMPEG4 */ |
| @@ -42,7 +42,7 @@ static inline int vc1_has_MVTYPEMB_bitplane(VC1Context *v) · 41 unmodified lines | |||
| 42 | { | 42 | { |
| 43 | if (v->mv_type_is_raw) | 43 | if (v->mv_type_is_raw) |
| 44 | return 0; | 44 | return 0; |
| 45 | return (v->s.pict_type == FF_P_TYPE && | 45 | return (v->s.pict_type == AV_PICTURE_TYPE_P && |
| 46 | (v->mv_mode == MV_PMODE_MIXED_MV || | 46 | (v->mv_mode == MV_PMODE_MIXED_MV || |
| 47 | (v->mv_mode == MV_PMODE_INTENSITY_COMP && | 47 | (v->mv_mode == MV_PMODE_INTENSITY_COMP && |
| 48 | v->mv_mode2 == MV_PMODE_MIXED_MV))); | 48 | v->mv_mode2 == MV_PMODE_MIXED_MV))); |
| @@ -53,8 +53,8 @@ static inline int vc1_has_SKIPMB_bitplane(VC1Context *v) · 4 unmodified lines | |||
| 53 | { | 53 | { |
| 54 | if (v->skip_is_raw) | 54 | if (v->skip_is_raw) |
| 55 | return 0; | 55 | return 0; |
| 56 | return (v->s.pict_type == FF_P_TYPE || | 56 | return (v->s.pict_type == AV_PICTURE_TYPE_P || |
| 57 | (v->s.pict_type == FF_B_TYPE && !v->bi_type)); | 57 | (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type)); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | /** Check whether the DIRECTMB bitplane is present */ | 60 | /** Check whether the DIRECTMB bitplane is present */ |
| @@ -62,7 +62,7 @@ static inline int vc1_has_DIRECTMB_bitplane(VC1Context *v) · 1 unmodified line | |||
| 62 | { | 62 | { |
| 63 | if (v->dmb_is_raw) | 63 | if (v->dmb_is_raw) |
| 64 | return 0; | 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 | /** Check whether the ACPRED bitplane is present */ | 68 | /** Check whether the ACPRED bitplane is present */ |
| @@ -71,8 +71,8 @@ static inline int vc1_has_ACPRED_bitplane(VC1Context *v) · 2 unmodified lines | |||
| 71 | if (v->acpred_is_raw) | 71 | if (v->acpred_is_raw) |
| 72 | return 0; | 72 | return 0; |
| 73 | return (v->profile == PROFILE_ADVANCED && | 73 | return (v->profile == PROFILE_ADVANCED && |
| 74 | (v->s.pict_type == FF_I_TYPE || | 74 | (v->s.pict_type == AV_PICTURE_TYPE_I || |
| 75 | (v->s.pict_type == FF_B_TYPE && v->bi_type))); | 75 | (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type))); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | /** Check whether the OVERFLAGS bitplane is present */ | 78 | /** Check whether the OVERFLAGS bitplane is present */ |
| @@ -81,8 +81,8 @@ static inline int vc1_has_OVERFLAGS_bitplane(VC1Context *v) · 2 unmodified lines | |||
| 81 | if (v->overflg_is_raw) | 81 | if (v->overflg_is_raw) |
| 82 | return 0; | 82 | return 0; |
| 83 | return (v->profile == PROFILE_ADVANCED && | 83 | return (v->profile == PROFILE_ADVANCED && |
| 84 | (v->s.pict_type == FF_I_TYPE || | 84 | (v->s.pict_type == AV_PICTURE_TYPE_I || |
| 85 | (v->s.pict_type == FF_B_TYPE && v->bi_type)) && | 85 | (v->s.pict_type == AV_PICTURE_TYPE_B && v->bi_type)) && |
| 86 | (v->overlap && v->pq <= 8) && | 86 | (v->overlap && v->pq <= 8) && |
| 87 | v->condover == CONDOVER_SELECT); | 87 | v->condover == CONDOVER_SELECT); |
| 88 | } | 88 | } |
| @@ -92,9 +92,9 @@ static int vc1_get_PTYPE(VC1Context *v) · 3 unmodified lines | |||
| 92 | { | 92 | { |
| 93 | MpegEncContext * const s = &v->s; | 93 | MpegEncContext * const s = &v->s; |
| 94 | switch (s->pict_type) { | 94 | switch (s->pict_type) { |
| 95 | case FF_I_TYPE: return 0; | 95 | case AV_PICTURE_TYPE_I: return 0; |
| 96 | case FF_P_TYPE: return v->p_frame_skipped ? 4 : 1; | 96 | case AV_PICTURE_TYPE_P: return v->p_frame_skipped ? 4 : 1; |
| 97 | case FF_B_TYPE: return v->bi_type ? 3 : 2; | 97 | case AV_PICTURE_TYPE_B: return v->bi_type ? 3 : 2; |
| 98 | } | 98 | } |
| 99 | return 0; | 99 | return 0; |
| 100 | } | 100 | } |
| @@ -102,8 +102,8 @@ static int vc1_get_PTYPE(VC1Context *v) · 1 unmodified line | |||
| 102 | /** Reconstruct bitstream MVMODE (7.1.1.32) */ | 102 | /** Reconstruct bitstream MVMODE (7.1.1.32) */ |
| 103 | static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v) | 103 | static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v) |
| 104 | { | 104 | { |
| 105 | if (v->s.pict_type == FF_P_TYPE || | 105 | if (v->s.pict_type == AV_PICTURE_TYPE_P || |
| 106 | (v->s.pict_type == FF_B_TYPE && !v->bi_type)) | 106 | (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type)) |
| 107 | return get_VAMvModeVC1(v->mv_mode); | 107 | return get_VAMvModeVC1(v->mv_mode); |
| 108 | return 0; | 108 | return 0; |
| 109 | } | 109 | } |
| @@ -111,7 +111,7 @@ static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v) · 1 unmodified line | |||
| 111 | /** Reconstruct bitstream MVMODE2 (7.1.1.33) */ | 111 | /** Reconstruct bitstream MVMODE2 (7.1.1.33) */ |
| 112 | static inline VAMvModeVC1 vc1_get_MVMODE2(VC1Context *v) | 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 | return get_VAMvModeVC1(v->mv_mode2); | 115 | return get_VAMvModeVC1(v->mv_mode2); |
| 116 | return 0; | 116 | return 0; |
| 117 | } | 117 | } |
| @@ -245,10 +245,10 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t · 127 unmodified lines | |||
| 245 | pic_param->transform_fields.bits.intra_transform_dc_table = v->s.dc_table_index; | 245 | pic_param->transform_fields.bits.intra_transform_dc_table = v->s.dc_table_index; |
| 246 | 246 | ||
| 247 | switch (s->pict_type) { | 247 | switch (s->pict_type) { |
| 248 | case FF_B_TYPE: | 248 | case AV_PICTURE_TYPE_B: |
| 249 | pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture); | 249 | pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture); |
| 250 | // fall-through | 250 | // fall-through |
| 251 | case FF_P_TYPE: | 251 | case AV_PICTURE_TYPE_P: |
| 252 | pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture); | 252 | pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture); |
| 253 | break; | 253 | break; |
| 254 | } | 254 | } |
| @@ -259,12 +259,12 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t · 4 unmodified lines | |||
| 259 | int x, y, n; | 259 | int x, y, n; |
| 260 | 260 | ||
| 261 | switch (s->pict_type) { | 261 | switch (s->pict_type) { |
| 262 | case FF_P_TYPE: | 262 | case AV_PICTURE_TYPE_P: |
| 263 | ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL; | 263 | ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL; |
| 264 | ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb ? s->mbskip_table : NULL; | 264 | ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb ? s->mbskip_table : NULL; |
| 265 | ff_bp[2] = pic_param->bitplane_present.flags.bp_mv_type_mb ? v->mv_type_mb_plane : NULL; | 265 | ff_bp[2] = pic_param->bitplane_present.flags.bp_mv_type_mb ? v->mv_type_mb_plane : NULL; |
| 266 | break; | 266 | break; |
| 267 | case FF_B_TYPE: | 267 | case AV_PICTURE_TYPE_B: |
| 268 | if (!v->bi_type) { | 268 | if (!v->bi_type) { |
| 269 | ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL; | 269 | ff_bp[0] = pic_param->bitplane_present.flags.bp_direct_mb ? v->direct_mb_plane : NULL; |
| 270 | ff_bp[1] = pic_param->bitplane_present.flags.bp_skip_mb ? s->mbskip_table : NULL; | 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 · 1 unmodified line | |||
| 272 | break; | 272 | break; |
| 273 | } | 273 | } |
| 274 | /* fall-through (BI-type) */ | 274 | /* fall-through (BI-type) */ |
| 275 | case FF_I_TYPE: | 275 | case AV_PICTURE_TYPE_I: |
| 276 | ff_bp[0] = NULL; /* XXX: interlaced frame (FIELDTX plane) */ | 276 | ff_bp[0] = NULL; /* XXX: interlaced frame (FIELDTX plane) */ |
| 277 | ff_bp[1] = pic_param->bitplane_present.flags.bp_ac_pred ? v->acpred_plane : NULL; | 277 | ff_bp[1] = pic_param->bitplane_present.flags.bp_ac_pred ? v->acpred_plane : NULL; |
| 278 | ff_bp[2] = pic_param->bitplane_present.flags.bp_overflags ? v->over_flags_plane : NULL; | 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) · 611 unmodified lines | |||
| 612 | v->s.pict_type = get_bits1(gb); | 612 | v->s.pict_type = get_bits1(gb); |
| 613 | if (v->s.avctx->max_b_frames) { | 613 | if (v->s.avctx->max_b_frames) { |
| 614 | if (!v->s.pict_type) { | 614 | if (!v->s.pict_type) { |
| 615 | if (get_bits1(gb)) v->s.pict_type = FF_I_TYPE; | 615 | if (get_bits1(gb)) v->s.pict_type = AV_PICTURE_TYPE_I; |
| 616 | else v->s.pict_type = FF_B_TYPE; | 616 | else v->s.pict_type = AV_PICTURE_TYPE_B; |
| 617 | } else v->s.pict_type = FF_P_TYPE; | 617 | } else v->s.pict_type = AV_PICTURE_TYPE_P; |
| 618 | } else v->s.pict_type = v->s.pict_type ? FF_P_TYPE : FF_I_TYPE; | 618 | } else v->s.pict_type = v->s.pict_type ? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I; |
| 619 | 619 | ||
| 620 | v->bi_type = 0; | 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 | v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); | 622 | v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); |
| 623 | v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index]; | 623 | v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index]; |
| 624 | if(v->bfraction == 0) { | 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 | skip_bits(gb, 7); // skip buffer fullness | 629 | skip_bits(gb, 7); // skip buffer fullness |
| 630 | 630 | ||
| 631 | if(v->parse_only) | 631 | if(v->parse_only) |
| 632 | return 0; | 632 | return 0; |
| 633 | 633 | ||
| 634 | /* calculate RND */ | 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 | v->rnd = 1; | 636 | v->rnd = 1; |
| 637 | if(v->s.pict_type == FF_P_TYPE) | 637 | if(v->s.pict_type == AV_PICTURE_TYPE_P) |
| 638 | v->rnd ^= 1; | 638 | v->rnd ^= 1; |
| 639 | 639 | ||
| 640 | /* Quantizer stuff */ | 640 | /* Quantizer stuff */ |
| @@ -661,18 +661,18 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) · 20 unmodified lines | |||
| 661 | v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11 | 661 | v->k_y = v->mvrange + 8; //k_y can be 8 9 10 11 |
| 662 | v->range_x = 1 << (v->k_x - 1); | 662 | v->range_x = 1 << (v->k_x - 1); |
| 663 | v->range_y = 1 << (v->k_y - 1); | 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 | v->x8_type = get_bits1(gb); | 667 | v->x8_type = get_bits1(gb); |
| 668 | }else v->x8_type = 0; | 668 | }else v->x8_type = 0; |
| 669 | //av_log(v->s.avctx, AV_LOG_INFO, "%c Frame: QP=[%i]%i (+%i/2) %i\n", | 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 | switch(v->s.pict_type) { | 674 | switch(v->s.pict_type) { |
| 675 | case FF_P_TYPE: | 675 | case AV_PICTURE_TYPE_P: |
| 676 | if (v->pq < 5) v->tt_index = 0; | 676 | if (v->pq < 5) v->tt_index = 0; |
| 677 | else if(v->pq < 13) v->tt_index = 1; | 677 | else if(v->pq < 13) v->tt_index = 1; |
| 678 | else v->tt_index = 2; | 678 | else v->tt_index = 2; |
| @@ -755,7 +755,7 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) · 76 unmodified lines | |||
| 755 | v->ttfrm = TT_8X8; | 755 | v->ttfrm = TT_8X8; |
| 756 | } | 756 | } |
| 757 | break; | 757 | break; |
| 758 | case FF_B_TYPE: | 758 | case AV_PICTURE_TYPE_B: |
| 759 | if (v->pq < 5) v->tt_index = 0; | 759 | if (v->pq < 5) v->tt_index = 0; |
| 760 | else if(v->pq < 13) v->tt_index = 1; | 760 | else if(v->pq < 13) v->tt_index = 1; |
| 761 | else v->tt_index = 2; | 761 | else v->tt_index = 2; |
| @@ -801,7 +801,7 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) · 39 unmodified lines | |||
| 801 | { | 801 | { |
| 802 | /* AC Syntax */ | 802 | /* AC Syntax */ |
| 803 | v->c_ac_table_index = decode012(gb); | 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 | v->y_ac_table_index = decode012(gb); | 806 | v->y_ac_table_index = decode012(gb); |
| 807 | } | 807 | } |
| @@ -809,8 +809,8 @@ int vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) · 1 unmodified line | |||
| 809 | v->s.dc_table_index = get_bits1(gb); | 809 | v->s.dc_table_index = get_bits1(gb); |
| 810 | } | 810 | } |
| 811 | 811 | ||
| 812 | if(v->s.pict_type == FF_BI_TYPE) { | 812 | if(v->s.pict_type == AV_PICTURE_TYPE_BI) { |
| 813 | v->s.pict_type = FF_B_TYPE; | 813 | v->s.pict_type = AV_PICTURE_TYPE_B; |
| 814 | v->bi_type = 1; | 814 | v->bi_type = 1; |
| 815 | } | 815 | } |
| 816 | return 0; | 816 | return 0; |
| @@ -833,19 +833,19 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 16 unmodified lines | |||
| 833 | } | 833 | } |
| 834 | switch(get_unary(gb, 0, 4)) { | 834 | switch(get_unary(gb, 0, 4)) { |
| 835 | case 0: | 835 | case 0: |
| 836 | v->s.pict_type = FF_P_TYPE; | 836 | v->s.pict_type = AV_PICTURE_TYPE_P; |
| 837 | break; | 837 | break; |
| 838 | case 1: | 838 | case 1: |
| 839 | v->s.pict_type = FF_B_TYPE; | 839 | v->s.pict_type = AV_PICTURE_TYPE_B; |
| 840 | break; | 840 | break; |
| 841 | case 2: | 841 | case 2: |
| 842 | v->s.pict_type = FF_I_TYPE; | 842 | v->s.pict_type = AV_PICTURE_TYPE_I; |
| 843 | break; | 843 | break; |
| 844 | case 3: | 844 | case 3: |
| 845 | v->s.pict_type = FF_BI_TYPE; | 845 | v->s.pict_type = AV_PICTURE_TYPE_BI; |
| 846 | break; | 846 | break; |
| 847 | case 4: | 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 | v->p_frame_skipped = 1; | 849 | v->p_frame_skipped = 1; |
| 850 | return 0; | 850 | return 0; |
| 851 | } | 851 | } |
| @@ -867,11 +867,11 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 15 unmodified lines | |||
| 867 | if(v->interlace) | 867 | if(v->interlace) |
| 868 | v->uvsamp = get_bits1(gb); | 868 | v->uvsamp = get_bits1(gb); |
| 869 | if(v->finterpflag) v->interpfrm = get_bits1(gb); | 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 | v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); | 871 | v->bfraction_lut_index = get_vlc2(gb, ff_vc1_bfraction_vlc.table, VC1_BFRACTION_VLC_BITS, 1); |
| 872 | v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index]; | 872 | v->bfraction = ff_vc1_bfraction_lut[v->bfraction_lut_index]; |
| 873 | if(v->bfraction == 0) { | 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 | pqindex = get_bits(gb, 5); | 877 | pqindex = get_bits(gb, 5); |
| @@ -895,14 +895,14 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 17 unmodified lines | |||
| 895 | if(v->postprocflag) | 895 | if(v->postprocflag) |
| 896 | v->postproc = get_bits(gb, 2); | 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 | if(v->parse_only) | 900 | if(v->parse_only) |
| 901 | return 0; | 901 | return 0; |
| 902 | 902 | ||
| 903 | switch(v->s.pict_type) { | 903 | switch(v->s.pict_type) { |
| 904 | case FF_I_TYPE: | 904 | case AV_PICTURE_TYPE_I: |
| 905 | case FF_BI_TYPE: | 905 | case AV_PICTURE_TYPE_BI: |
| 906 | status = bitplane_decoding(v->acpred_plane, &v->acpred_is_raw, v); | 906 | status = bitplane_decoding(v->acpred_plane, &v->acpred_is_raw, v); |
| 907 | if (status < 0) return -1; | 907 | if (status < 0) return -1; |
| 908 | av_log(v->s.avctx, AV_LOG_DEBUG, "ACPRED plane encoding: " | 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) · 9 unmodified lines | |||
| 918 | } | 918 | } |
| 919 | } | 919 | } |
| 920 | break; | 920 | break; |
| 921 | case FF_P_TYPE: | 921 | case AV_PICTURE_TYPE_P: |
| 922 | if (v->extended_mv) v->mvrange = get_unary(gb, 0, 3); | 922 | if (v->extended_mv) v->mvrange = get_unary(gb, 0, 3); |
| 923 | else v->mvrange = 0; | 923 | else v->mvrange = 0; |
| 924 | v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13 | 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) · 82 unmodified lines | |||
| 1007 | v->ttfrm = TT_8X8; | 1007 | v->ttfrm = TT_8X8; |
| 1008 | } | 1008 | } |
| 1009 | break; | 1009 | break; |
| 1010 | case FF_B_TYPE: | 1010 | case AV_PICTURE_TYPE_B: |
| 1011 | if (v->extended_mv) v->mvrange = get_unary(gb, 0, 3); | 1011 | if (v->extended_mv) v->mvrange = get_unary(gb, 0, 3); |
| 1012 | else v->mvrange = 0; | 1012 | else v->mvrange = 0; |
| 1013 | v->k_x = v->mvrange + 9 + (v->mvrange >> 1); //k_x can be 9 10 12 13 | 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) · 44 unmodified lines | |||
| 1058 | 1058 | ||
| 1059 | /* AC Syntax */ | 1059 | /* AC Syntax */ |
| 1060 | v->c_ac_table_index = decode012(gb); | 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 | v->y_ac_table_index = decode012(gb); | 1063 | v->y_ac_table_index = decode012(gb); |
| 1064 | } | 1064 | } |
| 1065 | /* DC Syntax */ | 1065 | /* DC Syntax */ |
| 1066 | v->s.dc_table_index = get_bits1(gb); | 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 | av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n"); | 1068 | av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n"); |
| 1069 | vop_dquant_decoding(v); | 1069 | vop_dquant_decoding(v); |
| 1070 | } | 1070 | } |
| 1071 | 1071 | ||
| 1072 | v->bi_type = 0; | 1072 | v->bi_type = 0; |
| 1073 | if(v->s.pict_type == FF_BI_TYPE) { | 1073 | if(v->s.pict_type == AV_PICTURE_TYPE_BI) { |
| 1074 | v->s.pict_type = FF_B_TYPE; | 1074 | v->s.pict_type = AV_PICTURE_TYPE_B; |
| 1075 | v->bi_type = 1; | 1075 | v->bi_type = 1; |
| 1076 | } | 1076 | } |
| 1077 | return 0; | 1077 | return 0; |
| @@ -67,9 +67,9 @@ static void vc1_extract_headers(AVCodecParserContext *s, AVCodecContext *avctx, · 66 unmodified lines | |||
| 67 | else | 67 | else |
| 68 | vc1_parse_frame_header_adv(&vpc->v, &gb); | 68 | vc1_parse_frame_header_adv(&vpc->v, &gb); |
| 69 | 69 | ||
| 70 | /* keep FF_BI_TYPE internal to VC1 */ | 70 | /* keep AV_PICTURE_TYPE_BI internal to VC1 */ |
| 71 | if (vpc->v.s.pict_type == FF_BI_TYPE) | 71 | if (vpc->v.s.pict_type == AV_PICTURE_TYPE_BI) |
| 72 | s->pict_type = FF_B_TYPE; | 72 | s->pict_type = AV_PICTURE_TYPE_B; |
| 73 | else | 73 | else |
| 74 | s->pict_type = vpc->v.s.pict_type; | 74 | s->pict_type = vpc->v.s.pict_type; |
| 75 | 75 | ||
| @@ -203,7 +203,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir) · 202 unmodified lines | |||
| 203 | my = s->mv[dir][0][1]; | 203 | my = s->mv[dir][0][1]; |
| 204 | 204 | ||
| 205 | // store motion vectors for further use in B frames | 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 | s->current_picture.motion_val[1][s->block_index[0]][0] = mx; | 207 | s->current_picture.motion_val[1][s->block_index[0]][0] = mx; |
| 208 | s->current_picture.motion_val[1][s->block_index[0]][1] = my; | 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) · 2851 unmodified lines | |||
| 3061 | ff_draw_horiz_band(s, s->mb_y * 16, 16); | 3061 | ff_draw_horiz_band(s, s->mb_y * 16, 16); |
| 3062 | s->first_slice_line = 0; | 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 | static void vc1_decode_blocks(VC1Context *v, int mby_start, int mby_end) | 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) · 4 unmodified lines | |||
| 3072 | ff_intrax8_decode_picture(&v->x8, 2*v->pq+v->halfpq, v->pq*(!v->pquantizer) ); | 3072 | ff_intrax8_decode_picture(&v->x8, 2*v->pq+v->halfpq, v->pq*(!v->pquantizer) ); |
| 3073 | }else{ | 3073 | }else{ |
| 3074 | switch(v->s.pict_type) { | 3074 | switch(v->s.pict_type) { |
| 3075 | case FF_I_TYPE: | 3075 | case AV_PICTURE_TYPE_I: |
| 3076 | if(v->profile == PROFILE_ADVANCED) | 3076 | if(v->profile == PROFILE_ADVANCED) |
| 3077 | vc1_decode_i_blocks_adv(v, mby_start, mby_end); | 3077 | vc1_decode_i_blocks_adv(v, mby_start, mby_end); |
| 3078 | else | 3078 | else |
| 3079 | vc1_decode_i_blocks(v); | 3079 | vc1_decode_i_blocks(v); |
| 3080 | break; | 3080 | break; |
| 3081 | case FF_P_TYPE: | 3081 | case AV_PICTURE_TYPE_P: |
| 3082 | if(v->p_frame_skipped) | 3082 | if(v->p_frame_skipped) |
| 3083 | vc1_decode_skip_blocks(v); | 3083 | vc1_decode_skip_blocks(v); |
| 3084 | else | 3084 | else |
| 3085 | vc1_decode_p_blocks(v, mby_start, mby_end); | 3085 | vc1_decode_p_blocks(v, mby_start, mby_end); |
| 3086 | break; | 3086 | break; |
| 3087 | case FF_B_TYPE: | 3087 | case AV_PICTURE_TYPE_B: |
| 3088 | if(v->bi_type){ | 3088 | if(v->bi_type){ |
| 3089 | if(v->profile == PROFILE_ADVANCED) | 3089 | if(v->profile == PROFILE_ADVANCED) |
| 3090 | vc1_decode_i_blocks_adv(v, mby_start, mby_end); | 3090 | vc1_decode_i_blocks_adv(v, mby_start, mby_end); |
| @@ -3498,7 +3498,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, · 407 unmodified lines | |||
| 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 | av_log(v->s.avctx, AV_LOG_WARNING, "Sprite decoder: expected I-frame\n"); | 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, · 8 unmodified lines | |||
| 3513 | 3513 | ||
| 3514 | // for skipping the frame | 3514 | // for skipping the frame |
| 3515 | s->current_picture.pict_type= s->pict_type; | 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 | /* skip B-frames if we don't have reference frames */ | 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 | goto err; | 3520 | goto err; |
| 3521 | } | 3521 | } |
| 3522 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==FF_B_TYPE) | 3522 | if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==AV_PICTURE_TYPE_B) |
| 3523 | || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=FF_I_TYPE) | 3523 | || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=AV_PICTURE_TYPE_I) |
| 3524 | || avctx->skip_frame >= AVDISCARD_ALL) { | 3524 | || avctx->skip_frame >= AVDISCARD_ALL) { |
| 3525 | goto end; | 3525 | goto end; |
| 3526 | } | 3526 | } |
| 3527 | 3527 | ||
| 3528 | if(s->next_p_frame_damaged){ | 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 | goto end; | 3530 | goto end; |
| 3531 | else | 3531 | else |
| 3532 | s->next_p_frame_damaged=0; | 3532 | s->next_p_frame_damaged=0; |
| @@ -3570,7 +3570,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, · 37 unmodified lines | |||
| 3570 | 3570 | ||
| 3571 | assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type); | 3571 | assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type); |
| 3572 | assert(s->current_picture.pict_type == s->pict_type); | 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 | *pict= *(AVFrame*)s->current_picture_ptr; | 3574 | *pict= *(AVFrame*)s->current_picture_ptr; |
| 3575 | } else if (s->last_picture_ptr != NULL) { | 3575 | } else if (s->last_picture_ptr != NULL) { |
| 3576 | *pict= *(AVFrame*)s->last_picture_ptr; | 3576 | *pict= *(AVFrame*)s->last_picture_ptr; |
| @@ -61,7 +61,7 @@ static int decode_frame(AVCodecContext *avctx, · 60 unmodified lines | |||
| 61 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 61 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 62 | return -1; | 62 | return -1; |
| 63 | } | 63 | } |
| 64 | p->pict_type= FF_I_TYPE; | 64 | p->pict_type= AV_PICTURE_TYPE_I; |
| 65 | p->key_frame= 1; | 65 | p->key_frame= 1; |
| 66 | 66 | ||
| 67 | for(i=0; i<16; i++){ | 67 | for(i=0; i<16; i++){ |
| @@ -127,7 +127,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, · 59 unmodified lines | |||
| 127 | int size; | 127 | int size; |
| 128 | 128 | ||
| 129 | *p = *pict; | 129 | *p = *pict; |
| 130 | p->pict_type= FF_I_TYPE; | 130 | p->pict_type= AV_PICTURE_TYPE_I; |
| 131 | p->key_frame= 1; | 131 | p->key_frame= 1; |
| 132 | 132 | ||
| 133 | emms_c(); | 133 | emms_c(); |
| @@ -225,12 +225,12 @@ void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf, · 224 unmodified lines | |||
| 225 | render->info.mpeg.backward_reference = VDP_INVALID_HANDLE; | 225 | render->info.mpeg.backward_reference = VDP_INVALID_HANDLE; |
| 226 | 226 | ||
| 227 | switch(s->pict_type){ | 227 | switch(s->pict_type){ |
| 228 | case FF_B_TYPE: | 228 | case AV_PICTURE_TYPE_B: |
| 229 | next = (struct vdpau_render_state *)s->next_picture.data[0]; | 229 | next = (struct vdpau_render_state *)s->next_picture.data[0]; |
| 230 | assert(next); | 230 | assert(next); |
| 231 | render->info.mpeg.backward_reference = next->surface; | 231 | render->info.mpeg.backward_reference = next->surface; |
| 232 | // no return here, going to set forward prediction | 232 | // no return here, going to set forward prediction |
| 233 | case FF_P_TYPE: | 233 | case AV_PICTURE_TYPE_P: |
| 234 | last = (struct vdpau_render_state *)s->last_picture.data[0]; | 234 | last = (struct vdpau_render_state *)s->last_picture.data[0]; |
| 235 | if (!last) // FIXME: Does this test make sense? | 235 | if (!last) // FIXME: Does this test make sense? |
| 236 | last = render; // predict second field from the first | 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, · 58 unmodified lines | |||
| 295 | render->info.vc1.picture_type = s->pict_type - 1 + s->pict_type / 3; | 295 | render->info.vc1.picture_type = s->pict_type - 1 + s->pict_type / 3; |
| 296 | 296 | ||
| 297 | switch(s->pict_type){ | 297 | switch(s->pict_type){ |
| 298 | case FF_B_TYPE: | 298 | case AV_PICTURE_TYPE_B: |
| 299 | next = (struct vdpau_render_state *)s->next_picture.data[0]; | 299 | next = (struct vdpau_render_state *)s->next_picture.data[0]; |
| 300 | assert(next); | 300 | assert(next); |
| 301 | render->info.vc1.backward_reference = next->surface; | 301 | render->info.vc1.backward_reference = next->surface; |
| 302 | // no break here, going to set forward prediction | 302 | // no break here, going to set forward prediction |
| 303 | case FF_P_TYPE: | 303 | case AV_PICTURE_TYPE_P: |
| 304 | last = (struct vdpau_render_state *)s->last_picture.data[0]; | 304 | last = (struct vdpau_render_state *)s->last_picture.data[0]; |
| 305 | if (!last) // FIXME: Does this test make sense? | 305 | if (!last) // FIXME: Does this test make sense? |
| 306 | last = render; // predict second field from the first | 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, · 44 unmodified lines | |||
| 351 | render->info.mpeg4.backward_reference = VDP_INVALID_HANDLE; | 351 | render->info.mpeg4.backward_reference = VDP_INVALID_HANDLE; |
| 352 | 352 | ||
| 353 | switch (s->pict_type) { | 353 | switch (s->pict_type) { |
| 354 | case FF_B_TYPE: | 354 | case AV_PICTURE_TYPE_B: |
| 355 | next = (struct vdpau_render_state *)s->next_picture.data[0]; | 355 | next = (struct vdpau_render_state *)s->next_picture.data[0]; |
| 356 | assert(next); | 356 | assert(next); |
| 357 | render->info.mpeg4.backward_reference = next->surface; | 357 | render->info.mpeg4.backward_reference = next->surface; |
| 358 | render->info.mpeg4.vop_coding_type = 2; | 358 | render->info.mpeg4.vop_coding_type = 2; |
| 359 | // no break here, going to set forward prediction | 359 | // no break here, going to set forward prediction |
| 360 | case FF_P_TYPE: | 360 | case AV_PICTURE_TYPE_P: |
| 361 | last = (struct vdpau_render_state *)s->last_picture.data[0]; | 361 | last = (struct vdpau_render_state *)s->last_picture.data[0]; |
| 362 | assert(last); | 362 | assert(last); |
| 363 | render->info.mpeg4.forward_reference = last->surface; | 363 | render->info.mpeg4.forward_reference = last->surface; |
| @@ -301,7 +301,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 300 unmodified lines | |||
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | c->pic.key_frame = 0; | 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 | //restore screen after cursor | 306 | //restore screen after cursor |
| 307 | if(c->screendta) { | 307 | if(c->screendta) { |
| @@ -374,7 +374,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 66 unmodified lines | |||
| 374 | break; | 374 | break; |
| 375 | case MAGIC_WMVi: // ServerInitialization struct | 375 | case MAGIC_WMVi: // ServerInitialization struct |
| 376 | c->pic.key_frame = 1; | 376 | c->pic.key_frame = 1; |
| 377 | c->pic.pict_type = FF_I_TYPE; | 377 | c->pic.pict_type = AV_PICTURE_TYPE_I; |
| 378 | depth = *src++; | 378 | depth = *src++; |
| 379 | if(depth != c->bpp) { | 379 | if(depth != c->bpp) { |
| 380 | av_log(avctx, AV_LOG_INFO, "Depth mismatch. Container %i bpp, Frame data: %i bpp\n", c->bpp, depth); | 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, · 1875 unmodified lines | |||
| 1876 | return buf_size; | 1876 | return buf_size; |
| 1877 | 1877 | ||
| 1878 | s->current_frame.reference = 3; | 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 | if (ff_thread_get_buffer(avctx, &s->current_frame) < 0) { | 1880 | if (ff_thread_get_buffer(avctx, &s->current_frame) < 0) { |
| 1881 | av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 1881 | av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 1882 | goto error; | 1882 | goto error; |
| @@ -1908,7 +1908,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, · 25 unmodified lines | |||
| 1908 | av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n"); | 1908 | av_log(s->avctx, AV_LOG_WARNING, "vp3: first frame not a keyframe\n"); |
| 1909 | 1909 | ||
| 1910 | s->golden_frame.reference = 3; | 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 | if (ff_thread_get_buffer(avctx, &s->golden_frame) < 0) { | 1912 | if (ff_thread_get_buffer(avctx, &s->golden_frame) < 0) { |
| 1913 | av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 1913 | av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 1914 | goto error; | 1914 | goto error; |
| @@ -26,9 +26,9 @@ static int parse(AVCodecParserContext *s, · 25 unmodified lines | |||
| 26 | const uint8_t *buf, int buf_size) | 26 | const uint8_t *buf, int buf_size) |
| 27 | { | 27 | { |
| 28 | if(avctx->codec_id == CODEC_ID_THEORA) | 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 | else | 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 | *poutbuf = buf; | 33 | *poutbuf = buf; |
| 34 | *poutbuf_size = buf_size; | 34 | *poutbuf_size = buf_size; |
| @@ -526,12 +526,12 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size, · 525 unmodified lines | |||
| 526 | } | 526 | } |
| 527 | 527 | ||
| 528 | if (p->key_frame) { | 528 | if (p->key_frame) { |
| 529 | p->pict_type = FF_I_TYPE; | 529 | p->pict_type = AV_PICTURE_TYPE_I; |
| 530 | s->default_models_init(s); | 530 | s->default_models_init(s); |
| 531 | for (block=0; block<s->mb_height*s->mb_width; block++) | 531 | for (block=0; block<s->mb_height*s->mb_width; block++) |
| 532 | s->macroblocks[block].type = VP56_MB_INTRA; | 532 | s->macroblocks[block].type = VP56_MB_INTRA; |
| 533 | } else { | 533 | } else { |
| 534 | p->pict_type = FF_P_TYPE; | 534 | p->pict_type = AV_PICTURE_TYPE_P; |
| 535 | vp56_parse_mb_type_models(s); | 535 | vp56_parse_mb_type_models(s); |
| 536 | s->parse_vector_models(s); | 536 | s->parse_vector_models(s); |
| 537 | s->mb_type = VP56_MB_INTER_NOVEC_PF; | 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, · 1492 unmodified lines | |||
| 1493 | avctx->release_buffer(avctx, curframe); | 1493 | avctx->release_buffer(avctx, curframe); |
| 1494 | 1494 | ||
| 1495 | curframe->key_frame = s->keyframe; | 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 | curframe->reference = referenced ? 3 : 0; | 1497 | curframe->reference = referenced ? 3 : 0; |
| 1498 | if ((ret = avctx->get_buffer(avctx, curframe))) { | 1498 | if ((ret = avctx->get_buffer(avctx, curframe))) { |
| 1499 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed!\n"); | 1499 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed!\n"); |
| @@ -25,7 +25,7 @@ static int parse(AVCodecParserContext *s, · 24 unmodified lines | |||
| 25 | const uint8_t **poutbuf, int *poutbuf_size, | 25 | const uint8_t **poutbuf, int *poutbuf_size, |
| 26 | const uint8_t *buf, int buf_size) | 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 | *poutbuf = buf; | 30 | *poutbuf = buf; |
| 31 | *poutbuf_size = buf_size; | 31 | *poutbuf_size = buf_size; |
| @@ -120,7 +120,7 @@ int ff_wmv2_decode_picture_header(MpegEncContext * s) · 119 unmodified lines | |||
| 120 | decode_ext_header(w); | 120 | decode_ext_header(w); |
| 121 | 121 | ||
| 122 | s->pict_type = get_bits1(&s->gb) + 1; | 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 | code = get_bits(&s->gb, 7); | 124 | code = get_bits(&s->gb, 7); |
| 125 | av_log(s->avctx, AV_LOG_DEBUG, "I7:%X/\n", code); | 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) · 8 unmodified lines | |||
| 135 | { | 135 | { |
| 136 | Wmv2Context * const w= (Wmv2Context*)s; | 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 | if(w->j_type_bit) w->j_type= get_bits1(&s->gb); | 139 | if(w->j_type_bit) w->j_type= get_bits1(&s->gb); |
| 140 | else w->j_type= 0; //FIXME check | 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]) · 200 unmodified lines | |||
| 342 | 342 | ||
| 343 | if(w->j_type) return 0; | 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 | if(IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])){ | 346 | if(IS_SKIP(s->current_picture.mb_type[s->mb_y * s->mb_stride + s->mb_x])){ |
| 347 | /* skip mb */ | 347 | /* skip mb */ |
| 348 | s->mb_intra = 0; | 348 | s->mb_intra = 0; |
| @@ -419,7 +419,7 @@ int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) · 70 unmodified lines | |||
| 419 | } | 419 | } |
| 420 | } | 420 | } |
| 421 | } else { | 421 | } else { |
| 422 | //if(s->pict_type==FF_P_TYPE) | 422 | //if(s->pict_type==AV_PICTURE_TYPE_P) |
| 423 | // printf("%d%d ", s->inter_intra_pred, cbp); | 423 | // printf("%d%d ", s->inter_intra_pred, cbp); |
| 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)); | 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 | s->ac_pred = get_bits1(&s->gb); | 425 | s->ac_pred = get_bits1(&s->gb); |
| @@ -72,7 +72,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number) · 71 unmodified lines | |||
| 72 | Wmv2Context * const w= (Wmv2Context*)s; | 72 | Wmv2Context * const w= (Wmv2Context*)s; |
| 73 | 73 | ||
| 74 | put_bits(&s->pb, 1, s->pict_type - 1); | 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 | put_bits(&s->pb, 7, 0); | 76 | put_bits(&s->pb, 7, 0); |
| 77 | } | 77 | } |
| 78 | put_bits(&s->pb, 5, s->qscale); | 78 | put_bits(&s->pb, 5, s->qscale); |
| @@ -87,7 +87,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number) · 8 unmodified lines | |||
| 87 | 87 | ||
| 88 | assert(s->flipflop_rounding); | 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 | assert(s->no_rounding==1); | 91 | assert(s->no_rounding==1); |
| 92 | if(w->j_type_bit) put_bits(&s->pb, 1, w->j_type); | 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, · 97 unmodified lines | |||
| 191 | coded_cbp |= val << (5 - i); | 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 | put_bits(&s->pb, | 195 | put_bits(&s->pb, |
| 196 | ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]); | 196 | ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]); |
| 197 | } else { | 197 | } else { |
| @@ -60,7 +60,7 @@ static int decode_frame(AVCodecContext *avctx, · 59 unmodified lines | |||
| 60 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 60 | av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 61 | return -1; | 61 | return -1; |
| 62 | } | 62 | } |
| 63 | p->pict_type= FF_I_TYPE; | 63 | p->pict_type= AV_PICTURE_TYPE_I; |
| 64 | p->key_frame= 1; | 64 | p->key_frame= 1; |
| 65 | 65 | ||
| 66 | Y = a->pic.data[0]; | 66 | Y = a->pic.data[0]; |
| @@ -500,11 +500,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac · 499 unmodified lines | |||
| 500 | } | 500 | } |
| 501 | if(c->flags & ZMBV_KEYFRAME) { | 501 | if(c->flags & ZMBV_KEYFRAME) { |
| 502 | c->pic.key_frame = 1; | 502 | c->pic.key_frame = 1; |
| 503 | c->pic.pict_type = FF_I_TYPE; | 503 | c->pic.pict_type = AV_PICTURE_TYPE_I; |
| 504 | c->decode_intra(c); | 504 | c->decode_intra(c); |
| 505 | } else { | 505 | } else { |
| 506 | c->pic.key_frame = 0; | 506 | c->pic.key_frame = 0; |
| 507 | c->pic.pict_type = FF_P_TYPE; | 507 | c->pic.pict_type = AV_PICTURE_TYPE_P; |
| 508 | if(c->decomp_len) | 508 | if(c->decomp_len) |
| 509 | c->decode_xor(c); | 509 | c->decode_xor(c); |
| 510 | } | 510 | } |
| @@ -134,7 +134,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf_size, void · 133 unmodified lines | |||
| 134 | if(c->curfrm == c->keyint) | 134 | if(c->curfrm == c->keyint) |
| 135 | c->curfrm = 0; | 135 | c->curfrm = 0; |
| 136 | *p = *pict; | 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 | p->key_frame= keyframe; | 138 | p->key_frame= keyframe; |
| 139 | chpal = !keyframe && memcmp(p->data[1], c->pal2, 1024); | 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) · 833 unmodified lines | |||
| 834 | avio_wb16(pb, size / 2); | 834 | avio_wb16(pb, size / 2); |
| 835 | } else if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO) { | 835 | } else if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO) { |
| 836 | int frame_type = gxf_parse_mpeg_frame(sc, pkt->data, pkt->size); | 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 | avio_w8(pb, 0x0d); | 838 | avio_w8(pb, 0x0d); |
| 839 | sc->iframes++; | 839 | sc->iframes++; |
| 840 | } else if (frame_type == FF_B_TYPE) { | 840 | } else if (frame_type == AV_PICTURE_TYPE_B) { |
| 841 | avio_w8(pb, 0x0f); | 841 | avio_w8(pb, 0x0f); |
| 842 | sc->bframes++; | 842 | sc->bframes++; |
| 843 | } else { | 843 | } else { |
| @@ -896,7 +896,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, · 895 unmodified lines | |||
| 896 | if((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE) | 896 | if((s->flags & AVFMT_FLAG_IGNDTS) && pkt->pts != AV_NOPTS_VALUE) |
| 897 | pkt->dts= AV_NOPTS_VALUE; | 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 | //FIXME Set low_delay = 0 when has_b_frames = 1 | 900 | //FIXME Set low_delay = 0 when has_b_frames = 1 |
| 901 | st->codec->has_b_frames = 1; | 901 | st->codec->has_b_frames = 1; |
| 902 | 902 | ||
| @@ -912,7 +912,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, · 9 unmodified lines | |||
| 912 | /* XXX: need has_b_frame, but cannot get it if the codec is | 912 | /* XXX: need has_b_frame, but cannot get it if the codec is |
| 913 | not initialized */ | 913 | not initialized */ |
| 914 | if (delay && | 914 | if (delay && |
| 915 | pc && pc->pict_type != FF_B_TYPE) | 915 | pc && pc->pict_type != AV_PICTURE_TYPE_B) |
| 916 | presentation_delayed = 1; | 916 | presentation_delayed = 1; |
| 917 | 917 | ||
| 918 | if(pkt->pts != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE && pkt->dts > pkt->pts && st->pts_wrap_bits<63 | 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, · 121 unmodified lines | |||
| 1040 | /* keyframe computation */ | 1040 | /* keyframe computation */ |
| 1041 | if (pc->key_frame == 1) | 1041 | if (pc->key_frame == 1) |
| 1042 | pkt->flags |= AV_PKT_FLAG_KEY; | 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 | pkt->flags |= AV_PKT_FLAG_KEY; | 1044 | pkt->flags |= AV_PKT_FLAG_KEY; |
| 1045 | } | 1045 | } |
| 1046 | if (pc) | 1046 | if (pc) |