[{"id":19215,"web_url":"https://patchwork.libcamera.org/comment/19215/","msgid":"<20210831103551.esiz7yfypi4dwebg@uno.localdomain>","date":"2021-08-31T10:35:51","subject":"Re: [libcamera-devel] [PATCH 2/5] android: jpeg: thumbnailer: Use\n\tMappedFrameBuffer::planes()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Hiro,\n\nOn Tue, Aug 31, 2021 at 03:34:35PM +0900, Hirokazu Honda wrote:\n> Thumbnailer gets the address of NV12 UV Plane by computing the\n> first plane size. MappedFrameBuffer::planes() returns the plane\n> address. This replaces the address computation with\n> MappedFrameBuffer::planes() in Thumbnailer.\n>\n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> ---\n>  src/android/jpeg/thumbnailer.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/android/jpeg/thumbnailer.cpp b/src/android/jpeg/thumbnailer.cpp\n> index 043c7b33..fe2c4969 100644\n> --- a/src/android/jpeg/thumbnailer.cpp\n> +++ b/src/android/jpeg/thumbnailer.cpp\n> @@ -63,7 +63,7 @@ void Thumbnailer::createThumbnail(const FrameBuffer &source,\n>\n>  \t/* Image scaling block implementing nearest-neighbour algorithm. */\n>  \tunsigned char *src = static_cast<unsigned char *>(frame.planes()[0].data());\n> -\tunsigned char *srcC = src + sh * sw;\n> +\tunsigned char *srcC = static_cast<unsigned char *>(frame.planes()[1].data());\n\nI am not sure I really understand the thumbnailer code, but this seems\nsane.\n\nAssuming the new srcC value is the same as the old one\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n>  \tunsigned char *srcCb, *srcCr;\n>  \tunsigned char *dstY, *srcY;\n>\n> --\n> 2.33.0.259.gc128427fd7-goog\n>","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 189B4BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 31 Aug 2021 10:35:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6AC356916A;\n\tTue, 31 Aug 2021 12:35:03 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3AA3368890\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 31 Aug 2021 12:35:02 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id B243424000B;\n\tTue, 31 Aug 2021 10:35:01 +0000 (UTC)"],"Date":"Tue, 31 Aug 2021 12:35:51 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<20210831103551.esiz7yfypi4dwebg@uno.localdomain>","References":"<20210831063438.785767-1-hiroh@chromium.org>\n\t<20210831063438.785767-3-hiroh@chromium.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210831063438.785767-3-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH 2/5] android: jpeg: thumbnailer: Use\n\tMappedFrameBuffer::planes()","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19234,"web_url":"https://patchwork.libcamera.org/comment/19234/","msgid":"<YS6b6ddP9P9UxmCy@pendragon.ideasonboard.com>","date":"2021-08-31T21:15:21","subject":"Re: [libcamera-devel] [PATCH 2/5] android: jpeg: thumbnailer: Use\n\tMappedFrameBuffer::planes()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nThank you for the patch.\n\nOn Tue, Aug 31, 2021 at 12:35:51PM +0200, Jacopo Mondi wrote:\n> On Tue, Aug 31, 2021 at 03:34:35PM +0900, Hirokazu Honda wrote:\n> > Thumbnailer gets the address of NV12 UV Plane by computing the\n> > first plane size. MappedFrameBuffer::planes() returns the plane\n> > address. This replaces the address computation with\n> > MappedFrameBuffer::planes() in Thumbnailer.\n> >\n> > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > ---\n> >  src/android/jpeg/thumbnailer.cpp | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/src/android/jpeg/thumbnailer.cpp b/src/android/jpeg/thumbnailer.cpp\n> > index 043c7b33..fe2c4969 100644\n> > --- a/src/android/jpeg/thumbnailer.cpp\n> > +++ b/src/android/jpeg/thumbnailer.cpp\n> > @@ -63,7 +63,7 @@ void Thumbnailer::createThumbnail(const FrameBuffer &source,\n> >\n> >  \t/* Image scaling block implementing nearest-neighbour algorithm. */\n> >  \tunsigned char *src = static_cast<unsigned char *>(frame.planes()[0].data());\n> > -\tunsigned char *srcC = src + sh * sw;\n> > +\tunsigned char *srcC = static_cast<unsigned char *>(frame.planes()[1].data());\n> \n> I am not sure I really understand the thumbnailer code, but this seems\n> sane.\n> \n> Assuming the new srcC value is the same as the old one\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nIt looks much nicer, happy to see the mapped frame buffer API making the\ncode cleaner.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >  \tunsigned char *srcCb, *srcCr;\n> >  \tunsigned char *dstY, *srcY;\n> >","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 17A49BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 31 Aug 2021 21:15:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7199D6916A;\n\tTue, 31 Aug 2021 23:15:37 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9B98568890\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 31 Aug 2021 23:15:36 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2062E24F;\n\tTue, 31 Aug 2021 23:15:36 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CLTRccdR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630444536;\n\tbh=GXDfsCt3ASpYm64QFOoFmuLjm/Qdv6jjL55RKnAkWms=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=CLTRccdR09IZ2UH1Gf3f61j4DCa6tG+RO7Xq/wKgzuxQQy7/ChkuPH8Ciaf4nlu/j\n\tOwhT8/v+xWPaT0zYrSgtP0dbpEp4iK7iLVb5CNkIQ9ISu/dI6CVofPLSACHeYK8320\n\t1qNUuv2ozgxAq1ZIXrNHijAbm//jXcN7dblSagQo=","Date":"Wed, 1 Sep 2021 00:15:21 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YS6b6ddP9P9UxmCy@pendragon.ideasonboard.com>","References":"<20210831063438.785767-1-hiroh@chromium.org>\n\t<20210831063438.785767-3-hiroh@chromium.org>\n\t<20210831103551.esiz7yfypi4dwebg@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210831103551.esiz7yfypi4dwebg@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH 2/5] android: jpeg: thumbnailer: Use\n\tMappedFrameBuffer::planes()","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]