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
f14a2139
Commit
f14a2139
authored
Dec 09, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packetizer: hevc: simplify/remove bitstream
bitstream reader will always return 0 if no bytes
parent
ed6d58ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
modules/packetizer/hevc.c
modules/packetizer/hevc.c
+17
-16
No files found.
modules/packetizer/hevc.c
View file @
f14a2139
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
#include <vlc_codec.h>
#include <vlc_codec.h>
#include <vlc_block.h>
#include <vlc_block.h>
#include <vlc_bits.h>
#include <vlc_block_helper.h>
#include <vlc_block_helper.h>
#include "packetizer_helper.h"
#include "packetizer_helper.h"
#include "hevc_nal.h"
#include "hevc_nal.h"
...
@@ -192,35 +191,37 @@ static block_t *ParseNALBlock(decoder_t *p_dec, bool *pb_ts_used, block_t *p_fra
...
@@ -192,35 +191,37 @@ static block_t *ParseNALBlock(decoder_t *p_dec, bool *pb_ts_used, block_t *p_fra
block_t
*
p_nal
=
NULL
;
block_t
*
p_nal
=
NULL
;
bs_t
bs
;
if
(
unlikely
(
p_frag
->
i_buffer
<
5
))
bs_init
(
&
bs
,
p_frag
->
p_buffer
+
4
,
p_frag
->
i_buffer
-
4
);
{
msg_Warn
(
p_dec
,
"NAL too small"
);
/* Get NALU type */
block_Release
(
p_frag
);
uint32_t
forbidden_zero_bit
=
bs_read1
(
&
bs
);
return
NULL
;
}
if
(
forbidden_zero_bit
)
if
(
p_frag
->
p_buffer
[
4
]
&
0x80
)
{
{
msg_
Err
(
p_dec
,
"Forbidden zero bit not null, corrupted NAL"
);
msg_
Warn
(
p_dec
,
"Forbidden zero bit not null, corrupted NAL"
);
p_sys
->
p_frame
=
NULL
;
p_sys
->
p_frame
=
NULL
;
p_sys
->
b_vcl
=
false
;
p_sys
->
b_vcl
=
false
;
return
NULL
;
return
NULL
;
}
}
uint32_t
nalu_type
=
bs_read
(
&
bs
,
6
);
bs_skip
(
&
bs
,
9
);
/* Get NALU type */
uint8_t
nalu_type
=
((
p_frag
->
p_buffer
[
4
]
&
0x7E
)
>>
1
);
if
(
nalu_type
<
HEVC_NAL_VPS
)
if
(
nalu_type
<
HEVC_NAL_VPS
)
{
{
/* NAL is a VCL NAL */
/* NAL is a VCL NAL */
p_sys
->
b_vcl
=
true
;
p_sys
->
b_vcl
=
true
;
uint32_t
first_slice_in_pic
=
bs_read1
(
&
bs
);
if
(
likely
(
p_frag
->
i_buffer
>
6
))
if
(
first_slice_in_pic
&&
p_sys
->
p_frame
)
{
{
p_nal
=
block_ChainGather
(
p_sys
->
p_frame
);
bool
first_slice_in_pic
=
p_frag
->
p_buffer
[
6
]
&
0x80
;
p_sys
->
p_frame
=
NULL
;
if
(
first_slice_in_pic
&&
p_sys
->
p_frame
)
{
p_nal
=
block_ChainGather
(
p_sys
->
p_frame
);
p_sys
->
p_frame
=
NULL
;
}
}
}
block_ChainAppend
(
&
p_sys
->
p_frame
,
p_frag
);
block_ChainAppend
(
&
p_sys
->
p_frame
,
p_frag
);
}
}
else
else
...
...
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