Commit 08f64718 authored by Deb Mukherjee's avatar Deb Mukherjee Committed by Yaowu Xu

Add 8x8 transform to experimental branch

Please refer to previous commit messages for detailed info:
https://on2-git.corp.google.com/g/#change,5940
https://on2-git.corp.google.com/g/#change,6045

Change-Id: I8b16992f2f69c5a808ad40a3e32ef589cce7c59d
parent 8e464cc4
......@@ -217,6 +217,7 @@ HAVE_LIST="
EXPERIMENT_LIST="
extend_qrange
segmentation
t8x8
csm
"
CONFIG_LIST="
......
......@@ -20,6 +20,7 @@ void vpx_log(const char *format, ...);
#include "treecoder.h"
#include "subpixel.h"
#include "vpx_ports/mem.h"
#include "common.h"
#define TRUE 1
#define FALSE 0
......@@ -65,6 +66,10 @@ extern const unsigned char vp8_block2above[25];
#define VP8_COMBINEENTROPYCONTEXTS( Dest, A, B) \
Dest = ((A)!=0) + ((B)!=0);
#if CONFIG_T8X8
#define VP8_COMBINEENTROPYCONTEXTS_8x8( Dest, A1, B1, A2, B2) \
Dest = ((A1)!=0 || (A2)!=0) + ((B1)!=0 || (B2)!=0);
#endif
typedef enum
{
......@@ -89,15 +94,15 @@ typedef enum
MB_MODE_COUNT
} MB_PREDICTION_MODE;
/* Macroblock level features */
// Macroblock level features
typedef enum
{
MB_LVL_ALT_Q = 0, /* Use alternate Quantizer .... */
MB_LVL_ALT_LF = 1, /* Use alternate loop filter value... */
MB_LVL_MAX = 2 /* Number of MB level features supported */
MB_LVL_ALT_Q = 0, // Use alternate Quantizer ....
MB_LVL_ALT_LF = 1, // Use alternate loop filter value...
MB_LVL_MAX = 2, // Number of MB level features supported
} MB_LVL_FEATURES;
/* Segment Feature Masks */
#define SEGMENT_ALTQ 0x01
#define SEGMENT_ALT_LF 0x02
......@@ -270,6 +275,7 @@ typedef struct
void *current_bc;
int corrupted;
#if CONFIG_RUNTIME_CPU_DETECT
......
......@@ -183,3 +183,176 @@ const vp8_prob vp8_coef_update_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTE
},
},
};
const vp8_prob vp8_coef_update_probs_8x8 [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES] =
{
{
{
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 229, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{219, 234, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{239, 204, 229, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 209, 229, 255, 255, 255, 255, 255, 255, 255, 255, },
{239, 219, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 204, 229, 255, 255, 255, 255, 255, 255, 255, 255, },
{229, 209, 234, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 193, 209, 255, 255, 255, 255, 255, 255, 255, 255, },
{229, 198, 239, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 204, 204, 255, 255, 255, 255, 255, 255, 255, 255, },
{219, 198, 229, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 198, 204, 255, 255, 255, 255, 255, 255, 255, 255, },
{209, 193, 234, 249, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 249, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 214, 214, 255, 255, 255, 255, 255, 255, 255, 255, },
{173, 193, 234, 255, 255, 255, 255, 255, 255, 255, 255, },
{249, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
},
{
{
{255, 255, 234, 255, 255, 255, 255, 255, 255, 255, 255, },
{224, 224, 219, 255, 255, 255, 255, 255, 255, 255, 255, },
{229, 239, 234, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 234, 224, 255, 255, 255, 255, 255, 255, 255, 255, },
{224, 234, 234, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 255, 229, 255, 255, 255, 255, 255, 255, 255, 255, },
{229, 255, 234, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 255, 229, 255, 255, 255, 255, 255, 255, 255, 255, },
{224, 255, 239, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
},
{
{
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{224, 219, 234, 255, 255, 255, 255, 255, 255, 255, 255, },
{234, 183, 214, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 193, 229, 255, 249, 255, 255, 255, 255, 255, 255, },
{229, 214, 234, 249, 255, 255, 255, 255, 255, 255, 255, },
{255, 249, 255, 255, 249, 255, 255, 255, 255, 255, 255, },
},
{
{255, 198, 229, 255, 255, 255, 255, 255, 255, 255, 255, },
{229, 219, 249, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 249, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 193, 224, 255, 255, 255, 255, 255, 255, 255, 255, },
{229, 204, 234, 249, 249, 255, 255, 255, 255, 255, 255, },
{255, 249, 249, 255, 244, 249, 255, 255, 255, 255, 255, },
},
{
{255, 178, 224, 255, 249, 255, 255, 255, 255, 255, 255, },
{234, 224, 234, 249, 255, 255, 255, 255, 255, 255, 255, },
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
},
{
{255, 183, 229, 255, 249, 255, 255, 255, 255, 255, 255, },
{234, 219, 234, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 249, 249, 255, 249, 255, 255, 255, 255, 255, 255, },
},
{
{255, 193, 224, 249, 255, 244, 255, 255, 255, 255, 255, },
{219, 224, 229, 255, 255, 249, 255, 255, 255, 255, 255, },
{255, 255, 255, 249, 249, 255, 255, 255, 255, 255, 255, },
},
{
{255, 193, 229, 255, 255, 255, 255, 255, 255, 255, 255, },
{224, 224, 239, 255, 255, 255, 255, 255, 255, 255, 255, },
{249, 244, 249, 255, 255, 255, 255, 255, 255, 255, 255, },
},
},
{
{
{255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{249, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, },
{255, 239, 234, 244, 239, 244, 249, 255, 255, 255, 255, },
},
{
{255, 249, 239, 239, 244, 255, 255, 255, 255, 255, 255, },
{255, 249, 244, 255, 249, 255, 255, 255, 255, 255, 255, },
{255, 255, 239, 255, 255, 249, 255, 255, 255, 255, 255, },
},
{
{255, 244, 239, 239, 244, 255, 255, 255, 255, 255, 255, },
{255, 234, 239, 234, 249, 255, 255, 255, 255, 255, 255, },
{255, 255, 229, 239, 234, 249, 244, 255, 255, 255, 255, },
},
{
{255, 239, 229, 239, 234, 234, 255, 255, 255, 255, 255, },
{255, 239, 234, 229, 244, 239, 255, 234, 255, 255, 255, },
{255, 229, 209, 229, 239, 234, 244, 229, 255, 249, 255, },
},
{
{255, 239, 234, 229, 244, 249, 255, 249, 255, 255, 255, },
{255, 234, 229, 244, 234, 249, 255, 249, 255, 255, 255, },
{255, 229, 239, 229, 249, 255, 255, 244, 255, 255, 255, },
},
{
{255, 239, 234, 239, 234, 239, 255, 249, 255, 255, 255, },
{255, 229, 234, 239, 239, 239, 255, 244, 255, 255, 255, },
{255, 229, 234, 239, 239, 244, 255, 255, 255, 255, 255, },
},
{
{255, 219, 224, 229, 229, 234, 239, 224, 255, 255, 255, },
{255, 229, 229, 224, 234, 229, 239, 239, 255, 255, 255, },
{255, 229, 224, 239, 234, 239, 224, 224, 255, 249, 255, },
},
{
{255, 234, 229, 244, 229, 229, 255, 214, 255, 255, 255, },
{255, 239, 234, 239, 214, 239, 255, 209, 255, 255, 255, },
{249, 239, 219, 209, 219, 224, 239, 204, 255, 255, 255, },
},
},
};
......@@ -13,7 +13,7 @@
#define common_h 1
#include <assert.h>
#include "vpx_config.h"
/* Interface header for common constant data structures and lookup tables */
#include "vpx_mem/vpx_mem.h"
......@@ -38,5 +38,4 @@
#define vp8_zero_array( Dest, N) vpx_memset( Dest, 0, N * sizeof( *Dest));
#endif /* common_h */
......@@ -223,3 +223,180 @@ const unsigned int vp8_default_coef_counts[BLOCK_TYPES]
},
},
};
const unsigned int vp8_default_coef_counts_8x8[BLOCK_TYPES]
[COEF_BANDS]
[PREV_COEF_CONTEXTS]
[MAX_ENTROPY_TOKENS] =
{
{ /* block Type 0 */
{ /* Coeff Band 0 */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
},
{ /* Coeff Band 1 */
{ 21041, 13314, 3420, 592, 117, 0, 0, 0, 0, 0, 0, 11783},
{ 48236, 6918, 586, 153, 0, 0, 0, 0, 0, 0, 0, 23137},
{ 676112, 106685, 24701, 6003, 1426, 429, 165, 0, 0, 0, 0, 28910}
},
{ /* Coeff Band 2 */
{ 660107, 75227, 8451, 1345, 259, 0, 0, 0, 0, 0, 0, 0},
{ 79164, 36835, 6865, 1185, 246, 47, 0, 0, 0, 0, 0, 2575},
{ 19469, 14330, 3070, 579, 94, 6, 0, 0, 0, 0, 0, 44}
},
{ /* Coeff Band 3 */
{ 1978004, 235343, 28485, 3242, 271, 0, 0, 0, 0, 0, 0, 0},
{ 228684, 106736, 21431, 2842, 272, 46, 0, 0, 0, 0, 0, 9266},
{ 32470, 27496, 6852, 1386, 45, 93, 0, 0, 0, 0, 0, 0}
},
{ /* Coeff Band 4 */
{ 1911212, 224613, 49653, 13748, 2541, 568, 48, 0, 0, 0, 0, 0},
{ 196670, 103472, 44473, 11490, 2432, 977, 72, 0, 0, 0, 0, 9447},
{ 37876, 40417, 19142, 6069, 1799, 727, 51, 0, 0, 0, 0, 0}
},
{ /* Coeff Band 5 */
{ 3813399, 437714, 64387, 11312, 695, 219, 0, 0, 0, 0, 0, 0},
{ 438288, 215917, 61905, 10194, 674, 107, 0, 0, 0, 0, 0, 17808},
{ 99139, 93643, 30054, 5758, 802, 171, 0, 0, 0, 0, 0, 0}
},
{ /* Coeff Band 6 */
{ 12259383, 1625505, 234927, 46306, 8417, 1456, 151, 0, 0, 0, 0, 0},
{ 1518161, 734287, 204240, 44228, 9462, 2240, 65, 0, 0, 0, 0, 107630},
{ 292470, 258894, 94925, 25864, 6662, 2055, 170, 0, 0, 0, 0, 0}
},
{ /* Coeff Band 7 */
{ 9791308, 2118949, 169439, 16735, 1122, 0, 0, 0, 0, 0, 0, 0},
{ 1500281, 752410, 123259, 13065, 1168, 47, 0, 0, 0, 0, 0, 707182},
{ 193067, 142638, 31018, 4719, 516, 138, 0, 0, 0, 0, 0, 12439}
}
},
{ /* block Type 1 */
{ /* Coeff Band 0 */
{ 16925, 10553, 852, 16, 63, 87, 47, 0, 0, 0, 0, 31232},
{ 39777, 26839, 6822, 1908, 678, 456, 227, 168, 35, 0, 0, 46825},
{ 17300, 16666, 4168, 1209, 492, 154, 118, 207, 0, 0, 0, 19608}
},
{ /* Coeff Band 1 */
{ 35882, 31722, 4625, 1270, 266, 237, 0, 0, 0, 0, 0, 0},
{ 15426, 13894, 4482, 1305, 281, 43, 0, 0, 0, 0, 0, 18627},
{ 3900, 6552, 3472, 1723, 746, 366, 115, 35, 0, 0, 0, 798}
},
{ /* Coeff Band 2 */
{ 21998, 29132, 3353, 679, 46, 0, 0, 0, 0, 0, 0, 0},
{ 9098, 15767, 3794, 792, 268, 47, 0, 0, 0, 0, 0, 22402},
{ 4007, 8472, 2844, 687, 217, 0, 0, 0, 0, 0, 0, 2739}
},
{ /* Coeff Band 3 */
{ 0, 31414, 2911, 682, 96, 0, 0, 0, 0, 0, 0, 0},
{ 0, 16515, 4425, 938, 124, 0, 0, 0, 0, 0, 0, 31369},
{ 0, 4833, 2787, 1213, 150, 0, 0, 0, 0, 0, 0, 3744}
},
{ /* Coeff Band 4 */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
},
{ /* Coeff Band 5 */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
},
{ /* Coeff Band 6 */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 52762},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13326}
},
{ /* Coeff Band 7 */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
}
},
{ /* block Type 2 */
{ /* Coeff Band 0 */
{ 4444, 1614, 120, 48, 0, 48, 0, 0, 0, 0, 0, 278},
{ 192436, 103730, 24494, 9845, 4122, 1193, 102, 0, 0, 0, 0, 2577},
{ 3473446, 2308716, 815510, 370374, 167797, 92152, 12073, 86, 0, 0, 0, 6801}
},
{ /* Coeff Band 1 */
{ 2150616, 1136388, 250011, 86888, 31434, 13746, 1243, 0, 0, 0, 0, 0},
{ 1179945, 799802, 266012, 106787, 40809, 16486, 1546, 0, 0, 0, 0, 2673},
{ 465128, 504130, 286989, 146259, 62380, 30192, 2866, 20, 0, 0, 0, 0}
},
{ /* Coeff Band 2 */
{ 2157762, 1177519, 282665, 108499, 43389, 23224, 2597, 34, 0, 0, 0, 0},
{ 1135685, 813705, 278079, 123255, 53935, 29492, 3152, 39, 0, 0, 0, 2978},
{ 391894, 428037, 264216, 144306, 69326, 40281, 5541, 29, 0, 0, 0, 38}
},
{ /* Coeff Band 3 */
{ 6669109, 3468471, 782161, 288484, 115500, 51083, 4943, 41, 0, 0, 0, 0},
{ 3454493, 2361636, 809524, 337663, 141343, 65036, 6361, 0, 0, 0, 0, 8730},
{ 1231825, 1359522, 824686, 420784, 185517, 98731, 10973, 72, 0, 0, 0, 20}
},
{ /* Coeff Band 4 */
{ 7606203, 3452846, 659856, 191703, 49335, 14336, 450, 0, 0, 0, 0, 0},
{ 3806506, 2379332, 691697, 224938, 61966, 18324, 766, 0, 0, 0, 0, 8193},
{ 1270110, 1283728, 628775, 243378, 72617, 24897, 1087, 0, 0, 0, 0, 0}
},
{ /* Coeff Band 5 */
{ 15314169, 7436809, 1579928, 515790, 167453, 58305, 3502, 19, 0, 0, 0, 0},
{ 7021286, 4667922, 1545706, 574463, 191793, 68748, 4048, 1, 0, 0, 0, 17222},
{ 2011989, 2145878, 1185336, 534879, 195719, 79103, 5343, 4, 0, 0, 0, 37}
},
{ /* Coeff Band 6 */
{ 63458382, 25384462, 4208045, 1091050, 299011, 95242, 5238, 33, 0, 0, 0, 0},
{ 25638401, 14694085, 3945978, 1195420, 344813, 117355, 6703, 0, 0, 0, 0, 216811},
{ 5988177, 5824044, 2754413, 1077350, 370739, 139710, 9693, 38, 0, 0, 0, 1835}
},
{ /* Coeff Band 7 */
{ 74998348, 29342158, 2955001, 452912, 69631, 9516, 37, 0, 0, 0, 0, 0},
{ 24762356, 13281085, 2409883, 436787, 68948, 10658, 36, 0, 0, 0, 0, 6614989},
{ 3882867, 3224489, 1052289, 252890, 46967, 8548, 154, 0, 0, 0, 0, 194354}
}
},
{ /* block Type 3 */
{ /* Coeff Band 0 */
{ 10583, 12059, 3155, 1041, 248, 175, 24, 2, 0, 0, 0, 5717},
{ 42461, 41782, 13553, 4966, 1352, 855, 89, 0, 0, 0, 0, 15000},
{ 4691125, 5045589, 2673566, 1089317, 378161, 160268, 18252, 813, 69, 13, 0, 49}
},
{ /* Coeff Band 1 */
{ 1535203, 1685686, 924565, 390329, 141709, 60523, 5983, 171, 0, 0, 0, 0},
{ 1594021, 1793276, 1016078, 441332, 164159, 70843, 8098, 311, 0, 0, 0, 11312},
{ 1225223, 1430184, 888492, 460713, 203286, 115149, 22061, 804, 7, 0, 0, 0}
},
{ /* Coeff Band 2 */
{ 1522386, 1590366, 799910, 303691, 96625, 37608, 3637, 180, 33, 11, 0, 0},
{ 1682184, 1793869, 913649, 353520, 113674, 46309, 4736, 221, 18, 3, 0, 963},
{ 1574580, 1740474, 954392, 417994, 151400, 67091, 8000, 536, 73, 10, 0, 63}
},
{ /* Coeff Band 3 */
{ 4963672, 5197790, 2585383, 982161, 313333, 118498, 16014, 536, 62, 0, 0, 0},
{ 5223913, 5569803, 2845858, 1107384, 364949, 147841, 18296, 658, 11, 11, 0, 1866},
{ 4042207, 4548894, 2608767, 1154993, 446290, 221295, 41054, 2438, 124, 20, 0, 0}
},
{ /* Coeff Band 4 */
{ 3857216, 4431325, 2670447, 1330169, 553301, 286825, 46763, 1917, 0, 0, 0, 0},
{ 4226215, 4963701, 3046198, 1523923, 644670, 355519, 58792, 2525, 0, 0, 0, 1298},
{ 3831873, 4580350, 3018580, 1660048, 797298, 502983, 123906, 7172, 16, 0, 0, 0}
},
{ /* Coeff Band 5 */
{ 8524543, 9285149, 4979435, 2039330, 683458, 266032, 22628, 270, 0, 0, 0, 0},
{ 9432163, 10428088, 5715661, 2385738, 838389, 326264, 29981, 361, 0, 0, 0, 884},
{ 9039066, 10368964, 6136765, 2862030, 1098269, 511668, 63105, 945, 14, 0, 0, 0}
},
{ /* Coeff Band 6 */
{ 33222872, 34748297, 17701695, 7214933, 2602336, 1191859, 187873, 12667, 390, 3, 0, 0},
{ 34765051, 37140719, 19525578, 8268934, 3085012, 1473864, 246743, 15258, 736, 3, 0, 8403},
{ 28591289, 32252393, 19037068, 9213729, 4020653, 2372354, 586420, 67428, 3920, 92, 7, 3}
},
{ /* Coeff Band 7 */
{ 68604786, 60777665, 19712887, 5656955, 1520443, 507166, 51829, 2466, 10, 0, 0, 0},
{ 55447403, 51682540, 19008774, 5928582, 1706884, 595531, 65998, 3661, 101, 0, 0, 8468343},
{ 28321970, 29149398, 13565882, 5258675, 1868588, 898041, 192023, 21497, 672, 17, 0, 1884921}
}
}
};
......@@ -18,4 +18,9 @@ extern const unsigned int vp8_default_coef_counts[BLOCK_TYPES]
[PREV_COEF_CONTEXTS]
[MAX_ENTROPY_TOKENS];
#endif //__DEFAULTCOEFCOUNTS_H
extern const unsigned int vp8_default_coef_counts_8x8[BLOCK_TYPES]
[COEF_BANDS]
[PREV_COEF_CONTEXTS]
[MAX_ENTROPY_TOKENS];
#endif
\ No newline at end of file
......@@ -59,6 +59,24 @@ DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]) =
9, 12, 13, 10,
7, 11, 14, 15,
};
#if CONFIG_T8X8
DECLARE_ALIGNED(64, cuchar, vp8_coef_bands_8x8[64]) = { 0, 1, 2, 3, 5, 4, 4, 5,
5, 3, 6, 3, 5, 4, 6, 6,
6, 5, 5, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7
};
DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]) =
{
0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5,
12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28,
35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51,
58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63,
};
#endif
DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]) =
{
......@@ -69,6 +87,9 @@ DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]) =
};
DECLARE_ALIGNED(16, short, vp8_default_zig_zag_mask[16]);
#if CONFIG_T8X8
DECLARE_ALIGNED(64, short, vp8_default_zig_zag_mask_8x8[64]);//int64_t
#endif
const int vp8_mb_feature_data_bits[MB_LVL_MAX] = {7, 6};
......@@ -107,12 +128,16 @@ static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[22];
void vp8_init_scan_order_mask()
{
int i;
for (i = 0; i < 16; i++)
{
vp8_default_zig_zag_mask[vp8_default_zig_zag1d[i]] = 1 << i;
}
#if CONFIG_T8X8
for (i = 0; i < 64; i++)
{
vp8_default_zig_zag_mask_8x8[vp8_default_zig_zag1d_8x8[i]] = 1 << i;
}
#endif
}
static void init_bit_tree(vp8_tree_index *p, int n)
......@@ -158,7 +183,6 @@ vp8_extra_bit_struct vp8_extra_bits[12] =
void vp8_default_coef_probs(VP8_COMMON *pc)
{
int h = 0;
do
{
int i = 0;
......@@ -183,8 +207,32 @@ void vp8_default_coef_probs(VP8_COMMON *pc)
while (++i < COEF_BANDS);
}
while (++h < BLOCK_TYPES);
}
#if CONFIG_T8X8
h = 0;
do
{
int i = 0;
do
{
int k = 0;
do
{
unsigned int branch_ct [ENTROPY_NODES] [2];
vp8_tree_probs_from_distribution(
MAX_ENTROPY_TOKENS, vp8_coef_encodings, vp8_coef_tree,
pc->fc.coef_probs_8x8 [h][i][k], branch_ct, vp8_default_coef_counts_8x8 [h][i][k],
256, 1);
}
while (++k < PREV_COEF_CONTEXTS);
}
while (++i < COEF_BANDS);
}
while (++h < BLOCK_TYPES);
#endif
}
void vp8_coef_tree_initialize()
{
......
......@@ -14,7 +14,7 @@
#include "treecoder.h"
#include "blockd.h"
#include "common.h"
/* Coefficient token alphabet */
#define ZERO_TOKEN 0 /* 0 Extra Bits 0+0 */
......@@ -64,6 +64,9 @@ extern vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */
#define COEF_BANDS 8
extern DECLARE_ALIGNED(16, const unsigned char, vp8_coef_bands[16]);
#if CONFIG_T8X8
extern DECLARE_ALIGNED(64, const unsigned char, vp8_coef_bands_8x8[64]);
#endif
/* Inside dimension is 3-valued measure of nearby complexity, that is,
the extent to which nearby coefficients are nonzero. For the first
......@@ -87,15 +90,20 @@ extern DECLARE_ALIGNED(16, const unsigned char, vp8_coef_bands[16]);
extern DECLARE_ALIGNED(16, const unsigned char, vp8_prev_token_class[MAX_ENTROPY_TOKENS]);
extern const vp8_prob vp8_coef_update_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
#if CONFIG_T8X8
extern const vp8_prob vp8_coef_update_probs_8x8 [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES];
#endif
struct VP8Common;
void vp8_default_coef_probs(struct VP8Common *);
extern DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d[16]);
extern DECLARE_ALIGNED(16, const short, vp8_default_inv_zig_zag[16]);
extern short vp8_default_zig_zag_mask[16];
#if CONFIG_T8X8
extern DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]);
extern short vp8_default_zig_zag_mask_8x8[64];//int64_t
#endif
extern const int vp8_mb_feature_data_bits[MB_LVL_MAX];
void vp8_coef_tree_initialize(void);
#endif
......@@ -75,7 +75,13 @@ void vp8_machine_specific_config(VP8_COMMON *ctx)
rtcd->idct.idct1_scalar_add = vp8_dc_only_idct_add_c;
rtcd->idct.iwalsh1 = vp8_short_inv_walsh4x4_1_c;
rtcd->idct.iwalsh16 = vp8_short_inv_walsh4x4_c;
#if CONFIG_T8X8
rtcd->idct.idct8 = vp8_short_idct8x8_c;
rtcd->idct.idct8_1 = vp8_short_idct8x8_1_c;
rtcd->idct.idct1_scalar_add_8x8 = vp8_dc_only_idct_add_8x8_c;
rtcd->idct.ihaar2 = vp8_short_ihaar2x2_c;
rtcd->idct.ihaar2_1 = vp8_short_ihaar2x2_1_c;
#endif
rtcd->recon.copy16x16 = vp8_copy_mem16x16_c;
rtcd->recon.copy8x8 = vp8_copy_mem8x8_c;
rtcd->recon.copy8x4 = vp8_copy_mem8x4_c;
......
......@@ -31,6 +31,34 @@
#include "arm/idct_arm.h"
#endif
#if CONFIG_T8X8
#ifndef vp8_idct_idct8
#define vp8_idct_idct8 vp8_short_idct8x8_c
#endif
extern prototype_idct(vp8_idct_idct8);
#ifndef vp8_idct_idct8_1
#define vp8_idct_idct8_1 vp8_short_idct8x8_1_c
#endif
extern prototype_idct(vp8_idct_idct8_1);
#ifndef vp8_idct_ihaar2
#define vp8_idct_ihaar2 vp8_short_ihaar2x2_c
#endif
extern prototype_idct(vp8_idct_ihaar2);
#ifndef vp8_idct_ihaar2_1
#define vp8_idct_ihaar2_1 vp8_short_ihaar2x2_1_c
#endif
extern prototype_idct(vp8_idct_ihaar2_1);
#ifndef vp8_idct_idct1_scalar_add_8x8
#define vp8_idct_idct1_scalar_add_8x8 vp8_dc_only_idct_add_8x8_c
#endif
extern prototype_idct_scalar_add(vp8_idct_idct1_scalar_add_8x8);
#endif
#ifndef vp8_idct_idct1
#define vp8_idct_idct1 vp8_short_idct4x4llm_1_c
#endif
......@@ -46,7 +74,6 @@ extern prototype_idct(vp8_idct_idct16);
#endif
extern prototype_idct_scalar_add(vp8_idct_idct1_scalar_add);
#ifndef vp8_idct_iwalsh1
#define vp8_idct_iwalsh1 vp8_short_inv_walsh4x4_1_c
#endif
......@@ -69,6 +96,14 @@ typedef struct
vp8_second_order_fn_t iwalsh1;
vp8_second_order_fn_t iwalsh16;
#if CONFIG_T8X8
vp8_idct_fn_t idct8;
vp8_idct_fn_t idct8_1;
vp8_idct_scalar_add_fn_t idct1_scalar_add_8x8;
vp8_idct_fn_t ihaar2;
vp8_idct_fn_t ihaar2_1;
#endif
} vp8_idct_rtcd_vtable_t;
#if CONFIG_RUNTIME_CPU_DETECT
......
......@@ -24,9 +24,13 @@
**************************************************************************/
#include "vpx_ports/config.h"
#include <math.h>
static const int cospi8sqrt2minus1 = 20091;