Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Nal layer ID if its > 0 #570

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions YUViewLib/src/parser/HEVC/ParserAnnexBHEVC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ namespace parser

using namespace hevc;

namespace
{

std::string formatNalPOCDetail(const int poc, const unsigned nuh_layer_id)
{
std::string str = " (POC " + std::to_string(poc);
if (nuh_layer_id > 0)
str += " Layer " + std::to_string(nuh_layer_id);
str += ")";
return str;
}

} // namespace

double ParserAnnexBHEVC::getFramerate() const
{
// First try to get the framerate from the parameter sets themselves
Expand Down Expand Up @@ -500,8 +514,9 @@ ParserAnnexBHEVC::parseAndAddNALUnit(int
}
currentSliceType = to_string(newSlice->sliceSegmentHeader.slice_type);

specificDescription += " (POC " + std::to_string(poc) + ")";
parseResult.nalTypeName = "Slice(POC " + std::to_string(poc) + ")";
const auto pocDetail = formatNalPOCDetail(poc, nalHEVC->header.nuh_layer_id);
specificDescription += pocDetail;
parseResult.nalTypeName = "Slice" + pocDetail;

DEBUG_HEVC("ParserAnnexBHEVC::parseAndAddNALUnit Slice POC "
<< poc << " - pocCounterOffset " << this->pocCounterOffset << " maxPOCCount "
Expand Down