From patchwork Wed Oct 2 01:20:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Skakov Pavel X-Patchwork-Id: 15444 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id F26F644A422 for ; Wed, 2 Oct 2019 04:26:42 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D34C3687FB4; Wed, 2 Oct 2019 04:26:42 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D32BC687F28 for ; Wed, 2 Oct 2019 04:26:36 +0300 (EEST) Received: by mail-lf1-f68.google.com with SMTP id t8so11340853lfc.13 for ; Tue, 01 Oct 2019 18:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=tDeuLM8nD4nbSnerVMgps9DrJWUuUOahF+V+udk630E=; b=DMJP93EpTlecc5mrJvkae6uW7/Q17ufiaF0rwgVJMyYWtfVjBJHd8iLx5F3JNV67Wb VBo0oN51lD9PQPWxffGft+9U+VGAhS/e7Vi0AVmj56ZAYNBabrKNwQXAx5H2I4K5hsXP 5qFkEFWe8czUtVgtAtcFqjsGV9XubNs/hw5i6LzCvf2KlHvhIEVFWl8RPCZ4/diB8Zae 7blUmqe0tMoBalxJpgSfsA7wemlv4UOUxmdxQAV9IqvdYsIYF2z+d2vqwt2kmctFHJlH zttXSz83y6BDiR/JL8t+ND6zF97Qec6H77+vXmbeErHilBZqJ3Fdnn12eEniY9g23gla aX2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=tDeuLM8nD4nbSnerVMgps9DrJWUuUOahF+V+udk630E=; b=QADAKuWjggwIAt/+4mOEyEUVfepGxWtXu2kjm+G/GtquecvaY5eB2DU1NkYFkKmty2 Ty/ixUjcQG/v0mzJtPHmxxAv5qYwZUiZYzuKAbBzK9+4/IRjzrJ89SrOPrPdny0HqhaB jqeXC0/d/sbdXEedRjcCA0yFwTL8kYiFFxDT2JEWxv1+Q3LEq+vkjpqWpfL3evFkUCDX L+55LgZ/8Rn4xYiq1rmKhn4s8+NAUJGIg3JLImU8DvNQKL8wOjOYNFT0udKbAqUsLv2q LEt2vTY5Bp808gMpK8cJGJJ9G9txtAijb5AvS1ra/rDqwIaxTFH87UVFm1l+xe9tx2Pj BeoQ== X-Gm-Message-State: APjAAAXiOmnC3nLhP0ENElgbMTB3Aa7y5xDoDNs9K/3s/2A5lTe7Ise2 auNTQFDwDe3zAXe7z6IiZhEbPNo/ X-Google-Smtp-Source: APXvYqzqR7qhIuGGu0hr4FQURwiyFrAc0f67vuCOHj7r1p4ioWsNjHVZ8aqsNfAPbiH5AZ+5juKFig== X-Received: by 2002:ac2:5091:: with SMTP id f17mr349456lfm.107.1569979240406; Tue, 01 Oct 2019 18:20:40 -0700 (PDT) Received: from [10.1.0.176] ([5.18.248.33]) by smtp.gmail.com with ESMTPSA id v1sm4352445lfq.89.2019.10.01.18.20.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Oct 2019 18:20:39 -0700 (PDT) From: Skakov Pavel To: FFmpeg development discussions and patches References: <4a6e0b07-62df-1ae1-d338-4f14a04c544a@gmail.com> <3c763f67-516c-bc08-0203-948fc4663f41@gmail.com> Message-ID: Date: Wed, 2 Oct 2019 04:20:36 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <3c763f67-516c-bc08-0203-948fc4663f41@gmail.com> Content-Language: en-US Subject: Re: [FFmpeg-devel] [PATCH] avcodec/tiff: correct the default value of YCbCrSubsampling 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" >>> TIFF decoder uses wrong default YCbCrSubsampling value so it breaks >>> on files that rely on standard default and omit the value. > This patch broke fate-exif-image-tiff and fate-lavf-tiff. Patch updated, fixed one more error in code: rps check used subsampling even for non-subsampled formats. FATE should be happy with this. From ecda81bd912581b5fb411dc83f51d1c7a5117b3b Mon Sep 17 00:00:00 2001 From: Pavel Skakov Date: Wed, 2 Oct 2019 04:14:32 +0300 Subject: [PATCH] avcodec/tiff: correct the default value of YCbCrSubsampling to 2x2 Signed-off-by: Pavel Skakov --- libavcodec/tiff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 9f24796a88..8b39ca1ebc 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -1869,7 +1869,7 @@ again: avpkt->size - s->strippos); } - if (s->rps <= 0 || s->rps % s->subsampling[1]) { + if (s->rps <= 0 || s->photometric == TIFF_PHOTOMETRIC_YCBCR && s->rps % s->subsampling[1]) { av_log(avctx, AV_LOG_ERROR, "rps %d invalid\n", s->rps); return AVERROR_INVALIDDATA; } @@ -2065,7 +2065,7 @@ static av_cold int tiff_init(AVCodecContext *avctx) s->width = 0; s->height = 0; s->subsampling[0] = - s->subsampling[1] = 1; + s->subsampling[1] = 2; s->avctx = avctx; ff_lzw_decode_open(&s->lzw); if (!s->lzw) -- 2.13.2.windows.1