summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kasting <pkasting@chromium.org>2021-07-26 03:57:55 -0700
committerJerome Jiang <jianj@google.com>2021-07-26 22:01:01 +0000
commitfc04a9491ebaaa8e2b1c7c8e0587c8a1873531d6 (patch)
treee8a04d96bf338d1b0666d85005f6a1159c685874
parent3db0921ec3392e9181eda4140272f6fa44c8b98a (diff)
downloadlibvpx-fc04a9491ebaaa8e2b1c7c8e0587c8a1873531d6.tar.gz
Fix some instances of -Wunused-but-set-variable.
Bug: chromium:1203071 Change-Id: Ieb628f95d676ba3814b5caf8a02a884330928c77
-rw-r--r--vp8/encoder/bitstream.c3
-rw-r--r--vp9/encoder/vp9_encodeframe.c18
-rw-r--r--vpx_ports/x86.h12
3 files changed, 15 insertions, 18 deletions
diff --git a/vp8/encoder/bitstream.c b/vp8/encoder/bitstream.c
index 80cbb882f..87825fa6f 100644
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -866,7 +866,6 @@ void vp8_update_coef_probs(VP8_COMP *cpi) {
#if !(CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING)
vp8_writer *const w = cpi->bc;
#endif
- int savings = 0;
vpx_clear_system_state();
@@ -940,8 +939,6 @@ void vp8_update_coef_probs(VP8_COMP *cpi) {
#if !(CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING)
vp8_write_literal(w, newp, 8);
#endif
-
- savings += s;
}
} while (++t < ENTROPY_NODES);
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index f08300976..131c4887f 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -784,8 +784,8 @@ static void fill_variance_8x8avg(const uint8_t *s, int sp, const uint8_t *d,
// Check if most of the superblock is skin content, and if so, force split to
// 32x32, and set x->sb_is_skin for use in mode selection.
-static int skin_sb_split(VP9_COMP *cpi, MACROBLOCK *x, const int low_res,
- int mi_row, int mi_col, int *force_split) {
+static int skin_sb_split(VP9_COMP *cpi, const int low_res, int mi_row,
+ int mi_col, int *force_split) {
VP9_COMMON *const cm = &cpi->common;
#if CONFIG_VP9_HIGHBITDEPTH
if (cm->use_highbitdepth) return 0;
@@ -797,11 +797,6 @@ static int skin_sb_split(VP9_COMP *cpi, MACROBLOCK *x, const int low_res,
mi_row + 8 < cm->mi_rows)) {
int num_16x16_skin = 0;
int num_16x16_nonskin = 0;
- uint8_t *ysignal = x->plane[0].src.buf;
- uint8_t *usignal = x->plane[1].src.buf;
- uint8_t *vsignal = x->plane[2].src.buf;
- int sp = x->plane[0].src.stride;
- int spuv = x->plane[1].src.stride;
const int block_index = mi_row * cm->mi_cols + mi_col;
const int bw = num_8x8_blocks_wide_lookup[BLOCK_64X64];
const int bh = num_8x8_blocks_high_lookup[BLOCK_64X64];
@@ -820,13 +815,7 @@ static int skin_sb_split(VP9_COMP *cpi, MACROBLOCK *x, const int low_res,
i = ymis;
break;
}
- ysignal += 16;
- usignal += 8;
- vsignal += 8;
}
- ysignal += (sp << 4) - 64;
- usignal += (spuv << 3) - 32;
- vsignal += (spuv << 3) - 32;
}
if (num_16x16_skin > 12) {
*force_split = 1;
@@ -1503,8 +1492,7 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
vp9_build_inter_predictors_sb(xd, mi_row, mi_col, BLOCK_64X64);
if (cpi->use_skin_detection)
- x->sb_is_skin =
- skin_sb_split(cpi, x, low_res, mi_row, mi_col, force_split);
+ x->sb_is_skin = skin_sb_split(cpi, low_res, mi_row, mi_col, force_split);
d = xd->plane[0].dst.buf;
dp = xd->plane[0].dst.stride;
diff --git a/vpx_ports/x86.h b/vpx_ports/x86.h
index 14f434449..ad3da84ac 100644
--- a/vpx_ports/x86.h
+++ b/vpx_ports/x86.h
@@ -223,6 +223,8 @@ static INLINE int x86_simd_caps(void) {
}
}
+ (void)reg_eax; // Avoid compiler warning on unused-but-set variable.
+
return flags & mask;
}
@@ -307,6 +309,11 @@ static INLINE unsigned int x86_readtscp(void) {
static INLINE unsigned int x86_tsc_start(void) {
unsigned int reg_eax, reg_ebx, reg_ecx, reg_edx;
cpuid(0, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
+ // Avoid compiler warnings on unused-but-set variables.
+ (void)reg_eax;
+ (void)reg_ebx;
+ (void)reg_ecx;
+ (void)reg_edx;
return x86_readtsc();
}
@@ -314,6 +321,11 @@ static INLINE unsigned int x86_tsc_end(void) {
uint32_t v = x86_readtscp();
unsigned int reg_eax, reg_ebx, reg_ecx, reg_edx;
cpuid(0, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
+ // Avoid compiler warnings on unused-but-set variables.
+ (void)reg_eax;
+ (void)reg_ebx;
+ (void)reg_ecx;
+ (void)reg_edx;
return v;
}