From patchwork Tue Oct 6 23:03:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 22744 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 A47D8449516 for ; Wed, 7 Oct 2020 02:11:31 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 63C8568B5F8; Wed, 7 Oct 2020 02:11:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1A2FD68AF30 for ; Wed, 7 Oct 2020 02:11:23 +0300 (EEST) Received: by mail-lj1-f180.google.com with SMTP id a5so34963ljj.11 for ; Tue, 06 Oct 2020 16:11:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PmcdnJQsqTVe8NYAQgfhqex2k+OSI8Z4DaIMmHc/O6o=; b=D8GD4NMVqF2WKnoHWTVWflx4mrZXC5MyVR/EKfVR5LFXyvRRkAW5NoFTmvO/aMbqyC RjEY2RZRNXnfPH6Ib/2IKnoZtq23vqIRxqyChDvoGJarkPUf7Vkl7DjULSXmIwEMd3ra /me4YYST204AufDOlzg1CQQK4yyn7TKHDVH9RYvrZoHcSipHBEcBQJbwi8+TK6K3m0sY 3fNc3l/jyEEp7BXg9rlOjKCU6IuK2ArrnKiztFYfD5kfP9RWjfXRcSDkyEGWKpsUfvva 9FYWzX/j7cjkxBihc18Fwf4Z73Dhr06+hUJYir1Lad/tXUTVmR6EUTSdU8yzIXvVMH6o V8oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PmcdnJQsqTVe8NYAQgfhqex2k+OSI8Z4DaIMmHc/O6o=; b=aKFgcnZYGPCJoYfPseMGCa9PiExlJRah7/ltGehL5UYjZBFHQG6rQAjJ8n/gQqKlvr L8IKMpBAqMNSwy/Krd7cb1kyHezde9lSzWd7ZnVX9sXxZ0z2YDef5NsUXWnIuXI4qZiQ h1g+Ks1T8H0upjeqiGgwAj4mwl9CKnZsOai4K8MPsVfW/NHILe84midSnNyIn6dt6PXW Je6sWjej6sFZz5Ky0J0RbrMkKtP97uTGkopsIdJXlnX75PzShOY17AJGfgDyb1z5xQDP NfnSKDifB3sXU6AJTlSwA8ou1sgEbqSZxUNqdutCcLZry/TttEpLg1KSuSy9stZXn+4N 2QlA== X-Gm-Message-State: AOAM532ejpqpsTKL45gyJ0MYgK+O6Hd+OrKFEJA5wMPS8QWmYbDSizuN tXGhqZ2RAT3xPGsUI7BvEAeWfFrc3YI= X-Google-Smtp-Source: ABdhPJyS+FKl4sLTJ2cE7GkMQinAB70FdGDpvBOgoBHwpPC0Eqi3V+Ur89peZqHnnzFwyuHOFGWT1g== X-Received: by 2002:a19:3f55:: with SMTP id m82mr29532lfa.491.1602025399377; Tue, 06 Oct 2020 16:03:19 -0700 (PDT) Received: from localhost.localdomain (91-159-194-103.elisa-laajakaista.fi. [91.159.194.103]) by smtp.gmail.com with ESMTPSA id y184sm52558lfa.245.2020.10.06.16.03.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 16:03:18 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 7 Oct 2020 02:03:16 +0300 Message-Id: <20201006230317.15516-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] swscale/swscale_internal: interpret RGB paletted pixel formats as RGB 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" This makes isAnyRGB return true for AV_PIX_FMT_PAL8 which is currently the only pixel format with this flag. This lets us have a single query for formats where we need to force range as only full range content is supported. --- libswscale/swscale_internal.h | 2 +- tests/ref/fate/sws-pixdesc-query | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index d207d3beff..013ad51299 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -775,7 +775,7 @@ static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); av_assert0(desc); - return (desc->flags & AV_PIX_FMT_FLAG_RGB) || + return (desc->flags & (AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_PAL)) || pix_fmt == AV_PIX_FMT_MONOBLACK || pix_fmt == AV_PIX_FMT_MONOWHITE; } diff --git a/tests/ref/fate/sws-pixdesc-query b/tests/ref/fate/sws-pixdesc-query index c3cccfa492..42e82389af 100644 --- a/tests/ref/fate/sws-pixdesc-query +++ b/tests/ref/fate/sws-pixdesc-query @@ -570,6 +570,7 @@ AnyRGB: gbrpf32le monob monow + pal8 rgb0 rgb24 rgb32