Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
3fd30bcc
Commit
3fd30bcc
authored
Dec 09, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mux: mp4: use hevc sps/pps/vps limits
When not implicit, limits are mentioned in *_id description.
parent
8f42dc5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
modules/mux/mp4/libmp4mux.c
modules/mux/mp4/libmp4mux.c
+17
-21
modules/packetizer/hevc_nal.h
modules/packetizer/hevc_nal.h
+4
-0
No files found.
modules/mux/mp4/libmp4mux.c
View file @
3fd30bcc
...
...
@@ -581,12 +581,10 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt)
uint8_t
*
p_buffer
;
};
/* According to the specification HEVC stream can have
* 16 vps id and an "unlimited" number of sps and pps id using ue(v) id*/
struct
nal
p_vps
[
16
],
*
p_sps
=
NULL
,
*
p_pps
=
NULL
,
*
p_sei
=
NULL
,
*
p_nal
=
NULL
;
size_t
i_vps
=
0
,
i_sps
=
0
,
i_pps
=
0
,
i_sei
=
0
;
uint8_t
i_num_arrays
=
0
;
struct
nal
rg_vps
[
HEVC_VPS_MAX
],
rg_sps
[
HEVC_SPS_MAX
],
rg_pps
[
HEVC_VPS_MAX
],
*
p_sei
=
NULL
,
*
p_nal
=
NULL
;
uint8_t
i_vps
=
0
,
i_sps
=
0
,
i_pps
=
0
,
i_num_arrays
=
0
;
size_t
i_sei
=
0
;
uint8_t
*
p_buffer
=
p_fmt
->
p_extra
;
size_t
i_buffer
=
p_fmt
->
i_extra
;
...
...
@@ -621,7 +619,9 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt)
switch
((
*
p_buffer
&
0x7E
)
>>
1
)
{
case
HEVC_NAL_VPS
:
p_nal
=
&
p_vps
[
i_vps
++
];
if
(
i_vps
==
HEVC_VPS_MAX
)
break
;
p_nal
=
&
rg_vps
[
i_vps
++
];
p_nal
->
p_buffer
=
p_buffer
;
/* Only keep the general profile from the first VPS
* if there are several (this shouldn't happen so soon) */
...
...
@@ -633,11 +633,9 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt)
break
;
case
HEVC_NAL_SPS
:
{
struct
nal
*
p_tmp
=
realloc
(
p_sps
,
sizeof
(
struct
nal
)
*
(
i_sps
+
1
));
if
(
!
p_tmp
)
if
(
i_sps
==
HEVC_SPS_MAX
)
break
;
p_sps
=
p_tmp
;
p_nal
=
&
p_sps
[
i_sps
++
];
p_nal
=
&
rg_sps
[
i_sps
++
];
p_nal
->
p_buffer
=
p_buffer
;
if
(
i_sps
==
1
&&
i_buffer
>
15
)
{
/* Get Chroma_idc and bitdepths */
...
...
@@ -649,11 +647,9 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt)
}
case
HEVC_NAL_PPS
:
{
struct
nal
*
p_tmp
=
realloc
(
p_pps
,
sizeof
(
struct
nal
)
*
(
i_pps
+
1
));
if
(
!
p_tmp
)
if
(
i_pps
==
HEVC_PPS_MAX
)
break
;
p_pps
=
p_tmp
;
p_nal
=
&
p_pps
[
i_pps
++
];
p_nal
=
&
rg_pps
[
i_pps
++
];
p_nal
->
p_buffer
=
p_buffer
;
if
(
i_pps
==
1
)
i_num_arrays
++
;
...
...
@@ -699,8 +695,8 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt)
/* Write VPS without forcing array_completeness */
bo_add_8
(
hvcC
,
HEVC_NAL_VPS
);
bo_add_16be
(
hvcC
,
i_vps
);
for
(
size
_t
i
=
0
;
i
<
i_vps
;
i
++
)
{
p_nal
=
&
p
_vps
[
i
];
for
(
uint8
_t
i
=
0
;
i
<
i_vps
;
i
++
)
{
p_nal
=
&
rg
_vps
[
i
];
bo_add_16be
(
hvcC
,
p_nal
->
i_buffer
);
bo_add_mem
(
hvcC
,
p_nal
->
i_buffer
,
p_nal
->
p_buffer
);
}
...
...
@@ -710,8 +706,8 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt)
/* Write SPS without forcing array_completeness */
bo_add_8
(
hvcC
,
HEVC_NAL_SPS
);
bo_add_16be
(
hvcC
,
i_sps
);
for
(
size
_t
i
=
0
;
i
<
i_sps
;
i
++
)
{
p_nal
=
&
p
_sps
[
i
];
for
(
uint8
_t
i
=
0
;
i
<
i_sps
;
i
++
)
{
p_nal
=
&
rg
_sps
[
i
];
bo_add_16be
(
hvcC
,
p_nal
->
i_buffer
);
bo_add_mem
(
hvcC
,
p_nal
->
i_buffer
,
p_nal
->
p_buffer
);
}
...
...
@@ -721,8 +717,8 @@ static bo_t *GetHvcCTag(es_format_t *p_fmt)
/* Write PPS without forcing array_completeness */
bo_add_8
(
hvcC
,
HEVC_NAL_PPS
);
bo_add_16be
(
hvcC
,
i_pps
);
for
(
size
_t
i
=
0
;
i
<
i_pps
;
i
++
)
{
p_nal
=
&
p
_pps
[
i
];
for
(
uint8
_t
i
=
0
;
i
<
i_pps
;
i
++
)
{
p_nal
=
&
rg
_pps
[
i
];
bo_add_16be
(
hvcC
,
p_nal
->
i_buffer
);
bo_add_mem
(
hvcC
,
p_nal
->
i_buffer
,
p_nal
->
p_buffer
);
}
...
...
modules/packetizer/hevc_nal.h
View file @
3fd30bcc
...
...
@@ -28,6 +28,10 @@
# include <vlc_common.h>
# include <vlc_codec.h>
#define HEVC_VPS_MAX 16
#define HEVC_SPS_MAX 16
#define HEVC_PPS_MAX 64
/* NAL types from https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-H.265-201304-I!!PDF-E&type=items */
enum
hevc_nal_unit_type_e
{
...
...
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