Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
097f2052
Commit
097f2052
authored
12 years ago
by
Christian Duvivier
Committed by
Gerrit Code Review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "Faster vp9_regular_quantize_b_8x8." into experimental
parents
7630cf0c
0e4397f0
v1.14.0-linphone
1.4.X
experimental
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m29-baseline
m31-baseline
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
pcs-2013
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/debargha/playground
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
stable-vp9-decoder
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
v1.3.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/encoder/vp9_quantize.c
+54
-25
vp9/encoder/vp9_quantize.c
with
54 additions
and
25 deletions
vp9/encoder/vp9_quantize.c
+
54
−
25
View file @
097f2052
...
@@ -228,43 +228,70 @@ void vp9_regular_quantize_b_2x2(BLOCK *b, BLOCKD *d) {
...
@@ -228,43 +228,70 @@ void vp9_regular_quantize_b_2x2(BLOCK *b, BLOCKD *d) {
}
}
void
vp9_regular_quantize_b_8x8
(
BLOCK
*
b
,
BLOCKD
*
d
)
{
void
vp9_regular_quantize_b_8x8
(
BLOCK
*
b
,
BLOCKD
*
d
)
{
int
i
,
rc
,
eob
;
if
(
!
b
->
skip_block
)
{
int
zbin
;
int
i
,
rc
,
eob
;
int
x
,
y
,
z
,
sz
;
int
zbin
;
int
zero_run
=
0
;
int
x
,
y
,
z
,
sz
;
int16_t
*
zbin_boost_ptr
=
b
->
zrun_zbin_boost
;
int
zero_run
;
int16_t
*
coeff_ptr
=
b
->
coeff
;
int16_t
*
zbin_boost_ptr
=
b
->
zrun_zbin_boost
;
int16_t
*
zbin_ptr
=
b
->
zbin
;
int16_t
*
coeff_ptr
=
b
->
coeff
;
int16_t
*
round_ptr
=
b
->
round
;
int16_t
*
zbin_ptr
=
b
->
zbin
;
int16_t
*
quant_ptr
=
b
->
quant
;
int16_t
*
round_ptr
=
b
->
round
;
uint8_t
*
quant_shift_ptr
=
b
->
quant_shift
;
int16_t
*
quant_ptr
=
b
->
quant
;
int16_t
*
qcoeff_ptr
=
d
->
qcoeff
;
uint8_t
*
quant_shift_ptr
=
b
->
quant_shift
;
int16_t
*
dqcoeff_ptr
=
d
->
dqcoeff
;
int16_t
*
qcoeff_ptr
=
d
->
qcoeff
;
int16_t
*
dequant_ptr
=
d
->
dequant
;
int16_t
*
dqcoeff_ptr
=
d
->
dqcoeff
;
int
zbin_oq_value
=
b
->
zbin_extra
;
int16_t
*
dequant_ptr
=
d
->
dequant
;
int
zbin_oq_value
=
b
->
zbin_extra
;
vpx_memset
(
qcoeff_ptr
,
0
,
64
*
sizeof
(
int16_t
));
vpx_memset
(
dqcoeff_ptr
,
0
,
64
*
sizeof
(
int16_t
));
eob
=
-
1
;
// Special case for DC as it is the one triggering access in various
// tables: {zbin, quant, quant_shift, dequant}_ptr[rc != 0]
{
z
=
coeff_ptr
[
0
];
zbin
=
(
zbin_ptr
[
0
]
+
zbin_boost_ptr
[
0
]
+
zbin_oq_value
);
zero_run
=
1
;
vpx_memset
(
qcoeff_ptr
,
0
,
64
*
sizeof
(
int16_t
));
sz
=
(
z
>>
31
);
// sign of z
vpx_memset
(
dqcoeff_ptr
,
0
,
64
*
sizeof
(
int16_t
));
x
=
(
z
^
sz
)
-
sz
;
// x = abs(z)
eob
=
-
1
;
if
(
x
>=
zbin
)
{
x
+=
(
round_ptr
[
0
]);
y
=
((
int
)(((
int
)(
x
*
quant_ptr
[
0
])
>>
16
)
+
x
))
>>
quant_shift_ptr
[
0
];
// quantize (x)
x
=
(
y
^
sz
)
-
sz
;
// get the sign back
qcoeff_ptr
[
0
]
=
x
;
// write to destination
dqcoeff_ptr
[
0
]
=
x
*
dequant_ptr
[
0
];
// dequantized value
if
(
!
b
->
skip_block
)
{
if
(
y
)
{
for
(
i
=
0
;
i
<
64
;
i
++
)
{
eob
=
0
;
// last nonzero coeffs
zero_run
=
0
;
}
}
}
for
(
i
=
1
;
i
<
64
;
i
++
)
{
rc
=
vp9_default_zig_zag1d_8x8
[
i
];
rc
=
vp9_default_zig_zag1d_8x8
[
i
];
z
=
coeff_ptr
[
rc
];
z
=
coeff_ptr
[
rc
];
zbin
=
(
zbin_ptr
[
rc
!=
0
]
+
zbin_boost_ptr
[
zero_run
]
+
zbin_oq_value
);
zbin
=
(
zbin_ptr
[
1
]
+
zbin_boost_ptr
[
zero_run
]
+
zbin_oq_value
);
zero_run
+=
(
zero_run
<
15
);
// The original code was incrementing zero_run while keeping it at
// maximum 15 by adding "(zero_run < 15)". The same is achieved by
// removing the opposite of the sign mask of "(zero_run - 15)".
zero_run
-=
(
zero_run
-
15
)
>>
31
;
sz
=
(
z
>>
31
);
// sign of z
sz
=
(
z
>>
31
);
// sign of z
x
=
(
z
^
sz
)
-
sz
;
// x = abs(z)
x
=
(
z
^
sz
)
-
sz
;
// x = abs(z)
if
(
x
>=
zbin
)
{
if
(
x
>=
zbin
)
{
x
+=
(
round_ptr
[
rc
!=
0
]);
x
+=
(
round_ptr
[
rc
!=
0
]);
y
=
((
int
)(((
int
)(
x
*
quant_ptr
[
rc
!=
0
])
>>
16
)
+
x
))
y
=
((
int
)(((
int
)(
x
*
quant_ptr
[
1
])
>>
16
)
+
x
))
>>
quant_shift_ptr
[
rc
!=
0
];
// quantize (x)
>>
quant_shift_ptr
[
1
];
// quantize (x)
x
=
(
y
^
sz
)
-
sz
;
// get the sign back
x
=
(
y
^
sz
)
-
sz
;
// get the sign back
qcoeff_ptr
[
rc
]
=
x
;
// write to destination
qcoeff_ptr
[
rc
]
=
x
;
// write to destination
dqcoeff_ptr
[
rc
]
=
x
*
dequant_ptr
[
rc
!=
0
];
// dequantized value
dqcoeff_ptr
[
rc
]
=
x
*
dequant_ptr
[
1
];
// dequantized value
if
(
y
)
{
if
(
y
)
{
eob
=
i
;
// last nonzero coeffs
eob
=
i
;
// last nonzero coeffs
...
@@ -272,8 +299,10 @@ void vp9_regular_quantize_b_8x8(BLOCK *b, BLOCKD *d) {
...
@@ -272,8 +299,10 @@ void vp9_regular_quantize_b_8x8(BLOCK *b, BLOCKD *d) {
}
}
}
}
}
}
d
->
eob
=
eob
+
1
;
}
else
{
d
->
eob
=
0
;
}
}
d
->
eob
=
eob
+
1
;
}
}
void
vp9_quantize_mby_8x8
(
MACROBLOCK
*
x
)
{
void
vp9_quantize_mby_8x8
(
MACROBLOCK
*
x
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets