MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / encode_frame

Function encode_frame

libavcodec/mpegvideo_enc.c:1467–1486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1465}
1466
1467static int encode_frame(AVCodecContext *c, const AVFrame *frame, AVPacket *pkt)
1468{
1469 int ret;
1470 int size = 0;
1471
1472 ret = avcodec_send_frame(c, frame);
1473 if (ret < 0)
1474 return ret;
1475
1476 do {
1477 ret = avcodec_receive_packet(c, pkt);
1478 if (ret >= 0) {
1479 size += pkt->size;
1480 av_packet_unref(pkt);
1481 } else if (ret < 0 && ret != AVERROR(EAGAIN) && ret != AVERROR_EOF)
1482 return ret;
1483 } while (ret >= 0);
1484
1485 return size;
1486}
1487
1488static int estimate_best_b_count(MPVMainEncContext *const m)
1489{

Callers 1

estimate_best_b_countFunction · 0.70

Calls 3

avcodec_send_frameFunction · 0.85
avcodec_receive_packetFunction · 0.85
av_packet_unrefFunction · 0.85

Tested by

no test coverage detected