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
f744f19c
Commit
f744f19c
authored
10 years ago
by
Guillaume Martres
Committed by
Gerrit Code Review
10 years ago
Browse files
Options
Download
Plain Diff
Merge "vp9_ratectrl.c: refactor get_active_quality usage"
parents
a0465501
44666b7c
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
nextgen
nextgenv2
sandbox/Jingning/experimental
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
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
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/encoder/vp9_ratectrl.c
+22
-38
vp9/encoder/vp9_ratectrl.c
with
22 additions
and
38 deletions
vp9/encoder/vp9_ratectrl.c
+
22
−
38
View file @
f744f19c
...
@@ -424,6 +424,16 @@ static int get_active_quality(int q, int gfu_boost, int low, int high,
...
@@ -424,6 +424,16 @@ static int get_active_quality(int q, int gfu_boost, int low, int high,
}
}
}
}
static
int
get_kf_active_quality
(
const
RATE_CONTROL
*
const
rc
,
int
q
)
{
return
get_active_quality
(
q
,
rc
->
kf_boost
,
kf_low
,
kf_high
,
kf_low_motion_minq
,
kf_high_motion_minq
);
}
static
int
get_gf_active_quality
(
const
RATE_CONTROL
*
const
rc
,
int
q
)
{
return
get_active_quality
(
q
,
rc
->
gfu_boost
,
gf_low
,
gf_high
,
arfgf_low_motion_minq
,
arfgf_high_motion_minq
);
}
static
int
calc_active_worst_quality_one_pass_vbr
(
const
VP9_COMP
*
cpi
)
{
static
int
calc_active_worst_quality_one_pass_vbr
(
const
VP9_COMP
*
cpi
)
{
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
const
RATE_CONTROL
*
const
rc
=
&
cpi
->
rc
;
const
unsigned
int
curr_frame
=
cpi
->
common
.
current_video_frame
;
const
unsigned
int
curr_frame
=
cpi
->
common
.
current_video_frame
;
...
@@ -523,11 +533,8 @@ static int rc_pick_q_and_bounds_one_pass_cbr(const VP9_COMP *cpi,
...
@@ -523,11 +533,8 @@ static int rc_pick_q_and_bounds_one_pass_cbr(const VP9_COMP *cpi,
double
q_adj_factor
=
1
.
0
;
double
q_adj_factor
=
1
.
0
;
double
q_val
;
double
q_val
;
active_best_quality
=
get_active_quality
(
rc
->
avg_frame_qindex
[
KEY_FRAME
],
active_best_quality
=
rc
->
kf_boost
,
get_kf_active_quality
(
rc
,
rc
->
avg_frame_qindex
[
KEY_FRAME
]);
kf_low
,
kf_high
,
kf_low_motion_minq
,
kf_high_motion_minq
);
// Allow somewhat lower kf minq with small image formats.
// Allow somewhat lower kf minq with small image formats.
if
((
cm
->
width
*
cm
->
height
)
<=
(
352
*
288
))
{
if
((
cm
->
width
*
cm
->
height
)
<=
(
352
*
288
))
{
...
@@ -552,9 +559,7 @@ static int rc_pick_q_and_bounds_one_pass_cbr(const VP9_COMP *cpi,
...
@@ -552,9 +559,7 @@ static int rc_pick_q_and_bounds_one_pass_cbr(const VP9_COMP *cpi,
}
else
{
}
else
{
q
=
active_worst_quality
;
q
=
active_worst_quality
;
}
}
active_best_quality
=
get_active_quality
(
active_best_quality
=
get_gf_active_quality
(
rc
,
q
);
q
,
rc
->
gfu_boost
,
gf_low
,
gf_high
,
arfgf_low_motion_minq
,
arfgf_high_motion_minq
);
}
else
{
}
else
{
// Use the lower of active_worst_quality and recent/average Q.
// Use the lower of active_worst_quality and recent/average Q.
if
(
cm
->
current_video_frame
>
1
)
{
if
(
cm
->
current_video_frame
>
1
)
{
...
@@ -657,11 +662,8 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
...
@@ -657,11 +662,8 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
double
q_adj_factor
=
1
.
0
;
double
q_adj_factor
=
1
.
0
;
double
q_val
;
double
q_val
;
active_best_quality
=
get_active_quality
(
rc
->
avg_frame_qindex
[
KEY_FRAME
],
active_best_quality
=
rc
->
kf_boost
,
get_kf_active_quality
(
rc
,
rc
->
avg_frame_qindex
[
KEY_FRAME
]);
kf_low
,
kf_high
,
kf_low_motion_minq
,
kf_high_motion_minq
);
// Allow somewhat lower kf minq with small image formats.
// Allow somewhat lower kf minq with small image formats.
if
((
cm
->
width
*
cm
->
height
)
<=
(
352
*
288
))
{
if
((
cm
->
width
*
cm
->
height
)
<=
(
352
*
288
))
{
...
@@ -690,10 +692,7 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
...
@@ -690,10 +692,7 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
if
(
q
<
cq_level
)
if
(
q
<
cq_level
)
q
=
cq_level
;
q
=
cq_level
;
active_best_quality
=
get_active_quality
(
q
,
rc
->
gfu_boost
,
active_best_quality
=
get_gf_active_quality
(
rc
,
q
);
gf_low
,
gf_high
,
arfgf_low_motion_minq
,
arfgf_high_motion_minq
);
// Constrained quality use slightly lower active best.
// Constrained quality use slightly lower active best.
active_best_quality
=
active_best_quality
*
15
/
16
;
active_best_quality
=
active_best_quality
*
15
/
16
;
...
@@ -702,14 +701,10 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
...
@@ -702,14 +701,10 @@ static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
if
(
!
cpi
->
refresh_alt_ref_frame
)
{
if
(
!
cpi
->
refresh_alt_ref_frame
)
{
active_best_quality
=
cq_level
;
active_best_quality
=
cq_level
;
}
else
{
}
else
{
active_best_quality
=
get_active_quality
(
active_best_quality
=
get_gf_active_quality
(
rc
,
q
);
q
,
rc
->
gfu_boost
,
gf_low
,
gf_high
,
arfgf_low_motion_minq
,
arfgf_high_motion_minq
);
}
}
}
else
{
}
else
{
active_best_quality
=
get_active_quality
(
active_best_quality
=
get_gf_active_quality
(
rc
,
q
);
q
,
rc
->
gfu_boost
,
gf_low
,
gf_high
,
arfgf_low_motion_minq
,
arfgf_high_motion_minq
);
}
}
}
else
{
}
else
{
if
(
oxcf
->
rc_mode
==
VPX_Q
)
{
if
(
oxcf
->
rc_mode
==
VPX_Q
)
{
...
@@ -810,11 +805,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
...
@@ -810,11 +805,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
double
q_adj_factor
=
1
.
0
;
double
q_adj_factor
=
1
.
0
;
double
q_val
;
double
q_val
;
// Baseline value derived from cpi->active_worst_quality and kf boost.
// Baseline value derived from cpi->active_worst_quality and kf boost.
active_best_quality
=
get_active_quality
(
active_worst_quality
,
active_best_quality
=
get_kf_active_quality
(
rc
,
active_worst_quality
);
rc
->
kf_boost
,
kf_low
,
kf_high
,
kf_low_motion_minq
,
kf_high_motion_minq
);
// Allow somewhat lower kf minq with small image formats.
// Allow somewhat lower kf minq with small image formats.
if
((
cm
->
width
*
cm
->
height
)
<=
(
352
*
288
))
{
if
((
cm
->
width
*
cm
->
height
)
<=
(
352
*
288
))
{
...
@@ -846,10 +837,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
...
@@ -846,10 +837,7 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
if
(
q
<
cq_level
)
if
(
q
<
cq_level
)
q
=
cq_level
;
q
=
cq_level
;
active_best_quality
=
get_active_quality
(
q
,
rc
->
gfu_boost
,
active_best_quality
=
get_gf_active_quality
(
rc
,
q
);
gf_low
,
gf_high
,
arfgf_low_motion_minq
,
arfgf_high_motion_minq
);
// Constrained quality use slightly lower active best.
// Constrained quality use slightly lower active best.
active_best_quality
=
active_best_quality
*
15
/
16
;
active_best_quality
=
active_best_quality
*
15
/
16
;
...
@@ -858,14 +846,10 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
...
@@ -858,14 +846,10 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
if
(
!
cpi
->
refresh_alt_ref_frame
)
{
if
(
!
cpi
->
refresh_alt_ref_frame
)
{
active_best_quality
=
cq_level
;
active_best_quality
=
cq_level
;
}
else
{
}
else
{
active_best_quality
=
get_active_quality
(
active_best_quality
=
get_gf_active_quality
(
rc
,
q
);
q
,
rc
->
gfu_boost
,
gf_low
,
gf_high
,
arfgf_low_motion_minq
,
arfgf_high_motion_minq
);
}
}
}
else
{
}
else
{
active_best_quality
=
get_active_quality
(
active_best_quality
=
get_gf_active_quality
(
rc
,
q
);
q
,
rc
->
gfu_boost
,
gf_low
,
gf_high
,
arfgf_low_motion_minq
,
arfgf_high_motion_minq
);
}
}
}
else
{
}
else
{
if
(
oxcf
->
rc_mode
==
VPX_Q
)
{
if
(
oxcf
->
rc_mode
==
VPX_Q
)
{
...
...
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