Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
libvpx
Commits
6202c75f
Commit
6202c75f
authored
Oct 18, 2014
by
Debargha Mukherjee
Committed by
Gerrit Code Review
Oct 18, 2014
Browse files
Merge "Add highbitdepth function for vp9_avg_8x8"
parents
06e65269
73ae6e49
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
2 deletions
+32
-2
vp9/common/vp9_rtcd_defs.pl
vp9/common/vp9_rtcd_defs.pl
+5
-0
vp9/encoder/vp9_avg.c
vp9/encoder/vp9_avg.c
+14
-0
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encodeframe.c
+13
-2
No files found.
vp9/common/vp9_rtcd_defs.pl
View file @
6202c75f
...
...
@@ -1114,6 +1114,11 @@ specialize qw/vp9_get_mb_ss/, "$sse2_x86inc";
add_proto
qw/unsigned int vp9_avg_8x8/
,
"
const uint8_t *, int p
";
specialize
qw/vp9_avg_8x8 sse2/
;
if
(
vpx_config
("
CONFIG_VP9_HIGHBITDEPTH
")
eq
"
yes
")
{
add_proto
qw/unsigned int vp9_highbd_avg_8x8/
,
"
const uint8_t *, int p
";
specialize
qw/vp9_highbd_avg_8x8/
;
}
# ENCODEMB INVOKE
add_proto
qw/void vp9_subtract_block/
,
"
int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride
";
...
...
vp9/encoder/vp9_avg.c
View file @
6202c75f
...
...
@@ -7,6 +7,7 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vp9/common/vp9_common.h"
#include "vpx_ports/mem.h"
unsigned
int
vp9_avg_8x8_c
(
const
uint8_t
*
s
,
int
p
)
{
...
...
@@ -17,3 +18,16 @@ unsigned int vp9_avg_8x8_c(const uint8_t *s, int p) {
return
(
sum
+
32
)
>>
6
;
}
#if CONFIG_VP9_HIGHBITDEPTH
unsigned
int
vp9_highbd_avg_8x8_c
(
const
uint8_t
*
s8
,
int
p
)
{
int
i
,
j
;
int
sum
=
0
;
const
uint16_t
*
s
=
CONVERT_TO_SHORTPTR
(
s8
);
for
(
i
=
0
;
i
<
8
;
++
i
,
s
+=
p
)
for
(
j
=
0
;
j
<
8
;
sum
+=
s
[
j
],
++
j
)
{}
return
(
sum
+
32
)
>>
6
;
}
#endif // CONFIG_VP9_HIGHBITDEPTH
vp9/encoder/vp9_encodeframe.c
View file @
6202c75f
...
...
@@ -533,8 +533,19 @@ static void choose_partitioning(VP9_COMP *cpi,
int
sum
=
0
;
if
(
x_idx
<
pixels_wide
&&
y_idx
<
pixels_high
)
{
int
s_avg
=
vp9_avg_8x8
(
s
+
y_idx
*
sp
+
x_idx
,
sp
);
int
d_avg
=
vp9_avg_8x8
(
d
+
y_idx
*
dp
+
x_idx
,
dp
);
int
s_avg
,
d_avg
;
#if CONFIG_VP9_HIGHBITDEPTH
if
(
xd
->
cur_buf
->
flags
&
YV12_FLAG_HIGHBITDEPTH
)
{
s_avg
=
vp9_highbd_avg_8x8
(
s
+
y_idx
*
sp
+
x_idx
,
sp
);
d_avg
=
vp9_highbd_avg_8x8
(
d
+
y_idx
*
dp
+
x_idx
,
dp
);
}
else
{
s_avg
=
vp9_avg_8x8
(
s
+
y_idx
*
sp
+
x_idx
,
sp
);
d_avg
=
vp9_avg_8x8
(
d
+
y_idx
*
dp
+
x_idx
,
dp
);
}
#else
s_avg
=
vp9_avg_8x8
(
s
+
y_idx
*
sp
+
x_idx
,
sp
);
d_avg
=
vp9_avg_8x8
(
d
+
y_idx
*
dp
+
x_idx
,
dp
);
#endif
sum
=
s_avg
-
d_avg
;
sse
=
sum
*
sum
;
}
...
...
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