Commit 6a6c4277 authored by Tom Finegan's avatar Tom Finegan Committed by James Zern
Browse files

vp9/encoder/vp9_onyx_if: Fix compute_qdelta_by_rate() warnings

- Rename and make static
- Make base_q_index an integer.
- Add a cast.

Change-Id: Iea8d1397fd2717e7373b182ec51f5db960ef2cca
parent 43785036
......@@ -217,9 +217,8 @@ int vp9_compute_qdelta(const VP9_COMP *cpi, double qstart, double qtarget) {
// Computes a q delta (in "q index" terms) to get from a starting q value
// to a value that should equate to thegiven rate ratio.
int vp9_compute_qdelta_by_rate(VP9_COMP *cpi,
double base_q_index, double rate_target_ratio) {
static int compute_qdelta_by_rate(VP9_COMP *cpi, int base_q_index,
double rate_target_ratio) {
int i;
int base_bits_per_mb;
int target_bits_per_mb;
......@@ -233,7 +232,7 @@ int vp9_compute_qdelta_by_rate(VP9_COMP *cpi,
base_q_index, 1.0);
// Find the target bits per mb based on the base value and given ratio.
target_bits_per_mb = rate_target_ratio * base_bits_per_mb;
target_bits_per_mb = (int)(rate_target_ratio * base_bits_per_mb);
// Convert the q target to an index
for (i = cpi->rc.best_quality; i < cpi->rc.worst_quality; i++) {
......@@ -278,9 +277,8 @@ static void setup_in_frame_q_adj(VP9_COMP *cpi) {
// Use some of the segments for in frame Q adjustment
for (segment = 1; segment < 2; segment++) {
qindex_delta =
vp9_compute_qdelta_by_rate(cpi, cm->base_qindex,
qindex_delta = compute_qdelta_by_rate(cpi, cm->base_qindex,
vp9_enable_segfeature(seg, segment, SEG_LVL_ALT_Q);
vp9_set_segdata(seg, segment, SEG_LVL_ALT_Q, qindex_delta);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment