Commit de6dfa6b authored by Jingning Han's avatar Jingning Han

hybrid transform of 16x16 dimension

Enable ADST/DCT of dimension 16x16 for I16X16 modes. This change provides
benefits mostly for hd sequences.

Set up the framework for selectable transform dimension.

Also allowing quantization parameter threshold to control the use
of hybrid transform (This is currently disabled by setting threshold
always above the quantization parameter. Adaptive thresholding can
be built upon this, which will further improve the coding performance.)

The coding performance gains (with respect to the codec that has all
other configuration settings turned on) are

derf:   0.013
yt:     0.086
hd:     0.198
std-hd: 0.501

Change-Id: Ibb4263a61fc74e0b3c345f54d73e8c73552bf926
parent c59e36fc
......@@ -227,6 +227,7 @@ EXPERIMENT_LIST="
tx16x16
newbestrefmv
new_mvref
hybridtransform16x16
"
CONFIG_LIST="
external_build
......
......@@ -133,13 +133,13 @@ typedef enum {
typedef enum {
TX_4X4, // 4x4 dct transform
TX_8X8, // 8x8 dct transform
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
TX_16X16, // 16x16 dct transform
#endif
TX_SIZE_MAX // Number of different transforms available
} TX_SIZE;
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
typedef enum {
DCT_DCT = 0, // DCT in both horizontal and vertical
ADST_DCT = 1, // ADST in horizontal, DCT in vertical
......@@ -155,10 +155,14 @@ typedef enum {
#define VP8_MVREFS (1 + SPLITMV - NEARESTMV)
#if CONFIG_HYBRIDTRANSFORM
#if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
#define ACTIVE_HT 110 // quantization stepsize threshold
#endif
#if CONFIG_HYBRIDTRANSFORM16X16
#define ACTIVE_HT16 300
#endif
typedef enum {
B_DC_PRED, /* average of above and left pixels */
B_TM_PRED,
......@@ -190,7 +194,7 @@ typedef enum {
} MV_REF_TYPE;
#endif
#if CONFIG_HYBRIDTRANSFORM8X8
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
// convert MB_PREDICTION_MODE to B_PREDICTION_MODE
static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
B_PREDICTION_MODE b_mode;
......@@ -244,7 +248,7 @@ static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
union b_mode_info {
struct {
B_PREDICTION_MODE first;
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
B_PREDICTION_MODE test;
TX_TYPE tx_type;
#endif
......@@ -269,7 +273,7 @@ typedef enum {
typedef struct {
MB_PREDICTION_MODE mode, uv_mode;
#if CONFIG_HYBRIDTRANSFORM
#if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
MB_PREDICTION_MODE mode_rdopt;
#endif
......@@ -457,15 +461,16 @@ typedef struct MacroBlockD {
#endif
#endif
#if CONFIG_HYBRIDTRANSFORM
#if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
int q_index;
#endif
} MACROBLOCKD;
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM
#if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
// transform mapping
static void txfm_map(BLOCKD *b, B_PREDICTION_MODE bmode) {
// map transform type
switch (bmode) {
case B_TM_PRED :
case B_RD_PRED :
......
......@@ -13,7 +13,7 @@
Generated file included by entropy.c */
#define COEF_UPDATE_PROB 252
#define COEF_UPDATE_PROB_8X8 252
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
#define COEF_UPDATE_PROB_16X16 252
#endif
......@@ -488,7 +488,7 @@ vp8_default_coef_probs_8x8[BLOCK_TYPES_8X8]
}
#endif
};
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
static const vp8_prob
vp8_default_coef_probs_16x16[BLOCK_TYPES_16X16]
[COEF_BANDS]
......@@ -546,103 +546,104 @@ vp8_default_coef_probs_16x16[BLOCK_TYPES_16X16]
}
},
{ /* block Type 1 */
{ /* Coeff Band 0 */
{ 134, 152, 233, 224, 234, 52, 255, 166, 128, 128, 128},
{ 97, 132, 185, 234, 186, 189, 197, 171, 255, 212, 128},
{ 84, 110, 185, 237, 182, 182, 145, 145, 255, 255, 128}
},
{ /* Coeff Band 1 */
{ 1, 124, 213, 247, 192, 212, 255, 255, 128, 128, 128},
{ 88, 111, 178, 254, 189, 211, 255, 255, 128, 128, 128},
{ 12, 59, 129, 236, 150, 179, 239, 195, 255, 255, 128},
{ 12, 59, 129, 236, 150, 179, 239, 195, 255, 255, 128}
},
{ /* Coeff Band 2 */
{ 1, 102, 225, 255, 210, 240, 128, 128, 128, 128, 128},
{ 110, 78, 195, 254, 200, 191, 255, 255, 128, 128, 128},
{ 37, 63, 177, 255, 194, 195, 128, 128, 128, 128, 128},
{ 37, 63, 177, 255, 194, 195, 128, 128, 128, 128, 128}
},
{ /* Coeff Band 3 */
{ 1, 1, 229, 255, 202, 224, 128, 128, 128, 128, 128},
{ 150, 1, 192, 255, 206, 226, 128, 128, 128, 128, 128},
{ 75, 1, 138, 255, 172, 228, 128, 128, 128, 128, 128},
{ 75, 1, 138, 255, 172, 228, 128, 128, 128, 128, 128}
},
{ /* Coeff Band 4 */
{ 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},
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}
},
{ /* Coeff Band 5 */
{ 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},
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}
},
{ /* Coeff Band 6 */
{ 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},
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}
},
{ /* Coeff Band 7 */
{ 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},
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}
}
{ /* Coeff Band 0 */
{ 1, 30, 103, 204, 142, 168, 235, 161, 255, 228, 128},
{ 1, 35, 90, 192, 130, 161, 227, 158, 255, 226, 255},
{ 1, 36, 78, 180, 122, 156, 221, 153, 255, 222, 255},
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}
},
{ /* Coeff Band 1 */
{ 1, 163, 228, 253, 212, 194, 255, 205, 128, 128, 128},
{ 67, 160, 226, 253, 210, 202, 245, 172, 255, 255, 128},
{ 51, 147, 219, 251, 207, 207, 255, 217, 128, 128, 128},
{ 25, 107, 175, 245, 183, 190, 254, 209, 255, 255, 128}
},
{ /* Coeff Band 2 */
{ 1, 66, 170, 240, 177, 186, 252, 203, 255, 245, 128},
{ 23, 64, 145, 230, 161, 177, 252, 198, 255, 255, 128},
{ 6, 51, 99, 208, 135, 163, 249, 178, 255, 248, 128},
{ 1, 33, 59, 161, 104, 151, 238, 164, 255, 237, 128}
},
{ /* Coeff Band 3 */
{ 1, 76, 216, 250, 198, 199, 255, 226, 255, 255, 128},
{ 86, 83, 200, 247, 189, 193, 255, 224, 255, 255, 128},
{ 30, 75, 164, 242, 172, 184, 254, 218, 255, 255, 128},
{ 3, 54, 103, 227, 140, 172, 253, 201, 255, 255, 128}
},
{ /* Coeff Band 4 */
{ 1, 241, 247, 255, 233, 223, 255, 255, 128, 128, 128},
{ 78, 212, 242, 255, 226, 230, 255, 255, 128, 128, 128},
{ 10, 167, 224, 255, 217, 225, 255, 128, 128, 128, 128},
{ 1, 104, 176, 250, 166, 219, 255, 255, 128, 128, 128}
},
{ /* Coeff Band 5 */
{ 1, 194, 241, 254, 228, 214, 248, 237, 255, 255, 128},
{ 95, 133, 228, 254, 218, 215, 255, 229, 128, 128, 128},
{ 24, 119, 201, 252, 202, 205, 255, 229, 128, 128, 128},
{ 1, 88, 155, 246, 183, 193, 255, 205, 128, 128, 128}
},
{ /* Coeff Band 6 */
{ 1, 204, 236, 255, 222, 220, 255, 239, 128, 128, 128},
{ 126, 105, 225, 254, 214, 217, 255, 254, 128, 128, 128},
{ 44, 86, 190, 251, 197, 204, 255, 233, 128, 128, 128},
{ 6, 71, 130, 240, 164, 188, 255, 246, 128, 128, 128}
},
{ /* Coeff Band 7 */
{ 1, 195, 250, 255, 239, 197, 128, 128, 128, 128, 128},
{ 167, 102, 249, 255, 234, 255, 128, 128, 128, 128, 128},
{ 65, 91, 222, 255, 217, 255, 128, 128, 128, 128, 128},
{ 1, 59, 128, 255, 154, 255, 128, 128, 128, 128, 128}
}
},
{ /* block Type 2 */
{ /* Coeff Band 0 */
{ 11, 181, 226, 199, 183, 255, 255, 255, 128, 128, 128},
{ 2, 147, 185, 248, 163, 180, 255, 236, 128, 128, 128},
{ 1, 123, 157, 238, 154, 176, 255, 226, 255, 255, 128},
{ 1, 123, 157, 238, 154, 176, 255, 226, 255, 255, 128}
},
{ /* Coeff Band 1 */
{ 1, 150, 191, 246, 174, 188, 255, 235, 128, 128, 128},
{ 1, 125, 166, 245, 165, 185, 255, 234, 128, 128, 128},
{ 1, 79, 125, 240, 148, 179, 255, 234, 255, 255, 128},
{ 1, 79, 125, 240, 148, 179, 255, 234, 255, 255, 128}
},
{ /* Coeff Band 2 */
{ 1, 146, 184, 242, 167, 183, 255, 230, 255, 255, 128},
{ 1, 119, 160, 239, 156, 178, 255, 231, 255, 255, 128},
{ 1, 75, 115, 234, 142, 173, 255, 225, 255, 255, 128},
{ 1, 75, 115, 234, 142, 173, 255, 225, 255, 255, 128}
},
{ /* Coeff Band 3 */
{ 1, 150, 188, 244, 169, 183, 255, 233, 255, 255, 128},
{ 1, 123, 162, 243, 161, 180, 255, 233, 128, 128, 128},
{ 1, 76, 120, 238, 148, 178, 255, 230, 255, 255, 128},
{ 1, 76, 120, 238, 148, 178, 255, 230, 255, 255, 128}
},
{ /* Coeff Band 4 */
{ 1, 163, 202, 252, 188, 204, 255, 248, 128, 128, 128},
{ 1, 136, 180, 251, 181, 201, 255, 246, 128, 128, 128},
{ 1, 92, 146, 249, 170, 197, 255, 245, 128, 128, 128},
{ 1, 92, 146, 249, 170, 197, 255, 245, 128, 128, 128}
},
{ /* Coeff Band 5 */
{ 1, 156, 195, 249, 179, 193, 255, 241, 255, 255, 128},
{ 1, 128, 169, 248, 171, 192, 255, 242, 255, 255, 128},
{ 1, 84, 132, 245, 158, 187, 255, 240, 255, 255, 128},
{ 1, 84, 132, 245, 158, 187, 255, 240, 255, 255, 128}
},
{ /* Coeff Band 6 */
{ 1, 36, 71, 251, 192, 201, 255, 243, 255, 255, 128},
{ 1, 49, 185, 250, 184, 199, 255, 242, 128, 128, 128},
{ 1, 95, 147, 247, 168, 190, 255, 239, 255, 255, 128},
{ 1, 95, 147, 247, 168, 190, 255, 239, 255, 255, 128}
},
{ /* Coeff Band 7 */
{ 1, 19, 98, 255, 218, 222, 255, 255, 128, 128, 128},
{ 36, 50, 210, 255, 212, 221, 255, 255, 128, 128, 128},
{ 6, 117, 180, 254, 199, 216, 255, 251, 128, 128, 128},
{ 6, 117, 180, 254, 199, 216, 255, 251, 128, 128, 128}
}
{ /* Coeff Band 0 */
{ 1, 30, 103, 204, 142, 168, 235, 161, 255, 228, 128},
{ 1, 35, 90, 192, 130, 161, 227, 158, 255, 226, 255},
{ 1, 36, 78, 180, 122, 156, 221, 153, 255, 222, 255},
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}
},
{ /* Coeff Band 1 */
{ 1, 163, 228, 253, 212, 194, 255, 205, 128, 128, 128},
{ 67, 160, 226, 253, 210, 202, 245, 172, 255, 255, 128},
{ 51, 147, 219, 251, 207, 207, 255, 217, 128, 128, 128},
{ 25, 107, 175, 245, 183, 190, 254, 209, 255, 255, 128}
},
{ /* Coeff Band 2 */
{ 1, 66, 170, 240, 177, 186, 252, 203, 255, 245, 128},
{ 23, 64, 145, 230, 161, 177, 252, 198, 255, 255, 128},
{ 6, 51, 99, 208, 135, 163, 249, 178, 255, 248, 128},
{ 1, 33, 59, 161, 104, 151, 238, 164, 255, 237, 128}
},
{ /* Coeff Band 3 */
{ 1, 76, 216, 250, 198, 199, 255, 226, 255, 255, 128},
{ 86, 83, 200, 247, 189, 193, 255, 224, 255, 255, 128},
{ 30, 75, 164, 242, 172, 184, 254, 218, 255, 255, 128},
{ 3, 54, 103, 227, 140, 172, 253, 201, 255, 255, 128}
},
{ /* Coeff Band 4 */
{ 1, 241, 247, 255, 233, 223, 255, 255, 128, 128, 128},
{ 78, 212, 242, 255, 226, 230, 255, 255, 128, 128, 128},
{ 10, 167, 224, 255, 217, 225, 255, 128, 128, 128, 128},
{ 1, 104, 176, 250, 166, 219, 255, 255, 128, 128, 128}
},
{ /* Coeff Band 5 */
{ 1, 194, 241, 254, 228, 214, 248, 237, 255, 255, 128},
{ 95, 133, 228, 254, 218, 215, 255, 229, 128, 128, 128},
{ 24, 119, 201, 252, 202, 205, 255, 229, 128, 128, 128},
{ 1, 88, 155, 246, 183, 193, 255, 205, 128, 128, 128}
},
{ /* Coeff Band 6 */
{ 1, 204, 236, 255, 222, 220, 255, 239, 128, 128, 128},
{ 126, 105, 225, 254, 214, 217, 255, 254, 128, 128, 128},
{ 44, 86, 190, 251, 197, 204, 255, 233, 128, 128, 128},
{ 6, 71, 130, 240, 164, 188, 255, 246, 128, 128, 128}
},
{ /* Coeff Band 7 */
{ 1, 195, 250, 255, 239, 197, 128, 128, 128, 128, 128},
{ 167, 102, 249, 255, 234, 255, 128, 128, 128, 128, 128},
{ 65, 91, 222, 255, 217, 255, 128, 128, 128, 128, 128},
{ 1, 59, 128, 255, 154, 255, 128, 128, 128, 128, 128}
}
},
{ /* block Type 3 */
{ /* Coeff Band 0 */
......
......@@ -95,7 +95,7 @@ DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]) = {
58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63,
};
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
// Table can be optimized.
DECLARE_ALIGNED(16, const int, vp8_coef_bands_16x16[256]) = {
0, 1, 2, 3, 5, 4, 4, 5, 5, 3, 6, 3, 5, 4, 6, 6,
......@@ -212,7 +212,7 @@ void vp8_default_coef_probs(VP8_COMMON *pc) {
vpx_memcpy(pc->fc.coef_probs_8x8, vp8_default_coef_probs_8x8,
sizeof(pc->fc.coef_probs_8x8));
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
vpx_memcpy(pc->fc.coef_probs_16x16, vp8_default_coef_probs_16x16,
sizeof(pc->fc.coef_probs_16x16));
#endif
......@@ -335,7 +335,7 @@ void vp8_adapt_coef_probs(VP8_COMMON *cm) {
}
}
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
for (i = 0; i < BLOCK_TYPES_16X16; ++i)
for (j = 0; j < COEF_BANDS; ++j)
for (k = 0; k < PREV_COEF_CONTEXTS; ++k) {
......
......@@ -67,6 +67,7 @@ extern vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */
#else
#define BLOCK_TYPES_8X8 3
#endif
#define BLOCK_TYPES_16X16 4
/* Middle dimension is a coarsening of the coefficient's
......@@ -75,7 +76,7 @@ extern vp8_extra_bit_struct vp8_extra_bits[12]; /* indexed by token value */
#define COEF_BANDS 8
extern DECLARE_ALIGNED(16, const int, vp8_coef_bands[16]);
extern DECLARE_ALIGNED(64, const int, vp8_coef_bands_8x8[64]);
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
extern DECLARE_ALIGNED(16, const int, vp8_coef_bands_16x16[256]);
#endif
......@@ -118,7 +119,7 @@ extern short vp8_default_zig_zag_mask[16];
extern DECLARE_ALIGNED(64, const int, vp8_default_zig_zag1d_8x8[64]);
void vp8_coef_tree_initialize(void);
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
extern DECLARE_ALIGNED(16, const int, vp8_default_zig_zag1d_16x16[256]);
#endif
void vp8_adapt_coef_probs(struct VP8Common *);
......
......@@ -33,7 +33,7 @@ void vp8_machine_specific_config(VP8_COMMON *ctx) {
rtcd->idct.idct8 = vp8_short_idct8x8_c;
rtcd->idct.idct1_scalar_add_8x8 = vp8_dc_only_idct_add_8x8_c;
rtcd->idct.ihaar2 = vp8_short_ihaar2x2_c;
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
rtcd->idct.idct16x16 = vp8_short_idct16x16_c;
#endif
rtcd->recon.copy16x16 = vp8_copy_mem16x16_c;
......
......@@ -43,7 +43,7 @@
#define Y2_WHT_UPSCALE_FACTOR 2
#endif
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
#ifndef vp8_idct_idct16x16
#define vp8_idct_idct16x16 vp8_short_idct16x16_c
#endif
......@@ -111,7 +111,7 @@ extern prototype_second_order(vp8_short_inv_walsh4x4_lossless_c);
extern prototype_second_order(vp8_short_inv_walsh4x4_1_lossless_c);
#endif
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
#include "vp8/common/blockd.h"
void vp8_ihtllm_c(short *input, short *output, int pitch,
TX_TYPE tx_type, int tx_dim);
......@@ -136,7 +136,7 @@ typedef struct {
vp8_idct_fn_t ihaar2;
vp8_idct_fn_t ihaar2_1;
#if CONFIG_TX16X16
#if CONFIG_TX16X16 || CONFIG_HYBRIDTRANSFORM16X16
vp8_idct_fn_t idct16x16;
#endif
} vp8_idct_rtcd_vtable_t;
......
......@@ -37,7 +37,7 @@ static const int rounding = 0;
// TODO: these transforms can be further converted into integer forms
// for complexity optimization
#if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8
#if CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM16X16
float idct_4[16] = {
0.500000000000000, 0.653281482438188, 0.500000000000000, 0.270598050073099,
0.500000000000000, 0.270598050073099, -0.500000000000000, -0.653281482438188,
......@@ -89,11 +89,85 @@ float iadst_8[64] = {
0.483002021635509, -0.466553967085785, 0.434217976756762, -0.387095214016348,
0.326790388032145, -0.255357107325375, 0.175227946595736, -0.089131608307532
};
#endif
#if CONFIG_HYBRIDTRANSFORM16X16 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM8X8
float idct_16[256] = {
0.250000, 0.351851, 0.346760, 0.338330, 0.326641, 0.311806, 0.293969, 0.273300,
0.250000, 0.224292, 0.196424, 0.166664, 0.135299, 0.102631, 0.068975, 0.034654,
0.250000, 0.338330, 0.293969, 0.224292, 0.135299, 0.034654, -0.068975, -0.166664,
-0.250000, -0.311806, -0.346760, -0.351851, -0.326641, -0.273300, -0.196424, -0.102631,
0.250000, 0.311806, 0.196424, 0.034654, -0.135299, -0.273300, -0.346760, -0.338330,
-0.250000, -0.102631, 0.068975, 0.224292, 0.326641, 0.351851, 0.293969, 0.166664,
0.250000, 0.273300, 0.068975, -0.166664, -0.326641, -0.338330, -0.196424, 0.034654,
0.250000, 0.351851, 0.293969, 0.102631, -0.135299, -0.311806, -0.346760, -0.224292,
0.250000, 0.224292, -0.068975, -0.311806, -0.326641, -0.102631, 0.196424, 0.351851,
0.250000, -0.034654, -0.293969, -0.338330, -0.135299, 0.166664, 0.346760, 0.273300,
0.250000, 0.166664, -0.196424, -0.351851, -0.135299, 0.224292, 0.346760, 0.102631,
-0.250000, -0.338330, -0.068975, 0.273300, 0.326641, 0.034654, -0.293969, -0.311806,
0.250000, 0.102631, -0.293969, -0.273300, 0.135299, 0.351851, 0.068975, -0.311806,
-0.250000, 0.166664, 0.346760, 0.034654, -0.326641, -0.224292, 0.196424, 0.338330,
0.250000, 0.034654, -0.346760, -0.102631, 0.326641, 0.166664, -0.293969, -0.224292,
0.250000, 0.273300, -0.196424, -0.311806, 0.135299, 0.338330, -0.068975, -0.351851,
0.250000, -0.034654, -0.346760, 0.102631, 0.326641, -0.166664, -0.293969, 0.224292,
0.250000, -0.273300, -0.196424, 0.311806, 0.135299, -0.338330, -0.068975, 0.351851,
0.250000, -0.102631, -0.293969, 0.273300, 0.135299, -0.351851, 0.068975, 0.311806,
-0.250000, -0.166664, 0.346760, -0.034654, -0.326641, 0.224292, 0.196424, -0.338330,
0.250000, -0.166664, -0.196424, 0.351851, -0.135299, -0.224292, 0.346760, -0.102631,
-0.250000, 0.338330, -0.068975, -0.273300, 0.326641, -0.034654, -0.293969, 0.311806,
0.250000, -0.224292, -0.068975, 0.311806, -0.326641, 0.102631, 0.196424, -0.351851,
0.250000, 0.034654, -0.293969, 0.338330, -0.135299, -0.166664, 0.346760, -0.273300,
0.250000, -0.273300, 0.068975, 0.166664, -0.326641, 0.338330, -0.196424, -0.034654,
0.250000, -0.351851, 0.293969, -0.102631, -0.135299, 0.311806, -0.346760, 0.224292,
0.250000, -0.311806, 0.196424, -0.034654, -0.135299, 0.273300, -0.346760, 0.338330,
-0.250000, 0.102631, 0.068975, -0.224292, 0.326641, -0.351851, 0.293969, -0.166664,
0.250000, -0.338330, 0.293969, -0.224292, 0.135299, -0.034654, -0.068975, 0.166664,
-0.250000, 0.311806, -0.346760, 0.351851, -0.326641, 0.273300, -0.196424, 0.102631,
0.250000, -0.351851, 0.346760, -0.338330, 0.326641, -0.311806, 0.293969, -0.273300,
0.250000, -0.224292, 0.196424, -0.166664, 0.135299, -0.102631, 0.068975, -0.034654
};
float iadst_16[256] = {
0.033094, 0.098087, 0.159534, 0.215215, 0.263118, 0.301511, 0.329007, 0.344612,
0.347761, 0.338341, 0.316693, 0.283599, 0.240255, 0.188227, 0.129396, 0.065889,
0.065889, 0.188227, 0.283599, 0.338341, 0.344612, 0.301511, 0.215215, 0.098087,
-0.033094, -0.159534, -0.263118, -0.329007, -0.347761, -0.316693, -0.240255, -0.129396,
0.098087, 0.263118, 0.344612, 0.316693, 0.188227, 0.000000, -0.188227, -0.316693,
-0.344612, -0.263118, -0.098087, 0.098087, 0.263118, 0.344612, 0.316693, 0.188227,
0.129396, 0.316693, 0.329007, 0.159534, -0.098087, -0.301511, -0.338341, -0.188227,
0.065889, 0.283599, 0.344612, 0.215215, -0.033094, -0.263118, -0.347761, -0.240255,
0.159534, 0.344612, 0.240255, -0.065889, -0.316693, -0.301511, -0.033094, 0.263118,
0.338341, 0.129396, -0.188227, -0.347761, -0.215215, 0.098087, 0.329007, 0.283599,
0.188227, 0.344612, 0.098087, -0.263118, -0.316693, -0.000000, 0.316693, 0.263118,
-0.098087, -0.344612, -0.188227, 0.188227, 0.344612, 0.098087, -0.263118, -0.316693,
0.215215, 0.316693, -0.065889, -0.347761, -0.098087, 0.301511, 0.240255, -0.188227,
-0.329007, 0.033094, 0.344612, 0.129396, -0.283599, -0.263118, 0.159534, 0.338341,
0.240255, 0.263118, -0.215215, -0.283599, 0.188227, 0.301511, -0.159534, -0.316693,
0.129396, 0.329007, -0.098087, -0.338341, 0.065889, 0.344612, -0.033094, -0.347761,
0.263118, 0.188227, -0.316693, -0.098087, 0.344612, 0.000000, -0.344612, 0.098087,
0.316693, -0.188227, -0.263118, 0.263118, 0.188227, -0.316693, -0.098087, 0.344612,
0.283599, 0.098087, -0.347761, 0.129396, 0.263118, -0.301511, -0.065889, 0.344612,
-0.159534, -0.240255, 0.316693, 0.033094, -0.338341, 0.188227, 0.215215, -0.329007,
0.301511, 0.000000, -0.301511, 0.301511, 0.000000, -0.301511, 0.301511, 0.000000,
-0.301511, 0.301511, 0.000000, -0.301511, 0.301511, 0.000000, -0.301511, 0.301511,
0.316693, -0.098087, -0.188227, 0.344612, -0.263118, -0.000000, 0.263118, -0.344612,
0.188227, 0.098087, -0.316693, 0.316693, -0.098087, -0.188227, 0.344612, -0.263118,
0.329007, -0.188227, -0.033094, 0.240255, -0.344612, 0.301511, -0.129396, -0.098087,
0.283599, -0.347761, 0.263118, -0.065889, -0.159534, 0.316693, -0.338341, 0.215215,
0.338341, -0.263118, 0.129396, 0.033094, -0.188227, 0.301511, -0.347761, 0.316693,
-0.215215, 0.065889, 0.098087, -0.240255, 0.329007, -0.344612, 0.283599, -0.159534,
0.344612, -0.316693, 0.263118, -0.188227, 0.098087, 0.000000, -0.098087, 0.188227,
-0.263118, 0.316693, -0.344612, 0.344612, -0.316693, 0.263118, -0.188227, 0.098087,
0.347761, -0.344612, 0.338341, -0.329007, 0.316693, -0.301511, 0.283599, -0.263118,
0.240255, -0.215215, 0.188227, -0.159534, 0.129396, -0.098087, 0.065889, -0.033094
};
#endif
#if CONFIG_HYBRIDTRANSFORM8X8 || CONFIG_HYBRIDTRANSFORM || CONFIG_HYBRIDTRANSFORM16X16
void vp8_ihtllm_c(short *input, short *output, int pitch,
TX_TYPE tx_type, int tx_dim) {
int i, j, k;
float bufa[64], bufb[64]; // buffers are for floating-point test purpose
float bufa[256], bufb[256]; // buffers are for floating-point test purpose
// the implementation could be simplified in
// conjunction with integer transform
......@@ -126,11 +200,13 @@ void vp8_ihtllm_c(short *input, short *output, int pitch,
switch(tx_type) {
case ADST_ADST :
case ADST_DCT :
ptv = (tx_dim == 4) ? &iadst_4[0] : &iadst_8[0];
ptv = (tx_dim == 4) ? &iadst_4[0] :
((tx_dim == 8) ? &iadst_8[0] : &iadst_16[0]);
break;
default :
ptv = (tx_dim == 4) ? &idct_4[0] : &idct_8[0];
ptv = (tx_dim == 4) ? &idct_4[0] :
((tx_dim == 8) ? &idct_8[0] : &idct_16[0]);
break;
}
......@@ -155,11 +231,13 @@ void vp8_ihtllm_c(short *input, short *output, int pitch,
switch(tx_type) {
case ADST_ADST :
case DCT_ADST :
pth = (tx_dim == 4) ? &iadst_4[0] : &iadst_8[0];
pth = (tx_dim == 4) ? &iadst_4[0] :
((tx_dim == 8) ? &iadst_8[0] : &iadst_16[0]);
break;
default :
pth = (tx_dim == 4) ? &idct_4[0] : &idct_8[0];
pth = (tx_dim == 4) ? &idct_4[0] :
((tx_dim == 8) ? &idct_8[0] : &idct_16[0]);
break;
}
......@@ -178,11 +256,13 @@ void vp8_ihtllm_c(short *input, short *output, int pitch,
switch(tx_type) {
case ADST_ADST :
case DCT_ADST :
pth = (tx_dim == 4) ? &iadst_4[0] : &iadst_8[0];
pth = (tx_dim == 4) ? &iadst_4[0] :
((tx_dim == 8) ? &iadst_8[0] : &iadst_16[0]);
break;
default :
pth = (tx_dim == 4) ? &idct_4[0] : &idct_8[0];
pth = (tx_dim == 4) ? &idct_4[0] :
((tx_dim == 8) ? &idct_8[0] : &idct_16[0]);
break;
}
}
......@@ -692,7 +772,7 @@ void vp8_short_ihaar2x2_c(short *input, short *output, int pitch) {