[FFmpeg-devel] [PATCH]lavc/psd: Support CMYK images
Carl Eugen Hoyos
ceffmpeg at gmail.com
Sat Jan 12 18:19:48 EET 2019
2019-01-11 7:17 GMT+01:00, Peter Ross <pross at xvid.org>:
> On Fri, Jan 11, 2019 at 03:23:49AM +0100, Carl Eugen Hoyos wrote:
>> 2019-01-11 2:55 GMT+01:00, Carl Eugen Hoyos <ceffmpeg at gmail.com>:
>> > Hi!
>> >
>> > Attached patch fixes ticket #6797, please comment.
>>
>> New patch with 16bit support attached.
>>
>> Please comment, Carl Eugen
>
>> From 5f879539ee7fecd57bd3de9f7c6363d9b7779b5b Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos <ceffmpeg at gmail.com>
>> Date: Fri, 11 Jan 2019 03:20:38 +0100
>> Subject: [PATCH] lavc/psd: Support CMYK images.
>>
>> Based on a05635e by Michael Niedermayer.
>>
>> Fixes ticket #6797.
>> ---
>> libavcodec/psd.c | 84
>> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 84 insertions(+)
>>
>> diff --git a/libavcodec/psd.c b/libavcodec/psd.c
>
>> + if (s->channel_depth == 8) {
>> + for (y = 0; y < s->height; y++) {
>> + for (x = 0; x < s->width; x++) {
>> + int k = src[3][x];
>> + int r = src[0][x] * k;
>> + int g = src[1][x] * k;
>> + int b = src[2][x] * k;
>> + dst[0][x] = g * 257 >> 16;
>> + dst[1][x] = b * 257 >> 16;
>> + dst[2][x] = r * 257 >> 16;
>> + }
>
> the same algorithm exists in libavcodec/mjpegdec.c, with alpha channel
> support.
> i guess it is trivial enough to be duplicated here.
>
> otherwise looks good.
Patch applied.
Thanks everybody, Carl Eugen
More information about the ffmpeg-devel
mailing list