From patchwork Thu Nov 17 23:20:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 1466 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp1057179vsb; Thu, 17 Nov 2016 15:20:39 -0800 (PST) X-Received: by 10.46.0.77 with SMTP id 74mr2889505lja.76.1479424839370; Thu, 17 Nov 2016 15:20:39 -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 d21si2022915lfg.83.2016.11.17.15.20.38; Thu, 17 Nov 2016 15:20:39 -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 893BA68A057; Fri, 18 Nov 2016 01:20:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-2.mx.upcmail.net (vie01a-dmta-pe04-2.mx.upcmail.net [62.179.121.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BBB17689DD0 for ; Fri, 18 Nov 2016 01:20:20 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1c7Vyf-0007oX-UX for ffmpeg-devel@ffmpeg.org; Fri, 18 Nov 2016 00:20:21 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 9BLL1u0140S5wYM01BLM9o; Fri, 18 Nov 2016 00:20:21 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 18 Nov 2016 00:20:18 +0100 Message-Id: <20161117232018.25086-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161117232018.25086-1-michael@niedermayer.cc> References: <20161117232018.25086-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/ffv1dec: Set packed_at_lsb for 16bit YUV 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This avoids unneeded computations Signed-off-by: Michael Niedermayer --- libavcodec/ffv1dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index b5fb825..358da17 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -637,12 +637,14 @@ static int read_header(FFV1Context *f) case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUVA420P10; break; } } else if (f->avctx->bits_per_raw_sample == 16 && !f->transparency){ + f->packed_at_lsb = 1; switch(16 * f->chroma_h_shift + f->chroma_v_shift) { case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUV444P16; break; case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUV422P16; break; case 0x11: f->avctx->pix_fmt = AV_PIX_FMT_YUV420P16; break; } } else if (f->avctx->bits_per_raw_sample == 16 && f->transparency){ + f->packed_at_lsb = 1; switch(16 * f->chroma_h_shift + f->chroma_v_shift) { case 0x00: f->avctx->pix_fmt = AV_PIX_FMT_YUVA444P16; break; case 0x10: f->avctx->pix_fmt = AV_PIX_FMT_YUVA422P16; break;