Commit d67a8feb authored by Yaowu Xu's avatar Yaowu Xu
Browse files

Change to use proper types

block: from int64_t to int as it is a block index.
sse: from unsigned int to int64_t to reduce type conversion. 

Change-Id: Iec8104ff8a3fd3a77d4e451c12918bd869966c2f
parent c57816fb
......@@ -558,7 +558,7 @@ static void model_rd_norm(int xsq_q10, int *r_q10, int *d_q10) {
*d_q10 = (dist_tab_q10[xq] * b_q10 + dist_tab_q10[xq + 1] * a_q10) >> 10;
}
void vp10_model_rd_from_var_lapndz(unsigned int var, unsigned int n_log2,
void vp10_model_rd_from_var_lapndz(int64_t var, unsigned int n_log2,
unsigned int qstep, int *rate,
int64_t *dist) {
// This function models the rate and distortion for a Laplacian
......
......@@ -394,7 +394,7 @@ void vp10_initialize_rd_consts(struct VP10_COMP *cpi);
void vp10_initialize_me_consts(const struct VP10_COMP *cpi,
MACROBLOCK *x, int qindex);
void vp10_model_rd_from_var_lapndz(unsigned int var, unsigned int n,
void vp10_model_rd_from_var_lapndz(int64_t var, unsigned int n,
unsigned int qstep, int *rate,
int64_t *dist);
......
......@@ -792,7 +792,7 @@ static void model_rd_from_sse(const VP10_COMP *const cpi,
const MACROBLOCKD *const xd,
BLOCK_SIZE bsize,
int plane,
uint64_t sse,
int64_t sse,
int *rate,
int64_t *dist) {
const struct macroblockd_plane *const pd = &xd->plane[plane];
......@@ -809,7 +809,8 @@ static void model_rd_from_sse(const VP10_COMP *const cpi,
int quantizer = (pd->dequant[1] >> dequant_shift);
if (quantizer < 120)
*rate = (square_error * (280 - quantizer)) >> (16 - VP9_PROB_COST_SHIFT);
*rate = (int)((square_error * (280 - quantizer)) >>
(16 - VP9_PROB_COST_SHIFT));
else
*rate = 0;
*dist = (square_error * quantizer) >> 8;
......@@ -4475,7 +4476,8 @@ static int64_t encode_inter_mb_segment(VP10_COMP *cpi,
k = i;
for (idy = 0; idy < height / 4; idy += num_4x4_h) {
for (idx = 0; idx < width / 4; idx += num_4x4_w) {
int64_t dist, ssz, rd, rd1, rd2, block;
int64_t dist, ssz, rd, rd1, rd2;
int block;
int coeff_ctx;
k += (idy * 2 + idx);
if (tx_size == TX_4X4)
......
Markdown is supported
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