2017-01-10 23:56 GMT+01:00 Carl Eugen Hoyos <ceffm...@gmail.com>: > 2017-01-10 23:53 GMT+01:00 Martin Vignali <martin.vign...@gmail.com>: > >> > But maybe you can put the Store data code inside the planar part > >> > (it's very similar) > >> > >> That means I have to remove the pixel_size context variable: > >> Do you want me to do that? > > > > No i don't think you need to remove it. > > Then I don't know how to do it, please send a patch. > (Please mention the ticket.) > > I though about something like the patch in attach.
I just quickly test this patch, pass fate test, and decode a test sample. Seems strange, that the uncompress size, doesn't need to be adapt. Martin
From 7527be4ae13d3e134e5eb607e5e7ccd060eb5446 Mon Sep 17 00:00:00 2001 From: Martin Vignali <martin.vign...@gmail.com> Date: Tue, 10 Jan 2017 23:59:59 +0100 Subject: [PATCH] libavcodec/psd : add support for psd bitmap mode Ticket 6044 Based on patch by Carl Eugen Hoyos --- libavcodec/psd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/psd.c b/libavcodec/psd.c index 7587ed9..074df51 100644 --- a/libavcodec/psd.c +++ b/libavcodec/psd.c @@ -319,6 +319,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, s->uncompressed_size = s->line_size * s->height * s->channel_count; switch (s->color_mode) { + case PSD_BITMAP: + s->line_size = s->width + 7 >> 3; + avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; + break; case PSD_INDEXED: if (s->channel_depth != 8 || s->channel_count != 1) { av_log(s->avctx, AV_LOG_ERROR, @@ -428,9 +432,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, plane_number = eq_channel[c]; ptr = picture->data[plane_number];/* get the right plane */ for (y = 0; y < s->height; y++) { - memcpy(ptr, ptr_data, s->width * s->pixel_size); + memcpy(ptr, ptr_data, s->line_size); ptr += picture->linesize[plane_number]; - ptr_data += s->width * s->pixel_size; + ptr_data += s->line_size; } } } -- 1.9.3 (Apple Git-50)
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel