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
Yushin Cho
aom-rav1e
Commits
8c5670bb
Commit
8c5670bb
authored
Mar 31, 2015
by
Jingning Han
Committed by
Gerrit Code Review
Mar 31, 2015
Browse files
Merge "Use SATD based mode decision for block sizes below 16x16"
parents
9b99eb2e
b4b5af6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_pickmode.c
View file @
8c5670bb
...
...
@@ -639,13 +639,18 @@ static void estimate_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
i
,
j
,
0
);
// TODO(jingning): This needs further refactoring.
block_yrd
(
cpi
,
x
,
&
rate
,
&
dist
,
&
is_skippable
,
&
this_sse
,
0
,
bsize_tx
,
tx_size
);
x
->
skip_txfm
[
0
]
=
is_skippable
;
if
(
is_skippable
)
rate
=
vp9_cost_bit
(
vp9_get_skip_prob
(
&
cpi
->
common
,
xd
),
1
);
else
rate
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
&
cpi
->
common
,
xd
),
0
);
if
(
plane_bsize
<=
BLOCK_16X16
)
{
block_yrd
(
cpi
,
x
,
&
rate
,
&
dist
,
&
is_skippable
,
&
this_sse
,
0
,
bsize_tx
,
tx_size
);
x
->
skip_txfm
[
0
]
=
is_skippable
;
if
(
is_skippable
)
rate
=
vp9_cost_bit
(
vp9_get_skip_prob
(
&
cpi
->
common
,
xd
),
1
);
else
rate
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
&
cpi
->
common
,
xd
),
0
);
}
else
{
unsigned
int
var_y
,
sse_y
;
model_rd_for_sb_y
(
cpi
,
bsize_tx
,
x
,
xd
,
&
rate
,
&
dist
,
&
var_y
,
&
sse_y
);
}
p
->
src
.
buf
=
src_buf_base
;
pd
->
dst
.
buf
=
dst_buf_base
;
...
...
@@ -1064,39 +1069,39 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
vp9_get_switchable_rate
(
cpi
,
xd
)
:
0
;
}
// TODO(jingning): disable color operations temporarily.
// chroma component rate-distortion cost modeling
// if (x->color_sensitivity[0] || x->color_sensitivity[1]) {
// int uv_rate = 0;
// int64_t uv_dist = 0;
// if (x->color_sensitivity[0])
// vp9_build_inter_predictors_sbp(xd, mi_row, mi_col, bsize, 1);
// if (x->color_sensitivity[1])
// vp9_build_inter_predictors_sbp(xd, mi_row, mi_col, bsize, 2);
// model_rd_for_sb_uv(cpi, bsize, x, xd, &uv_rate, &uv_dist,
// &var_y, &sse_y);
// this_rdc.rate += uv_rate;
// this_rdc.dist += uv_dist;
// }
block_yrd
(
cpi
,
x
,
&
this_rdc
.
rate
,
&
this_rdc
.
dist
,
&
is_skippable
,
&
this_sse
,
0
,
bsize
,
mbmi
->
tx_size
);
x
->
skip_txfm
[
0
]
=
is_skippable
;
if
(
is_skippable
)
{
this_rdc
.
rate
=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
1
);
}
else
{
if
(
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
this_rdc
.
rate
,
this_rdc
.
dist
)
<
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
0
,
this_sse
))
{
this_rdc
.
rate
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
0
);
}
else
{
if
(
bsize
<=
BLOCK_16X16
)
{
block_yrd
(
cpi
,
x
,
&
this_rdc
.
rate
,
&
this_rdc
.
dist
,
&
is_skippable
,
&
this_sse
,
0
,
bsize
,
mbmi
->
tx_size
);
x
->
skip_txfm
[
0
]
=
is_skippable
;
if
(
is_skippable
)
{
this_rdc
.
rate
=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
1
);
this_rdc
.
dist
=
this_sse
;
}
else
{
if
(
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
this_rdc
.
rate
,
this_rdc
.
dist
)
<
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
0
,
this_sse
))
{
this_rdc
.
rate
+=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
0
);
}
else
{
this_rdc
.
rate
=
vp9_cost_bit
(
vp9_get_skip_prob
(
cm
,
xd
),
1
);
this_rdc
.
dist
=
this_sse
;
}
}
if
(
cm
->
interp_filter
==
SWITCHABLE
)
{
if
((
mbmi
->
mv
[
0
].
as_mv
.
row
|
mbmi
->
mv
[
0
].
as_mv
.
col
)
&
0x07
)
this_rdc
.
rate
+=
vp9_get_switchable_rate
(
cpi
,
xd
);
}
}
if
(
cm
->
interp_filter
==
SWITCHABLE
)
{
if
((
mbmi
->
mv
[
0
].
as_mv
.
row
|
mbmi
->
mv
[
0
].
as_mv
.
col
)
&
0x07
)
this_rdc
.
rate
+=
vp9_get_switchable_rate
(
cpi
,
xd
);
if
(
x
->
color_sensitivity
[
0
]
||
x
->
color_sensitivity
[
1
])
{
int
uv_rate
=
0
;
int64_t
uv_dist
=
0
;
if
(
x
->
color_sensitivity
[
0
])
vp9_build_inter_predictors_sbp
(
xd
,
mi_row
,
mi_col
,
bsize
,
1
);
if
(
x
->
color_sensitivity
[
1
])
vp9_build_inter_predictors_sbp
(
xd
,
mi_row
,
mi_col
,
bsize
,
2
);
model_rd_for_sb_uv
(
cpi
,
bsize
,
x
,
xd
,
&
uv_rate
,
&
uv_dist
,
&
var_y
,
&
sse_y
);
this_rdc
.
rate
+=
uv_rate
;
this_rdc
.
dist
+=
uv_dist
;
}
this_rdc
.
rate
+=
rate_mv
;
...
...
Write
Preview
Supports
Markdown
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