summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-02-08 02:36:19 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-08 02:36:23 +0100
commit7c148f30f364ca721f12960cfa2bfe3d670a0207 (patch)
tree76591196342fe72eb97be7411791e65ebf8aa211
parent2048126ea7a5df2aec55a0db24f642a05e80dca4 (diff)
parent2efaaf9476c87cdbd174b95c0519575c7d6f30cf (diff)
Merge remote-tracking branch 'cehoyos/master'
* cehoyos/master: Support decoding yuv dpx images. Do not use -mdynamic-no-pic on OSX x86_64. Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rwxr-xr-xconfigure2
-rw-r--r--libavcodec/dpx.c31
2 files changed, 32 insertions, 1 deletions
diff --git a/configure b/configure
index 0c209c5876..f31d372506 100755
--- a/configure
+++ b/configure
@@ -4069,7 +4069,7 @@ case $target_os in
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
objformat="macho"
enabled x86_64 && objformat="macho64"
- enabled_any pic shared ||
+ enabled_any pic shared x86_64 ||
{ check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
;;
mingw32*)
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index 3b78486bb3..66d8428951 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -173,11 +173,16 @@ static int decode_frame(AVCodecContext *avctx,
break;
case 52: // ABGR
case 51: // RGBA
+ case 103: // UYVA4444
elements = 4;
break;
case 50: // RGB
+ case 102: // UYV444
elements = 3;
break;
+ case 100: // UYVY422
+ elements = 2;
+ break;
default:
avpriv_report_missing_feature(avctx, "Descriptor %d", descriptor);
return AVERROR_PATCHWELCOME;
@@ -280,6 +285,15 @@ static int decode_frame(AVCodecContext *avctx,
case 51160:
avctx->pix_fmt = AV_PIX_FMT_RGBA64LE;
break;
+ case 100081:
+ avctx->pix_fmt = AV_PIX_FMT_UYVY422;
+ break;
+ case 102081:
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P;
+ break;
+ case 103081:
+ avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
+ break;
default:
av_log(avctx, AV_LOG_ERROR, "Unsupported format\n");
return AVERROR_PATCHWELCOME;
@@ -344,9 +358,26 @@ static int decode_frame(AVCodecContext *avctx,
case 16:
elements *= 2;
case 8:
+ if ( avctx->pix_fmt == AV_PIX_FMT_YUVA444P
+ || avctx->pix_fmt == AV_PIX_FMT_YUV444P) {
+ for (x = 0; x < avctx->height; x++) {
+ ptr[0] = p->data[0] + x * p->linesize[0];
+ ptr[1] = p->data[1] + x * p->linesize[1];
+ ptr[2] = p->data[2] + x * p->linesize[2];
+ ptr[3] = p->data[3] + x * p->linesize[3];
+ for (y = 0; y < avctx->width; y++) {
+ *ptr[1]++ = *buf++;
+ *ptr[0]++ = *buf++;
+ *ptr[2]++ = *buf++;
+ if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P)
+ *ptr[3]++ = *buf++;
+ }
+ }
+ } else {
av_image_copy_plane(ptr[0], p->linesize[0],
buf, stride,
elements * avctx->width, avctx->height);
+ }
break;
}