ref: fc04a9491ebaaa8e2b1c7c8e0587c8a1873531d6
parent: 3db0921ec3392e9181eda4140272f6fa44c8b98a
author: Peter Kasting <pkasting@chromium.org>
date: Sun Jul 25 23:57:55 EDT 2021
Fix some instances of -Wunused-but-set-variable. Bug: chromium:1203071 Change-Id: Ieb628f95d676ba3814b5caf8a02a884330928c77
--- a/vp8/encoder/bitstream.c
+++ b/vp8/encoder/bitstream.c
@@ -866,7 +866,6 @@
#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 @@
#if !(CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING)
vp8_write_literal(w, newp, 8);
#endif
-
- savings += s;
}
} while (++t < ENTROPY_NODES);
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -784,8 +784,8 @@
// 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 @@
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 @@
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 @@
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;
--- a/vpx_ports/x86.h
+++ b/vpx_ports/x86.h
@@ -223,6 +223,8 @@
}
}
+ (void)reg_eax; // Avoid compiler warning on unused-but-set variable.
+
return flags & mask;
}
@@ -307,6 +309,11 @@
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 @@
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;
}