History

dpx: Replace avpicture functions with imgutils

Vittorio Giovara committed 11 years ago

Commit 48c06381 parent f0a10651 file · +9 −6Browse files

Unified · Split

libavcodec/dpxenc.c+9−6
@@ -78,7 +78,7 @@ do { \ · 77 unmodified lines
7878 else AV_WL32(p, value); \
7979 } while(0)
8080
81−static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic,
81+static void encode_rgb48_10bit(AVCodecContext *avctx, const AVFrame *pic,
8282 uint8_t *dst)
8383 {
8484 DPXContext *s = avctx->priv_data;
@@ -115,7 +115,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 30 unmodified lines
115115 if (s->bits_per_component == 10)
116116 size = avctx->height * avctx->width * 4;
117117 else
118− size = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
118+ size = av_image_get_buffer_size(avctx->pix_fmt,
119+ avctx->width, avctx->height, 1);
119120 if ((ret = ff_alloc_packet(pkt, size + HEADER_SIZE)) < 0) {
120121 av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
121122 return ret;
@@ -153,14 +154,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 31 unmodified lines
153154 switch (s->bits_per_component) {
154155 case 8:
155156 case 16:
156− size = avpicture_layout((const AVPicture*)frame, avctx->pix_fmt,
157− avctx->width, avctx->height,
158− buf + HEADER_SIZE, pkt->size - HEADER_SIZE);
157+ size = av_image_copy_to_buffer(buf + HEADER_SIZE,
158+ pkt->size - HEADER_SIZE,
159+ frame->data, frame->linesize,
160+ avctx->pix_fmt,
161+ avctx->width, avctx->height, 1);
159162 if (size < 0)
160163 return size;
161164 break;
162165 case 10:
163− encode_rgb48_10bit(avctx, (const AVPicture*)frame, buf + HEADER_SIZE);
166+ encode_rgb48_10bit(avctx, frame, buf + HEADER_SIZE);
164167 break;
165168 default:
166169 av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", s->bits_per_component);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t