]> granicus.if.org Git - libvpx/commitdiff
Modeling default coef probs with distribution
authorDeb Mukherjee <debargha@google.com>
Wed, 13 Mar 2013 18:03:17 +0000 (11:03 -0700)
committerDeb Mukherjee <debargha@google.com>
Tue, 26 Mar 2013 06:43:38 +0000 (23:43 -0700)
Replaces the default tables for single coefficient magnitudes with
those obtained from an appropriate distribution. The EOB node
is left unchanged. The model is represeted as a 256-size codebook
where the index corresponds to the probability of the Zero or the
One node. Two variations are implemented corresponding to whether
the Zero node or the One-node is used as the peg. The main advantage
is that the default prob tables will become considerably smaller and
manageable. Besides there is substantially less risk of over-fitting
for a training set.

Various distributions are tried and the one that gives the best
results is the family of Generalized Gaussian distributions with
shape parameter 0.75. The results are within about 0.2% of fully
trained tables for the Zero peg variant, and within 0.1% of the
One peg variant.

The forward updates are optionally (controlled by a macro)
model-based, i.e. restricted to only convey probabilities from the
codebook. Backward updates can also be optionally (controlled by
another macro) model-based, but is turned off by default. Currently
model-based forward updates work about the same as unconstrained
updates, but there is a drop in performance with backward-updates
being model based.

The model based approach also allows the probabilities for the key
frames to be adjusted from the defaults based on the base_qindex of
the frame. Currently the adjustment function is a placeholder that
adjusts the prob of EOB and Zero node from the nominal one at higher
quality (lower qindex) or lower quality (higher qindex) ends of the
range. The rest of the probabilities are then derived based on the
model from the adjusted prob of zero.

Change-Id: Iae050f3cbcc6d8b3f204e8dc395ae47b3b2192c9

configure
vp9/common/vp9_coefupdateprobs.h
vp9/common/vp9_default_coef_probs.h
vp9/common/vp9_entropy.c
vp9/common/vp9_entropy.h
vp9/decoder/vp9_decodframe.c
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_quantize.c

index 35801e2004eac082dbc4f1b783792becc5a049f7..519707919be910504b7e56873bc979d984c979c1 100755 (executable)
--- a/configure
+++ b/configure
@@ -247,6 +247,7 @@ EXPERIMENT_LIST="
     abovesprefmv
     code_nonzerocount
     useselectrefmv
+    modelcoefprob
 "
 CONFIG_LIST="
     external_build
index 6d8ed67605aacfc642370181603410de832ee536..b4d892df9afd5b2fb63a5dbde657ac1a782d49b2 100644 (file)
 
 /* Update probabilities for the nodes in the token entropy tree.
    Generated file included by vp9_entropy.c */
-#define COEF_UPDATE_PROB 252
-#define COEF_UPDATE_PROB_8X8 252
-#define COEF_UPDATE_PROB_16X16 252
+
+static const vp9_prob vp9_coef_update_prob[ENTROPY_NODES] = {
+  252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252
+};
 
 #if CONFIG_CODE_NONZEROCOUNT
 #define NZC_UPDATE_PROB_4X4     252
@@ -25,4 +26,8 @@
 #define NZC_UPDATE_PROB_PCAT    252
 #endif
 
+#if CONFIG_MODELCOEFPROB
+#define COEF_MODEL_UPDATE_PROB   16
+#endif
+
 #endif  // VP9_COMMON_VP9_COEFUPDATEPROBS_H__
index 6b1eff08c0663dc8d8befd591e7843df3ae5ca20..455fb8ccc89f2e67d74d161cfae249c9ffa8146a 100644 (file)
 
 /*Generated file, included by vp9_entropy.c*/
 
