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
Show 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,26 +360,16 @@ int ff_hevc_slice_rpl(HEVCContext *s)
...
@@ -360,26 +360,16 @@ int ff_hevc_slice_rpl(HEVCContext *s)
static
HEVCFrame
*
find_ref_idx
(
HEVCContext
*
s
,
int
poc
,
uint8_t
use_msb
)
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
;
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
++
)
{
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
s
->
DPB
);
i
++
)
{
HEVCFrame
*
ref
=
&
s
->
DPB
[
i
];
HEVCFrame
*
ref
=
&
s
->
DPB
[
i
];
if
(
ref
->
frame
->
buf
[
0
]
&&
ref
->
sequence
==
s
->
seq_decode
)
{
if
(
ref
->
frame
->
buf
[
0
]
&&
ref
->
sequence
==
s
->
seq_decode
)
{
if
((
ref
->
poc
&
LtM
ask
)
==
poc
)
if
((
ref
->
poc
&
m
ask
)
==
poc
)
return
ref
;
return
ref
;
}
}
}
}
}
if
(
s
->
nal_unit_type
!=
HEVC_NAL_CRA_NUT
&&
!
IS_BLA
(
s
))
if
(
s
->
nal_unit_type
!=
HEVC_NAL_CRA_NUT
&&
!
IS_BLA
(
s
))
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
...
...
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