Commit fed8a183 authored by Daniel Kang's avatar Daniel Kang

16x16 DCT blocks.

Set on all 16x16 intra/inter modes

Features:
- Butterfly fDCT/iDCT
- Loop filter does not filter internal edges with 16x16
- Optimize coefficient function
- Update coefficient probability function
- RD
- Entropy stats
- 16x16 is a config option

Have not tested with experiments.

hd:     2.60%
std-hd: 2.43%
yt:     1.32%
derf:   0.60%

Change-Id: I96fb090517c30c5da84bad4fae602c3ec0c58b1c
parent 2914ab2e
......@@ -227,6 +227,7 @@ EXPERIMENT_LIST="
hybridtransform
switchable_interp
htrans8x8
tx16x16
"
CONFIG_LIST="
external_build
......
This diff is collapsed.
......@@ -115,8 +115,8 @@ TEST(VP8Fdct8x8Test, RoundTripErrorCheck) {
EXPECT_GE(1, max_error)
<< "Error: 8x8 FDCT/IDCT has an individual roundtrip error > 1";
EXPECT_GE(count_test_block, total_error)
<< "Error: 8x8 FDCT/IDCT has average roundtrip error > 1 per block";
EXPECT_GE(count_test_block/5, total_error)
<< "Error: 8x8 FDCT/IDCT has average roundtrip error > 1/5 per block";
};
TEST(VP8Fdct8x8Test, ExtremalCheck) {
......@@ -149,9 +149,9 @@ TEST(VP8Fdct8x8Test, ExtremalCheck) {
<< "Error: Extremal 8x8 FDCT/IDCT has an"
<< " individual roundtrip error > 1";
EXPECT_GE(count_test_block, total_error)
EXPECT_GE(count_test_block/5, total_error)
<< "Error: Extremal 8x8 FDCT/IDCT has average"
<< " roundtrip error > 1 per block";
<< " roundtrip error > 1/5 per block";
}
};
......
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
extern "C" {
#include "vp8/encoder/dct.h"
#include "vp8/common/idct.h"
}
#include "acm_random.h"
#include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom;
namespace {
void reference_dct_1d(double input[8], double output[8]) {
const double kPi = 3.141592653589793238462643383279502884;
const double kInvSqrt2 = 0.707106781186547524400844362104;
for (int k = 0; k < 8; k++) {
output[k] = 0.0;
for (int n = 0; n < 8; n++)
output[k] += input[n]*cos(kPi*(2*n+1)*k/16.0);
if (k == 0)
output[k] = output[k]*kInvSqrt2;
}
}
void reference_dct_2d(int16_t input[64], double output[64]) {
// First transform columns
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = input[j*8 + i];
reference_dct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j)
output[j*8 + i] = temp_out[j];
}
// Then transform rows
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = output[j + i*8];
reference_dct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j)
output[j + i*8] = temp_out[j];
}
// Scale by some magic number
for (int i = 0; i < 64; ++i)
output[i] *= 2;
}
void reference_idct_1d(double input[8], double output[8]) {
const double kPi = 3.141592653589793238462643383279502884;
const double kSqrt2 = 1.414213562373095048801688724209698;
for (int k = 0; k < 8; k++) {
output[k] = 0.0;
for (int n = 0; n < 8; n++) {
output[k] += input[n]*cos(kPi*(2*k+1)*n/16.0);
if (n == 0)
output[k] = output[k]/kSqrt2;
}
}
}
void reference_idct_2d(double input[64], int16_t output[64]) {
double out[64], out2[64];
// First transform rows
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = input[j + i*8];
reference_idct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j)
out[j + i*8] = temp_out[j];
}
// Then transform columns
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = out[j*8 + i];
reference_idct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j)
out2[j*8 + i] = temp_out[j];
}
for (int i = 0; i < 64; ++i)
output[i] = round(out2[i]/32);
}
TEST(VP8Idct8x8Test, AccuracyCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 10000;
for (int i = 0; i < count_test_block; ++i) {
int16_t input[64], coeff[64];
int16_t output_c[64];
double output_r[64];
// Initialize a test block with input range [-255, 255].
for (int j = 0; j < 64; ++j)
input[j] = rnd.Rand8() - rnd.Rand8();
const int pitch = 16;
vp8_short_fdct8x8_c(input, output_c, pitch);
reference_dct_2d(input, output_r);
for (int j = 0; j < 64; ++j) {
const double diff = output_c[j] - output_r[j];
const double error = diff * diff;
// An error in a DCT coefficient isn't that bad.
// We care more about the reconstructed pixels.
EXPECT_GE(2.0, error)
<< "Error: 8x8 FDCT/IDCT has error " << error
<< " at index " << j;
}
#if 0
// Tests that the reference iDCT and fDCT match.
reference_dct_2d(input, output_r);
reference_idct_2d(output_r, output_c);
for (int j = 0; j < 64; ++j) {
const int diff = output_c[j] -input[j];
const int error = diff * diff;
EXPECT_EQ(0, error)
<< "Error: 8x8 FDCT/IDCT has error " << error
<< " at index " << j;
}
#endif
reference_dct_2d(input, output_r);
for (int j = 0; j < 64; ++j)
coeff[j] = round(output_r[j]);
vp8_short_idct8x8_c(coeff, output_c, pitch);
for (int j = 0; j < 64; ++j) {
const int diff = output_c[j] -input[j];
const int error = diff * diff;
EXPECT_GE(1, error)
<< "Error: 8x8 FDCT/IDCT has error " << error
<< " at index " << j;
}
}
}
} // namespace
LIBVPX_TEST_SRCS-yes += test.mk
LIBVPX_TEST_SRCS-yes += acm_random.h
LIBVPX_TEST_SRCS-yes += boolcoder_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_TX16X16) += dct16x16_test.cc
LIBVPX_TEST_SRCS-yes += fdct4x4_test.cc
LIBVPX_TEST_SRCS-yes += fdct8x8_test.cc
LIBVPX_TEST_SRCS-yes += idct8x8_test.cc
LIBVPX_TEST_SRCS-yes += test_libvpx.cc
LIBVPX_TEST_DATA-yes += hantro_collage_w352h288.yuv
......@@ -218,7 +218,4 @@ void vp8_initialize_common() {
vp8_entropy_mode_init();
vp8_entropy_mv_init();
vp8_init_scan_order_mask();
}
......@@ -131,11 +131,12 @@ typedef enum {
// Segment level features.
typedef enum {
TX_4X4 = 0, // 4x4 dct transform
TX_8X8 = 1, // 8x8 dct transform
TX_SIZE_MAX = 2 // Number of differnt transforms avaialble
TX_4X4, // 4x4 dct transform
TX_8X8, // 8x8 dct transform
#if CONFIG_TX16X16
TX_16X16, // 16x16 dct transform
#endif
TX_SIZE_MAX // Number of different transforms available
} TX_SIZE;
#if CONFIG_HYBRIDTRANSFORM
......
......@@ -13,4 +13,7 @@
Generated file included by entropy.c */
#define COEF_UPDATE_PROB 252
#define COEF_UPDATE_PROB_8X8 252
#if CONFIG_TX16X16
#define COEF_UPDATE_PROB_16X16 252
#endif
......@@ -488,3 +488,211 @@ vp8_default_coef_probs_8x8[BLOCK_TYPES_8X8]
}
#endif
};
#if CONFIG_TX16X16
static const vp8_prob
vp8_default_coef_probs_16x16[BLOCK_TYPES_16X16]
[COEF_BANDS]
[PREV_COEF_CONTEXTS]
[ENTROPY_NODES] =
{
{ /* block Type 0 */
{ /* Coeff Band 0 */
{ 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 1 */
{ 60, 140, 195, 255, 212, 214, 128, 128, 128, 128, 128},
{ 75, 221, 231, 255, 203, 255, 128, 128, 128, 128, 128},
{ 9, 212, 196, 251, 197, 207, 255, 185, 128, 128, 128},
{ 9, 212, 196, 251, 197, 207, 255, 185, 128, 128, 128}
},
{ /* Coeff Band 2 */
{ 1, 227, 226, 255, 215, 215, 128, 128, 128, 128, 128},
{ 5, 163, 209, 255, 212, 212, 255, 255, 128, 128, 128},
{ 1, 133, 203, 255, 210, 220, 255, 255, 128, 128, 128},
{ 1, 133, 203, 255, 210, 220, 255, 255, 128, 128, 128}
},
{ /* Coeff Band 3 */
{ 1, 226, 225, 255, 228, 236, 128, 128, 128, 128, 128},
{ 6, 163, 208, 255, 224, 234, 255, 255, 128, 128, 128},
{ 1, 122, 196, 253, 212, 248, 255, 255, 128, 128, 128},
{ 1, 122, 196, 253, 212, 248, 255, 255, 128, 128, 128}
},
{ /* Coeff Band 4 */
{ 1, 222, 197, 254, 193, 216, 255, 236, 128, 128, 128},
{ 7, 140, 163, 251, 195, 211, 255, 238, 128, 128, 128},
{ 1, 91, 152, 249, 181, 197, 255, 239, 128, 128, 128},
{ 1, 91, 152, 249, 181, 197, 255, 239, 128, 128, 128}
},
{ /* Coeff Band 5 */
{ 1, 226, 218, 255, 216, 241, 255, 255, 128, 128, 128},
{ 6, 154, 191, 255, 218, 240, 255, 255, 128, 128, 128},
{ 1, 110, 171, 252, 191, 204, 255, 236, 128, 128, 128},
{ 1, 110, 171, 252, 191, 204, 255, 236, 128, 128, 128}
},
{ /* Coeff Band 6 */
{ 1, 221, 217, 255, 208, 217, 255, 232, 128, 128, 128},
{ 11, 155, 189, 254, 203, 211, 255, 249, 128, 128, 128},
{ 1, 110, 171, 252, 191, 204, 255, 236, 128, 128, 128},
{ 1, 110, 171, 252, 191, 204, 255, 236, 128, 128, 128}
},
{ /* Coeff Band 7 */
{ 1, 207, 235, 255, 232, 240, 128, 128, 128, 128, 128},
{ 58, 161, 216, 255, 229, 235, 255, 255, 128, 128, 128},
{ 8, 133, 204, 255, 219, 231, 255, 255, 128, 128, 128},
{ 8, 133, 204, 255, 219, 231, 255, 255, 128, 128, 128}
}
},
{ /* 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}
}
},
{ /* 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}
}
},
{ /* block Type 3 */
{ /* Coeff Band 0 */
{ 17, 105, 227, 195, 164, 170, 168, 137, 221, 160, 184},
{ 6, 92, 166, 193, 158, 169, 179, 142, 236, 175, 200},
{ 2, 68, 118, 193, 147, 168, 187, 149, 241, 178, 247},
{ 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}
},
{ /* Coeff Band 1 */
{ 1, 193, 221, 246, 198, 194, 244, 176, 255, 192, 128},
{ 112, 160, 209, 244, 196, 194, 243, 175, 255, 209, 128},
{ 45, 123, 175, 240, 184, 195, 239, 178, 255, 218, 255},
{ 16, 53, 75, 169, 119, 152, 209, 146, 255, 219, 255}
},
{ /* Coeff Band 2 */
{ 1, 141, 183, 240, 176, 187, 246, 198, 255, 218, 128},
{ 36, 97, 150, 231, 161, 180, 243, 191, 255, 217, 255},
{ 8, 65, 111, 210, 143, 166, 230, 167, 255, 224, 255},
{ 2, 35, 61, 157, 113, 149, 208, 142, 255, 217, 255}
},
{ /* Coeff Band 3 */
{ 1, 173, 196, 245, 184, 191, 252, 211, 255, 240, 128},
{ 35, 119, 175, 242, 177, 187, 252, 209, 255, 235, 128},
{ 4, 88, 141, 234, 161, 180, 249, 200, 255, 228, 128},
{ 1, 57, 95, 203, 133, 161, 235, 167, 255, 231, 255}
},
{ /* Coeff Band 4 */
{ 1, 208, 227, 249, 209, 204, 248, 188, 255, 248, 128},
{ 28, 162, 211, 247, 203, 200, 252, 188, 255, 232, 128},
{ 5, 114, 174, 238, 182, 189, 245, 184, 255, 238, 128},
{ 1, 61, 100, 205, 136, 164, 235, 163, 255, 239, 128}
},
{ /* Coeff Band 5 */
{ 1, 195, 218, 252, 208, 207, 250, 205, 255, 245, 128},
{ 22, 141, 196, 249, 198, 201, 250, 202, 255, 244, 128},
{ 2, 105, 163, 240, 178, 189, 246, 191, 255, 246, 128},
{ 1, 70, 112, 206, 144, 167, 232, 162, 255, 239, 128}
},
{ /* Coeff Band 6 */
{ 1, 204, 215, 251, 204, 203, 255, 222, 255, 225, 128},
{ 15, 140, 194, 249, 194, 199, 254, 221, 255, 253, 128},
{ 1, 95, 153, 243, 172, 188, 254, 213, 255, 248, 128},
{ 1, 59, 99, 216, 135, 166, 247, 190, 255, 237, 255}
},
{ /* Coeff Band 7 */
{ 1, 7, 231, 255, 227, 223, 255, 240, 255, 255, 128},
{ 15, 157, 217, 255, 218, 219, 255, 239, 255, 255, 128},
{ 1, 114, 182, 252, 198, 207, 255, 235, 255, 255, 128},
{ 1, 71, 122, 238, 154, 181, 255, 216, 255, 255, 128}
}
}
};
#endif
</
......@@ -47,7 +47,7 @@ DECLARE_ALIGNED(16, const unsigned char, vp8_norm[256]) = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
DECLARE_ALIGNED(16, cuchar, vp8_coef_bands[16]) = {
DECLARE_ALIGNED(16, const int, vp8_coef_bands[16]) = {
0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7
};
......@@ -79,15 +79,15 @@ DECLARE_ALIGNED(16, const int, vp8_row_scan[16]) = {
#endif
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_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,
......@@ -95,9 +95,46 @@ 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
// 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,
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,
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, 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, 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, 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,
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, 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, 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(16, const int, vp8_default_zig_zag1d_16x16[256]) = {
0, 1, 16, 32, 17, 2, 3, 18, 33, 48, 64, 49, 34, 19, 4, 5,
20, 35, 50, 65, 80, 96, 81, 66, 51, 36, 21, 6, 7, 22, 37, 52,
67, 82, 97, 112, 128, 113, 98, 83, 68, 53, 38, 23, 8, 9, 24, 39,
54, 69, 84, 99, 114, 129, 144, 160, 145, 130, 115, 100, 85, 70, 55, 40,
25, 10, 11, 26, 41, 56, 71, 86, 101, 116, 131, 146, 161, 176, 192, 177,
162, 147, 132, 117, 102, 87, 72, 57, 42, 27, 12, 13, 28, 43, 58, 73,
88, 103, 118, 133, 148, 163, 178, 193, 208, 224, 209, 194, 179, 164, 149, 134,
119, 104, 89, 74, 59, 44, 29, 14, 15, 30, 45, 60, 75, 90, 105, 120,
135, 150, 165, 180, 195, 210, 225, 240, 241, 226, 211, 196, 181, 166, 151, 136,
121, 106, 91, 76, 61, 46, 31, 47, 62, 77, 92, 107, 122, 137, 152, 167,
182, 197, 212, 227, 242, 243, 228, 213, 198, 183, 168, 153, 138, 123, 108, 93,
78, 63, 79, 94, 109, 124, 139, 154, 169, 184, 199, 214, 229, 244, 245, 230,
215, 200, 185, 170, 155, 140, 125, 110, 95, 111, 126, 141, 156, 171, 186, 201,
216, 231, 246, 247, 232, 217, 202, 187, 172, 157, 142, 127, 143, 158, 173, 188,
203, 218, 233, 248, 249, 234, 219, 204, 189, 174, 159, 175, 190, 205, 220, 235,
250, 251, 236, 221, 206, 191, 207, 222, 237, 252, 253, 238, 223, 239, 254, 255,
};
#endif
DECLARE_ALIGNED(16, short, vp8_default_zig_zag_mask[16]);
DECLARE_ALIGNED(64, short, vp8_default_zig_zag_mask_8x8[64]);// int64_t
/* Array indices are identical to previously-existing CONTEXT_NODE indices */
......@@ -131,17 +168,6 @@ static const Prob Pcat6[] =
static vp8_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[26];
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;
}
for (i = 0; i < 64; i++) {
vp8_default_zig_zag_mask_8x8[vp8_default_zig_zag1d_8x8[i]] = 1 << i;
}
}
static void init_bit_tree(vp8_tree_index *p, int n) {
int i = 0;
......@@ -181,11 +207,15 @@ vp8_extra_bit_struct vp8_extra_bits[12] = {
void vp8_default_coef_probs(VP8_COMMON *pc) {
vpx_memcpy(pc->fc.coef_probs, default_coef_probs,
sizeof(default_coef_probs));
sizeof(pc->fc.coef_probs));
vpx_memcpy(pc->fc.coef_probs_8x8, vp8_default_coef_probs_8x8,
sizeof(vp8_default_coef_probs_8x8));
sizeof(pc->fc.coef_probs_8x8));
#if CONFIG_TX16X16
vpx_memcpy(pc->fc.coef_probs_16x16, vp8_default_coef_probs_16x16,
sizeof(pc->fc.coef_probs_16x16));
#endif
}
void vp8_coef_tree_initialize() {
......@@ -304,4 +334,27 @@ void vp8_adapt_coef_probs(VP8_COMMON *cm) {
else cm->fc.coef_probs_8x8[i][j][k][t] = prob;
}
}
#if CONFIG_TX16X16
for (i = 0; i < BLOCK_TYPES_16X16; ++i)
for (j = 0; j < COEF_BANDS; ++j)
for (k = 0; k < PREV_COEF_CONTEXTS; ++k) {