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
GSoC
GSoC2018
macOS
vlc
Commits
d6c05044
Commit
d6c05044
authored
Dec 14, 2017
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packetizer: hevc: don't double store poc prev msb/lsb
parent
db383e8b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
modules/packetizer/hevc_nal.c
modules/packetizer/hevc_nal.c
+12
-10
modules/packetizer/hevc_nal.h
modules/packetizer/hevc_nal.h
+3
-3
No files found.
modules/packetizer/hevc_nal.c
View file @
d6c05044
...
...
@@ -1454,6 +1454,11 @@ int hevc_compute_picture_order_count( const hevc_sequence_parameter_set_t *p_sps
const
hevc_slice_segment_header_t
*
p_slice
,
hevc_poc_ctx_t
*
p_ctx
)
{
struct
{
int
lsb
;
int
msb
;
}
prevPicOrderCnt
;
int
pocMSB
;
bool
NoRaslOutputFlag
;
bool
IsIRAP
=
(
p_slice
->
nal_type
>=
HEVC_NAL_BLA_W_LP
&&
...
...
@@ -1478,15 +1483,14 @@ int hevc_compute_picture_order_count( const hevc_sequence_parameter_set_t *p_sps
if
(
p_slice
->
nal_type
==
HEVC_NAL_IDR_N_LP
||
p_slice
->
nal_type
==
HEVC_NAL_IDR_W_RADL
)
{
p_ctx
->
prevPicOrderCnt
.
msb
=
0
;
p_ctx
->
prevPicOrderCnt
.
lsb
=
0
;
prevPicOrderCnt
.
msb
=
0
;
prevPicOrderCnt
.
lsb
=
0
;
}
/* Not an IRAP with NoRaslOutputFlag == 1 */
if
(
!
IsIRAP
||
!
NoRaslOutputFlag
)
else
if
(
!
IsIRAP
||
!
NoRaslOutputFlag
)
{
p_ctx
->
prevPicOrderCnt
.
msb
=
p_ctx
->
prevTid0PicOrderCnt
.
msb
;
p_ctx
->
prevPicOrderCnt
.
lsb
=
p_ctx
->
prevTid0PicOrderCnt
.
lsb
;
prevPicOrderCnt
.
msb
=
p_ctx
->
prevTid0PicOrderCnt
.
msb
;
prevPicOrderCnt
.
lsb
=
p_ctx
->
prevTid0PicOrderCnt
.
lsb
;
}
if
(
IsIRAP
&&
NoRaslOutputFlag
)
...
...
@@ -1496,8 +1500,8 @@ int hevc_compute_picture_order_count( const hevc_sequence_parameter_set_t *p_sps
else
{
const
unsigned
maxPocLSB
=
1U
<<
(
p_sps
->
log2_max_pic_order_cnt_lsb_minus4
+
4
);
pocMSB
=
p_ctx
->
prevPicOrderCnt
.
msb
;
int64_t
orderDiff
=
(
int64_t
)
p_slice
->
pic_order_cnt_lsb
-
p_ctx
->
prevPicOrderCnt
.
lsb
;
pocMSB
=
prevPicOrderCnt
.
msb
;
int64_t
orderDiff
=
(
int64_t
)
p_slice
->
pic_order_cnt_lsb
-
prevPicOrderCnt
.
lsb
;
if
(
orderDiff
<
0
&&
-
orderDiff
>=
maxPocLSB
/
2
)
pocMSB
+=
maxPocLSB
;
else
if
(
orderDiff
>
maxPocLSB
/
2
)
...
...
@@ -1513,8 +1517,6 @@ int hevc_compute_picture_order_count( const hevc_sequence_parameter_set_t *p_sps
p_ctx
->
prevTid0PicOrderCnt
.
lsb
=
p_slice
->
pic_order_cnt_lsb
;
}
p_ctx
->
prevPicOrderCnt
.
msb
=
pocMSB
;
p_ctx
->
prevPicOrderCnt
.
lsb
=
p_slice
->
pic_order_cnt_lsb
;
p_ctx
->
first_picture
=
false
;
return
pocMSB
+
p_slice
->
pic_order_cnt_lsb
;
...
...
modules/packetizer/hevc_nal.h
View file @
d6c05044
...
...
@@ -246,7 +246,7 @@ typedef struct
{
int
lsb
;
int
msb
;
}
prevPicOrderCnt
,
prevTid0PicOrderCnt
;
}
prevTid0PicOrderCnt
;
bool
HandleCraAsBlaFlag
;
bool
first_picture
;
/* Must be set on start or on NAL_EOS */
...
...
@@ -254,8 +254,8 @@ typedef struct
static
inline
void
hevc_poc_cxt_init
(
hevc_poc_ctx_t
*
p_ctx
)
{
p_ctx
->
prevPicOrderCnt
.
lsb
=
0
;
p_ctx
->
prevPicOrderCnt
.
msb
=
0
;
p_ctx
->
prev
Tid0
PicOrderCnt
.
lsb
=
0
;
p_ctx
->
prev
Tid0
PicOrderCnt
.
msb
=
0
;
p_ctx
->
first_picture
=
true
;
}
...
...
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