Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
Ignore av1 reserved units
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyichix committed Jul 20, 2022
1 parent 9264f6a commit e1f58c9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion _studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ namespace UMC_AV1_DECODER
info.num_ticks_per_picture_minus_1 = read_uvlc(bs);
}

inline bool av1_obu_type_is_reserved(AV1_OBU_TYPE& obu_type)
{
return 0 == obu_type || (9 <= obu_type && 14 >= obu_type);
}

static void av1_color_config(AV1Bitstream& bs, ColorConfig& config, uint32_t profile)
{
AV1D_LOG("[+]: %d", (uint32_t)bs.BitsDecoded());
Expand Down Expand Up @@ -1198,7 +1203,8 @@ namespace UMC_AV1_DECODER

if (info.header.obu_has_size_field)
av1_read_obu_size(*this, obu_size, sizeFieldLength);
else if (info.header.obu_type != OBU_TEMPORAL_DELIMITER)
// Av1-spec section 6.2.2: Reserved units are for future use and shall be ignored by AV1 decoder.
else if (info.header.obu_type != OBU_TEMPORAL_DELIMITER && !av1_obu_type_is_reserved(info.header.obu_type))
throw av1_exception(UMC::UMC_ERR_NOT_IMPLEMENTED); // no support for OBUs w/o size field so far

info.size = headerSize + sizeFieldLength + obu_size;
Expand Down

0 comments on commit e1f58c9

Please sign in to comment.