关于H265的IDR Frame 和 IFrame的判断

首先参考开源的:libde265

https://github.com/strukturag/libde265/blob/master/libde265/nal.h

 

#define NAL_UNIT_TRAIL_N  0
#define NAL_UNIT_TRAIL_R  1
#define NAL_UNIT_TSA_N    2
#define NAL_UNIT_TSA_R    3
#define NAL_UNIT_STSA_N   4
#define NAL_UNIT_STSA_R   5
#define NAL_UNIT_RADL_N   6
#define NAL_UNIT_RADL_R   7
#define NAL_UNIT_RASL_N   8
#define NAL_UNIT_RASL_R   9
#define NAL_UNIT_RESERVED_VCL_N10  10
#define NAL_UNIT_RESERVED_VCL_N12  12
#define NAL_UNIT_RESERVED_VCL_N14  14
#define NAL_UNIT_RESERVED_VCL_R11  11
#define NAL_UNIT_RESERVED_VCL_R13  13
#define NAL_UNIT_RESERVED_VCL_R15  15
#define NAL_UNIT_BLA_W_LP   16     // BLA = broken link access
#define NAL_UNIT_BLA_W_RADL 17
#define NAL_UNIT_BLA_N_LP   18
#define NAL_UNIT_IDR_W_RADL 19
#define NAL_UNIT_IDR_N_LP   20
#define NAL_UNIT_CRA_NUT    21     // CRA = clean random access
#define NAL_UNIT_RESERVED_IRAP_VCL22 22
#define NAL_UNIT_RESERVED_IRAP_VCL23 23
#define NAL_UNIT_RESERVED_VCL24     24
#define NAL_UNIT_RESERVED_VCL25     25
#define NAL_UNIT_RESERVED_VCL26     26
#define NAL_UNIT_RESERVED_VCL27     27
#define NAL_UNIT_RESERVED_VCL28     28
#define NAL_UNIT_RESERVED_VCL29     29
#define NAL_UNIT_RESERVED_VCL30     30
#define NAL_UNIT_RESERVED_VCL31     31
#define NAL_UNIT_VPS_NUT       32
#define NAL_UNIT_SPS_NUT       33
#define NAL_UNIT_PPS_NUT       34
#define NAL_UNIT_AUD_NUT       35
#define NAL_UNIT_EOS_NUT       36
#define NAL_UNIT_EOB_NUT       37
#define NAL_UNIT_FD_NUT        38
#define NAL_UNIT_PREFIX_SEI_NUT 39
#define NAL_UNIT_SUFFIX_SEI_NUT 40
#define NAL_UNIT_RESERVED_NVCL41     41
#define NAL_UNIT_RESERVED_NVCL42     42
#define NAL_UNIT_RESERVED_NVCL43     43
#define NAL_UNIT_RESERVED_NVCL44     44
#define NAL_UNIT_RESERVED_NVCL45     45
#define NAL_UNIT_RESERVED_NVCL46     46
#define NAL_UNIT_RESERVED_NVCL47     47

#define NAL_UNIT_UNDEFINED    255

bool isIDR(uint8_t unit_type);
bool isBLA(uint8_t unit_type);
bool isCRA(uint8_t unit_type);
bool isRAP(uint8_t unit_type);
bool isRASL(uint8_t unit_type);
bool isIRAP(uint8_t unit_type);
bool isRADL(uint8_t unit_type);
bool isReferenceNALU(uint8_t unit_type);
bool isSublayerNonReference(uint8_t unit_type);

const char* get_NAL_name(uint8_t unit_type);

inline bool isIdrPic(uint8_t nal_unit_type) {
  return (nal_unit_type == NAL_UNIT_IDR_W_RADL ||
          nal_unit_type == NAL_UNIT_IDR_N_LP);
}

inline bool isRapPic(uint8_t nal_unit_type) {
  return nal_uni
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

chinabinlang

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值