diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-22 20:31:09 +0200 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-10-22 20:31:09 +0200 |
commit | 8fe1433ad4f866df58c0862f0d13535c96e90d63 (patch) | |
tree | 819ec0c44d8ecf005ad300d0ad8eba1ad0d69359 /libavcodec | |
parent | ef4fbee79df6b3835bef36bbe59bdc7c834676f2 (diff) | |
parent | 48c06386831604921bdaf4fb77ea02766cd615f4 (diff) | |
download | ffmpeg-8fe1433ad4f866df58c0862f0d13535c96e90d63.tar.gz |
Merge commit '48c06386831604921bdaf4fb77ea02766cd615f4'
* commit '48c06386831604921bdaf4fb77ea02766cd615f4':
dpx: Replace avpicture functions with imgutils
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dpxenc.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index 9f3cbbe977..52e1ef2332 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -90,7 +90,8 @@ static av_always_inline void write32_internal(int big_endian, void *p, int value #define write16(p, value) write16_internal(s->big_endian, p, value) #define write32(p, value) write32_internal(s->big_endian, p, value) -static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst) +static void encode_rgb48_10bit(AVCodecContext *avctx, const AVFrame *pic, + uint8_t *dst) { DPXContext *s = avctx->priv_data; const uint8_t *src = pic->data[0]; @@ -115,7 +116,7 @@ static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic, uint } } -static void encode_gbrp10(AVCodecContext *avctx, const AVPicture *pic, uint8_t *dst) +static void encode_gbrp10(AVCodecContext *avctx, const AVFrame *pic, uint8_t *dst) { DPXContext *s = avctx->priv_data; const uint8_t *src[3] = {pic->data[0], pic->data[1], pic->data[2]}; @@ -141,7 +142,7 @@ static void encode_gbrp10(AVCodecContext *avctx, const AVPicture *pic, uint8_t * } } -static void encode_gbrp12(AVCodecContext *avctx, const AVPicture *pic, uint16_t *dst) +static void encode_gbrp12(AVCodecContext *avctx, const AVFrame *pic, uint16_t *dst) { DPXContext *s = avctx->priv_data; const uint16_t *src[3] = {(uint16_t*)pic->data[0], @@ -243,21 +244,22 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, src += frame->linesize[0]; } } else { - size = avpicture_layout((const AVPicture*)frame, avctx->pix_fmt, - avctx->width, avctx->height, - buf + HEADER_SIZE, pkt->size - HEADER_SIZE); + size = av_image_copy_to_buffer(buf + HEADER_SIZE, pkt->size - HEADER_SIZE, + frame->data, frame->linesize, + avctx->pix_fmt, + avctx->width, avctx->height, 1); } if (size < 0) return size; break; case 10: if (s->planar) - encode_gbrp10(avctx, (const AVPicture*)frame, buf + HEADER_SIZE); + encode_gbrp10(avctx, frame, buf + HEADER_SIZE); else - encode_rgb48_10bit(avctx, (const AVPicture*)frame, buf + HEADER_SIZE); + encode_rgb48_10bit(avctx, frame, buf + HEADER_SIZE); break; case 12: - encode_gbrp12(avctx, (const AVPicture*)frame, (uint16_t*)(buf + HEADER_SIZE)); + encode_gbrp12(avctx, frame, (uint16_t*)(buf + HEADER_SIZE)); break; default: av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", s->bits_per_component); |