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
dba79821
Commit
dba79821
authored
13 years ago
by
Scott LaVarnway
Committed by
Code Review
13 years ago
Browse files
Options
Download
Plain Diff
Merge "Using partition_info instead of blockd info for splitmv"
parents
914f7c36
99b97576
v1.14.0-linphone
1.4.X
cayuga
eider
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/jkoleszar/cached-multibit
sandbox/jkoleszar/new-rate-control
sandbox/jkoleszar/new-rtcd
sandbox/jkoleszar/reuse-modemv
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
v1.2.0
v1.1.0
v1.0.0
v0.9.7
v0.9.7-p1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vp8/encoder/pickinter.c
+14
-15
vp8/encoder/pickinter.c
vp8/encoder/rdopt.c
+34
-20
vp8/encoder/rdopt.c
with
48 additions
and
35 deletions
vp8/encoder/pickinter.c
+
14
−
15
View file @
dba79821
...
...
@@ -426,24 +426,29 @@ void vp8_pick_intra_mbuv_mode(MACROBLOCK *mb)
}
static
void
vp8_
update_mvcount
(
VP8_COMP
*
cpi
,
MACROBLOCKD
*
xd
,
int_mv
*
best_ref_mv
)
static
void
update_mvcount
(
VP8_COMP
*
cpi
,
MACROBLOCKD
*
xd
,
int_mv
*
best_ref_mv
)
{
/* Split MV modes currently not supported when RD is nopt enabled, therefore, only need to modify MVcount in NEWMV mode. */
/* Split MV modes currently not supported when RD is nopt enabled,
* therefore, only need to modify MVcount in NEWMV mode. */
if
(
xd
->
mode_info_context
->
mbmi
.
mode
==
NEWMV
)
{
cpi
->
MVcount
[
0
][
mv_max
+
((
xd
->
block
[
0
].
bmi
.
mv
.
as_mv
.
row
-
best_ref_mv
->
as_mv
.
row
)
>>
1
)]
++
;
cpi
->
MVcount
[
1
][
mv_max
+
((
xd
->
block
[
0
].
bmi
.
mv
.
as_mv
.
col
-
best_ref_mv
->
as_mv
.
col
)
>>
1
)]
++
;
cpi
->
MVcount
[
0
][
mv_max
+
((
xd
->
block
[
0
].
bmi
.
mv
.
as_mv
.
row
-
best_ref_mv
->
as_mv
.
row
)
>>
1
)]
++
;
cpi
->
MVcount
[
1
][
mv_max
+
((
xd
->
block
[
0
].
bmi
.
mv
.
as_mv
.
col
-
best_ref_mv
->
as_mv
.
col
)
>>
1
)]
++
;
}
}
void
vp8_pick_inter_mode
(
VP8_COMP
*
cpi
,
MACROBLOCK
*
x
,
int
recon_yoffset
,
int
recon_uvoffset
,
int
*
returnrate
,
int
*
returndistortion
,
int
*
returnintra
)
void
vp8_pick_inter_mode
(
VP8_COMP
*
cpi
,
MACROBLOCK
*
x
,
int
recon_yoffset
,
int
recon_uvoffset
,
int
*
returnrate
,
int
*
returndistortion
,
int
*
returnintra
)
{
BLOCK
*
b
=
&
x
->
block
[
0
];
BLOCKD
*
d
=
&
x
->
e_mbd
.
block
[
0
];
MACROBLOCKD
*
xd
=
&
x
->
e_mbd
;
B_MODE_INFO
best_bmodes
[
16
];
MB_MODE_INFO
best_mbmode
;
PARTITION_INFO
best_partition
;
int_mv
best_ref_mv
;
int_mv
mode_mv
[
MB_MODE_COUNT
];
MB_PREDICTION_MODE
this_mode
;
...
...
@@ -878,9 +883,8 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int re
*
returndistortion
=
distortion2
;
best_rd
=
this_rd
;
vpx_memcpy
(
&
best_mbmode
,
&
x
->
e_mbd
.
mode_info_context
->
mbmi
,
sizeof
(
MB_MODE_INFO
));
vpx_memcpy
(
&
best_partition
,
x
->
partition_info
,
sizeof
(
PARTITION_INFO
));
if
(
this_mode
==
B_PRED
||
this_mode
==
SPLITMV
)
if
(
this_mode
==
B_PRED
)
for
(
i
=
0
;
i
<
16
;
i
++
)
{
vpx_memcpy
(
&
best_bmodes
[
i
],
&
x
->
e_mbd
.
block
[
i
].
bmi
,
sizeof
(
B_MODE_INFO
));
...
...
@@ -952,7 +956,6 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int re
best_mbmode
.
partitioning
=
0
;
vpx_memcpy
(
&
x
->
e_mbd
.
mode_info_context
->
mbmi
,
&
best_mbmode
,
sizeof
(
MB_MODE_INFO
));
vpx_memcpy
(
x
->
partition_info
,
&
best_partition
,
sizeof
(
PARTITION_INFO
));
for
(
i
=
0
;
i
<
16
;
i
++
)
{
...
...
@@ -963,12 +966,10 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int re
return
;
}
// macroblock modes
vpx_memcpy
(
&
x
->
e_mbd
.
mode_info_context
->
mbmi
,
&
best_mbmode
,
sizeof
(
MB_MODE_INFO
));
vpx_memcpy
(
x
->
partition_info
,
&
best_partition
,
sizeof
(
PARTITION_INFO
));
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mode
==
B_PRED
||
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mode
==
SPLITMV
)
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mode
==
B_PRED
)
for
(
i
=
0
;
i
<
16
;
i
++
)
{
vpx_memcpy
(
&
x
->
e_mbd
.
block
[
i
].
bmi
,
&
best_bmodes
[
i
],
sizeof
(
B_MODE_INFO
));
...
...
@@ -979,7 +980,5 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int re
vp8_set_mbmode_and_mvs
(
x
,
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mode
,
&
best_bmodes
[
0
].
mv
);
}
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mv
.
as_mv
=
x
->
e_mbd
.
block
[
15
].
bmi
.
mv
.
as_mv
;
vp8_update_mvcount
(
cpi
,
&
x
->
e_mbd
,
&
frame_best_ref_mv
[
xd
->
mode_info_context
->
mbmi
.
ref_frame
]);
update_mvcount
(
cpi
,
&
x
->
e_mbd
,
&
frame_best_ref_mv
[
xd
->
mode_info_context
->
mbmi
.
ref_frame
]);
}
This diff is collapsed.
Click to expand it.
vp8/encoder/rdopt.c
+
34
−
20
View file @
dba79821
...
...
@@ -933,9 +933,11 @@ static int labels2mode(
cost
=
x
->
inter_bmode_costs
[
m
];
}
d
->
bmi
.
mode
=
m
;
d
->
bmi
.
mv
.
as_int
=
this_mv
->
as_int
;
x
->
partition_info
->
bmi
[
i
].
mode
=
m
;
x
->
partition_info
->
bmi
[
i
].
mv
.
as_int
=
this_mv
->
as_int
;
}
while
(
++
i
<
16
);
...
...
@@ -1275,8 +1277,8 @@ static void rd_check_segment(VP8_COMP *cpi, MACROBLOCK *x,
{
BLOCKD
*
bd
=
&
x
->
e_mbd
.
block
[
i
];
bsi
->
mvs
[
i
].
as_mv
=
bd
->
bmi
.
mv
.
as_mv
;
bsi
->
modes
[
i
]
=
bd
->
bmi
.
mode
;
bsi
->
mvs
[
i
].
as_mv
=
x
->
partition_info
->
bmi
[
i
]
.
mv
.
as_mv
;
bsi
->
modes
[
i
]
=
x
->
partition_info
->
bmi
[
i
]
.
mode
;
bsi
->
eobs
[
i
]
=
bd
->
eob
;
}
}
...
...
@@ -1406,7 +1408,6 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
BLOCKD
*
bd
=
&
x
->
e_mbd
.
block
[
i
];
bd
->
bmi
.
mv
.
as_mv
=
bsi
.
mvs
[
i
].
as_mv
;
bd
->
bmi
.
mode
=
bsi
.
modes
[
i
];
bd
->
eob
=
bsi
.
eobs
[
i
];
}
...
...
@@ -1424,9 +1425,13 @@ static int vp8_rd_pick_best_mbsegmentation(VP8_COMP *cpi, MACROBLOCK *x,
j
=
vp8_mbsplit_offset
[
bsi
.
segment_num
][
i
];
x
->
partition_info
->
bmi
[
i
].
mode
=
x
->
e_mbd
.
block
[
j
].
bm
i
.
mode
;
x
->
partition_info
->
bmi
[
i
].
mv
.
as_mv
=
x
->
e_mbd
.
block
[
j
].
bmi
.
mv
.
as_mv
;
x
->
partition_info
->
bmi
[
i
].
mode
=
bs
i
.
mode
s
[
j
]
;
x
->
partition_info
->
bmi
[
i
].
mv
.
as_mv
=
bsi
.
mvs
[
j
]
.
as_mv
;
}
/*
* used to set x->e_mbd.mode_info_context->mbmi.mv.as_int
*/
x
->
partition_info
->
bmi
[
15
].
mv
.
as_int
=
bsi
.
mvs
[
15
].
as_int
;
return
bsi
.
segment_rd
;
}
...
...
@@ -1686,25 +1691,29 @@ void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffse
}
}
static
void
vp8_
rd_update_mvcount
(
VP8_COMP
*
cpi
,
MACROBLOCK
D
*
x
d
,
int_mv
*
best_ref_mv
)
static
void
rd_update_mvcount
(
VP8_COMP
*
cpi
,
MACROBLOCK
*
x
,
int_mv
*
best_ref_mv
)
{
int
i
;
if
(
xd
->
mode_info_context
->
mbmi
.
mode
==
SPLITMV
)
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mode
==
SPLITMV
)
{
for
(
i
=
0
;
i
<
16
;
i
++
)
int
i
;
for
(
i
=
0
;
i
<
x
->
partition_info
->
count
;
i
++
)
{
if
(
x
d
->
block
[
i
].
bmi
.
mode
==
NEW4X4
)
if
(
x
->
partition_info
->
bmi
[
i
]
.
mode
==
NEW4X4
)
{
cpi
->
MVcount
[
0
][
mv_max
+
((
xd
->
block
[
i
].
bmi
.
mv
.
as_mv
.
row
-
best_ref_mv
->
as_mv
.
row
)
>>
1
)]
++
;
cpi
->
MVcount
[
1
][
mv_max
+
((
xd
->
block
[
i
].
bmi
.
mv
.
as_mv
.
col
-
best_ref_mv
->
as_mv
.
col
)
>>
1
)]
++
;
cpi
->
MVcount
[
0
][
mv_max
+
((
x
->
partition_info
->
bmi
[
i
].
mv
.
as_mv
.
row
-
best_ref_mv
->
as_mv
.
row
)
>>
1
)]
++
;
cpi
->
MVcount
[
1
][
mv_max
+
((
x
->
partition_info
->
bmi
[
i
].
mv
.
as_mv
.
col
-
best_ref_mv
->
as_mv
.
col
)
>>
1
)]
++
;
}
}
}
else
if
(
x
d
->
mode_info_context
->
mbmi
.
mode
==
NEWMV
)
else
if
(
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mode
==
NEWMV
)
{
cpi
->
MVcount
[
0
][
mv_max
+
((
xd
->
block
[
0
].
bmi
.
mv
.
as_mv
.
row
-
best_ref_mv
->
as_mv
.
row
)
>>
1
)]
++
;
cpi
->
MVcount
[
1
][
mv_max
+
((
xd
->
block
[
0
].
bmi
.
mv
.
as_mv
.
col
-
best_ref_mv
->
as_mv
.
col
)
>>
1
)]
++
;
cpi
->
MVcount
[
0
][
mv_max
+
((
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mv
.
as_mv
.
row
-
best_ref_mv
->
as_mv
.
row
)
>>
1
)]
++
;
cpi
->
MVcount
[
1
][
mv_max
+
((
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mv
.
as_mv
.
col
-
best_ref_mv
->
as_mv
.
col
)
>>
1
)]
++
;
}
}
...
...
@@ -2414,14 +2423,19 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
// macroblock modes
vpx_memcpy
(
&
x
->
e_mbd
.
mode_info_context
->
mbmi
,
&
best_mbmode
,
sizeof
(
MB_MODE_INFO
));
vpx_memcpy
(
x
->
partition_info
,
&
best_partition
,
sizeof
(
PARTITION_INFO
));
for
(
i
=
0
;
i
<
16
;
i
++
)
{
vpx_memcpy
(
&
x
->
e_mbd
.
block
[
i
].
bmi
,
&
best_bmodes
[
i
],
sizeof
(
B_MODE_INFO
));
}
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mv
.
as_mv
=
x
->
e_mbd
.
block
[
15
].
bmi
.
mv
.
as_mv
;
if
(
best_mbmode
.
mode
==
SPLITMV
)
{
vpx_memcpy
(
x
->
partition_info
,
&
best_partition
,
sizeof
(
PARTITION_INFO
));
x
->
e_mbd
.
mode_info_context
->
mbmi
.
mv
.
as_int
=
x
->
partition_info
->
bmi
[
15
].
mv
.
as_int
;
}
rd_update_mvcount
(
cpi
,
x
,
&
frame_best_ref_mv
[
xd
->
mode_info_context
->
mbmi
.
ref_frame
]);
vp8_rd_update_mvcount
(
cpi
,
&
x
->
e_mbd
,
&
frame_best_ref_mv
[
xd
->
mode_info_context
->
mbmi
.
ref_frame
]);
}
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