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
36397ea1
Commit
36397ea1
authored
Jan 14, 2012
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RGBA64 encoding with libopenjpeg.
Reviewed-by: Michael Bradshaw
parent
ffd1017f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
libopenjpegenc.c
libavcodec/libopenjpegenc.c
+10
-2
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/libopenjpegenc.c
View file @
36397ea1
...
...
@@ -87,6 +87,11 @@ static opj_image_t *mj2_create_image(AVCodecContext *avctx, opj_cparameters_t *p
numcomps
=
3
;
bpp
=
16
;
break
;
case
PIX_FMT_RGBA64
:
color_space
=
CLRSPC_SRGB
;
numcomps
=
4
;
bpp
=
16
;
break
;
case
PIX_FMT_YUV420P
:
color_space
=
CLRSPC_SYCC
;
numcomps
=
3
;
...
...
@@ -224,7 +229,7 @@ static int libopenjpeg_copy_rgb16(AVCodecContext *avctx, AVFrame *frame, opj_ima
int
y
;
uint16_t
*
frame_ptr
=
(
uint16_t
*
)
frame
->
data
[
0
];
av_assert0
(
numcomps
==
1
||
numcomps
==
3
);
av_assert0
(
numcomps
==
1
||
numcomps
==
3
||
numcomps
==
4
);
for
(
compno
=
0
;
compno
<
numcomps
;
++
compno
)
{
if
(
image
->
comps
[
compno
].
w
>
frame
->
linesize
[
0
]
/
numcomps
)
{
...
...
@@ -334,6 +339,9 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, uint8_t *buf, int buf
case
PIX_FMT_RGB48
:
cpyresult
=
libopenjpeg_copy_rgb16
(
avctx
,
frame
,
image
,
3
);
break
;
case
PIX_FMT_RGBA64
:
cpyresult
=
libopenjpeg_copy_rgb16
(
avctx
,
frame
,
image
,
4
);
break
;
case
PIX_FMT_YUV420P
:
case
PIX_FMT_YUV422P
:
case
PIX_FMT_YUV440P
:
...
...
@@ -408,7 +416,7 @@ AVCodec ff_libopenjpeg_encoder = {
.
encode
=
libopenjpeg_encode_frame
,
.
close
=
libopenjpeg_encode_close
,
.
capabilities
=
0
,
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_RGB24
,
PIX_FMT_RGBA
,
PIX_FMT_RGB48
,
.
pix_fmts
=
(
const
enum
PixelFormat
[]){
PIX_FMT_RGB24
,
PIX_FMT_RGBA
,
PIX_FMT_RGB48
,
PIX_FMT_RGBA64
,
PIX_FMT_GRAY8
,
PIX_FMT_GRAY16
,
PIX_FMT_YUV420P
,
PIX_FMT_YUV422P
,
PIX_FMT_YUVA420P
,
PIX_FMT_YUV440P
,
PIX_FMT_YUV444P
,
...
...
libavcodec/version.h
View file @
36397ea1
...
...
@@ -22,7 +22,7 @@
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 55
#define LIBAVCODEC_VERSION_MICRO 10
4
#define LIBAVCODEC_VERSION_MICRO 10
5
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
...
...
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