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
3aacb0d1
Commit
3aacb0d1
authored
Aug 22, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/proresdec2: add frame threading support
parent
c84a57d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
proresdec2.c
libavcodec/proresdec2.c
+16
-2
No files found.
libavcodec/proresdec2.c
View file @
3aacb0d1
...
...
@@ -36,6 +36,7 @@
#include "simple_idct.h"
#include "proresdec.h"
#include "proresdata.h"
#include "thread.h"
static
void
permute
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
const
uint8_t
permutation
[
64
])
{
...
...
@@ -644,6 +645,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
AVPacket
*
avpkt
)
{
ProresContext
*
ctx
=
avctx
->
priv_data
;
ThreadFrame
tframe
=
{
.
f
=
data
};
AVFrame
*
frame
=
data
;
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
...
...
@@ -669,7 +671,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
buf
+=
frame_hdr_size
;
buf_size
-=
frame_hdr_size
;
if
((
ret
=
ff_
get_buffer
(
avctx
,
frame
,
0
))
<
0
)
if
((
ret
=
ff_
thread_get_buffer
(
avctx
,
&
t
frame
,
0
))
<
0
)
return
ret
;
decode_picture:
...
...
@@ -697,6 +699,17 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
return
avpkt
->
size
;
}
#if HAVE_THREADS
static
int
decode_init_thread_copy
(
AVCodecContext
*
avctx
)
{
ProresContext
*
ctx
=
avctx
->
priv_data
;
ctx
->
slices
=
NULL
;
return
0
;
}
#endif
static
av_cold
int
decode_close
(
AVCodecContext
*
avctx
)
{
ProresContext
*
ctx
=
avctx
->
priv_data
;
...
...
@@ -713,7 +726,8 @@ AVCodec ff_prores_decoder = {
.
id
=
AV_CODEC_ID_PRORES
,
.
priv_data_size
=
sizeof
(
ProresContext
),
.
init
=
decode_init
,
.
init_thread_copy
=
ONLY_IF_THREADS_ENABLED
(
decode_init_thread_copy
),
.
close
=
decode_close
,
.
decode
=
decode_frame
,
.
capabilities
=
AV_CODEC_CAP_DR1
|
AV_CODEC_CAP_SLICE_THREADS
,
.
capabilities
=
AV_CODEC_CAP_DR1
|
AV_CODEC_CAP_SLICE_THREADS
|
AV_CODEC_CAP_FRAME_THREADS
,
};
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