diff options
author | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-10-14 11:33:24 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-10-21 11:59:59 +0200 |
commit | f890677d05bc4e8b494a73373ab4cc19791bf884 (patch) | |
tree | cb66705498706dc94caa00ae80962f770a7ba056 /libavcodec | |
parent | 13bddab7de10aebf6efb98aa6d7ff0c51bb0e364 (diff) |
Replace any remaining avpicture function with imgutils
avpicture_get_size() -> av_image_get_buffer_size()
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pamenc.c | 8 | ||||
-rw-r--r-- | libavcodec/pnm_parser.c | 4 | ||||
-rw-r--r-- | libavcodec/pnmenc.c | 7 | ||||
-rw-r--r-- | libavcodec/targaenc.c | 4 | ||||
-rw-r--r-- | libavcodec/vble.c | 6 |
5 files changed, 19 insertions, 10 deletions
diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c index 0be07e1f1b..2b63af986e 100644 --- a/libavcodec/pamenc.c +++ b/libavcodec/pamenc.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/imgutils.h" + #include "avcodec.h" #include "bytestream.h" #include "internal.h" @@ -31,10 +33,10 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, int i, h, w, n, linesize, depth, maxval, ret; const char *tuple_type; uint8_t *ptr; + int size = av_image_get_buffer_size(avctx->pix_fmt, + avctx->width, avctx->height, 1); - if ((ret = ff_alloc_packet(pkt, avpicture_get_size(avctx->pix_fmt, - avctx->width, - avctx->height) + 200)) < 0) { + if ((ret = ff_alloc_packet(pkt, size + 200)) < 0) { av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n"); return ret; } diff --git a/libavcodec/pnm_parser.c b/libavcodec/pnm_parser.c index 175ca36267..1b81c2abf0 100644 --- a/libavcodec/pnm_parser.c +++ b/libavcodec/pnm_parser.c @@ -19,6 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/imgutils.h" + #include "parser.h" //for ParseContext #include "pnm.h" @@ -66,7 +68,7 @@ retry: next = END_NOT_FOUND; } else { next = pnmctx.bytestream - pnmctx.bytestream_start - + avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); + + av_image_get_buffer_size(avctx->pix_fmt, avctx->width, avctx->height, 1); if (pnmctx.bytestream_start != buf) next -= pc->index; if (next > buf_size) diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index 791176a11c..f8c600f937 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "libavutil/imgutils.h" #include "libavutil/pixdesc.h" #include "avcodec.h" #include "bytestream.h" @@ -31,10 +32,10 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame * const p = pict; int i, h, h1, c, n, linesize, ret; uint8_t *ptr, *ptr1, *ptr2; + int size = av_image_get_buffer_size(avctx->pix_fmt, + avctx->width, avctx->height, 1); - if ((ret = ff_alloc_packet(pkt, avpicture_get_size(avctx->pix_fmt, - avctx->width, - avctx->height) + 200)) < 0) { + if ((ret = ff_alloc_packet(pkt, size + 200)) < 0) { av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n"); return ret; } diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c index a85400f958..290054de37 100644 --- a/libavcodec/targaenc.c +++ b/libavcodec/targaenc.c @@ -21,6 +21,7 @@ #include <string.h> +#include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/pixdesc.h" @@ -84,7 +85,8 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, av_log(avctx, AV_LOG_ERROR, "image dimensions too large\n"); return AVERROR(EINVAL); } - picsize = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height); + picsize = av_image_get_buffer_size(avctx->pix_fmt, + avctx->width, avctx->height, 1); if ((ret = ff_alloc_packet(pkt, picsize + 45)) < 0) { av_log(avctx, AV_LOG_ERROR, "encoded frame too large\n"); return ret; diff --git a/libavcodec/vble.c b/libavcodec/vble.c index 996a984a58..7ce1aeebfa 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -26,6 +26,8 @@ #define BITSTREAM_READER_LE +#include "libavutil/imgutils.h" + #include "avcodec.h" #include "get_bits.h" #include "huffyuvdsp.h" @@ -183,8 +185,8 @@ static av_cold int vble_decode_init(AVCodecContext *avctx) avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->bits_per_raw_sample = 8; - ctx->size = avpicture_get_size(avctx->pix_fmt, - avctx->width, avctx->height); + ctx->size = av_image_get_buffer_size(avctx->pix_fmt, + avctx->width, avctx->height, 1); ctx->val = av_malloc(ctx->size * sizeof(*ctx->val)); |