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
b1fbe29e
Commit
b1fbe29e
authored
Mar 18, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mjpegdec: Support 31111100 sampling
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e1545589
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
7 deletions
+27
-7
mjpegdec.c
libavcodec/mjpegdec.c
+27
-7
No files found.
libavcodec/mjpegdec.c
View file @
b1fbe29e
...
...
@@ -518,6 +518,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s
->
avctx
->
color_range
=
s
->
cs_itu601
?
AVCOL_RANGE_MPEG
:
AVCOL_RANGE_JPEG
;
}
break
;
case
0x31111100
:
if
(
s
->
bits
>
8
)
goto
unk_pixfmt
;
s
->
avctx
->
pix_fmt
=
s
->
cs_itu601
?
AV_PIX_FMT_YUV444P
:
AV_PIX_FMT_YUVJ444P
;
s
->
avctx
->
color_range
=
s
->
cs_itu601
?
AVCOL_RANGE_MPEG
:
AVCOL_RANGE_JPEG
;
s
->
upscale_h
[
1
]
=
s
->
upscale_h
[
2
]
=
2
;
break
;
case
0x22121100
:
case
0x22111200
:
if
(
s
->
bits
<=
8
)
s
->
avctx
->
pix_fmt
=
s
->
cs_itu601
?
AV_PIX_FMT_YUV422P
:
AV_PIX_FMT_YUVJ422P
;
...
...
@@ -2162,6 +2169,7 @@ the_end:
h
=
(
h
+
1
)
>>
1
;
av_assert0
(
w
>
0
);
for
(
i
=
0
;
i
<
h
;
i
++
)
{
if
(
s
->
upscale_h
[
p
]
==
1
)
{
if
(
is16bit
)
((
uint16_t
*
)
line
)[
w
-
1
]
=
((
uint16_t
*
)
line
)[(
w
-
1
)
/
2
];
else
line
[
w
-
1
]
=
line
[(
w
-
1
)
/
2
];
for
(
index
=
w
-
2
;
index
>
0
;
index
--
)
{
...
...
@@ -2170,6 +2178,18 @@ the_end:
else
line
[
index
]
=
(
line
[
index
/
2
]
+
line
[(
index
+
1
)
/
2
])
>>
1
;
}
}
else
if
(
s
->
upscale_h
[
p
]
==
2
)
{
if
(
is16bit
)
{
((
uint16_t
*
)
line
)[
w
-
1
]
=
((
uint16_t
*
)
line
)[
w
-
2
]
=
((
uint16_t
*
)
line
)[(
w
-
1
)
/
3
];
}
else
{
line
[
w
-
1
]
=
line
[
w
-
2
]
=
line
[(
w
-
1
)
/
3
];
}
for
(
index
=
w
-
3
;
index
>
0
;
index
--
)
{
line
[
index
]
=
(
line
[
index
/
3
]
+
line
[(
index
+
1
)
/
3
]
+
line
[(
index
+
2
)
/
3
]
+
1
)
/
3
;
}
}
line
+=
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