diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2014-02-25 18:01:49 -0800 |
---|---|---|
committer | Dmitry Kovalev <dkovalev@google.com> | 2014-02-25 18:01:49 -0800 |
commit | 8d80c262d11db39212fd96c325c8ca281be79340 (patch) | |
tree | dd83cd271ef7f5d9770bd859e15645971e703a8b /vp9/encoder | |
parent | 4632a96d9771b49d6edfe78b68e5dfbafa75fff3 (diff) | |
download | libvpx-8d80c262d11db39212fd96c325c8ca281be79340.tar libvpx-8d80c262d11db39212fd96c325c8ca281be79340.tar.gz libvpx-8d80c262d11db39212fd96c325c8ca281be79340.tar.bz2 libvpx-8d80c262d11db39212fd96c325c8ca281be79340.zip |
Using clamp() for active_{best, worst}_quality.
Change-Id: Ia79f975f54829b8ae6b568ca5c05f4f1f541706f
Diffstat (limited to 'vp9/encoder')
-rw-r--r-- | vp9/encoder/vp9_ratectrl.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index f78ebfe18..16c617e22 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -958,17 +958,10 @@ static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi, } // Clip the active best and worst quality values to limits. - if (active_worst_quality > rc->worst_quality) - active_worst_quality = rc->worst_quality; - - if (active_best_quality < rc->best_quality) - active_best_quality = rc->best_quality; - - if (active_best_quality > rc->worst_quality) - active_best_quality = rc->worst_quality; - - if (active_worst_quality < active_best_quality) - active_worst_quality = active_best_quality; + active_best_quality = clamp(active_best_quality, + rc->best_quality, rc->worst_quality); + active_worst_quality = clamp(active_worst_quality, + active_best_quality, rc->worst_quality); *top_index = active_worst_quality; *bottom_index = active_best_quality; |