Commit ebb1157c authored by Deb Mukherjee's avatar Deb Mukherjee Committed by Gerrit Code Review

Merge "Modifies the comp inter-intra expt" into experimental

parents bed59eb8 b34838be
......@@ -383,155 +383,27 @@ static void combine_interintra(MB_PREDICTION_MODE mode,
static const int scale_max = 256; // 1 << scale_bits;
static const int scale_round = 127; // (1 << (scale_bits - 1));
// This table is a function A + B*exp(-kx), where x is hor. index
static const int weights1d[32] = {
128, 122, 116, 111, 107, 103, 99, 96,
93, 90, 88, 85, 83, 81, 80, 78,
77, 76, 75, 74, 73, 72, 71, 70,
70, 69, 69, 68, 68, 68, 67, 67,
static const int weights1d[64] = {
128, 125, 122, 119, 116, 114, 111, 109,
107, 105, 103, 101, 99, 97, 96, 94,
93, 91, 90, 89, 88, 86, 85, 84,
83, 82, 81, 81, 80, 79, 78, 78,
77, 76, 76, 75, 75, 74, 74, 73,
73, 72, 72, 71, 71, 71, 70, 70,
70, 70, 69, 69, 69, 69, 68, 68,
68, 68, 68, 67, 67, 67, 67, 67,
};
// This table is a function A + B*exp(-k.sqrt(xy)), where x, y are
// hor. and vert. indices
static const int weights2d[1024] = {
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
128, 122, 120, 118, 116, 115, 114, 113,
112, 111, 111, 110, 109, 109, 108, 107,
107, 106, 106, 105, 105, 104, 104, 104,
103, 103, 102, 102, 102, 101, 101, 101,
128, 120, 116, 114, 112, 111, 109, 108,
107, 106, 105, 104, 103, 102, 102, 101,
100, 100, 99, 99, 98, 97, 97, 96,
96, 96, 95, 95, 94, 94, 93, 93,
128, 118, 114, 111, 109, 107, 106, 104,
103, 102, 101, 100, 99, 98, 97, 97,
96, 95, 95, 94, 93, 93, 92, 92,
91, 91, 90, 90, 90, 89, 89, 88,
128, 116, 112, 109, 107, 105, 103, 102,
100, 99, 98, 97, 96, 95, 94, 93,
93, 92, 91, 91, 90, 90, 89, 89,
88, 88, 87, 87, 86, 86, 85, 85,
128, 115, 111, 107, 105, 103, 101, 99,
98, 97, 96, 94, 93, 93, 92, 91,
90, 89, 89, 88, 88, 87, 86, 86,
85, 85, 84, 84, 84, 83, 83, 82,
128, 114, 109, 106, 103, 101, 99, 97,
96, 95, 93, 92, 91, 90, 90, 89,
88, 87, 87, 86, 85, 85, 84, 84,
83, 83, 82, 82, 82, 81, 81, 80,
128, 113, 108, 104, 102, 99, 97, 96,
94, 93, 92, 91, 90, 89, 88, 87,
86, 85, 85, 84, 84, 83, 83, 82,
82, 81, 81, 80, 80, 79, 79, 79,
128, 112, 107, 103, 100, 98, 96, 94,
93, 91, 90, 89, 88, 87, 86, 85,
85, 84, 83, 83, 82, 82, 81, 80,
80, 80, 79, 79, 78, 78, 78, 77,
128, 111, 106, 102, 99, 97, 95, 93,
91, 90, 89, 88, 87, 86, 85, 84,
83, 83, 82, 81, 81, 80, 80, 79,
79, 78, 78, 77, 77, 77, 76, 76,
128, 111, 105, 101, 98, 96, 93, 92,
90, 89, 88, 86, 85, 84, 84, 83,
82, 81, 81, 80, 80, 79, 79, 78,
78, 77, 77, 76, 76, 76, 75, 75,
128, 110, 104, 100, 97, 94, 92, 91,
89, 88, 86, 85, 84, 83, 83, 82,
81, 80, 80, 79, 79, 78, 78, 77,
77, 76, 76, 75, 75, 75, 74, 74,
128, 109, 103, 99, 96, 93, 91, 90,
88, 87, 85, 84, 83, 82, 82, 81,
80, 79, 79, 78, 78, 77, 77, 76,
76, 75, 75, 75, 74, 74, 74, 73,
128, 109, 102, 98, 95, 93, 90, 89,
87, 86, 84, 83, 82, 81, 81, 80,
79, 78, 78, 77, 77, 76, 76, 75,
75, 75, 74, 74, 73, 73, 73, 73,
128, 108, 102, 97, 94, 92, 90, 88,
86, 85, 84, 83, 82, 81, 80, 79,
78, 78, 77, 77, 76, 76, 75, 75,
74, 74, 73, 73, 73, 73, 72, 72,
128, 107, 101, 97, 93, 91, 89, 87,
85, 84, 83, 82, 81, 80, 79, 78,
78, 77, 76, 76, 75, 75, 74, 74,
74, 73, 73, 73, 72, 72, 72, 71,
128, 107, 100, 96, 93, 90, 88, 86,
85, 83, 82, 81, 80, 79, 78, 78,
77, 76, 76, 75, 75, 74, 74, 73,
73, 73, 72, 72, 72, 71, 71, 71,
128, 106, 100, 95, 92, 89, 87, 85,
84, 83, 81, 80, 79, 78, 78, 77,
76, 76, 75, 75, 74, 74, 73, 73,
72, 72, 72, 72, 71, 71, 71, 70,
128, 106, 99, 95, 91, 89, 87, 85,
83, 82, 81, 80, 79, 78, 77, 76,
76, 75, 75, 74, 74, 73, 73, 72,
72, 72, 71, 71, 71, 71, 70, 70,
128, 105, 99, 94, 91, 88, 86, 84,
83, 81, 80, 79, 78, 77, 77, 76,
75, 75, 74, 74, 73, 73, 72, 72,
72, 71, 71, 71, 70, 70, 70, 70,
128, 105, 98, 93, 90, 88, 85, 84,
82, 81, 80, 79, 78, 77, 76, 75,
75, 74, 74, 73, 73, 72, 72, 71,
71, 71, 71, 70, 70, 70, 70, 69,
128, 104, 97, 93, 90, 87, 85, 83,
82, 80, 79, 78, 77, 76, 76, 75,
74, 74, 73, 73, 72, 72, 71, 71,
71, 70, 70, 70, 70, 69, 69, 69,
128, 104, 97, 92, 89, 86, 84, 83,
81, 80, 79, 78, 77, 76, 75, 74,
74, 73, 73, 72, 72, 71, 71, 71,
70, 70, 70, 70, 69, 69, 69, 69,
128, 104, 96, 92, 89, 86, 84, 82,
80, 79, 78, 77, 76, 75, 75, 74,
73, 73, 72, 72, 71, 71, 71, 70,
70, 70, 70, 69, 69, 69, 69, 68,
128, 103, 96, 91, 88, 85, 83, 82,
80, 79, 78, 77, 76, 75, 74, 74,
73, 72, 72, 72, 71, 71, 70, 70,
70, 70, 69, 69, 69, 69, 68, 68,
128, 103, 96, 91, 88, 85, 83, 81,
80, 78, 77, 76, 75, 75, 74, 73,
73, 72, 72, 71, 71, 70, 70, 70,
70, 69, 69, 69, 69, 68, 68, 68,
128, 102, 95, 90, 87, 84, 82, 81,
79, 78, 77, 76, 75, 74, 73, 73,
72, 72, 71, 71, 71, 70, 70, 70,
69, 69, 69, 69, 68, 68, 68, 68,
128, 102, 95, 90, 87, 84, 82, 80,
79, 77, 76, 75, 75, 74, 73, 73,
72, 72, 71, 71, 70, 70, 70, 69,
69, 69, 69, 68, 68, 68, 68, 68,
128, 102, 94, 90, 86, 84, 82, 80,
78, 77, 76, 75, 74, 73, 73, 72,
72, 71, 71, 70, 70, 70, 69, 69,
69, 69, 68, 68, 68, 68, 68, 67,
128, 101, 94, 89, 86, 83, 81, 79,
78, 77, 76, 75, 74, 73, 73, 72,
71, 71, 71, 70, 70, 69, 69, 69,
69, 68, 68, 68, 68, 68, 67, 67,
128, 101, 93, 89, 85, 83, 81, 79,
78, 76, 75, 74, 74, 73, 72, 72,
71, 71, 70, 70, 70, 69, 69, 69,
68, 68, 68, 68, 68, 67, 67, 67,
128, 101, 93, 88, 85, 82, 80, 79,
77, 76, 75, 74, 73, 73, 72, 71,
71, 70, 70, 70, 69, 69, 69, 68,
68, 68, 68, 68, 67, 67, 67, 67,
};
int size_scale = (size >= 32 ? 1 :
size == 16 ? 2 :
size == 8 ? 4 : 8);
int size_shift = size == 64 ? 1 : 0;
int size_scale = (size >= 64 ? 1:
size == 32 ? 2 :
size == 16 ? 4 :
size == 8 ? 8 : 16);
int i, j;
switch (mode) {
case V_PRED:
for (i = 0; i < size; ++i) {
for (j = 0; j < size; ++j) {
int k = i * interstride + j;
int scale = weights1d[i * size_scale >> size_shift];
int scale = weights1d[i * size_scale];
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
......@@ -544,7 +416,7 @@ static void combine_interintra(MB_PREDICTION_MODE mode,
for (i = 0; i < size; ++i) {
for (j = 0; j < size; ++j) {
int k = i * interstride + j;
int scale = weights1d[j * size_scale >> size_shift];
int scale = weights1d[j * size_scale];
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
......@@ -558,9 +430,8 @@ static void combine_interintra(MB_PREDICTION_MODE mode,
for (i = 0; i < size; ++i) {
for (j = 0; j < size; ++j) {
int k = i * interstride + j;
int scale = (weights2d[(i * size_scale * 32 +
j * size_scale) >> size_shift] +
weights1d[i * size_scale >> size_shift]) >> 1;
int scale = (weights1d[i * size_scale] * 3 +
weights1d[j * size_scale]) >> 2;
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
......@@ -574,9 +445,8 @@ static void combine_interintra(MB_PREDICTION_MODE mode,
for (i = 0; i < size; ++i) {
for (j = 0; j < size; ++j) {
int k = i * interstride + j;
int scale = (weights2d[(i * size_scale * 32 +
j * size_scale) >> size_shift] +
weights1d[j * size_scale >> size_shift]) >> 1;
int scale = (weights1d[j * size_scale] * 3 +
weights1d[i * size_scale]) >> 2;
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
......@@ -589,8 +459,7 @@ static void combine_interintra(MB_PREDICTION_MODE mode,
for (i = 0; i < size; ++i) {
for (j = 0; j < size; ++j) {
int k = i * interstride + j;
int scale = weights2d[(i * size_scale * 32 +
j * size_scale) >> size_shift];
int scale = weights1d[(i < j ? i : j) * size_scale];
interpred[k] =
((scale_max - scale) * interpred[k] +
scale * intrapred[i * intrastride + j] + scale_round)
......
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