Android 10을 실행하는 기기는 ISO/IEC 23008-12에 명시된 고효율 이미지 파일 형식(HEIF)의 고효율 동영상 인코딩(HEVC) 관련 브랜드인 HEIC 압축 이미지 형식을 지원합니다.
HEIC로 인코딩된 이미지는 JPEG 파일에 비해 더 작은 파일 크기로 더 뛰어난 이미지 품질을 제공합니다.
HEIC 이미지는 카메라 HAL에서 압축되지 않은 이미지를 요청하고 HEIC 또는 HEVC 인코더에서 이 이미지를 인코딩하도록 미디어 하위 시스템에 전송하는 카메라 프레임워크에 의해 생성됩니다.
기기에서 HEIC 이미지 형식을 지원하려면 HEIC/HEVC 코덱을 구현하고 필수 스트림(IMPLEMENTATION_DEFINED/YUV 스트림 및 JPEG 앱 세그먼트 스트림) 구성을 지원해야 합니다.
미디어
다음과 같이 HEIC/HEVC 코덱을 하드웨어의 지속 품질(CQ) 모드로 구현합니다.
HEVC 유형 코덱은 이미지 크기에 따라 GRALLOC_USAGE_HW_VIDEO_ENCODER를 사용한 IMPLEMENTATION_DEFINED 형식 또는 HAL_PIXEL_FORMAT_YCBCR_420_888 형식을 사용합니다.
HEIC 유형 코덱은 GRALLOC_USAGE_HW_IMAGE_ENCODER를 사용한 IMPLEMENTATION_DEFINED 형식을 사용합니다.
카메라
정적 메타데이터에서 ANDROID_HEIC_INFO_SUPPORTED를 true로, ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT를 [1, 16] 사이의 값으로 설정하여 JPEG 앱 세그먼트의 수를 나타냅니다.
각 필수 스트림 조합의 경우 카메라 기기는 JPEG 스트림을 동일한 크기의 HEIC 스트림과 교환할 수 있도록 지원해야 합니다.
공개 API의 HEIC 출력 스트림의 경우 카메라 서비스는 HAL 내부 스트림 두 개를 만듭니다.
EXIF 및 미리보기 이미지 세그먼트를 비롯한 앱 세그먼트를 저장하기 위한 JPEG_APPS_SEGMENT 사용 플래그가 있는 BLOB 스트림
타겟 코덱 및 HEIC 스트림 크기에 따라 HEIC 스트림의 크기에 해당하는 IMPLEMENTATION_DEFINED 또는 YCBCR_420_888 스트림
ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT에 따라 카메라 프레임워크는 카메라 HAL이 JPEG 앱 세그먼트를 채울 만큼 충분히 큰 버퍼를 할당합니다. APP1 세그먼트는 필수이지만, APP1 세그먼트 다음의 세그먼트(APP2 이상)는 선택사항입니다. 카메라 프레임워크는 캡처 결과 메타데이터에서 파생될 수 있거나 기본 이미지 비트스트림과 관련된 APP1 세그먼트의 EXIF 태그를 재정의하고 이를 MediaMuxer로 전송합니다.
미디어 인코더는 출력 이미지의 메타데이터에 방향 정보를 포함하므로 기본 이미지와 미리보기 이미지 간의 방향 일관성을 보장하기 위해 카메라 HAL은 android.jpeg.orientation.을 기준으로 미리보기 이미지를 회전해서는 안 됩니다. 프레임워크는 방향 정보를 EXIF 메타데이터 및 HEIC 컨테이너에 씁니다.
JPEG 형식과 관련된 정적, 제어 및 동적 메타데이터 태그도 HEIC 형식에 적용됩니다. 예를 들어 캡처 요청의 android.jpeg.orientation 및 android.jpeg.quality 메타데이터 태그는 HEIC 이미지의 방향과 품질을 제어하는 데 사용됩니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-26(UTC)"],[],[],null,["# HEIF imaging\n\nDevices running Android 10 support the HEIC\ncompressed image format, a high\nefficiency video encoding (HEVC) specific *brand* of the high efficiency image\nfile format (HEIF) as specified in\n[ISO/IEC 23008-12](https://www.iso.org/standard/66067.html).\nHEIC-encoded images offer\nbetter image quality with smaller file sizes as compared to JPEG files.\n\nHEIC images are generated by the camera framework requesting an uncompressed\nimage from the\n[camera HAL](/docs/core/camera/camera3) and sending it to the media subsystem to\nbe encoded by an HEIC or HEVC encoder.\n\nRequirements\n------------\n\nTo support the HEIC image format, your device must have a hardware encoder\nsupporting\n[`MIMETYPE_IMAGE_ANDROID_HEIC`](https://developer.android.com/reference/android/media/MediaFormat.html#MIMETYPE_IMAGE_ANDROID_HEIC)\nor\n[`MIMETYPE_VIDEO_HEVC`](https://developer.android.com/reference/android/media/MediaFormat.html#MIMETYPE_VIDEO_HEVC)\nwith the\n[constant quality mode](https://developer.android.com/reference/android/media/MediaCodecInfo.EncoderCapabilities.html#BITRATE_MODE_CQ).\n\nImplementation\n--------------\n\nTo support the HEIC image format on your device, implement an HEIC/HEVC codec\nand provide support for the required stream configurations, which are the\n`IMPLEMENTATION_DEFINED`/`YUV` streams and JPEG app segment streams.\n\n### Media\n\nImplement the HEIC/HEVC codec in constant quality (CQ) mode for the\ncorresponding hardware as follows:\n\n- The HEVC type codec consumes either the `IMPLEMENTATION_DEFINED` format with the `GRALLOC_USAGE_HW_VIDEO_ENCODER` usage or the `HAL_PIXEL_FORMAT_YCBCR_420_888` format depending on the image size.\n- The HEIC type codec consumes the `IMPLEMENTATION_DEFINED` format with the `GRALLOC_USAGE_HW_IMAGE_ENCODER` usage.\n\n### Camera\n\nIn the static metadata, set `ANDROID_HEIC_INFO_SUPPORTED` to true, and\n`ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT` to a value between `[1, 16]`,\nindicating the number of JPEG app segments.\n\nFor each mandatory stream combination, your camera device must support swapping\na JPEG stream with a HEIC stream of the same size.\n\nFor an HEIC output stream at the public API, the camera service creates two HAL\ninternal streams:\n\n- A BLOB stream with the `JPEG_APPS_SEGMENT` usage flag to store app segments including EXIF and thumbnail segments\n- An `IMPLEMENTATION_DEFINED` or `YCBCR_420_888` stream the size of the HEIC stream depending on the target codec and HEIC stream size\n\nBased on `ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT`, the camera framework\nallocates buffers large enough for the camera HAL to populate the JPEG app\nsegments. The `APP1` segment is required but segments following the `APP1`\nsegment (`APP2` and above) are optional. The camera framework overrides the EXIF\ntags in the `APP1` segment that can be derived from the capture result metadata\nor are related to the main image bitstream and sends them to `MediaMuxer`.\n\nBecause the media encoder embeds the orientation in the metadata of output\nimages, to ensure a consistent orientation between the main image and thumbnail,\nthe camera HAL must not rotate the thumbnail image based on\n`android.jpeg.orientation.` The framework writes the orientation into the EXIF\nmetadata and HEIC container.\n\nThe static, control, and dynamic metadata tags related to the JPEG format also\napply to the HEIC format. For example, the `android.jpeg.orientation` and\n`android.jpeg.quality` metadata tags in the capture request are used to control\nthe orientation and quality of HEIC images.\n| **Note:** JPEG and HEIC streams can't be configured at the same time.\n\nTo use the HEIC format in an app, use the\n[HEIC public API](https://developer.android.com/reference/android/graphics/ImageFormat#HEIC).\n\nFor more information, see the following sources.\n\n**Camera HAL**\n\n- [`docs.html`](https://android.googlesource.com/platform/system/media/+/a44fd450eae51e671b1020d4f2fb146b181bc1f7/camera/docs/docs.html#31733)\n- [`CameraBlob`](https://android.googlesource.com/platform/hardware/interfaces/+/55386823a318309bfe1cc40175afa615225cabb1/camera/device/3.5/types.hal#156)\n- [`ANDROID_HEIC_INFO_SUPPORTED`](https://android.googlesource.com/platform/hardware/interfaces/+/55386823a318309bfe1cc40175afa615225cabb1/camera/metadata/3.4/types.hal#166)\n- [`ANDROID_HEIC_INFO_MAX_JPEG_APP_SEGMENTS_COUNT`](https://android.googlesource.com/platform/hardware/interfaces/+/55386823a318309bfe1cc40175afa615225cabb1/camera/metadata/3.4/types.hal#172)\n\n**Graphic buffer data space**\n\n- [`JPEG_APP_SEGMENTS`](https://android.googlesource.com/platform/hardware/interfaces/+/55386823a318309bfe1cc40175afa615225cabb1/graphics/common/1.2/types.hal#66)\n- [`HEIF`](https://android.googlesource.com/platform/hardware/interfaces/+/55386823a318309bfe1cc40175afa615225cabb1/graphics/common/1.2/types.hal#77)\n\n**Graphic buffer usage space**\n\n- [`HW_IMAGE_ENCODER`](https://android.googlesource.com/platform/hardware/interfaces/+/55386823a318309bfe1cc40175afa615225cabb1/graphics/common/1.2/types.hal#105)\n\nValidation\n----------\n\nTo validate that your implementation supports HEIC images, use the\n[`TestingCamera2`](https://android.googlesource.com/platform/pdk/+/refs/heads/android16-release/apps/TestingCamera2/)\ntest app and run the following camera CTS and VTS tests.\n\n**Camera CTS tests**\n\n- [`NativeImageReaderTest#testHeic`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/NativeImageReaderTest.java#46)\n- [`ImageReaderTest#testHeic`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java#207)\n- [`ImageReaderTest#testRepeatingHeic`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/ImageReaderTest.java#257)\n- [`ReprocessCaptureTest#testBasicYuvToHeicReprocessing`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/ReprocessCaptureTest.java#122)\n- [`ReprocessCaptureTest#testBasicOpaqueToHeicReprocessing`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/ReprocessCaptureTest.java#170)\n- [`RobustnessTest#testMandatoryOutputCombinations`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/RobustnessTest.java#230)\n- [`StillCaptureTest#testHeicExif`](https://android.googlesource.com/platform/cts/+/refs/heads/android16-release/tests/camera/src/android/hardware/camera2/cts/StillCaptureTest.java#116)\n\n**Camera VTS tests**\n\n- [`VtsHalCameraProviderV2_4TargetTest.cpp`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp#2357)"]]