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
d9704464
Commit
d9704464
authored
Jun 03, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
takdec: frame multi-threading support
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
d5f7f1fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
takdec.c
libavcodec/takdec.c
+18
-2
No files found.
libavcodec/takdec.c
View file @
d9704464
...
...
@@ -28,6 +28,7 @@
#include "libavutil/internal.h"
#include "libavutil/samplefmt.h"
#include "tak.h"
#include "thread.h"
#include "avcodec.h"
#include "dsputil.h"
#include "internal.h"
...
...
@@ -673,6 +674,7 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data,
{
TAKDecContext
*
s
=
avctx
->
priv_data
;
AVFrame
*
frame
=
data
;
ThreadFrame
tframe
=
{
.
f
=
data
};
GetBitContext
*
gb
=
&
s
->
gb
;
int
chan
,
i
,
ret
,
hsize
;
...
...
@@ -736,8 +738,9 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data,
:
s
->
ti
.
frame_samples
;
frame
->
nb_samples
=
s
->
nb_samples
;
if
((
ret
=
ff_
get_buffer
(
avctx
,
frame
,
0
))
<
0
)
if
((
ret
=
ff_
thread_get_buffer
(
avctx
,
&
t
frame
,
0
))
<
0
)
return
ret
;
ff_thread_finish_setup
(
avctx
);
if
(
avctx
->
bits_per_raw_sample
<=
16
)
{
int
buf_size
=
av_samples_get_buffer_size
(
NULL
,
avctx
->
channels
,
...
...
@@ -899,6 +902,18 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data,
return
pkt
->
size
;
}
static
int
update_thread_context
(
AVCodecContext
*
dst
,
const
AVCodecContext
*
src
)
{
TAKDecContext
*
tsrc
=
src
->
priv_data
;
TAKDecContext
*
tdst
=
dst
->
priv_data
;
if
(
dst
==
src
)
return
0
;
memcpy
(
&
tdst
->
ti
,
&
tsrc
->
ti
,
sizeof
(
TAKStreamInfo
));
return
0
;
}
static
av_cold
int
tak_decode_close
(
AVCodecContext
*
avctx
)
{
TAKDecContext
*
s
=
avctx
->
priv_data
;
...
...
@@ -916,7 +931,8 @@ AVCodec ff_tak_decoder = {
.
init
=
tak_decode_init
,
.
close
=
tak_decode_close
,
.
decode
=
tak_decode_frame
,
.
capabilities
=
CODEC_CAP_DR1
,
.
update_thread_context
=
update_thread_context
,
.
capabilities
=
CODEC_CAP_DR1
|
CODEC_CAP_FRAME_THREADS
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"TAK (Tom's lossless Audio Kompressor)"
),
.
sample_fmts
=
(
const
enum
AVSampleFormat
[])
{
AV_SAMPLE_FMT_U8P
,
AV_SAMPLE_FMT_S16P
,
...
...
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