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
d76864d9
Commit
d76864d9
authored
Feb 01, 2012
by
Michael Bradshaw
Committed by
Carl Eugen Hoyos
Feb 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support decoding rgba64 with libopenjpeg.
parent
ec0d02e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
libopenjpegdec.c
libavcodec/libopenjpegdec.c
+16
-12
No files found.
libavcodec/libopenjpegdec.c
View file @
d76864d9
...
...
@@ -50,6 +50,19 @@ static enum PixelFormat check_image_attributes(AVCodecContext *avctx, opj_image_
compRatio
|=
c1
.
dx
<<
9
|
c1
.
dy
<<
6
;
compRatio
|=
c2
.
dx
<<
3
|
c2
.
dy
;
if
(
image
->
numcomps
==
4
)
{
if
(
c0
.
prec
==
8
)
{
if
(
compRatio
==
0112222
&&
image
->
comps
[
3
].
dx
==
1
&&
image
->
comps
[
3
].
dy
==
1
)
{
return
PIX_FMT_YUVA420P
;
}
else
{
return
PIX_FMT_RGBA
;
}
}
else
{
return
PIX_FMT_RGBA64
;
}
}
switch
(
compRatio
)
{
case
0111111
:
goto
libopenjpeg_yuv444_rgb
;
case
0111212
:
return
PIX_FMT_YUV440P
;
...
...
@@ -91,15 +104,6 @@ libopenjpeg_rgb:
return
PIX_FMT_RGB24
;
}
static
int
is_yuva420
(
opj_image_t
*
image
)
{
return
image
->
numcomps
==
4
&&
image
->
comps
[
0
].
dx
==
1
&&
image
->
comps
[
0
].
dy
==
1
&&
image
->
comps
[
1
].
dx
==
2
&&
image
->
comps
[
1
].
dy
==
2
&&
image
->
comps
[
2
].
dx
==
2
&&
image
->
comps
[
2
].
dy
==
2
&&
image
->
comps
[
3
].
dx
==
1
&&
image
->
comps
[
3
].
dy
==
1
;
}
static
inline
int
libopenjpeg_ispacked
(
enum
PixelFormat
pix_fmt
)
{
int
i
,
component_plane
;
component_plane
=
av_pix_fmt_descriptors
[
pix_fmt
].
comp
[
0
].
plane
;
...
...
@@ -262,9 +266,8 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
break
;
case
2
:
avctx
->
pix_fmt
=
PIX_FMT_GRAY8A
;
break
;
case
3
:
avctx
->
pix_fmt
=
check_image_attributes
(
avctx
,
image
);
break
;
case
4
:
avctx
->
pix_fmt
=
is_yuva420
(
image
)
?
PIX_FMT_YUVA420P
:
PIX_FMT_RGBA
;
case
3
:
case
4
:
avctx
->
pix_fmt
=
check_image_attributes
(
avctx
,
image
);
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"%d components unsupported.
\n
"
,
image
->
numcomps
);
goto
done
;
...
...
@@ -318,6 +321,7 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
}
break
;
case
6
:
case
8
:
if
(
ispacked
)
{
libopenjpeg_copy_to_packed16
(
picture
,
image
);
}
...
...
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