Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
mpeg/h264: Add function to convert profile value to text
· a9b95c90
Kieran Kunhya
authored
Apr 08, 2017
a9b95c90
mp2v: Add profile and level text getters
· e9408996
Kieran Kunhya
authored
Apr 08, 2017
e9408996
Hide whitespace changes
Inline
Side-by-side
mpeg/h264.h
View file @
e9408996
...
...
@@ -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
View file @
e9408996
...
...
@@ -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
;
...
...