Android 14 provides support for capturing Ultra HDR
compressed images using the
JPEG_R
image format. This format is backward compatible with SDR JPEG images and
supports HDR rendering of content.
For details about the Ultra HDR format specification, see
Ultra HDR Image Format v1.0.
Implementation
This section describes how to implement the Ultra HDR feature.
Reference implementation
The AOSP camera framework and camera service includes a reference Ultra HDR implementation.
In addition to the reference functionality in the camera framework, you can
implement Ultra HDR within the camera HAL and advertise support for JPEG_R
output in the same way as other camera HAL output streams. In this scenario,
the camera HAL must generate the necessary recovery map and the final JPEG_R
image as defined by the
Ultra HDR specification.
You can optimize and tune the final output depending on the device hardware
and software capabilities.
Implementation options
Device manufacturers can decide on the following levels of Ultra HDR support for their devices:
- Minimal: In this configuration, Ultra HDR output through the camera
service composite stream functionality is disabled by default. To enable the
JpegRCompositeStream
reference implementation, set thero.camera.enableCompositeAPI0JpegR
system property totrue
. Because all processes and encoding is performed in software, this option can result in increased latency and decreased performance. - Moderate: With this option, the
JpegRCompositeStream
implementation uses a HAL-provided SDR JPEG file as a base image and a P010 frame to calculate a recovery map. This option involves software processing within the data path but is relatively minor compared to the minimal option. - Extensive: The camera HAL advertises and supports the
JPEG_R
output stream directly. This option lets device manufacturers implement device-specific optimizations and can provide significant image quality improvements.
To disable the JpegRCompositeStream
implementation, set the
ro.camera.disableJpegR
build property to true
. If this build property isn't
set or is set to false
, Ultra HDR is enabled by default through
JpegRCompositeStream
on devices supporting
10-bit output capability
and
concurrent 10 and 8-bit capture.
Validation
To validate the Ultra HDR feature on your device, run the following tests.
CTS tests
ImageReaderTest.java#testImageReaderBuilderWithBLOBAndJpegR
ImageReaderTest.java#testJpegR
ImageReaderTest.java#testJpegRDisplayP3
PerformanceTest.java#testSingleCapture
StillCaptureTest.java# testJpegRCapture
ITS tests
Manual tests
To perform manual tests, use the
sample implementation for Ultra HDR image capture,
which includes support for the configuration and capture of Ultra HDR using the
JPEG_R
image format.