diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-07-05 21:00:15 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-07-05 21:00:15 +0300 |
commit | 47496eb97cff8130991313d1b7292613620d8592 (patch) | |
tree | 8755738fc5db6409ca02cd95fff778ff7c936632 /libavcodec/rawenc.c | |
parent | e8576dc8dfc9a3434c7585c451a87db86ca0d9ba (diff) |
avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
the later is not optimal when the buffer size is well known at allocation time
This avoids a memcpy()
Overall 2.5% speedup with a random 1920x1080 video
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rawenc.c')
-rw-r--r-- | libavcodec/rawenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index d7923931bb..71c1de5b0e 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -54,7 +54,7 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt, if (ret < 0) return ret; - if ((ret = ff_alloc_packet2(avctx, pkt, ret)) < 0) + if ((ret = ff_alloc_packet(pkt, ret)) < 0) return ret; if ((ret = avpicture_layout((const AVPicture *)frame, avctx->pix_fmt, avctx->width, avctx->height, pkt->data, pkt->size)) < 0) |