Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
bitstream
Commits
314e0740
Commit
314e0740
authored
Oct 25, 2020
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aac: add function to calculate profile_and_level
parent
9252a6ae
Pipeline
#31721
failed with stage
in 9 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
mpeg/aac.h
mpeg/aac.h
+34
-0
No files found.
mpeg/aac.h
View file @
314e0740
...
...
@@ -29,6 +29,7 @@
* Normative references:
* - ISO/IEC 14496-3 Subpart 4:1998(E)
* (Advanced Audio Coding, Time/Frequency Coding)
* - ISO/IEC 13818-1:2013(E) (MPEG-2 Systems)
*/
#ifndef __BITSTREAM_MPEG_AAC_H__
...
...
@@ -252,6 +253,39 @@ static inline void loas_set_length(uint8_t *p, uint16_t val)
#define ASC_FLT_HVXC_FIXED 6
#define ASC_FLT_HVXC_4 7
/* Returns the profile_and_level structure for MPEG-4 audio descriptor */
static
inline
uint8_t
asc_get_profilelevel
(
uint8_t
asc_aot
,
uint8_t
channels
,
uint32_t
rate
)
{
uint8_t
profilelevel
;
switch
(
asc_aot
)
{
case
ASC_TYPE_LC
:
profilelevel
=
0x50
;
break
;
case
ASC_TYPE_SBR
:
profilelevel
=
0x58
;
break
;
case
ASC_TYPE_ER_LD
:
return
0x38
;
case
ASC_TYPE_PS
:
profilelevel
=
0x60
;
break
;
default:
return
0xf
;
}
if
(
rate
>
48000
)
return
profilelevel
+
3
;
if
(
channels
>
2
)
return
profilelevel
+
2
;
if
(
rate
>
24000
)
return
profilelevel
+
1
;
return
profilelevel
;
}
/*****************************************************************************
* AAC syntactic elements
*****************************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment