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
18433aef
Commit
18433aef
authored
Apr 18, 2012
by
Ronald S. Bultje
Browse files
Compound prediction for splitmv macroblocks.
Change-Id: I0af3395500b1cb0ed629249eb6636a0c9322cb18
parent
1cc406ab
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
vp8/common/blockd.h
View file @
18433aef
...
...
@@ -168,7 +168,10 @@ union b_mode_info
B_PREDICTION_MODE
second
;
#endif
}
as_mode
;
int_mv
mv
;
struct
{
int_mv
first
;
int_mv
second
;
}
as_mv
;
};
typedef
enum
...
...
@@ -222,6 +225,7 @@ typedef struct
/* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */
unsigned
char
**
base_pre
;
unsigned
char
**
base_second_pre
;
int
pre
;
int
pre_stride
;
...
...
@@ -316,6 +320,8 @@ typedef struct MacroBlockD
vp8_subpix_fn_t
subpixel_predict8x4
;
vp8_subpix_fn_t
subpixel_predict8x8
;
vp8_subpix_fn_t
subpixel_predict16x16
;
vp8_subpix_fn_t
subpixel_predict_avg
;
vp8_subpix_fn_t
subpixel_predict_avg8x4
;
vp8_subpix_fn_t
subpixel_predict_avg8x8
;
vp8_subpix_fn_t
subpixel_predict_avg16x16
;
#if CONFIG_HIGH_PRECISION_MV
...
...
vp8/common/debugmodes.c
View file @
18433aef
...
...
@@ -148,7 +148,9 @@ void vp8_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols, int f
{
mb_index
=
(
b_row
>>
2
)
*
(
cols
+
1
)
+
(
b_col
>>
2
);
bindex
=
(
b_row
&
3
)
*
4
+
(
b_col
&
3
);
fprintf
(
mvs
,
"%3d:%-3d "
,
mi
[
mb_index
].
bmi
[
bindex
].
mv
.
as_mv
.
row
,
mi
[
mb_index
].
bmi
[
bindex
].
mv
.
as_mv
.
col
);
fprintf
(
mvs
,
"%3d:%-3d "
,
mi
[
mb_index
].
bmi
[
bindex
].
as_mv
.
first
.
as_mv
.
row
,
mi
[
mb_index
].
bmi
[
bindex
].
as_mv
.
first
.
as_mv
.
col
);
}
...
...
vp8/common/filter.c
View file @
18433aef
...
...
@@ -456,6 +456,56 @@ void vp8_sixtap_predict_c
filter_block2d_6
(
src_ptr
,
dst_ptr
,
src_pixels_per_line
,
dst_pitch
,
HFilter
,
VFilter
);
}
/*
* The difference between filter_block2d_6() and filter_block2d_avg_6 is
* that filter_block2d_6() does a 6-tap filter and stores it in the output
* buffer, whereas filter_block2d_avg_6() does the same 6-tap filter, and
* then averages that with the content already present in the output
* ((filter_result + dest + 1) >> 1) and stores that in the output.
*/
static
void
filter_block2d_avg_6
(
unsigned
char
*
src_ptr
,
unsigned
char
*
output_ptr
,
unsigned
int
src_pixels_per_line
,
int
output_pitch
,
const
short
*
HFilter
,
const
short
*
VFilter
)
{
int
FData
[(
3
+
Interp_Extend
*
2
)
*
4
];
/* Temp data buffer used in filtering */
/* First filter 1-D horizontally... */
filter_block2d_first_pass_6
(
src_ptr
-
((
Interp_Extend
-
1
)
*
src_pixels_per_line
),
FData
,
src_pixels_per_line
,
1
,
3
+
Interp_Extend
*
2
,
4
,
HFilter
);
/* then filter verticaly... */
filter_block2d_second_pass_avg_6
(
FData
+
4
*
(
Interp_Extend
-
1
),
output_ptr
,
output_pitch
,
4
,
4
,
4
,
4
,
VFilter
);
}
void
vp8_sixtap_predict_avg_c
(
unsigned
char
*
src_ptr
,
int
src_pixels_per_line
,
int
xoffset
,
int
yoffset
,
unsigned
char
*
dst_ptr
,
int
dst_pitch
)
{
const
short
*
HFilter
;
const
short
*
VFilter
;
HFilter
=
vp8_sub_pel_filters_6
[
xoffset
];
/* 6 tap */
VFilter
=
vp8_sub_pel_filters_6
[
yoffset
];
/* 6 tap */
filter_block2d_avg_6
(
src_ptr
,
dst_ptr
,
src_pixels_per_line
,
dst_pitch
,
HFilter
,
VFilter
);
}
void
vp8_sixtap_predict8x8_c
(
unsigned
char
*
src_ptr
,
...
...
@@ -1366,6 +1416,26 @@ void vp8_bilinear_predict4x4_c
}
void
vp8_bilinear_predict_avg4x4_c
(
unsigned
char
*
src_ptr
,
int
src_pixels_per_line
,
int
xoffset
,
int
yoffset
,
unsigned
char
*
dst_ptr
,
int
dst_pitch
)
{
const
short
*
HFilter
;
const
short
*
VFilter
;
HFilter
=
vp8_bilinear_filters
[
xoffset
];
VFilter
=
vp8_bilinear_filters
[
yoffset
];
filter_block2d_bil_avg
(
src_ptr
,
dst_ptr
,
src_pixels_per_line
,
dst_pitch
,
HFilter
,
VFilter
,
4
,
4
);
}
void
vp8_bilinear_predict8x8_c
(
unsigned
char
*
src_ptr
,
...
...
vp8/common/findnearmv.h
View file @
18433aef
...
...
@@ -102,7 +102,22 @@ static int left_block_mv(const MODE_INFO *cur_mb, int b)
b
+=
4
;
}
return
(
cur_mb
->
bmi
+
b
-
1
)
->
mv
.
as_int
;
return
(
cur_mb
->
bmi
+
b
-
1
)
->
as_mv
.
first
.
as_int
;
}
static
int
left_block_second_mv
(
const
MODE_INFO
*
cur_mb
,
int
b
)
{
if
(
!
(
b
&
3
))
{
/* On L edge, get from MB to left of us */
--
cur_mb
;
if
(
cur_mb
->
mbmi
.
mode
!=
SPLITMV
)
return
cur_mb
->
mbmi
.
second_ref_frame
?
cur_mb
->
mbmi
.
second_mv
.
as_int
:
cur_mb
->
mbmi
.
mv
.
as_int
;
b
+=
4
;
}
return
cur_mb
->
mbmi
.
second_ref_frame
?
(
cur_mb
->
bmi
+
b
-
1
)
->
as_mv
.
second
.
as_int
:
(
cur_mb
->
bmi
+
b
-
1
)
->
as_mv
.
first
.
as_int
;
}
static
int
above_block_mv
(
const
MODE_INFO
*
cur_mb
,
int
b
,
int
mi_stride
)
...
...
@@ -117,8 +132,24 @@ static int above_block_mv(const MODE_INFO *cur_mb, int b, int mi_stride)
b
+=
16
;
}
return
(
cur_mb
->
bmi
+
b
-
4
)
->
mv
.
as_int
;
return
(
cur_mb
->
bmi
+
b
-
4
)
->
as_mv
.
first
.
as_int
;
}
static
int
above_block_second_mv
(
const
MODE_INFO
*
cur_mb
,
int
b
,
int
mi_stride
)
{
if
(
!
(
b
>>
2
))
{
/* On top edge, get from MB above us */
cur_mb
-=
mi_stride
;
if
(
cur_mb
->
mbmi
.
mode
!=
SPLITMV
)
return
cur_mb
->
mbmi
.
second_ref_frame
?
cur_mb
->
mbmi
.
second_mv
.
as_int
:
cur_mb
->
mbmi
.
mv
.
as_int
;
b
+=
16
;
}
return
cur_mb
->
mbmi
.
second_ref_frame
?
(
cur_mb
->
bmi
+
b
-
4
)
->
as_mv
.
second
.
as_int
:
(
cur_mb
->
bmi
+
b
-
4
)
->
as_mv
.
first
.
as_int
;
}
static
B_PREDICTION_MODE
left_block_mode
(
const
MODE_INFO
*
cur_mb
,
int
b
)
{
if
(
!
(
b
&
3
))
...
...
vp8/common/generic/systemdependent.c
View file @
18433aef
...
...
@@ -99,12 +99,14 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
rtcd
->
subpix
.
sixtap_avg8x8
=
vp8_sixtap_predict_avg8x8_c
;
rtcd
->
subpix
.
sixtap8x4
=
vp8_sixtap_predict8x4_c
;
rtcd
->
subpix
.
sixtap4x4
=
vp8_sixtap_predict_c
;
rtcd
->
subpix
.
sixtap_avg4x4
=
vp8_sixtap_predict_avg_c
;
rtcd
->
subpix
.
bilinear16x16
=
vp8_bilinear_predict16x16_c
;
rtcd
->
subpix
.
bilinear8x8
=
vp8_bilinear_predict8x8_c
;
rtcd
->
subpix
.
bilinear_avg16x16
=
vp8_bilinear_predict_avg16x16_c
;
rtcd
->
subpix
.
bilinear_avg8x8
=
vp8_bilinear_predict_avg8x8_c
;
rtcd
->
subpix
.
bilinear8x4
=
vp8_bilinear_predict8x4_c
;
rtcd
->
subpix
.
bilinear4x4
=
vp8_bilinear_predict4x4_c
;
rtcd
->
subpix
.
bilinear_avg4x4
=
vp8_bilinear_predict_avg4x4_c
;
rtcd
->
loopfilter
.
normal_mb_v
=
vp8_loop_filter_mbv_c
;
rtcd
->
loopfilter
.
normal_b_v
=
vp8_loop_filter_bv_c
;
...
...
vp8/common/mbpitch.c
View file @
18433aef
...
...
@@ -22,6 +22,7 @@ static void setup_block
BLOCKD
*
b
,
int
mv_stride
,
unsigned
char
**
base
,
unsigned
char
**
base2
,
int
Stride
,
int
offset
,
BLOCKSET
bs
...
...
@@ -39,6 +40,7 @@ static void setup_block
b
->
pre_stride
=
Stride
;
b
->
pre
=
offset
;
b
->
base_pre
=
base
;
b
->
base_second_pre
=
base2
;
}
}
...
...
@@ -49,6 +51,7 @@ static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs)
int
block
;
unsigned
char
**
y
,
**
u
,
**
v
;
unsigned
char
**
y2
,
**
u2
,
**
v2
;
if
(
bs
==
DEST
)
{
...
...
@@ -61,20 +64,24 @@ static void setup_macroblock(MACROBLOCKD *x, BLOCKSET bs)
y
=
&
x
->
pre
.
y_buffer
;
u
=
&
x
->
pre
.
u_buffer
;
v
=
&
x
->
pre
.
v_buffer
;
y2
=
&
x
->
second_pre
.
y_buffer
;
u2
=
&
x
->
second_pre
.
u_buffer
;
v2
=
&
x
->
second_pre
.
v_buffer
;
}
for
(
block
=
0
;
block
<
16
;
block
++
)
/* y blocks */
{
setup_block
(
&
x
->
block
[
block
],
x
->
dst
.
y_stride
,
y
,
x
->
dst
.
y_stride
,
setup_block
(
&
x
->
block
[
block
],
x
->
dst
.
y_stride
,
y
,
y2
,
x
->
dst
.
y_stride
,
(
block
>>
2
)
*
4
*
x
->
dst
.
y_stride
+
(
block
&
3
)
*
4
,
bs
);
}
for
(
block
=
16
;
block
<
20
;
block
++
)
/* U and V blocks */
{
setup_block
(
&
x
->
block
[
block
],
x
->
dst
.
uv_stride
,
u
,
x
->
dst
.
uv_stride
,
setup_block
(
&
x
->
block
[
block
],
x
->
dst
.
uv_stride
,
u
,
u2
,
x
->
dst
.
uv_stride
,
((
block
-
16
)
>>
1
)
*
4
*
x
->
dst
.
uv_stride
+
(
block
&
1
)
*
4
,
bs
);
setup_block
(
&
x
->
block
[
block
+
4
],
x
->
dst
.
uv_stride
,
v
,
x
->
dst
.
uv_stride
,
setup_block
(
&
x
->
block
[
block
+
4
],
x
->
dst
.
uv_stride
,
v
,
v2
,
x
->
dst
.
uv_stride
,
((
block
-
16
)
>>
1
)
*
4
*
x
->
dst
.
uv_stride
+
(
block
&
1
)
*
4
,
bs
);
}
}
...
...
vp8/common/reconinter.c
View file @
18433aef
...
...
@@ -174,21 +174,23 @@ void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf)
unsigned
char
*
ptr_base
;
unsigned
char
*
ptr
;
unsigned
char
*
pred_ptr
=
d
->
predictor
;
int_mv
mv
;
ptr_base
=
*
(
d
->
base_pre
);
mv
.
as_int
=
d
->
bmi
.
as_mv
.
first
.
as_int
;
if
(
d
->
bmi
.
mv
.
as_mv
.
row
&
7
||
d
->
bmi
.
mv
.
as_mv
.
col
&
7
)
if
(
mv
.
as_mv
.
row
&
7
||
mv
.
as_mv
.
col
&
7
)
{
ptr
=
ptr_base
+
d
->
pre
+
(
d
->
bmi
.
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
d
->
bmi
.
mv
.
as_mv
.
col
>>
3
);
ptr
=
ptr_base
+
d
->
pre
+
(
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
mv
.
as_mv
.
col
>>
3
);
#if CONFIG_SIXTEENTH_SUBPEL_UV
sppf
(
ptr
,
d
->
pre_stride
,
(
d
->
bmi
.
mv
.
as_mv
.
col
&
7
)
<<
1
,
(
d
->
bmi
.
mv
.
as_mv
.
row
&
7
)
<<
1
,
pred_ptr
,
pitch
);
sppf
(
ptr
,
d
->
pre_stride
,
(
mv
.
as_mv
.
col
&
7
)
<<
1
,
(
mv
.
as_mv
.
row
&
7
)
<<
1
,
pred_ptr
,
pitch
);
#else
sppf
(
ptr
,
d
->
pre_stride
,
d
->
bmi
.
mv
.
as_mv
.
col
&
7
,
d
->
bmi
.
mv
.
as_mv
.
row
&
7
,
pred_ptr
,
pitch
);
sppf
(
ptr
,
d
->
pre_stride
,
mv
.
as_mv
.
col
&
7
,
mv
.
as_mv
.
row
&
7
,
pred_ptr
,
pitch
);
#endif
}
else
{
ptr_base
+=
d
->
pre
+
(
d
->
bmi
.
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
d
->
bmi
.
mv
.
as_mv
.
col
>>
3
);
ptr_base
+=
d
->
pre
+
(
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
mv
.
as_mv
.
col
>>
3
);
ptr
=
ptr_base
;
for
(
r
=
0
;
r
<
4
;
r
++
)
...
...
@@ -207,21 +209,66 @@ void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, vp8_subpix_fn_t sppf)
}
}
/*
* Similar to vp8_build_inter_predictors_b(), but instead of storing the
* results in d->predictor, we average the contents of d->predictor (which
* come from an earlier call to vp8_build_inter_predictors_b()) with the
* predictor of the second reference frame / motion vector.
*/
void
vp8_build_2nd_inter_predictors_b
(
BLOCKD
*
d
,
int
pitch
,
vp8_subpix_fn_t
sppf
)
{
int
r
;
unsigned
char
*
ptr_base
;
unsigned
char
*
ptr
;
unsigned
char
*
pred_ptr
=
d
->
predictor
;
int_mv
mv
;
ptr_base
=
*
(
d
->
base_second_pre
);
mv
.
as_int
=
d
->
bmi
.
as_mv
.
second
.
as_int
;
if
(
mv
.
as_mv
.
row
&
7
||
mv
.
as_mv
.
col
&
7
)
{
ptr
=
ptr_base
+
d
->
pre
+
(
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
mv
.
as_mv
.
col
>>
3
);
#if CONFIG_SIXTEENTH_SUBPEL_UV
sppf
(
ptr
,
d
->
pre_stride
,
(
mv
.
as_mv
.
col
&
7
)
<<
1
,
(
mv
.
as_mv
.
row
&
7
)
<<
1
,
pred_ptr
,
pitch
);
#else
sppf
(
ptr
,
d
->
pre_stride
,
mv
.
as_mv
.
col
&
7
,
mv
.
as_mv
.
row
&
7
,
pred_ptr
,
pitch
);
#endif
}
else
{
ptr_base
+=
d
->
pre
+
(
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
mv
.
as_mv
.
col
>>
3
);
ptr
=
ptr_base
;
for
(
r
=
0
;
r
<
4
;
r
++
)
{
pred_ptr
[
0
]
=
(
pred_ptr
[
0
]
+
ptr
[
0
]
+
1
)
>>
1
;
pred_ptr
[
1
]
=
(
pred_ptr
[
1
]
+
ptr
[
1
]
+
1
)
>>
1
;
pred_ptr
[
2
]
=
(
pred_ptr
[
2
]
+
ptr
[
2
]
+
1
)
>>
1
;
pred_ptr
[
3
]
=
(
pred_ptr
[
3
]
+
ptr
[
3
]
+
1
)
>>
1
;
pred_ptr
+=
pitch
;
ptr
+=
d
->
pre_stride
;
}
}
}
static
void
build_inter_predictors4b
(
MACROBLOCKD
*
x
,
BLOCKD
*
d
,
int
pitch
)
{
unsigned
char
*
ptr_base
;
unsigned
char
*
ptr
;
unsigned
char
*
pred_ptr
=
d
->
predictor
;
int_mv
mv
;
ptr_base
=
*
(
d
->
base_pre
);
ptr
=
ptr_base
+
d
->
pre
+
(
d
->
bmi
.
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
d
->
bmi
.
mv
.
as_mv
.
col
>>
3
);
mv
.
as_int
=
d
->
bmi
.
as_mv
.
first
.
as_int
;
ptr
=
ptr_base
+
d
->
pre
+
(
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
mv
.
as_mv
.
col
>>
3
);
if
(
d
->
bmi
.
mv
.
as_mv
.
row
&
7
||
d
->
bmi
.
mv
.
as_mv
.
col
&
7
)
if
(
mv
.
as_mv
.
row
&
7
||
mv
.
as_mv
.
col
&
7
)
{
#if CONFIG_SIXTEENTH_SUBPEL_UV
x
->
subpixel_predict8x8
(
ptr
,
d
->
pre_stride
,
(
d
->
bmi
.
mv
.
as_mv
.
col
&
7
)
<<
1
,
(
d
->
bmi
.
mv
.
as_mv
.
row
&
7
)
<<
1
,
pred_ptr
,
pitch
);
x
->
subpixel_predict8x8
(
ptr
,
d
->
pre_stride
,
(
mv
.
as_mv
.
col
&
7
)
<<
1
,
(
mv
.
as_mv
.
row
&
7
)
<<
1
,
pred_ptr
,
pitch
);
#else
x
->
subpixel_predict8x8
(
ptr
,
d
->
pre_stride
,
d
->
bmi
.
mv
.
as_mv
.
col
&
7
,
d
->
bmi
.
mv
.
as_mv
.
row
&
7
,
pred_ptr
,
pitch
);
x
->
subpixel_predict8x8
(
ptr
,
d
->
pre_stride
,
mv
.
as_mv
.
col
&
7
,
mv
.
as_mv
.
row
&
7
,
pred_ptr
,
pitch
);
#endif
}
else
...
...
@@ -230,21 +277,54 @@ static void build_inter_predictors4b(MACROBLOCKD *x, BLOCKD *d, int pitch)
}
}
/*
* Similar to build_inter_predictors_4b(), but instead of storing the
* results in d->predictor, we average the contents of d->predictor (which
* come from an earlier call to build_inter_predictors_4b()) with the
* predictor of the second reference frame / motion vector.
*/
static
void
build_2nd_inter_predictors4b
(
MACROBLOCKD
*
x
,
BLOCKD
*
d
,
int
pitch
)
{
unsigned
char
*
ptr_base
;
unsigned
char
*
ptr
;
unsigned
char
*
pred_ptr
=
d
->
predictor
;
int_mv
mv
;
ptr_base
=
*
(
d
->
base_second_pre
);
mv
.
as_int
=
d
->
bmi
.
as_mv
.
second
.
as_int
;
ptr
=
ptr_base
+
d
->
pre
+
(
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
mv
.
as_mv
.
col
>>
3
);
if
(
mv
.
as_mv
.
row
&
7
||
mv
.
as_mv
.
col
&
7
)
{
#if CONFIG_SIXTEENTH_SUBPEL_UV
x
->
subpixel_predict_avg8x8
(
ptr
,
d
->
pre_stride
,
(
mv
.
as_mv
.
col
&
7
)
<<
1
,
(
mv
.
as_mv
.
row
&
7
)
<<
1
,
pred_ptr
,
pitch
);
#else
x
->
subpixel_predict_avg8x8
(
ptr
,
d
->
pre_stride
,
mv
.
as_mv
.
col
&
7
,
mv
.
as_mv
.
row
&
7
,
pred_ptr
,
pitch
);
#endif
}
else
{
RECON_INVOKE
(
&
x
->
rtcd
->
recon
,
avg8x8
)(
ptr
,
d
->
pre_stride
,
pred_ptr
,
pitch
);
}
}
static
void
build_inter_predictors2b
(
MACROBLOCKD
*
x
,
BLOCKD
*
d
,
int
pitch
)
{
unsigned
char
*
ptr_base
;
unsigned
char
*
ptr
;
unsigned
char
*
pred_ptr
=
d
->
predictor
;
int_mv
mv
;
ptr_base
=
*
(
d
->
base_pre
);
ptr
=
ptr_base
+
d
->
pre
+
(
d
->
bmi
.
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
d
->
bmi
.
mv
.
as_mv
.
col
>>
3
);
mv
.
as_int
=
d
->
bmi
.
as_mv
.
first
.
as_int
;
ptr
=
ptr_base
+
d
->
pre
+
(
mv
.
as_mv
.
row
>>
3
)
*
d
->
pre_stride
+
(
mv
.
as_mv
.
col
>>
3
);
if
(
d
->
bmi
.
mv
.
as_mv
.
row
&
7
||
d
->
bmi
.
mv
.
as_mv
.
col
&
7
)
if
(
mv
.
as_mv
.
row
&
7
||
mv
.
as_mv
.
col
&
7
)
{
#if CONFIG_SIXTEENTH_SUBPEL_UV
x
->
subpixel_predict8x4
(
ptr
,
d
->
pre_stride
,
(
d
->
bmi
.
mv
.
as_mv
.
col
&
7
)
<<
1
,
(
d
->
bmi
.
mv
.
as_mv
.
row
&
7
)
<<
1
,
pred_ptr
,
pitch
);
x
->
subpixel_predict8x4
(
ptr
,
d
->
pre_stride
,
(
mv
.
as_mv
.
col
&
7
)
<<
1
,
(
mv
.
as_mv
.
row
&
7
)
<<
1
,
pred_ptr
,
pitch
);
#else
x
->
subpixel_predict8x4
(
ptr
,
d
->
pre_stride
,
d
->
bmi
.
mv
.
as_mv
.
col
&
7
,
d
->
bmi
.
mv
.
as_mv
.
row
&
7
,
pred_ptr
,
pitch
);
x
->
subpixel_predict8x4
(
ptr
,
d
->
pre_stride
,
mv
.
as_mv
.
col
&
7
,
mv
.
as_mv
.
row
&
7
,
pred_ptr
,
pitch
);
#endif
}
else
...
...
@@ -322,33 +402,72 @@ void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x)
int
yoffset
=
i
*
8
+
j
*
2
;
int
uoffset
=
16
+
i
*
2
+
j
;
int
voffset
=
20
+
i
*
2
+
j
;
int
temp
;
temp
=
x
->
block
[
yoffset
].
bmi
.
mv
.
as_mv
.
row
+
x
->
block
[
yoffset
+
1
].
bmi
.
mv
.
as_mv
.
row
+
x
->
block
[
yoffset
+
4
].
bmi
.
mv
.
as_mv
.
row
+
x
->
block
[
yoffset
+
5
].
bmi
.
mv
.
as_mv
.
row
;
temp
=
x
->
block
[
yoffset
].
bmi
.
as_mv
.
first
.
as_mv
.
row
+
x
->
block
[
yoffset
+
1
].
bmi
.
as_mv
.
first
.
as_mv
.
row
+
x
->
block
[
yoffset
+
4
].
bmi
.
as_mv
.
first
.
as_mv
.
row
+
x
->
block
[
yoffset
+
5
].
bmi
.
as_mv
.
first
.
as_mv
.
row
;
if
(
temp
<
0
)
temp
-=
4
;
else
temp
+=
4
;
x
->
block
[
uoffset
].
bmi
.
mv
.
as_mv
.
row
=
(
temp
/
8
)
&
x
->
fullpixel_mask
;
x
->
block
[
uoffset
].
bmi
.
as_mv
.
first
.
as_mv
.
row
=
(
temp
/
8
)
&
x
->
fullpixel_mask
;
temp
=
x
->
block
[
yoffset
].
bmi
.
mv
.
as_mv
.
col
+
x
->
block
[
yoffset
+
1
].
bmi
.
mv
.
as_mv
.
col
+
x
->
block
[
yoffset
+
4
].
bmi
.
mv
.
as_mv
.
col
+
x
->
block
[
yoffset
+
5
].
bmi
.
mv
.
as_mv
.
col
;
temp
=
x
->
block
[
yoffset
].
bmi
.
as_mv
.
first
.
as_mv
.
col
+
x
->
block
[
yoffset
+
1
].
bmi
.
as_mv
.
first
.
as_mv
.
col
+
x
->
block
[
yoffset
+
4
].
bmi
.
as_mv
.
first
.
as_mv
.
col
+
x
->
block
[
yoffset
+
5
].
bmi
.
as_mv
.
first
.
as_mv
.
col
;
if
(
temp
<
0
)
temp
-=
4
;
else
temp
+=
4
;
x
->
block
[
uoffset
].
bmi
.
mv
.
as_mv
.
col
=
(
temp
/
8
)
&
x
->
fullpixel_mask
;
x
->
block
[
uoffset
].
bmi
.
as_mv
.
first
.
as_mv
.
col
=
(
temp
/
8
)
&
x
->
fullpixel_mask
;
x
->
block
[
voffset
].
bmi
.
as_mv
.
first
.
as_mv
.
row
=
x
->
block
[
uoffset
].
bmi
.
as_mv
.
first
.
as_mv
.
row
;
x
->
block
[
voffset
].
bmi
.
as_mv
.
first
.
as_mv
.
col
=
x
->
block
[
uoffset
].
bmi
.
as_mv
.
first
.
as_mv
.
col
;
x
->
block
[
voffset
].
bmi
.
mv
.
as_mv
.
row
=
x
->
block
[
uoffset
].
bmi
.
mv
.
as_mv
.
row
;
x
->
block
[
voffset
].
bmi
.
mv
.
as_mv
.
col
=
x
->
block
[
uoffset
].
bmi
.
mv
.
as_mv
.
col
;
if
(
x
->
mode_info_context
->
mbmi
.
second_ref_frame
)
{
temp
=
x
->
block
[
yoffset
].
bmi
.
as_mv
.
second
.
as_mv
.
row
+
x
->
block
[
yoffset
+
1
].
bmi
.
as_mv
.
second
.
as_mv
.
row
+
x
->
block
[
yoffset
+
4
].
bmi
.
as_mv
.
second
.
as_mv
.
row
+
x
->
block
[
yoffset
+
5
].
bmi
.
as_mv
.
second
.
as_mv
.
row
;
if
(
temp
<
0
)
{
temp
-=
4
;
}
else
{
temp
+=
4
;
}
x
->
block
[
uoffset
].
bmi
.
as_mv
.
second
.
as_mv
.
row
=
(
temp
/
8
)
&
x
->
fullpixel_mask
;
temp
=
x
->
block
[
yoffset
].
bmi
.
as_mv
.
second
.
as_mv
.
col
+
x
->
block
[
yoffset
+
1
].
bmi
.
as_mv
.
second
.
as_mv
.
col
+
x
->
block
[
yoffset
+
4
].
bmi
.
as_mv
.
second
.
as_mv
.
col
+
x
->
block
[
yoffset
+
5
].
bmi
.
as_mv
.
second
.
as_mv
.
col
;
if
(
temp
<
0
)
{
temp
-=
4
;
}
else
{
temp
+=
4
;
}
x
->
block
[
uoffset
].
bmi
.
as_mv
.
second
.
as_mv
.
col
=
(
temp
/
8
)
&
x
->
fullpixel_mask
;
x
->
block
[
voffset
].
bmi
.
as_mv
.
second
.
as_mv
.
row
=
x
->
block
[
uoffset
].
bmi
.
as_mv
.
second
.
as_mv
.
row
;
x
->
block
[
voffset
].
bmi
.
as_mv
.
second
.
as_mv
.
col
=
x
->
block
[
uoffset
].
bmi
.
as_mv
.
second
.
as_mv
.
col
;
}
}
}
...
...
@@ -357,13 +476,19 @@ void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x)
BLOCKD
*
d0
=
&
x
->
block
[
i
];
BLOCKD
*
d1
=
&
x
->
block
[
i
+
1
];
if
(
d0
->
bmi
.
mv
.
as_int
==
d1
->
bmi
.
mv
.
as_int
)
if
(
d0
->
bmi
.
as_mv
.
first
.
as_int
==
d1
->
bmi
.
as_mv
.
first
.
as_int
)
build_inter_predictors2b
(
x
,
d0
,
8
);
else
{
vp8_build_inter_predictors_b
(
d0
,
8
,
x
->
subpixel_predict
);
vp8_build_inter_predictors_b
(
d1
,
8
,
x
->
subpixel_predict
);
}
if
(
x
->
mode_info_context
->
mbmi
.
second_ref_frame
)
{
vp8_build_2nd_inter_predictors_b
(
d0
,
8
,
x
->
subpixel_predict_avg
);
vp8_build_2nd_inter_predictors_b
(
d1
,
8
,
x
->
subpixel_predict_avg
);
}
}
}
...
...
@@ -622,10 +747,17 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
if
(
x
->
mode_info_context
->
mbmi
.
need_to_clamp_mvs
)
{
clamp_mv_to_umv_border
(
&
x
->
block
[
0
].
bmi
.
mv
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
2
].
bmi
.
mv
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
8
].
bmi
.
mv
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
10
].
bmi
.
mv
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
0
].
bmi
.
as_mv
.
first
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
2
].
bmi
.
as_mv
.
first
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
8
].
bmi
.
as_mv
.
first
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
10
].
bmi
.
as_mv
.
first
.
as_mv
,
x
);
if
(
x
->
mode_info_context
->
mbmi
.
second_ref_frame
)
{
clamp_mv_to_umv_border
(
&
x
->
block
[
0
].
bmi
.
as_mv
.
second
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
2
].
bmi
.
as_mv
.
second
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
8
].
bmi
.
as_mv
.
second
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
10
].
bmi
.
as_mv
.
second
.
as_mv
,
x
);
}
}
...
...
@@ -633,6 +765,14 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
build_inter_predictors4b
(
x
,
&
x
->
block
[
2
],
16
);
build_inter_predictors4b
(
x
,
&
x
->
block
[
8
],
16
);
build_inter_predictors4b
(
x
,
&
x
->
block
[
10
],
16
);
if
(
x
->
mode_info_context
->
mbmi
.
second_ref_frame
)
{
build_2nd_inter_predictors4b
(
x
,
&
x
->
block
[
0
],
16
);
build_2nd_inter_predictors4b
(
x
,
&
x
->
block
[
2
],
16
);
build_2nd_inter_predictors4b
(
x
,
&
x
->
block
[
8
],
16
);
build_2nd_inter_predictors4b
(
x
,
&
x
->
block
[
10
],
16
);
}
}
else
{
...
...
@@ -646,11 +786,16 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
if
(
x
->
mode_info_context
->
mbmi
.
need_to_clamp_mvs
)
{
clamp_mv_to_umv_border
(
&
x
->
block
[
i
+
0
].
bmi
.
mv
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
i
+
1
].
bmi
.
mv
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
i
+
0
].
bmi
.
as_mv
.
first
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
i
+
1
].
bmi
.
as_mv
.
first
.
as_mv
,
x
);
if
(
x
->
mode_info_context
->
mbmi
.
second_ref_frame
)
{
clamp_mv_to_umv_border
(
&
x
->
block
[
i
+
0
].
bmi
.
as_mv
.
second
.
as_mv
,
x
);
clamp_mv_to_umv_border
(
&
x
->
block
[
i
+
1
].
bmi
.
as_mv
.
second
.
as_mv
,
x
);
}
}
if
(
d0
->
bmi
.
mv
.
as_int
==
d1
->
bmi
.
mv
.
as_int
)
if
(
d0
->
bmi
.
as_mv
.
first
.
as_int
==
d1
->
bmi
.
as_mv
.
first
.
as_int
)
build_inter_predictors2b
(
x
,
d0
,
16
);
else
{
...
...
@@ -658,8 +803,12 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
vp8_build_inter_predictors_b
(
d1
,
16
,
x
->
subpixel_predict
);
}
if
(
x
->
mode_info_context
->
mbmi
.
second_ref_frame
)
{
vp8_build_2nd_inter_predictors_b
(
d0
,
16
,
x
->
subpixel_predict_avg
);
vp8_build_2nd_inter_predictors_b
(
d1
,
16
,
x
->
subpixel_predict_avg
);
}
}
}
for
(
i
=
16
;
i
<
24
;
i
+=
2
)
...
...
@@ -667,13 +816,19 @@ static void build_inter4x4_predictors_mb(MACROBLOCKD *x)
BLOCKD
*
d0
=
&
x
->
block
[
i
];
BLOCKD
*
d1
=
&
x
->
block
[
i
+
1
];
if
(
d0
->
bmi
.
mv
.
as_int
==
d1
->
bmi
.
mv
.
as_int
)