History

Support decoding yuv dpx images.

Carl Eugen Hoyos committed 11 years ago

Commit 2efaaf91 parent ea329b61 file · +31 −0Browse files

Unified · Split

libavcodec/dpx.c+31−0
@@ -173,11 +173,16 @@ static int decode_frame(AVCodecContext *avctx, · 172 unmodified lines
173173 break;
174174 case 52: // ABGR
175175 case 51: // RGBA
176+ case 103: // UYVA4444
176177 elements = 4;
177178 break;
178179 case 50: // RGB
180+ case 102: // UYV444
179181 elements = 3;
180182 break;
183+ case 100: // UYVY422
184+ elements = 2;
185+ break;
181186 default:
182187 avpriv_report_missing_feature(avctx, "Descriptor %d", descriptor);
183188 return AVERROR_PATCHWELCOME;
@@ -280,6 +285,15 @@ static int decode_frame(AVCodecContext *avctx, · 96 unmodified lines
280285 case 51160:
281286 avctx->pix_fmt = AV_PIX_FMT_RGBA64LE;
282287 break;
288+ case 100081:
289+ avctx->pix_fmt = AV_PIX_FMT_UYVY422;
290+ break;
291+ case 102081:
292+ avctx->pix_fmt = AV_PIX_FMT_YUV444P;
293+ break;
294+ case 103081:
295+ avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
296+ break;
283297 default:
284298 av_log(avctx, AV_LOG_ERROR, "Unsupported format\n");
285299 return AVERROR_PATCHWELCOME;
@@ -344,9 +358,26 @@ static int decode_frame(AVCodecContext *avctx, · 58 unmodified lines
344358 case 16:
345359 elements *= 2;
346360 case 8:
361+ if ( avctx->pix_fmt == AV_PIX_FMT_YUVA444P
362+ || avctx->pix_fmt == AV_PIX_FMT_YUV444P) {
363+ for (x = 0; x < avctx->height; x++) {
364+ ptr[0] = p->data[0] + x * p->linesize[0];
365+ ptr[1] = p->data[1] + x * p->linesize[1];
366+ ptr[2] = p->data[2] + x * p->linesize[2];
367+ ptr[3] = p->data[3] + x * p->linesize[3];
368+ for (y = 0; y < avctx->width; y++) {
369+ *ptr[1]++ = *buf++;
370+ *ptr[0]++ = *buf++;
371+ *ptr[2]++ = *buf++;
372+ if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P)
373+ *ptr[3]++ = *buf++;
374+ }
375+ }
376+ } else {
347377 av_image_copy_plane(ptr[0], p->linesize[0],
348378 buf, stride,
349379 elements * avctx->width, avctx->height);
380+ }
350381 break;
351382 }
352383

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