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
15cee5e5
Commit
15cee5e5
authored
Jul 11, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mjpegdec: Fix used quant index for gbr
Fixes Ticket1651 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
94e86ae1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
mjpegdec.c
libavcodec/mjpegdec.c
+5
-4
mjpegdec.h
libavcodec/mjpegdec.h
+1
-0
No files found.
libavcodec/mjpegdec.c
View file @
15cee5e5
...
...
@@ -1088,7 +1088,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
s
->
dsp
.
clear_block
(
s
->
block
);
if
(
decode_block
(
s
,
s
->
block
,
i
,
s
->
dc_index
[
i
],
s
->
ac_index
[
i
],
s
->
quant_matrixes
[
s
->
quant_
index
[
c
]])
<
0
)
{
s
->
quant_matrixes
[
s
->
quant_
sindex
[
i
]])
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"error y=%d x=%d
\n
"
,
mb_y
,
mb_x
);
return
AVERROR_INVALIDDATA
;
...
...
@@ -1101,9 +1101,9 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
int16_t
*
block
=
s
->
blocks
[
c
][
block_idx
];
if
(
Ah
)
block
[
0
]
+=
get_bits1
(
&
s
->
gb
)
*
s
->
quant_matrixes
[
s
->
quant_
index
[
c
]][
0
]
<<
Al
;
s
->
quant_matrixes
[
s
->
quant_
sindex
[
i
]][
0
]
<<
Al
;
else
if
(
decode_dc_progressive
(
s
,
block
,
i
,
s
->
dc_index
[
i
],
s
->
quant_matrixes
[
s
->
quant_
index
[
c
]],
s
->
quant_matrixes
[
s
->
quant_
sindex
[
i
]],
Al
)
<
0
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"error y=%d x=%d
\n
"
,
mb_y
,
mb_x
);
...
...
@@ -1136,7 +1136,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
uint8_t
*
data
=
s
->
picture
.
data
[
c
];
int
linesize
=
s
->
linesize
[
c
];
int
last_scan
=
0
;
int16_t
*
quant_matrix
=
s
->
quant_matrixes
[
s
->
quant_
index
[
c
]];
int16_t
*
quant_matrix
=
s
->
quant_matrixes
[
s
->
quant_
sindex
[
0
]];
av_assert0
(
ss
>=
0
&&
Ah
>=
0
&&
Al
>=
0
);
if
(
se
<
ss
||
se
>
63
)
{
...
...
@@ -1231,6 +1231,7 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
&&
nb_components
==
3
&&
s
->
nb_components
==
3
&&
i
)
index
=
3
-
i
;
s
->
quant_sindex
[
i
]
=
s
->
quant_index
[
index
];
s
->
nb_blocks
[
i
]
=
s
->
h_count
[
index
]
*
s
->
v_count
[
index
];
s
->
h_scount
[
i
]
=
s
->
h_count
[
index
];
s
->
v_scount
[
i
]
=
s
->
v_count
[
index
];
...
...
libavcodec/mjpegdec.h
View file @
15cee5e5
...
...
@@ -84,6 +84,7 @@ typedef struct MJpegDecodeContext {
int
nb_blocks
[
MAX_COMPONENTS
];
int
h_scount
[
MAX_COMPONENTS
];
int
v_scount
[
MAX_COMPONENTS
];
int
quant_sindex
[
MAX_COMPONENTS
];
int
h_max
,
v_max
;
/* maximum h and v counts */
int
quant_index
[
4
];
/* quant table index for each component */
int
last_dc
[
MAX_COMPONENTS
];
/* last DEQUANTIZED dc (XXX: am I right to do that ?) */
...
...
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