From patchwork Wed Apr 19 18:11:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Izen X-Patchwork-Id: 41250 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4645:b0:e3:3194:9d20 with SMTP id eb5csp683713pzb; Wed, 19 Apr 2023 11:11:54 -0700 (PDT) X-Google-Smtp-Source: AKy350ZzudmWuNmg35n5uTBROocPGiGcg/9K7vZr4v+nz5kQdiNSUodaxbRgCihQzol1bSTXOKLS X-Received: by 2002:a17:906:39cf:b0:94d:e1ac:9aee with SMTP id i15-20020a17090639cf00b0094de1ac9aeemr3132285eje.33.1681927914444; Wed, 19 Apr 2023 11:11:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681927914; cv=none; d=google.com; s=arc-20160816; b=uNRr8PJBI8TNGXoF6LLtQD53GRqWChuqzFAmYu9yc/FuIIGamlwlWIKeBUxf9sii3D y/TVSaUye1A7HZqDFjFEGYwXsM9G0rQoAwXS6A5Ms/h6Zzx/bJR64+3OcQMkc4rLQGlr y3pJJ3fUY0wnBOUuGYP9gL5Fxt6Fn2BC16+7IbFFZiGbdn++IoTgI74DKtTrVQ7IR9yX IfhUw+2EwmgB873UqXVYKtM+tDTMlTG2YrcA6Wrcf0JJed4/jN26x6rNhqGrzof+3PDQ WH0n6RU9qZkju+0x3BbvyVnQD4b1dnRFF0YAJtb6O1cVVgKYiQ59cwBPZRbXxg4WP5d6 zEQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=Q/kIgPSesz8Qi7rwGt2RufA3Ucpr/rVZvilsq4H63AU=; b=GMfuZmzT7c2G3KYTTGdPQI5xxtLVSFdg+98K93dADpQYTDm0fGyBuJ85ti4dEFr0Db o3ljjK14XsLLPX0FYQNarMMEWVSgaCKMzOGT9zdSNns/x8ym/86aAgDkRqjEUxwiBOB+ 34pe/AciN6kylFhgjEXMo3s3/TNcaYFxuMz2+BsXPMt5Cd2GKjQVhuavW5IICsQokluJ pz4cncnCsNpQfRJZF/tFUm7PM2pPuJ31uC7upd4dO/dPp80kvQ6OCSsqCyOrCLtC1wWW kBzj45n/eIHoznOpj7aVphb8ClMrizFB+ZJeZ0myKyYsQ8Lt+ZPCLeClil+LeF4rOjtF bAZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=qB7gfGIH; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id wg1-20020a1709078f0100b00953198aff1dsi2060266ejc.1001.2023.04.19.11.11.54; Wed, 19 Apr 2023 11:11:54 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20221208 header.b=qB7gfGIH; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2BF8868A23A; Wed, 19 Apr 2023 21:11:38 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ED33568BA8E for ; Wed, 19 Apr 2023 21:11:30 +0300 (EEST) Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-b8f2747f720so28870276.1 for ; Wed, 19 Apr 2023 11:11:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681927889; x=1684519889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZTUeuBnteDtpeD0LjLOfAyxV+u9uQCiqmGDOdXejzu0=; b=qB7gfGIHMWJ4fOmrK5CKucDkNcBeM9vxyVRzT6LuSGxWNiDmwYx+DZlP7kUael2KEk /LzlTpZK7FQrhbB46iR7MDfz8ljup0HkKdNL7vdeAw9VlQIxQuglAvd58QUTTH0zCyr1 8RU08jJ7dBJCmgKVAxbh376ELDySE3SOwEf/+A/vawkVsJ1hQBqyCxOJ7TwKFKDPRmDQ +itDJZ01Yp93qiOJQxhCay/0gjqWZLhi6YvQByYZQJuV5OYBe8E8wAjI6qbQYbqXToog pGokXIVCXdzC3huy1NTbN+dm69mE5lSasmtgKIVsAwyi5Y7ZNarZYMESD20HDzPrXBFO DVYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681927889; x=1684519889; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZTUeuBnteDtpeD0LjLOfAyxV+u9uQCiqmGDOdXejzu0=; b=K9cJdB96sF50/PI8gl/Q6mL31sK/Dgg6ETHWBoL5bM1leoX0sWIk4p0t6tr3KyGx1T od3ntiln2vjRYvnI9duKp1n7aUvWNarZy9+8Omb8TqBpAURQeykykNlVr08mOT0n6Md+ SOD8meA7pbcFAw5YkjXXbI0eDuBlON3PmXY9OJm6b6dtK1qazBpxq9WSA0wwD6/G8vs/ 68YzqKpSn0MCS31gITcm7vmLFf8lHbQQm4Da2uRohUsqy8yQSHzSEzc/CS7MI8iC928s ARFi9oRVlvSO7rXVx9cnuAF53knyJ3y1zhCfI1rnlEaXtnPzShKmCsYuRjevnRkj7SCz wrJA== X-Gm-Message-State: AAQBX9fSEVvreXjisEGY3YSYwl5EqPYMECMuhDLBG3nEJZ7t2kd/Z0SU kEfmuZ/MCaNAOGnjhmR4xJ96JOdtSAQ= X-Received: by 2002:a81:1b10:0:b0:53c:6fca:a1c4 with SMTP id b16-20020a811b10000000b0053c6fcaa1c4mr17710287ywb.2.1681927889562; Wed, 19 Apr 2023 11:11:29 -0700 (PDT) Received: from gauss.local (c-98-224-219-15.hsd1.mi.comcast.net. [98.224.219.15]) by smtp.gmail.com with ESMTPSA id w67-20020a814946000000b00555e1886350sm280586ywa.78.2023.04.19.11.11.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 11:11:29 -0700 (PDT) From: Leo Izen To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Apr 2023 14:11:24 -0400 Message-Id: <20230419181126.38662-2-leo.izen@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230419181126.38662-1-leo.izen@gmail.com> References: <20230419181126.38662-1-leo.izen@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 1/3] avcodec/mjpegdec: fix non-subsampled RGB JPEGs X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Leo Izen Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: WmbuZV3HS+5Z The change introduced in b18a9c29713abc3a1b081de3f320ab53a47120c6 created a regression for non-subsampled progressive RGB jpegs. This should fix that. --- libavcodec/mjpegdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 01537d4774..1e3ddb72fb 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1698,7 +1698,8 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, s->h_scount[i] = s->h_count[index]; s->v_scount[i] = s->v_count[index]; - if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == AV_PIX_FMT_GBRP) + if((nb_components == 3 || nb_components == 1) && s->nb_components == 3 + && s->avctx->pix_fmt == AV_PIX_FMT_GBRP && !s->progressive) index = (index+2)%3; s->comp_index[i] = index;