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
Guillaume Martres
aom-rav1e
Commits
e62875b5
Commit
e62875b5
authored
Apr 17, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Apr 17, 2014
Browse files
Merge "Removing cq_target_quality from VP9_COMP."
parents
69b88df2
53dbc7f9
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_firstpass.c
View file @
e62875b5
...
...
@@ -904,6 +904,7 @@ static int get_twopass_worst_quality(const VP9_COMP *cpi,
const
FIRSTPASS_STATS
*
stats
,
int
section_target_bandwidth
)
{
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
const
VP9_CONFIG
*
const
oxcf
=
&
cpi
->
oxcf
;
if
(
section_target_bandwidth
<=
0
)
{
return
rc
->
worst_quality
;
// Highest value allowed
...
...
@@ -911,7 +912,7 @@ static int get_twopass_worst_quality(const VP9_COMP *cpi,
const
int
num_mbs
=
cpi
->
common
.
MBs
;
const
double
section_err
=
stats
->
coded_error
/
stats
->
count
;
const
double
err_per_mb
=
section_err
/
num_mbs
;
const
double
speed_term
=
1
.
0
+
0
.
04
*
cpi
->
oxcf
.
speed
;
const
double
speed_term
=
1
.
0
+
0
.
04
*
oxcf
->
speed
;
const
int
target_norm_bits_per_mb
=
((
uint64_t
)
section_target_bandwidth
<<
BPER_MB_NORMBITS
)
/
num_mbs
;
int
q
;
...
...
@@ -928,8 +929,8 @@ static int get_twopass_worst_quality(const VP9_COMP *cpi,
}
// Restriction on active max q for constrained quality mode.
if
(
cpi
->
oxcf
.
end_usage
==
USAGE_CONSTRAINED_QUALITY
)
q
=
MAX
(
q
,
cpi
->
cq_
target_quality
);
if
(
oxcf
->
end_usage
==
USAGE_CONSTRAINED_QUALITY
)
q
=
MAX
(
q
,
oxcf
->
cq_
level
);
return
q
;
}
}
...
...
vp9/encoder/vp9_onyx_if.c
View file @
e62875b5
...
...
@@ -788,10 +788,6 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
rc
->
worst_quality
=
cpi
->
oxcf
.
worst_allowed_q
;
rc
->
best_quality
=
cpi
->
oxcf
.
best_allowed_q
;
// active values should only be modified if out of new range
cpi
->
cq_target_quality
=
cpi
->
oxcf
.
cq_level
;
cm
->
interp_filter
=
DEFAULT_INTERP_FILTER
;
cm
->
display_width
=
cpi
->
oxcf
.
width
;
...
...
@@ -1695,6 +1691,7 @@ static int recode_loop_test(const VP9_COMP *cpi,
int
q
,
int
maxq
,
int
minq
)
{
const
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
const
VP9_CONFIG
*
const
oxcf
=
&
cpi
->
oxcf
;
int
force_recode
=
0
;
// Special case trap if maximum allowed frame size exceeded.
...
...
@@ -1712,10 +1709,10 @@ static int recode_loop_test(const VP9_COMP *cpi,
if
((
rc
->
projected_frame_size
>
high_limit
&&
q
<
maxq
)
||
(
rc
->
projected_frame_size
<
low_limit
&&
q
>
minq
))
{
force_recode
=
1
;
}
else
if
(
cpi
->
oxcf
.
end_usage
==
USAGE_CONSTRAINED_QUALITY
)
{
}
else
if
(
oxcf
->
end_usage
==
USAGE_CONSTRAINED_QUALITY
)
{
// Deal with frame undershoot and whether or not we are
// below the automatically set cq level.
if
(
q
>
cpi
->
cq_
target_quality
&&
if
(
q
>
oxcf
->
cq_
level
&&
rc
->
projected_frame_size
<
((
rc
->
this_frame_target
*
7
)
>>
3
))
{
force_recode
=
1
;
}
...
...
@@ -1890,7 +1887,7 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
(double)vp9_dc_quant(cm->base_qindex, 0) / 4.0,
cpi->rc.avg_q,
vp9_convert_qindex_to_q(cpi->rc.ni_av_qi),
vp9_convert_qindex_to_q(cpi->
cq_target_quality
),
vp9_convert_qindex_to_q(cpi->
oxcf.cq_level
),
cpi->refresh_last_frame, cpi->refresh_golden_frame,
cpi->refresh_alt_ref_frame, cm->frame_type, cpi->rc.gfu_boost,
cpi->twopass.bits_left,
...
...
vp9/encoder/vp9_onyx_int.h
View file @
e62875b5
...
...
@@ -394,8 +394,6 @@ typedef struct VP9_COMP {
RATE_CONTROL
rc
;
int
cq_target_quality
;
vp9_coeff_count
coef_counts
[
TX_SIZES
][
PLANE_TYPES
];
vp9_coeff_probs_model
frame_coef_probs
[
TX_SIZES
][
PLANE_TYPES
];
...
...
vp9/encoder/vp9_ratectrl.c
View file @
e62875b5
...
...
@@ -613,6 +613,7 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
const
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
const
VP9_CONFIG
*
const
oxcf
=
&
cpi
->
oxcf
;
const
int
cq_level
=
oxcf
->
cq_level
;
int
active_best_quality
;
int
active_worst_quality
=
calc_active_worst_quality_one_pass_vbr
(
cpi
);
int
q
;
...
...
@@ -671,8 +672,8 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
}
// For constrained quality dont allow Q less than the cq level
if
(
oxcf
->
end_usage
==
USAGE_CONSTRAINED_QUALITY
)
{
if
(
q
<
c
pi
->
cq_target_quality
)
q
=
c
pi
->
cq_target_quality
;
if
(
q
<
c
q_level
)
q
=
c
q_level
;
if
(
rc
->
frames_since_key
>
1
)
{
active_best_quality
=
get_active_quality
(
q
,
rc
->
gfu_boost
,
gf_low
,
gf_high
,
...
...
@@ -689,7 +690,7 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
}
else
if
(
oxcf
->
end_usage
==
USAGE_CONSTANT_QUALITY
)
{
if
(
!
cpi
->
refresh_alt_ref_frame
)
{
active_best_quality
=
c
pi
->
cq_target_quality
;
active_best_quality
=
c
q_level
;
}
else
{
if
(
rc
->
frames_since_key
>
1
)
{
active_best_quality
=
get_active_quality
(
...
...
@@ -708,7 +709,7 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
}
}
else
{
if
(
oxcf
->
end_usage
==
USAGE_CONSTANT_QUALITY
)
{
active_best_quality
=
c
pi
->
cq_target_quality
;
active_best_quality
=
c
q_level
;
}
else
{
// Use the lower of active_worst_quality and recent/average Q.
if
(
cm
->
current_video_frame
>
1
)
...
...
@@ -718,14 +719,8 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
// For the constrained quality mode we don't want
// q to fall below the cq level.
if
((
oxcf
->
end_usage
==
USAGE_CONSTRAINED_QUALITY
)
&&
(
active_best_quality
<
cpi
->
cq_target_quality
))
{
// If we are strongly undershooting the target rate in the last
// frames then use the user passed in cq value not the auto
// cq value.
if
(
rc
->
rolling_actual_bits
<
rc
->
min_frame_bandwidth
)
active_best_quality
=
oxcf
->
cq_level
;
else
active_best_quality
=
cpi
->
cq_target_quality
;
(
active_best_quality
<
cq_level
))
{
active_best_quality
=
cq_level
;
}
}
}
...
...
@@ -807,6 +802,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
const
VP9_COMMON
*
const
cm
=
&
cpi
->
common
;
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
const
VP9_CONFIG
*
const
oxcf
=
&
cpi
->
oxcf
;
const
int
cq_level
=
oxcf
->
cq_level
;
int
active_best_quality
;
int
active_worst_quality
=
cpi
->
twopass
.
active_worst_quality
;
int
q
;
...
...
@@ -867,8 +863,8 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
}
// For constrained quality dont allow Q less than the cq level
if
(
oxcf
->
end_usage
==
USAGE_CONSTRAINED_QUALITY
)
{
if
(
q
<
c
pi
->
cq_target_quality
)
q
=
c
pi
->
cq_target_quality
;
if
(
q
<
c
q_level
)
q
=
c
q_level
;
if
(
rc
->
frames_since_key
>
1
)
{
active_best_quality
=
get_active_quality
(
q
,
rc
->
gfu_boost
,
gf_low
,
gf_high
,
...
...
@@ -885,7 +881,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
}
else
if
(
oxcf
->
end_usage
==
USAGE_CONSTANT_QUALITY
)
{
if
(
!
cpi
->
refresh_alt_ref_frame
)
{
active_best_quality
=
c
pi
->
cq_target_quality
;
active_best_quality
=
c
q_level
;
}
else
{
if
(
rc
->
frames_since_key
>
1
)
{
active_best_quality
=
get_active_quality
(
...
...
@@ -904,21 +900,15 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
}
}
else
{
if
(
oxcf
->
end_usage
==
USAGE_CONSTANT_QUALITY
)
{
active_best_quality
=
c
pi
->
cq_target_quality
;
active_best_quality
=
c
q_level
;
}
else
{
active_best_quality
=
inter_minq
[
active_worst_quality
];
// For the constrained quality mode we don't want
// q to fall below the cq level.
if
((
oxcf
->
end_usage
==
USAGE_CONSTRAINED_QUALITY
)
&&
(
active_best_quality
<
cpi
->
cq_target_quality
))
{
// If we are strongly undershooting the target rate in the last
// frames then use the user passed in cq value not the auto
// cq value.
if
(
rc
->
rolling_actual_bits
<
rc
->
min_frame_bandwidth
)
active_best_quality
=
oxcf
->
cq_level
;
else
active_best_quality
=
cpi
->
cq_target_quality
;
(
active_best_quality
<
cq_level
))
{
active_best_quality
=
cq_level
;
}
}
}
...
...
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