Commit 1f7c4114 authored by Luc Trudeau's avatar Luc Trudeau

Fix Dead Store in rdopt.c

Change-Id: Iad6a16d3ab819405de037d5100060710e0636176
parent 72e0f783
...@@ -801,78 +801,64 @@ static double od_compute_dist_common(int activity_masking, uint16_t *x, ...@@ -801,78 +801,64 @@ static double od_compute_dist_common(int activity_masking, uint16_t *x,
static double od_compute_dist(uint16_t *x, uint16_t *y, int bsize_w, static double od_compute_dist(uint16_t *x, uint16_t *y, int bsize_w,
int bsize_h, int qindex) { int bsize_h, int qindex) {
int i;
double sum = 0;
assert(bsize_w >= 8 && bsize_h >= 8); assert(bsize_w >= 8 && bsize_h >= 8);
#if CONFIG_PVQ #if CONFIG_PVQ
int activity_masking = 1; int activity_masking = 1;
#else #else
int activity_masking = 0; int activity_masking = 0;
#endif #endif
{ int i, j;
int j; DECLARE_ALIGNED(16, od_coeff, e[MAX_TX_SQUARE]);
DECLARE_ALIGNED(16, od_coeff, e[MAX_TX_SQUARE]); DECLARE_ALIGNED(16, od_coeff, tmp[MAX_TX_SQUARE]);
DECLARE_ALIGNED(16, od_coeff, tmp[MAX_TX_SQUARE]); DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_TX_SQUARE]);
DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_TX_SQUARE]); for (i = 0; i < bsize_h; i++) {
int mid = OD_DIST_LP_MID; for (j = 0; j < bsize_w; j++) {
for (i = 0; i < bsize_h; i++) { e[i * bsize_w + j] = x[i * bsize_w + j] - y[i * bsize_w + j];
for (j = 0; j < bsize_w; j++) {
e[i * bsize_w + j] = x[i * bsize_w + j] - y[i * bsize_w + j];
}
} }
for (i = 0; i < bsize_h; i++) { }
tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; int mid = OD_DIST_LP_MID;
tmp[i * bsize_w + bsize_w - 1] = for (i = 0; i < bsize_h; i++) {
mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1];
for (j = 1; j < bsize_w - 1; j++) { tmp[i * bsize_w + bsize_w - 1] =
tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2];
e[i * bsize_w + j - 1] + e[i * bsize_w + j + 1]; for (j = 1; j < bsize_w - 1; j++) {
} tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] +
e[i * bsize_w + j + 1];
} }
sum = od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h,
qindex, tmp, e_lp);
} }
return sum; return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h,
qindex, tmp, e_lp);
} }
static double od_compute_dist_diff(uint16_t *x, int16_t *e, int bsize_w, static double od_compute_dist_diff(uint16_t *x, int16_t *e, int bsize_w,
int bsize_h, int qindex) { int bsize_h, int qindex) {
int i;
double sum = 0;
assert(bsize_w >= 8 && bsize_h >= 8); assert(bsize_w >= 8 && bsize_h >= 8);
#if CONFIG_PVQ #if CONFIG_PVQ
int activity_masking = 1; int activity_masking = 1;
#else #else
int activity_masking = 0; int activity_masking = 0;
#endif #endif
{ DECLARE_ALIGNED(16, uint16_t, y[MAX_TX_SQUARE]);
int j; DECLARE_ALIGNED(16, od_coeff, tmp[MAX_TX_SQUARE]);
DECLARE_ALIGNED(16, uint16_t, y[MAX_TX_SQUARE]); DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_TX_SQUARE]);
DECLARE_ALIGNED(16, od_coeff, tmp[MAX_TX_SQUARE]); int i, j;
DECLARE_ALIGNED(16, od_coeff, e_lp[MAX_TX_SQUARE]); for (i = 0; i < bsize_h; i++) {
int mid = OD_DIST_LP_MID; for (j = 0; j < bsize_w; j++) {
for (i = 0; i < bsize_h; i++) { y[i * bsize_w + j] = x[i * bsize_w + j] - e[i * bsize_w + j];
for (j = 0; j < bsize_w; j++) {
y[i * bsize_w + j] = x[i * bsize_w + j] - e[i * bsize_w + j];
}
} }
for (i = 0; i < bsize_h; i++) { }
tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1]; int mid = OD_DIST_LP_MID;
tmp[i * bsize_w + bsize_w - 1] = for (i = 0; i < bsize_h; i++) {
mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2]; tmp[i * bsize_w] = mid * e[i * bsize_w] + 2 * e[i * bsize_w + 1];
for (j = 1; j < bsize_w - 1; j++) { tmp[i * bsize_w + bsize_w - 1] =
tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + mid * e[i * bsize_w + bsize_w - 1] + 2 * e[i * bsize_w + bsize_w - 2];
e[i * bsize_w + j - 1] + e[i * bsize_w + j + 1]; for (j = 1; j < bsize_w - 1; j++) {
} tmp[i * bsize_w + j] = mid * e[i * bsize_w + j] + e[i * bsize_w + j - 1] +
e[i * bsize_w + j + 1];
} }
sum = od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h,
qindex, tmp, e_lp);
} }
return sum; return od_compute_dist_common(activity_masking, x, y, bsize_w, bsize_h,
qindex, tmp, e_lp);
} }
int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCK *x, int64_t av1_dist_8x8(const AV1_COMP *const cpi, const MACROBLOCK *x,
......
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