Skip to content

Commit

Permalink
Merge pull request #570 from IENT/feature/ShowLayerInHEVCNALs
Browse files Browse the repository at this point in the history
Show Nal layer ID if its > 0
  • Loading branch information
ChristianFeldmann committed Mar 24, 2024
2 parents 5928954 + 3445809 commit f7b50b8
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 f7b50b8

Please sign in to comment.