Check only VPS, SPS, and PPS nal types for completeness.
This commit is contained in:
1 parent
0112e63f0f
commit
4f72d8aabd
1 file changed
+11
-1
@@ -1166,6 +1166,9 @@ struct NAL_units{
|
||||
UInt16 numNalus;
|
||||
};
|
||||
|
||||
#define NAL_UNIT_VPS 32
|
||||
#define NAL_UNIT_SPS 33
|
||||
#define NAL_UNIT_PPS 34
|
||||
|
||||
typedef struct HEVCConfig {
|
||||
UInt8 configurationVersion;
|
||||
@@ -1241,9 +1244,10 @@ int analyze_HEVC(const uint8_t *cookie, uint32_t cookieLen, bool *completeness)
|
||||
info->NAL_units = (struct NAL_units *)malloc(sizeof(struct NAL_units) * info->numOfArrays);
|
||||
|
||||
for (UInt8 j = 0; j < info->numOfArrays; j++) {
|
||||
bool unitIsComplete = true;
|
||||
info->NAL_units[j].array_completeness = b.GetBits(1);
|
||||
if (info->NAL_units[j].array_completeness == 0) {
|
||||
complete = false;
|
||||
unitIsComplete = false;
|
||||
}
|
||||
|
||||
b.SkipBits(1); // reserved 0
|
||||
@@ -1251,6 +1255,12 @@ int analyze_HEVC(const uint8_t *cookie, uint32_t cookieLen, bool *completeness)
|
||||
info->NAL_units[j].NAL_unit_type = b.GetBits(6);
|
||||
info->NAL_units[j].numNalus = b.GetBits(16);
|
||||
|
||||
if (info->NAL_units[j].NAL_unit_type == NAL_UNIT_VPS ||
|
||||
info->NAL_units[j].NAL_unit_type == NAL_UNIT_SPS ||
|
||||
info->NAL_units[j].NAL_unit_type == NAL_UNIT_PPS) {
|
||||
complete = unitIsComplete;
|
||||
}
|
||||
|
||||
for (UInt8 i = 0; i < info->NAL_units[j].numNalus; i++) {
|
||||
UInt16 nalUnitLength = b.GetBits(16);
|
||||
b.SkipBits(8 * nalUnitLength);
|
||||
|
||||
Reference in new issue
Block a user