Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Ultra HDR
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Android 14 hỗ trợ chụp hình ảnh nén Ultra HDR bằng định dạng hình ảnh JPEG_R
. Định dạng này tương thích ngược với hình ảnh JPEG SDR và hỗ trợ kết xuất nội dung HDR.
Để biết thông tin chi tiết về thông số kỹ thuật của định dạng Ultra HDR, hãy xem nội dung Định dạng hình ảnh Ultra HDR phiên bản 1.0.
Triển khai
Phần này mô tả cách triển khai tính năng Ultra HDR.
Triển khai tham chiếu
Khung máy ảnh và dịch vụ máy ảnh AOSP bao gồm cách triển khai tham chiếu Ultra HDR.
Ngoài chức năng tham chiếu trong khung máy ảnh, bạn có thể triển khai Ultra HDR trong HAL máy ảnh và quảng cáo tính năng hỗ trợ đầu ra JPEG_R
giống như các luồng đầu ra HAL máy ảnh khác. Trong trường hợp này, HAL của máy ảnh phải tạo bản đồ khôi phục cần thiết và hình ảnh JPEG_R
cuối cùng theo định nghĩa của thông số kỹ thuật Ultra HDR.
Bạn có thể tối ưu hoá và điều chỉnh đầu ra cuối cùng tuỳ thuộc vào phần cứng và chức năng phần mềm của thiết bị.
Các cách triển khai
Nhà sản xuất thiết bị có thể quyết định các cấp độ hỗ trợ Ultra HDR sau đây cho thiết bị của họ:
- Tối thiểu: Trong cấu hình này, đầu ra Ultra HDR thông qua chức năng luồng kết hợp dịch vụ máy ảnh sẽ bị tắt theo mặc định. Để bật tính năng triển khai tham chiếu
JpegRCompositeStream
, hãy đặt thuộc tính hệ thống ro.camera.enableCompositeAPI0JpegR
thành true
. Vì tất cả các quy trình và quá trình mã hoá đều được thực hiện trong phần mềm, nên tuỳ chọn này có thể làm tăng độ trễ và giảm hiệu suất.
- Trung bình: Với tuỳ chọn này, quá trình triển khai
JpegRCompositeStream
sử dụng tệp JPEG SDR do HAL cung cấp làm hình ảnh cơ sở và khung P010 để tính toán bản đồ khôi phục. Tuỳ chọn này liên quan đến việc xử lý phần mềm trong đường dẫn dữ liệu nhưng tương đối nhỏ so với tuỳ chọn tối thiểu.
- Mở rộng: HAL máy ảnh quảng cáo và hỗ trợ trực tiếp luồng đầu ra
JPEG_R
. Tuỳ chọn này cho phép nhà sản xuất thiết bị triển khai các hoạt động tối ưu hoá dành riêng cho thiết bị và có thể cải thiện đáng kể chất lượng hình ảnh.
Để tắt hoạt động triển khai JpegRCompositeStream
, hãy đặt thuộc tính bản dựng ro.camera.disableJpegR
thành true
. Nếu bạn không đặt hoặc đặt thuộc tính bản dựng này thành false
, thì Ultra HDR sẽ được bật theo mặc định thông qua JpegRCompositeStream
trên các thiết bị hỗ trợ khả năng đầu ra 10 bit và quay đồng thời 10 và 8 bit.
Xác nhận kết quả
Để xác thực tính năng Ultra HDR trên thiết bị, hãy chạy các chương trình kiểm thử sau.
Kiểm thử CTS
Kiểm thử ITS
Bài kiểm tra thủ công
Để thực hiện kiểm thử thủ công, hãy sử dụng phương thức triển khai mẫu để chụp ảnh Ultra HDR, bao gồm cả tính năng hỗ trợ cấu hình và chụp Ultra HDR bằng định dạng hình ảnh JPEG_R
.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# Ultra HDR\n\nAndroid 14 provides support for capturing Ultra HDR\ncompressed images using the\n[`JPEG_R`](https://developer.android.com/reference/kotlin/android/graphics/ImageFormat#jpeg_r)\nimage format. This format is backward compatible with SDR JPEG images and\nsupports HDR rendering of content.\nFor details about the Ultra HDR format specification, see\n[Ultra HDR Image Format v1.0](https://developer.android.com/guide/topics/media/hdr-image-format).\n\nImplementation\n--------------\n\nThis section describes how to implement the Ultra HDR feature.\n\n### Reference implementation\n\nThe AOSP camera framework and camera service includes a reference Ultra HDR\nimplementation.\n\nIn addition to the reference functionality in the camera framework, you can\nimplement Ultra HDR within the camera HAL and advertise support for `JPEG_R`\noutput in the same way as other camera HAL output streams. In this scenario,\nthe camera HAL must generate the necessary recovery map and the final `JPEG_R`\nimage as defined by the\n[Ultra HDR specification](https://developer.android.com/guide/topics/media/hdr-image-format#introduction).\nYou can optimize and tune the final output depending on the device hardware\nand software capabilities.\n\n### Implementation options\n\nDevice manufacturers can decide on the following levels of Ultra HDR support for\ntheir devices:\n\n- **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 the `ro.camera.enableCompositeAPI0JpegR` system property to `true`. Because all processes and encoding is performed in software, this option can result in increased latency and decreased performance.\n- **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.\n- **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.\n\nTo disable the `JpegRCompositeStream` implementation, set the\n`ro.camera.disableJpegR` build property to `true`. If this build property isn't\nset or is set to `false`, Ultra HDR is enabled by default through\n`JpegRCompositeStream` on devices supporting\n[10-bit output capability](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT)\nand\n[concurrent 10 and 8-bit capture](https://developer.android.com/reference/android/hardware/camera2/params/DynamicRangeProfiles#getProfileCaptureRequestConstraints(long)).\n\nValidation\n----------\n\nTo validate the Ultra HDR feature on your device, run the following tests.\n\n### CTS tests\n\n- [`ImageReaderTest.java#testImageReaderBuilderWithBLOBAndJpegR`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java#815)\n- [`ImageReaderTest.java#testJpegR`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java#503)\n- [`ImageReaderTest.java#testJpegRDisplayP3`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java#526)\n- [`PerformanceTest.java#testSingleCapture`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/PerformanceTest.java#313)\n- [`StillCaptureTest.java# testJpegRCapture`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java#192)\n\n### ITS tests\n\n- [`scene4#test_aspect_ratio_and_crop`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/apps/CameraITS/tests/scene4/test_aspect_ratio_and_crop.py)\n\n### Manual tests\n\nTo perform manual tests, use the\n[sample implementation for Ultra HDR image capture](https://github.com/android/platform-samples/pull/56),\nwhich includes support for the configuration and capture of Ultra HDR using the\n`JPEG_R` image format."]]