diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-22 21:46:56 +0200 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-22 21:46:56 +0200 |
commit | dde8e5ad02ad60b149d9a532e67587f45f3aecc5 (patch) | |
tree | 23222bdf799d325b155feb07b280e585f35f82fe | |
parent | 3c3997188ef945a978792a59c646bfb33cc68a5f (diff) | |
parent | 3ee2c60cc296eee3f63d7b5fee9b4332eeeac9fa (diff) | |
download | ffmpeg-streaming-dde8e5ad02ad60b149d9a532e67587f45f3aecc5.zip ffmpeg-streaming-dde8e5ad02ad60b149d9a532e67587f45f3aecc5.tar.gz |
Merge commit '3ee2c60cc296eee3f63d7b5fee9b4332eeeac9fa'
* commit '3ee2c60cc296eee3f63d7b5fee9b4332eeeac9fa':
utils: Use data buffers directly instead of an AVPicture
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
-rw-r--r-- | libavcodec/utils.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index eac7251..83a2078 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -512,7 +512,8 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) switch (avctx->codec_type) { case AVMEDIA_TYPE_VIDEO: { - AVPicture picture; + uint8_t *data[4]; + int linesize[4]; int size[4] = { 0 }; int w = frame->width; int h = frame->height; @@ -527,27 +528,27 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) do { // NOTE: do not align linesizes individually, this breaks e.g. assumptions // that linesize[0] == 2*linesize[1] in the MPEG-encoder for 4:2:2 - av_image_fill_linesizes(picture.linesize, avctx->pix_fmt, w); + av_image_fill_linesizes(linesize, avctx->pix_fmt, w); // increase alignment of w for next try (rhs gives the lowest bit set in w) w += w & ~(w - 1); unaligned = 0; for (i = 0; i < 4; i++) - unaligned |= picture.linesize[i] % pool->stride_align[i]; + unaligned |= linesize[i] % pool->stride_align[i]; } while (unaligned); - tmpsize = av_image_fill_pointers(picture.data, avctx->pix_fmt, h, - NULL, picture.linesize); + tmpsize = av_image_fill_pointers(data, avctx->pix_fmt, h, + NULL, linesize); if (tmpsize < 0) return -1; - for (i = 0; i < 3 && picture.data[i + 1]; i++) - size[i] = picture.data[i + 1] - picture.data[i]; - size[i] = tmpsize - (picture.data[i] - picture.data[0]); + for (i = 0; i < 3 && data[i + 1]; i++) + size[i] = data[i + 1] - data[i]; + size[i] = tmpsize - (data[i] - data[0]); for (i = 0; i < 4; i++) { av_buffer_pool_uninit(&pool->pools[i]); - pool->linesize[i] = picture.linesize[i]; + pool->linesize[i] = linesize[i]; if (size[i]) { pool->pools[i] = av_buffer_pool_init(size[i] + 16 + STRIDE_ALIGN - 1, CONFIG_MEMORY_POISONING ? |