AV1 error resilience: Added tile size error detection and handling. (#580)
* * AV1 error resilience: Added tile size error detection and handling. Also added additional update to change log for PR#574. * * Wording change in change log. * * Updated change log based on review comments.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
cf85e6c46c
Коммит
41338c40f3
@@ -28,6 +28,10 @@ Full documentation for rocDecode is available at [https://rocm.docs.amd.com/proj
|
||||
|
||||
* GetStream() interface call from RocVideoDecoder utility class
|
||||
|
||||
### Changed
|
||||
|
||||
* Changed asserts in query API calls in RocVideoDecoder utility class to error reports, to avoid hard stop during query in case error occurs and to let the caller decide actions.
|
||||
|
||||
## rocDecode 0.10.0 for ROCm 6.4
|
||||
|
||||
### Added
|
||||
|
||||
@@ -119,7 +119,10 @@ ParserResult Av1VideoParser::ParsePictureData(const uint8_t *p_stream, uint32_t
|
||||
obu_byte_offset_ += bytes_parsed;
|
||||
if (obu_size_ > bytes_parsed) {
|
||||
obu_size_ -= bytes_parsed;
|
||||
ParseTileGroupObu(pic_data_buffer_ptr_ + obu_byte_offset_, obu_size_);
|
||||
if (ParseTileGroupObu(pic_data_buffer_ptr_ + obu_byte_offset_, obu_size_) != PARSER_OK) {
|
||||
ERR("Error occurred in ParseTileGroupObu(). Skip this OBU.");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ERR("Frame OBU size error.");
|
||||
return PARSER_OUT_OF_RANGE;
|
||||
@@ -127,7 +130,9 @@ ParserResult Av1VideoParser::ParsePictureData(const uint8_t *p_stream, uint32_t
|
||||
break;
|
||||
}
|
||||
case kObuTileGroup: {
|
||||
ParseTileGroupObu(pic_data_buffer_ptr_ + obu_byte_offset_, obu_size_);
|
||||
if (ParseTileGroupObu(pic_data_buffer_ptr_ + obu_byte_offset_, obu_size_) != PARSER_OK) {
|
||||
ERR("Error occurred in ParseTileGroupObu(). Skip this OBU.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -1230,7 +1235,7 @@ ParserResult Av1VideoParser::ParseUncompressedHeader(uint8_t *p_stream, size_t s
|
||||
return PARSER_OK;
|
||||
}
|
||||
|
||||
void Av1VideoParser::ParseTileGroupObu(uint8_t *p_stream, size_t size) {
|
||||
ParserResult Av1VideoParser::ParseTileGroupObu(uint8_t *p_stream, size_t size) {
|
||||
size_t offset = 0; // current bit offset
|
||||
Av1FrameHeader *p_frame_header = &frame_header_;
|
||||
Av1TileGroupDataInfo *p_tile_group = &tile_group_data_;
|
||||
@@ -1272,6 +1277,7 @@ void Av1VideoParser::ParseTileGroupObu(uint8_t *p_stream, size_t size) {
|
||||
} else {
|
||||
uint32_t tile_size_bytes = p_frame_header->tile_info.tile_size_bytes_minus_1 + 1;
|
||||
uint32_t tile_size = ReadLeBytes(p_tg_buf, tile_size_bytes) + 1;
|
||||
CHECK_ALLOWED_MAX("Tile size", tile_size, tg_size);
|
||||
p_tile_group->tile_data_info[tile_num].tile_size = tile_size;
|
||||
p_tile_group->tile_data_info[tile_num].tile_offset = p_tg_buf + tile_size_bytes - p_tile_group->buffer_ptr;
|
||||
tg_size -= tile_size + tile_size_bytes;
|
||||
@@ -1290,6 +1296,7 @@ void Av1VideoParser::ParseTileGroupObu(uint8_t *p_stream, size_t size) {
|
||||
}
|
||||
seen_frame_header_ = 0;
|
||||
}
|
||||
return PARSER_OK;
|
||||
}
|
||||
|
||||
void Av1VideoParser::ParseColorConfig(const uint8_t *p_stream, size_t &offset, Av1SequenceHeader *p_seq_header) {
|
||||
|
||||
@@ -226,9 +226,9 @@ protected:
|
||||
/*! \brief Function to parse a tile group OBU
|
||||
* \param [in] p_stream Pointer to the bit stream
|
||||
* \param [in] size Byte size of the stream
|
||||
* \return None
|
||||
* \return <tt>ParserResult</tt>
|
||||
*/
|
||||
void ParseTileGroupObu(uint8_t *p_stream, size_t size);
|
||||
ParserResult ParseTileGroupObu(uint8_t *p_stream, size_t size);
|
||||
|
||||
/*! \brief Function to parse color config in sequence header
|
||||
* \param [in] p_stream Pointer to the bit stream
|
||||
|
||||
Ссылка в новой задаче
Block a user