Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
80f8e035
Commit
80f8e035
authored
Jul 24, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init_poc() vs. idr() cleanup
Originally committed as revision 14377 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
e16190fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
h264.c
libavcodec/h264.c
+3
-13
No files found.
libavcodec/h264.c
View file @
80f8e035
...
...
@@ -3304,6 +3304,9 @@ static void idr(H264Context *h){
}
h
->
short_ref_count
=
0
;
h
->
prev_frame_num
=
0
;
h
->
prev_frame_num_offset
=
0
;
h
->
prev_poc_msb
=
h
->
prev_poc_lsb
=
0
;
}
/* forget old pics after a seek */
...
...
@@ -3696,23 +3699,14 @@ static int init_poc(H264Context *h){
const
int
max_frame_num
=
1
<<
h
->
sps
.
log2_max_frame_num
;
int
field_poc
[
2
];
if
(
h
->
nal_unit_type
==
NAL_IDR_SLICE
){
h
->
frame_num_offset
=
0
;
}
else
{
if
(
h
->
frame_num
<
h
->
prev_frame_num
)
h
->
frame_num_offset
=
h
->
prev_frame_num_offset
+
max_frame_num
;
else
h
->
frame_num_offset
=
h
->
prev_frame_num_offset
;
}
if
(
h
->
sps
.
poc_type
==
0
){
const
int
max_poc_lsb
=
1
<<
h
->
sps
.
log2_max_poc_lsb
;
if
(
h
->
nal_unit_type
==
NAL_IDR_SLICE
){
h
->
prev_poc_msb
=
h
->
prev_poc_lsb
=
0
;
}
if
(
h
->
poc_lsb
<
h
->
prev_poc_lsb
&&
h
->
prev_poc_lsb
-
h
->
poc_lsb
>=
max_poc_lsb
/
2
)
h
->
poc_msb
=
h
->
prev_poc_msb
+
max_poc_lsb
;
else
if
(
h
->
poc_lsb
>
h
->
prev_poc_lsb
&&
h
->
prev_poc_lsb
-
h
->
poc_lsb
<
-
max_poc_lsb
/
2
)
...
...
@@ -3760,12 +3754,8 @@ static int init_poc(H264Context *h){
field_poc
[
1
]
+=
h
->
delta_poc
[
1
];
}
else
{
int
poc
;
if
(
h
->
nal_unit_type
==
NAL_IDR_SLICE
){
poc
=
0
;
}
else
{
if
(
h
->
nal_ref_idc
)
poc
=
2
*
(
h
->
frame_num_offset
+
h
->
frame_num
);
else
poc
=
2
*
(
h
->
frame_num_offset
+
h
->
frame_num
)
-
1
;
}
field_poc
[
0
]
=
poc
;
field_poc
[
1
]
=
poc
;
}
...
...
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