* rocDecode/HEVC: Added empty NAL detection. (#452)

Dieser Commit ist enthalten in:
jeffqjiangNew
2024-11-13 13:28:29 -05:00
committet von GitHub
Ursprung 6b37dd606f
Commit b3f8fec41b
2 geänderte Dateien mit 5 neuen und 6 gelöschten Zeilen
+4 -5
Datei anzeigen
@@ -139,11 +139,10 @@ ParserResult RocVideoParser::GetNalUnit() {
start_code_found = true;
start_code_num_++;
next_start_code_offset_ = curr_byte_offset_;
// Move the pointer (3 + 2) bytes forward (start_code + nal header)
curr_byte_offset_ += 5;
// Move the pointer 3 bytes forward
curr_byte_offset_ += 3;
// For the very first NAL unit, search for the next start code (or reach the end of frame)
// also detect empty nal units with no data
if (start_code_num_ == 1 ) {
start_code_found = false;
curr_start_code_offset_ = next_start_code_offset_;
@@ -153,7 +152,7 @@ ParserResult RocVideoParser::GetNalUnit() {
}
}
curr_byte_offset_++;
}
}
if (start_code_num_ == 0) {
// No NAL unit in the frame data
return PARSER_NOT_FOUND;
@@ -164,7 +163,7 @@ ParserResult RocVideoParser::GetNalUnit() {
} else {
nal_unit_size_ = pic_data_size_ - curr_start_code_offset_;
return PARSER_EOF;
}
}
}
size_t RocVideoParser::EbspToRbsp(uint8_t *streamBuffer,size_t begin_bytepos, size_t end_bytepos) {