From patchwork Wed Oct 21 08:08:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 10157 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 060A1C3D3C for ; Wed, 21 Oct 2020 08:08:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 84EA360352; Wed, 21 Oct 2020 10:08:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="HRmXDGYG"; dkim-atps=neutral Received: from mail.uajain.com (static.126.159.217.95.clients.your-server.de [95.217.159.126]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F133A60352 for ; Wed, 21 Oct 2020 10:08:15 +0200 (CEST) From: Umang Jain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail; t=1603267695; bh=c+FBmRgsN1r6Gb3ji55Fx0pjRGSAG6+IW66c3p2Mnxw=; h=From:To:Cc:Subject; b=HRmXDGYGi+ru9R9//PSn4iwGno6LfBtIRtFhpCYp5KgHzEusZLrt6+NkmCup1u+9D ZPsZ5+ZZN/AzIoQKqv2c1wFi1Uzkh/WKu2fgk88DSuKrl7EqK8qCBJ6WccYcSgB/2d aZ7fbLkKmRItINs6fbQHTB5JG+WeZmU9zuqhrURhePlhGyy6XfegK5TUzdUVUU5MgJ TPezov63J9yESxUk8HoPmrp86o1YpwgOvKzopTJmLIQ4sso4VaJwntFvbCHmb9Qonp aiMacZXzf1O4rbV4+kcCKL0rR9TS0Aa0RcaslAMBDQqItVYBpx+BlmmtFqwiHpfvzN AnG2qss5jBYyg== To: libcamera-devel@lists.libcamera.org Date: Wed, 21 Oct 2020 13:38:04 +0530 Message-Id: <20201021080806.46636-1-email@uajain.com> Mime-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 0/2] andriod: Basic NV12 thumbnailer 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" Still RFC as couple of \todos still pending to get address; partly which I need help with in order to know what should be the forward path from here on. One of the hurdle after writing the thumbnailer component was to use the existing encoder to compress it. The encoder uses FrameBuffer parameter to encode as of now. The result of thumbnailer is raw bytes, so either we need to get a FrameBuffer/MappedFrameBuffer instance created out of those raw bytes(which seems difficult) OR make the encoder flexible enough so that we can encode directly from bytes. Patch 1/2 implements the latter (discussed with Kieran last week). Coming to patch 2/2, is the thumbnailer which is generated and compressed in the PostProcessorJpeg layer. How would we embed this in the Exif data, is still the missing piece of the puzzle. I am still unsure where I should (thumnail + compress) in PostProcessor layer or the Encoder layer. Both these places has it's own set of challenges according to me. Please refer to the \todo and see if you can help me with any ideas. (The actual thumbnailer(.cpp / .h) has been reviewed before and I might have not addressed all the comments from it. Although there a few changes in there, I will make sure that the reviews are addressed when I'll submit a non-RFC version). Thanks! Umang Jain (2): android: jpeg: encoder_libjpeg Allow encoding raw frame bytes android: jpeg: Add a basic NV12 image thumbnailer src/android/jpeg/encoder_libjpeg.cpp | 37 +++++---- src/android/jpeg/encoder_libjpeg.h | 7 +- src/android/jpeg/post_processor_jpeg.cpp | 39 +++++++++ src/android/jpeg/post_processor_jpeg.h | 3 + src/android/jpeg/thumbnailer.cpp | 100 +++++++++++++++++++++++ src/android/jpeg/thumbnailer.h | 40 +++++++++ src/android/meson.build | 1 + 7 files changed, 211 insertions(+), 16 deletions(-) create mode 100644 src/android/jpeg/thumbnailer.cpp create mode 100644 src/android/jpeg/thumbnailer.h