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
45c0e338
Commit
45c0e338
authored
May 30, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
j2kdec: merge picture handling from jpeg2000
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f471b5fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
j2kdec.c
libavcodec/j2kdec.c
+10
-12
No files found.
libavcodec/j2kdec.c
View file @
45c0e338
...
...
@@ -62,7 +62,6 @@ typedef struct Jpeg2000Tile {
typedef
struct
Jpeg2000DecoderContext
{
AVClass
*
class
;
AVCodecContext
*
avctx
;
AVFrame
*
picture
;
GetByteContext
g
;
int
width
,
height
;
...
...
@@ -162,7 +161,6 @@ static int tag_tree_decode(Jpeg2000DecoderContext *s, Jpeg2000TgtNode *node,
static
int
get_siz
(
Jpeg2000DecoderContext
*
s
)
{
int
i
,
ret
;
ThreadFrame
frame
=
{
.
f
=
s
->
picture
};
if
(
bytestream2_get_bytes_left
(
&
s
->
g
)
<
36
)
return
AVERROR
(
EINVAL
);
...
...
@@ -255,13 +253,6 @@ static int get_siz(Jpeg2000DecoderContext *s)
break
;
}
if
((
ret
=
ff_thread_get_buffer
(
s
->
avctx
,
&
frame
,
0
))
<
0
)
return
ret
;
s
->
picture
->
pict_type
=
AV_PICTURE_TYPE_I
;
s
->
picture
->
key_frame
=
1
;
return
0
;
}
...
...
@@ -1237,11 +1228,10 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
int
*
got_frame
,
AVPacket
*
avpkt
)
{
Jpeg2000DecoderContext
*
s
=
avctx
->
priv_data
;
ThreadFrame
frame
=
{
.
f
=
data
};
AVFrame
*
picture
=
data
;
int
tileno
,
ret
;
s
->
picture
=
picture
;
s
->
avctx
=
avctx
;
bytestream2_init
(
&
s
->
g
,
avpkt
->
data
,
avpkt
->
size
);
s
->
curtileno
=
-
1
;
...
...
@@ -1276,11 +1266,19 @@ static int jpeg2000_decode_frame(AVCodecContext *avctx, void *data,
if
(
ret
=
jpeg2000_read_main_headers
(
s
))
goto
err_out
;
/* get picture buffer */
if
((
ret
=
ff_thread_get_buffer
(
avctx
,
&
frame
,
0
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"ff_thread_get_buffer() failed.
\n
"
);
goto
err_out
;
}
picture
->
pict_type
=
AV_PICTURE_TYPE_I
;
picture
->
key_frame
=
1
;
if
(
ret
=
jpeg2000_read_bitstream_packets
(
s
))
goto
err_out
;
for
(
tileno
=
0
;
tileno
<
s
->
numXtiles
*
s
->
numYtiles
;
tileno
++
)
if
(
ret
=
jpeg2000_decode_tile
(
s
,
s
->
tile
+
tileno
,
s
->
picture
))
if
(
ret
=
jpeg2000_decode_tile
(
s
,
s
->
tile
+
tileno
,
picture
))
goto
err_out
;
jpeg2000_dec_cleanup
(
s
);
...
...
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