diff options
author | Ronald S. Bultje <rbultje@google.com> | 2013-03-26 19:17:08 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-03-26 19:17:08 -0700 |
commit | 7c701459143f8e30f91462af30e3232fd80997f6 (patch) | |
tree | f67d7ccbcf28e45bfec2675fe5453cd745f07cfe /vp9/common | |
parent | 3c77ab4c0ff53fec33b21f8f0c55bd083697770e (diff) | |
parent | d9094d8fd381726a9306c7fc32da3103aacc1a53 (diff) | |
download | libvpx-7c701459143f8e30f91462af30e3232fd80997f6.tar libvpx-7c701459143f8e30f91462af30e3232fd80997f6.tar.gz libvpx-7c701459143f8e30f91462af30e3232fd80997f6.tar.bz2 libvpx-7c701459143f8e30f91462af30e3232fd80997f6.zip |
Merge "Add col/row-based coefficient scanning patterns for 1D 8x8/16x16 ADSTs." into experimental
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_entropy.c | 97 | ||||
-rw-r--r-- | vp9/common/vp9_entropy.h | 8 |
2 files changed, 103 insertions, 2 deletions
diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c index 1e13861db..22c2905d8 100644 --- a/vp9/common/vp9_entropy.c +++ b/vp9/common/vp9_entropy.c @@ -91,6 +91,28 @@ DECLARE_ALIGNED(64, const int, vp9_default_zig_zag1d_8x8[64]) = { 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63, }; +DECLARE_ALIGNED(16, const int, vp9_col_scan_8x8[64]) = { + 0, 8, 16, 24, 32, 40, 48, 56, + 1, 9, 17, 25, 33, 41, 49, 57, + 2, 10, 18, 26, 34, 42, 50, 58, + 3, 11, 19, 27, 35, 43, 51, 59, + 4, 12, 20, 28, 36, 44, 52, 60, + 5, 13, 21, 29, 37, 45, 53, 61, + 6, 14, 22, 30, 38, 46, 54, 62, + 7, 15, 23, 31, 39, 47, 55, 63, +}; + +DECLARE_ALIGNED(16, const int, vp9_row_scan_8x8[64]) = { + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, +}; + DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_16x16[256]) = { 0, 1, 16, 32, 17, 2, 3, 18, 33, 48, 64, 49, 34, 19, 4, 5, @@ -126,6 +148,44 @@ DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_16x16[256]) = { 237, 252, 253, 238, 223, 239, 254, 255, }; +DECLARE_ALIGNED(16, const int, vp9_col_scan_16x16[256]) = { + 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, + 1, 17, 33, 49, 65, 81, 97, 113, 129, 145, 161, 177, 193, 209, 225, 241, + 2, 18, 34, 50, 66, 82, 98, 114, 130, 146, 162, 178, 194, 210, 226, 242, + 3, 19, 35, 51, 67, 83, 99, 115, 131, 147, 163, 179, 195, 211, 227, 243, + 4, 20, 36, 52, 68, 84, 100, 116, 132, 148, 164, 180, 196, 212, 228, 244, + 5, 21, 37, 53, 69, 85, 101, 117, 133, 149, 165, 181, 197, 213, 229, 245, + 6, 22, 38, 54, 70, 86, 102, 118, 134, 150, 166, 182, 198, 214, 230, 246, + 7, 23, 39, 55, 71, 87, 103, 119, 135, 151, 167, 183, 199, 215, 231, 247, + 8, 24, 40, 56, 72, 88, 104, 120, 136, 152, 168, 184, 200, 216, 232, 248, + 9, 25, 41, 57, 73, 89, 105, 121, 137, 153, 169, 185, 201, 217, 233, 249, + 10, 26, 42, 58, 74, 90, 106, 122, 138, 154, 170, 186, 202, 218, 234, 250, + 11, 27, 43, 59, 75, 91, 107, 123, 139, 155, 171, 187, 203, 219, 235, 251, + 12, 28, 44, 60, 76, 92, 108, 124, 140, 156, 172, 188, 204, 220, 236, 252, + 13, 29, 45, 61, 77, 93, 109, 125, 141, 157, 173, 189, 205, 221, 237, 253, + 14, 30, 46, 62, 78, 94, 110, 126, 142, 158, 174, 190, 206, 222, 238, 254, + 15, 31, 47, 63, 79, 95, 111, 127, 143, 159, 175, 191, 207, 223, 239, 255, +}; + +DECLARE_ALIGNED(16, const int, vp9_row_scan_16x16[256]) = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, +}; + DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_32x32[1024]) = { 0, 1, 32, 64, 33, 2, 3, 34, 65, 96, 128, 97, 66, 35, 4, 5, 36, 67, 98, 129, 160, 192, 161, 130, 99, 68, 37, 6, 7, 38, 69, 100, 131, 162, 193, 224, 256, 225, 194, 163, 132, 101, 70, 39, 8, 9, 40, 71, 102, 133, 164, 195, 226, 257, 288, 320, 289, 258, 227, 196, 165, 134, 103, 72, @@ -2080,8 +2140,16 @@ DECLARE_ALIGNED(16, int, DECLARE_ALIGNED(16, int, vp9_row_scan_4x4_neighbors[16 * MAX_NEIGHBORS]); DECLARE_ALIGNED(16, int, + vp9_col_scan_8x8_neighbors[64 * MAX_NEIGHBORS]); +DECLARE_ALIGNED(16, int, + vp9_row_scan_8x8_neighbors[64 * MAX_NEIGHBORS]); +DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_8x8_neighbors[64 * MAX_NEIGHBORS]); DECLARE_ALIGNED(16, int, + vp9_col_scan_16x16_neighbors[256 * MAX_NEIGHBORS]); +DECLARE_ALIGNED(16, int, + vp9_row_scan_16x16_neighbors[256 * MAX_NEIGHBORS]); +DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_16x16_neighbors[256 * MAX_NEIGHBORS]); DECLARE_ALIGNED(16, int, vp9_default_zig_zag1d_32x32_neighbors[1024 * MAX_NEIGHBORS]); @@ -2117,8 +2185,13 @@ static void init_scan_neighbors(const int *scan, int l, int *neighbors, // use the combination of the two as a context. int a = find_in_scan(scan, l, (i - 1) * l + j); int b = find_in_scan(scan, l, i * l + j - 1); - if (scan == vp9_col_scan_4x4 || scan == vp9_row_scan_4x4) { - neighbors[max_neighbors * n + 0] = MAX(a, b); + if (scan == vp9_col_scan_4x4 || scan == vp9_col_scan_8x8 || + scan == vp9_col_scan_16x16) { + neighbors[max_neighbors * n + 0] = a; + neighbors[max_neighbors * n + 1] = -1; + } else if (scan == vp9_row_scan_4x4 || scan == vp9_row_scan_8x8 || + scan == vp9_row_scan_16x16) { + neighbors[max_neighbors * n + 0] = b; neighbors[max_neighbors * n + 1] = -1; } else { neighbors[max_neighbors * n + 0] = a; @@ -2149,8 +2222,16 @@ void vp9_init_neighbors() { vp9_col_scan_4x4_neighbors, MAX_NEIGHBORS); init_scan_neighbors(vp9_default_zig_zag1d_8x8, 8, vp9_default_zig_zag1d_8x8_neighbors, MAX_NEIGHBORS); + init_scan_neighbors(vp9_row_scan_8x8, 8, + vp9_row_scan_8x8_neighbors, MAX_NEIGHBORS); + init_scan_neighbors(vp9_col_scan_8x8, 8, + vp9_col_scan_8x8_neighbors, MAX_NEIGHBORS); init_scan_neighbors(vp9_default_zig_zag1d_16x16, 16, vp9_default_zig_zag1d_16x16_neighbors, MAX_NEIGHBORS); + init_scan_neighbors(vp9_row_scan_16x16, 16, + vp9_row_scan_16x16_neighbors, MAX_NEIGHBORS); + init_scan_neighbors(vp9_col_scan_16x16, 16, + vp9_col_scan_16x16_neighbors, MAX_NEIGHBORS); init_scan_neighbors(vp9_default_zig_zag1d_32x32, 32, vp9_default_zig_zag1d_32x32_neighbors, MAX_NEIGHBORS); } @@ -2168,9 +2249,21 @@ const int *vp9_get_coef_neighbors_handle(const int *scan, int *pad) { } else if (scan == vp9_default_zig_zag1d_8x8) { *pad = MAX_NEIGHBORS; return vp9_default_zig_zag1d_8x8_neighbors; + } else if (scan == vp9_row_scan_8x8) { + *pad = 2; + return vp9_row_scan_8x8_neighbors; + } else if (scan == vp9_col_scan_8x8) { + *pad = 2; + return vp9_col_scan_8x8_neighbors; } else if (scan == vp9_default_zig_zag1d_16x16) { *pad = MAX_NEIGHBORS; return vp9_default_zig_zag1d_16x16_neighbors; + } else if (scan == vp9_row_scan_16x16) { + *pad = 2; + return vp9_row_scan_16x16_neighbors; + } else if (scan == vp9_col_scan_16x16) { + *pad = 2; + return vp9_col_scan_16x16_neighbors; } else if (scan == vp9_default_zig_zag1d_32x32) { *pad = MAX_NEIGHBORS; return vp9_default_zig_zag1d_32x32_neighbors; diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h index ec8cb72e1..64f595047 100644 --- a/vp9/common/vp9_entropy.h +++ b/vp9/common/vp9_entropy.h @@ -102,7 +102,15 @@ extern DECLARE_ALIGNED(16, const int, vp9_col_scan_4x4[16]); extern DECLARE_ALIGNED(16, const int, vp9_row_scan_4x4[16]); extern DECLARE_ALIGNED(64, const int, vp9_default_zig_zag1d_8x8[64]); + +extern DECLARE_ALIGNED(16, const int, vp9_col_scan_8x8[64]); +extern DECLARE_ALIGNED(16, const int, vp9_row_scan_8x8[64]); + extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_16x16[256]); + +extern DECLARE_ALIGNED(16, const int, vp9_col_scan_16x16[256]); +extern DECLARE_ALIGNED(16, const int, vp9_row_scan_16x16[256]); + extern DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_32x32[1024]); void vp9_coef_tree_initialize(void); |