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
c72cca5a
Commit
c72cca5a
authored
Sep 01, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ffv1dec: move initial_states init to init_thread_copy()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
5be7aecc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
ffv1dec.c
libavcodec/ffv1dec.c
+9
-6
No files found.
libavcodec/ffv1dec.c
View file @
c72cca5a
...
...
@@ -942,13 +942,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
static
int
init_thread_copy
(
AVCodecContext
*
avctx
)
{
FFV1Context
*
f
=
avctx
->
priv_data
;
int
i
;
f
->
picture
.
f
=
NULL
;
f
->
last_picture
.
f
=
NULL
;
f
->
sample_buffer
=
NULL
;
f
->
quant_table_count
=
0
;
f
->
slice_count
=
0
;
for
(
i
=
0
;
i
<
f
->
quant_table_count
;
i
++
)
{
av_assert0
(
f
->
version
>
1
);
f
->
initial_states
[
i
]
=
av_memdup
(
f
->
initial_states
[
i
],
f
->
context_count
[
i
]
*
sizeof
(
*
f
->
initial_states
[
i
]));
}
return
0
;
}
...
...
@@ -962,12 +968,9 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
return
0
;
if
(
!
fdst
->
picture
.
f
)
{
FFV1Context
bak
=
*
fdst
;
memcpy
(
fdst
,
fsrc
,
sizeof
(
*
fdst
));
for
(
i
=
0
;
i
<
fdst
->
quant_table_count
;
i
++
)
{
fdst
->
initial_states
[
i
]
=
av_malloc
(
fdst
->
context_count
[
i
]
*
sizeof
(
*
fdst
->
initial_states
[
i
]));
memcpy
(
fdst
->
initial_states
[
i
],
fsrc
->
initial_states
[
i
],
fdst
->
context_count
[
i
]
*
sizeof
(
*
fdst
->
initial_states
[
i
]));
}
memcpy
(
fdst
->
initial_states
,
bak
.
initial_states
,
sizeof
(
fdst
->
initial_states
));
fdst
->
picture
.
f
=
av_frame_alloc
();
fdst
->
last_picture
.
f
=
av_frame_alloc
();
...
...
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