diff options
author | Deb Mukherjee <debargha@google.com> | 2014-10-06 14:30:01 -0700 |
---|---|---|
committer | Deb Mukherjee <debargha@google.com> | 2014-10-07 11:20:56 -0700 |
commit | fced63ed300c721c115c00af0bd91907702242eb (patch) | |
tree | 627a22c33bf1d0baf2f0a446e448c6665587991d /vp9/encoder/vp9_rdopt.c | |
parent | 12344f26975c7ecd9ce2e1c75aa98dd068711ed7 (diff) | |
download | libvpx-fced63ed300c721c115c00af0bd91907702242eb.tar libvpx-fced63ed300c721c115c00af0bd91907702242eb.tar.gz libvpx-fced63ed300c721c115c00af0bd91907702242eb.tar.bz2 libvpx-fced63ed300c721c115c00af0bd91907702242eb.zip |
Resolves some static analysis / undefined warnings
Also fixes a case of distortion becoming negative and messing
up the RDCOST computation.
Change-Id: Id345af9e8dfff31ade622be5756e51f2cdface53
Diffstat (limited to 'vp9/encoder/vp9_rdopt.c')
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 20a4b7082..eacbbf7da 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -232,7 +232,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize, // Fast approximate the modelling function. if (cpi->oxcf.speed > 4) { int64_t rate; - int64_t square_error = sse; + const int64_t square_error = sum_sse; int quantizer = (pd->dequant[1] >> 3); #if CONFIG_VP9_HIGHBITDEPTH if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) { @@ -497,7 +497,7 @@ static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize, if (tx_size != TX_32X32) dc_correct >>= 2; - args->dist = args->sse - dc_correct; + args->dist = MAX(0, args->sse - dc_correct); } } else { // skip forward transform @@ -2448,7 +2448,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, #if CONFIG_VP9_HIGHBITDEPTH DECLARE_ALIGNED_ARRAY(16, uint16_t, tmp_buf16, MAX_MB_PLANE * 64 * 64); DECLARE_ALIGNED_ARRAY(16, uint8_t, tmp_buf8, MAX_MB_PLANE * 64 * 64); - uint8_t *tmp_buf = tmp_buf8; + uint8_t *tmp_buf; #else DECLARE_ALIGNED_ARRAY(16, uint8_t, tmp_buf, MAX_MB_PLANE * 64 * 64); #endif // CONFIG_VP9_HIGHBITDEPTH |