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
Guillaume Martres
aom-rav1e
Commits
0256a759
Commit
0256a759
authored
Jul 01, 2014
by
Alex Converse
Browse files
Allow lossless skipping in RD mode decision.
Change-Id: I2fc4ecfc2dd3ff1dd241a68c9ed4c280291b41f2
parent
bd756699
Changes
1
Show whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_rdopt.c
View file @
0256a759
...
@@ -2791,14 +2791,22 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
...
@@ -2791,14 +2791,22 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
*
rate2
+=
vp9_get_switchable_rate
(
cpi
);
*
rate2
+=
vp9_get_switchable_rate
(
cpi
);
if
(
!
is_comp_pred
)
{
if
(
!
is_comp_pred
)
{
if
(
cpi
->
allow_encode_breakout
&&
x
->
encode_breakout
)
{
if
(
cpi
->
allow_encode_breakout
)
{
const
BLOCK_SIZE
y_size
=
get_plane_block_size
(
bsize
,
&
xd
->
plane
[
0
]);
const
BLOCK_SIZE
y_size
=
get_plane_block_size
(
bsize
,
&
xd
->
plane
[
0
]);
const
BLOCK_SIZE
uv_size
=
get_plane_block_size
(
bsize
,
&
xd
->
plane
[
1
]);
const
BLOCK_SIZE
uv_size
=
get_plane_block_size
(
bsize
,
&
xd
->
plane
[
1
]);
unsigned
int
var
,
sse
;
unsigned
int
var
,
sse
;
// Skipping threshold for ac.
// Skipping threshold for ac.
unsigned
int
thresh_ac
;
unsigned
int
thresh_ac
;
// Set a maximum for threshold to avoid big PSNR loss in low bitrate case.
// Skipping threshold for dc
// Use extreme low threshold for static frames to limit skipping.
unsigned
int
thresh_dc
;
var
=
cpi
->
fn_ptr
[
y_size
].
vf
(
x
->
plane
[
0
].
src
.
buf
,
x
->
plane
[
0
].
src
.
stride
,
xd
->
plane
[
0
].
dst
.
buf
,
xd
->
plane
[
0
].
dst
.
stride
,
&
sse
);
if
(
x
->
encode_breakout
>
0
)
{
// Set a maximum for threshold to avoid big PSNR loss in low bitrate
// case. Use extreme low threshold for static frames to limit skipping.
const
unsigned
int
max_thresh
=
(
cpi
->
allow_encode_breakout
==
const
unsigned
int
max_thresh
=
(
cpi
->
allow_encode_breakout
==
ENCODE_BREAKOUT_LIMITED
)
?
128
:
36000
;
ENCODE_BREAKOUT_LIMITED
)
?
128
:
36000
;
// The encode_breakout input
// The encode_breakout input
...
@@ -2809,21 +2817,17 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
...
@@ -2809,21 +2817,17 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
thresh_ac
=
(
xd
->
plane
[
0
].
dequant
[
1
]
*
xd
->
plane
[
0
].
dequant
[
1
])
/
9
;
thresh_ac
=
(
xd
->
plane
[
0
].
dequant
[
1
]
*
xd
->
plane
[
0
].
dequant
[
1
])
/
9
;
thresh_ac
=
clamp
(
thresh_ac
,
min_thresh
,
max_thresh
);
thresh_ac
=
clamp
(
thresh_ac
,
min_thresh
,
max_thresh
);
var
=
cpi
->
fn_ptr
[
y_size
].
vf
(
x
->
plane
[
0
].
src
.
buf
,
x
->
plane
[
0
].
src
.
stride
,
xd
->
plane
[
0
].
dst
.
buf
,
xd
->
plane
[
0
].
dst
.
stride
,
&
sse
);
// Adjust threshold according to partition size.
// Adjust threshold according to partition size.
thresh_ac
>>=
8
-
(
b_width_log2_lookup
[
bsize
]
+
thresh_ac
>>=
8
-
(
b_width_log2_lookup
[
bsize
]
+
b_height_log2_lookup
[
bsize
]);
b_height_log2_lookup
[
bsize
]);
thresh_dc
=
(
xd
->
plane
[
0
].
dequant
[
0
]
*
xd
->
plane
[
0
].
dequant
[
0
]
>>
6
);
}
else
{
thresh_ac
=
0
;
thresh_dc
=
0
;
}
// Y skipping condition checking
// Y skipping condition checking
if
(
sse
<
thresh_ac
||
sse
==
0
)
{
if
(
sse
<
thresh_ac
||
sse
==
0
)
{
// Skipping threshold for dc
unsigned
int
thresh_dc
;
thresh_dc
=
(
xd
->
plane
[
0
].
dequant
[
0
]
*
xd
->
plane
[
0
].
dequant
[
0
]
>>
6
);
// dc skipping checking
// dc skipping checking
if
((
sse
-
var
)
<
thresh_dc
||
sse
==
var
)
{
if
((
sse
-
var
)
<
thresh_dc
||
sse
==
var
)
{
unsigned
int
sse_u
,
sse_v
;
unsigned
int
sse_u
,
sse_v
;
...
...
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