[FFmpeg-cvslog] lavc/tiff: Support decoding 16bit cmyk.
Carl Eugen Hoyos
git at videolan.org
Wed Mar 20 18:10:23 EET 2019
ffmpeg | branch: master | Carl Eugen Hoyos <ceffmpeg at gmail.com> | Sat Mar 9 11:05:36 2019 +0100| [6fcf7adc019b29926ce7b096640cfdf714074bcd] | committer: Carl Eugen Hoyos
lavc/tiff: Support decoding 16bit cmyk.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6fcf7adc019b29926ce7b096640cfdf714074bcd
---
libavcodec/tiff.c | 16 ++++++++++++++++
libavcodec/version.h | 2 +-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 112f5b52f4..828ed9e2e9 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1547,6 +1547,22 @@ again:
}
dst += p->linesize[plane];
}
+ } else if (s->photometric == TIFF_PHOTOMETRIC_SEPARATED &&
+ s->avctx->pix_fmt == AV_PIX_FMT_RGBA64BE) {
+ dst = p->data[plane];
+ for (i = 0; i < s->height; i++) {
+ for (j = 0; j < s->width; j++) {
+ uint64_t k = 65535 - AV_RB16(dst + 8 * j + 6);
+ uint64_t r = (65535 - AV_RB16(dst + 8 * j )) * k;
+ uint64_t g = (65535 - AV_RB16(dst + 8 * j + 2)) * k;
+ uint64_t b = (65535 - AV_RB16(dst + 8 * j + 4)) * k;
+ AV_WB16(dst + 8 * j , r * 65537 >> 32);
+ AV_WB16(dst + 8 * j + 2, g * 65537 >> 32);
+ AV_WB16(dst + 8 * j + 4, b * 65537 >> 32);
+ AV_WB16(dst + 8 * j + 6, 65535);
+ }
+ dst += p->linesize[plane];
+ }
}
}
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 309e4111cb..a217283b03 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 47
-#define LIBAVCODEC_VERSION_MICRO 103
+#define LIBAVCODEC_VERSION_MICRO 104
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
More information about the ffmpeg-cvslog
mailing list