{"id":13572,"url":"https://patchwork.libcamera.org/api/1.1/patches/13572/?format=json","web_url":"https://patchwork.libcamera.org/patch/13572/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210831063438.785767-2-hiroh@chromium.org>","date":"2021-08-31T06:34:34","name":"[libcamera-devel,1/5] android: yuv: Use CameraBuffer::stride() in PostProcessorYuv","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"11775a34ce68288ccc7beb8612ecc39097d7621c","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/1.1/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13572/mbox/","series":[{"id":2423,"url":"https://patchwork.libcamera.org/api/1.1/series/2423/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2423","date":"2021-08-31T06:34:33","name":"Improve/Clean up post processors code in android","version":1,"mbox":"https://patchwork.libcamera.org/series/2423/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13572/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13572/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8FEE2BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 31 Aug 2021 06:35:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4EBFB69170;\n\tTue, 31 Aug 2021 08:35:08 +0200 (CEST)","from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com\n\t[IPv6:2607:f8b0:4864:20::102f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0A3D669166\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 31 Aug 2021 08:35:06 +0200 (CEST)","by mail-pj1-x102f.google.com with SMTP id j1so11097478pjv.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Aug 2021 23:35:05 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:3c62:aba4:18ea:5441])\n\tby smtp.gmail.com with ESMTPSA id\n\td17sm16304027pfn.110.2021.08.30.23.35.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 30 Aug 2021 23:35:03 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"kj1DizGk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=3k3ExmsDADITCkoKoVxB6HQlr2nUSFrjo/RKrh85abo=;\n\tb=kj1DizGkPBg20cfkuiEPrdADt3O9UFlhkNvUJgLo57vpUVH1rI9GwB74WVuFrRMK6Z\n\tc4FR5v10ixF8arZomrfFedUdmEa/Wj9spcx9EpjRQwLquO/DROIWqlSHTWp5yyiSSvIz\n\tX7O6Zdg62O6t8OVU4+sy92u+7b5vhN4Lr+xcQ=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=3k3ExmsDADITCkoKoVxB6HQlr2nUSFrjo/RKrh85abo=;\n\tb=Nq1yA6KJUbKZ1w0ewO+yC03tUtF3IxVKsvhvXZdK3oBCu0iV2qxVE4hhYZAhzf5b4H\n\tN1eZPCz/9gncCujzcUjv3dOu1lSapkA91UFRwR+AtkeR6FIr5z4qIxTk1XWyv8mATaeI\n\tY8P/45FXLczXiQSSkPdSKm/ve7ISw+A1Pv+AsBSrAKZitnBaBACNt90Wmzz1WkH9IbGH\n\tNHp7Z0Mg00Yp1OouS2aheM5uHG/8zEAAWSJy4H9JSJJiiG0Li3v2MM7FXiQulFSl9mj3\n\tWBNN24lBt1UL4ihCCamPtHCAMtRNIlvAOQnYUaIOzKTZFFPrCv8KhOeQvl3Dyg0pGuWg\n\tRjQQ==","X-Gm-Message-State":"AOAM5326cu72oGX3bsCoJIKhcpP6BiFQnGy9GrcjWcvNxpO3pnoKVdFM\n\tdlO66STTzs5CRl2SdqIfLehsEqHbez7o2w==","X-Google-Smtp-Source":"ABdhPJzjO/H70wQsQYk1FhSiX/M/CsCA9g89+UhTj1yE3GLrKr8SziIzjlrtarJl0ftt+2nHulwDIg==","X-Received":"by 2002:a17:90a:44:: with SMTP id\n\t4mr3463079pjb.130.1630391704276; \n\tMon, 30 Aug 2021 23:35:04 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 31 Aug 2021 15:34:34 +0900","Message-Id":"<20210831063438.785767-2-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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/5] android: yuv: Use\n\tCameraBuffer::stride() in PostProcessorYuv","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"PostProcessorYuv computes strides for a CameraBuffer. CameraBuffer has\nstride() function. This replaces the computation with the function.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/yuv/post_processor_yuv.cpp | 13 +++++++------\n src/android/yuv/post_processor_yuv.h   |  1 -\n 2 files changed, 7 insertions(+), 7 deletions(-)","diff":"diff --git a/src/android/yuv/post_processor_yuv.cpp b/src/android/yuv/post_processor_yuv.cpp\nindex 6952fc38..12d6297d 100644\n--- a/src/android/yuv/post_processor_yuv.cpp\n+++ b/src/android/yuv/post_processor_yuv.cpp\n@@ -69,9 +69,9 @@ int PostProcessorYuv::process(const FrameBuffer &source,\n \t\t\t\t    sourceStride_[1],\n \t\t\t\t    sourceSize_.width, sourceSize_.height,\n \t\t\t\t    destination->plane(0).data(),\n-\t\t\t\t    destinationStride_[0],\n+\t\t\t\t    destination->stride(0),\n \t\t\t\t    destination->plane(1).data(),\n-\t\t\t\t    destinationStride_[1],\n+\t\t\t\t    destination->stride(1),\n \t\t\t\t    destinationSize_.width,\n \t\t\t\t    destinationSize_.height,\n \t\t\t\t    libyuv::FilterMode::kFilterBilinear);\n@@ -115,8 +115,8 @@ bool PostProcessorYuv::isValidBuffers(const FrameBuffer &source,\n \t\t\t<< destination.plane(0).size() << \", \"\n \t\t\t<< destination.plane(1).size()\n \t\t\t<< \"}, expected size: {\"\n-\t\t\t<< sourceLength_[0] << \", \"\n-\t\t\t<< sourceLength_[1] << \"}\";\n+\t\t\t<< destinationLength_[0] << \", \"\n+\t\t\t<< destinationLength_[1] << \"}\";\n \t\treturn false;\n \t}\n \n@@ -132,13 +132,14 @@ void PostProcessorYuv::calculateLengths(const StreamConfiguration &inCfg,\n \tconst PixelFormatInfo &nv12Info = PixelFormatInfo::info(formats::NV12);\n \tfor (unsigned int i = 0; i < 2; i++) {\n \t\tsourceStride_[i] = inCfg.stride;\n-\t\tdestinationStride_[i] = nv12Info.stride(destinationSize_.width, i, 1);\n+\t\tconst unsigned int destinationStride =\n+\t\t\tnv12Info.stride(destinationSize_.width, i, 1);\n \n \t\tconst unsigned int vertSubSample =\n \t\t\tnv12Info.planes[i].verticalSubSampling;\n \t\tsourceLength_[i] = sourceStride_[i] *\n \t\t\t((sourceSize_.height + vertSubSample - 1) / vertSubSample);\n-\t\tdestinationLength_[i] = destinationStride_[i] *\n+\t\tdestinationLength_[i] = destinationStride *\n \t\t\t((destinationSize_.height + vertSubSample - 1) / vertSubSample);\n \t}\n }\ndiff --git a/src/android/yuv/post_processor_yuv.h b/src/android/yuv/post_processor_yuv.h\nindex f8b1ba23..1a0b5e89 100644\n--- a/src/android/yuv/post_processor_yuv.h\n+++ b/src/android/yuv/post_processor_yuv.h\n@@ -36,7 +36,6 @@ private:\n \tunsigned int sourceLength_[2] = {};\n \tunsigned int destinationLength_[2] = {};\n \tunsigned int sourceStride_[2] = {};\n-\tunsigned int destinationStride_[2] = {};\n };\n \n #endif /* __ANDROID_POST_PROCESSOR_YUV_H__ */\n","prefixes":["libcamera-devel","1/5"]}