Skip to content

Commit

Permalink
H265: Refine reference page num.
Browse files Browse the repository at this point in the history
  • Loading branch information
chundonglinlin committed Jan 16, 2023
1 parent 7a7f6d8 commit 64bc408
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions trunk/src/app/srs_app_statistic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ struct SrsStatisticStream
// The level_idc, ISO_IEC_14496-10-AVC-2003.pdf, page 45.
SrsAvcLevel avc_level;
#ifdef SRS_H265
// The profile_idc, ITU-T-H.265-2021.pdf, page 559.
// The profile_idc, ITU-T-H.265-2021.pdf, page 62.
SrsHevcProfile hevc_profile;
// The level_idc, ITU-T-H.265-2021.pdf, page 684.
// The level_idc, ITU-T-H.265-2021.pdf, page 63.
SrsHevcLevel hevc_level;
#endif
// The width and height in codec info.
Expand Down
18 changes: 9 additions & 9 deletions trunk/src/kernel/srs_kernel_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,8 @@ srs_error_t SrsFormat::hevc_demux_vps(SrsBuffer *stream)
}

// nal_unit_type specifies the type of RBSP data structure contained in the NAL unit as specified in Table 7-1.
// @see 7.4.2 NAL unit semantics
// @doc ITU-T-H.265-2021.pdf, page 64.
// @see 7.4.2.2 NAL unit header semantics
// @doc ITU-T-H.265-2021.pdf, page 86.
SrsHevcNaluType nal_unit_type = (SrsHevcNaluType)((nutv >> 1) & 0x3f);
if (nal_unit_type != SrsHevcNaluType_VPS) {
return srs_error_new(ERROR_HEVC_DECODE_ERROR, "hevc vps nal_unit_type=%d shall be equal to 33", nal_unit_type);
Expand Down Expand Up @@ -1143,8 +1143,8 @@ srs_error_t SrsFormat::hevc_demux_vps_rbsp(char* rbsp, int nb_rbsp)
SrsBuffer stream(rbsp, nb_rbsp);

// H265 VPS (video_parameter_set_rbsp()) NAL Unit.
// Section 7.3.2.1 ("Video parameter set data syntax") of the H.265
// ITU-T-H.265-2021.pdf, page 53.
// Section 7.3.2.1 ("Video parameter set RBSP syntax") of the H.265
// ITU-T-H.265-2021.pdf, page 54.
if (!stream.require(4)) {
return srs_error_new(ERROR_HEVC_DECODE_ERROR, "vps requires 4 only %d bytes", stream.left());
}
Expand Down Expand Up @@ -1328,8 +1328,8 @@ srs_error_t SrsFormat::hevc_demux_sps(SrsBuffer *stream)
}

