From patchwork Mon Nov 9 21:34:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 10397 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E7283BE082 for ; Mon, 9 Nov 2020 21:34:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6E8536308E; Mon, 9 Nov 2020 22:34:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="tBuvMSWr"; dkim-atps=neutral Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0832E62D3E for ; Mon, 9 Nov 2020 22:34:31 +0100 (CET) Received: by mail-lj1-x232.google.com with SMTP id l10so12224953lji.4 for ; Mon, 09 Nov 2020 13:34:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=njStWOL5mn9WsqBQs0rTEZQXny5yw2+wmBiFhoCNemU=; b=tBuvMSWr8pRdEfgxCBkuahdzUDWO0Cfd3dGLugc0Ho/aWU2bGrcxcBF74ejD50aSX9 tZ0Ac3SQQnko46+6+wTKvK6FK/cuEt5JErjyGK44xxmZafNkzSL4AyhWkz94AtFS8Fpb Amq/uzDQi2DwOQB9MhKlxQ6kw4bYZ2Bv71WT+Yf0tUeVmjd4FFKSrk5Jl2y5jS+VewWh lJ7x+xgHG//yFyeqLnHkgqtqRsMG1tujH8znGScNBPn9nPqqOwrjKkgxNZB7aoVUkDVX RyhACNDJcW0TmSWe8dr77xLuiSXkfDN22tKbGqyeMXhbydfUTm/xzH+mcq+Gdj6BHFxt HsgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=njStWOL5mn9WsqBQs0rTEZQXny5yw2+wmBiFhoCNemU=; b=q4xB1ah93jX1g1zERduhPJkoBEI7oIMXCi9VDhABKFBCoEvv7sAL9Bv0F6Rb2t0ZfY qu7drg5Fyfrkgc4j4ryTInTEIjK2yVOsAMEllWjxmK9ZXMB2rxe9zk5+bWh0yT+IwS2+ tFU4TFMOi/xtnoBctrH45QfCObUgt35rxv703Ij0JGpmASw6I3PqsFPgVASPvPWW0W2r y+2NlBI6LWHzfRLZBh8AUVE6QClmUZA6CAGY6uAgt70+IoBoHqNvJyjP9Zuslqkcc/V+ 56eyWaOGxaxYyXOWIBnAyW46V8EE0noaHqKL6h+KJooeHYZWIxZbi/HtkyA5njOlF7h4 LJsg== X-Gm-Message-State: AOAM532yQK/n+fJj6n/fhApJuFwaDL3cl9BJevhv8FBe0b/7HH0lePmz H45TprIyjGcIF32N2G/S0DBrouDt1acIfw== X-Google-Smtp-Source: ABdhPJz5s2Vi29NO57STp1N4amR9akXFyjEu+W7oRB4TPKhrgHVWC2zZS2hImuLMdAxuaglo0ez29w== X-Received: by 2002:a2e:8008:: with SMTP id j8mr2308286ljg.452.1604957669538; Mon, 09 Nov 2020 13:34:29 -0800 (PST) Received: from localhost.localdomain ([85.249.41.73]) by smtp.googlemail.com with ESMTPSA id c1sm1375986lfj.222.2020.11.09.13.34.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 13:34:28 -0800 (PST) From: Andrey Konovalov To: libcamera-devel@lists.libcamera.org Date: Tue, 10 Nov 2020 00:34:09 +0300 Message-Id: <20201109213411.30987-1-andrey.konovalov@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [libcamera-devel] [PATCH][RFC 0/2] qcam: viewfinder_gl: add RAW12P format support X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This patchset adds support for OpenGL accelerated conversion from 12-bit packed raw Bayer format (debyering). All the 4 pixel layouts are supported, but only the RGGB one was tested. The lower 4 bits of the 12-bit colour values are discarded as the target RGBA format has only 8 bits per colour. viewfinder_gl not only converts the format, but also scales the image to match the window size, and this doesn't go very well with debayering when done as single operation - there is a chance of 1-pixel wide contrast coloured stripes when the window size isn't of the same size as the captured frames. Andrey Konovalov (2): qcam: viewfinder_gl: set the vertex shader file name in selectFormat() qcam: viewfinder_gl: Add shader to render packed RAW12 formats src/qcam/assets/shader/bayer.vert | 28 ++++++++ src/qcam/assets/shader/bayer_12_packed.frag | 68 ++++++++++++++++++ src/qcam/assets/shader/shaders.qrc | 2 + src/qcam/viewfinder_gl.cpp | 78 ++++++++++++++++++++- src/qcam/viewfinder_gl.h | 8 +++ 5 files changed, 181 insertions(+), 3 deletions(-) create mode 100644 src/qcam/assets/shader/bayer.vert create mode 100644 src/qcam/assets/shader/bayer_12_packed.frag