diff --git a/_studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h b/_studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h index a03177ccd6..8d1f2233a6 100644 --- a/_studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h +++ b/_studio/shared/umc/codec/av1_dec/include/umc_av1_dec_defs.h @@ -104,6 +104,7 @@ namespace UMC_AV1_DECODER enum AV1_OBU_TYPE { + OBU_RESERVED_0 = 0, OBU_SEQUENCE_HEADER = 1, OBU_TEMPORAL_DELIMITER = 2, OBU_FRAME_HEADER = 3, @@ -112,6 +113,12 @@ namespace UMC_AV1_DECODER OBU_FRAME = 6, OBU_REDUNDANT_FRAME_HEADER = 7, OBU_TILE_LIST = 8, + OBU_RESERVED_9 = 9, + OBU_RESERVED_10 = 10, + OBU_RESERVED_11 = 11, + OBU_RESERVED_12 = 12, + OBU_RESERVED_13 = 13, + OBU_RESERVED_14 = 14, OBU_PADDING = 15, }; diff --git a/_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp b/_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp index 8be3ea77c4..e8cf88a85a 100644 --- a/_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp +++ b/_studio/shared/umc/codec/av1_dec/src/umc_av1_bitstream.cpp @@ -81,6 +81,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 OBU_RESERVED_0 == obu_type || (OBU_RESERVED_9 <= obu_type && OBU_RESERVED_14 >= obu_type); + } + static void av1_color_config(AV1Bitstream& bs, ColorConfig& config, uint32_t profile) { AV1D_LOG("[+]: %d", (uint32_t)bs.BitsDecoded()); @@ -1211,7 +1216,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;