Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
1761a6b5
Commit
1761a6b5
authored
Nov 13, 2012
by
Ronald S. Bultje
Committed by
Gerrit Code Review
Nov 13, 2012
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Use full 32-pixel edge for superblock bestrefmv motion vector ordering." into experimental
parents
b147c64c
c79ae171
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
162 additions
and
24 deletions
+162
-24
vp9/common/findnearmv.c
vp9/common/findnearmv.c
+152
-24
vp9/common/rtcd_defs.sh
vp9/common/rtcd_defs.sh
+10
-0
No files found.
vp9/common/findnearmv.c
View file @
1761a6b5
...
...
@@ -42,23 +42,39 @@ vp9_prob *vp9_mv_ref_probs(VP9_COMMON *pc,
}
#define SP(x) (((x) & 7) << 1)
unsigned
int
vp9_sad3x16_c
(
const
unsigned
char
*
src_ptr
,
int
src_stride
,
const
unsigned
char
*
ref_ptr
,
int
ref_stride
,
int
max_sad
)
{
unsigned
int
vp9_sad3x16_c
(
const
unsigned
char
*
src_ptr
,
int
src_stride
,
const
unsigned
char
*
ref_ptr
,
int
ref_stride
,
int
max_sad
)
{
return
sad_mx_n_c
(
src_ptr
,
src_stride
,
ref_ptr
,
ref_stride
,
3
,
16
);
}
unsigned
int
vp9_sad16x3_c
(
const
unsigned
char
*
src_ptr
,
int
src_stride
,
const
unsigned
char
*
ref_ptr
,
int
ref_stride
,
int
max_sad
)
{
unsigned
int
vp9_sad16x3_c
(
const
unsigned
char
*
src_ptr
,
int
src_stride
,
const
unsigned
char
*
ref_ptr
,
int
ref_stride
,
int
max_sad
)
{
return
sad_mx_n_c
(
src_ptr
,
src_stride
,
ref_ptr
,
ref_stride
,
16
,
3
);
}
#if CONFIG_SUPERBLOCKS
unsigned
int
vp9_sad3x32_c
(
const
unsigned
char
*
src_ptr
,
int
src_stride
,
const
unsigned
char
*
ref_ptr
,
int
ref_stride
,
int
max_sad
)
{
return
sad_mx_n_c
(
src_ptr
,
src_stride
,
ref_ptr
,
ref_stride
,
3
,
32
);
}
unsigned
int
vp9_sad32x3_c
(
const
unsigned
char
*
src_ptr
,
int
src_stride
,
const
unsigned
char
*
ref_ptr
,
int
ref_stride
,
int
max_sad
)
{
return
sad_mx_n_c
(
src_ptr
,
src_stride
,
ref_ptr
,
ref_stride
,
32
,
3
);
}
#endif
#if CONFIG_SUBPELREFMV
unsigned
int
vp9_variance2x16_c
(
const
unsigned
char
*
src_ptr
,
const
int
source_stride
,
...
...
@@ -93,7 +109,7 @@ unsigned int vp9_sub_pixel_variance16x2_c(const unsigned char *src_ptr,
const
unsigned
char
*
dst_ptr
,
const
int
dst_pixels_per_line
,
unsigned
int
*
sse
)
{
unsigned
short
FData3
[
16
*
3
];
// Temp data buff
f
er used in filtering
unsigned
short
FData3
[
16
*
3
];
// Temp data buffer used in filtering
unsigned
char
temp2
[
20
*
16
];
const
short
*
HFilter
,
*
VFilter
;
...
...
@@ -114,7 +130,7 @@ unsigned int vp9_sub_pixel_variance2x16_c(const unsigned char *src_ptr,
const
unsigned
char
*
dst_ptr
,
const
int
dst_pixels_per_line
,
unsigned
int
*
sse
)
{
unsigned
short
FData3
[
2
*
17
];
// Temp data buff
f
er used in filtering
unsigned
short
FData3
[
2
*
17
];
// Temp data buffer used in filtering
unsigned
char
temp2
[
2
*
16
];
const
short
*
HFilter
,
*
VFilter
;
...
...
@@ -127,6 +143,76 @@ unsigned int vp9_sub_pixel_variance2x16_c(const unsigned char *src_ptr,
return
vp9_variance2x16_c
(
temp2
,
2
,
dst_ptr
,
dst_pixels_per_line
,
sse
);
}
#if CONFIG_SUPERBLOCKS
unsigned
int
vp9_variance2x32_c
(
const
unsigned
char
*
src_ptr
,
const
int
source_stride
,
const
unsigned
char
*
ref_ptr
,
const
int
recon_stride
,
unsigned
int
*
sse
)
{
unsigned
int
var
;
int
avg
;
variance
(
src_ptr
,
source_stride
,
ref_ptr
,
recon_stride
,
2
,
32
,
&
var
,
&
avg
);
*
sse
=
var
;
return
(
var
-
(((
unsigned
int
)
avg
*
avg
)
>>
5
));
}
unsigned
int
vp9_variance32x2_c
(
const
unsigned
char
*
src_ptr
,
const
int
source_stride
,
const
unsigned
char
*
ref_ptr
,
const
int
recon_stride
,
unsigned
int
*
sse
)
{
unsigned
int
var
;
int
avg
;
variance
(
src_ptr
,
source_stride
,
ref_ptr
,
recon_stride
,
32
,
2
,
&
var
,
&
avg
);
*
sse
=
var
;
return
(
var
-
(((
unsigned
int
)
avg
*
avg
)
>>
5
));
}
unsigned
int
vp9_sub_pixel_variance32x2_c
(
const
unsigned
char
*
src_ptr
,
const
int
src_pixels_per_line
,
const
int
xoffset
,
const
int
yoffset
,
const
unsigned
char
*
dst_ptr
,
const
int
dst_pixels_per_line
,
unsigned
int
*
sse
)
{
unsigned
short
FData3
[
32
*
3
];
// Temp data buffer used in filtering
unsigned
char
temp2
[
20
*
32
];
const
short
*
HFilter
,
*
VFilter
;
HFilter
=
vp9_bilinear_filters
[
xoffset
];
VFilter
=
vp9_bilinear_filters
[
yoffset
];
var_filter_block2d_bil_first_pass
(
src_ptr
,
FData3
,
src_pixels_per_line
,
1
,
3
,
32
,
HFilter
);
var_filter_block2d_bil_second_pass
(
FData3
,
temp2
,
32
,
32
,
2
,
32
,
VFilter
);
return
vp9_variance16x2_c
(
temp2
,
32
,
dst_ptr
,
dst_pixels_per_line
,
sse
);
}
unsigned
int
vp9_sub_pixel_variance2x16_c
(
const
unsigned
char
*
src_ptr
,
const
int
src_pixels_per_line
,
const
int
xoffset
,
const
int
yoffset
,
const
unsigned
char
*
dst_ptr
,
const
int
dst_pixels_per_line
,
unsigned
int
*
sse
)
{
unsigned
short
FData3
[
2
*
33
];
// Temp data buffer used in filtering
unsigned
char
temp2
[
2
*
32
];
const
short
*
HFilter
,
*
VFilter
;
HFilter
=
vp9_bilinear_filters
[
xoffset
];
VFilter
=
vp9_bilinear_filters
[
yoffset
];
var_filter_block2d_bil_first_pass
(
src_ptr
,
FData3
,
src_pixels_per_line
,
1
,
33
,
2
,
HFilter
);
var_filter_block2d_bil_second_pass
(
FData3
,
temp2
,
2
,
2
,
32
,
2
,
VFilter
);
return
vp9_variance2x16_c
(
temp2
,
2
,
dst_ptr
,
dst_pixels_per_line
,
sse
);
}
#endif
#endif
/* check a list of motion vectors by sad score using a number rows of pixels
...
...
@@ -194,15 +280,39 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
offset
=
ref_y_stride
*
row_offset
+
col_offset
;
score
=
0
;
if
(
xd
->
up_available
)
{
vp9_sub_pixel_variance16x2_c
(
above_ref
+
offset
,
ref_y_stride
,
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
row
),
above_src
,
xd
->
dst
.
y_stride
,
&
sse
);
#if CONFIG_SUPERBLOCKS
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
vp9_sub_pixel_variance32x2_c
(
above_ref
+
offset
,
ref_y_stride
,
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
row
),
above_src
,
xd
->
dst
.
y_stride
,
&
sse
);
}
else
{
#endif
vp9_sub_pixel_variance16x2_c
(
above_ref
+
offset
,
ref_y_stride
,
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
row
),
above_src
,
xd
->
dst
.
y_stride
,
&
sse
);
#if CONFIG_SUPERBLOCKS
}
#endif
score
+=
sse
;
}
if
(
xd
->
left_available
)
{
vp9_sub_pixel_variance2x16_c
(
left_ref
+
offset
,
ref_y_stride
,
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
row
),
left_src
,
xd
->
dst
.
y_stride
,
&
sse
);
#if CONFIG_SUPERBLOCKS
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
vp9_sub_pixel_variance2x32_c
(
left_ref
+
offset
,
ref_y_stride
,
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
row
),
left_src
,
xd
->
dst
.
y_stride
,
&
sse
);
}
else
{
#endif
vp9_sub_pixel_variance2x16_c
(
left_ref
+
offset
,
ref_y_stride
,
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
row
),
left_src
,
xd
->
dst
.
y_stride
,
&
sse
);
#if CONFIG_SUPERBLOCKS
}
#endif
score
+=
sse
;
}
#else
...
...
@@ -213,12 +323,30 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
offset
=
ref_y_stride
*
row_offset
+
col_offset
;
score
=
0
;
if
(
xd
->
up_available
)
{
score
+=
vp9_sad16x3
(
above_src
,
xd
->
dst
.
y_stride
,
above_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
#if CONFIG_SUPERBLOCKS
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
score
+=
vp9_sad32x3
(
above_src
,
xd
->
dst
.
y_stride
,
above_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
}
else
{
#endif
score
+=
vp9_sad16x3
(
above_src
,
xd
->
dst
.
y_stride
,
above_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
#if CONFIG_SUPERBLOCKS
}
#endif
}
if
(
xd
->
left_available
)
{
score
+=
vp9_sad3x16
(
left_src
,
xd
->
dst
.
y_stride
,
left_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
#if CONFIG_SUPERBLOCKS
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
score
+=
vp9_sad3x32
(
left_src
,
xd
->
dst
.
y_stride
,
left_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
}
else
{
#endif
score
+=
vp9_sad3x16
(
left_src
,
xd
->
dst
.
y_stride
,
left_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
#if CONFIG_SUPERBLOCKS
}
#endif
}
#endif
// Add the entry to our list and then resort the list on score.
...
...
vp9/common/rtcd_defs.sh
View file @
1761a6b5
...
...
@@ -233,6 +233,16 @@ specialize vp9_sad16x3 sse2
prototype unsigned int vp9_sad3x16
"const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
specialize vp9_sad3x16 sse2
if
[
"
$CONFIG_SUPERBLOCKS
"
=
"yes"
]
;
then
prototype unsigned int vp9_sad32x3
"const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
specialize vp9_sad32x3
prototype unsigned int vp9_sad3x32
"const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, int max_sad"
specialize vp9_sad3x32
fi
#
# Encoder functions below this point.
#
...
...
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