Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Yushin Cho
aom-rav1e
Commits
1a69eed2
Commit
1a69eed2
authored
Nov 19, 2013
by
Dmitry Kovalev
Browse files
Using is_inter_block() and has_second_ref() functions.
Change-Id: Iadd771a33c8874f3b774923bca4da3c8fe5429ee
parent
82f8ae4c
Changes
2
Show whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_encodemb.c
View file @
1a69eed2
...
@@ -167,7 +167,7 @@ static void optimize_b(MACROBLOCK *mb,
...
@@ -167,7 +167,7 @@ static void optimize_b(MACROBLOCK *mb,
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
rdmult
=
mb
->
rdmult
*
err_mult
;
rdmult
=
mb
->
rdmult
*
err_mult
;
if
(
mb
->
e_mbd
.
mi_8x8
[
0
]
->
mbmi
.
ref_frame
[
0
]
==
INTRA_FRAME
)
if
(
!
is_inter_block
(
&
mb
->
e_mbd
.
mi_8x8
[
0
]
->
mbmi
)
)
rdmult
=
(
rdmult
*
9
)
>>
4
;
rdmult
=
(
rdmult
*
9
)
>>
4
;
rddiv
=
mb
->
rddiv
;
rddiv
=
mb
->
rddiv
;
/* Initialize the sentinel node of the trellis. */
/* Initialize the sentinel node of the trellis. */
...
...
vp9/encoder/vp9_rdopt.c
View file @
1a69eed2
...
@@ -567,8 +567,7 @@ static void dist_block(int plane, int block, TX_SIZE tx_size, void *arg) {
...
@@ -567,8 +567,7 @@ static void dist_block(int plane, int block, TX_SIZE tx_size, void *arg) {
&
this_sse
)
>>
shift
;
&
this_sse
)
>>
shift
;
args
->
sse
=
this_sse
>>
shift
;
args
->
sse
=
this_sse
>>
shift
;
if
(
x
->
skip_encode
&&
if
(
x
->
skip_encode
&&
!
is_inter_block
(
&
xd
->
mi_8x8
[
0
]
->
mbmi
))
{
xd
->
mi_8x8
[
0
]
->
mbmi
.
ref_frame
[
0
]
==
INTRA_FRAME
)
{
// TODO(jingning): tune the model to better capture the distortion.
// TODO(jingning): tune the model to better capture the distortion.
int64_t
p
=
(
pd
->
dequant
[
1
]
*
pd
->
dequant
[
1
]
*
int64_t
p
=
(
pd
->
dequant
[
1
]
*
pd
->
dequant
[
1
]
*
(
1
<<
ss_txfrm_size
))
>>
(
shift
+
2
);
(
1
<<
ss_txfrm_size
))
>>
(
shift
+
2
);
...
@@ -3754,7 +3753,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
...
@@ -3754,7 +3753,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
assert
((
cm
->
mcomp_filter_type
==
SWITCHABLE
)
||
assert
((
cm
->
mcomp_filter_type
==
SWITCHABLE
)
||
(
cm
->
mcomp_filter_type
==
best_mbmode
.
interp_filter
)
||
(
cm
->
mcomp_filter_type
==
best_mbmode
.
interp_filter
)
||
(
best_mbmode
.
ref_frame
[
0
]
==
INTRA_FRAME
));
!
is_inter_block
(
&
best_mbmode
));
// Updating rd_thresh_freq_fact[] here means that the different
// Updating rd_thresh_freq_fact[] here means that the different
// partition/block sizes are handled independently based on the best
// partition/block sizes are handled independently based on the best
...
@@ -4325,8 +4324,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
...
@@ -4325,8 +4324,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
}
}
// Keep record of best inter rd with single reference
// Keep record of best inter rd with single reference
if
(
xd
->
mi_8x8
[
0
]
->
mbmi
.
ref_frame
[
0
]
>
INTRA_FRAME
&&
if
(
is_inter_block
(
&
xd
->
mi_8x8
[
0
]
->
mbmi
)
&&
xd
->
mi_8x8
[
0
]
->
mbmi
.
ref_frame
[
1
]
==
NONE
&&
!
has_second_ref
(
&
xd
->
mi_8x8
[
0
]
->
mbmi
)
&&
!
mode_excluded
&&
!
mode_excluded
&&
this_rd
<
best_inter_rd
)
{
this_rd
<
best_inter_rd
)
{
best_inter_rd
=
this_rd
;
best_inter_rd
=
this_rd
;
...
@@ -4489,7 +4488,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
...
@@ -4489,7 +4488,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
assert
((
cm
->
mcomp_filter_type
==
SWITCHABLE
)
||
assert
((
cm
->
mcomp_filter_type
==
SWITCHABLE
)
||
(
cm
->
mcomp_filter_type
==
best_mbmode
.
interp_filter
)
||
(
cm
->
mcomp_filter_type
==
best_mbmode
.
interp_filter
)
||
(
best_mbmode
.
ref_frame
[
0
]
==
INTRA_FRAME
));
!
is_inter_block
(
&
best_mbmode
));
// Updating rd_thresh_freq_fact[] here means that the different
// Updating rd_thresh_freq_fact[] here means that the different
// partition/block sizes are handled independently based on the best
// partition/block sizes are handled independently based on the best
...
@@ -4515,7 +4514,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
...
@@ -4515,7 +4514,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
// macroblock modes
// macroblock modes
*
mbmi
=
best_mbmode
;
*
mbmi
=
best_mbmode
;
x
->
skip
|=
best_skip2
;
x
->
skip
|=
best_skip2
;
if
(
best_mbmode
.
ref_frame
[
0
]
==
INTRA_FRAME
)
{
if
(
!
is_inter_block
(
&
best_mbmode
)
)
{
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
i
=
0
;
i
<
4
;
i
++
)
xd
->
mi_8x8
[
0
]
->
bmi
[
i
].
as_mode
=
best_bmodes
[
i
].
as_mode
;
xd
->
mi_8x8
[
0
]
->
bmi
[
i
].
as_mode
=
best_bmodes
[
i
].
as_mode
;
}
else
{
}
else
{
...
...
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