Skip to content

Commit

Permalink
Show Nal layer ID if its > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Mar 20, 2024
1 parent 5928954 commit 3445809
Showing 1 changed file with 17 additions and 2 deletions.
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

0 comments on commit 3445809

Please sign in to comment.