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
463d086b
Commit
463d086b
authored
21 years ago
by
Mike Melanson
Browse files
Options
Downloads
Patches
Plain Diff
get those permutations straight
Originally committed as revision 1850 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
892fc83e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavcodec/vp3.c
+10
-6
10 additions, 6 deletions
libavcodec/vp3.c
libavcodec/vp3data.h
+3
-3
3 additions, 3 deletions
libavcodec/vp3data.h
with
13 additions
and
9 deletions
libavcodec/vp3.c
+
10
−
6
View file @
463d086b
...
...
@@ -862,7 +862,7 @@ static void init_dequantizer(Vp3DecodeContext *s)
* the dequantization phase */
for
(
i
=
1
;
i
<
64
;
i
++
)
{
j
=
quant
_index
[
i
];
j
=
zigzag
_index
[
i
];
s
->
intra_y_dequant
[
j
]
=
vp31_intra_y_dequant
[
i
]
*
quality_scale
/
100
;
if
(
s
->
intra_y_dequant
[
j
]
<
MIN_DEQUANT_VAL
)
...
...
@@ -2065,6 +2065,7 @@ static void render_fragments(Vp3DecodeContext *s,
int
j
;
int16_t
*
dequantizer
;
DCTELEM
dequant_block
[
64
];
DCTELEM
dequant_block_permuted
[
64
];
unsigned
char
*
output_plane
;
unsigned
char
*
last_plane
;
unsigned
char
*
golden_plane
;
...
...
@@ -2155,9 +2156,12 @@ static void render_fragments(Vp3DecodeContext *s,
i
,
s
->
all_fragments
[
i
].
coding_method
,
s
->
all_fragments
[
i
].
coeffs
[
0
],
dequantizer
[
0
]);
for
(
j
=
0
;
j
<
64
;
j
++
)
dequant_block
[
de
quant
_index
[
j
]]
=
dequant_block
[
de
zigzag
_index
[
j
]]
=
s
->
all_fragments
[
i
].
coeffs
[
j
]
*
dequantizer
[
j
];
for
(
j
=
0
;
j
<
64
;
j
++
)
dequant_block_permuted
[
s
->
dsp
.
idct_permutation
[
j
]]
=
dequant_block
[
j
];
debug_idct
(
"dequantized block:
\n
"
);
for
(
m
=
0
;
m
<
8
;
m
++
)
{
...
...
@@ -2171,14 +2175,14 @@ static void render_fragments(Vp3DecodeContext *s,
/* invert DCT and place (or add) in final output */
if
(
s
->
all_fragments
[
i
].
coding_method
==
MODE_INTRA
)
{
dequant_block
[
0
]
+=
1024
;
dequant_block
_permuted
[
0
]
+=
1024
;
s
->
dsp
.
idct_put
(
output_plane
+
s
->
all_fragments
[
i
].
first_pixel
,
stride
,
dequant_block
);
stride
,
dequant_block
_permuted
);
}
else
{
s
->
dsp
.
idct_add
(
output_plane
+
s
->
all_fragments
[
i
].
first_pixel
,
stride
,
dequant_block
);
stride
,
dequant_block
_permuted
);
}
debug_idct
(
"block after idct_%s():
\n
"
,
...
...
@@ -2363,7 +2367,7 @@ static int vp3_decode_init(AVCodecContext *avctx)
/* build quantization table */
for
(
i
=
0
;
i
<
64
;
i
++
)
quant
_index
[
de
quant
_index
[
i
]]
=
i
;
zigzag
_index
[
de
zigzag
_index
[
i
]]
=
i
;
/* work out the block mapping tables */
s
->
superblock_fragments
=
av_malloc
(
s
->
superblock_count
*
16
*
sizeof
(
int
));
...
...
This diff is collapsed.
Click to expand it.
libavcodec/vp3data.h
+
3
−
3
View file @
463d086b
...
...
@@ -60,7 +60,7 @@ static uint32_t vp31_quality_threshold[64] =
};
/* table used to convert natural order <-> zigzag order */
static
const
int
de
quant
_index
[
64
]
=
static
const
int
de
zigzag
_index
[
64
]
=
{
0
,
1
,
8
,
16
,
9
,
2
,
3
,
10
,
17
,
24
,
32
,
25
,
18
,
11
,
4
,
5
,
12
,
19
,
26
,
33
,
40
,
48
,
41
,
34
,
...
...
@@ -71,8 +71,8 @@ static const int dequant_index[64] =
53
,
60
,
61
,
54
,
47
,
55
,
62
,
63
};
/* inverse of de
quant
index */
static
int
quant
_index
[
64
];
/* inverse of de
zigzag
index */
static
int
zigzag
_index
[
64
];
static
const
uint16_t
dc_bias
[
16
][
32
][
2
]
=
{
{
/* DC bias table 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