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
2a9bed8f
Commit
2a9bed8f
authored
May 27, 2020
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hevc_refs: reduce code duplication in find_ref_idx()
parent
d29aaf12
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
16 deletions
+6
-16
hevc_refs.c
libavcodec/hevc_refs.c
+6
-16
No files found.
libavcodec/hevc_refs.c
View file @
2a9bed8f
...
...
@@ -360,24 +360,14 @@ int ff_hevc_slice_rpl(HEVCContext *s)
static
HEVCFrame
*
find_ref_idx
(
HEVCContext
*
s
,
int
poc
,
uint8_t
use_msb
)
{
int
mask
=
use_msb
?
~
0
:
(
1
<<
s
->
ps
.
sps
->
log2_max_poc_lsb
)
-
1
;
int
i
;
if
(
use_msb
)
{
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
DPB
);
i
++
)
{
HEVCFrame
*
ref
=
&
s
->
DPB
[
i
];
if
(
ref
->
frame
->
buf
[
0
]
&&
(
ref
->
sequence
==
s
->
seq_decode
))
{
if
(
ref
->
poc
==
poc
)
return
ref
;
}
}
}
else
{
int
LtMask
=
(
1
<<
s
->
ps
.
sps
->
log2_max_poc_lsb
)
-
1
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
DPB
);
i
++
)
{
HEVCFrame
*
ref
=
&
s
->
DPB
[
i
];
if
(
ref
->
frame
->
buf
[
0
]
&&
ref
->
sequence
==
s
->
seq_decode
)
{
if
((
ref
->
poc
&
LtMask
)
==
poc
)
return
ref
;
}
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
DPB
);
i
++
)
{
HEVCFrame
*
ref
=
&
s
->
DPB
[
i
];
if
(
ref
->
frame
->
buf
[
0
]
&&
ref
->
sequence
==
s
->
seq_decode
)
{
if
((
ref
->
poc
&
mask
)
==
poc
)
return
ref
;
}
}
...
...
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