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
b4a5fcb9
Commit
b4a5fcb9
authored
Sep 15, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mjpegdec: Fix rgb48 ljpeg
Fixes Ticket894 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
069010ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
mjpegdec.c
libavcodec/mjpegdec.c
+9
-3
No files found.
libavcodec/mjpegdec.c
View file @
b4a5fcb9
...
...
@@ -357,7 +357,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
switch
(
pix_fmt_id
)
{
case
0x11111100
:
if
(
s
->
rgb
)
s
->
avctx
->
pix_fmt
=
AV_PIX_FMT_BGR24
;
s
->
avctx
->
pix_fmt
=
s
->
bits
<=
8
?
AV_PIX_FMT_BGR24
:
AV_PIX_FMT_BGR48
;
else
{
if
(
s
->
component_id
[
0
]
==
'Q'
&&
s
->
component_id
[
1
]
==
'F'
&&
s
->
component_id
[
2
]
==
'A'
)
{
s
->
avctx
->
pix_fmt
=
s
->
bits
<=
8
?
AV_PIX_FMT_GBRP
:
AV_PIX_FMT_GBRP16
;
...
...
@@ -887,8 +887,14 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
}
else
{
for
(
i
=
0
;
i
<
nb_components
;
i
++
)
{
int
c
=
s
->
comp_index
[
i
];
for
(
mb_x
=
0
;
mb_x
<
s
->
mb_width
;
mb_x
++
)
{
ptr
[
3
*
mb_x
+
2
-
c
]
=
buffer
[
mb_x
][
i
];
if
(
s
->
bits
<=
8
)
{
for
(
mb_x
=
0
;
mb_x
<
s
->
mb_width
;
mb_x
++
)
{
ptr
[
3
*
mb_x
+
2
-
c
]
=
buffer
[
mb_x
][
i
];
}
}
else
{
for
(
mb_x
=
0
;
mb_x
<
s
->
mb_width
;
mb_x
++
)
{
((
uint16_t
*
)
ptr
)[
3
*
mb_x
+
2
-
c
]
=
buffer
[
mb_x
][
i
];
}
}
}
}
...
...
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