Commit da70e7b0 authored by Urvang Joshi's avatar Urvang Joshi
Browse files

angle estimation: Some renames/tweaks to sync with aomedia code.

Change-Id: Ide91d76fafe79b2b310ffd5afb7cd5b26b681f78
parent 43e6281f
......@@ -2503,7 +2503,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;
......@@ -2511,7 +2511,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;
......@@ -2534,16 +2533,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;
......@@ -2555,7 +2554,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);
......@@ -2564,7 +2563,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;
......@@ -2587,16 +2585,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;
......
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