Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
42dd1434
Commit
42dd1434
authored
7 years ago
by
Ronald S. Bultje
Browse files
Options
Downloads
Patches
Plain Diff
mdec: use correctly permutated quant matrix for dequantization.
parent
9e85c5d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/mdec.c
+10
-1
10 additions, 1 deletion
libavcodec/mdec.c
with
10 additions
and
1 deletion
libavcodec/mdec.c
+
10
−
1
View file @
42dd1434
...
@@ -49,6 +49,7 @@ typedef struct MDECContext {
...
@@ -49,6 +49,7 @@ typedef struct MDECContext {
int
mb_height
;
int
mb_height
;
int
mb_x
,
mb_y
;
int
mb_x
,
mb_y
;
DECLARE_ALIGNED
(
16
,
int16_t
,
block
)[
6
][
64
];
DECLARE_ALIGNED
(
16
,
int16_t
,
block
)[
6
][
64
];
DECLARE_ALIGNED
(
16
,
uint16_t
,
quant_matrix
)[
64
];
uint8_t
*
bitstream_buffer
;
uint8_t
*
bitstream_buffer
;
unsigned
int
bitstream_buffer_size
;
unsigned
int
bitstream_buffer_size
;
int
block_last_index
[
6
];
int
block_last_index
[
6
];
...
@@ -61,7 +62,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
...
@@ -61,7 +62,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
int
component
;
int
component
;
RLTable
*
rl
=
&
ff_rl_mpeg1
;
RLTable
*
rl
=
&
ff_rl_mpeg1
;
uint8_t
*
const
scantable
=
a
->
scantable
.
permutated
;
uint8_t
*
const
scantable
=
a
->
scantable
.
permutated
;
const
uint16_t
*
quant_matrix
=
ff_mpeg1_default_intra
_matrix
;
const
uint16_t
*
quant_matrix
=
a
->
quant
_matrix
;
const
int
qscale
=
a
->
qscale
;
const
int
qscale
=
a
->
qscale
;
/* DC coefficient */
/* DC coefficient */
...
@@ -212,6 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -212,6 +213,7 @@ static int decode_frame(AVCodecContext *avctx,
static
av_cold
int
decode_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
decode_init
(
AVCodecContext
*
avctx
)
{
{
MDECContext
*
const
a
=
avctx
->
priv_data
;
MDECContext
*
const
a
=
avctx
->
priv_data
;
int
i
;
if
(
avctx
->
idct_algo
==
FF_IDCT_AUTO
)
if
(
avctx
->
idct_algo
==
FF_IDCT_AUTO
)
avctx
->
idct_algo
=
FF_IDCT_SIMPLE
;
avctx
->
idct_algo
=
FF_IDCT_SIMPLE
;
...
@@ -231,6 +233,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
...
@@ -231,6 +233,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVJ420P
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVJ420P
;
avctx
->
color_range
=
AVCOL_RANGE_JPEG
;
avctx
->
color_range
=
AVCOL_RANGE_JPEG
;
/* init q matrix */
for
(
i
=
0
;
i
<
64
;
i
++
)
{
int
j
=
a
->
idsp
.
idct_permutation
[
i
];
a
->
quant_matrix
[
j
]
=
ff_mpeg1_default_intra_matrix
[
i
];
}
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment