* qatar/master: doxy: remove reference to removed api examples: unbreak compilation ttadec: cosmetics: reindent sunrast: use RLE trigger macro inplace of the hard coded value. sunrastenc: set keyframe flag for the output packet. mpegvideo_enc: switch to encode2(). mpegvideo_enc: force encoding delay of at least 1 frame when low_delay=0 Conflicts: doc/examples/muxing.c
Unified · Split
| @@ -70,7 +70,7 @@ static void audio_encode_example(const char *filename) · 69 unmodified lines | ||
| 70 | 70 | c->sample_fmt = AV_SAMPLE_FMT_S16; |
| 71 | 71 | |
| 72 | 72 | /* open it */ |
| 73 | − if (avcodec_open(c, codec) < 0) { | |
| 73 | + if (avcodec_open2(c, codec, NULL) < 0) { | |
| 74 | 74 | fprintf(stderr, "could not open codec\n"); |
| 75 | 75 | exit(1); |
| 76 | 76 | } |
| @@ -135,7 +135,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 58 unmodified lines | ||
| 135 | 135 | c = avcodec_alloc_context3(codec); |
| 136 | 136 | |
| 137 | 137 | /* open it */ |
| 138 | − if (avcodec_open(c, codec) < 0) { | |
| 138 | + if (avcodec_open2(c, codec, NULL) < 0) { | |
| 139 | 139 | fprintf(stderr, "could not open codec\n"); |
| 140 | 140 | exit(1); |
| 141 | 141 | } |
| @@ -243,7 +243,7 @@ static void video_encode_example(const char *filename, int codec_id) · 101 unmodified lines | ||
| 243 | 243 | av_opt_set(c->priv_data, "preset", "slow", 0); |
| 244 | 244 | |
| 245 | 245 | /* open it */ |
| 246 | − if (avcodec_open(c, codec) < 0) { | |
| 246 | + if (avcodec_open2(c, codec, NULL) < 0) { | |
| 247 | 247 | fprintf(stderr, "could not open codec\n"); |
| 248 | 248 | exit(1); |
| 249 | 249 | } |
| @@ -366,7 +366,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 116 unmodified lines | ||
| 366 | 366 | available in the bitstream. */ |
| 367 | 367 | |
| 368 | 368 | /* open it */ |
| 369 | − if (avcodec_open(c, codec) < 0) { | |
| 369 | + if (avcodec_open2(c, codec, NULL) < 0) { | |
| 370 | 370 | fprintf(stderr, "could not open codec\n"); |
| 371 | 371 | exit(1); |
| 372 | 372 | } |
| @@ -103,7 +103,7 @@ static void open_audio(AVFormatContext *oc, AVStream *st) · 102 unmodified lines | ||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /* open it */ |
| 106 | − if (avcodec_open(c, codec) < 0) { | |
| 106 | + if (avcodec_open2(c, codec, NULL) < 0) { | |
| 107 | 107 | fprintf(stderr, "could not open codec\n"); |
| 108 | 108 | exit(1); |
| 109 | 109 | } |
| @@ -164,7 +164,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) · 54 unmodified lines | ||
| 164 | 164 | |
| 165 | 165 | get_audio_frame(samples, audio_input_frame_size, c->channels); |
| 166 | 166 | |
| 167 | − pkt.size = avcodec_encode_audio(c, audio_outbuf, audio_outbuf_size, samples); | |
| 167 | + pkt.size = avcodec_encode_audio2(c, audio_outbuf, audio_outbuf_size, samples); | |
| 168 | 168 | |
| 169 | 169 | if (c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE) |
| 170 | 170 | pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base); |
| @@ -284,7 +284,7 @@ static void open_video(AVFormatContext *oc, AVStream *st) · 113 unmodified lines | ||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /* open the codec */ |
| 287 | − if (avcodec_open(c, codec) < 0) { | |
| 287 | + if (avcodec_open2(c, codec, NULL) < 0) { | |
| 288 | 288 | fprintf(stderr, "could not open codec\n"); |
| 289 | 289 | exit(1); |
| 290 | 290 | } |
| @@ -90,7 +90,7 @@ AVCodec ff_flv_encoder = { · 89 unmodified lines | ||
| 90 | 90 | .id = CODEC_ID_FLV1, |
| 91 | 91 | .priv_data_size = sizeof(MpegEncContext), |
| 92 | 92 | .init = ff_MPV_encode_init, |
| 93 | − .encode = ff_MPV_encode_picture, | |
| 93 | + .encode2 = ff_MPV_encode_picture, | |
| 94 | 94 | .close = ff_MPV_encode_end, |
| 95 | 95 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 96 | 96 | .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), |
| @@ -327,7 +327,7 @@ AVCodec ff_h261_encoder = { · 326 unmodified lines | ||
| 327 | 327 | .id = CODEC_ID_H261, |
| 328 | 328 | .priv_data_size = sizeof(H261Context), |
| 329 | 329 | .init = ff_MPV_encode_init, |
| 330 | − .encode = ff_MPV_encode_picture, | |
| 330 | + .encode2 = ff_MPV_encode_picture, | |
| 331 | 331 | .close = ff_MPV_encode_end, |
| 332 | 332 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 333 | 333 | .long_name= NULL_IF_CONFIG_SMALL("H.261"), |
| @@ -452,11 +452,10 @@ void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]) · 451 unmodified lines | ||
| 452 | 452 | |
| 453 | 453 | // maximum over s->mjpeg_vsample[i] |
| 454 | 454 | #define V_MAX 2 |
| 455 | −static int amv_encode_picture(AVCodecContext *avctx, | |
| 456 | − unsigned char *buf, int buf_size, void *data) | |
| 457 | −{ | |
| 455 | +static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, | |
| 456 | + AVFrame *pic, int *got_packet) | |
| 458 | 457 | |
| 459 | − AVFrame* pic=data; | |
| 458 | +{ | |
| 460 | 459 | MpegEncContext *s = avctx->priv_data; |
| 461 | 460 | int i; |
| 462 | 461 | |
| @@ -469,7 +468,7 @@ static int amv_encode_picture(AVCodecContext *avctx, · 6 unmodified lines | ||
| 469 | 468 | pic->data[i] += (pic->linesize[i] * (s->mjpeg_vsample[i] * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 )); |
| 470 | 469 | pic->linesize[i] *= -1; |
| 471 | 470 | } |
| 472 | − return ff_MPV_encode_picture(avctx,buf, buf_size, pic); | |
| 471 | + return ff_MPV_encode_picture(avctx, pkt, pic, got_packet); | |
| 473 | 472 | } |
| 474 | 473 | |
| 475 | 474 | AVCodec ff_mjpeg_encoder = { |
| @@ -478,7 +477,7 @@ AVCodec ff_mjpeg_encoder = { · 2 unmodified lines | ||
| 478 | 477 | .id = CODEC_ID_MJPEG, |
| 479 | 478 | .priv_data_size = sizeof(MpegEncContext), |
| 480 | 479 | .init = ff_MPV_encode_init, |
| 481 | − .encode = ff_MPV_encode_picture, | |
| 480 | + .encode2 = ff_MPV_encode_picture, | |
| 482 | 481 | .close = ff_MPV_encode_end, |
| 483 | 482 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE}, |
| 484 | 483 | .long_name= NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), |
| @@ -490,7 +489,7 @@ AVCodec ff_amv_encoder = { · 5 unmodified lines | ||
| 490 | 489 | .id = CODEC_ID_AMV, |
| 491 | 490 | .priv_data_size = sizeof(MpegEncContext), |
| 492 | 491 | .init = ff_MPV_encode_init, |
| 493 | − .encode = amv_encode_picture, | |
| 492 | + .encode2 = amv_encode_picture, | |
| 494 | 493 | .close = ff_MPV_encode_end, |
| 495 | 494 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE}, |
| 496 | 495 | .long_name = NULL_IF_CONFIG_SMALL("AMV Video"), |
| @@ -966,7 +966,7 @@ AVCodec ff_mpeg1video_encoder = { · 965 unmodified lines | ||
| 966 | 966 | .id = CODEC_ID_MPEG1VIDEO, |
| 967 | 967 | .priv_data_size = sizeof(MpegEncContext), |
| 968 | 968 | .init = encode_init, |
| 969 | − .encode = ff_MPV_encode_picture, | |
| 969 | + .encode2 = ff_MPV_encode_picture, | |
| 970 | 970 | .close = ff_MPV_encode_end, |
| 971 | 971 | .supported_framerates= avpriv_frame_rate_tab+1, |
| 972 | 972 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| @@ -981,7 +981,7 @@ AVCodec ff_mpeg2video_encoder = { · 8 unmodified lines | ||
| 981 | 981 | .id = CODEC_ID_MPEG2VIDEO, |
| 982 | 982 | .priv_data_size = sizeof(MpegEncContext), |
| 983 | 983 | .init = encode_init, |
| 984 | − .encode = ff_MPV_encode_picture, | |
| 984 | + .encode2 = ff_MPV_encode_picture, | |
| 985 | 985 | .close = ff_MPV_encode_end, |
| 986 | 986 | .supported_framerates= avpriv_frame_rate_tab+1, |
| 987 | 987 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE}, |
| @@ -1346,7 +1346,7 @@ AVCodec ff_mpeg4_encoder = { · 1345 unmodified lines | ||
| 1346 | 1346 | .id = CODEC_ID_MPEG4, |
| 1347 | 1347 | .priv_data_size = sizeof(MpegEncContext), |
| 1348 | 1348 | .init = encode_init, |
| 1349 | − .encode = ff_MPV_encode_picture, | |
| 1349 | + .encode2 = ff_MPV_encode_picture, | |
| 1350 | 1350 | .close = ff_MPV_encode_end, |
| 1351 | 1351 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 1352 | 1352 | .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, |
| @@ -263,6 +263,14 @@ typedef struct MpegEncContext { · 262 unmodified lines | ||
| 263 | 263 | * offsets used in asm. */ |
| 264 | 264 | |
| 265 | 265 | int64_t user_specified_pts;///< last non zero pts from AVFrame which was passed into avcodec_encode_video() |
| 266 | + /** | |
| 267 | + * pts difference between the first and second input frame, used for | |
| 268 | + * calculating dts of the first frame when there's a delay */ | |
| 269 | + int64_t dts_delta; | |
| 270 | + /** | |
| 271 | + * reordered pts to be used as dts for the next output frame when there's | |
| 272 | + * a delay */ | |
| 273 | + int64_t reordered_pts; | |
| 266 | 274 | |
| 267 | 275 | /** bit output */ |
| 268 | 276 | PutBitContext pb; |
| @@ -702,7 +710,8 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx); · 433 unmodified lines | ||
| 702 | 710 | void ff_MPV_frame_end(MpegEncContext *s); |
| 703 | 711 | int ff_MPV_encode_init(AVCodecContext *avctx); |
| 704 | 712 | int ff_MPV_encode_end(AVCodecContext *avctx); |
| 705 | −int ff_MPV_encode_picture(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data); | |
| 713 | +int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt, | |
| 714 | + const AVFrame *frame, int *got_packet); | |
| 706 | 715 | void ff_MPV_common_init_mmx(MpegEncContext *s); |
| 707 | 716 | void ff_MPV_common_init_axp(MpegEncContext *s); |
| 708 | 717 | void ff_MPV_common_init_mmi(MpegEncContext *s); |
| @@ -897,7 +897,8 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg) · 896 unmodified lines | ||
| 897 | 897 | AVFrame *pic = NULL; |
| 898 | 898 | int64_t pts; |
| 899 | 899 | int i; |
| 900 | − const int encoding_delay = s->max_b_frames; | |
| 900 | + const int encoding_delay = s->max_b_frames ? s->max_b_frames : | |
| 901 | + (s->low_delay ? 0 : 1); | |
| 901 | 902 | int direct = 1; |
| 902 | 903 | |
| 903 | 904 | if (pic_arg) { |
| @@ -915,6 +916,9 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg) · 11 unmodified lines | ||
| 915 | 916 | "last=%"PRId64"\n", pts, s->user_specified_pts); |
| 916 | 917 | return -1; |
| 917 | 918 | } |
| 919 | + | |
| 920 | + if (!s->low_delay && pic_arg->display_picture_number == 1) | |
| 921 | + s->dts_delta = time - last; | |
| 918 | 922 | } |
| 919 | 923 | s->user_specified_pts = pts; |
| 920 | 924 | } else { |
| @@ -1384,20 +1388,23 @@ no_output_pic: · 463 unmodified lines | ||
| 1384 | 1388 | return 0; |
| 1385 | 1389 | } |
| 1386 | 1390 | |
| 1387 | −int ff_MPV_encode_picture(AVCodecContext *avctx, | |
| 1388 | − unsigned char *buf, int buf_size, void *data) | |
| 1391 | +int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt, | |
| 1392 | + const AVFrame *pic_arg, int *got_packet) | |
| 1389 | 1393 | { |
| 1390 | 1394 | MpegEncContext *s = avctx->priv_data; |
| 1391 | − AVFrame *pic_arg = data; | |
| 1392 | − int i, stuffing_count; | |
| 1395 | + int i, stuffing_count, ret; | |
| 1393 | 1396 | int context_count = s->slice_context_count; |
| 1394 | 1397 | |
| 1398 | + if (!pkt->data && | |
| 1399 | + (ret = ff_alloc_packet(pkt, s->mb_width*s->mb_height*(MAX_MB_BYTES+100)+10000)) < 0) | |
| 1400 | + return ret; | |
| 1401 | + | |
| 1395 | 1402 | for (i = 0; i < context_count; i++) { |
| 1396 | 1403 | int start_y = s->thread_context[i]->start_mb_y; |
| 1397 | 1404 | int end_y = s->thread_context[i]-> end_mb_y; |
| 1398 | 1405 | int h = s->mb_height; |
| 1399 | − uint8_t *start = buf + (size_t)(((int64_t) buf_size) * start_y / h); | |
| 1400 | − uint8_t *end = buf + (size_t)(((int64_t) buf_size) * end_y / h); | |
| 1406 | + uint8_t *start = pkt->data + (size_t)(((int64_t) pkt->size) * start_y / h); | |
| 1407 | + uint8_t *end = pkt->data + (size_t)(((int64_t) pkt->size) * end_y / h); | |
| 1401 | 1408 | |
| 1402 | 1409 | init_put_bits(&s->thread_context[i]->pb, start, end - start); |
| 1403 | 1410 | } |
| @@ -1557,13 +1564,27 @@ vbv_retry: · 153 unmodified lines | ||
| 1557 | 1564 | } |
| 1558 | 1565 | s->total_bits += s->frame_bits; |
| 1559 | 1566 | avctx->frame_bits = s->frame_bits; |
| 1567 | + | |
| 1568 | + pkt->pts = s->current_picture.f.pts; | |
| 1569 | + if (!s->low_delay) { | |
| 1570 | + if (!s->current_picture.f.coded_picture_number) | |
| 1571 | + pkt->dts = pkt->pts - s->dts_delta; | |
| 1572 | + else | |
| 1573 | + pkt->dts = s->reordered_pts; | |
| 1574 | + s->reordered_pts = s->input_picture[0]->f.pts; | |
| 1575 | + } else | |
| 1576 | + pkt->dts = pkt->pts; | |
| 1577 | + if (s->current_picture.f.key_frame) | |
| 1578 | + pkt->flags |= AV_PKT_FLAG_KEY; | |
| 1560 | 1579 | } else { |
| 1561 | 1580 | assert((put_bits_ptr(&s->pb) == s->pb.buf)); |
| 1562 | 1581 | s->frame_bits = 0; |
| 1563 | 1582 | } |
| 1564 | 1583 | assert((s->frame_bits & 7) == 0); |
| 1565 | 1584 | |
| 1566 | − return s->frame_bits / 8; | |
| 1585 | + pkt->size = s->frame_bits / 8; | |
| 1586 | + *got_packet = !!pkt->size; | |
| 1587 | + return 0; | |
| 1567 | 1588 | } |
| 1568 | 1589 | |
| 1569 | 1590 | static inline void dct_single_coeff_elimination(MpegEncContext *s, |
| @@ -2385,7 +2406,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 815 unmodified lines | ||
| 2385 | 2406 | if(s->data_partitioning){ |
| 2386 | 2407 | if( s->pb2 .buf_end - s->pb2 .buf - (put_bits_count(&s-> pb2)>>3) < MAX_MB_BYTES |
| 2387 | 2408 | || s->tex_pb.buf_end - s->tex_pb.buf - (put_bits_count(&s->tex_pb )>>3) < MAX_MB_BYTES){ |
| 2388 | − av_log(s->avctx, AV_LOG_ERROR, "encoded frame too large\n"); | |
| 2409 | + av_log(s->avctx, AV_LOG_ERROR, "encoded partitioned frame too large\n"); | |
| 2389 | 2410 | return -1; |
| 2390 | 2411 | } |
| 2391 | 2412 | } |
| @@ -4084,7 +4105,7 @@ AVCodec ff_h263_encoder = { · 1692 unmodified lines | ||
| 4084 | 4105 | .id = CODEC_ID_H263, |
| 4085 | 4106 | .priv_data_size = sizeof(MpegEncContext), |
| 4086 | 4107 | .init = ff_MPV_encode_init, |
| 4087 | − .encode = ff_MPV_encode_picture, | |
| 4108 | + .encode2 = ff_MPV_encode_picture, | |
| 4088 | 4109 | .close = ff_MPV_encode_end, |
| 4089 | 4110 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 4090 | 4111 | .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"), |
| @@ -4111,7 +4132,7 @@ AVCodec ff_h263p_encoder = { · 20 unmodified lines | ||
| 4111 | 4132 | .id = CODEC_ID_H263P, |
| 4112 | 4133 | .priv_data_size = sizeof(MpegEncContext), |
| 4113 | 4134 | .init = ff_MPV_encode_init, |
| 4114 | − .encode = ff_MPV_encode_picture, | |
| 4135 | + .encode2 = ff_MPV_encode_picture, | |
| 4115 | 4136 | .close = ff_MPV_encode_end, |
| 4116 | 4137 | .capabilities = CODEC_CAP_SLICE_THREADS, |
| 4117 | 4138 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| @@ -4125,7 +4146,7 @@ AVCodec ff_msmpeg4v2_encoder = { · 7 unmodified lines | ||
| 4125 | 4146 | .id = CODEC_ID_MSMPEG4V2, |
| 4126 | 4147 | .priv_data_size = sizeof(MpegEncContext), |
| 4127 | 4148 | .init = ff_MPV_encode_init, |
| 4128 | − .encode = ff_MPV_encode_picture, | |
| 4149 | + .encode2 = ff_MPV_encode_picture, | |
| 4129 | 4150 | .close = ff_MPV_encode_end, |
| 4130 | 4151 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 4131 | 4152 | .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), |
| @@ -4137,7 +4158,7 @@ AVCodec ff_msmpeg4v3_encoder = { · 5 unmodified lines | ||
| 4137 | 4158 | .id = CODEC_ID_MSMPEG4V3, |
| 4138 | 4159 | .priv_data_size = sizeof(MpegEncContext), |
| 4139 | 4160 | .init = ff_MPV_encode_init, |
| 4140 | − .encode = ff_MPV_encode_picture, | |
| 4161 | + .encode2 = ff_MPV_encode_picture, | |
| 4141 | 4162 | .close = ff_MPV_encode_end, |
| 4142 | 4163 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 4143 | 4164 | .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), |
| @@ -4149,7 +4170,7 @@ AVCodec ff_wmv1_encoder = { · 5 unmodified lines | ||
| 4149 | 4170 | .id = CODEC_ID_WMV1, |
| 4150 | 4171 | .priv_data_size = sizeof(MpegEncContext), |
| 4151 | 4172 | .init = ff_MPV_encode_init, |
| 4152 | − .encode = ff_MPV_encode_picture, | |
| 4173 | + .encode2 = ff_MPV_encode_picture, | |
| 4153 | 4174 | .close = ff_MPV_encode_end, |
| 4154 | 4175 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 4155 | 4176 | .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"), |
| @@ -62,7 +62,7 @@ AVCodec ff_rv10_encoder = { · 61 unmodified lines | ||
| 62 | 62 | .id = CODEC_ID_RV10, |
| 63 | 63 | .priv_data_size = sizeof(MpegEncContext), |
| 64 | 64 | .init = ff_MPV_encode_init, |
| 65 | − .encode = ff_MPV_encode_picture, | |
| 65 | + .encode2 = ff_MPV_encode_picture, | |
| 66 | 66 | .close = ff_MPV_encode_end, |
| 67 | 67 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 68 | 68 | .long_name= NULL_IF_CONFIG_SMALL("RealVideo 1.0"), |
| @@ -63,7 +63,7 @@ AVCodec ff_rv20_encoder = { · 62 unmodified lines | ||
| 63 | 63 | .id = CODEC_ID_RV20, |
| 64 | 64 | .priv_data_size = sizeof(MpegEncContext), |
| 65 | 65 | .init = ff_MPV_encode_init, |
| 66 | − .encode = ff_MPV_encode_picture, | |
| 66 | + .encode2 = ff_MPV_encode_picture, | |
| 67 | 67 | .close = ff_MPV_encode_end, |
| 68 | 68 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 69 | 69 | .long_name= NULL_IF_CONFIG_SMALL("RealVideo 2.0"), |
| @@ -165,7 +165,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, · 164 unmodified lines | ||
| 165 | 165 | if (buf_end - buf < 1) |
| 166 | 166 | return AVERROR_INVALIDDATA; |
| 167 | 167 | |
| 168 | − if ((value = *buf++) == 0x80) { | |
| 168 | + if ((value = *buf++) == RLE_TRIGGER) { | |
| 169 | 169 | run = *buf++ + 1; |
| 170 | 170 | if (run != 1) |
| 171 | 171 | value = *buf++; |
| @@ -199,6 +199,7 @@ static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 198 unmodified lines | ||
| 199 | 199 | AV_WB32(&avpkt->data[16], s->length); |
| 200 | 200 | |
| 201 | 201 | *got_packet_ptr = 1; |
| 202 | + avpkt->flags |= AV_PKT_FLAG_KEY; | |
| 202 | 203 | avpkt->size = bytestream2_tell_p(&s->p); |
| 203 | 204 | return 0; |
| 204 | 205 | } |
| @@ -419,10 +419,10 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data, · 418 unmodified lines | ||
| 419 | 419 | // fixed order prediction |
| 420 | 420 | #define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k) |
| 421 | 421 | switch (s->bps) { |
| 422 | − case 1: *p += PRED(*predictor, 4); break; | |
| 423 | − case 2: | |
| 424 | − case 3: *p += PRED(*predictor, 5); break; | |
| 425 | − case 4: *p += *predictor; break; | |
| 422 | + case 1: *p += PRED(*predictor, 4); break; | |
| 423 | + case 2: | |
| 424 | + case 3: *p += PRED(*predictor, 5); break; | |
| 425 | + case 4: *p += *predictor; break; | |
| 426 | 426 | } |
| 427 | 427 | *predictor = *p; |
| 428 | 428 | |
| @@ -217,7 +217,7 @@ AVCodec ff_wmv2_encoder = { · 216 unmodified lines | ||
| 217 | 217 | .id = CODEC_ID_WMV2, |
| 218 | 218 | .priv_data_size = sizeof(Wmv2Context), |
| 219 | 219 | .init = wmv2_encode_init, |
| 220 | − .encode = ff_MPV_encode_picture, | |
| 220 | + .encode2 = ff_MPV_encode_picture, | |
| 221 | 221 | .close = ff_MPV_encode_end, |
| 222 | 222 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 223 | 223 | .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 8"), |
| @@ -439,15 +439,14 @@ typedef struct AVInputFormat { · 438 unmodified lines | ||
| 439 | 439 | |
| 440 | 440 | /** |
| 441 | 441 | * Read the format header and initialize the AVFormatContext |
| 442 | − * structure. Return 0 if OK. 'ap' if non-NULL contains | |
| 443 | − * additional parameters. Only used in raw format right | |
| 444 | − * now. 'av_new_stream' should be called to create new streams. | |
| 442 | + * structure. Return 0 if OK. Only used in raw format right | |
| 443 | + * now. 'avformat_new_stream' should be called to create new streams. | |
| 445 | 444 | */ |
| 446 | 445 | int (*read_header)(struct AVFormatContext *); |
| 447 | 446 | |
| 448 | 447 | /** |
| 449 | 448 | * Read one packet and put it in 'pkt'. pts and flags are also |
| 450 | − * set. 'av_new_stream' can be called only if the flag | |
| 449 | + * set. 'avformat_new_stream' can be called only if the flag | |
| 451 | 450 | * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a |
| 452 | 451 | * background thread). |
| 453 | 452 | * @return 0 on success, < 0 on error. |