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
e90d4e92
Commit
e90d4e92
authored
Oct 17, 2018
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/mjpegdec: Support 2:3 subsampling.
Fixes ticket #7495.
parent
b9136c1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
mjpegdec.c
libavcodec/mjpegdec.c
+9
-4
version.h
libavcodec/version.h
+1
-1
No files found.
libavcodec/mjpegdec.c
View file @
e90d4e92
...
...
@@ -594,6 +594,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
s
->
avctx
->
color_range
=
s
->
cs_itu601
?
AVCOL_RANGE_MPEG
:
AVCOL_RANGE_JPEG
;
break
;
case
0x22111100
:
case
0x23111100
:
case
0x42111100
:
case
0x24111100
:
if
(
s
->
bits
<=
8
)
s
->
avctx
->
pix_fmt
=
s
->
cs_itu601
?
AV_PIX_FMT_YUV420P
:
AV_PIX_FMT_YUVJ420P
;
...
...
@@ -607,6 +608,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
if
(
s
->
bits
>
8
)
goto
unk_pixfmt
;
s
->
upscale_v
[
1
]
=
s
->
upscale_v
[
2
]
=
1
;
}
else
if
(
pix_fmt_id
==
0x23111100
)
{
if
(
s
->
bits
>
8
)
goto
unk_pixfmt
;
s
->
upscale_v
[
1
]
=
s
->
upscale_v
[
2
]
=
2
;
}
break
;
case
0x41111100
:
...
...
@@ -2528,7 +2533,7 @@ the_end:
w
=
AV_CEIL_RSHIFT
(
w
,
hshift
);
h
=
AV_CEIL_RSHIFT
(
h
,
vshift
);
}
if
(
s
->
upscale_v
[
p
])
if
(
s
->
upscale_v
[
p
]
==
1
)
h
=
(
h
+
1
)
>>
1
;
av_assert0
(
w
>
0
);
for
(
i
=
0
;
i
<
h
;
i
++
)
{
...
...
@@ -2592,9 +2597,9 @@ the_end:
}
dst
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[(
h
-
1
)
*
s
->
linesize
[
p
]];
for
(
i
=
h
-
1
;
i
;
i
--
)
{
uint8_t
*
src1
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[
i
/
2
*
s
->
linesize
[
p
]];
uint8_t
*
src2
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[(
i
+
1
)
/
2
*
s
->
linesize
[
p
]];
if
(
s
rc1
==
src2
||
i
==
h
-
1
)
{
uint8_t
*
src1
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[
i
*
s
->
upscale_v
[
p
]
/
(
s
->
upscale_v
[
p
]
+
1
)
*
s
->
linesize
[
p
]];
uint8_t
*
src2
=
&
((
uint8_t
*
)
s
->
picture_ptr
->
data
[
p
])[(
i
+
1
)
*
s
->
upscale_v
[
p
]
/
(
s
->
upscale_v
[
p
]
+
1
)
*
s
->
linesize
[
p
]];
if
(
s
->
upscale_v
[
p
]
!=
2
&&
(
src1
==
src2
||
i
==
h
-
1
)
)
{
memcpy
(
dst
,
src1
,
w
);
}
else
{
for
(
index
=
0
;
index
<
w
;
index
++
)
...
...
libavcodec/version.h
View file @
e90d4e92
...
...
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 58
#define LIBAVCODEC_VERSION_MINOR 33
#define LIBAVCODEC_VERSION_MICRO 10
0
#define LIBAVCODEC_VERSION_MICRO 10
1
#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