* 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 | c->sample_fmt = AV_SAMPLE_FMT_S16; | 70 | c->sample_fmt = AV_SAMPLE_FMT_S16; |
| 71 | 71 | ||
| 72 | /* open it */ | 72 | /* open it */ |
| 73 | if (avcodec_open(c, codec) < 0) { | 73 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 74 | fprintf(stderr, "could not open codec\n"); | 74 | fprintf(stderr, "could not open codec\n"); |
| 75 | exit(1); | 75 | exit(1); |
| 76 | } | 76 | } |
| @@ -135,7 +135,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 58 unmodified lines | |||
| 135 | c = avcodec_alloc_context3(codec); | 135 | c = avcodec_alloc_context3(codec); |
| 136 | 136 | ||
| 137 | /* open it */ | 137 | /* open it */ |
| 138 | if (avcodec_open(c, codec) < 0) { | 138 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 139 | fprintf(stderr, "could not open codec\n"); | 139 | fprintf(stderr, "could not open codec\n"); |
| 140 | exit(1); | 140 | exit(1); |
| 141 | } | 141 | } |
| @@ -243,7 +243,7 @@ static void video_encode_example(const char *filename, int codec_id) · 101 unmodified lines | |||
| 243 | av_opt_set(c->priv_data, "preset", "slow", 0); | 243 | av_opt_set(c->priv_data, "preset", "slow", 0); |
| 244 | 244 | ||
| 245 | /* open it */ | 245 | /* open it */ |
| 246 | if (avcodec_open(c, codec) < 0) { | 246 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 247 | fprintf(stderr, "could not open codec\n"); | 247 | fprintf(stderr, "could not open codec\n"); |
| 248 | exit(1); | 248 | exit(1); |
| 249 | } | 249 | } |
| @@ -366,7 +366,7 @@ static void video_decode_example(const char *outfilename, const char *filename) · 116 unmodified lines | |||
| 366 | available in the bitstream. */ | 366 | available in the bitstream. */ |
| 367 | 367 | ||
| 368 | /* open it */ | 368 | /* open it */ |
| 369 | if (avcodec_open(c, codec) < 0) { | 369 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 370 | fprintf(stderr, "could not open codec\n"); | 370 | fprintf(stderr, "could not open codec\n"); |
| 371 | exit(1); | 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 | /* open it */ | 105 | /* open it */ |
| 106 | if (avcodec_open(c, codec) < 0) { | 106 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 107 | fprintf(stderr, "could not open codec\n"); | 107 | fprintf(stderr, "could not open codec\n"); |
| 108 | exit(1); | 108 | exit(1); |
| 109 | } | 109 | } |
| @@ -164,7 +164,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) · 54 unmodified lines | |||
| 164 | 164 | ||
| 165 | get_audio_frame(samples, audio_input_frame_size, c->channels); | 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 | if (c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE) | 169 | if (c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE) |
| 170 | pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base); | 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 | /* open the codec */ | 286 | /* open the codec */ |
| 287 | if (avcodec_open(c, codec) < 0) { | 287 | if (avcodec_open2(c, codec, NULL) < 0) { |
| 288 | fprintf(stderr, "could not open codec\n"); | 288 | fprintf(stderr, "could not open codec\n"); |
| 289 | exit(1); | 289 | exit(1); |
| 290 | } | 290 | } |
| @@ -90,7 +90,7 @@ AVCodec ff_flv_encoder = { · 89 unmodified lines | |||
| 90 | .id = CODEC_ID_FLV1, | 90 | .id = CODEC_ID_FLV1, |
| 91 | .priv_data_size = sizeof(MpegEncContext), | 91 | .priv_data_size = sizeof(MpegEncContext), |
| 92 | .init = ff_MPV_encode_init, | 92 | .init = ff_MPV_encode_init, |
| 93 | .encode = ff_MPV_encode_picture, | 93 | .encode2 = ff_MPV_encode_picture, |
| 94 | .close = ff_MPV_encode_end, | 94 | .close = ff_MPV_encode_end, |
| 95 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 95 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 96 | .long_name= NULL_IF_CONFIG_SMALL("Flash Video (FLV) / Sorenson Spark / Sorenson H.263"), | 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 | .id = CODEC_ID_H261, | 327 | .id = CODEC_ID_H261, |
| 328 | .priv_data_size = sizeof(H261Context), | 328 | .priv_data_size = sizeof(H261Context), |
| 329 | .init = ff_MPV_encode_init, | 329 | .init = ff_MPV_encode_init, |
| 330 | .encode = ff_MPV_encode_picture, | 330 | .encode2 = ff_MPV_encode_picture, |
| 331 | .close = ff_MPV_encode_end, | 331 | .close = ff_MPV_encode_end, |
| 332 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 332 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 333 | .long_name= NULL_IF_CONFIG_SMALL("H.261"), | 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 | // maximum over s->mjpeg_vsample[i] | 453 | // maximum over s->mjpeg_vsample[i] |
| 454 | #define V_MAX 2 | 454 | #define V_MAX 2 |
| 455 | static int amv_encode_picture(AVCodecContext *avctx, | 455 | static int amv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, |
| 456 | unsigned char *buf, int buf_size, void *data) | 456 | AVFrame *pic, int *got_packet) |
| 457 | { | ||
| 458 | 457 | ||
| 459 | AVFrame* pic=data; | 458 | { |
| 460 | MpegEncContext *s = avctx->priv_data; | 459 | MpegEncContext *s = avctx->priv_data; |
| 461 | int i; | 460 | int i; |
| 462 | 461 | ||
| @@ -469,7 +468,7 @@ static int amv_encode_picture(AVCodecContext *avctx, · 6 unmodified lines | |||
| 469 | pic->data[i] += (pic->linesize[i] * (s->mjpeg_vsample[i] * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 )); | 468 | pic->data[i] += (pic->linesize[i] * (s->mjpeg_vsample[i] * (8 * s->mb_height -((s->height/V_MAX)&7)) - 1 )); |
| 470 | pic->linesize[i] *= -1; | 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 | AVCodec ff_mjpeg_encoder = { | 474 | AVCodec ff_mjpeg_encoder = { |
| @@ -478,7 +477,7 @@ AVCodec ff_mjpeg_encoder = { · 2 unmodified lines | |||
| 478 | .id = CODEC_ID_MJPEG, | 477 | .id = CODEC_ID_MJPEG, |
| 479 | .priv_data_size = sizeof(MpegEncContext), | 478 | .priv_data_size = sizeof(MpegEncContext), |
| 480 | .init = ff_MPV_encode_init, | 479 | .init = ff_MPV_encode_init, |
| 481 | .encode = ff_MPV_encode_picture, | 480 | .encode2 = ff_MPV_encode_picture, |
| 482 | .close = ff_MPV_encode_end, | 481 | .close = ff_MPV_encode_end, |
| 483 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE}, | 482 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE}, |
| 484 | .long_name= NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), | 483 | .long_name= NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), |
| @@ -490,7 +489,7 @@ AVCodec ff_amv_encoder = { · 5 unmodified lines | |||
| 490 | .id = CODEC_ID_AMV, | 489 | .id = CODEC_ID_AMV, |
| 491 | .priv_data_size = sizeof(MpegEncContext), | 490 | .priv_data_size = sizeof(MpegEncContext), |
| 492 | .init = ff_MPV_encode_init, | 491 | .init = ff_MPV_encode_init, |
| 493 | .encode = amv_encode_picture, | 492 | .encode2 = amv_encode_picture, |
| 494 | .close = ff_MPV_encode_end, | 493 | .close = ff_MPV_encode_end, |
| 495 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE}, | 494 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE}, |
| 496 | .long_name = NULL_IF_CONFIG_SMALL("AMV Video"), | 495 | .long_name = NULL_IF_CONFIG_SMALL("AMV Video"), |
| @@ -966,7 +966,7 @@ AVCodec ff_mpeg1video_encoder = { · 965 unmodified lines | |||
| 966 | .id = CODEC_ID_MPEG1VIDEO, | 966 | .id = CODEC_ID_MPEG1VIDEO, |
| 967 | .priv_data_size = sizeof(MpegEncContext), | 967 | .priv_data_size = sizeof(MpegEncContext), |
| 968 | .init = encode_init, | 968 | .init = encode_init, |
| 969 | .encode = ff_MPV_encode_picture, | 969 | .encode2 = ff_MPV_encode_picture, |
| 970 | .close = ff_MPV_encode_end, | 970 | .close = ff_MPV_encode_end, |
| 971 | .supported_framerates= avpriv_frame_rate_tab+1, | 971 | .supported_framerates= avpriv_frame_rate_tab+1, |
| 972 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 972 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| @@ -981,7 +981,7 @@ AVCodec ff_mpeg2video_encoder = { · 8 unmodified lines | |||
| 981 | .id = CODEC_ID_MPEG2VIDEO, | 981 | .id = CODEC_ID_MPEG2VIDEO, |
| 982 | .priv_data_size = sizeof(MpegEncContext), | 982 | .priv_data_size = sizeof(MpegEncContext), |
| 983 | .init = encode_init, | 983 | .init = encode_init, |
| 984 | .encode = ff_MPV_encode_picture, | 984 | .encode2 = ff_MPV_encode_picture, |
| 985 | .close = ff_MPV_encode_end, | 985 | .close = ff_MPV_encode_end, |
| 986 | .supported_framerates= avpriv_frame_rate_tab+1, | 986 | .supported_framerates= avpriv_frame_rate_tab+1, |
| 987 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE}, | 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 | .id = CODEC_ID_MPEG4, | 1346 | .id = CODEC_ID_MPEG4, |
| 1347 | .priv_data_size = sizeof(MpegEncContext), | 1347 | .priv_data_size = sizeof(MpegEncContext), |
| 1348 | .init = encode_init, | 1348 | .init = encode_init, |
| 1349 | .encode = ff_MPV_encode_picture, | 1349 | .encode2 = ff_MPV_encode_picture, |
| 1350 | .close = ff_MPV_encode_end, | 1350 | .close = ff_MPV_encode_end, |
| 1351 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 1351 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 1352 | .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, | 1352 | .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, |
| @@ -263,6 +263,14 @@ typedef struct MpegEncContext { · 262 unmodified lines | |||
| 263 | * offsets used in asm. */ | 263 | * offsets used in asm. */ |
| 264 | 264 | ||
| 265 | int64_t user_specified_pts;///< last non zero pts from AVFrame which was passed into avcodec_encode_video() | 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 | /** bit output */ | 275 | /** bit output */ |
| 268 | PutBitContext pb; | 276 | PutBitContext pb; |
| @@ -702,7 +710,8 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx); · 433 unmodified lines | |||
| 702 | void ff_MPV_frame_end(MpegEncContext *s); | 710 | void ff_MPV_frame_end(MpegEncContext *s); |
| 703 | int ff_MPV_encode_init(AVCodecContext *avctx); | 711 | int ff_MPV_encode_init(AVCodecContext *avctx); |
| 704 | int ff_MPV_encode_end(AVCodecContext *avctx); | 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 | void ff_MPV_common_init_mmx(MpegEncContext *s); | 715 | void ff_MPV_common_init_mmx(MpegEncContext *s); |
| 707 | void ff_MPV_common_init_axp(MpegEncContext *s); | 716 | void ff_MPV_common_init_axp(MpegEncContext *s); |
| 708 | void ff_MPV_common_init_mmi(MpegEncContext *s); | 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 | AVFrame *pic = NULL; | 897 | AVFrame *pic = NULL; |
| 898 | int64_t pts; | 898 | int64_t pts; |
| 899 | int i; | 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 | int direct = 1; | 902 | int direct = 1; |
| 902 | 903 | ||
| 903 | if (pic_arg) { | 904 | if (pic_arg) { |
| @@ -915,6 +916,9 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg) · 11 unmodified lines | |||
| 915 | "last=%"PRId64"\n", pts, s->user_specified_pts); | 916 | "last=%"PRId64"\n", pts, s->user_specified_pts); |
| 916 | return -1; | 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 | s->user_specified_pts = pts; | 923 | s->user_specified_pts = pts; |
| 920 | } else { | 924 | } else { |
| @@ -1384,20 +1388,23 @@ no_output_pic: · 463 unmodified lines | |||
| 1384 | return 0; | 1388 | return 0; |
| 1385 | } | 1389 | } |
| 1386 | 1390 | ||
| 1387 | int ff_MPV_encode_picture(AVCodecContext *avctx, | 1391 | int ff_MPV_encode_picture(AVCodecContext *avctx, AVPacket *pkt, |
| 1388 | unsigned char *buf, int buf_size, void *data) | 1392 | const AVFrame *pic_arg, int *got_packet) |
| 1389 | { | 1393 | { |
| 1390 | MpegEncContext *s = avctx->priv_data; | 1394 | MpegEncContext *s = avctx->priv_data; |
| 1391 | AVFrame *pic_arg = data; | 1395 | int i, stuffing_count, ret; |
| 1392 | int i, stuffing_count; | ||
| 1393 | int context_count = s->slice_context_count; | 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 | for (i = 0; i < context_count; i++) { | 1402 | for (i = 0; i < context_count; i++) { |
| 1396 | int start_y = s->thread_context[i]->start_mb_y; | 1403 | int start_y = s->thread_context[i]->start_mb_y; |
| 1397 | int end_y = s->thread_context[i]-> end_mb_y; | 1404 | int end_y = s->thread_context[i]-> end_mb_y; |
| 1398 | int h = s->mb_height; | 1405 | int h = s->mb_height; |
| 1399 | uint8_t *start = buf + (size_t)(((int64_t) buf_size) * start_y / h); | 1406 | uint8_t *start = pkt->data + (size_t)(((int64_t) pkt->size) * start_y / h); |
| 1400 | uint8_t *end = buf + (size_t)(((int64_t) buf_size) * end_y / h); | 1407 | uint8_t *end = pkt->data + (size_t)(((int64_t) pkt->size) * end_y / h); |
| 1401 | 1408 | ||
| 1402 | init_put_bits(&s->thread_context[i]->pb, start, end - start); | 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 | s->total_bits += s->frame_bits; | 1565 | s->total_bits += s->frame_bits; |
| 1559 | avctx->frame_bits = s->frame_bits; | 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 | } else { | 1579 | } else { |
| 1561 | assert((put_bits_ptr(&s->pb) == s->pb.buf)); | 1580 | assert((put_bits_ptr(&s->pb) == s->pb.buf)); |
| 1562 | s->frame_bits = 0; | 1581 | s->frame_bits = 0; |
| 1563 | } | 1582 | } |
| 1564 | assert((s->frame_bits & 7) == 0); | 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 | static inline void dct_single_coeff_elimination(MpegEncContext *s, | 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 | if(s->data_partitioning){ | 2406 | if(s->data_partitioning){ |
| 2386 | if( s->pb2 .buf_end - s->pb2 .buf - (put_bits_count(&s-> pb2)>>3) < MAX_MB_BYTES | 2407 | if( s->pb2 .buf_end - s->pb2 .buf - (put_bits_count(&s-> pb2)>>3) < MAX_MB_BYTES |
| 2387 | || s->tex_pb.buf_end - s->tex_pb.buf - (put_bits_count(&s->tex_pb )>>3) < MAX_MB_BYTES){ | 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 | return -1; | 2410 | return -1; |
| 2390 | } | 2411 | } |
| 2391 | } | 2412 | } |
| @@ -4084,7 +4105,7 @@ AVCodec ff_h263_encoder = { · 1692 unmodified lines | |||
| 4084 | .id = CODEC_ID_H263, | 4105 | .id = CODEC_ID_H263, |
| 4085 | .priv_data_size = sizeof(MpegEncContext), | 4106 | .priv_data_size = sizeof(MpegEncContext), |
| 4086 | .init = ff_MPV_encode_init, | 4107 | .init = ff_MPV_encode_init, |
| 4087 | .encode = ff_MPV_encode_picture, | 4108 | .encode2 = ff_MPV_encode_picture, |
| 4088 | .close = ff_MPV_encode_end, | 4109 | .close = ff_MPV_encode_end, |
| 4089 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 4110 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 4090 | .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"), | 4111 | .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"), |
| @@ -4111,7 +4132,7 @@ AVCodec ff_h263p_encoder = { · 20 unmodified lines | |||
| 4111 | .id = CODEC_ID_H263P, | 4132 | .id = CODEC_ID_H263P, |
| 4112 | .priv_data_size = sizeof(MpegEncContext), | 4133 | .priv_data_size = sizeof(MpegEncContext), |
| 4113 | .init = ff_MPV_encode_init, | 4134 | .init = ff_MPV_encode_init, |
| 4114 | .encode = ff_MPV_encode_picture, | 4135 | .encode2 = ff_MPV_encode_picture, |
| 4115 | .close = ff_MPV_encode_end, | 4136 | .close = ff_MPV_encode_end, |
| 4116 | .capabilities = CODEC_CAP_SLICE_THREADS, | 4137 | .capabilities = CODEC_CAP_SLICE_THREADS, |
| 4117 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 4138 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| @@ -4125,7 +4146,7 @@ AVCodec ff_msmpeg4v2_encoder = { · 7 unmodified lines | |||
| 4125 | .id = CODEC_ID_MSMPEG4V2, | 4146 | .id = CODEC_ID_MSMPEG4V2, |
| 4126 | .priv_data_size = sizeof(MpegEncContext), | 4147 | .priv_data_size = sizeof(MpegEncContext), |
| 4127 | .init = ff_MPV_encode_init, | 4148 | .init = ff_MPV_encode_init, |
| 4128 | .encode = ff_MPV_encode_picture, | 4149 | .encode2 = ff_MPV_encode_picture, |
| 4129 | .close = ff_MPV_encode_end, | 4150 | .close = ff_MPV_encode_end, |
| 4130 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 4151 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 4131 | .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), | 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 | .id = CODEC_ID_MSMPEG4V3, | 4158 | .id = CODEC_ID_MSMPEG4V3, |
| 4138 | .priv_data_size = sizeof(MpegEncContext), | 4159 | .priv_data_size = sizeof(MpegEncContext), |
| 4139 | .init = ff_MPV_encode_init, | 4160 | .init = ff_MPV_encode_init, |
| 4140 | .encode = ff_MPV_encode_picture, | 4161 | .encode2 = ff_MPV_encode_picture, |
| 4141 | .close = ff_MPV_encode_end, | 4162 | .close = ff_MPV_encode_end, |
| 4142 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 4163 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 4143 | .long_name= NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), | 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 | .id = CODEC_ID_WMV1, | 4170 | .id = CODEC_ID_WMV1, |
| 4150 | .priv_data_size = sizeof(MpegEncContext), | 4171 | .priv_data_size = sizeof(MpegEncContext), |
| 4151 | .init = ff_MPV_encode_init, | 4172 | .init = ff_MPV_encode_init, |
| 4152 | .encode = ff_MPV_encode_picture, | 4173 | .encode2 = ff_MPV_encode_picture, |
| 4153 | .close = ff_MPV_encode_end, | 4174 | .close = ff_MPV_encode_end, |
| 4154 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 4175 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 4155 | .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"), | 4176 | .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 7"), |
| @@ -62,7 +62,7 @@ AVCodec ff_rv10_encoder = { · 61 unmodified lines | |||
| 62 | .id = CODEC_ID_RV10, | 62 | .id = CODEC_ID_RV10, |
| 63 | .priv_data_size = sizeof(MpegEncContext), | 63 | .priv_data_size = sizeof(MpegEncContext), |
| 64 | .init = ff_MPV_encode_init, | 64 | .init = ff_MPV_encode_init, |
| 65 | .encode = ff_MPV_encode_picture, | 65 | .encode2 = ff_MPV_encode_picture, |
| 66 | .close = ff_MPV_encode_end, | 66 | .close = ff_MPV_encode_end, |
| 67 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 67 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 68 | .long_name= NULL_IF_CONFIG_SMALL("RealVideo 1.0"), | 68 | .long_name= NULL_IF_CONFIG_SMALL("RealVideo 1.0"), |
| @@ -63,7 +63,7 @@ AVCodec ff_rv20_encoder = { · 62 unmodified lines | |||
| 63 | .id = CODEC_ID_RV20, | 63 | .id = CODEC_ID_RV20, |
| 64 | .priv_data_size = sizeof(MpegEncContext), | 64 | .priv_data_size = sizeof(MpegEncContext), |
| 65 | .init = ff_MPV_encode_init, | 65 | .init = ff_MPV_encode_init, |
| 66 | .encode = ff_MPV_encode_picture, | 66 | .encode2 = ff_MPV_encode_picture, |
| 67 | .close = ff_MPV_encode_end, | 67 | .close = ff_MPV_encode_end, |
| 68 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 68 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 69 | .long_name= NULL_IF_CONFIG_SMALL("RealVideo 2.0"), | 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 | if (buf_end - buf < 1) | 165 | if (buf_end - buf < 1) |
| 166 | return AVERROR_INVALIDDATA; | 166 | return AVERROR_INVALIDDATA; |
| 167 | 167 | ||
| 168 | if ((value = *buf++) == 0x80) { | 168 | if ((value = *buf++) == RLE_TRIGGER) { |
| 169 | run = *buf++ + 1; | 169 | run = *buf++ + 1; |
| 170 | if (run != 1) | 170 | if (run != 1) |
| 171 | value = *buf++; | 171 | value = *buf++; |
| @@ -199,6 +199,7 @@ static int sunrast_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 198 unmodified lines | |||
| 199 | AV_WB32(&avpkt->data[16], s->length); | 199 | AV_WB32(&avpkt->data[16], s->length); |
| 200 | 200 | ||
| 201 | *got_packet_ptr = 1; | 201 | *got_packet_ptr = 1; |
| 202 | avpkt->flags |= AV_PKT_FLAG_KEY; | ||
| 202 | avpkt->size = bytestream2_tell_p(&s->p); | 203 | avpkt->size = bytestream2_tell_p(&s->p); |
| 203 | return 0; | 204 | return 0; |
| 204 | } | 205 | } |
| @@ -419,10 +419,10 @@ static int tta_decode_frame(AVCodecContext *avctx, void *data, · 418 unmodified lines | |||
| 419 | // fixed order prediction | 419 | // fixed order prediction |
| 420 | #define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k) | 420 | #define PRED(x, k) (int32_t)((((uint64_t)x << k) - x) >> k) |
| 421 | switch (s->bps) { | 421 | switch (s->bps) { |
| 422 | case 1: *p += PRED(*predictor, 4); break; | 422 | case 1: *p += PRED(*predictor, 4); break; |
| 423 | case 2: | 423 | case 2: |
| 424 | case 3: *p += PRED(*predictor, 5); break; | 424 | case 3: *p += PRED(*predictor, 5); break; |
| 425 | case 4: *p += *predictor; break; | 425 | case 4: *p += *predictor; break; |
| 426 | } | 426 | } |
| 427 | *predictor = *p; | 427 | *predictor = *p; |
| 428 | 428 | ||
| @@ -217,7 +217,7 @@ AVCodec ff_wmv2_encoder = { · 216 unmodified lines | |||
| 217 | .id = CODEC_ID_WMV2, | 217 | .id = CODEC_ID_WMV2, |
| 218 | .priv_data_size = sizeof(Wmv2Context), | 218 | .priv_data_size = sizeof(Wmv2Context), |
| 219 | .init = wmv2_encode_init, | 219 | .init = wmv2_encode_init, |
| 220 | .encode = ff_MPV_encode_picture, | 220 | .encode2 = ff_MPV_encode_picture, |
| 221 | .close = ff_MPV_encode_end, | 221 | .close = ff_MPV_encode_end, |
| 222 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | 222 | .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, |
| 223 | .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 8"), | 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 | * Read the format header and initialize the AVFormatContext | 441 | * Read the format header and initialize the AVFormatContext |
| 442 | * structure. Return 0 if OK. 'ap' if non-NULL contains | 442 | * structure. Return 0 if OK. Only used in raw format right |
| 443 | * additional parameters. Only used in raw format right | 443 | * now. 'avformat_new_stream' should be called to create new streams. |
| 444 | * now. 'av_new_stream' should be called to create new streams. | ||
| 445 | */ | 444 | */ |
| 446 | int (*read_header)(struct AVFormatContext *); | 445 | int (*read_header)(struct AVFormatContext *); |
| 447 | 446 | ||
| 448 | /** | 447 | /** |
| 449 | * Read one packet and put it in 'pkt'. pts and flags are also | 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 | * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a | 450 | * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a |
| 452 | * background thread). | 451 | * background thread). |
| 453 | * @return 0 on success, < 0 on error. | 452 | * @return 0 on success, < 0 on error. |