From patchwork Thu Nov 10 22:08:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Eugen Hoyos X-Patchwork-Id: 1378 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp1089036vsb; Thu, 10 Nov 2016 14:08:34 -0800 (PST) X-Received: by 10.194.88.131 with SMTP id bg3mr7749713wjb.32.1478815714653; Thu, 10 Nov 2016 14:08:34 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id v5si7306265wja.213.2016.11.10.14.08.34; Thu, 10 Nov 2016 14:08:34 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C22106899EB; Fri, 11 Nov 2016 00:08:28 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-3.mx.upcmail.net (vie01a-dmta-pe01-3.mx.upcmail.net [62.179.121.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4EAAA6899EB for ; Fri, 11 Nov 2016 00:08:22 +0200 (EET) Received: from [172.31.216.44] (helo=vie01a-pemc-psmtp-pe02) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1c4xWD-000368-81 for ffmpeg-devel@ffmpeg.org; Thu, 10 Nov 2016 23:08:25 +0100 Received: from [192.168.1.3] ([80.110.108.152]) by vie01a-pemc-psmtp-pe02 with SMTP @ mailcloud.upcmail.net id 6N8P1u0133HK5G001N8R5i; Thu, 10 Nov 2016 23:08:25 +0100 X-SourceIP: 80.110.108.152 From: Carl Eugen Hoyos To: FFmpeg development discussions and patches Date: Thu, 10 Nov 2016 23:08:23 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Message-Id: <201611102308.23921.cehoyos@ag.or.at> Subject: [FFmpeg-devel] [PATCH]lavc/dpx: Support gray12 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Hi! Not sure how useful this is but we also support gprp12. Please comment, Carl Eugen From 525d19c0486bae49d2ee304d1afc8960d4f58bbc Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Thu, 10 Nov 2016 23:04:46 +0100 Subject: [PATCH] lavc/dpx: Support GRAY12 colourspace. --- libavcodec/dpx.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index e4dd1b0..1aa2cbd 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -243,6 +243,10 @@ static int decode_frame(AVCodecContext *avctx, case 6080: avctx->pix_fmt = AV_PIX_FMT_GRAY8; break; + case 6121: + case 6120: + avctx->pix_fmt = AV_PIX_FMT_GRAY12; + break; case 50081: case 50080: avctx->pix_fmt = AV_PIX_FMT_RGB24; @@ -345,12 +349,12 @@ static int decode_frame(AVCodecContext *avctx, (uint16_t*)ptr[2], (uint16_t*)ptr[3]}; for (y = 0; y < avctx->width; y++) { - *dst[2] = read16(&buf, endian) >> 4; - dst[2]++; + if (elements >= 3) + *dst[2]++ = read16(&buf, endian) >> 4; *dst[0] = read16(&buf, endian) >> 4; dst[0]++; - *dst[1] = read16(&buf, endian) >> 4; - dst[1]++; + if (elements >= 2) + *dst[1]++ = read16(&buf, endian) >> 4; if (elements == 4) *dst[3]++ = read16(&buf, endian) >> 4; }