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
1c56946e
Commit
1c56946e
authored
12 years ago
by
Yaowu Xu
Committed by
Gerrit Code Review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "subpelrefmv for superblocks" into experimental
parents
08b43fef
61416aed
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
vp9-preview
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/common/findnearmv.c
+40
-138
vp9/common/findnearmv.c
with
40 additions
and
138 deletions
vp9/common/findnearmv.c
+
40
−
138
View file @
1c56946e
...
@@ -57,36 +57,15 @@ unsigned int vp9_sad16x3_c(const unsigned char *src_ptr,
...
@@ -57,36 +57,15 @@ unsigned int vp9_sad16x3_c(const unsigned char *src_ptr,
return
sad_mx_n_c
(
src_ptr
,
src_stride
,
ref_ptr
,
ref_stride
,
16
,
3
);
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
#if CONFIG_SUBPELREFMV
unsigned
int
vp9_variance2x16_c
(
const
unsigned
char
*
src_ptr
,
unsigned
int
vp9_variance2x16_c
(
const
unsigned
char
*
src_ptr
,
const
int
source_stride
,
const
int
source_stride
,
const
unsigned
char
*
ref_ptr
,
const
unsigned
char
*
ref_ptr
,
const
int
recon_stride
,
const
int
recon_stride
,
unsigned
int
*
sse
)
{
unsigned
int
*
sse
)
{
unsigned
int
var
;
int
sum
;
int
avg
;
variance
(
src_ptr
,
source_stride
,
ref_ptr
,
recon_stride
,
2
,
16
,
sse
,
&
sum
);
return
(
*
sse
-
(((
unsigned
int
)
sum
*
sum
)
>>
5
));
variance
(
src_ptr
,
source_stride
,
ref_ptr
,
recon_stride
,
2
,
16
,
&
var
,
&
avg
);
*
sse
=
var
;
return
(
var
-
(((
unsigned
int
)
avg
*
avg
)
>>
5
));
}
}
unsigned
int
vp9_variance16x2_c
(
const
unsigned
char
*
src_ptr
,
unsigned
int
vp9_variance16x2_c
(
const
unsigned
char
*
src_ptr
,
...
@@ -94,12 +73,9 @@ unsigned int vp9_variance16x2_c(const unsigned char *src_ptr,
...
@@ -94,12 +73,9 @@ unsigned int vp9_variance16x2_c(const unsigned char *src_ptr,
const
unsigned
char
*
ref_ptr
,
const
unsigned
char
*
ref_ptr
,
const
int
recon_stride
,
const
int
recon_stride
,
unsigned
int
*
sse
)
{
unsigned
int
*
sse
)
{
unsigned
int
var
;
int
sum
;
int
avg
;
variance
(
src_ptr
,
source_stride
,
ref_ptr
,
recon_stride
,
16
,
2
,
sse
,
&
sum
);
return
(
*
sse
-
(((
unsigned
int
)
sum
*
sum
)
>>
5
));
variance
(
src_ptr
,
source_stride
,
ref_ptr
,
recon_stride
,
16
,
2
,
&
var
,
&
avg
);
*
sse
=
var
;
return
(
var
-
(((
unsigned
int
)
avg
*
avg
)
>>
5
));
}
}
unsigned
int
vp9_sub_pixel_variance16x2_c
(
const
unsigned
char
*
src_ptr
,
unsigned
int
vp9_sub_pixel_variance16x2_c
(
const
unsigned
char
*
src_ptr
,
...
@@ -110,7 +86,7 @@ unsigned int vp9_sub_pixel_variance16x2_c(const unsigned char *src_ptr,
...
@@ -110,7 +86,7 @@ unsigned int vp9_sub_pixel_variance16x2_c(const unsigned char *src_ptr,
const
int
dst_pixels_per_line
,
const
int
dst_pixels_per_line
,
unsigned
int
*
sse
)
{
unsigned
int
*
sse
)
{
unsigned
short
FData3
[
16
*
3
];
// Temp data buffer used in filtering
unsigned
short
FData3
[
16
*
3
];
// Temp data buffer used in filtering
unsigned
char
temp2
[
2
0
*
16
];
unsigned
char
temp2
[
2
*
16
];
const
short
*
HFilter
,
*
VFilter
;
const
short
*
HFilter
,
*
VFilter
;
HFilter
=
vp9_bilinear_filters
[
xoffset
];
HFilter
=
vp9_bilinear_filters
[
xoffset
];
...
@@ -143,76 +119,6 @@ unsigned int vp9_sub_pixel_variance2x16_c(const unsigned char *src_ptr,
...
@@ -143,76 +119,6 @@ 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
);
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
)
>>
6
));
}
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
)
>>
6
));
}
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_variance32x2_c
(
temp2
,
32
,
dst_ptr
,
dst_pixels_per_line
,
sse
);
}
unsigned
int
vp9_sub_pixel_variance2x32_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_variance2x32_c
(
temp2
,
2
,
dst_ptr
,
dst_pixels_per_line
,
sse
);
}
#endif
#endif
#endif
/* check a list of motion vectors by sad score using a number rows of pixels
/* check a list of motion vectors by sad score using a number rows of pixels
...
@@ -231,9 +137,9 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
...
@@ -231,9 +137,9 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
unsigned
char
*
left_src
;
unsigned
char
*
left_src
;
unsigned
char
*
above_ref
;
unsigned
char
*
above_ref
;
unsigned
char
*
left_ref
;
unsigned
char
*
left_ref
;
int
score
;
unsigned
int
score
;
int
sse
;
unsigned
int
sse
;
int
ref_scores
[
MAX_MV_REFS
]
=
{
0
};
unsigned
int
ref_scores
[
MAX_MV_REFS
]
=
{
0
};
int_mv
sorted_mvs
[
MAX_MV_REFS
];
int_mv
sorted_mvs
[
MAX_MV_REFS
];
int
zero_seen
=
FALSE
;
int
zero_seen
=
FALSE
;
...
@@ -274,46 +180,46 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
...
@@ -274,46 +180,46 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
xd
->
mb_to_right_edge
+
RIGHT_BOTTOM_MARGIN
,
xd
->
mb_to_right_edge
+
RIGHT_BOTTOM_MARGIN
,
xd
->
mb_to_top_edge
-
LEFT_TOP_MARGIN
+
24
,
xd
->
mb_to_top_edge
-
LEFT_TOP_MARGIN
+
24
,
xd
->
mb_to_bottom_edge
+
RIGHT_BOTTOM_MARGIN
);
xd
->
mb_to_bottom_edge
+
RIGHT_BOTTOM_MARGIN
);
#if CONFIG_SUBPELREFMV
#if CONFIG_SUBPELREFMV
row_offset
=
this_mv
.
as_mv
.
row
>>
3
;
row_offset
=
this_mv
.
as_mv
.
row
>>
3
;
col_offset
=
this_mv
.
as_mv
.
col
>>
3
;
col_offset
=
this_mv
.
as_mv
.
col
>>
3
;
offset
=
ref_y_stride
*
row_offset
+
col_offset
;
offset
=
ref_y_stride
*
row_offset
+
col_offset
;
score
=
0
;
score
=
0
;
if
(
xd
->
up_available
)
{
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
);
score
+=
sse
;
#if CONFIG_SUPERBLOCKS
#if CONFIG_SUPERBLOCKS
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
vp9_sub_pixel_variance32x2_c
(
above_ref
+
offset
,
ref_y_stride
,
vp9_sub_pixel_variance16x2_c
(
above_ref
+
offset
+
16
,
ref_y_stride
,
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
row
),
SP
(
this_mv
.
as_mv
.
row
),
above_src
,
xd
->
dst
.
y_stride
,
&
sse
);
above_src
+
16
,
xd
->
dst
.
y_stride
,
&
sse
);
}
else
{
score
+=
sse
;
#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
#endif
score
+=
sse
;
}
}
if
(
xd
->
left_available
)
{
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
);
score
+=
sse
;
#if CONFIG_SUPERBLOCKS
#if CONFIG_SUPERBLOCKS
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
vp9_sub_pixel_variance2x32_c
(
left_ref
+
offset
,
ref_y_stride
,
vp9_sub_pixel_variance2x16_c
(
left_ref
+
offset
+
ref_y_stride
*
16
,
ref_y_stride
,
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
col
),
SP
(
this_mv
.
as_mv
.
row
),
SP
(
this_mv
.
as_mv
.
row
),
left_src
,
xd
->
dst
.
y_stride
,
&
sse
);
left_src
+
xd
->
dst
.
y_stride
*
16
,
}
else
{
xd
->
dst
.
y_stride
,
&
sse
);
#endif
score
+=
sse
;
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
#endif
score
+=
sse
;
}
}
#else
#else
row_offset
=
(
this_mv
.
as_mv
.
row
>
0
)
?
row_offset
=
(
this_mv
.
as_mv
.
row
>
0
)
?
...
@@ -323,28 +229,24 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
...
@@ -323,28 +229,24 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd,
offset
=
ref_y_stride
*
row_offset
+
col_offset
;
offset
=
ref_y_stride
*
row_offset
+
col_offset
;
score
=
0
;
score
=
0
;
if
(
xd
->
up_available
)
{
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 CONFIG_SUPERBLOCKS
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
score
+=
vp9_sad32x3
(
above_src
,
xd
->
dst
.
y_stride
,
score
+=
vp9_sad16x3
(
above_src
+
16
,
xd
->
dst
.
y_stride
,
above_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
above_ref
+
offset
+
16
,
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
#endif
}
}
if
(
xd
->
left_available
)
{
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 CONFIG_SUPERBLOCKS
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
if
(
xd
->
mode_info_context
->
mbmi
.
encoded_as_sb
)
{
score
+=
vp9_sad3x32
(
left_src
,
xd
->
dst
.
y_stride
,
score
+=
vp9_sad3x16
(
left_src
+
xd
->
dst
.
y_stride
*
16
,
left_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
xd
->
dst
.
y_stride
,
}
else
{
left_ref
+
offset
+
ref_y_stride
*
16
,
#endif
ref_y_stride
,
INT_MAX
);
score
+=
vp9_sad3x16
(
left_src
,
xd
->
dst
.
y_stride
,
left_ref
+
offset
,
ref_y_stride
,
INT_MAX
);
#if CONFIG_SUPERBLOCKS
}
}
#endif
#endif
}
}
...
...
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