TSDuck v3.38-3696
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::HEVCShortTermReferencePictureSetList Class Reference

List of HEVC short-term reference picture sets. More...

#include <tsHEVCShortTermReferencePictureSetList.h>

Inheritance diagram for ts::HEVCShortTermReferencePictureSetList:
Collaboration diagram for ts::HEVCShortTermReferencePictureSetList:

Classes

class  ShortTermReferencePictureSet
 HEVC short-term reference picture set. More...
 

Public Types

using SuperClass = AbstractVideoStructure
 Reference to the superclass.
 

Public Member Functions

 HEVCShortTermReferencePictureSetList (const uint8_t *data=nullptr, size_t size=0, uint32_t num_short_term_ref_pic_sets=0)
 Constructor from a binary area.
 
virtual void clear () override
 Clear all values.
 
virtual std::ostream & display (std::ostream &=std::cout, const UString &margin=UString(), int level=Severity::Info) const override
 Display the content of this object to a stream.
 
uint32_t num_short_term_ref_pic_sets () const
 Get the num_short_term_ref_pic_sets parameter of the list of st_ref_pic_set structures.
 
virtual bool parse (AVCParser &, std::initializer_list< uint32_t >=std::initializer_list< uint32_t >()) override
 Parse the structure.
 
virtual bool parse (const uint8_t *, size_t, std::initializer_list< uint32_t >=std::initializer_list< uint32_t >()) override
 Parse a memory area containing binary video data of the expected type.
 
bool reset (uint32_t num_short_term_ref_pic_sets)
 Reset this object, makes it valid, resize the vector with empty st_ref_pic_set structures.
 

Public Attributes

std::vector< ShortTermReferencePictureSetlist {}
 The list of ShortTermReferencePictureSet is organized as a vector.
 
bool valid = false
 Valid flag.
 

Protected Member Functions

template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void disp (std::ostream &out, const UString &margin, const UChar *name, INT n) const
 Display helper for subclasses.
 
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void disp (std::ostream &out, const UString &margin, const UChar *name, std::vector< INT > n) const
 Display helper for subclasses.
 

Detailed Description

List of HEVC short-term reference picture sets.

See also
ITU-T Rec. H.265, 7.3.7 and 7.4.8.

The HEVC structure st_ref_pic_set(stRpsIdx) is defined in 7.3.7 for index stRpsIdx. This index ranges from 0 to num_short_term_ref_pic_sets. The structure at index i may reference similar structures at lower indexes. So, a st_ref_pic_set cannot be used alone, it needs a reference to the previous instances.

The structure st_ref_pic_set(stRpsIdx) is used in two structures:

  • In sequence parameter set (7.3.2.2), an array of index 0 to num_short_term_ref_pic_sets - 1.
  • in slice segment header (7.3.6), last element, index num_short_term_ref_pic_sets.

As a consequence, the st_ref_pic_set structure is not defined as an AbstractVideoStructure because it cannot be parsed alone. The AbstractVideoStructure is a vector of st_ref_pic_set. The vector structure is used because the st_ref_pic_set structure are accessed by index.

The constructor parses a list of num_short_term_ref_pic_sets - 1 elements.

Unlike other AbstractVideoStructure subclasses, the parse() methods do no clear the content and do not rebuild the complete object. The parse() methods only parse one st_ref_pic_set structure which is placed in an existing element of the vector. The parse() methods need one argument: the stRpsIdx index of the element to parse from memory.

To completely rebuild a new HEVCShortTermReferencePictureSetList, use reset() and then parse each element is sequence.

Constructor & Destructor Documentation

◆ HEVCShortTermReferencePictureSetList()

ts::HEVCShortTermReferencePictureSetList::HEVCShortTermReferencePictureSetList ( const uint8_t *  data = nullptr,
size_t  size = 0,
uint32_t  num_short_term_ref_pic_sets = 0 
)

Constructor from a binary area.

The constructor resizes the vector with num_short_term_ref_pic_sets + 1 elements and parses the elements indexes from 0 to num_short_term_ref_pic_sets. The last element is left uninitialized.

