diff --git a/codec/bundle.json b/codec/bundle.json
index 5a09c82a8dfd930a375ac6360ef2617fb29bf9e3..a2c484ec236ac9733d4626542c9547bc20a84100 100644
--- a/codec/bundle.json
+++ b/codec/bundle.json
@@ -28,7 +28,7 @@
"build": {
"sub_component": [
"//drivers/interface/codec/v3_0:codec_idl_target",
- "//drivers/interface/codec/image/v2_0:image_idl_target"
+ "//drivers/interface/codec/image/v2_1:image_idl_target"
],
"test": [
],
@@ -58,7 +58,7 @@
}
},
{
- "name": "//drivers/interface/codec/image/v2_0:libimage_proxy_2.0",
+ "name": "//drivers/interface/codec/image/v2_1:libimage_proxy_2.1",
"header": {
"header_files": [
],
@@ -66,7 +66,7 @@
}
},
{
- "name": "//drivers/interface/codec/image/v2_0:image_idl_headers",
+ "name": "//drivers/interface/codec/image/v2_1:image_idl_headers",
"header": {
"header_files": [
],
@@ -74,7 +74,7 @@
}
},
{
- "name": "//drivers/interface/codec/image/v2_0:libimage_stub_2.0",
+ "name": "//drivers/interface/codec/image/v2_1:libimage_stub_2.1",
"header": {
"header_files": [
],
diff --git a/codec/image/v2_1/BUILD.gn b/codec/image/v2_1/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..02af1724d4e443aaae28bcd71ac6d3d5df26e5e9
--- /dev/null
+++ b/codec/image/v2_1/BUILD.gn
@@ -0,0 +1,32 @@
+# Copyright (c) 2025 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build/config/components/hdi/hdi.gni")
+if (defined(ohos_lite)) {
+ group("libimage_proxy_2.1") {
+ deps = []
+ public_configs = []
+ }
+} else {
+ hdi("image") {
+ module_name = "codec_service"
+
+ sources = [
+ "CodecImageType.idl",
+ "ICodecImage.idl",
+ ]
+ language = "cpp"
+ subsystem_name = "hdf"
+ part_name = "drivers_interface_codec"
+ }
+}
diff --git a/codec/image/v2_1/CodecImageType.idl b/codec/image/v2_1/CodecImageType.idl
new file mode 100644
index 0000000000000000000000000000000000000000..289b1e935bd06341bbcd31f2dcff668583e91939
--- /dev/null
+++ b/codec/image/v2_1/CodecImageType.idl
@@ -0,0 +1,437 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * @addtogroup Codec
+ * @{
+ *
+ * @brief Defines APIs of the image Codec module.
+ *
+ * The Codec module provides APIs for image codec, setting codec parameters,
+ * and controlling and transferring image data.
+ *
+ * @since 4.0
+ * @version 2.0
+ */
+
+/**
+ * @file CodecImageTypes.idl
+ *
+ * @brief Defines custom data types used in the image Codec module APIs,
+ * including the codec image parameters, types and buffers.
+ *
+ *
+ * @since 4.0
+ * @version 2.0
+ */
+
+/**
+ * @brief Defines the path for the package of the image Codec module APIs.
+ *
+ * @since 4.0
+ * @version 2.0
+ */
+package ohos.hdi.codec.image.v2_1;
+
+/**
+ * @brief Defines the image region information.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+struct CodecImageRegion {
+ unsigned int left; /**< Distance to the left of the image. */
+ unsigned int right; /**< Distance to the right of the image. */
+ unsigned int top; /**< Distance to the top of the image. */
+ unsigned int bottom; /**< Distance to the bottom of the image. */
+ unsigned int flag; /**< True is use regionInfo. */
+ unsigned int rsv; /**< Reserved for extend. */
+};
+
+/**
+ * @brief Enumerates the types of image that can be encoded or decoded
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+enum CodecImageRole {
+ CODEC_IMAGE_JPEG = 0, /**< Jpeg image. */
+ CODEC_IMAGE_HEIF, /**< Heif image. */
+ CODEC_IMAGE_INVALID, /**< Invalid image type. */
+};
+
+/**
+ * @brief Defines the codec image buffer information.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+struct CodecImageBuffer {
+ unsigned int id; /**< Buffer ID. */
+ unsigned int size; /**< Size of buffer. */
+ NativeBuffer buffer; /**< Buffer handle used for encoding or decoding. For details,
+ see {@link NativeBuffer}. */
+ FileDescriptor fenceFd; /**< Fence file descriptor. */
+ CodecImageRole bufferRole; /**< Image buffer role, see {@link CodecImageRole}. */
+};
+
+/**
+ * @brief Defines the image codec type.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+enum CodecImageType {
+ CODEC_IMAGE_TYPE_DECODER = 0, /**< Image decoder. */
+ CODEC_IMAGE_TYPE_ENCODER, /**< Image encoder. */
+ CODEC_IMAGE_TYPE_INVALID, /**< Invalid type. */
+};
+
+/**
+ * @brief Defines the image codec capabilities.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+struct CodecImageCapability {
+ String name; /**< Name of the image codec. */
+ enum CodecImageRole role; /**< Role of the image codec. */
+ enum CodecImageType type; /**< Type of the image codec. */
+ unsigned int widthAlignment; /**< Alignment value of the width. */
+ unsigned int heightAlignment; /**< Alignment value of the height. */
+ unsigned int maxSample; /**< Maximum sample. */
+ unsigned int maxWidth; /**< Maximum width. */
+ unsigned int maxHeight; /**< Maximum height. */
+ unsigned int minWidth; /**< Minimum width. */
+ unsigned int minHeight; /**< Minimum height. */
+ unsigned int maxInst; /**< Maximum instance. */
+ unsigned int[] supportPixFmts; /**< Supported PixFormat. For details, see {@link PixFormat}. */
+ boolean isSoftwareCodec; /**< Whether it is a software codec. */
+};
+
+/**
+ * @brief Defines the jpeg image quant table information.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+struct CodecJpegQuantTable {
+ unsigned short[] quantVal; /**< Quant table value. */
+ boolean tableFlag; /**< True when quant has been output. */
+};
+
+/**
+ * @brief Defines the jpeg image huff table information.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+struct CodecJpegHuffTable {
+ unsigned char[] bits; /**< Bits value, bits[0] is unused. */
+ unsigned char[] huffVal; /**< Huff table value. */
+ boolean tableFlag; /**< True when huff table valid. */
+};
+
+/**
+ * @brief Defines the jpeg image huff table information.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+struct CodecJpegCompInfo {
+ unsigned int componentId; /**< CompInfo index in JpegDecInfo. */
+ unsigned int componentIndex; /**< CompInfo index in JpegDecInfo. */
+ unsigned int hSampFactor; /**< Horizontal sample factor. */
+ unsigned int vSampFactor; /**< vertical sample factor. */
+ unsigned int quantTableNo; /**< Quant table value. */
+ unsigned int dcTableNo; /**< Dc table index. */
+ unsigned int acTableNo; /**< Ac table index. */
+ boolean infoFlag;
+};
+
+/**
+ * @brief Defines the jpeg image decode information.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+struct CodecJpegDecInfo {
+ unsigned int imageWidth; /**< Image width. */
+ unsigned int imageHeight; /**< Image height. */
+ unsigned int dataPrecision; /**< Bit height. */
+ unsigned int numComponents; /**< Num of color component in jpeg image. */
+ unsigned int restartInterval; /**< MCUs per restart. */
+ boolean arithCode; /**< False is Huff coding,
+ true is arithmetic coding. */
+ boolean progressiveMode; /**< If SOF specifiy progressive mode. */
+ struct CodecJpegCompInfo[] compInfo; /**< Jpeg compress information. */
+ struct CodecJpegHuffTable[] dcHuffTbl; /**< Dc huffman table information. */
+ struct CodecJpegHuffTable[] acHuffTbl; /**< Ac huffman table information. */
+ struct CodecJpegQuantTable[] quantTbl; /**< Quant table information. */
+ struct CodecImageRegion region; /**< Image region information. */
+ unsigned int sampleSize; /**< Image sample size. */
+ unsigned int compressPos; /**< The offset of Jpeg compressed data. */
+};
+
+/**
+ * @brief Defines the supported property type for heif image encode.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+enum PropertyType {
+ MIRROR_INFO, /**< True means the image is displayed as a vertical mirror,
+ false means the image is displayed as a horizontal mirror. */
+ ROTATE_INFO, /**< Determines how many degrees the image is rotated to display,
+ valid value is 0/90/180/270. */
+ COLOR_TYPE, /**< Image color type. */
+ COLOR_INFO, /**< Detailed color info when color type is set to NCLX. */
+ ICC_PROFILE, /**< Detailed color info when color type is set to RICC or PROF. */
+ CONTENT_LIGHT_LEVEL, /**< Clli info for HDR. */
+ MASTER_DISPLAY_COLOR_VOLUME, /**< Mdcv info for HDR. */
+ TONE_MAP_METADATA, /**< Tone map meta data for HDR. */
+ USER_DATA_DO_COMPRESS, /**< Determines whether user data is compressed. */
+ IT35_INFO, /**< It35 info for HDR. */
+ AUX_TYPE, /**< URN for auxiliary image. */
+ IMG_RESOLUTION, /**< Resolution for uncoded auxiliary image. */
+ RLOC_INFO, /**< Rloc info for fragmentmap. */
+};
+
+/**
+ * @brief Defines the color type of the output heif image.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+enum ColorType {
+ NCLX, /**< NCLX color type. */
+ RICC, /**< RICC color type. */
+ PROF, /**< PROF color type. */
+};
+
+/**
+ * @brief Defines the color info when ColorType is set to NCLX.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct ColourInfo {
+ unsigned short colourPrimaries; /**< Gamut triangle, and white point coordinates. */
+ unsigned short transferCharacteristics; /**< Transfer function/OETF. */
+ unsigned short matrixCoefficients; /**< Specifies the matrix coefficient for YUV-RGB conversion. */
+ boolean fullRangeFlag; /**< Specifies the YUV value range during the conversion
+ between YUV and RGB. */
+};
+
+/**
+ * @brief Defines details for Clli info of HDR heif image.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct ContentLightLevel {
+ unsigned short maxContentLightLevel; /**< Max value of content light level. */
+ unsigned short maxPicAverageLightLevel; /**< Max value of average light level. */
+};
+
+/**
+ * @brief Defines details for Mdcv info of HDR heif image.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct MasteringDisplayColourVolume {
+ unsigned short displayPrimariesRX; /**< Display primaries for X-plane of red. */
+ unsigned short displayPrimariesRY; /**< Display primaries for Y-plane of red. */
+ unsigned short displayPrimariesGX; /**< Display primaries for X-plane of green. */
+ unsigned short displayPrimariesGY; /**< Display primaries for Y-plane of green. */
+ unsigned short displayPrimariesBX; /**< Display primaries for X-plane of blue. */
+ unsigned short displayPrimariesBY; /**< Display primaries for Y-plane of blue. */
+ unsigned short whitePointX; /**< White point for X-plane. */
+ unsigned short whitePointY; /**< White point for Y-plane. */
+ unsigned int maxDisplayMasteringLuminance; /**< Max display mastering luminance. */
+ unsigned int minDisplayMasteringLuminance; /**< Min display mastering luminance. */
+};
+
+/**
+ * @brief Defines a struct to describe the relative position of the auxiliary image to the associated image.
+ *
+ * @since 5.0
+ * @version 1.0
+ */
+struct RelativeLocation {
+ unsigned int horizontalOffset; /**< Horizontal offset in pixels of the left-most pixel column. */
+ unsigned int verticalOffset; /**< Vertical offset in pixels of the top-most pixel row. */
+};
+
+/**
+ * @brief Defines a struct to describe resolution for image.
+ *
+ * @since 5.0
+ * @version 1.0
+ */
+struct Resolution {
+ unsigned int width;
+ unsigned int height;
+};
+
+/**
+ * @brief Defines a struct to describe a signed rational number.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct SignedRational {
+ int numerator; /**< Numerator of a signed rational number. */
+ unsigned int denominator; /**< Denominator of a signed rational number. */
+};
+
+/**
+ * @brief Defines a struct to describe an unsigned rational number.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct UnsignedRational {
+ unsigned int numerator; /**< Numerator of an unsigned rational number. */
+ unsigned int denominator; /**< Denominator of an unsigned rational number. */
+};
+
+/**
+ * @brief Defines details for gain map channel info of HDR heif image.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct ToneMapChannel {
+ SignedRational gainMapMin; /**< Per-component min gain map values. */
+ SignedRational gainMapMax; /**< Per-component max gain map values. */
+ UnsignedRational gamma; /**< Per-component gamma values. */
+ SignedRational baseOffset; /**< Baseline image offset. */
+ SignedRational alternateOffset; /**< Alternate image offset. */
+};
+
+/**
+ * @brief Defines details for gain map metadata of HDR heif image.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct ToneMapMetadata {
+ unsigned short channelCnt; /**< The number of channels, it is either 1 or 3. */
+ boolean useBaseColorSpace; /**< Determine whether to use base color space. */
+ UnsignedRational baseHdrHeadroom; /**< Value of base hdr headroom. */
+ UnsignedRational alternateHdrHeadroom; /**< Value of alternate hdr headroom. */
+ ToneMapChannel channels1; /**< Detail info of channel 1. */
+ ToneMapChannel channels2; /**< Detail info of channel 2. */
+ ToneMapChannel channels3; /**< Detail info of channel 3. */
+};
+
+/**
+ * @brief Defines buffer that store non-pixel data for heif encode.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct SharedBuffer {
+ FileDescriptor fd; /**< Fd related to the buffer. */
+ unsigned int filledLen; /**< Used size of the buffer. */
+ unsigned int capacity; /**< Total size of the buffer. */
+};
+
+/**
+ * @brief Defines how to store pixel data for heif encode.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct ImageItem {
+ String itemName; /**< Item name. */
+ unsigned int id; /**< Item id. */
+ NativeBuffer pixelBuffer; /**< Buffer to store pixel data. */
+ SharedBuffer pixelSharedBuffer; /**< Buffer to store pixel data which cannot be stored in NativeBuffer. */
+ boolean isPrimary; /**< Primary image flag. */
+ boolean isHidden; /**< Determines whether to display this image. */
+ String compressType; /**< Determines how to compress the pixel data. */
+ unsigned int quality; /**< Compress quality, value range: [0, 100]. */
+ unsigned char[] liteProperties; /**< Store smaller propety data, (enum + struct)|(enum + strlen + str)...*/
+ SharedBuffer sharedProperties; /**< Store larger data, (enum + buffersize + buffer)... */
+};
+
+/**
+ * @brief Defines how to store meta data for heif encode.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct MetaItem {
+ String itemName; /**< Name of the item. */
+ unsigned int id; /**< Id of the item. */
+ SharedBuffer data; /**< Data of the item. */
+ unsigned char[] properties; /**< Extra properties of the item. */
+};
+
+/**
+ * @brief Defines reference type for heif encode.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+enum ReferenceType {
+ DIMG, /**< Describe relation between base map and gain map for HDR. */
+ THMB, /**< Describe relation between primary image and thumbnail. */
+ AUXL, /**< Describe relation between primary image and auxilary image. */
+ CDSC, /**< Describe relation between primary image and meta data. */
+};
+
+/**
+ * @brief Defines the relation between different items for heif encode.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+struct ItemRef {
+ ReferenceType type; /**< Relation between two items. */
+ String auxType; /**< Extra info for auxilary image, only valid when type is set to AUXL. */
+ unsigned int from; /**< One party to a relation. */
+ unsigned int[] to; /**< The other party to a relation. */
+};
+
+/**
+ * @brief Defines the grid info of heif image.
+ *
+ * @since 6.0
+ * @version 1.0
+ */
+struct GridInfo {
+ unsigned int displayWidth; /**< Display width of image. */
+ unsigned int displayHeight; /**< Display height of image. */
+ boolean enableGrid; /**< Whether heif image is tiling into grids. */
+ unsigned int cols; /**< Number of total columns. */
+ unsigned int rows; /**< Number of total rows. */
+ unsigned int tileWidth; /**< Width of image grid. */
+ unsigned int tileHeight; /**< Height of image grid. */
+};
+
+/**
+ * @brief Defines the heif image decode information.
+ *
+ * @since 6.0
+ * @version 1.0
+ */
+struct CodecHeifDecInfo {
+ GridInfo gridInfo; /**< Grid info of heif image, see {@link GridInfo}. */
+ unsigned int sampleSize; /**< Image sample size, valid value is 1/2/4/8/16. */
+};
diff --git a/codec/image/v2_1/ICodecImage.idl b/codec/image/v2_1/ICodecImage.idl
new file mode 100644
index 0000000000000000000000000000000000000000..7875781c79140e4fbbfd7c754fdf7f11f695725a
--- /dev/null
+++ b/codec/image/v2_1/ICodecImage.idl
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * @addtogroup Codec
+ * @{
+ *
+ * @brief Defines APIs of the image Codec module.
+ *
+ * The Codec module provides APIs for image codec, setting codec parameters,
+ * and controlling and transferring image data.
+ *
+ * @since 4.0
+ * @version 2.0
+ */
+
+/**
+ * @file ICodecImage.idl
+ *
+ * @brief Declares the APIs for image codec.
+ *
+ *You can use these APIs to allocate input buffer, and decode image
+ *
+ * @since 4.0
+ * @version 2.0
+ */
+
+/**
+ * @brief Defines the path for the package of the image Codec module APIs.
+ *
+ * @since 4.0
+ * @version 2.1
+ */
+package ohos.hdi.codec.image.v2_1;
+
+import ohos.hdi.codec.image.v2_1.CodecImageType;
+
+interface ICodecImage {
+
+ /**
+ * @brief Notify to power on the Image Codec module hardware.
+ *
+ * You can use this API to notify the Image Codec module hardware to power on.
+ * @param role Indicates the image codec role {@link CodecImageRole} obtained.
+ *
+ * @since 6.0
+ * @version 2.1
+ */
+ [oneway] NotifyPowerOn([in] enum CodecImageRole role);
+
+ /**
+ * @brief Obtains image codec capabilities.
+ *
+ * You can use this API to obtain the encoding and decoding capabilities provided by the image Codec module.
+ * For details, see {@link CodecImageCapability}.
+ *
+ * @param capList Indicates the image codec capabilities {@link CodecImageCapability} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+ GetImageCapability([out] struct CodecImageCapability[] capList);
+
+ /**
+ * @brief Image codec module init.
+ *
+ * You can use this API to init the Image Codec module.
+ *
+ * @param role Indicates the image codec role {@link CodecImageRole} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+ Init([in] enum CodecImageRole role);
+
+ /**
+ * @brief Image codec module deinit.
+ *
+ * You can use this API to deinit the Image Codec module.
+ *
+ * @param role Indicates the image codec role {@link CodecImageRole} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+ DeInit([in] enum CodecImageRole role);
+
+ /**
+ * @brief Start jpeg image decode.
+ *
+ * You can use this API to start jpeg image decode.
+ *
+ * @param inBuffer Indicates input buffer of the jpeg image decode {@link CodecImageBuffer} obtained.
+ * @param outBuffer Indicates output buffer of the jpeg image decode {@link CodecImageBuffer} obtained.
+ * @param decInfo Indicates decode information of the image decode {@link JpegDecInfo} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_ERR_INVALID_PARAM if the operation fails due to invalid parameters.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+ DoJpegDecode([in] struct CodecImageBuffer inBuffer, [in] struct CodecImageBuffer outBuffer,
+ [in] struct CodecJpegDecInfo decInfo);
+
+ /**
+ * @brief Allocate input buffer.
+ *
+ * You can use this API to allocate input buffer for image codec.
+ * After input buffer is duplicated to proxy, stub will automatically free its own reference to input buffer.
+ *
+ * @param inBuffer Indicates input buffer of the image codec {@link CodecImageBuffer} obtained.
+ * @param size Indicates size of input buffer {@link CodecImageBuffer} obtained.
+ * @param role Indicates image codec role of input buffer {@link CodecImageRole} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_ERR_INVALID_PARAM if the operation fails due to invalid parameters.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ * @version 1.0
+ */
+ AllocateInBuffer([out] struct CodecImageBuffer inBuffer, [in] unsigned int size, [in] CodecImageRole role);
+
+ /**
+ * @brief Free input buffer.
+ *
+ * You can use this API to free input buffer for image decode.
+ *
+ * @param buffer Indicates input buffer of the image codec {@link CodecImageBuffer} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 4.0
+ * @version 1.0
+ * @deprecated
+ * @stub no longer hold reference to input buffer, no need to free.
+ */
+ FreeInBuffer([in] struct CodecImageBuffer inBuffer);
+
+ /**
+ * @brief Start heif image encode.
+ *
+ * You can use this API to start heif image encode.
+ *
+ * @param inputImgs Indicates input images for the heif image encode {@link ImageItem} obtained.
+ * @param inputMetas Indicates encode parameters of the image encode {@link MetaItem} obtained.
+ * @param refs Indicates reference relations of the heif image encode {@link ItemRef} obtained.
+ * @param output Indicates output buffer of the heif image encode {@link SharedBuffer} obtained.
+ * @param filledLen Indicates filled length of output buffer if heif image encode succeed.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 5.0
+ * @version 2.0
+ */
+ DoHeifEncode([in] ImageItem[] inputImgs, [in] MetaItem[] inputMetas,
+ [in] ItemRef[] refs, [in] SharedBuffer output, [out] unsigned int filledLen);
+
+ /**
+ * @brief Start heif image decode.
+ *
+ * You can use this API to start heif image decode.
+ *
+ * @param inputs Indicates input buffer of the heif image decode {@link Ashmem} obtained.
+ * @param output Indicates output buffer of the heif image decode {@link NativeBuffer} obtained.
+ * @param decInfo Indicates decode information of the image decode {@link CodecHeifDecInfo} obtained.
+ *
+ * @return Returns HDF_SUCCESS if the operation is successful.
+ * @return Returns HDF_FAILURE if the execution fails.
+ * @return Returns other values if the underlying layer returns a failure. For details about the error codes,
+ * see HDF_STATUS defined by HDF.
+ *
+ * @since 6.0
+ * @version 1.0
+ */
+ DoHeifDecode([in] Ashmem[] inputs, [in] NativeBuffer output, [in] struct CodecHeifDecInfo decInfo);
+}