// nal_unit_type specifies the type of RBSP data structure contained in the NAL unit as specified in Table 7-1.
// @see 7.4.2 NAL unit semantics
// @doc ITU-T-H.265-2021.pdf, page 64.
// @see 7.4.2.2 NAL unit header semantics
// @doc ITU-T-H.265-2021.pdf, page 86.
SrsHevcNaluType nal_unit_type = (SrsHevcNaluType)((nutv >> 1) & 0x3f);
if (nal_unit_type != SrsHevcNaluType_SPS) {
return srs_error_new(ERROR_HEVC_DECODE_ERROR, "hevc sps nal_unit_type=%d shall be equal to 33", nal_unit_type);
Expand Down Expand Up @@ -1378,7 +1378,7 @@ srs_error_t SrsFormat::hevc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
SrsBuffer stream(rbsp, nb_rbsp);

// H265 SPS Nal Unit (seq_parameter_set_rbsp()) parser.
// Section 7.3.2.2 ("Sequence parameter set data syntax") of the H.265
// Section 7.3.2.2 ("Sequence parameter set RBSP syntax") of the H.265
// ITU-T-H.265-2021.pdf, page 55.
if (!stream.require(2)) {
return srs_error_new(ERROR_HEVC_DECODE_ERROR, "sps requires 2 only %d bytes", stream.left());
Expand Down Expand Up @@ -1516,7 +1516,7 @@ srs_error_t SrsFormat::hevc_demux_sps_rbsp(char* rbsp, int nb_rbsp)
srs_error_t SrsFormat::hevc_demux_pps(SrsBuffer *stream)
{
// for NALU, ITU-T H.265 7.3.2.3 Picture parameter set RBSP syntax
// @see 7.3.2.3.1 General picture parameter set RBSP syntax
// @see 7.3.2.3 Picture parameter set RBSP syntax
// @doc ITU-T-H.265-2021.pdf, page 57.
if (!stream->require(1)) {
return srs_error_new(ERROR_HEVC_DECODE_ERROR, "decode hevc pps requires 1 only %d bytes", stream->left());
Expand Down Expand Up @@ -1574,7 +1574,7 @@ srs_error_t SrsFormat::hevc_demux_pps_rbsp(char* rbsp, int nb_rbsp)
SrsBuffer stream(rbsp, nb_rbsp);

// H265 PPS NAL Unit (pic_parameter_set_rbsp()) parser.
// Section 7.3.2.3 ("Parameter parameter set data syntax") of the H.265
// Section 7.3.2.3 ("Picture parameter set RBSP syntax") of the H.265
// ITU-T-H.265-2021.pdf, page 57.
SrsBitBuffer bs(&stream);

Expand Down
16 changes: 8 additions & 8 deletions trunk/src/kernel/srs_kernel_codec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,6 @@ struct SrsHevcRbspVps
/**
* Sequence Parameter Set
* @see 7.3.2.2 Sequence parameter set RBSP syntax
* 7.3.2.2.1 General sequence parameter set RBSP syntax
* @doc ITU-T-H.265-2021.pdf, page 55.
*/
struct SrsHevcRbspSps
Expand Down Expand Up @@ -823,7 +822,6 @@ struct SrsHevcRbspSps
/**
* Picture Parameter Set
* @see 7.3.2.3 Picture parameter set RBSP syntax
* 7.3.2.3.1 General picture parameter set RBSP syntax
* @doc ITU-T-H.265-2021.pdf, page 57.
*/
struct SrsHevcRbspPps
Expand Down Expand Up @@ -1034,8 +1032,9 @@ std::string srs_avc_level2str(SrsAvcLevel level);
#ifdef SRS_H265

/**
* the profile for hevc/h.265.
* @see Annex A Profiles and levels, ITU-T-H.265-2021.pdf, page 559.
* the profile for hevc/h.265, Annex A Profiles, tiers and levels
* @see A.3 Profiles
* @doc ITU-T-H.265-2021.pdf, page 268.
*/
enum SrsHevcProfile
{
Expand All @@ -1050,8 +1049,9 @@ enum SrsHevcProfile
std::string srs_hevc_profile2str(SrsHevcProfile profile);

/**
* the level for hevc/h.265.
* @see Annex A Profiles and levels, ITU-T-H.265-2021.pdf, page 684.
* the level for hevc/h.265, Annex A Profiles, tiers and levels
* @see A.4 Tiers and levels
* @doc ITU-T-H.265-2021.pdf, page 283.
*/
enum SrsHevcLevel
{
Expand Down Expand Up @@ -1190,9 +1190,9 @@ class SrsVideoCodecConfig : public SrsCodecConfig
// level_idc, ISO_IEC_14496-10-AVC-2003.pdf, page 45.
SrsAvcLevel avc_level;
#ifdef SRS_H265
// The profile_idc, ITU-T-H.265-2021.pdf, page 559.
// The profile_idc, ITU-T-H.265-2021.pdf, page 62.
SrsHevcProfile hevc_profile;
// The level_idc, ITU-T-H.265-2021.pdf, page 684.
// The level_idc, ITU-T-H.265-2021.pdf, page 63.
SrsHevcLevel hevc_level;
#endif
// lengthSizeMinusOne, ISO_IEC_14496-15-AVC-format-2012.pdf, page 16
Expand Down

0 comments on commit 64bc408

Please sign in to comment.