[bTSstream-devel] [Git][videolan/bitstream][master] 2 commits: mpeg/h264: Add function to convert profile value to text
Kieran Kunhya
gitlab at videolan.org
Tue Jun 27 20:01:15 CEST 2017
Kieran Kunhya pushed to branch master at videolan / bitstream
Commits:
a9b95c90 by Kieran Kunhya at 2017-06-27T19:00:13+01:00
mpeg/h264: Add function to convert profile value to text
- - - - -
e9408996 by Kieran Kunhya at 2017-06-27T19:00:13+01:00
mp2v: Add profile and level text getters
- - - - -
2 changed files:
- mpeg/h264.h
- mpeg/mp2v.h
Changes:
=====================================
mpeg/h264.h
=====================================
--- a/mpeg/h264.h
+++ b/mpeg/h264.h
@@ -246,6 +246,19 @@ static inline uint8_t h264sps_get_profile(const uint8_t *p_h264sps)
return p_h264sps[4];
}
+/* Note: doesn't do the constrained profile checks */
+static inline const char *h264_sps_get_profile_txt(uint8_t i_profile)
+{
+ return i_profile == 44 ? "CAVLC 4:4:4 Intra" :
+ i_profile == 66 ? "Baseline" :
+ i_profile == 77 ? "Main" :
+ i_profile == 88 ? "Extended" :
+ i_profile == 100 ? "High" :
+ i_profile == 110 ? "High 10" :
+ i_profile == 122 ? "High 4:2:2" :
+ i_profile == 144 ? "High 4:4:4 Predictive" : "Reserved";
+}
+
static inline void h264sps_set_level(uint8_t *p_h264sps, uint8_t i_level)
{
p_h264sps[6] = i_level;
=====================================
mpeg/mp2v.h
=====================================
--- a/mpeg/mp2v.h
+++ b/mpeg/mp2v.h
@@ -324,6 +324,46 @@ static inline uint8_t mp2vseqx_get_profilelevel(const uint8_t *p_mp2vseqx)
return ((p_mp2vseqx[4] & 0x0f) << 4) | (p_mp2vseqx[5] >> 4);
}
+static inline const char *mp2vseqx_get_profile_txt(uint8_t i_profilelevel)
+{
+ if (i_profilelevel & (1 << 7)) {
+ return i_profilelevel == MPV2SEQX_LEVEL_LOW_MV ||
+ i_profilelevel == MPV2SEQX_LEVEL_MAIN_MV ||
+ i_profilelevel == MPV2SEQX_LEVEL_HIGH_MV ||
+ i_profilelevel == MPV2SEQX_LEVEL_HIGH1440_MV ? "Multi-view" :
+ i_profilelevel == MPV2SEQX_LEVEL_MAIN_422 ||
+ i_profilelevel == MPV2SEQX_LEVEL_HIGH_422 ? "4:2:2" : "Reserved";
+ }
+ else {
+ i_profilelevel &= 0x70;
+ return i_profilelevel == MP2VSEQX_PROFILE_SIMPLE ? "Simple" :
+ i_profilelevel == MP2VSEQX_PROFILE_MAIN ? "Main" :
+ i_profilelevel == MP2VSEQX_PROFILE_SNR_SCAL ? "SNR Scalable" :
+ i_profilelevel == MP2VSEQX_PROFILE_SPAT_SCAL ? "Spatially Scalable" :
+ i_profilelevel == MP2VSEQX_PROFILE_HIGH ? "High" : "Reserved";
+ }
+}
+
+static inline const char *mp2vseqx_get_level_txt(uint8_t i_profilelevel)
+{
+ if (i_profilelevel & (1 << 7)) {
+ return i_profilelevel == MPV2SEQX_LEVEL_LOW_MV ? "Low" :
+ i_profilelevel == MPV2SEQX_LEVEL_MAIN_MV ||
+ i_profilelevel == MPV2SEQX_LEVEL_MAIN_422 ? "Main" :
+ i_profilelevel == MPV2SEQX_LEVEL_HIGH1440_MV ||
+ i_profilelevel == MPV2SEQX_LEVEL_HIGH_422 ? "High 1440" :
+ i_profilelevel == MPV2SEQX_LEVEL_HIGH_MV ? "High" : "Reserved";
+ }
+ else {
+ i_profilelevel &= 0xf;
+ return i_profilelevel == MP2VSEQX_LEVEL_LOW ? "Low" :
+ i_profilelevel == MP2VSEQX_LEVEL_MAIN ? "Main" :
+ i_profilelevel == MP2VSEQX_LEVEL_HIGH1440 ? "High 1440" :
+ i_profilelevel == MP2VSEQX_LEVEL_HIGH ? "High" :
+ i_profilelevel == MP2VSEQX_LEVEL_HIGHP ? "HighP" : "Reserved";
+ }
+}
+
static inline void mp2vseqx_set_progressive(uint8_t *p_mp2vseqx)
{
p_mp2vseqx[5] |= 0x8;
View it on GitLab: https://code.videolan.org/videolan/bitstream/compare/8bdacdfe02358c990a2bbf2ee14a68984c85cdc2...e9408996e7557e4a6b9f8e2e7ea1b1cb959bf837
---
View it on GitLab: https://code.videolan.org/videolan/bitstream/compare/8bdacdfe02358c990a2bbf2ee14a68984c85cdc2...e9408996e7557e4a6b9f8e2e7ea1b1cb959bf837
You're receiving this email because of your account on code.videolan.org.
More information about the biTStream-devel
mailing list