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
78 else AV_WL32(p, value); \78 else AV_WL32(p, value); \
79} while(0)79} while(0)
80 80
81static void encode_rgb48_10bit(AVCodecContext *avctx, const AVPicture *pic,81static void encode_rgb48_10bit(AVCodecContext *avctx, const AVFrame *pic,
82 uint8_t *dst)82 uint8_t *dst)
83{83{
84 DPXContext *s = avctx->priv_data;84 DPXContext *s = avctx->priv_data;
@@ -115,7 +115,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 30 unmodified lines
115 if (s->bits_per_component == 10)115 if (s->bits_per_component == 10)
116 size = avctx->height * avctx->width * 4;116 size = avctx->height * avctx->width * 4;
117 else117 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);
119 if ((ret = ff_alloc_packet(pkt, size + HEADER_SIZE)) < 0) {120 if ((ret = ff_alloc_packet(pkt, size + HEADER_SIZE)) < 0) {
120 av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");121 av_log(avctx, AV_LOG_ERROR, "Error getting output packet.\n");
121 return ret;122 return ret;
@@ -153,14 +154,16 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 31 unmodified lines
153 switch (s->bits_per_component) {154 switch (s->bits_per_component) {
154 case 8:155 case 8:
155 case 16:156 case 16:
156 size = avpicture_layout((const AVPicture*)frame, avctx->pix_fmt,157 size = av_image_copy_to_buffer(buf + HEADER_SIZE,
157 avctx->width, avctx->height,158 pkt->size - HEADER_SIZE,
158 buf + HEADER_SIZE, pkt->size - HEADER_SIZE);159 frame->data, frame->linesize,
160 avctx->pix_fmt,
161 avctx->width, avctx->height, 1);
159 if (size < 0)162 if (size < 0)
160 return size;163 return size;
161 break;164 break;
162 case 10:165 case 10:
163 encode_rgb48_10bit(avctx, (const AVPicture*)frame, buf + HEADER_SIZE);166 encode_rgb48_10bit(avctx, frame, buf + HEADER_SIZE);
164 break;167 break;
165 default:168 default:
166 av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", s->bits_per_component);169 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