Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
2e2d2466
Commit
2e2d2466
authored
Apr 22, 2013
by
Nicolas Bertrand
Committed by
Diego Biurrun
Apr 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jpeg2000: Add mutlti-threading support to decoder
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
c1ad70c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
jpeg2000dec.c
libavcodec/jpeg2000dec.c
+5
-2
No files found.
libavcodec/jpeg2000dec.c
View file @
2e2d2466
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include "avcodec.h"
#include "avcodec.h"
#include "bytestream.h"
#include "bytestream.h"
#include "internal.h"
#include "internal.h"
#include "thread.h"
#include "jpeg2000.h"
#include "jpeg2000.h"
#define JP2_SIG_TYPE 0x6A502020
#define JP2_SIG_TYPE 0x6A502020
...
@@ -1242,6 +1243,7 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1242,6 +1243,7 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
int
*
got_frame
,
AVPacket
*
avpkt
)
int
*
got_frame
,
AVPacket
*
avpkt
)
{
{
Jpeg2000DecoderContext
*
s
=
avctx
->
priv_data
;
Jpeg2000DecoderContext
*
s
=
avctx
->
priv_data
;
ThreadFrame
frame
=
{
.
f
=
data
};
AVFrame
*
picture
=
data
;
AVFrame
*
picture
=
data
;
int
tileno
,
ret
;
int
tileno
,
ret
;
...
@@ -1277,8 +1279,8 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1277,8 +1279,8 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
return
ret
;
return
ret
;
/* get picture buffer */
/* get picture buffer */
if
((
ret
=
ff_
get_buffer
(
avctx
,
pictur
e
,
0
))
<
0
)
{
if
((
ret
=
ff_
thread_get_buffer
(
avctx
,
&
fram
e
,
0
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ff_
get_buffer() failed
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"ff_
thread_get_buffer() failed.
\n
"
);
return
ret
;
return
ret
;
}
}
picture
->
pict_type
=
AV_PICTURE_TYPE_I
;
picture
->
pict_type
=
AV_PICTURE_TYPE_I
;
...
@@ -1326,6 +1328,7 @@ AVCodec ff_jpeg2000_decoder = {
...
@@ -1326,6 +1328,7 @@ AVCodec ff_jpeg2000_decoder = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"JPEG 2000"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"JPEG 2000"
),
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_JPEG2000
,
.
id
=
AV_CODEC_ID_JPEG2000
,
.
capabilities
=
CODEC_CAP_FRAME_THREADS
,
.
priv_data_size
=
sizeof
(
Jpeg2000DecoderContext
),
.
priv_data_size
=
sizeof
(
Jpeg2000DecoderContext
),
.
decode
=
jpeg2000_decode_frame
,
.
decode
=
jpeg2000_decode_frame
,
.
priv_class
=
&
class
,
.
priv_class
=
&
class
,
...
...
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