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
c61dc289
Commit
c61dc289
authored
Apr 11, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/lcldec: add support for frame threads
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
83784665
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
lcldec.c
libavcodec/lcldec.c
+14
-3
No files found.
libavcodec/lcldec.c
View file @
c61dc289
...
...
@@ -46,6 +46,7 @@
#include "bytestream.h"
#include "internal.h"
#include "lcl.h"
#include "thread.h"
#if CONFIG_ZLIB_DECODER
#include <zlib.h>
...
...
@@ -157,6 +158,7 @@ static int zlib_decomp(AVCodecContext *avctx, const uint8_t *src, int src_len, i
static
int
decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_frame
,
AVPacket
*
avpkt
)
{
AVFrame
*
frame
=
data
;
ThreadFrame
tframe
=
{
.
f
=
data
};
const
uint8_t
*
buf
=
avpkt
->
data
;
int
buf_size
=
avpkt
->
size
;
LclDecContext
*
const
c
=
avctx
->
priv_data
;
...
...
@@ -173,7 +175,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPac
unsigned
int
len
=
buf_size
;
int
linesize
;
if
((
ret
=
ff_
get_buffer
(
avctx
,
frame
,
0
))
<
0
)
if
((
ret
=
ff_
thread_get_buffer
(
avctx
,
&
t
frame
,
0
))
<
0
)
return
ret
;
outptr
=
frame
->
data
[
0
];
// Output image pointer
...
...
@@ -618,6 +620,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
return
0
;
}
#if HAVE_THREADS
static
int
init_thread_copy
(
AVCodecContext
*
avctx
)
{
return
decode_init
(
avctx
);
}
#endif
static
av_cold
int
decode_end
(
AVCodecContext
*
avctx
)
{
LclDecContext
*
const
c
=
avctx
->
priv_data
;
...
...
@@ -639,9 +648,10 @@ AVCodec ff_mszh_decoder = {
.
id
=
AV_CODEC_ID_MSZH
,
.
priv_data_size
=
sizeof
(
LclDecContext
),
.
init
=
decode_init
,
.
init_thread_copy
=
ONLY_IF_THREADS_ENABLED
(
init_thread_copy
),
.
close
=
decode_end
,
.
decode
=
decode_frame
,
.
capabilities
=
AV_CODEC_CAP_DR1
,
.
capabilities
=
AV_CODEC_CAP_DR1
|
AV_CODEC_CAP_FRAME_THREADS
,
.
caps_internal
=
FF_CODEC_CAP_INIT_THREADSAFE
,
};
#endif
...
...
@@ -654,9 +664,10 @@ AVCodec ff_zlib_decoder = {
.
id
=
AV_CODEC_ID_ZLIB
,
.
priv_data_size
=
sizeof
(
LclDecContext
),
.
init
=
decode_init
,
.
init_thread_copy
=
ONLY_IF_THREADS_ENABLED
(
init_thread_copy
),
.
close
=
decode_end
,
.
decode
=
decode_frame
,
.
capabilities
=
AV_CODEC_CAP_DR1
,
.
capabilities
=
AV_CODEC_CAP_DR1
|
AV_CODEC_CAP_FRAME_THREADS
,
.
caps_internal
=
FF_CODEC_CAP_INIT_THREADSAFE
,
};
#endif
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