+// NOTE: When the CONFIG_MODELCOEFPROB experiment is on, only the first
+// 2 or 3 from each row is actually used depending on whether
+// UNCONSTRAINDED_NODES is 2 or 3. If this experiment is merged
+// the tables below should be shortened accordingly.
 static const vp9_coeff_probs default_coef_probs_4x4[BLOCK_TYPES] = {
   { /* block Type 0 */
     { /* Intra */
index 7c902d8c44c4c7c31bf7bf225341f617e286e30f..8d9d4a525061f46ca99ad44465799df6cfcf3fe9 100644 (file)
@@ -245,6 +245,1602 @@ const int vp9_basenzcvalue[NZC32X32_TOKENS] = {
 
 #endif  // CONFIG_CODE_NONZEROCOUNT
 
+#if CONFIG_MODELCOEFPROB
+
+const vp9_prob vp9_modelcoefprobs_gg875[COEFPROB_MODELS][ENTROPY_NODES - 1] = {
+  // Probs generated with a Generalized Gaussian (with shape parameter 0.875)
+  // source model with varying quantizer step size for a uniform quantizer
+  {0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},  // do not use
+  {1,   2,   6,  86, 129,  11,  87,  42,  92,  52,},
+  {2,   4,  12,  87, 129,  22,  89,  75,  97,  91,},
+  {3,   6,  17,  88, 130,  32,  90, 102, 102, 121,},
+  {4,   8,  22,  89, 131,  41,  91, 125, 107, 145,},
+  {5,  10,  28,  90, 131,  50,  93, 144, 112, 164,},
+  {6,  12,  33,  90, 132,  59,  94, 160, 117, 180,},
+  {7,  14,  38,  91, 132,  67,  95, 173, 122, 193,},
+  {8,  15,  42,  92, 133,  75,  97, 185, 126, 204,},
+  {9,  17,  47,  92, 133,  82,  98, 195, 131, 212,},
+  {10,  19,  52,  93, 134,  89,  99, 203, 135, 220,},
+  {11,  21,  56,  94, 134,  96, 101, 211, 140, 226,},
+  {12,  23,  60,  95, 135, 102, 102, 217, 144, 231,},
+  {13,  25,  65,  95, 135, 109, 103, 222, 148, 235,},
+  {14,  26,  69,  96, 136, 115, 105, 227, 153, 238,},
+  {15,  28,  73,  97, 136, 120, 106, 231, 157, 241,},
+  {16,  30,  77,  97, 137, 126, 107, 234, 161, 244,},
+  {17,  32,  81,  98, 138, 131, 108, 237, 164, 246,},
+  {18,  34,  85,  99, 138, 136, 110, 240, 168, 247,},
+  {19,  35,  89, 100, 139, 141, 111, 242, 172, 249,},
+  {20,  37,  92, 100, 139, 145, 112, 244, 175, 250,},
+  {21,  39,  96, 101, 140, 150, 113, 246, 179, 251,},
+  {22,  41,  99, 102, 140, 154, 115, 247, 182, 252,},
+  {23,  42, 103, 102, 141, 158, 116, 248, 185, 252,},
+  {24,  44, 106, 103, 141, 162, 117, 249, 188, 253,},
+  {25,  46, 110, 104, 142, 166, 118, 250, 191, 253,},
+  {26,  48, 113, 104, 142, 170, 120, 251, 194, 254,},
+  {27,  49, 116, 105, 143, 173, 121, 252, 197, 254,},
+  {28,  51, 119, 106, 143, 176, 122, 252, 200, 254,},
+  {29,  53, 122, 107, 144, 180, 123, 253, 202, 255,},
+  {30,  54, 125, 107, 144, 183, 125, 253, 205, 255,},
+  {31,  56, 128, 108, 145, 186, 126, 254, 207, 255,},
+  {32,  58, 131, 109, 145, 189, 127, 254, 209, 255,},
+  {33,  59, 134, 109, 146, 191, 128, 254, 212, 255,},
+  {34,  61, 137, 110, 146, 194, 130, 254, 214, 255,},
+  {35,  62, 139, 111, 147, 196, 131, 255, 216, 255,},
+  {36,  64, 142, 112, 147, 199, 132, 255, 218, 255,},
+  {37,  66, 145, 112, 148, 201, 134, 255, 220, 255,},
+  {38,  67, 147, 113, 148, 203, 135, 255, 221, 255,},
+  {39,  69, 150, 114, 149, 206, 136, 255, 223, 255,},
+  {40,  70, 152, 114, 149, 208, 137, 255, 225, 255,},
+  {41,  72, 155, 115, 150, 210, 138, 255, 226, 255,},
+  {42,  74, 157, 116, 150, 212, 140, 255, 228, 255,},
+  {43,  75, 159, 117, 151, 213, 141, 255, 229, 255,},
+  {44,  77, 161, 117, 151, 215, 142, 255, 230, 255,},
+  {45,  78, 164, 118, 152, 217, 143, 255, 232, 255,},
+  {46,  80, 166, 119, 152, 219, 145, 255, 233, 255,},
+  {47,  81, 168, 120, 153, 220, 146, 255, 234, 255,},
+  {48,  83, 170, 120, 153, 222, 147, 255, 235, 255,},
+  {49,  84, 172, 121, 154, 223, 148, 255, 236, 255,},
+  {50,  86, 174, 122, 154, 225, 150, 255, 237, 255,},
+  {51,  87, 176, 123, 155, 226, 151, 255, 238, 255,},
+  {52,  89, 178, 123, 155, 227, 152, 255, 239, 255,},
+  {53,  90, 180, 124, 156, 228, 153, 255, 240, 255,},
+  {54,  92, 182, 125, 156, 230, 154, 255, 241, 255,},
+  {55,  93, 183, 126, 157, 231, 156, 255, 242, 255,},
+  {56,  95, 185, 126, 157, 232, 157, 255, 242, 255,},
+  {57,  96, 187, 127, 158, 233, 158, 255, 243, 255,},
+  {58,  98, 189, 128, 158, 234, 159, 255, 244, 255,},
+  {59,  99, 190, 129, 159, 235, 160, 255, 244, 255,},
+  {60, 101, 192, 129, 159, 236, 162, 255, 245, 255,},
+  {61, 102, 193, 130, 160, 237, 163, 255, 246, 255,},
+  {62, 104, 195, 131, 160, 238, 164, 255, 246, 255,},
+  {63, 105, 197, 132, 161, 238, 165, 255, 247, 255,},
+  {64, 106, 198, 132, 162, 239, 166, 255, 247, 255,},
+  {65, 108, 199, 133, 162, 240, 167, 255, 248, 255,},
+  {66, 109, 201, 134, 163, 241, 169, 255, 248, 255,},
+  {67, 111, 202, 135, 163, 241, 170, 255, 249, 255,},
+  {68, 112, 204, 135, 164, 242, 171, 255, 249, 255,},
+  {69, 113, 205, 136, 164, 243, 172, 255, 249, 255,},
+  {70, 115, 206, 137, 165, 243, 173, 255, 250, 255,},
+  {71, 116, 208, 138, 165, 244, 174, 255, 250, 255,},
+  {72, 117, 209, 138, 166, 244, 175, 255, 250, 255,},
+  {73, 119, 210, 139, 166, 245, 177, 255, 251, 255,},
+  {74, 120, 211, 140, 167, 245, 178, 255, 251, 255,},
+  {75, 121, 212, 141, 167, 246, 179, 255, 251, 255,},
+  {76, 123, 214, 142, 168, 246, 180, 255, 252, 255,},
+  {77, 124, 215, 142, 168, 247, 181, 255, 252, 255,},
+  {78, 125, 216, 143, 169, 247, 182, 255, 252, 255,},
+  {79, 127, 217, 144, 170, 248, 183, 255, 252, 255,},
+  {80, 128, 218, 145, 170, 248, 184, 255, 253, 255,},
+  {81, 129, 219, 146, 171, 248, 185, 255, 253, 255,},
+  {82, 131, 220, 146, 171, 249, 186, 255, 253, 255,},
+  {83, 132, 221, 147, 172, 249, 187, 255, 253, 255,},
+  {84, 133, 222, 148, 172, 249, 188, 255, 253, 255,},
+  {85, 134, 223, 149, 173, 250, 189, 255, 253, 255,},
+  {86, 136, 224, 149, 173, 250, 190, 255, 254, 255,},
+  {87, 137, 225, 150, 174, 250, 191, 255, 254, 255,},
+  {88, 138, 226, 151, 174, 251, 192, 255, 254, 255,},
+  {89, 139, 226, 152, 175, 251, 193, 255, 254, 255,},
+  {90, 141, 227, 153, 175, 251, 194, 255, 254, 255,},
+  {91, 142, 228, 153, 176, 251, 195, 255, 254, 255,},
+  {92, 143, 229, 154, 177, 252, 196, 255, 254, 255,},
+  {93, 144, 230, 155, 177, 252, 197, 255, 254, 255,},
+  {94, 146, 230, 156, 178, 252, 198, 255, 255, 255,},
+  {95, 147, 231, 157, 178, 252, 199, 255, 255, 255,},
+  {96, 148, 232, 157, 179, 252, 200, 255, 255, 255,},
+  {97, 149, 233, 158, 179, 253, 201, 255, 255, 255,},
+  {98, 150, 233, 159, 180, 253, 202, 255, 255, 255,},
+  {99, 152, 234, 160, 180, 253, 203, 255, 255, 255,},
+  {100, 153, 235, 161, 181, 253, 204, 255, 255, 255,},
+  {101, 154, 235, 161, 182, 253, 205, 255, 255, 255,},
+  {102, 155, 236, 162, 182, 253, 206, 255, 255, 255,},
+  {103, 156, 236, 163, 183, 254, 207, 255, 255, 255,},
+  {104, 157, 237, 164, 183, 254, 207, 255, 255, 255,},
+  {105, 159, 238, 165, 184, 254, 208, 255, 255, 255,},
+  {106, 160, 238, 166, 184, 254, 209, 255, 255, 255,},
+  {107, 161, 239, 166, 185, 254, 210, 255, 255, 255,},
+  {108, 162, 239, 167, 185, 254, 211, 255, 255, 255,},
+  {109, 163, 240, 168, 186, 254, 212, 255, 255, 255,},
+  {110, 164, 240, 169, 187, 254, 212, 255, 255, 255,},
+  {111, 165, 241, 170, 187, 254, 213, 255, 255, 255,},
+  {112, 166, 241, 170, 188, 255, 214, 255, 255, 255,},
+  {113, 167, 242, 171, 188, 255, 215, 255, 255, 255,},
+  {114, 169, 242, 172, 189, 255, 216, 255, 255, 255,},
+  {115, 170, 243, 173, 189, 255, 216, 255, 255, 255,},
+  {116, 171, 243, 174, 190, 255, 217, 255, 255, 255,},
+  {117, 172, 244, 174, 190, 255, 218, 255, 255, 255,},
+  {118, 173, 244, 175, 191, 255, 219, 255, 255, 255,},
+  {119, 174, 244, 176, 192, 255, 219, 255, 255, 255,},
+  {120, 175, 245, 177, 192, 255, 220, 255, 255, 255,},
+  {121, 176, 245, 178, 193, 255, 221, 255, 255, 255,},
+  {122, 177, 245, 178, 193, 255, 222, 255, 255, 255,},
+  {123, 178, 246, 179, 194, 255, 222, 255, 255, 255,},
+  {124, 179, 246, 180, 194, 255, 223, 255, 255, 255,},
+  {125, 180, 247, 181, 195, 255, 224, 255, 255, 255,},
+  {126, 181, 247, 182, 196, 255, 224, 255, 255, 255,},
+  {127, 182, 247, 182, 196, 255, 225, 255, 255, 255,},
+  {128, 183, 247, 183, 197, 255, 226, 255, 255, 255,},
+  {129, 184, 248, 184, 197, 255, 226, 255, 255, 255,},
+  {130, 185, 248, 185, 198, 255, 227, 255, 255, 255,},
+  {131, 186, 248, 186, 198, 255, 228, 255, 255, 255,},
+  {132, 187, 249, 186, 199, 255, 228, 255, 255, 255,},
+  {133, 188, 249, 187, 200, 255, 229, 255, 255, 255,},
+  {134, 189, 249, 188, 200, 255, 230, 255, 255, 255,},
+  {135, 190, 249, 189, 201, 255, 230, 255, 255, 255,},
+  {136, 191, 250, 190, 201, 255, 231, 255, 255, 255,},
+  {137, 192, 250, 190, 202, 255, 231, 255, 255, 255,},
+  {138, 193, 250, 191, 202, 255, 232, 255, 255, 255,},
+  {139, 194, 250, 192, 203, 255, 232, 255, 255, 255,},
+  {140, 195, 251, 193, 204, 255, 233, 255, 255, 255,},
+  {141, 195, 251, 194, 204, 255, 234, 255, 255, 255,},
+  {142, 196, 251, 194, 205, 255, 234, 255, 255, 255,},
+  {143, 197, 251, 195, 205, 255, 235, 255, 255, 255,},
+  {144, 198, 251, 196, 206, 255, 235, 255, 255, 255,},
+  {145, 199, 252, 197, 206, 255, 236, 255, 255, 255,},
+  {146, 200, 252, 197, 207, 255, 236, 255, 255, 255,},
+  {147, 201, 252, 198, 208, 255, 237, 255, 255, 255,},
+  {148, 202, 252, 199, 208, 255, 237, 255, 255, 255,},
+  {149, 203, 252, 200, 209, 255, 238, 255, 255, 255,},
+  {150, 203, 252, 201, 209, 255, 238, 255, 255, 255,},
+  {151, 204, 253, 201, 210, 255, 239, 255, 255, 255,},
+  {152, 205, 253, 202, 210, 255, 239, 255, 255, 255,},
+  {153, 206, 253, 203, 211, 255, 239, 255, 255, 255,},
+  {154, 207, 253, 204, 212, 255, 240, 255, 255, 255,},
+  {155, 208, 253, 204, 212, 255, 240, 255, 255, 255,},
+  {156, 209, 253, 205, 213, 255, 241, 255, 255, 255,},
+  {157, 209, 253, 206, 213, 255, 241, 255, 255, 255,},
+  {158, 210, 254, 207, 214, 255, 242, 255, 255, 255,},
+  {159, 211, 254, 207, 214, 255, 242, 255, 255, 255,},
+  {160, 212, 254, 208, 215, 255, 242, 255, 255, 255,},
+  {161, 213, 254, 209, 215, 255, 243, 255, 255, 255,},
+  {162, 213, 254, 210, 216, 255, 243, 255, 255, 255,},
+  {163, 214, 254, 210, 217, 255, 244, 255, 255, 255,},
+  {164, 215, 254, 211, 217, 255, 244, 255, 255, 255,},
+  {165, 216, 254, 212, 218, 255, 244, 255, 255, 255,},
+  {166, 216, 254, 212, 218, 255, 245, 255, 255, 255,},
+  {167, 217, 254, 213, 219, 255, 245, 255, 255, 255,},
+  {168, 218, 254, 214, 219, 255, 245, 255, 255, 255,},
+  {169, 219, 255, 215, 220, 255, 246, 255, 255, 255,},
+  {170, 219, 255, 215, 221, 255, 246, 255, 255, 255,},
+  {171, 220, 255, 216, 221, 255, 246, 255, 255, 255,},
+  {172, 221, 255, 217, 222, 255, 247, 255, 255, 255,},
+  {173, 222, 255, 217, 222, 255, 247, 255, 255, 255,},
+  {174, 222, 255, 218, 223, 255, 247, 255, 255, 255,},
+  {175, 223, 255, 219, 223, 255, 248, 255, 255, 255,},
+  {176, 224, 255, 220, 224, 255, 248, 255, 255, 255,},
+  {177, 224, 255, 220, 224, 255, 248, 255, 255, 255,},
+  {178, 225, 255, 221, 225, 255, 248, 255, 255, 255,},
+  {179, 226, 255, 222, 225, 255, 249, 255, 255, 255,},
+  {180, 226, 255, 222, 226, 255, 249, 255, 255, 255,},
+  {181, 227, 255, 223, 227, 255, 249, 255, 255, 255,},
+  {182, 228, 255, 224, 227, 255, 249, 255, 255, 255,},
+  {183, 228, 255, 224, 228, 255, 250, 255, 255, 255,},
+  {184, 229, 255, 225, 228, 255, 250, 255, 255, 255,},
+  {185, 230, 255, 226, 229, 255, 250, 255, 255, 255,},
+  {186, 230, 255, 226, 229, 255, 250, 255, 255, 255,},
+  {187, 231, 255, 227, 230, 255, 251, 255, 255, 255,},
+  {188, 232, 255, 228, 230, 255, 251, 255, 255, 255,},
+  {189, 232, 255, 228, 231, 255, 251, 255, 255, 255,},
+  {190, 233, 255, 229, 231, 255, 251, 255, 255, 255,},
+  {191, 233, 255, 229, 232, 255, 251, 255, 255, 255,},
+  {192, 234, 255, 230, 232, 255, 252, 255, 255, 255,},
+  {193, 234, 255, 231, 233, 255, 252, 255, 255, 255,},
+  {194, 235, 255, 231, 233, 255, 252, 255, 255, 255,},
+  {195, 236, 255, 232, 234, 255, 252, 255, 255, 255,},
+  {196, 236, 255, 232, 234, 255, 252, 255, 255, 255,},
+  {197, 237, 255, 233, 235, 255, 252, 255, 255, 255,},
+  {198, 237, 255, 234, 235, 255, 253, 255, 255, 255,},
+  {199, 238, 255, 234, 236, 255, 253, 255, 255, 255,},
+  {200, 238, 255, 235, 236, 255, 253, 255, 255, 255,},
+  {201, 239, 255, 235, 237, 255, 253, 255, 255, 255,},
+  {202, 239, 255, 236, 237, 255, 253, 255, 255, 255,},
+  {203, 240, 255, 237, 238, 255, 253, 255, 255, 255,},
+  {204, 240, 255, 237, 238, 255, 254, 255, 255, 255,},
+  {205, 241, 255, 238, 239, 255, 254, 255, 255, 255,},
+  {206, 241, 255, 238, 239, 255, 254, 255, 255, 255,},
+  {207, 242, 255, 239, 240, 255, 254, 255, 255, 255,},
+  {208, 242, 255, 239, 240, 255, 254, 255, 255, 255,},
+  {209, 243, 255, 240, 241, 255, 254, 255, 255, 255,},
+  {210, 243, 255, 240, 241, 255, 254, 255, 255, 255,},
+  {211, 244, 255, 241, 242, 255, 254, 255, 255, 255,},
+  {212, 244, 255, 241, 242, 255, 254, 255, 255, 255,},
+  {213, 245, 255, 242, 243, 255, 255, 255, 255, 255,},
+  {214, 245, 255, 242, 243, 255, 255, 255, 255, 255,},
+  {215, 246, 255, 243, 244, 255, 255, 255, 255, 255,},
+  {216, 246, 255, 243, 244, 255, 255, 255, 255, 255,},
+  {217, 246, 255, 244, 244, 255, 255, 255, 255, 255,},
+  {218, 247, 255, 244, 245, 255, 255, 255, 255, 255,},
+  {219, 247, 255, 245, 245, 255, 255, 255, 255, 255,},
+  {220, 248, 255, 245, 246, 255, 255, 255, 255, 255,},
+  {221, 248, 255, 246, 246, 255, 255, 255, 255, 255,},
+  {222, 248, 255, 246, 247, 255, 255, 255, 255, 255,},
+  {223, 249, 255, 247, 247, 255, 255, 255, 255, 255,},
+  {224, 249, 255, 247, 247, 255, 255, 255, 255, 255,},
+  {225, 250, 255, 247, 248, 255, 255, 255, 255, 255,},
+  {226, 250, 255, 248, 248, 255, 255, 255, 255, 255,},
+  {227, 250, 255, 248, 249, 255, 255, 255, 255, 255,},
+  {228, 251, 255, 249, 249, 255, 255, 255, 255, 255,},
+  {229, 251, 255, 249, 249, 255, 255, 255, 255, 255,},
+  {230, 251, 255, 249, 250, 255, 255, 255, 255, 255,},
+  {231, 251, 255, 250, 250, 255, 255, 255, 255, 255,},
+  {232, 252, 255, 250, 250, 255, 255, 255, 255, 255,},
+  {233, 252, 255, 251, 251, 255, 255, 255, 255, 255,},
+  {234, 252, 255, 251, 251, 255, 255, 255, 255, 255,},
+  {235, 253, 255, 251, 251, 255, 255, 255, 255, 255,},
+  {236, 253, 255, 252, 252, 255, 255, 255, 255, 255,},
+  {237, 253, 255, 252, 252, 255, 255, 255, 255, 255,},
+  {238, 253, 255, 252, 252, 255, 255, 255, 255, 255,},
+  {239, 254, 255, 253, 253, 255, 255, 255, 255, 255,},
+  {240, 254, 255, 253, 253, 255, 255, 255, 255, 255,},
+  {241, 254, 255, 253, 253, 255, 255, 255, 255, 255,},
+  {242, 254, 255, 253, 254, 255, 255, 255, 255, 255,},
+  {243, 254, 255, 254, 254, 255, 255, 255, 255, 255,},
+  {244, 255, 255, 254, 254, 255, 255, 255, 255, 255,},
+  {245, 255, 255, 254, 254, 255, 255, 255, 255, 255,},
+  {246, 255, 255, 254, 254, 255, 255, 255, 255, 255,},
+  {247, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {248, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {249, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {250, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {251, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {252, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {253, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {254, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {255, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+};
+
+const vp9_prob vp9_modelcoefprobs_gg75[COEFPROB_MODELS][ENTROPY_NODES - 1] = {
+  // Probs generated with a Generalized Gaussian (with shape parameter 0.75)
+  // source model with varying quantizer step size for a uniform quantizer
+  {0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},  // do not use
+  {1,   2,   6,  87, 129,  11,  88,  39,  93,  47,},
+  {2,   4,  11,  88, 130,  21,  89,  68,  98,  79,},
+  {3,   6,  16,  89, 131,  30,  91,  92, 103, 105,},
+  {4,   8,  21,  90, 131,  38,  92, 112, 107, 126,},
+  {5,  10,  26,  90, 132,  46,  94, 129, 111, 143,},
+  {6,  11,  31,  91, 133,  54,  95, 143, 115, 157,},
+  {7,  13,  35,  92, 133,  61,  96, 156, 119, 170,},
+  {8,  15,  40,  93, 134,  68,  97, 167, 123, 180,},
+  {9,  17,  44,  94, 134,  74,  98, 177, 126, 189,},
+  {10,  19,  48,  94, 135,  80, 100, 185, 130, 197,},
+  {11,  20,  52,  95, 135,  86, 101, 192, 133, 204,},
+  {12,  22,  56,  96, 136,  92, 102, 199, 137, 210,},
+  {13,  24,  60,  96, 136,  97, 103, 205, 140, 215,},
+  {14,  26,  64,  97, 137, 103, 104, 210, 143, 219,},
+  {15,  27,  68,  98, 137, 108, 105, 215, 146, 223,},
+  {16,  29,  71,  98, 138, 112, 106, 219, 149, 227,},
+  {17,  31,  75,  99, 138, 117, 107, 223, 152, 230,},
+  {18,  32,  78, 100, 139, 121, 108, 226, 155, 233,},
+  {19,  34,  82, 100, 139, 126, 109, 229, 158, 235,},
+  {20,  36,  85, 101, 140, 130, 110, 231, 161, 238,},
+  {21,  37,  88, 102, 140, 134, 111, 234, 164, 239,},
+  {22,  39,  91, 102, 141, 138, 112, 236, 167, 241,},
+  {23,  40,  94, 103, 141, 141, 113, 238, 169, 243,},
+  {24,  42,  97, 104, 142, 145, 114, 240, 172, 244,},
+  {25,  44, 100, 104, 142, 149, 115, 241, 174, 245,},
+  {26,  45, 103, 105, 143, 152, 116, 243, 177, 246,},
+  {27,  47, 106, 105, 143, 155, 117, 244, 179, 247,},
+  {28,  48, 109, 106, 143, 158, 118, 245, 182, 248,},
+  {29,  50, 112, 107, 144, 161, 119, 246, 184, 249,},
+  {30,  52, 115, 107, 144, 164, 120, 247, 186, 250,},
+  {31,  53, 117, 108, 145, 167, 121, 248, 188, 250,},
+  {32,  55, 120, 109, 145, 170, 122, 249, 190, 251,},
+  {33,  56, 122, 109, 146, 173, 123, 249, 192, 252,},
+  {34,  58, 125, 110, 146, 175, 124, 250, 194, 252,},
+  {35,  59, 127, 110, 147, 178, 125, 251, 196, 252,},
+  {36,  61, 130, 111, 147, 180, 126, 251, 198, 253,},
+  {37,  62, 132, 112, 147, 183, 127, 251, 200, 253,},
+  {38,  64, 135, 112, 148, 185, 128, 252, 202, 253,},
+  {39,  65, 137, 113, 148, 187, 129, 252, 204, 254,},
+  {40,  67, 139, 114, 149, 189, 130, 253, 205, 254,},
+  {41,  68, 141, 114, 149, 191, 131, 253, 207, 254,},
+  {42,  70, 144, 115, 150, 193, 132, 253, 209, 254,},
+  {43,  71, 146, 115, 150, 195, 133, 254, 210, 254,},
+  {44,  72, 148, 116, 151, 197, 134, 254, 212, 255,},
+  {45,  74, 150, 117, 151, 199, 135, 254, 213, 255,},
+  {46,  75, 152, 117, 151, 201, 136, 254, 215, 255,},
+  {47,  77, 154, 118, 152, 202, 137, 254, 216, 255,},
+  {48,  78, 156, 119, 152, 204, 138, 254, 217, 255,},
+  {49,  80, 158, 119, 153, 206, 139, 255, 219, 255,},
+  {50,  81, 160, 120, 153, 207, 140, 255, 220, 255,},
+  {51,  82, 162, 120, 154, 209, 141, 255, 221, 255,},
+  {52,  84, 164, 121, 154, 210, 142, 255, 222, 255,},
+  {53,  85, 165, 122, 155, 212, 143, 255, 224, 255,},
+  {54,  87, 167, 122, 155, 213, 144, 255, 225, 255,},
+  {55,  88, 169, 123, 155, 215, 145, 255, 226, 255,},
+  {56,  89, 171, 124, 156, 216, 146, 255, 227, 255,},
+  {57,  91, 172, 124, 156, 217, 146, 255, 228, 255,},
+  {58,  92, 174, 125, 157, 218, 147, 255, 229, 255,},
+  {59,  93, 176, 126, 157, 220, 148, 255, 230, 255,},
+  {60,  95, 177, 126, 158, 221, 149, 255, 231, 255,},
+  {61,  96, 179, 127, 158, 222, 150, 255, 232, 255,},
+  {62,  97, 180, 127, 159, 223, 151, 255, 232, 255,},
+  {63,  99, 182, 128, 159, 224, 152, 255, 233, 255,},
+  {64, 100, 183, 129, 159, 225, 153, 255, 234, 255,},
+  {65, 101, 185, 129, 160, 226, 154, 255, 235, 255,},
+  {66, 103, 186, 130, 160, 227, 155, 255, 236, 255,},
+  {67, 104, 188, 131, 161, 228, 156, 255, 236, 255,},
+  {68, 105, 189, 131, 161, 229, 157, 255, 237, 255,},
+  {69, 106, 190, 132, 162, 230, 158, 255, 238, 255,},
+  {70, 108, 192, 133, 162, 231, 159, 255, 238, 255,},
+  {71, 109, 193, 133, 162, 231, 159, 255, 239, 255,},
+  {72, 110, 194, 134, 163, 232, 160, 255, 240, 255,},
+  {73, 111, 196, 134, 163, 233, 161, 255, 240, 255,},
+  {74, 113, 197, 135, 164, 234, 162, 255, 241, 255,},
+  {75, 114, 198, 136, 164, 235, 163, 255, 241, 255,},
+  {76, 115, 199, 136, 165, 235, 164, 255, 242, 255,},
+  {77, 116, 200, 137, 165, 236, 165, 255, 243, 255,},
+  {78, 118, 202, 138, 166, 237, 166, 255, 243, 255,},
+  {79, 119, 203, 138, 166, 237, 167, 255, 244, 255,},
+  {80, 120, 204, 139, 167, 238, 168, 255, 244, 255,},
+  {81, 121, 205, 140, 167, 239, 168, 255, 244, 255,},
+  {82, 123, 206, 140, 167, 239, 169, 255, 245, 255,},
+  {83, 124, 207, 141, 168, 240, 170, 255, 245, 255,},
+  {84, 125, 208, 142, 168, 240, 171, 255, 246, 255,},
+  {85, 126, 209, 142, 169, 241, 172, 255, 246, 255,},
+  {86, 127, 210, 143, 169, 241, 173, 255, 247, 255,},
+  {87, 129, 211, 144, 170, 242, 174, 255, 247, 255,},
+  {88, 130, 212, 144, 170, 242, 175, 255, 247, 255,},
+  {89, 131, 213, 145, 171, 243, 175, 255, 248, 255,},
+  {90, 132, 214, 146, 171, 243, 176, 255, 248, 255,},
+  {91, 133, 215, 146, 171, 244, 177, 255, 248, 255,},
+  {92, 134, 216, 147, 172, 244, 178, 255, 249, 255,},
+  {93, 136, 217, 148, 172, 245, 179, 255, 249, 255,},
+  {94, 137, 218, 148, 173, 245, 180, 255, 249, 255,},
+  {95, 138, 219, 149, 173, 245, 181, 255, 249, 255,},
+  {96, 139, 220, 150, 174, 246, 181, 255, 250, 255,},
+  {97, 140, 220, 150, 174, 246, 182, 255, 250, 255,},
+  {98, 141, 221, 151, 175, 247, 183, 255, 250, 255,},
+  {99, 142, 222, 152, 175, 247, 184, 255, 250, 255,},
+  {100, 144, 223, 152, 176, 247, 185, 255, 251, 255,},
+  {101, 145, 224, 153, 176, 248, 186, 255, 251, 255,},
+  {102, 146, 224, 154, 177, 248, 186, 255, 251, 255,},
+  {103, 147, 225, 154, 177, 248, 187, 255, 251, 255,},
+  {104, 148, 226, 155, 177, 248, 188, 255, 252, 255,},
+  {105, 149, 226, 156, 178, 249, 189, 255, 252, 255,},
+  {106, 150, 227, 156, 178, 249, 190, 255, 252, 255,},
+  {107, 151, 228, 157, 179, 249, 191, 255, 252, 255,},
+  {108, 152, 229, 158, 179, 250, 191, 255, 252, 255,},
+  {109, 153, 229, 158, 180, 250, 192, 255, 252, 255,},
+  {110, 154, 230, 159, 180, 250, 193, 255, 253, 255,},
+  {111, 155, 231, 160, 181, 250, 194, 255, 253, 255,},
+  {112, 157, 231, 160, 181, 251, 195, 255, 253, 255,},
+  {113, 158, 232, 161, 182, 251, 195, 255, 253, 255,},
+  {114, 159, 232, 162, 182, 251, 196, 255, 253, 255,},
+  {115, 160, 233, 162, 183, 251, 197, 255, 253, 255,},
+  {116, 161, 234, 163, 183, 251, 198, 255, 253, 255,},
+  {117, 162, 234, 164, 184, 252, 198, 255, 254, 255,},
+  {118, 163, 235, 165, 184, 252, 199, 255, 254, 255,},
+  {119, 164, 235, 165, 185, 252, 200, 255, 254, 255,},
+  {120, 165, 236, 166, 185, 252, 201, 255, 254, 255,},
+  {121, 166, 236, 167, 186, 252, 201, 255, 254, 255,},
+  {122, 167, 237, 167, 186, 252, 202, 255, 254, 255,},
+  {123, 168, 237, 168, 186, 253, 203, 255, 254, 255,},
+  {124, 169, 238, 169, 187, 253, 204, 255, 254, 255,},
+  {125, 170, 238, 169, 187, 253, 204, 255, 254, 255,},
+  {126, 171, 239, 170, 188, 253, 205, 255, 254, 255,},
+  {127, 172, 239, 171, 188, 253, 206, 255, 254, 255,},
+  {128, 173, 240, 171, 189, 253, 207, 255, 255, 255,},
+  {129, 174, 240, 172, 189, 253, 207, 255, 255, 255,},
+  {130, 175, 241, 173, 190, 253, 208, 255, 255, 255,},
+  {131, 176, 241, 174, 190, 254, 209, 255, 255, 255,},
+  {132, 177, 241, 174, 191, 254, 209, 255, 255, 255,},
+  {133, 178, 242, 175, 191, 254, 210, 255, 255, 255,},
+  {134, 179, 242, 176, 192, 254, 211, 255, 255, 255,},
+  {135, 180, 243, 176, 192, 254, 212, 255, 255, 255,},
+  {136, 180, 243, 177, 193, 254, 212, 255, 255, 255,},
+  {137, 181, 243, 178, 193, 254, 213, 255, 255, 255,},
+  {138, 182, 244, 179, 194, 254, 214, 255, 255, 255,},
+  {139, 183, 244, 179, 194, 254, 214, 255, 255, 255,},
+  {140, 184, 244, 180, 195, 254, 215, 255, 255, 255,},
+  {141, 185, 245, 181, 195, 254, 216, 255, 255, 255,},
+  {142, 186, 245, 181, 196, 255, 216, 255, 255, 255,},
+  {143, 187, 245, 182, 196, 255, 217, 255, 255, 255,},
+  {144, 188, 246, 183, 197, 255, 218, 255, 255, 255,},
+  {145, 189, 246, 183, 197, 255, 218, 255, 255, 255,},
+  {146, 190, 246, 184, 198, 255, 219, 255, 255, 255,},
+  {147, 191, 247, 185, 198, 255, 220, 255, 255, 255,},
+  {148, 191, 247, 186, 199, 255, 220, 255, 255, 255,},
+  {149, 192, 247, 186, 199, 255, 221, 255, 255, 255,},
+  {150, 193, 248, 187, 200, 255, 221, 255, 255, 255,},
+  {151, 194, 248, 188, 200, 255, 222, 255, 255, 255,},
+  {152, 195, 248, 188, 201, 255, 223, 255, 255, 255,},
+  {153, 196, 248, 189, 201, 255, 223, 255, 255, 255,},
+  {154, 197, 249, 190, 202, 255, 224, 255, 255, 255,},
+  {155, 198, 249, 191, 202, 255, 224, 255, 255, 255,},
+  {156, 198, 249, 191, 203, 255, 225, 255, 255, 255,},
+  {157, 199, 249, 192, 203, 255, 226, 255, 255, 255,},
+  {158, 200, 250, 193, 204, 255, 226, 255, 255, 255,},
+  {159, 201, 250, 193, 204, 255, 227, 255, 255, 255,},
+  {160, 202, 250, 194, 205, 255, 227, 255, 255, 255,},
+  {161, 203, 250, 195, 206, 255, 228, 255, 255, 255,},
+  {162, 203, 250, 196, 206, 255, 228, 255, 255, 255,},
+  {163, 204, 251, 196, 207, 255, 229, 255, 255, 255,},
+  {164, 205, 251, 197, 207, 255, 229, 255, 255, 255,},
+  {165, 206, 251, 198, 208, 255, 230, 255, 255, 255,},
+  {166, 207, 251, 198, 208, 255, 231, 255, 255, 255,},
+  {167, 207, 251, 199, 209, 255, 231, 255, 255, 255,},
+  {168, 208, 252, 200, 209, 255, 232, 255, 255, 255,},
+  {169, 209, 252, 201, 210, 255, 232, 255, 255, 255,},
+  {170, 210, 252, 201, 210, 255, 233, 255, 255, 255,},
+  {171, 211, 252, 202, 211, 255, 233, 255, 255, 255,},
+  {172, 211, 252, 203, 211, 255, 234, 255, 255, 255,},
+  {173, 212, 252, 203, 212, 255, 234, 255, 255, 255,},
+  {174, 213, 252, 204, 212, 255, 235, 255, 255, 255,},
+  {175, 214, 253, 205, 213, 255, 235, 255, 255, 255,},
+  {176, 214, 253, 206, 213, 255, 236, 255, 255, 255,},
+  {177, 215, 253, 206, 214, 255, 236, 255, 255, 255,},
+  {178, 216, 253, 207, 214, 255, 237, 255, 255, 255,},
+  {179, 217, 253, 208, 215, 255, 237, 255, 255, 255,},
+  {180, 217, 253, 208, 216, 255, 237, 255, 255, 255,},
+  {181, 218, 253, 209, 216, 255, 238, 255, 255, 255,},
+  {182, 219, 254, 210, 217, 255, 238, 255, 255, 255,},
+  {183, 220, 254, 211, 217, 255, 239, 255, 255, 255,},
+  {184, 220, 254, 211, 218, 255, 239, 255, 255, 255,},
+  {185, 221, 254, 212, 218, 255, 240, 255, 255, 255,},
+  {186, 222, 254, 213, 219, 255, 240, 255, 255, 255,},
+  {187, 222, 254, 213, 219, 255, 241, 255, 255, 255,},
+  {188, 223, 254, 214, 220, 255, 241, 255, 255, 255,},
+  {189, 224, 254, 215, 220, 255, 241, 255, 255, 255,},
+  {190, 225, 254, 215, 221, 255, 242, 255, 255, 255,},
+  {191, 225, 254, 216, 221, 255, 242, 255, 255, 255,},
+  {192, 226, 254, 217, 222, 255, 243, 255, 255, 255,},
+  {193, 227, 255, 218, 223, 255, 243, 255, 255, 255,},
+  {194, 227, 255, 218, 223, 255, 243, 255, 255, 255,},
+  {195, 228, 255, 219, 224, 255, 244, 255, 255, 255,},
+  {196, 229, 255, 220, 224, 255, 244, 255, 255, 255,},
+  {197, 229, 255, 220, 225, 255, 244, 255, 255, 255,},
+  {198, 230, 255, 221, 225, 255, 245, 255, 255, 255,},
+  {199, 230, 255, 222, 226, 255, 245, 255, 255, 255,},
+  {200, 231, 255, 222, 226, 255, 246, 255, 255, 255,},
+  {201, 232, 255, 223, 227, 255, 246, 255, 255, 255,},
+  {202, 232, 255, 224, 228, 255, 246, 255, 255, 255,},
+  {203, 233, 255, 224, 228, 255, 247, 255, 255, 255,},
+  {204, 234, 255, 225, 229, 255, 247, 255, 255, 255,},
+  {205, 234, 255, 226, 229, 255, 247, 255, 255, 255,},
+  {206, 235, 255, 227, 230, 255, 248, 255, 255, 255,},
+  {207, 235, 255, 227, 230, 255, 248, 255, 255, 255,},
+  {208, 236, 255, 228, 231, 255, 248, 255, 255, 255,},
+  {209, 237, 255, 229, 231, 255, 248, 255, 255, 255,},
+  {210, 237, 255, 229, 232, 255, 249, 255, 255, 255,},
+  {211, 238, 255, 230, 233, 255, 249, 255, 255, 255,},
+  {212, 238, 255, 231, 233, 255, 249, 255, 255, 255,},
+  {213, 239, 255, 231, 234, 255, 250, 255, 255, 255,},
+  {214, 239, 255, 232, 234, 255, 250, 255, 255, 255,},
+  {215, 240, 255, 233, 235, 255, 250, 255, 255, 255,},
+  {216, 241, 255, 233, 235, 255, 250, 255, 255, 255,},
+  {217, 241, 255, 234, 236, 255, 251, 255, 255, 255,},
+  {218, 242, 255, 235, 236, 255, 251, 255, 255, 255,},
+  {219, 242, 255, 235, 237, 255, 251, 255, 255, 255,},
+  {220, 243, 255, 236, 237, 255, 251, 255, 255, 255,},
+  {221, 243, 255, 236, 238, 255, 252, 255, 255, 255,},
+  {222, 244, 255, 237, 239, 255, 252, 255, 255, 255,},
+  {223, 244, 255, 238, 239, 255, 252, 255, 255, 255,},
+  {224, 245, 255, 238, 240, 255, 252, 255, 255, 255,},
+  {225, 245, 255, 239, 240, 255, 252, 255, 255, 255,},
+  {226, 246, 255, 240, 241, 255, 253, 255, 255, 255,},
+  {227, 246, 255, 240, 241, 255, 253, 255, 255, 255,},
+  {228, 247, 255, 241, 242, 255, 253, 255, 255, 255,},
+  {229, 247, 255, 242, 242, 255, 253, 255, 255, 255,},
+  {230, 248, 255, 242, 243, 255, 253, 255, 255, 255,},
+  {231, 248, 255, 243, 244, 255, 254, 255, 255, 255,},
+  {232, 248, 255, 243, 244, 255, 254, 255, 255, 255,},
+  {233, 249, 255, 244, 245, 255, 254, 255, 255, 255,},
+  {234, 249, 255, 245, 245, 255, 254, 255, 255, 255,},
+  {235, 250, 255, 245, 246, 255, 254, 255, 255, 255,},
+  {236, 250, 255, 246, 246, 255, 254, 255, 255, 255,},
+  {237, 251, 255, 246, 247, 255, 255, 255, 255, 255,},
+  {238, 251, 255, 247, 247, 255, 255, 255, 255, 255,},
+  {239, 251, 255, 248, 248, 255, 255, 255, 255, 255,},
+  {240, 252, 255, 248, 248, 255, 255, 255, 255, 255,},
+  {241, 252, 255, 249, 249, 255, 255, 255, 255, 255,},
+  {242, 252, 255, 249, 249, 255, 255, 255, 255, 255,},
+  {243, 253, 255, 250, 250, 255, 255, 255, 255, 255,},
+  {244, 253, 255, 250, 250, 255, 255, 255, 255, 255,},
+  {245, 253, 255, 251, 251, 255, 255, 255, 255, 255,},
+  {246, 254, 255, 251, 251, 255, 255, 255, 255, 255,},
+  {247, 254, 255, 252, 252, 255, 255, 255, 255, 255,},
+  {248, 254, 255, 252, 252, 255, 255, 255, 255, 255,},
+  {249, 255, 255, 253, 253, 255, 255, 255, 255, 255,},
+  {250, 255, 255, 253, 253, 255, 255, 255, 255, 255,},
+  {251, 255, 255, 254, 254, 255, 255, 255, 255, 255,},
+  {252, 255, 255, 254, 254, 255, 255, 255, 255, 255,},
+  {253, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {254, 255, 255, 255, 255, 255, 255, 255, 255, 255,},
+  {255, 255, 255, 255, 255, 255, 255, 255, 255, 255,}
+};
+
+const vp9_prob vp9_modelcoefprobs_gg625[COEFPROB_MODELS][ENTROPY_NODES - 1] = {
+  // Probs generated with a Generalized Gaussian (with shape parameter 0.625)
+  // source model with varying quantizer step size for a uniform quantizer
+  {0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},  // do not use
+  {1,   2,   6,  88, 130,  10,  88,  35,  94,  40,},
+  {2,   4,  11,  89, 131,  19,  90,  60,  99,  67,},
+  {3,   6,  15,  90, 132,  27,  92,  80, 103,  88,},
+  {4,   7,  20,  91, 132,  34,  93,  97, 107, 105,},
+  {5,   9,  24,  92, 133,  41,  94, 112, 110, 120,},
+  {6,  11,  28,  93, 134,  48,  95, 125, 113, 132,},
+  {7,  13,  33,  93, 134,  54,  97, 136, 116, 143,},
+  {8,  14,  36,  94, 135,  60,  98, 146, 119, 152,},
+  {9,  16,  40,  95, 135,  65,  99, 155, 122, 161,},
+  {10,  18,  44,  95, 136,  70, 100, 163, 125, 168,},
+  {11,  19,  48,  96, 136,  75, 101, 170, 127, 175,},
+  {12,  21,  51,  97, 137,  80, 102, 176, 130, 181,},
+  {13,  23,  55,  97, 137,  85, 102, 182, 132, 187,},
+  {14,  24,  58,  98, 138,  89, 103, 188, 135, 192,},
+  {15,  26,  61,  99, 138,  94, 104, 193, 137, 196,},
+  {16,  27,  64,  99, 139,  98, 105, 197, 140, 201,},
+  {17,  29,  67, 100, 139, 102, 106, 201, 142, 205,},
+  {18,  30,  70, 101, 140, 106, 107, 205, 144, 208,},
+  {19,  32,  73, 101, 140, 109, 108, 209, 146, 211,},
+  {20,  34,  76, 102, 140, 113, 109, 212, 148, 214,},
+  {21,  35,  79, 102, 141, 116, 109, 215, 151, 217,},
+  {22,  37,  82, 103, 141, 120, 110, 218, 153, 220,},
+  {23,  38,  85, 103, 142, 123, 111, 220, 155, 222,},
+  {24,  40,  87, 104, 142, 126, 112, 223, 157, 224,},
+  {25,  41,  90, 105, 143, 129, 113, 225, 159, 226,},
+  {26,  42,  93, 105, 143, 132, 113, 227, 161, 228,},
+  {27,  44,  95, 106, 143, 135, 114, 229, 162, 230,},
+  {28,  45,  98, 106, 144, 138, 115, 230, 164, 232,},
+  {29,  47, 100, 107, 144, 141, 116, 232, 166, 233,},
+  {30,  48, 103, 107, 145, 144, 117, 234, 168, 235,},
+  {31,  50, 105, 108, 145, 146, 117, 235, 170, 236,},
+  {32,  51, 107, 108, 145, 149, 118, 236, 171, 237,},
+  {33,  52, 110, 109, 146, 151, 119, 238, 173, 238,},
+  {34,  54, 112, 110, 146, 154, 120, 239, 175, 239,},
+  {35,  55, 114, 110, 147, 156, 120, 240, 176, 240,},
+  {36,  57, 116, 111, 147, 158, 121, 241, 178, 241,},
+  {37,  58, 119, 111, 147, 161, 122, 242, 180, 242,},
+  {38,  59, 121, 112, 148, 163, 123, 243, 181, 243,},
+  {39,  61, 123, 112, 148, 165, 123, 244, 183, 244,},
+  {40,  62, 125, 113, 148, 167, 124, 244, 184, 245,},
+  {41,  63, 127, 113, 149, 169, 125, 245, 186, 245,},
+  {42,  65, 129, 114, 149, 171, 126, 246, 187, 246,},
+  {43,  66, 131, 114, 150, 173, 126, 246, 188, 247,},
+  {44,  67, 133, 115, 150, 175, 127, 247, 190, 247,},
+  {45,  69, 135, 115, 150, 177, 128, 247, 191, 248,},
+  {46,  70, 136, 116, 151, 178, 129, 248, 193, 248,},
+  {47,  71, 138, 116, 151, 180, 129, 248, 194, 249,},
+  {48,  73, 140, 117, 151, 182, 130, 249, 195, 249,},
+  {49,  74, 142, 118, 152, 184, 131, 249, 197, 250,},
+  {50,  75, 144, 118, 152, 185, 131, 250, 198, 250,},
+  {51,  76, 145, 119, 153, 187, 132, 250, 199, 250,},
+  {52,  78, 147, 119, 153, 188, 133, 251, 200, 251,},
+  {53,  79, 149, 120, 153, 190, 134, 251, 201, 251,},
+  {54,  80, 151, 120, 154, 192, 134, 251, 203, 251,},
+  {55,  82, 152, 121, 154, 193, 135, 251, 204, 252,},
+  {56,  83, 154, 121, 154, 194, 136, 252, 205, 252,},
+  {57,  84, 155, 122, 155, 196, 136, 252, 206, 252,},
+  {58,  85, 157, 122, 155, 197, 137, 252, 207, 252,},
+  {59,  86, 158, 123, 156, 199, 138, 252, 208, 252,},
+  {60,  88, 160, 123, 156, 200, 139, 253, 209, 253,},
+  {61,  89, 162, 124, 156, 201, 139, 253, 210, 253,},
+  {62,  90, 163, 124, 157, 202, 140, 253, 211, 253,},
+  {63,  91, 164, 125, 157, 204, 141, 253, 212, 253,},
+  {64,  93, 166, 125, 157, 205, 141, 253, 213, 253,},
+  {65,  94, 167, 126, 158, 206, 142, 254, 214, 254,},
+  {66,  95, 169, 126, 158, 207, 143, 254, 215, 254,},
+  {67,  96, 170, 127, 158, 208, 143, 254, 216, 254,},
+  {68,  97, 172, 127, 159, 209, 144, 254, 217, 254,},
+  {69,  98, 173, 128, 159, 210, 145, 254, 218, 254,},
+  {70, 100, 174, 128, 160, 212, 146, 254, 219, 254,},
+  {71, 101, 176, 129, 160, 213, 146, 254, 220, 254,},
+  {72, 102, 177, 130, 160, 214, 147, 254, 220, 254,},
+  {73, 103, 178, 130, 161, 215, 148, 255, 221, 255,},
+  {74, 104, 179, 131, 161, 216, 148, 255, 222, 255,},
+  {75, 105, 181, 131, 161, 217, 149, 255, 223, 255,},
+  {76, 107, 182, 132, 162, 217, 150, 255, 224, 255,},
+  {77, 108, 183, 132, 162, 218, 150, 255, 224, 255,},
+  {78, 109, 184, 133, 163, 219, 151, 255, 225, 255,},
+  {79, 110, 185, 133, 163, 220, 152, 255, 226, 255,},
+  {80, 111, 187, 134, 163, 221, 153, 255, 227, 255,},
+  {81, 112, 188, 134, 164, 222, 153, 255, 227, 255,},
+  {82, 113, 189, 135, 164, 223, 154, 255, 228, 255,},
+  {83, 115, 190, 135, 164, 223, 155, 255, 229, 255,},
+  {84, 116, 191, 136, 165, 224, 155, 255, 229, 255,},
+  {85, 117, 192, 136, 165, 225, 156, 255, 230, 255,},
+  {86, 118, 193, 137, 165, 226, 157, 255, 231, 255,},
+  {87, 119, 194, 137, 166, 226, 157, 255, 231, 255,},
+  {88, 120, 195, 138, 166, 227, 158, 255, 232, 255,},
+  {89, 121, 196, 139, 167, 228, 159, 255, 232, 255,},
+  {90, 122, 197, 139, 167, 229, 159, 255, 233, 255,},
+  {91, 123, 198, 140, 167, 229, 160, 255, 234, 255,},
+  {92, 124, 199, 140, 168, 230, 161, 255, 234, 255,},
+  {93, 125, 200, 141, 168, 231, 162, 255, 235, 255,},
+  {94, 127, 201, 141, 168, 231, 162, 255, 235, 255,},
+  {95, 128, 202, 142, 169, 232, 163, 255, 236, 255,},
+  {96, 129, 203, 142, 169, 232, 164, 255, 236, 255,},
+  {97, 130, 204, 143, 170, 233, 164, 255, 237, 255,},
+  {98, 131, 205, 143, 170, 234, 165, 255, 237, 255,},
+  {99, 132, 206, 144, 170, 234, 166, 255, 238, 255,},
+  {100, 133, 207, 144, 171, 235, 166, 255, 238, 255,},
+  {101, 134, 208, 145, 171, 235, 167, 255, 239, 255,},
+  {102, 135, 209, 146, 171, 236, 168, 255, 239, 255,},
+  {103, 136, 209, 146, 172, 236, 168, 255, 240, 255,},
+  {104, 137, 210, 147, 172, 237, 169, 255, 240, 255,},
+  {105, 138, 211, 147, 173, 237, 170, 255, 240, 255,},
+  {106, 139, 212, 148, 173, 238, 170, 255, 241, 255,},
+  {107, 140, 213, 148, 173, 238, 171, 255, 241, 255,},
+  {108, 141, 213, 149, 174, 239, 172, 255, 242, 255,},
+  {109, 142, 214, 149, 174, 239, 172, 255, 242, 255,},
+  {110, 143, 215, 150, 175, 240, 173, 255, 242, 255,},
+  {111, 144, 216, 151, 175, 240, 174, 255, 243, 255,},
+  {112, 145, 217, 151, 175, 240, 174, 255, 243, 255,},
+  {113, 146, 217, 152, 176, 241, 175, 255, 244, 255,},
+  {114, 147, 218, 152, 176, 241, 176, 255, 244, 255,},
+  {115, 148, 219, 153, 176, 242, 177, 255, 244, 255,},
+  {116, 149, 219, 153, 177, 242, 177, 255, 245, 255,},
+  {117, 150, 220, 154, 177, 242, 178, 255, 245, 255,},
+  {118, 151, 221, 155, 178, 243, 179, 255, 245, 255,},
+  {119, 152, 222, 155, 178, 243, 179, 255, 245, 255,},
+  {120, 153, 222, 156, 178, 244, 180, 255, 246, 255,},
+  {121, 154, 223, 156, 179, 244, 181, 255, 246, 255,},
+  {122, 155, 224, 157, 179, 244, 181, 255, 246, 255,},
+  {123, 156, 224, 157, 180, 245, 182, 255, 247, 255,},
+  {124, 157, 225, 158, 180, 245, 183, 255, 247, 255,},
+  {125, 158, 225, 159, 180, 245, 183, 255, 247, 255,},
+  {126, 159, 226, 159, 181, 246, 184, 255, 247, 255,},
+  {127, 160, 227, 160, 181, 246, 185, 255, 248, 255,},
+  {128, 161, 227, 160, 182, 246, 185, 255, 248, 255,},
+  {129, 162, 228, 161, 182, 246, 186, 255, 248, 255,},
+  {130, 163, 228, 161, 182, 247, 187, 255, 248, 255,},
+  {131, 164, 229, 162, 183, 247, 187, 255, 249, 255,},
+  {132, 165, 230, 163, 183, 247, 188, 255, 249, 255,},
+  {133, 166, 230, 163, 184, 248, 189, 255, 249, 255,},
+  {134, 166, 231, 164, 184, 248, 189, 255, 249, 255,},
+  {135, 167, 231, 164, 184, 248, 190, 255, 250, 255,},
+  {136, 168, 232, 165, 185, 248, 191, 255, 250, 255,},
+  {137, 169, 232, 166, 185, 248, 191, 255, 250, 255,},
+  {138, 170, 233, 166, 186, 249, 192, 255, 250, 255,},
+  {139, 171, 233, 167, 186, 249, 192, 255, 250, 255,},
+  {140, 172, 234, 167, 187, 249, 193, 255, 251, 255,},
+  {141, 173, 234, 168, 187, 249, 194, 255, 251, 255,},
+  {142, 174, 235, 169, 187, 250, 194, 255, 251, 255,},
+  {143, 175, 235, 169, 188, 250, 195, 255, 251, 255,},
+  {144, 176, 236, 170, 188, 250, 196, 255, 251, 255,},
+  {145, 177, 236, 170, 189, 250, 196, 255, 251, 255,},
+  {146, 177, 237, 171, 189, 250, 197, 255, 252, 255,},
+  {147, 178, 237, 172, 189, 251, 198, 255, 252, 255,},
+  {148, 179, 238, 172, 190, 251, 198, 255, 252, 255,},
+  {149, 180, 238, 173, 190, 251, 199, 255, 252, 255,},
+  {150, 181, 238, 173, 191, 251, 200, 255, 252, 255,},
+  {151, 182, 239, 174, 191, 251, 200, 255, 252, 255,},
+  {152, 183, 239, 175, 192, 251, 201, 255, 252, 255,},
+  {153, 184, 240, 175, 192, 252, 202, 255, 252, 255,},
+  {154, 184, 240, 176, 193, 252, 202, 255, 253, 255,},
+  {155, 185, 240, 177, 193, 252, 203, 255, 253, 255,},
+  {156, 186, 241, 177, 193, 252, 203, 255, 253, 255,},
+  {157, 187, 241, 178, 194, 252, 204, 255, 253, 255,},
+  {158, 188, 242, 178, 194, 252, 205, 255, 253, 255,},
+  {159, 189, 242, 179, 195, 252, 205, 255, 253, 255,},
+  {160, 190, 242, 180, 195, 253, 206, 255, 253, 255,},
+  {161, 190, 243, 180, 196, 253, 207, 255, 253, 255,},
+  {162, 191, 243, 181, 196, 253, 207, 255, 254, 255,},
+  {163, 192, 243, 182, 197, 253, 208, 255, 254, 255,},
+  {164, 193, 244, 182, 197, 253, 209, 255, 254, 255,},
+  {165, 194, 244, 183, 197, 253, 209, 255, 254, 255,},
+  {166, 195, 244, 184, 198, 253, 210, 255, 254, 255,},
+  {167, 196, 245, 184, 198, 253, 210, 255, 254, 255,},
+  {168, 196, 245, 185, 199, 253, 211, 255, 254, 255,},
+  {169, 197, 245, 186, 199, 254, 212, 255, 254, 255,},
+  {170, 198, 246, 186, 200, 254, 212, 255, 254, 255,},
+  {171, 199, 246, 187, 200, 254, 213, 255, 254, 255,},
+  {172, 200, 246, 188, 201, 254, 214, 255, 254, 255,},
+  {173, 200, 246, 188, 201, 254, 214, 255, 254, 255,},
+  {174, 201, 247, 189, 202, 254, 215, 255, 254, 255,},
+  {175, 202, 247, 189, 202, 254, 215, 255, 255, 255,},
+  {176, 203, 247, 190, 203, 254, 216, 255, 255, 255,},
+  {177, 204, 248, 191, 203, 254, 217, 255, 255, 255,},
+  {178, 204, 248, 191, 204, 254, 217, 255, 255, 255,},
+  {179, 205, 248, 192, 204, 254, 218, 255, 255, 255,},
+  {180, 206, 248, 193, 204, 254, 218, 255, 255, 255,},
+  {181, 207, 249, 194, 205, 255, 219, 255, 255, 255,},
+  {182, 208, 249, 194, 205, 255, 220, 255, 255, 255,},
+  {183, 208, 249, 195, 206, 255, 220, 255, 255, 255,},
+  {184, 209, 249, 196, 206, 255, 221, 255, 255, 255,},
+  {185, 210, 250, 196, 207, 255, 221, 255, 255, 255,},
+  {186, 211, 250, 197, 207, 255, 222, 255, 255, 255,},
+  {187, 211, 250, 198, 208, 255, 223, 255, 255, 255,},
+  {188, 212, 250, 198, 208, 255, 223, 255, 255, 255,},
+  {189, 213, 250, 199, 209, 255, 224, 255, 255, 255,},
+  {190, 214, 251, 200, 209, 255, 224, 255, 255, 255,},
+  {191, 215, 251, 200, 210, 255, 225, 255, 255, 255,},
+  {192, 215, 251, 201, 211, 255, 225, 255, 255, 255,},
+  {193, 216, 251, 202, 211, 255, 226, 255, 255, 255,},
+  {194, 217, 251, 203, 212, 255, 227, 255, 255, 255,},
+  {195, 218, 252, 203, 212, 255, 227, 255, 255, 255,},
+  {196, 218, 252, 204, 213, 255, 228, 255, 255, 255,},
+  {197, 219, 252, 205, 213, 255, 228, 255, 255, 255,},
+  {198, 220, 252, 205, 214, 255, 229, 255, 255, 255,},
+  {199, 221, 252, 206, 214, 255, 229, 255, 255, 255,},
+  {200, 221, 252, 207, 215, 255, 230, 255, 255, 255,},
+  {201, 222, 252, 208, 215, 255, 231, 255, 255, 255,},
+  {202, 223, 253, 208, 216, 255, 231, 255, 255, 255,},
+  {203, 223, 253, 209, 216, 255, 232, 255, 255, 255,},
+  {204, 224, 253, 210, 217, 255, 232, 255, 255, 255,},
+  {205, 225, 253, 211, 218, 255, 233, 255, 255, 255,},
+  {206, 226, 253, 211, 218, 255, 233, 255, 255, 255,},
+  {207, 226, 253, 212, 219, 255, 234, 255, 255, 255,},
+  {208, 227, 253, 213, 219, 255, 234, 255, 255, 255,},
+  {209, 228, 254, 214, 220, 255, 235, 255, 255, 255,},
+  {210, 228, 254, 214, 220, 255, 236, 255, 255, 255,},
+  {211, 229, 254, 215, 221, 255, 236, 255, 255, 255,},
+  {212, 230, 254, 216, 222, 255, 237, 255, 255, 255,},
+  {213, 230, 254, 217, 222, 255, 237, 255, 255, 255,},
+  {214, 231, 254, 217, 223, 255, 238, 255, 255, 255,},
+  {215, 232, 254, 218, 223, 255, 238, 255, 255, 255,},
+  {216, 233, 254, 219, 224, 255, 239, 255, 255, 255,},
+  {217, 233, 254, 220, 225, 255, 239, 255, 255, 255,},
+  {218, 234, 255, 220, 225, 255, 240, 255, 255, 255,},
+  {219, 235, 255, 221, 226, 255, 240, 255, 255, 255,},
+  {220, 235, 255, 222, 226, 255, 241, 255, 255, 255,},
+  {221, 236, 255, 223, 227, 255, 241, 255, 255, 255,},
+  {222, 237, 255, 224, 228, 255, 242, 255, 255, 255,},
+  {223, 237, 255, 224, 228, 255, 242, 255, 255, 255,},
+  {224, 238, 255, 225, 229, 255, 243, 255, 255, 255,},
+  {225, 238, 255, 226, 230, 255, 243, 255, 255, 255,},
+  {226, 239, 255, 227, 230, 255, 244, 255, 255, 255,},
+  {227, 240, 255, 228, 231, 255, 244, 255, 255, 255,},
+  {228, 240, 255, 228, 232, 255, 245, 255, 255, 255,},
+  {229, 241, 255, 229, 232, 255, 245, 255, 255, 255,},
+  {230, 242, 255, 230, 233, 255, 246, 255, 255, 255,},
+  {231, 242, 255, 231, 234, 255, 246, 255, 255, 255,},
+  {232, 243, 255, 232, 234, 255, 247, 255, 255, 255,},
+  {233, 243, 255, 233, 235, 255, 247, 255, 255, 255,},
+  {234, 244, 255, 233, 236, 255, 247, 255, 255, 255,},
+  {235, 245, 255, 234, 236, 255, 248, 255, 255, 255,},
+  {236, 245, 255, 235, 237, 255, 248, 255, 255, 255,},
+  {237, 246, 255, 236, 238, 255, 249, 255, 255, 255,},
+  {238, 247, 255, 237, 239, 255, 249, 255, 255, 255,},
+  {239, 247, 255, 238, 239, 255, 250, 255, 255, 255,},
+  {240, 248, 255, 239, 240, 255, 250, 255, 255, 255,},
+  {241, 248, 255, 240, 241, 255, 251, 255, 255, 255,},
+  {242, 249, 255, 241, 242, 255, 251, 255, 255, 255,},
+  {243, 249, 255, 241, 243, 255, 251, 255, 255, 255,},
+  {244, 250, 255, 242, 243, 255, 252, 255, 255, 255,},
+  {245, 251, 255, 243, 244, 255, 252, 255, 255, 255,},
+  {246, 251, 255, 244, 245, 255, 253, 255, 255, 255,},
+  {247, 252, 255, 245, 246, 255, 253, 255, 255, 255,},
+  {248, 252, 255, 246, 247, 255, 253, 255, 255, 255,},
+  {249, 253, 255, 247, 248, 255, 254, 255, 255, 255,},
+  {250, 253, 255, 248, 249, 255, 254, 255, 255, 255,},
+  {251, 254, 255, 249, 250, 255, 254, 255, 255, 255,},
+  {252, 254, 255, 251, 251, 255, 255, 255, 255, 255,},
+  {253, 255, 255, 252, 252, 255, 255, 255, 255, 255,},
+  {254, 255, 255, 253, 253, 255, 255, 255, 255, 255,},
+  {255, 255, 255, 254, 254, 255, 255, 255, 255, 255,},
+};
+
+const vp9_prob vp9_modelcoefprobs_gg875p1[COEFPROB_MODELS][ENTROPY_NODES - 1] = {
+  // Probs generated with a Generalized Gaussian (with shape parameter 0.625)
+  // source model with varying quantizer step size for a uniform quantizer
+  {0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},  // do not use
+  {1,   1,   3,  86, 128,   6,  86,  22,  89,  28,},
+  {1,   2,   6,  86, 129,  11,  87,  42,  92,  52,},
+  {2,   3,   9,  87, 129,  17,  88,  59,  94,  73,},
+  {2,   4,  12,  87, 129,  22,  89,  75,  97,  92,},
+  {3,   5,  14,  88, 130,  27,  89,  90, 100, 108,},
+  {3,   6,  17,  88, 130,  33,  90, 103, 102, 122,},
+  {4,   7,  20,  88, 130,  37,  91, 115, 105, 135,},
+  {4,   8,  23,  89, 131,  42,  92, 126, 108, 147,},
+  {5,   9,  25,  89, 131,  47,  92, 137, 110, 157,},
+  {5,  10,  28,  90, 131,  52,  93, 146, 113, 167,},
+  {6,  11,  31,  90, 132,  56,  94, 154, 115, 175,},
+  {6,  12,  33,  90, 132,  60,  94, 162, 118, 183,},
+  {7,  13,  36,  91, 132,  65,  95, 170, 120, 190,},
+  {7,  14,  39,  91, 132,  69,  96, 176, 123, 196,},
+  {8,  15,  41,  92, 133,  73,  96, 182, 125, 201,},
+  {8,  16,  44,  92, 133,  77,  97, 188, 128, 206,},
+  {9,  17,  46,  92, 133,  81,  98, 193, 130, 211,},
+  {9,  18,  49,  93, 134,  85,  99, 198, 133, 215,},
+  {10,  19,  51,  93, 134,  89,  99, 203, 135, 219,},
+  {10,  20,  54,  93, 134,  92, 100, 207, 137, 222,},
+  {11,  21,  56,  94, 134,  96, 101, 211, 140, 226,},
+  {12,  22,  58,  94, 135, 100, 101, 214, 142, 228,},
+  {12,  23,  61,  95, 135, 103, 102, 217, 145, 231,},
+  {13,  24,  63,  95, 135, 106, 103, 220, 147, 233,},
+  {13,  25,  66,  95, 136, 110, 103, 223, 149, 235,},
+  {14,  26,  68,  96, 136, 113, 104, 226, 151, 237,},
+  {14,  27,  70,  96, 136, 116, 105, 228, 154, 239,},
+  {15,  28,  72,  97, 136, 119, 106, 230, 156, 241,},
+  {15,  29,  75,  97, 137, 122, 106, 232, 158, 242,},
+  {16,  30,  77,  97, 137, 125, 107, 234, 160, 243,},
+  {17,  31,  79,  98, 137, 128, 108, 236, 163, 245,},
+  {17,  32,  81,  98, 138, 131, 108, 237, 165, 246,},
+  {18,  33,  83,  99, 138, 134, 109, 239, 167, 247,},
+  {18,  34,  86,  99, 138, 137, 110, 240, 169, 248,},
+  {19,  35,  88,  99, 138, 140, 111, 242, 171, 248,},
+  {19,  36,  90, 100, 139, 142, 111, 243, 173, 249,},
+  {20,  37,  92, 100, 139, 145, 112, 244, 175, 250,},
+  {20,  38,  94, 101, 139, 148, 113, 245, 177, 250,},
+  {21,  39,  96, 101, 140, 150, 113, 246, 179, 251,},
+  {22,  40,  98, 101, 140, 153, 114, 246, 181, 251,},
+  {22,  41, 100, 102, 140, 155, 115, 247, 183, 252,},
+  {23,  42, 102, 102, 140, 157, 116, 248, 185, 252,},
+  {23,  43, 104, 103, 141, 160, 116, 249, 186, 253,},
+  {24,  44, 106, 103, 141, 162, 117, 249, 188, 253,},
+  {25,  45, 108, 103, 141, 164, 118, 250, 190, 253,},
+  {25,  46, 110, 104, 142, 166, 119, 250, 192, 253,},
+  {26,  47, 112, 104, 142, 168, 119, 251, 193, 254,},
+  {26,  48, 114, 105, 142, 171, 120, 251, 195, 254,},
+  {27,  49, 116, 105, 143, 173, 121, 252, 197, 254,},
+  {27,  50, 118, 105, 143, 175, 122, 252, 198, 254,},
+  {28,  51, 119, 106, 143, 177, 122, 252, 200, 254,},
+  {29,  52, 121, 106, 143, 179, 123, 253, 201, 255,},
+  {29,  53, 123, 107, 144, 180, 124, 253, 203, 255,},
+  {30,  54, 125, 107, 144, 182, 125, 253, 204, 255,},
+  {30,  55, 127, 108, 144, 184, 125, 253, 206, 255,},
+  {31,  56, 128, 108, 145, 186, 126, 254, 207, 255,},
+  {32,  57, 130, 108, 145, 188, 127, 254, 209, 255,},
+  {32,  58, 132, 109, 145, 189, 128, 254, 210, 255,},
+  {33,  59, 134, 109, 146, 191, 128, 254, 211, 255,},
+  {33,  60, 135, 110, 146, 193, 129, 254, 213, 255,},
+  {34,  61, 137, 110, 146, 194, 130, 254, 214, 255,},
+  {35,  62, 139, 111, 146, 196, 131, 255, 215, 255,},
+  {35,  63, 140, 111, 147, 197, 131, 255, 216, 255,},
+  {36,  64, 142, 112, 147, 199, 132, 255, 218, 255,},
+  {37,  65, 144, 112, 147, 200, 133, 255, 219, 255,},
+  {37,  66, 145, 112, 148, 202, 134, 255, 220, 255,},
+  {38,  67, 147, 113, 148, 203, 135, 255, 221, 255,},
+  {38,  68, 148, 113, 148, 204, 135, 255, 222, 255,},
+  {39,  69, 150, 114, 149, 206, 136, 255, 223, 255,},
+  {40,  70, 151, 114, 149, 207, 137, 255, 224, 255,},
+  {40,  71, 153, 115, 149, 208, 138, 255, 225, 255,},
+  {41,  72, 154, 115, 150, 210, 138, 255, 226, 255,},
+  {42,  73, 156, 116, 150, 211, 139, 255, 227, 255,},
+  {42,  74, 157, 116, 150, 212, 140, 255, 228, 255,},
+  {43,  75, 159, 117, 151, 213, 141, 255, 229, 255,},
+  {44,  76, 160, 117, 151, 214, 142, 255, 230, 255,},
+  {44,  77, 162, 117, 151, 216, 142, 255, 231, 255,},
+  {45,  78, 163, 118, 152, 217, 143, 255, 231, 255,},
+  {45,  79, 165, 118, 152, 218, 144, 255, 232, 255,},
+  {46,  80, 166, 119, 152, 219, 145, 255, 233, 255,},
+  {47,  81, 167, 119, 153, 220, 146, 255, 234, 255,},
+  {47,  82, 169, 120, 153, 221, 146, 255, 235, 255,},
+  {48,  83, 170, 120, 153, 222, 147, 255, 235, 255,},
+  {49,  84, 171, 121, 154, 223, 148, 255, 236, 255,},
+  {49,  85, 173, 121, 154, 224, 149, 255, 237, 255,},
+  {50,  86, 174, 122, 154, 225, 150, 255, 237, 255,},
+  {51,  87, 175, 122, 155, 225, 150, 255, 238, 255,},
+  {51,  88, 177, 123, 155, 226, 151, 255, 239, 255,},
+  {52,  89, 178, 123, 155, 227, 152, 255, 239, 255,},
+  {53,  90, 179, 124, 156, 228, 153, 255, 240, 255,},
+  {53,  91, 180, 124, 156, 229, 154, 255, 240, 255,},
+  {54,  92, 182, 125, 156, 230, 154, 255, 241, 255,},
+  {55,  93, 183, 125, 157, 230, 155, 255, 241, 255,},
+  {55,  94, 184, 126, 157, 231, 156, 255, 242, 255,},
+  {56,  95, 185, 126, 157, 232, 157, 255, 242, 255,},
+  {57,  96, 187, 127, 158, 233, 158, 255, 243, 255,},
+  {57,  97, 188, 127, 158, 233, 159, 255, 243, 255,},
+  {58,  98, 189, 128, 158, 234, 159, 255, 244, 255,},
+  {59,  99, 190, 128, 159, 235, 160, 255, 244, 255,},
+  {60, 100, 191, 129, 159, 235, 161, 255, 245, 255,},
+  {60, 101, 192, 129, 160, 236, 162, 255, 245, 255,},
+  {61, 102, 193, 130, 160, 237, 163, 255, 246, 255,},
+  {62, 103, 194, 131, 160, 237, 164, 255, 246, 255,},
+  {62, 104, 196, 131, 161, 238, 164, 255, 246, 255,},
+  {63, 105, 197, 132, 161, 238, 165, 255, 247, 255,},
+  {64, 106, 198, 132, 161, 239, 166, 255, 247, 255,},
+  {64, 107, 199, 133, 162, 239, 167, 255, 247, 255,},
+  {65, 108, 200, 133, 162, 240, 168, 255, 248, 255,},
+  {66, 109, 201, 134, 163, 241, 168, 255, 248, 255,},
+  {67, 110, 202, 134, 163, 241, 169, 255, 248, 255,},
+  {67, 111, 203, 135, 163, 242, 170, 255, 249, 255,},
+  {68, 112, 204, 135, 164, 242, 171, 255, 249, 255,},
+  {69, 113, 205, 136, 164, 242, 172, 255, 249, 255,},
+  {69, 114, 206, 137, 164, 243, 173, 255, 250, 255,},
+  {70, 115, 207, 137, 165, 243, 173, 255, 250, 255,},
+  {71, 116, 208, 138, 165, 244, 174, 255, 250, 255,},
+  {72, 117, 208, 138, 166, 244, 175, 255, 250, 255,},
+  {72, 118, 209, 139, 166, 245, 176, 255, 251, 255,},
+  {73, 119, 210, 139, 166, 245, 177, 255, 251, 255,},
+  {74, 120, 211, 140, 167, 245, 178, 255, 251, 255,},
+  {75, 121, 212, 141, 167, 246, 178, 255, 251, 255,},
+  {75, 122, 213, 141, 168, 246, 179, 255, 251, 255,},
+  {76, 123, 214, 142, 168, 246, 180, 255, 252, 255,},
+  {77, 124, 215, 142, 168, 247, 181, 255, 252, 255,},
+  {78, 125, 215, 143, 169, 247, 182, 255, 252, 255,},
+  {78, 126, 216, 144, 169, 247, 182, 255, 252, 255,},
+  {79, 127, 217, 144, 170, 248, 183, 255, 252, 255,},
+  {80, 128, 218, 145, 170, 248, 184, 255, 253, 255,},
+  {81, 129, 219, 145, 170, 248, 185, 255, 253, 255,},
+  {82, 130, 219, 146, 171, 249, 186, 255, 253, 255,},
+  {82, 131, 220, 147, 171, 249, 187, 255, 253, 255,},
+  {83, 132, 221, 147, 172, 249, 187, 255, 253, 255,},
+  {84, 133, 222, 148, 172, 249, 188, 255, 253, 255,},
+  {85, 134, 222, 148, 173, 250, 189, 255, 253, 255,},
+  {85, 135, 223, 149, 173, 250, 190, 255, 254, 255,},
+  {86, 136, 224, 150, 173, 250, 191, 255, 254, 255,},
+  {87, 137, 225, 150, 174, 250, 191, 255, 254, 255,},
+  {88, 138, 225, 151, 174, 251, 192, 255, 254, 255,},
+  {89, 139, 226, 152, 175, 251, 193, 255, 254, 255,},
+  {89, 140, 227, 152, 175, 251, 194, 255, 254, 255,},
+  {90, 141, 227, 153, 176, 251, 195, 255, 254, 255,},
+  {91, 142, 228, 153, 176, 251, 195, 255, 254, 255,},
+  {92, 143, 229, 154, 176, 252, 196, 255, 254, 255,},
+  {93, 144, 229, 155, 177, 252, 197, 255, 254, 255,},
+  {93, 145, 230, 155, 177, 252, 198, 255, 255, 255,},
+  {94, 146, 231, 156, 178, 252, 199, 255, 255, 255,},
+  {95, 147, 231, 157, 178, 252, 199, 255, 255, 255,},
+  {96, 148, 232, 157, 179, 252, 200, 255, 255, 255,},
+  {97, 149, 232, 158, 179, 253, 201, 255, 255, 255,},
+  {98, 150, 233, 159, 180, 253, 202, 255, 255, 255,},
+  {99, 151, 234, 159, 180, 253, 202, 255, 255, 255,},
+  {99, 152, 234, 160, 181, 253, 203, 255, 255, 255,},
+  {100, 153, 235, 161, 181, 253, 204, 255, 255, 255,},
+  {101, 154, 235, 162, 182, 253, 205, 255, 255, 255,},
+  {102, 155, 236, 162, 182, 253, 206, 255, 255, 255,},
+  {103, 156, 236, 163, 183, 254, 206, 255, 255, 255,},
+  {104, 157, 237, 164, 183, 254, 207, 255, 255, 255,},
+  {105, 158, 237, 164, 183, 254, 208, 255, 255, 255,},
+  {105, 159, 238, 165, 184, 254, 209, 255, 255, 255,},
+  {106, 160, 238, 166, 184, 254, 209, 255, 255, 255,},
+  {107, 161, 239, 166, 185, 254, 210, 255, 255, 255,},
+  {108, 162, 239, 167, 185, 254, 211, 255, 255, 255,},
+  {109, 163, 240, 168, 186, 254, 212, 255, 255, 255,},
+  {110, 164, 240, 169, 186, 254, 212, 255, 255, 255,},
+  {111, 165, 241, 169, 187, 254, 213, 255, 255, 255,},
+  {112, 166, 241, 170, 187, 255, 214, 255, 255, 255,},
+  {113, 167, 242, 171, 188, 255, 215, 255, 255, 255,},
+  {114, 168, 242, 172, 189, 255, 215, 255, 255, 255,},
+  {114, 169, 242, 172, 189, 255, 216, 255, 255, 255,},
+  {115, 170, 243, 173, 190, 255, 217, 255, 255, 255,},
+  {116, 171, 243, 174, 190, 255, 217, 255, 255, 255,},
+  {117, 172, 244, 175, 191, 255, 218, 255, 255, 255,},
+  {118, 173, 244, 175, 191, 255, 219, 255, 255, 255,},
+  {119, 174, 244, 176, 192, 255, 220, 255, 255, 255,},
+  {120, 175, 245, 177, 192, 255, 220, 255, 255, 255,},
+  {121, 176, 245, 178, 193, 255, 221, 255, 255, 255,},
+  {122, 177, 245, 178, 193, 255, 222, 255, 255, 255,},
+  {123, 178, 246, 179, 194, 255, 222, 255, 255, 255,},
+  {124, 179, 246, 180, 194, 255, 223, 255, 255, 255,},
+  {125, 180, 247, 181, 195, 255, 224, 255, 255, 255,},
+  {126, 181, 247, 182, 196, 255, 224, 255, 255, 255,},
+  {127, 182, 247, 182, 196, 255, 225, 255, 255, 255,},
+  {128, 183, 247, 183, 197, 255, 226, 255, 255, 255,},
+  {129, 184, 248, 184, 197, 255, 226, 255, 255, 255,},
+  {130, 185, 248, 185, 198, 255, 227, 255, 255, 255,},
+  {131, 186, 248, 186, 198, 255, 228, 255, 255, 255,},
+  {132, 187, 249, 186, 199, 255, 228, 255, 255, 255,},
+  {133, 188, 249, 187, 200, 255, 229, 255, 255, 255,},
+  {134, 189, 249, 188, 200, 255, 230, 255, 255, 255,},
+  {135, 190, 249, 189, 201, 255, 230, 255, 255, 255,},
+  {136, 191, 250, 190, 201, 255, 231, 255, 255, 255,},
+  {137, 192, 250, 191, 202, 255, 231, 255, 255, 255,},
+  {138, 193, 250, 191, 203, 255, 232, 255, 255, 255,},
+  {139, 194, 250, 192, 203, 255, 233, 255, 255, 255,},
+  {140, 195, 251, 193, 204, 255, 233, 255, 255, 255,},
+  {142, 196, 251, 194, 204, 255, 234, 255, 255, 255,},
+  {143, 197, 251, 195, 205, 255, 234, 255, 255, 255,},
+  {144, 198, 251, 196, 206, 255, 235, 255, 255, 255,},
+  {145, 199, 252, 197, 206, 255, 236, 255, 255, 255,},
+  {146, 200, 252, 197, 207, 255, 236, 255, 255, 255,},
+  {147, 201, 252, 198, 208, 255, 237, 255, 255, 255,},
+  {148, 202, 252, 199, 208, 255, 237, 255, 255, 255,},
+  {149, 203, 252, 200, 209, 255, 238, 255, 255, 255,},
+  {151, 204, 253, 201, 210, 255, 238, 255, 255, 255,},
+  {152, 205, 253, 202, 210, 255, 239, 255, 255, 255,},
+  {153, 206, 253, 203, 211, 255, 239, 255, 255, 255,},
+  {154, 207, 253, 204, 212, 255, 240, 255, 255, 255,},
+  {155, 208, 253, 205, 212, 255, 241, 255, 255, 255,},
+  {157, 209, 253, 206, 213, 255, 241, 255, 255, 255,},
+  {158, 210, 253, 206, 214, 255, 242, 255, 255, 255,},
+  {159, 211, 254, 207, 214, 255, 242, 255, 255, 255,},
+  {160, 212, 254, 208, 215, 255, 243, 255, 255, 255,},
+  {162, 213, 254, 209, 216, 255, 243, 255, 255, 255,},
+  {163, 214, 254, 210, 217, 255, 244, 255, 255, 255,},
+  {164, 215, 254, 211, 217, 255, 244, 255, 255, 255,},
+  {165, 216, 254, 212, 218, 255, 244, 255, 255, 255,},
+  {167, 217, 254, 213, 219, 255, 245, 255, 255, 255,},
+  {168, 218, 254, 214, 219, 255, 245, 255, 255, 255,},
+  {169, 219, 255, 215, 220, 255, 246, 255, 255, 255,},
+  {171, 220, 255, 216, 221, 255, 246, 255, 255, 255,},
+  {172, 221, 255, 217, 222, 255, 247, 255, 255, 255,},
+  {174, 222, 255, 218, 223, 255, 247, 255, 255, 255,},
+  {175, 223, 255, 219, 223, 255, 248, 255, 255, 255,},
+  {177, 224, 255, 220, 224, 255, 248, 255, 255, 255,},
+  {178, 225, 255, 221, 225, 255, 248, 255, 255, 255,},
+  {179, 226, 255, 222, 226, 255, 249, 255, 255, 255,},
+  {181, 227, 255, 223, 227, 255, 249, 255, 255, 255,},
+  {182, 228, 255, 224, 227, 255, 250, 255, 255, 255,},
+  {184, 229, 255, 225, 228, 255, 250, 255, 255, 255,},
+  {186, 230, 255, 226, 229, 255, 250, 255, 255, 255,},
+  {187, 231, 255, 227, 230, 255, 251, 255, 255, 255,},
+  {189, 232, 255, 228, 231, 255, 251, 255, 255, 255,},
+  {190, 233, 255, 229, 232, 255, 251, 255, 255, 255,},
+  {192, 234, 255, 230, 232, 255, 252, 255, 255, 255,},
+  {194, 235, 255, 231, 233, 255, 252, 255, 255, 255,},
+  {196, 236, 255, 232, 234, 255, 252, 255, 255, 255,},
+  {197, 237, 255, 233, 235, 255, 253, 255, 255, 255,},
+  {199, 238, 255, 234, 236, 255, 253, 255, 255, 255,},
+  {201, 239, 255, 235, 237, 255, 253, 255, 255, 255,},
+  {203, 240, 255, 237, 238, 255, 253, 255, 255, 255,},
+  {205, 241, 255, 238, 239, 255, 254, 255, 255, 255,},
+  {207, 242, 255, 239, 240, 255, 254, 255, 255, 255,},
+  {209, 243, 255, 240, 241, 255, 254, 255, 255, 255,},
+  {211, 244, 255, 241, 242, 255, 254, 255, 255, 255,},
+  {214, 245, 255, 242, 243, 255, 255, 255, 255, 255,},
+  {216, 246, 255, 243, 244, 255, 255, 255, 255, 255,},
+  {218, 247, 255, 244, 245, 255, 255, 255, 255, 255,},
+  {221, 248, 255, 246, 246, 255, 255, 255, 255, 255,},
+  {224, 249, 255, 247, 247, 255, 255, 255, 255, 255,},
+  {226, 250, 255, 248, 248, 255, 255, 255, 255, 255,},
+  {229, 251, 255, 249, 249, 255, 255, 255, 255, 255,},
+  {233, 252, 255, 251, 251, 255, 255, 255, 255, 255,},
+  {236, 253, 255, 252, 252, 255, 255, 255, 255, 255,},
+  {241, 254, 255, 253, 253, 255, 255, 255, 255, 255,},
+  {246, 255, 255, 254, 254, 255, 255, 255, 255, 255,},
+};
+
+const vp9_prob vp9_modelcoefprobs_gg75p1[COEFPROB_MODELS][ENTROPY_NODES - 1] = {
+  // Probs generated with a Generalized Gaussian (with shape parameter 0.625)
+  // source model with varying quantizer step size for a uniform quantizer
+  {0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},  // do not use
+  {1,   1,   3,  86, 129,   6,  87,  21,  90,  26,},
+  {1,   2,   6,  87, 129,  11,  88,  39,  93,  47,},
+  {2,   3,   9,  87, 130,  16,  89,  55,  96,  65,},
+  {2,   4,  11,  88, 130,  21,  89,  69,  98,  81,},
+  {3,   5,  14,  88, 130,  26,  90,  82, 101,  95,},
+  {3,   6,  17,  89, 131,  31,  91,  94, 103, 107,},
+  {4,   7,  20,  89, 131,  35,  92, 105, 105, 119,},
+  {4,   8,  22,  90, 131,  40,  92, 115, 108, 129,},
+  {5,   9,  25,  90, 132,  44,  93, 124, 110, 138,},
+  {5,  10,  27,  91, 132,  48,  94, 133, 112, 147,},
+  {6,  11,  30,  91, 132,  52,  95, 141, 114, 155,},
+  {6,  12,  32,  92, 133,  56,  95, 148, 116, 162,},
+  {7,  13,  35,  92, 133,  60,  96, 155, 118, 168,},
+  {7,  14,  37,  92, 133,  64,  97, 161, 121, 174,},
+  {8,  15,  40,  93, 134,  68,  97, 167, 123, 180,},
+  {9,  16,  42,  93, 134,  71,  98, 173, 125, 185,},
+  {9,  17,  44,  94, 134,  75,  99, 178, 127, 190,},
+  {10,  18,  47,  94, 135,  78,  99, 182, 129, 195,},
+  {10,  19,  49,  94, 135,  82, 100, 187, 131, 199,},
+  {11,  20,  51,  95, 135,  85, 100, 191, 133, 202,},
+  {11,  21,  54,  95, 135,  88, 101, 195, 135, 206,},
+  {12,  22,  56,  96, 136,  92, 102, 199, 137, 209,},
+  {13,  23,  58,  96, 136,  95, 102, 202, 138, 213,},
+  {13,  24,  61,  96, 136,  98, 103, 206, 140, 215,},
+  {14,  25,  63,  97, 137, 101, 104, 209, 142, 218,},
+  {14,  26,  65,  97, 137, 104, 104, 211, 144, 221,},
+  {15,  27,  67,  98, 137, 107, 105, 214, 146, 223,},
+  {15,  28,  69,  98, 138, 110, 106, 217, 148, 225,},
+  {16,  29,  71,  98, 138, 113, 106, 219, 150, 227,},
+  {17,  30,  73,  99, 138, 115, 107, 221, 151, 229,},
+  {17,  31,  76,  99, 138, 118, 107, 223, 153, 231,},
+  {18,  32,  78, 100, 139, 121, 108, 225, 155, 232,},
+  {18,  33,  80, 100, 139, 123, 109, 227, 157, 234,},
+  {19,  34,  82, 100, 139, 126, 109, 229, 158, 235,},
+  {20,  35,  84, 101, 140, 128, 110, 231, 160, 237,},
+  {20,  36,  86, 101, 140, 131, 111, 232, 162, 238,},
+  {21,  37,  88, 102, 140, 133, 111, 234, 164, 239,},
+  {21,  38,  90, 102, 140, 136, 112, 235, 165, 240,},
+  {22,  39,  92, 102, 141, 138, 112, 236, 167, 241,},
+  {23,  40,  94, 103, 141, 140, 113, 237, 169, 242,},
+  {23,  41,  95, 103, 141, 143, 114, 238, 170, 243,},
+  {24,  42,  97, 103, 142, 145, 114, 240, 172, 244,},
+  {25,  43,  99, 104, 142, 147, 115, 241, 173, 245,},
+  {25,  44, 101, 104, 142, 149, 116, 242, 175, 246,},
+  {26,  45, 103, 105, 142, 151, 116, 242, 176, 246,},
+  {26,  46, 105, 105, 143, 153, 117, 243, 178, 247,},
+  {27,  47, 107, 105, 143, 156, 117, 244, 180, 248,},
+  {28,  48, 108, 106, 143, 158, 118, 245, 181, 248,},
+  {28,  49, 110, 106, 144, 159, 119, 245, 182, 249,},
+  {29,  50, 112, 107, 144, 161, 119, 246, 184, 249,},
+  {30,  51, 114, 107, 144, 163, 120, 247, 185, 250,},
+  {30,  52, 115, 108, 144, 165, 121, 247, 187, 250,},
+  {31,  53, 117, 108, 145, 167, 121, 248, 188, 250,},
+  {32,  54, 119, 108, 145, 169, 122, 248, 190, 251,},
+  {32,  55, 121, 109, 145, 171, 123, 249, 191, 251,},
+  {33,  56, 122, 109, 146, 172, 123, 249, 192, 251,},
+  {34,  57, 124, 110, 146, 174, 124, 250, 194, 252,},
+  {34,  58, 126, 110, 146, 176, 125, 250, 195, 252,},
+  {35,  59, 127, 110, 147, 177, 125, 250, 196, 252,},
+  {36,  60, 129, 111, 147, 179, 126, 251, 197, 253,},
+  {36,  61, 130, 111, 147, 181, 127, 251, 199, 253,},
+  {37,  62, 132, 112, 147, 182, 127, 251, 200, 253,},
+  {38,  63, 134, 112, 148, 184, 128, 252, 201, 253,},
+  {38,  64, 135, 112, 148, 185, 128, 252, 202, 253,},
+  {39,  65, 137, 113, 148, 187, 129, 252, 204, 254,},
+  {40,  66, 138, 113, 149, 188, 130, 253, 205, 254,},
+  {40,  67, 140, 114, 149, 190, 130, 253, 206, 254,},
+  {41,  68, 141, 114, 149, 191, 131, 253, 207, 254,},
+  {42,  69, 143, 115, 150, 192, 132, 253, 208, 254,},
+  {42,  70, 144, 115, 150, 194, 132, 253, 209, 254,},
+  {43,  71, 146, 115, 150, 195, 133, 254, 210, 254,},
+  {44,  72, 147, 116, 150, 197, 134, 254, 211, 255,},
+  {44,  73, 149, 116, 151, 198, 134, 254, 212, 255,},
+  {45,  74, 150, 117, 151, 199, 135, 254, 213, 255,},
+  {46,  75, 152, 117, 151, 200, 136, 254, 214, 255,},
+  {46,  76, 153, 118, 152, 202, 136, 254, 215, 255,},
+  {47,  77, 154, 118, 152, 203, 137, 254, 216, 255,},
+  {48,  78, 156, 119, 152, 204, 138, 254, 217, 255,},
+  {49,  79, 157, 119, 153, 205, 139, 255, 218, 255,},
+  {49,  80, 159, 119, 153, 206, 139, 255, 219, 255,},
+  {50,  81, 160, 120, 153, 207, 140, 255, 220, 255,},
+  {51,  82, 161, 120, 154, 208, 141, 255, 221, 255,},
+  {51,  83, 163, 121, 154, 210, 141, 255, 222, 255,},
+  {52,  84, 164, 121, 154, 211, 142, 255, 223, 255,},
+  {53,  85, 165, 122, 154, 212, 143, 255, 223, 255,},
+  {54,  86, 166, 122, 155, 213, 143, 255, 224, 255,},
+  {54,  87, 168, 123, 155, 214, 144, 255, 225, 255,},
+  {55,  88, 169, 123, 155, 215, 145, 255, 226, 255,},
+  {56,  89, 170, 123, 156, 216, 145, 255, 227, 255,},
+  {57,  90, 172, 124, 156, 217, 146, 255, 227, 255,},
+  {57,  91, 173, 124, 156, 218, 147, 255, 228, 255,},
+  {58,  92, 174, 125, 157, 218, 147, 255, 229, 255,},
+  {59,  93, 175, 125, 157, 219, 148, 255, 230, 255,},
+  {60,  94, 176, 126, 157, 220, 149, 255, 230, 255,},
+  {60,  95, 178, 126, 158, 221, 150, 255, 231, 255,},
+  {61,  96, 179, 127, 158, 222, 150, 255, 232, 255,},
+  {62,  97, 180, 127, 158, 223, 151, 255, 232, 255,},
+  {63,  98, 181, 128, 159, 224, 152, 255, 233, 255,},
+  {63,  99, 182, 128, 159, 224, 152, 255, 234, 255,},
+  {64, 100, 183, 129, 159, 225, 153, 255, 234, 255,},
+  {65, 101, 184, 129, 160, 226, 154, 255, 235, 255,},
+  {66, 102, 186, 130, 160, 227, 154, 255, 235, 255,},
+  {66, 103, 187, 130, 160, 227, 155, 255, 236, 255,},
+  {67, 104, 188, 131, 161, 228, 156, 255, 236, 255,},
+  {68, 105, 189, 131, 161, 229, 157, 255, 237, 255,},
+  {69, 106, 190, 132, 161, 230, 157, 255, 238, 255,},
+  {69, 107, 191, 132, 162, 230, 158, 255, 238, 255,},
+  {70, 108, 192, 133, 162, 231, 159, 255, 239, 255,},
+  {71, 109, 193, 133, 163, 232, 159, 255, 239, 255,},
+  {72, 110, 194, 134, 163, 232, 160, 255, 240, 255,},
+  {73, 111, 195, 134, 163, 233, 161, 255, 240, 255,},
+  {73, 112, 196, 135, 164, 233, 162, 255, 241, 255,},
+  {74, 113, 197, 135, 164, 234, 162, 255, 241, 255,},
+  {75, 114, 198, 136, 164, 235, 163, 255, 241, 255,},
+  {76, 115, 199, 136, 165, 235, 164, 255, 242, 255,},
+  {77, 116, 200, 137, 165, 236, 165, 255, 242, 255,},
+  {77, 117, 201, 137, 165, 236, 165, 255, 243, 255,},
+  {78, 118, 202, 138, 166, 237, 166, 255, 243, 255,},
+  {79, 119, 203, 138, 166, 237, 167, 255, 244, 255,},
+  {80, 120, 204, 139, 166, 238, 167, 255, 244, 255,},
+  {81, 121, 205, 139, 167, 238, 168, 255, 244, 255,},
+  {82, 122, 206, 140, 167, 239, 169, 255, 245, 255,},
+  {82, 123, 206, 141, 168, 239, 170, 255, 245, 255,},
+  {83, 124, 207, 141, 168, 240, 170, 255, 245, 255,},
+  {84, 125, 208, 142, 168, 240, 171, 255, 246, 255,},
+  {85, 126, 209, 142, 169, 241, 172, 255, 246, 255,},
+  {86, 127, 210, 143, 169, 241, 173, 255, 246, 255,},
+  {87, 128, 211, 143, 169, 242, 173, 255, 247, 255,},
+  {87, 129, 212, 144, 170, 242, 174, 255, 247, 255,},
+  {88, 130, 212, 144, 170, 242, 175, 255, 247, 255,},
+  {89, 131, 213, 145, 171, 243, 176, 255, 248, 255,},
+  {90, 132, 214, 146, 171, 243, 176, 255, 248, 255,},
+  {91, 133, 215, 146, 171, 244, 177, 255, 248, 255,},
+  {92, 134, 216, 147, 172, 244, 178, 255, 248, 255,},
+  {93, 135, 216, 147, 172, 244, 179, 255, 249, 255,},
+  {93, 136, 217, 148, 173, 245, 179, 255, 249, 255,},
+  {94, 137, 218, 148, 173, 245, 180, 255, 249, 255,},
+  {95, 138, 219, 149, 173, 245, 181, 255, 249, 255,},
+  {96, 139, 220, 150, 174, 246, 181, 255, 250, 255,},
+  {97, 140, 220, 150, 174, 246, 182, 255, 250, 255,},
+  {98, 141, 221, 151, 175, 246, 183, 255, 250, 255,},
+  {99, 142, 222, 151, 175, 247, 184, 255, 250, 255,},
+  {100, 143, 222, 152, 175, 247, 184, 255, 251, 255,},
+  {100, 144, 223, 153, 176, 247, 185, 255, 251, 255,},
+  {101, 145, 224, 153, 176, 248, 186, 255, 251, 255,},
+  {102, 146, 224, 154, 177, 248, 187, 255, 251, 255,},
+  {103, 147, 225, 154, 177, 248, 187, 255, 251, 255,},
+  {104, 148, 226, 155, 178, 248, 188, 255, 252, 255,},
+  {105, 149, 226, 156, 178, 249, 189, 255, 252, 255,},
+  {106, 150, 227, 156, 178, 249, 190, 255, 252, 255,},
+  {107, 151, 228, 157, 179, 249, 190, 255, 252, 255,},
+  {108, 152, 228, 158, 179, 249, 191, 255, 252, 255,},
+  {109, 153, 229, 158, 180, 250, 192, 255, 252, 255,},
+  {110, 154, 230, 159, 180, 250, 193, 255, 253, 255,},
+  {111, 155, 230, 159, 181, 250, 193, 255, 253, 255,},
+  {111, 156, 231, 160, 181, 250, 194, 255, 253, 255,},
+  {112, 157, 231, 161, 181, 251, 195, 255, 253, 255,},
+  {113, 158, 232, 161, 182, 251, 196, 255, 253, 255,},
+  {114, 159, 233, 162, 182, 251, 196, 255, 253, 255,},
+  {115, 160, 233, 163, 183, 251, 197, 255, 253, 255,},
+  {116, 161, 234, 163, 183, 251, 198, 255, 253, 255,},
+  {117, 162, 234, 164, 184, 252, 199, 255, 254, 255,},
+  {118, 163, 235, 165, 184, 252, 199, 255, 254, 255,},
+  {119, 164, 235, 165, 185, 252, 200, 255, 254, 255,},
+  {120, 165, 236, 166, 185, 252, 201, 255, 254, 255,},
+  {121, 166, 236, 167, 186, 252, 202, 255, 254, 255,},
+  {122, 167, 237, 167, 186, 252, 202, 255, 254, 255,},
+  {123, 168, 237, 168, 187, 253, 203, 255, 254, 255,},
+  {124, 169, 238, 169, 187, 253, 204, 255, 254, 255,},
+  {125, 170, 238, 169, 188, 253, 205, 255, 254, 255,},
+  {126, 171, 239, 170, 188, 253, 205, 255, 254, 255,},
+  {127, 172, 239, 171, 189, 253, 206, 255, 254, 255,},
+  {128, 173, 240, 172, 189, 253, 207, 255, 255, 255,},
+  {129, 174, 240, 172, 190, 253, 208, 255, 255, 255,},
+  {130, 175, 241, 173, 190, 253, 208, 255, 255, 255,},
+  {131, 176, 241, 174, 191, 254, 209, 255, 255, 255,},
+  {132, 177, 242, 175, 191, 254, 210, 255, 255, 255,},
+  {133, 178, 242, 175, 192, 254, 210, 255, 255, 255,},
+  {134, 179, 242, 176, 192, 254, 211, 255, 255, 255,},
+  {135, 180, 243, 177, 193, 254, 212, 255, 255, 255,},
+  {137, 181, 243, 177, 193, 254, 213, 255, 255, 255,},
+  {138, 182, 244, 178, 194, 254, 213, 255, 255, 255,},
+  {139, 183, 244, 179, 194, 254, 214, 255, 255, 255,},
+  {140, 184, 244, 180, 195, 254, 215, 255, 255, 255,},
+  {141, 185, 245, 181, 195, 254, 216, 255, 255, 255,},
+  {142, 186, 245, 181, 196, 255, 216, 255, 255, 255,},
+  {143, 187, 245, 182, 196, 255, 217, 255, 255, 255,},
+  {144, 188, 246, 183, 197, 255, 218, 255, 255, 255,},
+  {145, 189, 246, 184, 197, 255, 218, 255, 255, 255,},
+  {146, 190, 247, 184, 198, 255, 219, 255, 255, 255,},
+  {147, 191, 247, 185, 199, 255, 220, 255, 255, 255,},
+  {149, 192, 247, 186, 199, 255, 221, 255, 255, 255,},
+  {150, 193, 247, 187, 200, 255, 221, 255, 255, 255,},
+  {151, 194, 248, 188, 200, 255, 222, 255, 255, 255,},
+  {152, 195, 248, 188, 201, 255, 223, 255, 255, 255,},
+  {153, 196, 248, 189, 201, 255, 223, 255, 255, 255,},
+  {154, 197, 249, 190, 202, 255, 224, 255, 255, 255,},
+  {156, 198, 249, 191, 203, 255, 225, 255, 255, 255,},
+  {157, 199, 249, 192, 203, 255, 225, 255, 255, 255,},
+  {158, 200, 250, 193, 204, 255, 226, 255, 255, 255,},
+  {159, 201, 250, 193, 205, 255, 227, 255, 255, 255,},
+  {160, 202, 250, 194, 205, 255, 227, 255, 255, 255,},
+  {162, 203, 250, 195, 206, 255, 228, 255, 255, 255,},
+  {163, 204, 251, 196, 206, 255, 229, 255, 255, 255,},
+  {164, 205, 251, 197, 207, 255, 229, 255, 255, 255,},
+  {165, 206, 251, 198, 208, 255, 230, 255, 255, 255,},
+  {166, 207, 251, 199, 208, 255, 231, 255, 255, 255,},
+  {168, 208, 251, 200, 209, 255, 231, 255, 255, 255,},
+  {169, 209, 252, 201, 210, 255, 232, 255, 255, 255,},
+  {170, 210, 252, 201, 210, 255, 233, 255, 255, 255,},
+  {172, 211, 252, 202, 211, 255, 233, 255, 255, 255,},
+  {173, 212, 252, 203, 212, 255, 234, 255, 255, 255,},
+  {174, 213, 252, 204, 212, 255, 235, 255, 255, 255,},
+  {175, 214, 253, 205, 213, 255, 235, 255, 255, 255,},
+  {177, 215, 253, 206, 214, 255, 236, 255, 255, 255,},
+  {178, 216, 253, 207, 215, 255, 237, 255, 255, 255,},
+  {179, 217, 253, 208, 215, 255, 237, 255, 255, 255,},
+  {181, 218, 253, 209, 216, 255, 238, 255, 255, 255,},
+  {182, 219, 254, 210, 217, 255, 238, 255, 255, 255,},
+  {184, 220, 254, 211, 217, 255, 239, 255, 255, 255,},
+  {185, 221, 254, 212, 218, 255, 240, 255, 255, 255,},
+  {186, 222, 254, 213, 219, 255, 240, 255, 255, 255,},
+  {188, 223, 254, 214, 220, 255, 241, 255, 255, 255,},
+  {189, 224, 254, 215, 221, 255, 241, 255, 255, 255,},
+  {191, 225, 254, 216, 221, 255, 242, 255, 255, 255,},
+  {192, 226, 254, 217, 222, 255, 243, 255, 255, 255,},
+  {194, 227, 255, 218, 223, 255, 243, 255, 255, 255,},
+  {195, 228, 255, 219, 224, 255, 244, 255, 255, 255,},
+  {197, 229, 255, 220, 225, 255, 244, 255, 255, 255,},
+  {198, 230, 255, 221, 225, 255, 245, 255, 255, 255,},
+  {200, 231, 255, 222, 226, 255, 245, 255, 255, 255,},
+  {201, 232, 255, 223, 227, 255, 246, 255, 255, 255,},
+  {203, 233, 255, 224, 228, 255, 247, 255, 255, 255,},
+  {205, 234, 255, 226, 229, 255, 247, 255, 255, 255,},
+  {206, 235, 255, 227, 230, 255, 248, 255, 255, 255,},
+  {208, 236, 255, 228, 231, 255, 248, 255, 255, 255,},
+  {210, 237, 255, 229, 232, 255, 249, 255, 255, 255,},
+  {211, 238, 255, 230, 233, 255, 249, 255, 255, 255,},
+  {213, 239, 255, 231, 234, 255, 250, 255, 255, 255,},
+  {215, 240, 255, 233, 235, 255, 250, 255, 255, 255,},
+  {217, 241, 255, 234, 236, 255, 251, 255, 255, 255,},
+  {219, 242, 255, 235, 237, 255, 251, 255, 255, 255,},
+  {221, 243, 255, 236, 238, 255, 252, 255, 255, 255,},
+  {223, 244, 255, 237, 239, 255, 252, 255, 255, 255,},
+  {225, 245, 255, 239, 240, 255, 252, 255, 255, 255,},
+  {227, 246, 255, 240, 241, 255, 253, 255, 255, 255,},
+  {229, 247, 255, 241, 242, 255, 253, 255, 255, 255,},
+  {231, 248, 255, 243, 244, 255, 254, 255, 255, 255,},
+  {233, 249, 255, 244, 245, 255, 254, 255, 255, 255,},
+  {236, 250, 255, 246, 246, 255, 254, 255, 255, 255,},
+  {238, 251, 255, 247, 247, 255, 255, 255, 255, 255,},
+  {241, 252, 255, 249, 249, 255, 255, 255, 255, 255,},
+  {244, 253, 255, 250, 250, 255, 255, 255, 255, 255,},
+  {247, 254, 255, 252, 252, 255, 255, 255, 255, 255,},
+  {251, 255, 255, 254, 254, 255, 255, 255, 255, 255,},
+};
+
+const vp9_prob vp9_modelcoefprobs_gg625p1[COEFPROB_MODELS][ENTROPY_NODES - 1] = {
+  // Probs generated with a Generalized Gaussian (with shape parameter 0.625)
+  // source model with varying quantizer step size for a uniform quantizer
+  {0,   0,   0,   0,   0,   0,   0,   0,   0,   0,},  // do not use
+  {1,   1,   3,  87, 129,   6,  87,  20,  91,  24,},
+  {1,   2,   6,  88, 130,  11,  89,  36,  94,  41,},
+  {2,   3,   8,  88, 130,  15,  90,  50,  97,  56,},
+  {2,   4,  11,  89, 131,  20,  90,  62,  99,  70,},
+  {3,   5,  14,  90, 131,  24,  91,  74, 102,  81,},
+  {3,   6,  16,  90, 132,  29,  92,  84, 104,  92,},
+  {4,   7,  19,  91, 132,  33,  93,  93, 106, 101,},
+  {4,   8,  21,  91, 132,  37,  93, 102, 108, 110,},
+  {5,   9,  24,  92, 133,  40,  94, 110, 110, 118,},
+  {5,  10,  26,  92, 133,  44,  95, 118, 111, 125,},
+  {6,  11,  29,  93, 134,  48,  96, 125, 113, 132,},
+  {7,  12,  31,  93, 134,  51,  96, 132, 115, 139,},
+  {7,  13,  33,  93, 134,  55,  97, 138, 117, 145,},
+  {8,  14,  36,  94, 135,  58,  97, 144, 119, 150,},
+  {8,  15,  38,  94, 135,  62,  98, 149, 120, 155,},
+  {9,  16,  40,  95, 135,  65,  99, 154, 122, 160,},
+  {10,  17,  42,  95, 136,  68,  99, 159, 124, 165,},
+  {10,  18,  45,  96, 136,  71, 100, 164, 125, 169,},
+  {11,  19,  47,  96, 136,  74, 100, 168, 127, 174,},
+  {11,  20,  49,  96, 136,  77, 101, 173, 128, 177,},
+  {12,  21,  51,  97, 137,  80, 102, 176, 130, 181,},
+  {13,  22,  53,  97, 137,  83, 102, 180, 131, 185,},
+  {13,  23,  55,  98, 137,  86, 103, 184, 133, 188,},
+  {14,  24,  57,  98, 138,  89, 103, 187, 135, 191,},
+  {14,  25,  59,  98, 138,  91, 104, 190, 136, 194,},
+  {15,  26,  61,  99, 138,  94, 104, 193, 138, 197,},
+  {16,  27,  64,  99, 139,  97, 105, 196, 139, 200,},
+  {16,  28,  66, 100, 139,  99, 106, 199, 141, 202,},
+  {17,  29,  68, 100, 139, 102, 106, 201, 142, 205,},
+  {18,  30,  69, 100, 139, 104, 107, 204, 143, 207,},
+  {18,  31,  71, 101, 140, 107, 107, 206, 145, 209,},
+  {19,  32,  73, 101, 140, 109, 108, 209, 146, 211,},
+  {20,  33,  75, 102, 140, 112, 108, 211, 148, 213,},
+  {20,  34,  77, 102, 141, 114, 109, 213, 149, 215,},
+  {21,  35,  79, 102, 141, 116, 109, 215, 150, 217,},
+  {22,  36,  81, 103, 141, 119, 110, 217, 152, 219,},
+  {22,  37,  83, 103, 141, 121, 110, 218, 153, 220,},
+  {23,  38,  85, 103, 142, 123, 111, 220, 155, 222,},
+  {24,  39,  87, 104, 142, 125, 112, 222, 156, 224,},
+  {24,  40,  88, 104, 142, 127, 112, 223, 157, 225,},
+  {25,  41,  90, 105, 143, 129, 113, 225, 159, 226,},
+  {26,  42,  92, 105, 143, 131, 113, 226, 160, 228,},
+  {26,  43,  94, 105, 143, 133, 114, 227, 161, 229,},
+  {27,  44,  95, 106, 143, 135, 114, 229, 162, 230,},
+  {28,  45,  97, 106, 144, 137, 115, 230, 164, 231,},
+  {28,  46,  99, 107, 144, 139, 115, 231, 165, 232,},
+  {29,  47, 101, 107, 144, 141, 116, 232, 166, 233,},
+  {30,  48, 102, 107, 145, 143, 116, 233, 168, 234,},
+  {31,  49, 104, 108, 145, 145, 117, 234, 169, 235,},
+  {31,  50, 106, 108, 145, 147, 118, 235, 170, 236,},
+  {32,  51, 107, 108, 145, 149, 118, 236, 171, 237,},
+  {33,  52, 109, 109, 146, 150, 119, 237, 172, 238,},
+  {33,  53, 111, 109, 146, 152, 119, 238, 174, 239,},
+  {34,  54, 112, 110, 146, 154, 120, 239, 175, 240,},
+  {35,  55, 114, 110, 146, 156, 120, 240, 176, 240,},
+  {36,  56, 115, 110, 147, 157, 121, 240, 177, 241,},
+  {36,  57, 117, 111, 147, 159, 121, 241, 178, 242,},
+  {37,  58, 119, 111, 147, 161, 122, 242, 180, 242,},
+  {38,  59, 120, 112, 148, 162, 122, 242, 181, 243,},
+  {38,  60, 122, 112, 148, 164, 123, 243, 182, 244,},
+  {39,  61, 123, 112, 148, 165, 124, 244, 183, 244,},
+  {40,  62, 125, 113, 148, 167, 124, 244, 184, 245,},
+  {41,  63, 126, 113, 149, 168, 125, 245, 185, 245,},
+  {41,  64, 128, 114, 149, 170, 125, 245, 186, 246,},
+  {42,  65, 129, 114, 149, 171, 126, 246, 187, 246,},
+  {43,  66, 131, 114, 150, 173, 126, 246, 188, 247,},
+  {44,  67, 132, 115, 150, 174, 127, 247, 189, 247,},
+  {44,  68, 134, 115, 150, 176, 127, 247, 191, 247,},
+  {45,  69, 135, 116, 150, 177, 128, 248, 192, 248,},
+  {46,  70, 136, 116, 151, 178, 129, 248, 193, 248,},
+  {47,  71, 138, 116, 151, 180, 129, 248, 194, 249,},
+  {48,  72, 139, 117, 151, 181, 130, 249, 195, 249,},
+  {48,  73, 141, 117, 152, 183, 130, 249, 196, 249,},
+  {49,  74, 142, 118, 152, 184, 131, 249, 197, 250,},
+  {50,  75, 143, 118, 152, 185, 131, 250, 198, 250,},
+  {51,  76, 145, 118, 152, 186, 132, 250, 199, 250,},
+  {51,  77, 146, 119, 153, 188, 132, 250, 200, 250,},
+  {52,  78, 148, 119, 153, 189, 133, 251, 201, 251,},
+  {53,  79, 149, 120, 153, 190, 134, 251, 201, 251,},
+  {54,  80, 150, 120, 154, 191, 134, 251, 202, 251,},
+  {55,  81, 151, 120, 154, 192, 135, 251, 203, 251,},
+  {55,  82, 153, 121, 154, 194, 135, 252, 204, 252,},
+  {56,  83, 154, 121, 155, 195, 136, 252, 205, 252,},
+  {57,  84, 155, 122, 155, 196, 136, 252, 206, 252,},
+  {58,  85, 157, 122, 155, 197, 137, 252, 207, 252,},
+  {59,  86, 158, 123, 155, 198, 138, 252, 208, 252,},
+  {59,  87, 159, 123, 156, 199, 138, 253, 209, 253,},
+  {60,  88, 160, 123, 156, 200, 139, 253, 210, 253,},
+  {61,  89, 162, 124, 156, 201, 139, 253, 210, 253,},
+  {62,  90, 163, 124, 157, 202, 140, 253, 211, 253,},
+  {63,  91, 164, 125, 157, 203, 140, 253, 212, 253,},
+  {64,  92, 165, 125, 157, 204, 141, 253, 213, 253,},
+  {64,  93, 166, 126, 158, 205, 142, 254, 214, 253,},
+  {65,  94, 168, 126, 158, 206, 142, 254, 214, 254,},
+  {66,  95, 169, 126, 158, 207, 143, 254, 215, 254,},
+  {67,  96, 170, 127, 158, 208, 143, 254, 216, 254,},
+  {68,  97, 171, 127, 159, 209, 144, 254, 217, 254,},
+  {69,  98, 172, 128, 159, 210, 145, 254, 218, 254,},
+  {69,  99, 173, 128, 159, 211, 145, 254, 218, 254,},
+  {70, 100, 175, 129, 160, 212, 146, 254, 219, 254,},
+  {71, 101, 176, 129, 160, 213, 146, 254, 220, 254,},
+  {72, 102, 177, 130, 160, 214, 147, 254, 220, 254,},
+  {73, 103, 178, 130, 161, 214, 148, 255, 221, 255,},
+  {74, 104, 179, 130, 161, 215, 148, 255, 222, 255,},
+  {75, 105, 180, 131, 161, 216, 149, 255, 223, 255,},
+  {75, 106, 181, 131, 162, 217, 149, 255, 223, 255,},
+  {76, 107, 182, 132, 162, 218, 150, 255, 224, 255,},
+  {77, 108, 183, 132, 162, 219, 151, 255, 225, 255,},
+  {78, 109, 184, 133, 163, 219, 151, 255, 225, 255,},
+  {79, 110, 185, 133, 163, 220, 152, 255, 226, 255,},
+  {80, 111, 186, 134, 163, 221, 152, 255, 226, 255,},
+  {81, 112, 187, 134, 164, 222, 153, 255, 227, 255,},
+  {82, 113, 188, 135, 164, 222, 154, 255, 228, 255,},
+  {83, 114, 189, 135, 164, 223, 154, 255, 228, 255,},
+  {83, 115, 190, 136, 165, 224, 155, 255, 229, 255,},
+  {84, 116, 191, 136, 165, 224, 156, 255, 230, 255,},
+  {85, 117, 192, 137, 165, 225, 156, 255, 230, 255,},
+  {86, 118, 193, 137, 166, 226, 157, 255, 231, 255,},
+  {87, 119, 194, 137, 166, 226, 157, 255, 231, 255,},
+  {88, 120, 195, 138, 166, 227, 158, 255, 232, 255,},
+  {89, 121, 196, 138, 167, 228, 159, 255, 232, 255,},
+  {90, 122, 197, 139, 167, 228, 159, 255, 233, 255,},
+  {91, 123, 198, 139, 167, 229, 160, 255, 233, 255,},
+  {92, 124, 199, 140, 168, 230, 161, 255, 234, 255,},
+  {93, 125, 200, 140, 168, 230, 161, 255, 234, 255,},
+  {93, 126, 201, 141, 168, 231, 162, 255, 235, 255,},
+  {94, 127, 202, 141, 169, 231, 163, 255, 235, 255,},
+  {95, 128, 203, 142, 169, 232, 163, 255, 236, 255,},
+  {96, 129, 203, 142, 169, 233, 164, 255, 236, 255,},
+  {97, 130, 204, 143, 170, 233, 164, 255, 237, 255,},
+  {98, 131, 205, 143, 170, 234, 165, 255, 237, 255,},
+  {99, 132, 206, 144, 170, 234, 166, 255, 238, 255,},
+  {100, 133, 207, 145, 171, 235, 166, 255, 238, 255,},
+  {101, 134, 208, 145, 171, 235, 167, 255, 239, 255,},
+  {102, 135, 209, 146, 171, 236, 168, 255, 239, 255,},
+  {103, 136, 209, 146, 172, 236, 168, 255, 240, 255,},
+  {104, 137, 210, 147, 172, 237, 169, 255, 240, 255,},
+  {105, 138, 211, 147, 173, 237, 170, 255, 240, 255,},
+  {106, 139, 212, 148, 173, 238, 170, 255, 241, 255,},
+  {107, 140, 213, 148, 173, 238, 171, 255, 241, 255,},
+  {108, 141, 213, 149, 174, 239, 172, 255, 242, 255,},
+  {109, 142, 214, 149, 174, 239, 172, 255, 242, 255,},
+  {110, 143, 215, 150, 174, 240, 173, 255, 242, 255,},
+  {111, 144, 216, 150, 175, 240, 174, 255, 243, 255,},
+  {112, 145, 216, 151, 175, 240, 174, 255, 243, 255,},
+  {113, 146, 217, 152, 176, 241, 175, 255, 243, 255,},
+  {114, 147, 218, 152, 176, 241, 176, 255, 244, 255,},
+  {115, 148, 219, 153, 176, 242, 176, 255, 244, 255,},
+  {116, 149, 219, 153, 177, 242, 177, 255, 244, 255,},
+  {117, 150, 220, 154, 177, 242, 178, 255, 245, 255,},
+  {118, 151, 221, 154, 178, 243, 178, 255, 245, 255,},
+  {119, 152, 221, 155, 178, 243, 179, 255, 245, 255,},
+  {120, 153, 222, 156, 178, 244, 180, 255, 246, 255,},
+  {121, 154, 223, 156, 179, 244, 180, 255, 246, 255,},
+  {122, 155, 223, 157, 179, 244, 181, 255, 246, 255,},
+  {123, 156, 224, 157, 180, 245, 182, 255, 247, 255,},
+  {124, 157, 225, 158, 180, 245, 183, 255, 247, 255,},
+  {125, 158, 225, 159, 180, 245, 183, 255, 247, 255,},
+  {126, 159, 226, 159, 181, 246, 184, 255, 247, 255,},
+  {127, 160, 227, 160, 181, 246, 185, 255, 248, 255,},
+  {128, 161, 227, 160, 182, 246, 185, 255, 248, 255,},
+  {129, 162, 228, 161, 182, 246, 186, 255, 248, 255,},
+  {130, 163, 229, 162, 183, 247, 187, 255, 248, 255,},
+  {131, 164, 229, 162, 183, 247, 187, 255, 249, 255,},
+  {132, 165, 230, 163, 183, 247, 188, 255, 249, 255,},
+  {133, 166, 230, 163, 184, 248, 189, 255, 249, 255,},
+  {135, 167, 231, 164, 184, 248, 190, 255, 249, 255,},
+  {136, 168, 232, 165, 185, 248, 190, 255, 250, 255,},
+  {137, 169, 232, 165, 185, 248, 191, 255, 250, 255,},
+  {138, 170, 233, 166, 186, 249, 192, 255, 250, 255,},
+  {139, 171, 233, 167, 186, 249, 192, 255, 250, 255,},
+  {140, 172, 234, 167, 187, 249, 193, 255, 251, 255,},
+  {141, 173, 234, 168, 187, 249, 194, 255, 251, 255,},
+  {142, 174, 235, 169, 187, 250, 195, 255, 251, 255,},
+  {143, 175, 235, 169, 188, 250, 195, 255, 251, 255,},
+  {144, 176, 236, 170, 188, 250, 196, 255, 251, 255,},
+  {146, 177, 236, 171, 189, 250, 197, 255, 251, 255,},
+  {147, 178, 237, 171, 189, 251, 197, 255, 252, 255,},
+  {148, 179, 237, 172, 190, 251, 198, 255, 252, 255,},
+  {149, 180, 238, 173, 190, 251, 199, 255, 252, 255,},
+  {150, 181, 238, 173, 191, 251, 200, 255, 252, 255,},
+  {151, 182, 239, 174, 191, 251, 200, 255, 252, 255,},
+  {152, 183, 239, 175, 192, 251, 201, 255, 252, 255,},
+  {153, 184, 240, 176, 192, 252, 202, 255, 253, 255,},
+  {155, 185, 240, 176, 193, 252, 203, 255, 253, 255,},
+  {156, 186, 241, 177, 193, 252, 203, 255, 253, 255,},
+  {157, 187, 241, 178, 194, 252, 204, 255, 253, 255,},
+  {158, 188, 242, 179, 194, 252, 205, 255, 253, 255,},
+  {159, 189, 242, 179, 195, 252, 206, 255, 253, 255,},
+  {160, 190, 242, 180, 195, 253, 206, 255, 253, 255,},
+  {162, 191, 243, 181, 196, 253, 207, 255, 253, 255,},
+  {163, 192, 243, 182, 196, 253, 208, 255, 254, 255,},
+  {164, 193, 244, 182, 197, 253, 209, 255, 254, 255,},
+  {165, 194, 244, 183, 198, 253, 209, 255, 254, 255,},
+  {166, 195, 244, 184, 198, 253, 210, 255, 254, 255,},
+  {168, 196, 245, 185, 199, 253, 211, 255, 254, 255,},
+  {169, 197, 245, 185, 199, 254, 212, 255, 254, 255,},
+  {170, 198, 246, 186, 200, 254, 212, 255, 254, 255,},
+  {171, 199, 246, 187, 200, 254, 213, 255, 254, 255,},
+  {172, 200, 246, 188, 201, 254, 214, 255, 254, 255,},
+  {174, 201, 247, 189, 201, 254, 215, 255, 254, 255,},
+  {175, 202, 247, 189, 202, 254, 215, 255, 255, 255,},
+  {176, 203, 247, 190, 203, 254, 216, 255, 255, 255,},
+  {177, 204, 248, 191, 203, 254, 217, 255, 255, 255,},
+  {179, 205, 248, 192, 204, 254, 218, 255, 255, 255,},
+  {180, 206, 248, 193, 204, 254, 218, 255, 255, 255,},
+  {181, 207, 249, 194, 205, 255, 219, 255, 255, 255,},
+  {183, 208, 249, 195, 206, 255, 220, 255, 255, 255,},
+  {184, 209, 249, 195, 206, 255, 221, 255, 255, 255,},
+  {185, 210, 250, 196, 207, 255, 221, 255, 255, 255,},
+  {186, 211, 250, 197, 208, 255, 222, 255, 255, 255,},
+  {188, 212, 250, 198, 208, 255, 223, 255, 255, 255,},
+  {189, 213, 250, 199, 209, 255, 224, 255, 255, 255,},
+  {190, 214, 251, 200, 210, 255, 224, 255, 255, 255,},
+  {192, 215, 251, 201, 210, 255, 225, 255, 255, 255,},
+  {193, 216, 251, 202, 211, 255, 226, 255, 255, 255,},
+  {194, 217, 251, 203, 212, 255, 227, 255, 255, 255,},
+  {196, 218, 252, 204, 212, 255, 228, 255, 255, 255,},
+  {197, 219, 252, 205, 213, 255, 228, 255, 255, 255,},
+  {198, 220, 252, 206, 214, 255, 229, 255, 255, 255,},
+  {200, 221, 252, 207, 215, 255, 230, 255, 255, 255,},
+  {201, 222, 252, 208, 215, 255, 231, 255, 255, 255,},
+  {202, 223, 253, 209, 216, 255, 231, 255, 255, 255,},
+  {204, 224, 253, 210, 217, 255, 232, 255, 255, 255,},
+  {205, 225, 253, 211, 218, 255, 233, 255, 255, 255,},
+  {207, 226, 253, 212, 218, 255, 234, 255, 255, 255,},
+  {208, 227, 253, 213, 219, 255, 234, 255, 255, 255,},
+  {209, 228, 254, 214, 220, 255, 235, 255, 255, 255,},
+  {211, 229, 254, 215, 221, 255, 236, 255, 255, 255,},
+  {212, 230, 254, 216, 222, 255, 237, 255, 255, 255,},
+  {214, 231, 254, 217, 223, 255, 238, 255, 255, 255,},
+  {215, 232, 254, 218, 223, 255, 238, 255, 255, 255,},
+  {217, 233, 254, 219, 224, 255, 239, 255, 255, 255,},
+  {218, 234, 255, 221, 225, 255, 240, 255, 255, 255,},
+  {220, 235, 255, 222, 226, 255, 241, 255, 255, 255,},
+  {221, 236, 255, 223, 227, 255, 241, 255, 255, 255,},
+  {223, 237, 255, 224, 228, 255, 242, 255, 255, 255,},
+  {224, 238, 255, 225, 229, 255, 243, 255, 255, 255,},
+  {226, 239, 255, 227, 230, 255, 244, 255, 255, 255,},
+  {227, 240, 255, 228, 231, 255, 244, 255, 255, 255,},
+  {229, 241, 255, 229, 232, 255, 245, 255, 255, 255,},
+  {231, 242, 255, 231, 233, 255, 246, 255, 255, 255,},
+  {232, 243, 255, 232, 234, 255, 247, 255, 255, 255,},
+  {234, 244, 255, 233, 236, 255, 247, 255, 255, 255,},
+  {235, 245, 255, 235, 237, 255, 248, 255, 255, 255,},
+  {237, 246, 255, 236, 238, 255, 249, 255, 255, 255,},
+  {239, 247, 255, 238, 239, 255, 250, 255, 255, 255,},
+  {241, 248, 255, 239, 241, 255, 250, 255, 255, 255,},
+  {242, 249, 255, 241, 242, 255, 251, 255, 255, 255,},
+  {244, 250, 255, 243, 243, 255, 252, 255, 255, 255,},
+  {246, 251, 255, 244, 245, 255, 253, 255, 255, 255,},
+  {248, 252, 255, 246, 247, 255, 253, 255, 255, 255,},
+  {250, 253, 255, 248, 248, 255, 254, 255, 255, 255,},
+  {252, 254, 255, 250, 250, 255, 255, 255, 255, 255,},
+  {254, 255, 255, 253, 253, 255, 255, 255, 255, 255,},
+};
+
+void vp9_get_model_distribution(vp9_prob p, vp9_prob *tree_probs,
+                                int b, int r) {
+  const vp9_prob (*model)[ENTROPY_NODES - 1];
+#if UNCONSTRAINED_NODES == 2
+  if (r != INTRA_FRAME && b == PLANE_TYPE_UV)
+    model = vp9_modelcoefprobs_gg75;
+  else if (r == INTRA_FRAME && b == PLANE_TYPE_UV)
+    model = vp9_modelcoefprobs_gg75;
+  else if (r != INTRA_FRAME && b == PLANE_TYPE_Y_WITH_DC)
+    model = vp9_modelcoefprobs_gg75;
+  else
+    model = vp9_modelcoefprobs_gg75;
+#else
+  if (r != INTRA_FRAME && b == PLANE_TYPE_UV)
+    model = vp9_modelcoefprobs_gg75p1;
+  else if (r == INTRA_FRAME && b == PLANE_TYPE_UV)
+    model = vp9_modelcoefprobs_gg75p1;
+  else if (r != INTRA_FRAME && b == PLANE_TYPE_Y_WITH_DC)
+    model = vp9_modelcoefprobs_gg75p1;
+  else
+    model = vp9_modelcoefprobs_gg75p1;
+#endif
+  vpx_memcpy(tree_probs + UNCONSTRAINED_NODES,
+             model[p] + UNCONSTRAINED_NODES - 1,
+             (ENTROPY_NODES - UNCONSTRAINED_NODES) * sizeof(vp9_prob));
+}
+#endif
+
 static vp9_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[28];
 
 static void init_bit_tree(vp9_tree_index *p, int n) {
@@ -312,6 +1908,9 @@ int vp9_get_coef_context(int * recent_energy, int token) {
 };
 
 void vp9_default_coef_probs(VP9_COMMON *pc) {
+#if CONFIG_MODELCOEFPROB
+  int b, r, c, p;
+#endif
 #if CONFIG_CODE_NONZEROCOUNT
 #ifdef NZC_DEFAULT_COUNTS
   int h, g;
@@ -360,7 +1959,39 @@ void vp9_default_coef_probs(VP9_COMMON *pc) {
 #endif
   vpx_memcpy(pc->fc.nzc_pcat_probs, default_nzc_pcat_probs,
              sizeof(pc->fc.nzc_pcat_probs));
-#endif  // CONFIG_CODE_NONZEROCOUNTyy
+#endif  // CONFIG_CODE_NONZEROCOUNT
+#if CONFIG_MODELCOEFPROB
+  for (b = 0; b < BLOCK_TYPES; ++b)
+    for (r = 0; r < REF_TYPES; ++r)
+      for (c = 0; c < COEF_BANDS; ++c)
+        for (p = 0; p < PREV_COEF_CONTEXTS; ++p) {
+          int t;
+          for (t = 0; t < UNCONSTRAINED_NODES; t++)
+            pc->fc.coef_probs_4x4[b][r][c][p][t] =
+                default_coef_probs_4x4[b][r][c][p][t];
+          vp9_get_model_distribution(
+              default_coef_probs_4x4[b][r][c][p][UNCONSTRAINED_NODES - 1],
+              pc->fc.coef_probs_4x4[b][r][c][p], b, r);
+          for (t = 0; t < UNCONSTRAINED_NODES; t++)
+            pc->fc.coef_probs_8x8[b][r][c][p][t] =
+                default_coef_probs_8x8[b][r][c][p][t];
+          vp9_get_model_distribution(
+              default_coef_probs_8x8[b][r][c][p][UNCONSTRAINED_NODES - 1],
+              pc->fc.coef_probs_8x8[b][r][c][p], b, r);
+          for (t = 0; t < UNCONSTRAINED_NODES; t++)
+            pc->fc.coef_probs_16x16[b][r][c][p][t] =
+                default_coef_probs_16x16[b][r][c][p][t];
+          vp9_get_model_distribution(
+              default_coef_probs_16x16[b][r][c][p][UNCONSTRAINED_NODES - 1],
+              pc->fc.coef_probs_16x16[b][r][c][p], b, r);
+          for (t = 0; t < UNCONSTRAINED_NODES; t++)
+            pc->fc.coef_probs_32x32[b][r][c][p][t] =
+                default_coef_probs_32x32[b][r][c][p][t];
+          vp9_get_model_distribution(
+              default_coef_probs_32x32[b][r][c][p][UNCONSTRAINED_NODES - 1],
+              pc->fc.coef_probs_32x32[b][r][c][p], b, r);
+        }
+#else
   vpx_memcpy(pc->fc.coef_probs_4x4, default_coef_probs_4x4,
              sizeof(pc->fc.coef_probs_4x4));
   vpx_memcpy(pc->fc.coef_probs_8x8, default_coef_probs_8x8,
@@ -369,7 +2000,68 @@ void vp9_default_coef_probs(VP9_COMMON *pc) {
              sizeof(pc->fc.coef_probs_16x16));
   vpx_memcpy(pc->fc.coef_probs_32x32, default_coef_probs_32x32,
              sizeof(pc->fc.coef_probs_32x32));
+#endif
+}
+
+#if CONFIG_MODELCOEFPROB
+// This is a placeholder function that will enable the default coef probs to
+// change for key frames based on the base_qindex. If base_qindex is large,
+// we can expect probabilities of zeros to be bigger, and vice versa. The rest
+// of the probabilities are derived from the nodel.
+void vp9_adjust_default_coef_probs(VP9_COMMON *cm) {
+  static const int factor_bits = 4;
+  static const int factor_rnd = 8;   // (1 << (factor_bits - 1))
+  int b, r, c, p;
+  int factor = (1 << factor_bits);
+  /*
+  if (cm->base_qindex < 32)
+    factor -= ((32 - cm->base_qindex) >> 4);
+    */
+  if (cm->base_qindex > 128)
+    factor += ((cm->base_qindex - 128) >> 4);
+  // printf(" Q %d factor %d\n", cm->base_qindex, factor);
+
+  for (b = 0; b < BLOCK_TYPES; ++b)
+    for (r = 0; r < REF_TYPES; ++r)
+      for (c = 0; c < COEF_BANDS; ++c)
+        for (p = 0; p < PREV_COEF_CONTEXTS; ++p) {
+          int t, x;
+          vp9_prob prob;
+          for (t = 0; t < UNCONSTRAINED_NODES; t++) {
+            x = (default_coef_probs_4x4[b][r][c][p][t] * factor + factor_rnd)
+                >> factor_bits;
+            prob = (x > 255 ? 255 : (x < 1 ? 1 : x));
+            cm->fc.coef_probs_4x4[b][r][c][p][t] = prob;
+          }
+          vp9_get_model_distribution(
+              prob, cm->fc.coef_probs_4x4[b][r][c][p], b, r);
+          for (t = 0; t < UNCONSTRAINED_NODES; t++) {
+            x = (default_coef_probs_8x8[b][r][c][p][t] * factor + factor_rnd)
+                >> factor_bits;
+            prob = (x > 255 ? 255 : (x < 1 ? 1 : x));
+            cm->fc.coef_probs_8x8[b][r][c][p][t] = prob;
+          }
+          vp9_get_model_distribution(
+              prob, cm->fc.coef_probs_8x8[b][r][c][p], b, r);
+          for (t = 0; t < UNCONSTRAINED_NODES; t++) {
+            x = (default_coef_probs_16x16[b][r][c][p][t] * factor + factor_rnd)
+                >> factor_bits;
+            prob = (x > 255 ? 255 : (x < 1 ? 1 : x));
+            cm->fc.coef_probs_16x16[b][r][c][p][t] = prob;
+          }
+          vp9_get_model_distribution(
+              prob, cm->fc.coef_probs_16x16[b][r][c][p], b, r);
+          for (t = 0; t < UNCONSTRAINED_NODES; t++) {
+            x = (default_coef_probs_32x32[b][r][c][p][t] * factor + factor_rnd)
+                >> factor_bits;
+            prob = (x > 255 ? 255 : (x < 1 ? 1 : x));
+            cm->fc.coef_probs_32x32[b][r][c][p][t] = prob;
+          }
+          vp9_get_model_distribution(
+              prob, cm->fc.coef_probs_32x32[b][r][c][p], b, r);
+        }
 }
+#endif
 
 void vp9_coef_tree_initialize() {
   init_bit_trees();
@@ -1483,6 +3175,11 @@ static void adapt_coef_probs(vp9_coeff_probs *dst_coef_probs,
   unsigned int branch_ct[ENTROPY_NODES][2];
   vp9_prob coef_probs[ENTROPY_NODES];
   int factor;
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_ADAPT
+  int entropy_nodes_adapt = UNCONSTRAINED_ADAPT_NODES;
+#else
+  int entropy_nodes_adapt = ENTROPY_NODES;
+#endif
 
   for (i = 0; i < block_types; ++i)
     for (j = 0; j < REF_TYPES; ++j)
@@ -1493,13 +3190,19 @@ static void adapt_coef_probs(vp9_coeff_probs *dst_coef_probs,
           vp9_tree_probs_from_distribution(vp9_coef_tree,
                                            coef_probs, branch_ct,
                                            coef_counts[i][j][k][l], 0);
-          for (t = 0; t < ENTROPY_NODES; ++t) {
+          for (t = 0; t < entropy_nodes_adapt; ++t) {
             count = branch_ct[t][0] + branch_ct[t][1];
             count = count > count_sat ? count_sat : count;
             factor = (update_factor * count / count_sat);
             dst_coef_probs[i][j][k][l][t] =
                 weighted_prob(pre_coef_probs[i][j][k][l][t],
                               coef_probs[t], factor);
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_ADAPT
+            if (t == UNCONSTRAINED_NODES - 1)
+              vp9_get_model_distribution(
+                  dst_coef_probs[i][j][k][l][UNCONSTRAINED_NODES - 1],
+                  dst_coef_probs[i][j][k][l], i, j);
+#endif
           }
         }
 }
@@ -1508,7 +3211,6 @@ void vp9_adapt_coef_probs(VP9_COMMON *cm) {
   int count_sat;
   int update_factor; /* denominator 256 */
 
-  // printf("Frame type: %d\n", cm->frame_type);
   if (cm->frame_type == KEY_FRAME) {
     update_factor = COEF_MAX_UPDATE_FACTOR_KEY;
     count_sat = COEF_COUNT_SAT_KEY;
index 2f154860faa1011780eb39d0e196d816b31f17d1..e7fb5019af4f3a542234f78ba4d59ce9941f944f 100644 (file)
@@ -15,7 +15,6 @@
 #include "vp9/common/vp9_treecoder.h"
 #include "vp9/common/vp9_blockd.h"
 #include "vp9/common/vp9_common.h"
-#include "vp9/common/vp9_coefupdateprobs.h"
 
 extern const int vp9_i8x8_block[4];
 
@@ -33,8 +32,8 @@ extern const int vp9_i8x8_block[4];
 #define DCT_VAL_CATEGORY5       9       /* 35-66     Extra Bits 5+1 */
 #define DCT_VAL_CATEGORY6       10      /* 67+       Extra Bits 14+1 */
 #define DCT_EOB_TOKEN           11      /* EOB       Extra Bits 0+0 */
-#define MAX_ENTROPY_TOKENS 12
-#define ENTROPY_NODES 11
+#define MAX_ENTROPY_TOKENS      12
+#define ENTROPY_NODES           11
 #define EOSB_TOKEN              127     /* Not signalled, encoder only */
 
 #define INTER_MODE_CONTEXTS     7
@@ -142,6 +141,33 @@ static int get_coef_band(TX_SIZE tx_size, int coef_index) {
 }
 extern int vp9_get_coef_context(int * recent_energy, int token);
 
+#if CONFIG_MODELCOEFPROB
+#define COEFPROB_BITS               8
+#define COEFPROB_MODELS             (1 << COEFPROB_BITS)
+
+// 2 => EOB and Zero nodes are unconstrained, rest are modeled
+// 3 => EOB, Zero and One nodes are unconstrained, rest are modeled
+#define UNCONSTRAINED_NODES         3   // Choose one of 2 or 3
+
+// whether forward updates are model-based
+#define MODEL_BASED_UPDATE          0
+// if model-based how many nodes are unconstrained
+#define UNCONSTRAINED_UPDATE_NODES  3
+// whether backward updates are model-based
+#define MODEL_BASED_ADAPT           0
+#define UNCONSTRAINED_ADAPT_NODES   3
+
+// whether to adjust the coef probs for key frames based on qindex
+#define ADJUST_KF_COEF_PROBS        0
+
+typedef vp9_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS]
+                                      [PREV_COEF_CONTEXTS][2];
+extern const vp9_prob vp9_modelcoefprobs[COEFPROB_MODELS][ENTROPY_NODES - 1];
+void vp9_get_model_distribution(vp9_prob model, vp9_prob *tree_probs,
+                                int b, int r);
+void vp9_adjust_default_coef_probs(struct VP9Common *cm);
+#endif  // CONFIG_MODELCOEFPROB
+
 #if CONFIG_CODE_NONZEROCOUNT
 /* Alphabet for number of non-zero symbols in block */
 #define NZC_0                   0       /* Used for all blocks */
@@ -224,4 +250,7 @@ extern const int vp9_extranzcbits[NZC32X32_TOKENS];
 extern const int vp9_basenzcvalue[NZC32X32_TOKENS];
 
 #endif  // CONFIG_CODE_NONZEROCOUNT
+
+#include "vp9/common/vp9_coefupdateprobs.h"
+
 #endif  // VP9_COMMON_VP9_ENTROPY_H_
index c61c11225a2d1eb2d037f2256347d2fa2190b69a..c4e3f7e602f8445c592fa6db3c709b2c30b688a2 100644 (file)
@@ -1197,6 +1197,12 @@ static void read_nzc_probs(VP9_COMMON *cm,
 static void read_coef_probs_common(BOOL_DECODER* const bc,
                                    vp9_coeff_probs *coef_probs,
                                    int block_types) {
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_UPDATE
+  const int entropy_nodes_update = UNCONSTRAINED_UPDATE_NODES;
+#else
+  const int entropy_nodes_update = ENTROPY_NODES;
+#endif
+
   int i, j, k, l, m;
 
   if (vp9_read_bit(bc)) {
@@ -1206,11 +1212,15 @@ static void read_coef_probs_common(BOOL_DECODER* const bc,
           for (l = 0; l < PREV_COEF_CONTEXTS; l++) {
             if (l >= 3 && k == 0)
               continue;
-            for (m = CONFIG_CODE_NONZEROCOUNT; m < ENTROPY_NODES; m++) {
+            for (m = CONFIG_CODE_NONZEROCOUNT; m < entropy_nodes_update; m++) {
               vp9_prob *const p = coef_probs[i][j][k][l] + m;
 
-              if (vp9_read(bc, COEF_UPDATE_PROB)) {
+              if (vp9_read(bc, vp9_coef_update_prob[m])) {
                 *p = read_prob_diff_update(bc, *p);
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_UPDATE
+                if (m == 1)
+                  vp9_get_model_distribution(*p, coef_probs[i][j][k][l], i, j);
+#endif
               }
             }
           }
@@ -1611,6 +1621,10 @@ int vp9_decode_frame(VP9D_COMP *pbi, const unsigned char **p_data_end) {
       }
     }
   }
+#if CONFIG_MODELCOEFPROB && ADJUST_KF_COEF_PROBS
+  if (pc->frame_type == KEY_FRAME)
+    vp9_adjust_default_coef_probs(pc);
+#endif
 
 #if CONFIG_NEW_MVREF
   // If Key frame reset mv ref id probabilities to defaults
index c96ae6a1c9a455e6d405a31a0abb2513b47c0a91..9296ec6a9a65bde9972709fe3228b50c10fbc0f8 100644 (file)
@@ -399,6 +399,43 @@ static int prob_diff_update_savings_search(const unsigned int *ct,
   return bestsavings;
 }
 
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_UPDATE
+static int prob_diff_update_savings_search_model(const unsigned int *ct,
+                                                 const vp9_prob *oldp,
+                                                 vp9_prob *bestp,
+                                                 const vp9_prob upd,
+                                                 int b, int r) {
+  int i, old_b, new_b, update_b, savings, bestsavings, step;
+  int newp;
+  vp9_prob bestnewp, newplist[ENTROPY_NODES];
+  for (i = UNCONSTRAINED_NODES - 1, old_b = 0; i < ENTROPY_NODES; ++i)
+    old_b += cost_branch256(ct + 2 * i, oldp[i]);
+
+  bestsavings = 0;
+  bestnewp = oldp[UNCONSTRAINED_NODES - 1];
+
+  step = (*bestp > oldp[UNCONSTRAINED_NODES - 1] ? -1 : 1);
+  newp = *bestp;
+  // newp = *bestp - step * (abs(*bestp - oldp[UNCONSTRAINED_NODES - 1]) >> 1);
+  for (; newp != oldp[UNCONSTRAINED_NODES - 1]; newp += step) {
+    if (newp < 1 || newp > 255) continue;
+    newplist[UNCONSTRAINED_NODES - 1] = newp;
+    vp9_get_model_distribution(newp, newplist, b, r);
+    for (i = UNCONSTRAINED_NODES - 1, new_b = 0; i < ENTROPY_NODES; ++i)
+      new_b += cost_branch256(ct + 2 * i, newplist[i]);
+    update_b = prob_diff_update_cost(newp, oldp[UNCONSTRAINED_NODES - 1]) +
+        vp9_cost_upd256;
+    savings = old_b - new_b - update_b;
+    if (savings > bestsavings) {
+      bestsavings = savings;
+      bestnewp = newp;
+    }
+  }
+  *bestp = bestnewp;
+  return bestsavings;
+}
+#endif
+
 static void vp9_cond_prob_update(vp9_writer *bc, vp9_prob *oldp, vp9_prob upd,
                                  unsigned int *ct) {
   vp9_prob newp;
@@ -2014,6 +2051,11 @@ static void update_coef_probs_common(vp9_writer* const bc,
   int i, j, k, l, t;
   int update[2] = {0, 0};
   int savings;
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_UPDATE
+  const int entropy_nodes_update = UNCONSTRAINED_UPDATE_NODES;
+#else
+  const int entropy_nodes_update = ENTROPY_NODES;
+#endif
   // vp9_prob bestupd = find_coef_update_prob(cpi);
 
   /* dry run to see if there is any udpate at all needed */
@@ -2021,20 +2063,27 @@ static void update_coef_probs_common(vp9_writer* const bc,
   for (i = 0; i < block_types; ++i) {
     for (j = 0; j < REF_TYPES; ++j) {
       for (k = 0; k < COEF_BANDS; ++k) {
-        int prev_coef_savings[ENTROPY_NODES] = {0};
+        // int prev_coef_savings[ENTROPY_NODES] = {0};
         for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
-          for (t = CONFIG_CODE_NONZEROCOUNT; t < ENTROPY_NODES; ++t) {
+          for (t = CONFIG_CODE_NONZEROCOUNT; t < entropy_nodes_update; ++t) {
             vp9_prob newp = new_frame_coef_probs[i][j][k][l][t];
             const vp9_prob oldp = old_frame_coef_probs[i][j][k][l][t];
-            const vp9_prob upd = COEF_UPDATE_PROB;
-            int s = prev_coef_savings[t];
+            const vp9_prob upd = vp9_coef_update_prob[t];
+            int s;  // = prev_coef_savings[t];
             int u = 0;
 
             if (l >= 3 && k == 0)
               continue;
 #if defined(SEARCH_NEWP)
-            s = prob_diff_update_savings_search(frame_branch_ct[i][j][k][l][t],
-                                                oldp, &newp, upd);
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_UPDATE
+            if (t == UNCONSTRAINED_NODES - 1)
+              s = prob_diff_update_savings_search_model(
+                  frame_branch_ct[i][j][k][l][0],
+                  old_frame_coef_probs[i][j][k][l], &newp, upd, i, j);
+            else
+#endif
+              s = prob_diff_update_savings_search(
+                  frame_branch_ct[i][j][k][l][t], oldp, &newp, upd);
             if (s > 0 && newp != oldp)
               u = 1;
             if (u)
@@ -2061,45 +2110,57 @@ static void update_coef_probs_common(vp9_writer* const bc,
   /* Is coef updated at all */
   if (update[1] == 0 || savings < 0) {
     vp9_write_bit(bc, 0);
-  } else {
-    vp9_write_bit(bc, 1);
-    for (i = 0; i < block_types; ++i) {
-      for (j = 0; j < REF_TYPES; ++j) {
-        for (k = 0; k < COEF_BANDS; ++k) {
-          int prev_coef_savings[ENTROPY_NODES] = {0};
-          for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
-            // calc probs and branch cts for this frame only
-            for (t = CONFIG_CODE_NONZEROCOUNT; t < ENTROPY_NODES; ++t) {
-              vp9_prob newp = new_frame_coef_probs[i][j][k][l][t];
-              vp9_prob *oldp = old_frame_coef_probs[i][j][k][l] + t;
-              const vp9_prob upd = COEF_UPDATE_PROB;
-              int s = prev_coef_savings[t];
-              int u = 0;
-              if (l >= 3 && k == 0)
-                continue;
+    return;
+  }
+  vp9_write_bit(bc, 1);
+  for (i = 0; i < block_types; ++i) {
+    for (j = 0; j < REF_TYPES; ++j) {
+      for (k = 0; k < COEF_BANDS; ++k) {
+        // int prev_coef_savings[ENTROPY_NODES] = {0};
+        for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
+          // calc probs and branch cts for this frame only
+          for (t = CONFIG_CODE_NONZEROCOUNT; t < entropy_nodes_update; ++t) {
+            vp9_prob newp = new_frame_coef_probs[i][j][k][l][t];
+            vp9_prob *oldp = old_frame_coef_probs[i][j][k][l] + t;
+            const vp9_prob upd = vp9_coef_update_prob[t];
+            int s;  // = prev_coef_savings[t];
+            int u = 0;
+            if (l >= 3 && k == 0)
+              continue;
 
 #if defined(SEARCH_NEWP)
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_UPDATE
+            if (t == UNCONSTRAINED_NODES - 1)
+              s = prob_diff_update_savings_search_model(
+                  frame_branch_ct[i][j][k][l][0],
+                  old_frame_coef_probs[i][j][k][l], &newp, upd, i, j);
+            else
+#endif
               s = prob_diff_update_savings_search(
-                      frame_branch_ct[i][j][k][l][t],
-                      *oldp, &newp, upd);
-              if (s > 0 && newp != *oldp)
-                u = 1;
+                  frame_branch_ct[i][j][k][l][t],
+                  *oldp, &newp, upd);
+            if (s > 0 && newp != *oldp)
+              u = 1;
 #else
-              s = prob_update_savings(frame_branch_ct[i][j][k][l][t],
-                                      *oldp, newp, upd);
-              if (s > 0)
-                u = 1;
+            s = prob_update_savings(frame_branch_ct[i][j][k][l][t],
+                                    *oldp, newp, upd);
+            if (s > 0)
+              u = 1;
 #endif
-              vp9_write(bc, u, upd);
+            vp9_write(bc, u, upd);
 #ifdef ENTROPY_STATS
-              if (!cpi->dummy_packing)
-                ++tree_update_hist[i][j][k][l][t][u];
+            if (!cpi->dummy_packing)
+              ++tree_update_hist[i][j][k][l][t][u];
+#endif
+            if (u) {
+              /* send/use new probability */
+              write_prob_diff_update(bc, newp, *oldp);
+              *oldp = newp;
+#if CONFIG_MODELCOEFPROB && MODEL_BASED_UPDATE
+              if (t == UNCONSTRAINED_NODES - 1)
+                vp9_get_model_distribution(
+                    newp, old_frame_coef_probs[i][j][k][l], i, j);
 #endif
-              if (u) {
-                /* send/use new probability */
-                write_prob_diff_update(bc, newp, *oldp);
-                *oldp = newp;
-              }
             }
           }
         }
index 428e585e19f30ca5867af27e7e2488bfa5ee20bc..11b300bddb90b39388fc0f5c9f98cb094ca5beac 100644 (file)
@@ -1287,9 +1287,6 @@ static void encode_frame_internal(VP9_COMP *cpi) {
   vp9_zero(cpi->mb_mv_ref_count);
 #endif
 
-  // force lossless mode
-  if (cm->base_qindex <= 4)
-    cm->base_qindex = 0;
   cpi->mb.e_mbd.lossless = (cm->base_qindex == 0 &&
                             cm->y1dc_delta_q == 0 &&
                             cm->uvdc_delta_q == 0 &&
index c2f2f83e1e09da72883e4e94d2523f29f9fc1424..2dfc27c68f9c81f812832e61eac7c0f98c27eeea 100644 (file)
@@ -3052,6 +3052,10 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
     }
 
     // transform / motion compensation build reconstruction frame
+#if CONFIG_MODELCOEFPROB && ADJUST_KF_COEF_PROBS
+    if (cm->frame_type == KEY_FRAME)
+      vp9_adjust_default_coef_probs(cm);
+#endif
 
     vp9_encode_frame(cpi);
 
index 9ac2c8460f27e128753475c7383176f07a4a2f8c..13958c03d071bfd692034b4f43a123da7cd6be9c 100644 (file)
@@ -730,6 +730,10 @@ void vp9_set_quantizer(struct VP9_COMP *cpi, int Q) {
 
   cm->base_qindex = Q;
 
+  // Set lossless mode
+  if (cm->base_qindex <= 4)
+    cm->base_qindex = 0;
+
   // if any of the delta_q values are changing update flag will
   // have to be set.
   cm->y1dc_delta_q = 0;