summaryrefslogtreecommitdiff
path: root/libavcodec/libx265.c
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2014-03-23 14:31:06 +0000
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2014-03-24 15:27:41 +0000
commit21a561176e5ed44208a4438a1b0c28a91dd6f4b6 (patch)
treed07c4703c4666e2382765c0e341c44b9679d3d4b /libavcodec/libx265.c
parent60728e8bab8d2a5f6bbb4baa7d53142dbc6047ed (diff)
libx265: Only use one memcpy for headers
They're guaranteed by the x265 API to be contiguous in memory. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/libx265.c')
-rw-r--r--libavcodec/libx265.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index b779c373c5..b12407030e 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -80,7 +80,6 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
{
libx265Context *ctx = avctx->priv_data;
x265_nal *nal;
- uint8_t *buf;
int sar_num, sar_den;
int nnal;
int ret;
@@ -198,11 +197,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
return AVERROR(ENOMEM);
}
- buf = ctx->header;
- for (i = 0; i < nnal; i++) {
- memcpy(buf, nal[i].payload, nal[i].sizeBytes);
- buf += nal[i].sizeBytes;
- }
+ memcpy(ctx->header, nal[0].payload, ctx->header_size);
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
avctx->extradata_size = ctx->header_size;