diff options
author | Harvey Yang <chenghaoyang@chromium.org> | 2023-02-08 03:33:19 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-02-10 00:47:42 +0200 |
commit | 2403f5141f002be70c94f182e0774f257bb4ee11 (patch) | |
tree | 1dbcf8fd6e1156f31e52180b8a14e7980eccf10a /src/android/jpeg/encoder_jea.h | |
parent | 8702b9dac7bc3785102153a3b95085db01df17f9 (diff) |
android: jpeg: Add JEA implementation
This patch adds JEA implementation to replace libjpeg in CrOS platform,
where hardware accelerator is available.
Signed-off-by: Harvey Yang <chenghaoyang@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/jpeg/encoder_jea.h')
-rw-r--r-- | src/android/jpeg/encoder_jea.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/android/jpeg/encoder_jea.h b/src/android/jpeg/encoder_jea.h new file mode 100644 index 00000000..ffe9df27 --- /dev/null +++ b/src/android/jpeg/encoder_jea.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2022, Google Inc. + * + * encoder_jea.h - JPEG encoding using CrOS JEA + */ + +#pragma once + +#include <libcamera/geometry.h> + +#include <cros-camera/jpeg_compressor.h> + +#include "encoder.h" + +class EncoderJea : public Encoder +{ +public: + EncoderJea(); + ~EncoderJea(); + + int configure(const libcamera::StreamConfiguration &cfg) override; + int encode(Camera3RequestDescriptor::StreamBuffer *buffer, + libcamera::Span<const uint8_t> exifData, + unsigned int quality) override; + +private: + libcamera::Size size_; + + std::unique_ptr<cros::JpegCompressor> jpegCompressor_; +}; |