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
786032ca
Commit
786032ca
authored
Mar 12, 2015
by
Rainer Hochecker
Committed by
Michael Niedermayer
Mar 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hevc: avoid unnecessary calls to get_format
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
332776f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
hevc.c
libavcodec/hevc.c
+14
-9
No files found.
libavcodec/hevc.c
View file @
786032ca
...
...
@@ -280,7 +280,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
return
0
;
}
static
int
set_sps
(
HEVCContext
*
s
,
const
HEVCSPS
*
sps
)
static
int
set_sps
(
HEVCContext
*
s
,
const
HEVCSPS
*
sps
,
enum
AVPixelFormat
pix_fmt
)
{
#define HWACCEL_MAX (CONFIG_HEVC_DXVA2_HWACCEL)
enum
AVPixelFormat
pix_fmts
[
HWACCEL_MAX
+
2
],
*
fmt
=
pix_fmts
;
...
...
@@ -304,13 +304,18 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps)
#endif
}
*
fmt
++
=
sps
->
pix_fmt
;
*
fmt
=
AV_PIX_FMT_NONE
;
if
(
pix_fmt
==
AV_PIX_FMT_NONE
)
{
*
fmt
++
=
sps
->
pix_fmt
;
*
fmt
=
AV_PIX_FMT_NONE
;
ret
=
ff_thread_get_format
(
s
->
avctx
,
pix_fmts
);
if
(
ret
<
0
)
goto
fail
;
s
->
avctx
->
pix_fmt
=
ret
;
ret
=
ff_thread_get_format
(
s
->
avctx
,
pix_fmts
);
if
(
ret
<
0
)
goto
fail
;
s
->
avctx
->
pix_fmt
=
ret
;
}
else
{
s
->
avctx
->
pix_fmt
=
pix_fmt
;
}
ff_set_sar
(
s
->
avctx
,
sps
->
vui
.
sar
);
...
...
@@ -420,7 +425,7 @@ static int hls_slice_header(HEVCContext *s)
sh
->
no_output_of_prior_pics_flag
=
0
;
}
ff_hevc_clear_refs
(
s
);
ret
=
set_sps
(
s
,
s
->
sps
);
ret
=
set_sps
(
s
,
s
->
sps
,
AV_PIX_FMT_NONE
);
if
(
ret
<
0
)
return
ret
;
...
...
@@ -3335,7 +3340,7 @@ static int hevc_update_thread_context(AVCodecContext *dst,
}
if
(
s
->
sps
!=
s0
->
sps
)
if
((
ret
=
set_sps
(
s
,
s0
->
sps
))
<
0
)
if
((
ret
=
set_sps
(
s
,
s0
->
sps
,
src
->
pix_fmt
))
<
0
)
return
ret
;
s
->
seq_decode
=
s0
->
seq_decode
;
...
...
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