Parameters
[in]dataAddress of binary data to analyze.
[in]sizeSize in bytes of binary data to analyze.
[in]num_short_term_ref_pic_setsThe corresponding HEVC parameter.

Member Function Documentation

◆ reset()

bool ts::HEVCShortTermReferencePictureSetList::reset ( uint32_t  num_short_term_ref_pic_sets)

Reset this object, makes it valid, resize the vector with empty st_ref_pic_set structures.

Parameters
[in]num_short_term_ref_pic_setsThe corresponding HEVC parameter.
Returns
True on success, false on invalid size.

◆ num_short_term_ref_pic_sets()

uint32_t ts::HEVCShortTermReferencePictureSetList::num_short_term_ref_pic_sets ( ) const
inline

Get the num_short_term_ref_pic_sets parameter of the list of st_ref_pic_set structures.

In practice, this is the size of the list of the ShortTermReferencePictureSet. The ShortTermReferencePictureSet index 0 to num_short_term_ref_pic_sets - 1 are stored in the HEVCSequenceParameterSet. The one with index num_short_term_ref_pic_sets, when present, is directly stored in the slice header.

Returns
The num_short_term_ref_pic_sets parameter of the list of st_ref_pic_set structures.

◆ clear()

virtual void ts::HEVCShortTermReferencePictureSetList::clear ( )
overridevirtual

Clear all values.

Should be reimplemented by subclasses. The data are marked invalid.

Reimplemented from ts::AbstractVideoData.

◆ parse() [1/2]

virtual bool ts::HEVCShortTermReferencePictureSetList::parse ( const uint8_t *  addr,
size_t  size,
std::initializer_list< uint32_t >  params = std::initializer_list< uint32_t >() 
)
overridevirtual

Parse a memory area containing binary video data of the expected type.

Must be reimplemented by subclasses. The data are marked as valid or invalid.

Parameters
[in]addrAddress of the binary data to parse.
[in]sizeSize in bytes of the binary data to parse.
[in]paramsAdditional parameters. May be needed by some structures.
Returns
The valid flag.

Reimplemented from ts::AbstractVideoStructure.

◆ parse() [2/2]

virtual bool ts::HEVCShortTermReferencePictureSetList::parse ( AVCParser parser,
std::initializer_list< uint32_t >  params = std::initializer_list< uint32_t >() 
)
overridevirtual

Parse the structure.

Must be reimplemented by subclasses. The data are marked as valid or invalid.

Parameters
[in,out]parserThe parser of an AVC stream.
[in]paramsAdditional parameters. May be needed by some structures.
Returns
The valid flag.

Implements ts::AbstractVideoStructure.

◆ display()

virtual std::ostream & ts::HEVCShortTermReferencePictureSetList::display ( std::ostream &  stream = std::cout,
const UString margin = UString(),
int  level = Severity::Info 
) const
overridevirtual

Display the content of this object to a stream.

Parameters
[in,out]streamThe stream where to print the content. Standard output by default.
[in]marginThe prefix string on each line, empty by default.
[in]levelSeverity level (for instance, Severity::Info or Severity::Debug may display more information).
Returns
A reference to stream.

Implements ts::DisplayInterface.

◆ disp() [1/2]

template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::AbstractVideoData::disp ( std::ostream &  out,
const UString margin,
const UChar name,
INT  n 
) const
inlineprotectedinherited

Display helper for subclasses.

Display an integer value.

Template Parameters
INTAn integer type.
Parameters
[in,out]outThe stream where to print the content.
[in]marginThe prefix string on each line.
[in]nameA name to display for the value.
[in]nThe integer value to display.

◆ disp() [2/2]

template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr>
void ts::AbstractVideoData::disp ( std::ostream &  out,
const UString margin,
const UChar name,
std::vector< INT n 
) const
inlineprotectedinherited

Display helper for subclasses.

Display a vector of integer value.

Template Parameters
INTAn integer type.
Parameters
[in,out]outThe stream where to print the content.
[in]marginThe prefix string on each line.
[in]nameA name to display for the value.
[in]nThe integer values to display.

Member Data Documentation

◆ valid

bool ts::AbstractVideoData::valid = false
inherited

Valid flag.

Other fields are significant only if valid is true.


The documentation for this class was generated from the following file: