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
80604030
Commit
80604030
authored
Feb 24, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
j2kenc: switch to encode2
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
131698af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
j2kenc.c
libavcodec/j2kenc.c
+17
-8
No files found.
libavcodec/j2kenc.c
View file @
80604030
...
...
@@ -920,18 +920,23 @@ static void reinit(J2kEncoderContext *s)
}
}
static
int
encode_frame
(
AVCodecContext
*
avctx
,
uint8_t
*
buf
,
int
buf_size
,
void
*
data
)
static
int
encode_frame
(
AVCodecContext
*
avctx
,
AVPacket
*
pkt
,
const
AVFrame
*
pict
,
int
*
got_packet
)
{
int
tileno
,
ret
;
J2kEncoderContext
*
s
=
avctx
->
priv_data
;
if
(
!
pkt
->
data
&&
(
ret
=
av_new_packet
(
pkt
,
avctx
->
width
*
avctx
->
height
*
9
+
FF_MIN_BUFFER_SIZE
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error getting output packet.
\n
"
);
return
ret
;
}
// init:
s
->
buf
=
s
->
buf_start
=
buf
;
s
->
buf_end
=
buf
+
buf_
size
;
s
->
buf
=
s
->
buf_start
=
pkt
->
data
;
s
->
buf_end
=
pkt
->
data
+
pkt
->
size
;
s
->
picture
=
*
(
AVFrame
*
)
data
;
s
->
picture
=
*
pict
;
avctx
->
coded_frame
=
&
s
->
picture
;
s
->
lambda
=
s
->
picture
.
quality
*
LAMBDA_SCALE
;
...
...
@@ -965,7 +970,11 @@ static int encode_frame(AVCodecContext *avctx,
bytestream_put_be16
(
&
s
->
buf
,
J2K_EOC
);
av_log
(
s
->
avctx
,
AV_LOG_DEBUG
,
"end
\n
"
);
return
s
->
buf
-
s
->
buf_start
;
pkt
->
size
=
s
->
buf
-
s
->
buf_start
;
pkt
->
flags
|=
AV_PKT_FLAG_KEY
;
*
got_packet
=
1
;
return
0
;
}
static
av_cold
int
j2kenc_init
(
AVCodecContext
*
avctx
)
...
...
@@ -1041,7 +1050,7 @@ AVCodec ff_jpeg2000_encoder = {
.
id
=
CODEC_ID_JPEG2000
,
.
priv_data_size
=
sizeof
(
J2kEncoderContext
),
.
init
=
j2kenc_init
,
.
encode
=
encode_frame
,
.
encode
2
=
encode_frame
,
.
close
=
j2kenc_destroy
,
.
capabilities
=
CODEC_CAP_EXPERIMENTAL
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"JPEG 2000"
),
...
...
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