Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
01853d7c
Commit
01853d7c
authored
Jun 03, 2015
by
Johann
Committed by
Gerrit Code Review
Jun 03, 2015
Browse files
Merge "Unify reference variance functions"
parents
e2a5fd2c
d90536c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/variance_test.cc
View file @
01853d7c
...
...
@@ -68,11 +68,11 @@ static unsigned int mb_ss_ref(const int16_t *src) {
return
res
;
}
static
u
nsigned
in
t
variance_ref
(
const
uint8_t
*
src
,
const
uint8_t
*
ref
,
int
l2w
,
int
l2h
,
int
src_stride_coeff
,
int
ref_stride_coeff
,
uint32_t
*
sse_ptr
,
bool
use_high_bit_depth_
,
vpx_bit_depth_t
bit_depth
)
{
static
u
int32_
t
variance_ref
(
const
uint8_t
*
src
,
const
uint8_t
*
ref
,
int
l2w
,
int
l2h
,
int
src_stride_coeff
,
int
ref_stride_coeff
,
uint32_t
*
sse_ptr
,
bool
use_high_bit_depth_
,
vpx_bit_depth_t
bit_depth
)
{
int64_t
se
=
0
;
uint64_t
sse
=
0
;
const
int
w
=
1
<<
l2w
;
...
...
@@ -96,15 +96,17 @@ static unsigned int variance_ref(const uint8_t *src, const uint8_t *ref,
}
}
RoundHighBitDepth
(
bit_depth
,
&
se
,
&
sse
);
*
sse_ptr
=
(
uint32_t
)
sse
;
return
(
unsigned
int
)
(
sse
-
(((
int64_t
)
se
*
se
)
>>
(
l2w
+
l2h
)));
*
sse_ptr
=
static_cast
<
uint32_t
>
(
sse
);
return
static_cast
<
uint32_t
>
(
sse
-
((
static_cast
<
int64_t
>
(
se
)
*
se
)
>>
(
l2w
+
l2h
)));
}
static
u
nsigned
in
t
subpel_variance_ref
(
const
uint8_t
*
ref
,
const
uint8_t
*
src
,
int
l2w
,
int
l2h
,
int
xoff
,
int
yoff
,
unsigned
in
t
*
sse_ptr
,
bool
use_high_bit_depth_
,
vpx_bit_depth_t
bit_depth
)
{
static
u
int32_
t
subpel_variance_ref
(
const
uint8_t
*
ref
,
const
uint8_t
*
src
,
int
l2w
,
int
l2h
,
int
xoff
,
int
yoff
,
uint32_
t
*
sse_ptr
,
bool
use_high_bit_depth_
,
vpx_bit_depth_t
bit_depth
)
{
int64_t
se
=
0
;
uint64_t
sse
=
0
;
const
int
w
=
1
<<
l2w
;
...
...
@@ -142,8 +144,10 @@ static unsigned int subpel_variance_ref(const uint8_t *ref, const uint8_t *src,
}
}
RoundHighBitDepth
(
bit_depth
,
&
se
,
&
sse
);
*
sse_ptr
=
(
unsigned
int
)
sse
;
return
(
unsigned
int
)
(
sse
-
(((
int64_t
)
se
*
se
)
>>
(
l2w
+
l2h
)));
*
sse_ptr
=
static_cast
<
uint32_t
>
(
sse
);
return
static_cast
<
uint32_t
>
(
sse
-
((
static_cast
<
int64_t
>
(
se
)
*
se
)
>>
(
l2w
+
l2h
)));
}
typedef
unsigned
int
(
*
SumOfSquaresFunction
)(
const
int16_t
*
src
);
...
...
@@ -464,14 +468,14 @@ void MseTest<MseFunctionType>::MaxTest_sse() {
EXPECT_EQ
(
expected
,
var
);
}
unsigned
in
t
subpel_avg_variance_ref
(
const
uint8_t
*
ref
,
const
uint8_t
*
src
,
const
uint8_t
*
second_pred
,
int
l2w
,
int
l2h
,
int
xoff
,
int
yoff
,
unsigned
in
t
*
sse_ptr
,
bool
use_high_bit_depth
,
vpx_bit_depth_t
bit_depth
)
{
static
uint32_
t
subpel_avg_variance_ref
(
const
uint8_t
*
ref
,
const
uint8_t
*
src
,
const
uint8_t
*
second_pred
,
int
l2w
,
int
l2h
,
int
xoff
,
int
yoff
,
uint32_
t
*
sse_ptr
,
bool
use_high_bit_depth
,
vpx_bit_depth_t
bit_depth
)
{
int64_t
se
=
0
;
uint64_t
sse
=
0
;
const
int
w
=
1
<<
l2w
;
...
...
@@ -510,8 +514,10 @@ unsigned int subpel_avg_variance_ref(const uint8_t *ref,
}
}
RoundHighBitDepth
(
bit_depth
,
&
se
,
&
sse
);
*
sse_ptr
=
(
unsigned
int
)
sse
;
return
(
unsigned
int
)
(
sse
-
(((
int64_t
)
se
*
se
)
>>
(
l2w
+
l2h
)));
*
sse_ptr
=
static_cast
<
uint32_t
>
(
sse
);
return
static_cast
<
uint32_t
>
(
sse
-
((
static_cast
<
int64_t
>
(
se
)
*
se
)
>>
(
l2w
+
l2h
)));
}
template
<
typename
SubpelVarianceFunctionType
>
...
...
Write
Preview
Supports
Markdown
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