summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2023-02-22 11:34:30 -0800
committerJames Zern <jzern@google.com>2023-02-22 11:59:02 -0800
commit46add73f7e60799fab383c5dcbad0b953eee0c7a (patch)
tree4502f009da2366c13025e818af508e2abbfbbece
parent910245f1fed19a4cd5233a9930e7a3dd2ca5d004 (diff)
downloadlibvpx-46add73f7e60799fab383c5dcbad0b953eee0c7a.tar
libvpx-46add73f7e60799fab383c5dcbad0b953eee0c7a.tar.gz
libvpx-46add73f7e60799fab383c5dcbad0b953eee0c7a.tar.bz2
libvpx-46add73f7e60799fab383c5dcbad0b953eee0c7a.zip
vp9_block.h: rename diff struct to Diff
This matches the style guide and fixes some -Wshadow warnings related to variables with the same name. Something similar was done in libaom in: 863b04994b Fix warnings reported by -Wshadow: Part2: av1 directory Bug: webm:1793 Change-Id: I4df1bbc8d079a3174d75f0d35d54c200ffdbb677
-rw-r--r--vp9/encoder/vp9_block.h2
-rw-r--r--vp9/encoder/vp9_encodeframe.c14
-rw-r--r--vp9/encoder/vp9_encoder.c3
-rw-r--r--vp9/encoder/vp9_encoder.h2
4 files changed, 11 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_block.h b/vp9/encoder/vp9_block.h
index 20294b4b9..178695291 100644
--- a/vp9/encoder/vp9_block.h
+++ b/vp9/encoder/vp9_block.h
@@ -24,7 +24,7 @@ typedef struct {
unsigned int sse;
int sum;
unsigned int var;
-} diff;
+} Diff;
struct macroblock_plane {
DECLARE_ALIGNED(16, int16_t, src_diff[64 * 64]);
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index a522097e6..5b811016d 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -2432,16 +2432,16 @@ static void set_source_var_based_partition(VP9_COMP *cpi,
(row8x8_remaining >= MI_BLOCK_SIZE)) {
int i, j;
int index;
- diff d32[4];
+ Diff d32[4];
const int offset = (mi_row >> 1) * cm->mb_cols + (mi_col >> 1);
int is_larger_better = 0;
int use32x32 = 0;
unsigned int thr = cpi->source_var_thresh;
- memset(d32, 0, 4 * sizeof(diff));
+ memset(d32, 0, sizeof(d32));
for (i = 0; i < 4; i++) {
- diff *d16[4];
+ Diff *d16[4];
for (j = 0; j < 4; j++) {
int b_mi_row = coord_lookup[i * 4 + j].row;
@@ -5681,12 +5681,12 @@ static void encode_nonrd_sb_row(VP9_COMP *cpi, ThreadData *td,
}
// end RTC play code
-static INLINE uint32_t variance(const diff *const d) {
+static INLINE uint32_t variance(const Diff *const d) {
return d->sse - (uint32_t)(((int64_t)d->sum * d->sum) >> 8);
}
#if CONFIG_VP9_HIGHBITDEPTH
-static INLINE uint32_t variance_highbd(diff *const d) {
+static INLINE uint32_t variance_highbd(Diff *const d) {
const int64_t var = (int64_t)d->sse - (((int64_t)d->sum * d->sum) >> 8);
return (var >= 0) ? (uint32_t)var : 0;
}
@@ -5706,7 +5706,7 @@ static int set_var_thresh_from_histogram(VP9_COMP *cpi) {
? (cm->MBs * VAR_HIST_LARGE_CUT_OFF / 100)
: (cm->MBs * VAR_HIST_SMALL_CUT_OFF / 100);
DECLARE_ALIGNED(16, int, hist[VAR_HIST_BINS]);
- diff *var16 = cpi->source_diff_var;
+ Diff *var16 = cpi->source_diff_var;
int sum = 0;
int i, j;
@@ -5790,7 +5790,7 @@ static void source_var_based_partition_search_method(VP9_COMP *cpi) {
if (cpi->source_diff_var) vpx_free(cpi->source_diff_var);
CHECK_MEM_ERROR(cm, cpi->source_diff_var,
- vpx_calloc(cm->MBs, sizeof(diff)));
+ vpx_calloc(cm->MBs, sizeof(cpi->source_diff_var)));
}
if (!cpi->frames_till_next_var_check)
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 22fbb899f..4cec02eb9 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -2546,7 +2546,8 @@ VP9_COMP *vp9_create_compressor(const VP9EncoderConfig *oxcf,
for (i = 0; i < MAX_ARF_GOP_SIZE; ++i) cpi->tpl_stats[i].tpl_stats_ptr = NULL;
// Allocate memory to store variances for a frame.
- CHECK_MEM_ERROR(cm, cpi->source_diff_var, vpx_calloc(cm->MBs, sizeof(diff)));
+ CHECK_MEM_ERROR(cm, cpi->source_diff_var,
+ vpx_calloc(cm->MBs, sizeof(cpi->source_diff_var)));
cpi->source_var_thresh = 0;
cpi->frames_till_next_var_check = 0;
#define BFP(BT, SDF, SDAF, VF, SVF, SVAF, SDX4DF) \
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index 79c0b36a1..77de5c875 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -920,7 +920,7 @@ typedef struct VP9_COMP {
SVC svc;
// Store frame variance info in SOURCE_VAR_BASED_PARTITION search type.
- diff *source_diff_var;
+ Diff *source_diff_var;
// The threshold used in SOURCE_VAR_BASED_PARTITION search type.
unsigned int source_var_thresh;
int frames_till_next_var_check;