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
559c8b9e
Commit
559c8b9e
authored
Mar 31, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mjpegdec: support subsampled 420 CMYK
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
79849081
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
mjpegdec.c
libavcodec/mjpegdec.c
+19
-2
No files found.
libavcodec/mjpegdec.c
View file @
559c8b9e
...
...
@@ -408,6 +408,19 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
}
av_assert0
(
s
->
nb_components
==
4
);
break
;
case
0x22111122
:
if
(
s
->
adobe_transform
==
0
&&
s
->
bits
<=
8
)
{
s
->
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRAP
;
s
->
upscale_v
=
6
;
s
->
upscale_h
=
6
;
s
->
chroma_height
=
s
->
height
;
}
else
{
if
(
s
->
bits
<=
8
)
s
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA420P
;
else
s
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA420P16
;
s
->
avctx
->
color_range
=
s
->
cs_itu601
?
AVCOL_RANGE_MPEG
:
AVCOL_RANGE_JPEG
;
}
av_assert0
(
s
->
nb_components
==
4
);
break
;
case
0x12121100
:
case
0x22122100
:
if
(
s
->
bits
<=
8
)
s
->
avctx
->
pix_fmt
=
s
->
cs_itu601
?
AV_PIX_FMT_YUV444P
:
AV_PIX_FMT_YUVJ444P
;
...
...
@@ -2039,7 +2052,9 @@ the_end:
av_assert0
(
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVJ444P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV444P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVJ440P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV440P
);
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV440P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_GBRAP
);
for
(
p
=
1
;
p
<
4
;
p
++
)
{
uint8_t
*
line
=
s
->
picture_ptr
->
data
[
p
];
if
(
!
(
s
->
upscale_h
&
(
1
<<
p
)))
...
...
@@ -2056,7 +2071,9 @@ the_end:
av_assert0
(
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVJ444P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV444P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUVJ422P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV422P
);
avctx
->
pix_fmt
==
AV_PIX_FMT_YUV422P
||
avctx
->
pix_fmt
==
AV_PIX_FMT_GBRAP
);
avcodec_get_chroma_sub_sample
(
s
->
avctx
->
pix_fmt
,
&
hshift
,
&
vshift
);
for
(
p
=
1
;
p
<
4
;
p
++
)
{
uint8_t
*
dst
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[(
s
->
height
-
1
)
*
s
->
linesize
[
p
]];
...
...
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