* rocDecoder/Bitstream reader: Added stream type detection optimization. (#522)
- During stream type evaluation, when we have a high confidence score, we stop and finalize, to avoid unnecessary exhaustive type search.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
a5863bceba
Коммит
5f779a6eb7
@@ -10,6 +10,8 @@ Full documentation for rocDecode is available at [https://rocm.docs.amd.com/proj
|
||||
|
||||
### Changed
|
||||
|
||||
* Bitstream type detection optimization in bitstream reader.
|
||||
|
||||
### Removed
|
||||
|
||||
## rocDecode 0.10.0 for ROCm 6.4
|
||||
|
||||
@@ -585,6 +585,9 @@ int RocVideoESParser::ProbeStreamType() {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (stream_type_score >= STREAM_TYPE_HIGH_CONFIDENCE_SCORE_THRESHOLD) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (stream_buf) {
|
||||
@@ -688,7 +691,7 @@ int RocVideoESParser::CheckAvcEStream(uint8_t *p_stream, int stream_size) {
|
||||
if (num_start_codes == 0) {
|
||||
score = 0;
|
||||
} else {
|
||||
score = sps_present * 25 + pps_present * 25 + idr_slice_present * 15 + slice_present * 15 + first_slice_present * 15;
|
||||
score = sps_present * 25 + pps_present * 25 + idr_slice_present * 20 + slice_present * 15 + first_slice_present * 15;
|
||||
}
|
||||
return score;
|
||||
}
|
||||
@@ -832,7 +835,7 @@ int RocVideoESParser::CheckHevcEStream(uint8_t *p_stream, int stream_size) {
|
||||
if (num_start_codes == 0) {
|
||||
score = 0;
|
||||
} else {
|
||||
score = vps_present * 20 + sps_present * 20 + pps_present * 20 + rap_slice_present * 15 + slice_present * 15 + first_slice_present * 15;
|
||||
score = vps_present * 15 + sps_present * 20 + pps_present * 20 + rap_slice_present * 15 + slice_present * 15 + first_slice_present * 15;
|
||||
}
|
||||
return score;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ enum {
|
||||
|
||||
#define STREAM_PROBE_SIZE 2 * 1024
|
||||
#define STREAM_TYPE_SCORE_THRESHOLD 50
|
||||
#define STREAM_TYPE_HIGH_CONFIDENCE_SCORE_THRESHOLD 90
|
||||
|
||||
class RocVideoESParser {
|
||||
public:
|
||||
|
||||
Ссылка в новой задаче
Block a user