[libcamera-devel] [RFC] Basic image scaler for NV12 format

Umang Jain email at uajain.com
Tue Sep 22 10:54:43 CEST 2020


Hi all,

Continuing my work on EXIF metadata support for android HAL,
following patch is an image scaler for thumbnail generation
that would be embedded as a part of the EXIF metadata.

Initially when I started out, I tried to make the scaler as
generic interface to handle different image formats but it
quickly turned complex for me. Hence, I focused on a tight
combination (from NV12 input to RGB output) because that's
what is needed from EXIF's thumbnail PoV. If you think there
might be more use-cases, I would be glad to know your thoughts
and tips on how to structure this work.

There might be a few blobs of helper code in the patch. The
scaled pixels were pushed out to a file in /tmp/ for inspection.
(So those parts can skipped as part of review).
The frames were captured using Kieran's work on vivid pipeline
and JPEG frame sink. A build/test version of the  branch exists here:
https://github.com/uajain/libcamera/commits/uajain/exif-scaler-NV12-tester


Umang Jain (1):
  android: jpeg: Add a basic NV12 image scaler

 src/android/jpeg/encoder_libjpeg.cpp |  10 ++
 src/android/jpeg/scaler.cpp          | 137 +++++++++++++++++++++++++++
 src/android/jpeg/scaler.h            |  32 +++++++
 src/android/meson.build              |   1 +
 4 files changed, 180 insertions(+)
 create mode 100644 src/android/jpeg/scaler.cpp
 create mode 100644 src/android/jpeg/scaler.h

-- 
2.25.1



More information about the libcamera-devel mailing list