OLD | NEW |
1 // Copyright 2011 Google Inc. | 1 // Copyright 2011 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // This code is licensed under the same terms as WebM: | 3 // This code is licensed under the same terms as WebM: |
4 // Software License Agreement: http://www.webmproject.org/license/software/ | 4 // Software License Agreement: http://www.webmproject.org/license/software/ |
5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ | 5 // Additional IP Rights Grant: http://www.webmproject.org/license/additional/ |
6 // ----------------------------------------------------------------------------- | 6 // ----------------------------------------------------------------------------- |
7 // | 7 // |
8 // Cost tables for level and modes | 8 // Cost tables for level and modes |
9 // | 9 // |
10 // Author: Skal (pascal.massimino@gmail.com) | 10 // Author: Skal (pascal.massimino@gmail.com) |
11 | 11 |
12 #include <assert.h> | 12 #include "./cost.h" |
13 | |
14 #include "cost.h" | |
15 | 13 |
16 #if defined(__cplusplus) || defined(c_plusplus) | 14 #if defined(__cplusplus) || defined(c_plusplus) |
17 extern "C" { | 15 extern "C" { |
18 #endif | 16 #endif |
19 | 17 |
20 //------------------------------------------------------------------------------ | 18 //------------------------------------------------------------------------------ |
21 // Boolean-cost cost table | 19 // Boolean-cost cost table |
22 | 20 |
23 const uint16_t VP8EntropyCost[256] = { | 21 const uint16_t VP8EntropyCost[256] = { |
24 1792, 1792, 1792, 1536, 1536, 1408, 1366, 1280, 1280, 1216, | 22 1792, 1792, 1792, 1536, 1536, 1408, 1366, 1280, 1280, 1216, |
(...skipping 20 matching lines...) Expand all Loading... |
45 74, 73, 71, 69, 67, 66, 64, 63, 61, 59, | 43 74, 73, 71, 69, 67, 66, 64, 63, 61, 59, |
46 57, 55, 54, 52, 51, 49, 47, 46, 44, 43, | 44 57, 55, 54, 52, 51, 49, 47, 46, 44, 43, |
47 41, 40, 38, 36, 35, 33, 32, 30, 29, 27, | 45 41, 40, 38, 36, 35, 33, 32, 30, 29, 27, |
48 25, 24, 22, 21, 19, 18, 16, 15, 13, 12, | 46 25, 24, 22, 21, 19, 18, 16, 15, 13, 12, |
49 10, 9, 7, 6, 4, 3 | 47 10, 9, 7, 6, 4, 3 |
50 }; | 48 }; |
51 | 49 |
52 //------------------------------------------------------------------------------ | 50 //------------------------------------------------------------------------------ |
53 // Level cost tables | 51 // Level cost tables |
54 | 52 |
55 // For each given level, the following table given the pattern of contexts | 53 // For each given level, the following table gives the pattern of contexts to |
56 // to use for coding it (in [][0]) as well as the bit value to use for | 54 // use for coding it (in [][0]) as well as the bit value to use for each |
57 // each context (in [][1]). | 55 // context (in [][1]). |
58 const uint16_t VP8LevelCodes[MAX_VARIABLE_LEVEL][2] = { | 56 const uint16_t VP8LevelCodes[MAX_VARIABLE_LEVEL][2] = { |
59 {0x001, 0x000}, {0x007, 0x001}, {0x00f, 0x005}, | 57 {0x001, 0x000}, {0x007, 0x001}, {0x00f, 0x005}, |
60 {0x00f, 0x00d}, {0x033, 0x003}, {0x033, 0x003}, {0x033, 0x023}, | 58 {0x00f, 0x00d}, {0x033, 0x003}, {0x033, 0x003}, {0x033, 0x023}, |
61 {0x033, 0x023}, {0x033, 0x023}, {0x033, 0x023}, {0x0d3, 0x013}, | 59 {0x033, 0x023}, {0x033, 0x023}, {0x033, 0x023}, {0x0d3, 0x013}, |
62 {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, | 60 {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, |
63 {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x093}, | 61 {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x013}, {0x0d3, 0x093}, |
64 {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, | 62 {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, |
65 {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, | 63 {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, |
66 {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, | 64 {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, |
67 {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x153, 0x053}, | 65 {0x0d3, 0x093}, {0x0d3, 0x093}, {0x0d3, 0x093}, {0x153, 0x053}, |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 { 439, 1139, 1101, 1257, 3710, 1922, 1205, 1040, 1931, 1529 }, | 481 { 439, 1139, 1101, 1257, 3710, 1922, 1205, 1040, 1931, 1529 }, |
484 { 979, 935, 1269, 847, 1202, 1286, 1530, 1535, 827, 1036 }, | 482 { 979, 935, 1269, 847, 1202, 1286, 1530, 1535, 827, 1036 }, |
485 { 516, 1378, 1569, 1110, 1798, 1798, 1198, 2199, 1543, 712 } }, | 483 { 516, 1378, 1569, 1110, 1798, 1798, 1198, 2199, 1543, 712 } }, |
486 }; | 484 }; |
487 | 485 |
488 //------------------------------------------------------------------------------ | 486 //------------------------------------------------------------------------------ |
489 | 487 |
490 #if defined(__cplusplus) || defined(c_plusplus) | 488 #if defined(__cplusplus) || defined(c_plusplus) |
491 } // extern "C" | 489 } // extern "C" |
492 #endif | 490 #endif |
OLD | NEW |