From patchwork Tue Aug 31 06:34:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13573 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 41114BD87D for ; Tue, 31 Aug 2021 06:35:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0426669176; Tue, 31 Aug 2021 08:35:10 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bq1qarvb"; dkim-atps=neutral Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9EAB960137 for ; Tue, 31 Aug 2021 08:35:07 +0200 (CEST) Received: by mail-pj1-x102b.google.com with SMTP id d3-20020a17090ae28300b0019629c96f25so1646074pjz.2 for ; Mon, 30 Aug 2021 23:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Oi7VNQOpVLdn4SHrGSxhRVEEm/yhbmfU+hI02STYM+s=; b=bq1qarvbyTuSIm5KQ4B3mI5wMMgXVcaY+e0G2rt1IMBz+SgQQDqEH40//Vk2aV1nrC hkWIb7F2rYa2+9k8fO8cviG+aPkrs5q/wygYNHt5AUyAS62GCe0JI6f+Kf5Oip08WScg ZJQegB5dSjolGPcdWL9kp+OMPny8wiLoi2KRE= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Oi7VNQOpVLdn4SHrGSxhRVEEm/yhbmfU+hI02STYM+s=; b=ocTNAn3RQQJS4h0rNVA/h8emt9KTgKRf1BpPC/+Tc2JDDFawOOpE2hoU6Hd3M3sF3O cy5zOqwgvHrA348tYfUR8ExrLOfBJ541GhaM2y2OCphH6lUdjvIJWq3qA/mT05PAVRIV dCfI2/T8tCrSX4ZrIvjBURL9SG1/lgEEuPDa7Buyy0EmiqwcdV4imffnH9bz54mG2yEg MR1KK8Q3oV8xFQtTiHItYIUZpPqWrxOHGtIdX75Tnqc/doGLbnkjdx6lXyZpawqykEXc 6E7KsPzEpGSsu6RQn57vBITabqMYn5UlE+lgGuvcDJyoal2Xt9Peh4erL8/S+JCEgTNy 6BDg== X-Gm-Message-State: AOAM530J9yNYa9BDNF+YABb4FrMuHfsOEFXuB2iRnACWZbFKX940XgHy eWxGgow6QGKe97bgPX1UtDpgrUuSTHIMtQ== X-Google-Smtp-Source: ABdhPJwOTWPktF57eEcScbSlqhn7hoUXmUg/16HbJAgKE0BKP1f1EqCy4gHyLBPo1+ygPrP+W7B55g== X-Received: by 2002:a17:902:724b:b0:131:ab33:1e4e with SMTP id c11-20020a170902724b00b00131ab331e4emr3251131pll.12.1630391705860; Mon, 30 Aug 2021 23:35:05 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:3c62:aba4:18ea:5441]) by smtp.gmail.com with ESMTPSA id d17sm16304027pfn.110.2021.08.30.23.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Aug 2021 23:35:05 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 31 Aug 2021 15:34:35 +0900 Message-Id: <20210831063438.785767-3-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.259.gc128427fd7-goog In-Reply-To: <20210831063438.785767-1-hiroh@chromium.org> References: <20210831063438.785767-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/5] android: jpeg: thumbnailer: Use MappedFrameBuffer::planes() 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Thumbnailer gets the address of NV12 UV Plane by computing the first plane size. MappedFrameBuffer::planes() returns the plane address. This replaces the address computation with MappedFrameBuffer::planes() in Thumbnailer. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/android/jpeg/thumbnailer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/jpeg/thumbnailer.cpp b/src/android/jpeg/thumbnailer.cpp index 043c7b33..fe2c4969 100644 --- a/src/android/jpeg/thumbnailer.cpp +++ b/src/android/jpeg/thumbnailer.cpp @@ -63,7 +63,7 @@ void Thumbnailer::createThumbnail(const FrameBuffer &source, /* Image scaling block implementing nearest-neighbour algorithm. */ unsigned char *src = static_cast(frame.planes()[0].data()); - unsigned char *srcC = src + sh * sw; + unsigned char *srcC = static_cast(frame.planes()[1].data()); unsigned char *srcCb, *srcCr; unsigned char *dstY, *srcY;