Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
aom-rav1e
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
aom-rav1e
Commits
037345eb
Commit
037345eb
authored
14 years ago
by
John Koleszar
Committed by
Code Review
14 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Move vp8_strict_quantize_b inside EXACT_QUANT #define."
parents
fc018e0d
82c43398
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp8/encoder/quantize.c
+59
-58
59 additions, 58 deletions
vp8/encoder/quantize.c
with
59 additions
and
58 deletions
vp8/encoder/quantize.c
+
59
−
58
View file @
037345eb
...
...
@@ -118,6 +118,65 @@ void vp8_regular_quantize_b(BLOCK *b, BLOCKD *d)
d
->
eob
=
eob
+
1
;
}
/* Perform regular quantization, with unbiased rounding and no zero bin. */
void
vp8_strict_quantize_b
(
BLOCK
*
b
,
BLOCKD
*
d
)
{
int
i
;
int
rc
;
int
eob
;
int
x
;
int
y
;
int
z
;
int
sz
;
short
*
coeff_ptr
;
short
*
quant_ptr
;
short
*
quant_shift_ptr
;
short
*
qcoeff_ptr
;
short
*
dqcoeff_ptr
;
short
*
dequant_ptr
;
coeff_ptr
=
&
b
->
coeff
[
0
];
quant_ptr
=
&
b
->
quant
[
0
][
0
];
quant_shift_ptr
=
&
b
->
quant_shift
[
0
][
0
];
qcoeff_ptr
=
d
->
qcoeff
;
dqcoeff_ptr
=
d
->
dqcoeff
;
dequant_ptr
=
&
d
->
dequant
[
0
][
0
];
eob
=
-
1
;
vpx_memset
(
qcoeff_ptr
,
0
,
32
);
vpx_memset
(
dqcoeff_ptr
,
0
,
32
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
int
dq
;
int
round
;
/*TODO: These arrays should be stored in zig-zag order.*/
rc
=
vp8_default_zig_zag1d
[
i
];
z
=
coeff_ptr
[
rc
];
dq
=
dequant_ptr
[
rc
];
round
=
dq
>>
1
;
/* Sign of z. */
sz
=
-
(
z
<
0
);
x
=
(
z
+
sz
)
^
sz
;
x
+=
round
;
if
(
x
>=
dq
)
{
/* Quantize x. */
y
=
(((
x
*
quant_ptr
[
rc
])
>>
16
)
+
x
)
>>
quant_shift_ptr
[
rc
];
/* Put the sign back. */
x
=
(
y
+
sz
)
^
sz
;
/* Save the coefficient and its dequantized value. */
qcoeff_ptr
[
rc
]
=
x
;
dqcoeff_ptr
[
rc
]
=
x
*
dq
;
/* Remember the last non-zero coefficient. */
if
(
y
)
eob
=
i
;
}
}
d
->
eob
=
eob
+
1
;
}
#else
void
vp8_fast_quantize_b_c
(
BLOCK
*
b
,
BLOCKD
*
d
)
{
...
...
@@ -207,64 +266,6 @@ void vp8_regular_quantize_b(BLOCK *b, BLOCKD *d)
#endif
/* Perform regular quantization, with unbiased rounding and no zero bin. */
void
vp8_strict_quantize_b
(
BLOCK
*
b
,
BLOCKD
*
d
)
{
int
i
;
int
rc
;
int
eob
;
int
x
;
int
y
;
int
z
;
int
sz
;
short
*
coeff_ptr
;
short
*
quant_ptr
;
short
*
quant_shift_ptr
;
short
*
qcoeff_ptr
;
short
*
dqcoeff_ptr
;
short
*
dequant_ptr
;
coeff_ptr
=
&
b
->
coeff
[
0
];
quant_ptr
=
&
b
->
quant
[
0
][
0
];
quant_shift_ptr
=
&
b
->
quant_shift
[
0
][
0
];
qcoeff_ptr
=
d
->
qcoeff
;
dqcoeff_ptr
=
d
->
dqcoeff
;
dequant_ptr
=
&
d
->
dequant
[
0
][
0
];
eob
=
-
1
;
vpx_memset
(
qcoeff_ptr
,
0
,
32
);
vpx_memset
(
dqcoeff_ptr
,
0
,
32
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
int
dq
;
int
round
;
/*TODO: These arrays should be stored in zig-zag order.*/
rc
=
vp8_default_zig_zag1d
[
i
];
z
=
coeff_ptr
[
rc
];
dq
=
dequant_ptr
[
rc
];
round
=
dq
>>
1
;
/* Sign of z. */
sz
=
-
(
z
<
0
);
x
=
(
z
+
sz
)
^
sz
;
x
+=
round
;
if
(
x
>=
dq
)
{
/* Quantize x. */
y
=
(((
x
*
quant_ptr
[
rc
])
>>
16
)
+
x
)
>>
quant_shift_ptr
[
rc
];
/* Put the sign back. */
x
=
(
y
+
sz
)
^
sz
;
/* Save the coefficient and its dequantized value. */
qcoeff_ptr
[
rc
]
=
x
;
dqcoeff_ptr
[
rc
]
=
x
*
dq
;
/* Remember the last non-zero coefficient. */
if
(
y
)
eob
=
i
;
}
}
d
->
eob
=
eob
+
1
;
}
void
vp8_quantize_mby
(
MACROBLOCK
*
x
)
{
int
i
;
...
...
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