Commit 98a306a1 authored by Yaowu Xu's avatar Yaowu Xu Committed by Gerrit Code Review

Merge changes I027a4f2a,Ide91d76f into nextgenv2

* changes:
  Add complier warning -wunused.
  angle estimation: Some renames/tweaks to sync with aomedia code.
parents 32d8a496 3212dda9
......@@ -2507,7 +2507,7 @@ static const uint8_t mode_to_angle_bin[INTRA_MODES] = {
static void angle_estimation(const uint8_t *src, int src_stride, int rows,
int cols, uint8_t *directional_mode_skip_mask) {
int i, r, c, dx, dy, temp, sn, remd, quot;
int i, r, c, index, dx, dy, temp, sn, remd, quot;
uint64_t hist[DIRECTIONAL_MODES];
uint64_t hist_sum = 0;
......@@ -2515,7 +2515,6 @@ static void angle_estimation(const uint8_t *src, int src_stride, int rows,
src += src_stride;
for (r = 1; r < rows; ++r) {
for (c = 1; c < cols; ++c) {
uint8_t index;
dx = src[c] - src[c - 1];
dy = src[c] - src[c - src_stride];
temp = dx * dx + dy * dy;
......@@ -2538,16 +2537,16 @@ static void angle_estimation(const uint8_t *src, int src_stride, int rows,
for (i = 0; i < DIRECTIONAL_MODES; ++i) hist_sum += hist[i];
for (i = 0; i < INTRA_MODES; ++i) {
if (i != DC_PRED && i != TM_PRED) {
const uint8_t index = mode_to_angle_bin[i];
uint64_t score = 2 * hist[index];
const uint8_t angle_bin = mode_to_angle_bin[i];
uint64_t score = 2 * hist[angle_bin];
int weight = 2;
if (index > 0) {
score += hist[index - 1];
weight += 1;
if (angle_bin > 0) {
score += hist[angle_bin - 1];
++weight;
}
if (index < DIRECTIONAL_MODES - 1) {
score += hist[index + 1];
weight += 1;
if (angle_bin < DIRECTIONAL_MODES - 1) {
score += hist[angle_bin + 1];
++weight;
}
if (score * ANGLE_SKIP_THRESH < hist_sum * weight)
directional_mode_skip_mask[i] = 1;
......@@ -2559,7 +2558,7 @@ static void angle_estimation(const uint8_t *src, int src_stride, int rows,
static void highbd_angle_estimation(const uint8_t *src8, int src_stride,
int rows, int cols,
uint8_t *directional_mode_skip_mask) {
int i, r, c, dx, dy, temp, sn, remd, quot;
int i, r, c, index, dx, dy, temp, sn, remd, quot;
uint64_t hist[DIRECTIONAL_MODES];
uint64_t hist_sum = 0;
uint16_t *src = CONVERT_TO_SHORTPTR(src8);
......@@ -2568,7 +2567,6 @@ static void highbd_angle_estimation(const uint8_t *src8, int src_stride,
src += src_stride;
for (r = 1; r < rows; ++r) {
for (c = 1; c < cols; ++c) {
uint8_t index;
dx = src[c] - src[c - 1];
dy = src[c] - src[c - src_stride];
temp = dx * dx + dy * dy;
......@@ -2591,16 +2589,16 @@ static void highbd_angle_estimation(const uint8_t *src8, int src_stride,
for (i = 0; i < DIRECTIONAL_MODES; ++i) hist_sum += hist[i];
for (i = 0; i < INTRA_MODES; ++i) {
if (i != DC_PRED && i != TM_PRED) {
const uint8_t index = mode_to_angle_bin[i];
uint64_t score = 2 * hist[index];
const uint8_t angle_bin = mode_to_angle_bin[i];
uint64_t score = 2 * hist[angle_bin];
int weight = 2;
if (index > 0) {
score += hist[index - 1];
weight += 1;
if (angle_bin > 0) {
score += hist[angle_bin - 1];
++weight;
}
if (index < DIRECTIONAL_MODES - 1) {
score += hist[index + 1];
weight += 1;
if (angle_bin < DIRECTIONAL_MODES - 1) {
score += hist[angle_bin + 1];
++weight;
}
if (score * ANGLE_SKIP_THRESH < hist_sum * weight)
directional_mode_skip_mask[i] = 1;
......
......@@ -616,20 +616,14 @@ process_toolchain() {
check_add_cflags -Wvla
check_add_cflags -Wimplicit-function-declaration
check_add_cflags -Wuninitialized
check_add_cflags -Wunused-variable
check_add_cflags -Wunused
check_add_cflags -Wsign-compare
# Enabling the following warning for C++ generates some useless warnings
# about some function parameters shadowing class member function names.
# So, only enable this warning for C code.
check_cflags "-Wshadow" && add_cflags_only "-Wshadow"
case ${CC} in
*clang*) ;;
*) check_add_cflags -Wunused-but-set-variable ;;
esac
if enabled mips || [ -z "${INLINE}" ]; then
enabled extra_warnings || check_add_cflags -Wno-unused-function
else
check_add_cflags -Wunused-function
fi
fi
......
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