Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
65fe7d76
Commit
65fe7d76
authored
Sep 10, 2013
by
Jingning Han
Committed by
Gerrit Code Review
Sep 10, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Remove redundant condition check in 32x32 quant"
parents
db487188
5d93feb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
vp9/encoder/vp9_quantize.c
vp9/encoder/vp9_quantize.c
+10
-16
No files found.
vp9/encoder/vp9_quantize.c
View file @
65fe7d76
...
...
@@ -94,7 +94,7 @@ void vp9_quantize_b_32x32_c(int16_t *coeff_ptr, intptr_t n_coeffs,
uint16_t
*
eob_ptr
,
const
int16_t
*
scan
,
const
int16_t
*
iscan
)
{
int
i
,
rc
,
eob
;
int
zbins
[
2
],
nzbins
[
2
]
,
zbin
;
int
zbins
[
2
],
nzbins
[
2
];
int
x
,
y
,
z
,
sz
;
int
idx
=
0
;
int
idx_arr
[
1024
];
...
...
@@ -127,27 +127,21 @@ void vp9_quantize_b_32x32_c(int16_t *coeff_ptr, intptr_t n_coeffs,
for
(
i
=
0
;
i
<
idx
;
i
++
)
{
rc
=
scan
[
idx_arr
[
i
]];
// Calculate ZBIN
zbin
=
(
zbins
[
rc
!=
0
]);
z
=
coeff_ptr
[
rc
];
sz
=
(
z
>>
31
);
// sign of z
x
=
(
z
^
sz
)
-
sz
;
// x = abs(z)
if
(
x
>=
zbin
)
{
x
+=
ROUND_POWER_OF_TWO
(
round_ptr
[
rc
!=
0
],
1
);
x
=
clamp
(
x
,
INT16_MIN
,
INT16_MAX
);
y
=
(((
int
)(((
int
)(
x
*
quant_ptr
[
rc
!=
0
])
>>
16
)
+
x
))
*
quant_shift_ptr
[
rc
!=
0
])
>>
15
;
// quantize (x)
x
+=
ROUND_POWER_OF_TWO
(
round_ptr
[
rc
!=
0
],
1
);
x
=
clamp
(
x
,
INT16_MIN
,
INT16_MAX
);
y
=
((((
x
*
quant_ptr
[
rc
!=
0
])
>>
16
)
+
x
)
*
quant_shift_ptr
[
rc
!=
0
])
>>
15
;
// quantize (x)
x
=
(
y
^
sz
)
-
sz
;
// get the sign back
qcoeff_ptr
[
rc
]
=
x
;
// write to destination
dqcoeff_ptr
[
rc
]
=
x
*
dequant_ptr
[
rc
!=
0
]
/
2
;
// dequantized value
x
=
(
y
^
sz
)
-
sz
;
// get the sign back
qcoeff_ptr
[
rc
]
=
x
;
// write to destination
dqcoeff_ptr
[
rc
]
=
x
*
dequant_ptr
[
rc
!=
0
]
/
2
;
// dequantized value
if
(
y
)
{
eob
=
idx_arr
[
i
];
// last nonzero coeffs
}
}
if
(
y
)
eob
=
idx_arr
[
i
];
// last nonzero coeffs
}
}
*
eob_ptr
=
eob
+
1
;
...
...
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