diff --git a/frameworks/innerkitsimpl/codec/src/image_source.cpp b/frameworks/innerkitsimpl/codec/src/image_source.cpp index a70aec2a8f9afbde80c74ab6005f2c7d311242b3..849a669443c7a83b8473ed69e7bfb1497c853db7 100644 --- a/frameworks/innerkitsimpl/codec/src/image_source.cpp +++ b/frameworks/innerkitsimpl/codec/src/image_source.cpp @@ -166,6 +166,7 @@ constexpr int32_t DEFAULT_DMA_SIZE = 512 * 512; constexpr int32_t DMA_ALLOC = 1; constexpr int32_t SHARE_MEMORY_ALLOC = 2; constexpr int32_t AUTO_ALLOC = 0; +constexpr uint8_t GAINMAP_CHANNEL_NUM_ONE = 0x01; static constexpr uint8_t JPEG_SOI[] = { 0xFF, 0xD8, 0xFF }; constexpr uint8_t PIXEL_BYTES = 4; @@ -862,6 +863,7 @@ DecodeContext ImageSource::InitDecodeContext(const DecodeOptions &opts, const Im { DecodeContext context; context.photoDesiredPixelFormat = opts.photoDesiredPixelFormat; + context.isCreateWideGamutSdrPixelMap = opts.isCreateWideGamutSdrPixelMap; if (opts.allocatorType != AllocatorType::DEFAULT) { context.allocatorType = opts.allocatorType; } else { @@ -4235,6 +4237,11 @@ bool ImageSource::ApplyGainMap(ImageHdrType hdrType, DecodeContext& baseCtx, Dec IMAGE_LOGI("[ImageSource] jpeg get gainmap failed"); return false; } + if (baseCtx.isCreateWideGamutSdrPixelMap && + metadata.extendMeta.metaISO.gainmapChannelNum == GAINMAP_CHANNEL_NUM_ONE) { + IMAGE_LOGI("HDR-IMAGE wideGumat get one channel gainmap"); + return false; + } IMAGE_LOGD("HDR-IMAGE get hdr metadata, extend flag is %{public}d, static size is %{public}zu," "dynamic metadata size is %{public}zu", metadata.extendMetaFlag, metadata.staticMetadata.size(), metadata.dynamicMetadata.size()); @@ -4333,7 +4340,8 @@ static uint32_t AllocHdrSurfaceBuffer(DecodeContext& context, ImageHdrType hdrTy } #endif -static void SetResLog(sptr& baseSptr, sptr& gainmapSptr, sptr& hdrSptr) +static void SetResLogBuffer(sptr& baseSptr, sptr& gainmapSptr, + sptr& hdrSptr) { VpeUtils::SetSurfaceBufferInfo(baseSptr, CM_BT709_LIMIT); VpeUtils::SetSurfaceBufferInfo(gainmapSptr, CM_BT709_LIMIT); @@ -4343,8 +4351,16 @@ static void SetResLog(sptr& baseSptr, sptr& gainma VpeUtils::SetSbMetadataType(hdrSptr, CM_IMAGE_HDR_VIVID_SINGLE); } -void ImageSource::SpecialSetComposeBuffer(sptr& baseSptr, sptr& gainmapSptr, - sptr& hdrSptr, HdrMetadata& metadata) +static void SetWideGamutBuffer(sptr& baseSptr, sptr& gainmapSptr, + sptr& hdrSptr) +{ + VpeUtils::GetSbColorSpaceType(baseSptr, CM_SRGB_FULL); + VpeUtils::GetSbColorSpaceType(gainmapSptr, CM_SRGB_FULL); + VpeUtils::GetSbColorSpaceType(hdrSptr, CM_DISPLAY_BT2020_SRGB); +} + +void ImageSource::SpecialSetComposeBuffer(DecodeContext& context, sptr& baseSptr, + sptr& gainmapSptr, sptr& hdrSptr, HdrMetadata& metadata) { // videoHdrImage special process CM_HDR_Metadata_Type videoToImageHdrType = GetHdrMediaType(metadata); @@ -4355,7 +4371,11 @@ void ImageSource::SpecialSetComposeBuffer(sptr& baseSptr, sptr hdrSptr(reinterpret_cast(hdrCtx.pixelsBuffer.context)); - SpecialSetComposeBuffer(baseSptr, gainmapSptr, hdrSptr, metadata); + SpecialSetComposeBuffer(baseCtx, baseSptr, gainmapSptr, hdrSptr, metadata); VpeSurfaceBuffers buffers = { .sdr = baseSptr, .gainmap = gainmapSptr, diff --git a/frameworks/innerkitsimpl/test/unittest/heif_parser_box_test.cpp b/frameworks/innerkitsimpl/test/unittest/heif_parser_box_test.cpp index 545e7d29fbe42d221d7d517f8878760b2ea0c4c5..c287f9069d2a9bb6d6b793c1069e4d0a49c5c839 100644 --- a/frameworks/innerkitsimpl/test/unittest/heif_parser_box_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/heif_parser_box_test.cpp @@ -33,6 +33,7 @@ static constexpr size_t ERR_LENGTH = -1; static constexpr size_t NORMAL_LENGTH = 1; static constexpr size_t SIZE_32BITS = 0xFFFFFFFF; static constexpr size_t UUID_TYPE_BYTE_NUM = 16; +static constexpr uint32_t NAL_LAYER_ID = 33; static std::vector SetUint32ToUint8Vertor(uint32_t data) { @@ -363,6 +364,28 @@ HWTEST_F(HeifParserBoxTest, AppendNalDataTest001, TestSize.Level3) GTEST_LOG_(INFO) << "HeifParserBoxTest: AppendNalDataTest001 end"; } +/** + * @tc.name: AppendNalDataTest001 + * @tc.desc: HeifHvccBox + * @tc.type: FUNC + */ +HWTEST_F(HeifParserBoxTest, AppendNalDataTest002, TestSize.Level3) +{ + GTEST_LOG_(INFO) << "HeifParserBoxTest: AppendNalDataTest002 start"; + HeifHvccBox heifHvccBox; + std::vector nalData = {0x01, 0x02, 0x03, 0x04}; + heifHvccBox.ParserHvccColorRangeFlag(nalData); + auto spsConfig = hvcc->GetSpsConfig(); + ASSERT_EQ(spsConfig.nalUnitType, NAL_LAYER_ID); + ASSERT_EQ(spsConfig.bitDepthLumaMinus8, 0); + ASSERT_EQ(spsConfig.bitDepthChromaMinus8, 0); + ASSERT_EQ(spsConfig.chromaFormatIdc, 1); + ASSERT_EQ(spsConfig.picWidthInLumaSamples, 512); + ASSERT_EQ(spsConfig.picHeightInLumaSamples, 512); + ASSERT_EQ(spsConfig.videoRangeFlag, 1); + GTEST_LOG_(INFO) << "HeifParserBoxTest: AppendNalDataTest002 end"; +} + /** * @tc.name: ParseExtentsTest001 * @tc.desc: HeifIlocBox diff --git a/frameworks/innerkitsimpl/test/unittest/image_source_test/image_source_test.cpp b/frameworks/innerkitsimpl/test/unittest/image_source_test/image_source_test.cpp index f85c4665eb5a8adffee27949cc37170efc1ad259..ea6c557cbe0743ec81690e0ceab7c805d7468bd0 100644 --- a/frameworks/innerkitsimpl/test/unittest/image_source_test/image_source_test.cpp +++ b/frameworks/innerkitsimpl/test/unittest/image_source_test/image_source_test.cpp @@ -55,6 +55,8 @@ static const std::string IMAGE_INPUT_JPEG_BROKEN_ONE = "/data/local/tmp/image/te static const std::string IMAGE_INPUT_JPEG_BROKEN_TWO = "/data/local/tmp/image/test_jpeg_broken_two.jpg"; static const std::string IMAGE_URL_PREFIX = "data:image/"; static const std::string IMAGE_INPUT_JPG_PATH_EXACTSIZE = "/data/local/tmp/image/800-500.jpg"; +static const std::string IMAGE_JPG_THREE_GAINMAP_HDR_PATH = "/data/local/tmp/image/three_gainmap_hdr.jpg"; +static const std::string IMAGE_HEIC_THREE_GAINMAP_HDR_PATH = "/data/local/tmp/image/three_gainmap_hdr.heic"; static const int32_t DEFAULT_DMA_SIZE = 512 * 512; static const int32_t NUM_1_MINUS = -1; static const int32_t IMAGE_INPUT_JPG_WIDTH = 800; @@ -3100,5 +3102,83 @@ HWTEST_F(ImageSourceTest, DecodeHeifAuxiliaryPicturesTest002, TestSize.Level1) ASSERT_EQ(errorCode, ERR_IMAGE_DATA_ABNORMAL); GTEST_LOG_(INFO) << "ImageSourceTest: DecodeHeifAuxiliaryPicturesTest002 end"; } + +/** + * @tc.name: WideGumatTest001 + * @tc.desc: test WideGumat one channel gainmap Jpeg HDR input + * @tc.type: FUNC + */ +HWTEST_F(ImageSourceTest, WideGumatTest001, TestSize.Level3) +{ + uint32_t errorCode = 0; + SourceOptions opts; + opts.formatHint = "image/jpeg"; + std::unique_ptr imageSource = ImageSource::CreateImageSource(IMAGE_INPUT_JPEG_HDR_PATH, + opts, errorCode); + ASSERT_EQ(errorCode, SUCCESS); + ASSERT_NE(imageSource.get(), nullptr); + uint32_t index = 0; + DecodeOptions decodeOpts; + decodeOpts.isCreateWideGamutSdrPixelMap = true; + decodeOpts.desiredDynamicRange = Media::DecodeDynamicRange::AUTO; + std::unique_ptr pixelMap = imageSource->CreatePixelMap(index, decodeOpts, errorCode); + ASSERT_EQ(errorCode, SUCCESS); + bool isHdr = pixelMap->IsHdr(); + ASSERT_EQ(isHdr, false); + Media::PixelFormat pixelFormat = pixelMap->GetPixelFormat(); + ASSERT_EQ(pixelFormat, Media::PixelFormat::RGBA_8888); +} + +/** + * @tc.name: WideGumatTest002 + * @tc.desc: test WideGumat one channel gainmap Jpeg HDR input + * @tc.type: FUNC + */ +HWTEST_F(ImageSourceTest, WideGumatTest002, TestSize.Level3) +{ + uint32_t errorCode = 0; + SourceOptions opts; + opts.formatHint = "image/jpeg"; + std::unique_ptr imageSource = ImageSource::CreateImageSource(IMAGE_JPG_THREE_GAINMAP_HDR_PATH, + opts, errorCode); + ASSERT_EQ(errorCode, SUCCESS); + ASSERT_NE(imageSource.get(), nullptr); + uint32_t index = 0; + DecodeOptions decodeOpts; + decodeOpts.isCreateWideGamutSdrPixelMap = true; + decodeOpts.desiredDynamicRange = Media::DecodeDynamicRange::AUTO; + std::unique_ptr pixelMap = imageSource->CreatePixelMap(index, decodeOpts, errorCode); + ASSERT_EQ(errorCode, SUCCESS); + bool isHdr = pixelMap->IsHdr(); + ASSERT_EQ(isHdr, true); + Media::PixelFormat pixelFormat = pixelMap->GetPixelFormat(); + ASSERT_EQ(pixelFormat, Media::PixelFormat::RGBA_1010102); +} + +/** + * @tc.name: WideGumatTest001 + * @tc.desc: test WideGumat one channel gainmap Jpeg HDR input + * @tc.type: FUNC + */ +HWTEST_F(ImageSourceTest, WideGumatTest003, TestSize.Level3) +{ + uint32_t errorCode = 0; + SourceOptions opts; + opts.formatHint = "image/jpeg"; + std::unique_ptr imageSource = ImageSource::CreateImageSource(IMAGE_HEIC_THREE_GAINMAP_HDR_PATH, + opts, errorCode); + ASSERT_EQ(errorCode, SUCCESS); + ASSERT_NE(imageSource.get(), nullptr); + uint32_t index = 0; + DecodeOptions decodeOpts; + decodeOpts.isCreateWideGamutSdrPixelMap = true; + decodeOpts.desiredDynamicRange = Media::DecodeDynamicRange::AUTO; + std::unique_ptr pixelMap = imageSource->CreatePixelMap(index, decodeOpts, errorCode); + ASSERT_EQ(errorCode, SUCCESS); + bool isHdr = pixelMap->IsHdr(); + ASSERT_EQ(isHdr, false); + Media::PixelFormat pixelFormat = pixelMap->GetPixelFormat(); + ASSERT_EQ(pixelFormat, Media::PixelFormat::RGBA_8888); +} } // namespace Multimedia } // namespace OHOS \ No newline at end of file diff --git a/frameworks/kits/js/common/image_source_napi.cpp b/frameworks/kits/js/common/image_source_napi.cpp index d9cc4a16326a9404ca5160cb5fd6831ab787121a..227178262dcfc24ea223969442fea23dfababea7 100644 --- a/frameworks/kits/js/common/image_source_napi.cpp +++ b/frameworks/kits/js/common/image_source_napi.cpp @@ -903,6 +903,7 @@ std::vector ImageSourceNapi::RegisterNapi() DECLARE_NAPI_FUNCTION("createPixelMapSync", CreatePixelMapSync), DECLARE_NAPI_FUNCTION("createPixelMapUsingAllocator", CreatePixelMapUsingAllocator), DECLARE_NAPI_FUNCTION("createPixelMapUsingAllocatorSync", CreatePixelMapUsingAllocatorSync), + DECLARE_NAPI_FUNCTION("createWideGamutSdrPixelMap", CreateWideGamutSdrPixelMap), DECLARE_NAPI_FUNCTION("updateData", UpdateData), DECLARE_NAPI_FUNCTION("release", Release), DECLARE_NAPI_GETTER("supportedFormats", GetSupportedFormats), @@ -1785,6 +1786,34 @@ static void CreatePixelMapExecute(napi_env env, void *data) IMAGE_LOGD("CreatePixelMapExecute OUT"); } +static void CreateWideGamutSdrPixelMapExecute(napi_env env, void *data) +{ + IMAGE_LOGD("CreateWideGamutSdrPixelMapExecute IN"); + if (data == nullptr) { + IMAGE_LOGE("data is nullptr"); + return; + } + auto context = static_cast(data); + if (context == nullptr) { + IMAGE_LOGE("empty context"); + return; + } + if (context->errMsg.size() > 0) { + IMAGE_LOGE("mismatch args"); + context->status = ERROR; + return; + } + context->decodeOpts.isCreateWideGamutSdrPixelMap = true; + context->decodeOpts.desiredDynamicRange = DecodeDynamicRange::AUTO; + context->rPixelMap = CreatePixelMapInner(context->constructor_, context->rImageSource, + context->index, context->decodeOpts, context->status); + if (context->status != SUCCESS) { + context->errMsg = "Create CreateWideGamutSdrPixelMap error"; + IMAGE_LOGE("CreateWideGamutSdrPixelMap error"); + } + IMAGE_LOGD("CreateWideGamutSdrPixelMapExecute OUT"); +} + static void CreatePixelMapUsingAllocatorExecute(napi_env env, void *data) { if (data == nullptr) { @@ -1905,6 +1934,47 @@ napi_value ImageSourceNapi::CreatePixelMap(napi_env env, napi_callback_info info return result; } +napi_value ImageSourceNapi::CreateWideGamutSdrPixelMap(napi_env env, napi_callback_info info) +{ + napi_value result = nullptr; + napi_get_undefined(env, &result); + napi_status status; + napi_value thisVar = nullptr; + size_t argCount = NUM_0; + napi_value argValue[NUM_2] = {0}; + IMG_JS_ARGS(env, info, status, argCount, argValue, thisVar); + IMG_NAPI_CHECK_RET_D(IMG_IS_READY(status, thisVar), nullptr, IMAGE_LOGE("fail to get thisVar")); + IMG_NAPI_CHECK_RET_D(IMG_IS_OK(status), nullptr, IMAGE_LOGE("fail to napi_get_cb_info")); + std::unique_ptr asyncContext = std::make_unique(); + status = napi_unwrap(env, thisVar, reinterpret_cast(&asyncContext->constructor_)); + IMG_NAPI_CHECK_RET_D(IMG_IS_READY(status, asyncContext->constructor_), + nullptr, IMAGE_LOGE("fail to unwrap context")); + IMG_NAPI_CHECK_RET_D(IMG_IS_READY(status, asyncContext->constructor_->nativeImgSrc), + nullptr, IMAGE_LOGE("fail to unwrap nativeImgSrc")); + asyncContext->rImageSource = asyncContext->constructor_->nativeImgSrc; + IMG_NAPI_CHECK_RET_D(IMG_IS_READY(status, asyncContext->rImageSource), + nullptr, IMAGE_LOGE("empty native rImageSource")); + + if (argCount == 1 && ImageNapiUtils::getType(env, argValue[0]) == napi_function) { + napi_create_reference(env, argValue[0], 1, &asyncContext->callbackRef); + } else if (argCount > 1) { + IMAGE_LOGE("Too many arguments"); + return result; + } + if (asyncContext->callbackRef == nullptr) { + napi_create_promise(env, &(asyncContext->deferred), &result); + } else { + napi_get_undefined(env, &result); + } + ImageNapiUtils::HicheckerReport(); + IMG_CREATE_CREATE_ASYNC_WORK_WITH_QOS(env, status, "CreateWideGamutSdrPixelMap", CreateWideGamutSdrPixelMapExecute, + CreatePixelMapComplete, asyncContext, asyncContext->work, napi_qos_user_initiated); + + IMG_NAPI_CHECK_RET_D(IMG_IS_OK(status), + nullptr, IMAGE_LOGE("fail to create async work")); + return result; +} + napi_value ImageSourceNapi::CreatePixelMapSync(napi_env env, napi_callback_info info) { napi_value result = nullptr; diff --git a/interfaces/innerkits/include/image_source.h b/interfaces/innerkits/include/image_source.h index 7f040ce8e275e4e1580f89ed428c4a64e5e36bad..df7430431fbe8e9ab74757944aec806a65378550 100644 --- a/interfaces/innerkits/include/image_source.h +++ b/interfaces/innerkits/include/image_source.h @@ -332,8 +332,8 @@ private: ImagePlugin::PlImageInfo& outInfo, uint32_t& errorCode); bool DecodeJpegGainMap(ImageHdrType hdrType, float scale, ImagePlugin::DecodeContext& gainMapCtx, HdrMetadata& metadata); - void SpecialSetComposeBuffer(sptr& baseSptr, sptr& gainmapSptr, - sptr& hdrSptr, HdrMetadata& metadata); + void SpecialSetComposeBuffer(ImagePlugin::DecodeContext& context, sptr& baseSptr, + sptr& gainmapSptr, sptr& hdrSptr, HdrMetadata& metadata); void DumpInputData(const std::string& fileSuffix = "dat"); static uint64_t GetNowTimeMicroSeconds(); uint32_t ModifyImageProperty(std::shared_ptr metadataAccessor, diff --git a/interfaces/innerkits/include/image_type.h b/interfaces/innerkits/include/image_type.h index bf8894913f24d2d79bfb2253fa34b19ba0c01193..a9f1d859faf87219dde63663e582d3e20f5f53ab 100644 --- a/interfaces/innerkits/include/image_type.h +++ b/interfaces/innerkits/include/image_type.h @@ -361,6 +361,7 @@ struct DecodeOptions { bool isAppUseAllocator = false; std::shared_ptr reusePixelmap = nullptr; CropAndScaleStrategy cropAndScaleStrategy = CropAndScaleStrategy::DEFAULT; + bool isCreateWideGamutSdrPixelMap = false; }; enum class ScaleMode : int32_t { diff --git a/interfaces/kits/js/common/include/image_source_napi.h b/interfaces/kits/js/common/include/image_source_napi.h index 4d5653acd442e57275de6f17b43d6ebed0144b01..206d352c9d2aa46e71564c04dd9a60b2a0e316a4 100644 --- a/interfaces/kits/js/common/include/image_source_napi.h +++ b/interfaces/kits/js/common/include/image_source_napi.h @@ -82,6 +82,7 @@ private: #if !defined(IOS_PLATFORM) && !defined(ANDROID_PLATFORM) static napi_value CreatePicture(napi_env env, napi_callback_info info); #endif + static napi_value CreateWideGamutSdrPixelMap(napi_env env, napi_callback_info info); static napi_value CreatePixelMapUsingAllocator(napi_env env, napi_callback_info info); static napi_value CreatePixelMapUsingAllocatorSync(napi_env env, napi_callback_info info); diff --git a/plugins/common/libs/image/libextplugin/src/heif_impl/heif_parser/box/item_property_hvcc_box.cpp b/plugins/common/libs/image/libextplugin/src/heif_impl/heif_parser/box/item_property_hvcc_box.cpp index 59fcd7cd5b5bf11f085b521aba2b6749da8f1619..fe51c0ae100a5a0f68b31ab01b845dca72d2aa14 100644 --- a/plugins/common/libs/image/libextplugin/src/heif_impl/heif_parser/box/item_property_hvcc_box.cpp +++ b/plugins/common/libs/image/libextplugin/src/heif_impl/heif_parser/box/item_property_hvcc_box.cpp @@ -14,6 +14,7 @@ */ #include "box/item_property_hvcc_box.h" +#include "image_log.h" static const uint8_t GENGERAL_PROFILE_SPACE_SHIFT = 6; static const uint8_t GENERAL_TIER_FLAG_SHIFT = 5; @@ -79,7 +80,9 @@ heif_error HeifHvccBox::ParseContent(HeifStreamReader& reader) // box store content is bitDepthLumaMinus8 config_.bitDepthLuma = (reader.Read8() & 0x07) + BIT_DEPTH_DIFF; + IMAGE_LOGD("Heifparser::chromaFormatIdc :%{public}d", spsConfig_.chromaFormatIdc); config_.bitDepthChroma = (reader.Read8() & 0x07) + BIT_DEPTH_DIFF; + IMAGE_LOGD("Heifparser::bitDepthChroma :%{public}d", spsConfig_.chromaFormatIdc); config_.avgFrameRate = reader.Read16(); tempByte = reader.Read8(); @@ -246,7 +249,9 @@ void HeifHvccBox::ProfileTierLevel(std::vector &nalUnits, uint32_t prof std::vector subLayerProfileIdcs; std::vector> subLayerProfileCompatibilityFlags; if (profilePresentFlag) { - GetWord(nalUnits, READ_BIT_NUM_FLAG); // general_profile_idc + GetWord(nalUnits, TEMPORAL_ID_NESTED_SHIFT); + GetWord(nalUnits, READ_BIT_NUM_FLAG); + GetWord(nalUnits, SUB_LAYER_PROFILE_IDC_SIZE); // general_profile_idc for (uint32_t j = 0; j < READ_GENERAL_PROFILE_IDC_NUM; ++j) { uint32_t flag = GetWord(nalUnits, READ_BIT_NUM_FLAG); @@ -294,8 +299,11 @@ bool HeifHvccBox::ParseNalUnitAnalysisSps(std::vector &nalUnits) { boxBitLength_ = nalUnits.size() * BIT_DEPTH_DIFF; spsConfig_.forbiddenZeroBit = GetWord(nalUnits, READ_BIT_NUM_FLAG); - spsConfig_.nuhTemporalIdPlus1 = GetWord(nalUnits, NUM_TEMPORAL_ID_SIZE); spsConfig_.nalUnitType = GetWord(nalUnits, NALU_TYPE_ID_SIZE); + if (spsConfig_.nalUnitType != SPS_BOX_TYPE) { + return false; + } + spsConfig_.nuhLayerId = GetWord(nalUnits, NUM_TEMPORAL_ID_SIZE); GetWord(nalUnits, SUB_LAYER_MINUS); return ParseSpsSyntax(nalUnits); } @@ -314,6 +322,7 @@ bool HeifHvccBox::ParseSpsSyntax(std::vector &nalUnits) spsConfig_.spsVideoParameterSetId = GetGolombCode(nalUnits); spsConfig_.chromaFormatIdc = GetGolombCode(nalUnits); + IMAGE_LOGD("Heifparser::chromaFormatIdc :%{public}d", spsConfig_.chromaFormatIdc); if (spsConfig_.chromaFormatIdc == SUB_LAYER_MINUS) { spsConfig_.separateColourPlaneFlag = GetWord(nalUnits, READ_BIT_NUM_FLAG); } @@ -327,7 +336,9 @@ bool HeifHvccBox::ParseSpsSyntax(std::vector &nalUnits) spsConfig_.confWinBottomOffset = GetGolombCode(nalUnits); } spsConfig_.bitDepthLumaMinus8 = GetGolombCode(nalUnits); + IMAGE_LOGD("Heifparser::SPS DepthLumaMinus8 :%{public}d", spsConfig_.chromaFormatIdc); spsConfig_.bitDepthChromaMinus8 = GetGolombCode(nalUnits); + IMAGE_LOGD("Heifparser::SPS DepthChromaMinus8 :%{public}d", spsConfig_.chromaFormatIdc); spsConfig_.log2MaxPicOrderCntLsbMinus4 = GetGolombCode(nalUnits); spsConfig_.spsSubLayerOrderingInfoPresentFlag = GetWord(nalUnits, READ_BIT_NUM_FLAG); uint32_t i = spsConfig_.spsSubLayerOrderingInfoPresentFlag ? 0 : spsConfig_.spsMaxSubLayersMinus1; @@ -390,6 +401,7 @@ bool HeifHvccBox::ParseSpsVuiParameter(std::vector &nalUnits) if (videoSignalTypePresentFlag) { GetWord(nalUnits, SUB_LAYER_MINUS); spsConfig_.videoRangeFlag = GetWord(nalUnits, READ_BIT_NUM_FLAG); + IMAGE_LOGD("Heifparser::SPS DepthChromaMinus8 :%{public}d", spsConfig_.chromaFormatIdc); } return true; } diff --git a/plugins/manager/include/image/abs_image_decoder.h b/plugins/manager/include/image/abs_image_decoder.h index 8d741718086dad13f14e45e791ab7c569da78098..adc98aa9b1ccc33257c20e7b548b7269170603ff 100644 --- a/plugins/manager/include/image/abs_image_decoder.h +++ b/plugins/manager/include/image/abs_image_decoder.h @@ -89,6 +89,8 @@ struct DecodeContext { ColorManager::ColorSpaceName grColorSpaceName = ColorManager::NONE; // In: User set allocatorType. bool isAppUseAllocator = false; + // In : User set CreateWideGamutSdrPixelMap + bool isCreateWideGamutSdrPixelMap = false; }; struct ProgDecodeContext {