mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-08 15:50:18 +00:00
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>
(cherry picked from commit 47496eb97c
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
dec0316c0f
commit
e9deb55810
@ -51,7 +51,7 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if ((ret = ff_alloc_packet2(avctx, pkt, ret)) < 0)
|
if ((ret = ff_alloc_packet(pkt, ret)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
if ((ret = avpicture_layout((const AVPicture *)frame, avctx->pix_fmt, avctx->width,
|
if ((ret = avpicture_layout((const AVPicture *)frame, avctx->pix_fmt, avctx->width,
|
||||||
avctx->height, pkt->data, pkt->size)) < 0)
|
avctx->height, pkt->data, pkt->size)) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user