heif解码aireview修改

Signed-off-by: liujinhong <liujinhong6@huawei.com>
This commit is contained in:
liujinhong 2024-10-26 14:48:27 +08:00
parent a2fa421ee6
commit 4a19512a3b
2 changed files with 9 additions and 7 deletions

View File

@ -42,7 +42,6 @@ enum heif_error {
heif_invalid_exif_data = 20,
heif_invalid_mirror_direction = 21,
heif_error_grid_too_large = 22,
heif_invalid_color_range_flag = 23,
};
} // namespace ImagePlugin
} // namespace OHOS

View File

@ -219,12 +219,16 @@ std::vector<uint8_t> HeifHvccBox::GetNaluData(const std::vector<HvccNalArray> &n
void HeifHvccBox::ProcessBoxData(std::vector<uint8_t> &nalu)
{
int naluSize = nalu.size();
std::vector<int> indicesToDelete;
for (int i = UINT16_BYTES_NUM; i < naluSize; ++i) {
if (nalu[i - UINT8_BYTES_NUM] == 0x00 &&
nalu[i - SKIP_DOUBLE_DATA_PROCESS_BYTE] == 0x00 && nalu[i] == 0x03) {
nalu.erase(nalu.begin() + i);
indicesToDelete.push_back(i);
}
}
for (auto it = indicesToDelete.rbegin(); it != indicesToDelete.rend(); ++it) {
nalu.erase(nalu.begin() + *it);
}
}
void HeifHvccBox::ParserHvccColorRangeFlag(const std::vector<HvccNalArray> &nalArrays)
@ -356,13 +360,12 @@ void HeifHvccBox::ReadGolombCodesForSizeId(std::vector<uint8_t> &nalUnits, int s
void HeifHvccBox::ParseSpsScallListData(std::vector<uint8_t> &nalUnits)
{
std::vector<std::vector<int>> scalingListPredModeFlag;
for (int sizeId = 0; sizeId < GENERAL_PROFILE_SIZE; ++sizeId) {
for (int matrixId = 0; matrixId < NUM_TEMPORAL_ID_SIZE;
matrixId += ((sizeId == SUB_LAYER_MINUS) ? SUB_LAYER_MINUS : READ_BIT_NUM_FLAG)) {
scalingListPredModeFlag[sizeId][matrixId] = GetWord(nalUnits, READ_BIT_NUM_FLAG);
if (!scalingListPredModeFlag[sizeId][matrixId]) {
scalingListPredModeFlag[sizeId][matrixId] = GetGolombCode(nalUnits);
matrixId += ((sizeId == SUB_LAYER_MINUS) ? SUB_LAYER_MINUS : READ_BIT_NUM_FLAG)) {
uint8_t tmpFlag = GetWord(nalUnits, READ_BIT_NUM_FLAG);
if (!tmpFlag) {
GetGolombCode(nalUnits);
} else {
ReadGolombCodesForSizeId(nalUnits, sizeId);
}