]> granicus.if.org Git - libvpx/commitdiff
Further changes to coefficient contexts.
authorPaul Wilkins <paulwilkins@google.com>
Tue, 19 Feb 2013 18:12:00 +0000 (10:12 -0800)
committerRonald S. Bultje <rbultje@google.com>
Sat, 23 Feb 2013 15:29:09 +0000 (07:29 -0800)
This patch alters the balance of context between the
coefficient bands (reflecting the position of coefficients
within a transform blocks) and the energy of the previous
token (or tokens) within a block.

In this case the number of coefficient bands is reduced
but more previous token energy bands are supported.

Some initial rebalancing of the default tables has been
by running multiple derf clips at multiple data rates using
the ENTOPY_STATS macro. Further balancing needs to be
done using larger image formatsd especially in regard to
the bigger transform sizes which are not as well represented
in encodings of smaller image formats.

Change-Id: If9736e95c391e711b04aef6393d26f60f36e1f8a

vp9/common/vp9_default_coef_probs.h
vp9/common/vp9_entropy.c
vp9/common/vp9_entropy.h
vp9/common/vp9_treecoder.h
vp9/decoder/vp9_detokenize.c
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_encodemb.c
vp9/encoder/vp9_rdopt.c
vp9/encoder/vp9_tokenize.c

index c18712259804143284ab9268c117a36c67c41617..3e78c0b7e9dee7bef74c96a2bcc4af40cbc57089 100644 (file)
 
 /*Generated file, included by vp9_entropy.c*/
 
-
 static const vp9_coeff_probs default_coef_probs_4x4[BLOCK_TYPES_4X4] = {
   { /* block Type 0 */
     { /* Coeff Band 0 */
-      { 209,  89, 216, 242, 191, 190, 245, 191, 240, 235, 168 },
-      { 142,  96, 196, 229, 173, 180, 233, 175, 247, 220, 174 },
-      {  66,  89, 157, 205, 155, 171, 209, 156, 243, 200, 197 },
+      { 217, 106, 221, 236, 184, 182, 233, 176, 236, 225, 152 },
+      { 132, 100, 186, 213, 166, 172, 206, 155, 227, 192, 183 },
+      {  39,  86, 136, 179, 147, 163, 179, 140, 228, 177, 201 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 159, 235, 246, 202, 197, 237, 186, 248, 223, 223 },
-      {  96, 137, 223, 247, 203, 198, 242, 188, 241, 202, 209 },
-      {  22,  95, 167, 243, 184, 196, 237, 187, 247, 221, 221 },
-      {   3,  51,  81, 192, 125, 158, 220, 164, 242, 211, 197 }
+      {   1, 166, 224, 238, 190, 184, 229, 172, 249, 215, 255 },
+      {  69, 139, 208, 238, 190, 185, 231, 174, 250, 216, 249 },
+      {  21,  96, 157, 236, 178, 187, 232, 175, 251, 216, 228 },
+      {   9,  68, 106, 220, 133, 168, 235, 182, 251, 213, 235 },
+      {   2,  41,  62, 153, 109, 143, 230, 146, 251, 222, 228 },
+      {   1,  19,  29,  80,  97, 137, 134, 105, 237, 181, 222 }
     }, { /* Coeff Band 2 */
-      {   1, 145, 226, 244, 196, 194, 240, 191, 247, 225, 233 },
-      {  66, 127, 203, 240, 188, 189, 239, 188, 248, 225, 220 },
-      {   9,  83, 136, 224, 159, 176, 235, 177, 247, 223, 207 },
-      {   2,  46,  71, 169, 121, 152, 210, 149, 241, 212, 199 }
+      {   1, 142, 214, 234, 184, 184, 224, 171, 246, 210, 209 },
+      {  43, 127, 183, 227, 173, 178, 223, 169, 246, 205, 216 },
+      {   6,  91, 132, 212, 152, 170, 219, 162, 246, 203, 229 },
+      {   2,  66,  96, 189, 130, 159, 214, 155, 246, 203, 222 },
+      {   1,  43,  62, 143, 111, 146, 194, 135, 244, 198, 223 },
+      {   1,  24,  34,  87, 101, 140, 133, 111, 226, 163, 214 }
     }, { /* Coeff Band 3 */
-      {   1, 174, 238, 249, 209, 201, 245, 198, 241, 196, 241 },
-      {  76, 151, 223, 247, 203, 197, 245, 194, 243, 202, 198 },
-      {  12, 102, 170, 240, 183, 187, 242, 191, 247, 225, 209 },
-      {   1,  52,  85, 202, 135, 162, 225, 168, 240, 209, 221 }
+      {   1, 153, 215, 237, 188, 185, 234, 176, 252, 221, 244 },
+      {  46, 130, 190, 232, 177, 181, 233, 174, 253, 220, 241 },
+      {   6,  90, 140, 220, 159, 173, 230, 169, 252, 218, 241 },
+      {   2,  62,  99, 200, 136, 164, 225, 161, 252, 216, 239 },
+      {   1,  36,  58, 155, 109, 147, 208, 144, 250, 207, 235 },
+      {   1,  17,  27,  81,  93, 136, 146, 109, 237, 175, 221 }
     }, { /* Coeff Band 4 */
-      {   1, 140, 230, 247, 204, 198, 242, 190, 249, 209, 248 },
-      {  94, 126, 213, 244, 195, 194, 240, 190, 247, 210, 237 },
-      {  13,  95, 159, 232, 171, 181, 237, 179, 245, 205, 237 },
-      {   1,  51,  83, 186, 128, 158, 216, 154, 240, 193, 229 }
+      {   1, 157, 218, 243, 194, 190, 241, 186, 252, 224, 228 },
+      {  66, 129, 194, 237, 180, 185, 239, 182, 253, 225, 248 },
+      {  14,  95, 152, 226, 162, 177, 237, 177, 253, 224, 249 },
+      {   5,  69, 112, 210, 143, 168, 231, 168, 253, 221, 240 },
+      {   1,  42,  68, 172, 115, 153, 217, 153, 253, 215, 246 },
+      {   1,  20,  31,  96,  93, 133, 169, 118, 243, 191, 224 }
     }, { /* Coeff Band 5 */
-      {   1, 218, 244, 251, 214, 202, 243, 199, 253, 214, 255 },
-      {  91, 194, 238, 249, 210, 200, 247, 203, 251, 223, 255 },
-      {  18, 140, 207, 247, 198, 194, 246, 203, 252, 213, 255 },
-      {   3,  76, 126, 223, 156, 172, 233, 185, 251, 206, 255 }
-    }, { /* Coeff Band 6 */
-      {   1, 135, 235, 250, 210, 203, 246, 206, 251, 219, 241 },
-      { 105, 120, 214, 246, 196, 196, 245, 195, 250, 216, 243 },
-      {  24,  91, 154, 231, 166, 180, 241, 183, 250, 214, 242 },
-      {   3,  53,  84, 183, 127, 157, 218, 153, 244, 195, 237 }
-    }, { /* Coeff Band 7 */
-      {   1,  83, 246, 252, 215, 208, 246, 206, 255, 237, 128 },
-      { 184,  61, 233, 250, 208, 204, 245, 198, 254, 227, 255 },
-      {  83,  58, 190, 246, 189, 195, 244, 198, 255, 229, 128 },
-      {  41,  38, 125, 214, 144, 169, 229, 171, 251, 216, 255 }
+      {   1, 113, 226, 247, 200, 195, 245, 192, 255, 233, 128 },
+      { 125,  90, 208, 243, 191, 190, 244, 190, 254, 233, 238 },
+      {  55,  74, 164, 236, 174, 184, 242, 185, 254, 232, 255 },
+      {  28,  58, 122, 221, 148, 172, 238, 178, 254, 229, 225 },
+      {  11,  39,  75, 178, 118, 154, 225, 158, 254, 225, 246 },
+      {   5,  21,  38, 105,  97, 140, 171, 119, 247, 193, 246 }
     }
   }, { /* block Type 1 */
     { /* Coeff Band 0 */
-      { 242,  73, 238, 244, 198, 192, 241, 189, 253, 226, 247 },
-      { 171,  70, 204, 231, 180, 183, 228, 172, 247, 215, 221 },
-      {  73,  62, 144, 202, 153, 169, 207, 153, 245, 199, 230 },
+      { 240,  66, 234, 234, 188, 182, 224, 172, 242, 204, 186 },
+      { 153,  73, 194, 210, 169, 173, 196, 152, 229, 184, 196 },
+      {  55,  61, 125, 168, 144, 161, 169, 136, 227, 173, 210 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 163, 241, 245, 201, 192, 243, 191, 255, 229, 255 },
-      { 165, 147, 230, 245, 201, 193, 244, 193, 255, 231, 255 },
-      {  76, 109, 191, 243, 190, 193, 243, 192, 255, 231, 255 },
-      {  22,  63, 111, 202, 138, 164, 225, 164, 252, 218, 248 }
+      {   1, 150, 232, 235, 190, 182, 228, 174, 250, 212, 255 },
+      { 144, 131, 216, 235, 191, 187, 225, 171, 249, 215, 249 },
+      {  58, 101, 175, 235, 184, 188, 227, 173, 251, 218, 255 },
+      {  26,  75, 127, 225, 149, 177, 229, 179, 251, 215, 246 },
+      {  11,  48,  80, 177, 117, 150, 229, 159, 251, 215, 243 },
+      {   5,  28,  42, 103, 104, 141, 161, 115, 240, 186, 229 }
     }, { /* Coeff Band 2 */
-      {   1, 113, 225, 245, 201, 195, 238, 185, 254, 225, 255 },
-      { 122, 105, 195, 236, 183, 186, 235, 180, 254, 227, 252 },
-      {  38,  79, 135, 217, 154, 172, 229, 171, 253, 220, 250 },
-      {   9,  53,  78, 161, 121, 151, 202, 141, 251, 207, 244 }
+      {   1, 114, 220, 232, 186, 184, 221, 169, 245, 199, 251 },
+      {  94, 110, 185, 224, 173, 178, 222, 166, 245, 211, 224 },
+      {  22,  80, 132, 211, 154, 171, 218, 162, 249, 208, 242 },
+      {   7,  59,  95, 189, 130, 160, 213, 154, 248, 210, 244 },
+      {   1,  37,  58, 141, 109, 146, 197, 136, 247, 199, 237 },
+      {   1,  20,  31,  82,  96, 135, 137, 112, 235, 166, 228 }
     }, { /* Coeff Band 3 */
-      {   1, 150, 238, 250, 213, 202, 244, 194, 255, 236, 255 },
-      { 140, 132, 223, 247, 204, 199, 243, 193, 255, 234, 255 },
-      {  51, 101, 182, 240, 188, 189, 240, 186, 255, 232, 255 },
-      {   6,  59, 100, 201, 137, 165, 225, 161, 252, 221, 249 }
+      {   1, 145, 223, 238, 191, 186, 233, 178, 253, 221, 255 },
+      { 102, 126, 196, 232, 178, 182, 232, 176, 253, 217, 241 },
+      {  27,  96, 155, 221, 161, 174, 230, 172, 252, 220, 255 },
+      {   7,  71, 116, 205, 146, 167, 226, 164, 251, 216, 239 },
+      {   1,  46,  74, 171, 118, 153, 209, 149, 252, 213, 234 },
+      {   1,  22,  35, 102,  97, 136, 171, 117, 244, 194, 233 }
     }, { /* Coeff Band 4 */
-      {   1, 151, 233, 248, 205, 199, 248, 196, 255, 243, 255 },
-      { 133, 140, 214, 244, 193, 193, 245, 194, 255, 236, 255 },
-      {  27, 104, 168, 235, 172, 183, 243, 187, 254, 235, 255 },
-      {   2,  61, 101, 202, 135, 164, 229, 167, 254, 223, 255 }
+      {   1, 152, 227, 244, 198, 192, 241, 189, 255, 241, 128 },
+      { 103, 137, 204, 239, 185, 187, 242, 185, 255, 234, 128 },
+      {  29, 106, 166, 231, 169, 179, 239, 181, 255, 236, 128 },
+      {  10,  79, 129, 217, 152, 171, 235, 173, 255, 233, 128 },
+      {   2,  50,  84, 187, 125, 159, 224, 158, 255, 223, 255 },
+      {   1,  26,  45, 122, 101, 139, 194, 130, 249, 205, 255 }
     }, { /* Coeff Band 5 */
-      {   1, 227, 246, 254, 225, 215, 254, 217, 255, 255, 128 },
-      { 132, 195, 239, 253, 219, 210, 252, 212, 255, 255, 128 },
-      {  49, 143, 214, 251, 207, 204, 253, 212, 255, 238, 128 },
-      {  11,  93, 151, 235, 169, 185, 247, 190, 255, 238, 128 }
-    }, { /* Coeff Band 6 */
-      {   1, 143, 237, 251, 213, 203, 249, 203, 255, 243, 128 },
-      { 137, 120, 216, 246, 198, 196, 248, 199, 255, 240, 255 },
-      {  50,  94, 166, 233, 169, 181, 245, 189, 255, 240, 255 },
-      {   9,  56,  97, 190, 129, 158, 228, 159, 255, 226, 255 }
-    }, { /* Coeff Band 7 */
-      {   1,  96, 245, 254, 229, 216, 255, 212, 255, 255, 128 },
-      { 179,  81, 234, 253, 217, 209, 255, 230, 255, 255, 128 },
-      { 105,  56, 192, 248, 192, 197, 252, 212, 255, 205, 128 },
-      {  53,  32, 133, 228, 151, 177, 250, 192, 255, 255, 128 }
+      {   1, 122, 234, 249, 208, 201, 249, 200, 255, 253, 128 },
+      { 133, 107, 213, 246, 197, 194, 248, 197, 255, 246, 128 },
+      {  56,  86, 170, 240, 179, 187, 249, 192, 255, 239, 128 },
+      {  25,  67, 129, 225, 150, 175, 245, 186, 255, 240, 128 },
+      {  10,  47,  87, 190, 124, 155, 237, 168, 255, 231, 128 },
+      {  13,  32,  57, 133,  95, 159, 193, 141, 254, 207, 128 }
     }
   }
 };
 static const vp9_coeff_probs default_hybrid_coef_probs_4x4[BLOCK_TYPES_4X4_HYBRID] = {
   { /* block Type 0 */
     { /* Coeff Band 0 */
-      { 191,  34, 178, 193, 160, 173, 196, 142, 247, 191, 244 },
-      {  84,  45, 129, 187, 145, 170, 189, 145, 240, 186, 212 },
-      {  14,  36,  69, 149, 120, 154, 177, 136, 231, 177, 196 },
+      { 168,  42, 163, 192, 156, 165, 188, 147, 237, 185, 167 },
+      {  68,  38,  98, 154, 135, 155, 155, 133, 216, 162, 190 },
+      {   7,  25,  45, 101, 108, 143, 134, 117, 216, 159, 200 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1,  76, 169, 226, 167, 180, 227, 171, 247, 218, 226 },
-      {  72,  75, 162, 226, 166, 181, 231, 172, 242, 200, 219 },
-      {  30,  63, 130, 218, 153, 175, 226, 170, 247, 216, 219 },
-      {   5,  39,  67, 156, 119, 151, 194, 140, 239, 202, 216 }
+      {   1,  71, 142, 195, 149, 164, 206, 149, 244, 198, 226 },
+      {  56,  66, 133, 195, 148, 162, 205, 148, 244, 196, 236 },
+      {  32,  57, 111, 193, 140, 162, 205, 147, 245, 197, 237 },
+      {  15,  47,  87, 178, 122, 154, 208, 151, 245, 198, 233 },
+      {   4,  34,  57, 138, 109, 144, 198, 131, 248, 203, 231 },
+      {   1,  16,  23,  74,  93, 136, 125, 107, 226, 163, 216 }
     }, { /* Coeff Band 2 */
-      {   1,  79, 182, 228, 175, 183, 224, 170, 247, 215, 220 },
-      {  69,  77, 168, 224, 170, 180, 223, 168, 246, 215, 223 },
-      {  24,  63, 126, 209, 153, 171, 219, 160, 247, 215, 225 },
-      {   3,  35,  58, 151, 115, 151, 191, 138, 240, 199, 220 }
+      {   1,  69, 154, 204, 155, 166, 212, 150, 248, 203, 239 },
+      {  47,  67, 137, 201, 150, 165, 212, 151, 246, 202, 236 },
+      {  13,  56, 105, 190, 140, 161, 209, 148, 246, 202, 227 },
+      {   3,  43,  74, 172, 122, 154, 205, 146, 246, 201, 230 },
+      {   1,  26,  41, 126,  99, 141, 190, 131, 246, 195, 229 },
+      {   1,  11,  17,  60,  85, 130, 122, 100, 226, 163, 214 }
     }, { /* Coeff Band 3 */
-      {   1, 139, 213, 238, 194, 192, 234, 180, 244, 193, 236 },
-      {  82, 127, 204, 238, 190, 186, 234, 175, 244, 191, 235 },
-      {  26,  93, 161, 230, 173, 179, 233, 178, 249, 217, 241 },
-      {   3,  48,  78, 186, 132, 158, 212, 157, 244, 205, 233 }
+      {   1,  92, 165, 213, 159, 170, 220, 161, 247, 208, 225 },
+      {  44,  84, 147, 208, 154, 169, 219, 159, 248, 207, 229 },
+      {  13,  66, 113, 198, 141, 166, 215, 154, 248, 207, 234 },
+      {   4,  49,  82, 179, 124, 157, 211, 153, 247, 203, 227 },
+      {   1,  30,  49, 139, 105, 145, 195, 135, 247, 201, 225 },
+      {   1,  14,  22,  73,  89, 134, 137, 109, 234, 172, 212 }
     }, { /* Coeff Band 4 */
-      {   1, 100, 208, 233, 180, 182, 238, 175, 250, 206, 225 },
-      {  84,  87, 184, 230, 175, 180, 236, 179, 250, 209, 243 },
-      {  14,  61, 111, 217, 146, 171, 236, 174, 249, 207, 245 },
-      {   1,  32,  49, 150, 106, 142, 212, 145, 242, 191, 237 }
+      {   1, 105, 186, 226, 170, 177, 228, 170, 249, 214, 200 },
+      {  53,  92, 164, 222, 165, 175, 228, 168, 251, 217, 222 },
+      {  12,  71, 124, 213, 151, 172, 225, 166, 251, 215, 242 },
+      {   3,  53,  89, 194, 129, 160, 222, 162, 251, 214, 237 },
+      {   1,  32,  52, 149, 106, 146, 208, 142, 251, 212, 233 },
+      {   1,  14,  23,  79,  89, 136, 149, 111, 238, 184, 222 }
     }, { /* Coeff Band 5 */
-      {   1, 130, 223, 241, 192, 189, 231, 176, 250, 209, 246 },
-      { 101, 120, 207, 239, 188, 187, 240, 196, 250, 202, 255 },
-      {  19,  90, 155, 232, 169, 181, 238, 190, 250, 207, 249 },
-      {   1,  54,  86, 197, 130, 161, 220, 170, 248, 196, 248 }
-    }, { /* Coeff Band 6 */
-      {   1, 103, 208, 236, 183, 185, 235, 190, 243, 202, 219 },
-      {  95,  92, 185, 230, 175, 181, 233, 174, 242, 203, 225 },
-      {  24,  72, 131, 213, 152, 171, 226, 164, 241, 202, 220 },
-      {   3,  45,  74, 169, 123, 154, 204, 145, 238, 188, 222 }
-    }, { /* Coeff Band 7 */
-      {   1,  63, 236, 247, 205, 194, 241, 189, 252, 222, 255 },
-      { 151,  48, 224, 245, 200, 193, 240, 187, 255, 234, 255 },
-      {  76,  45, 178, 240, 180, 189, 239, 182, 253, 231, 255 },
-      {  38,  31, 111, 187, 125, 154, 217, 155, 253, 214, 255 }
+      {   1,  83, 206, 238, 184, 184, 237, 179, 248, 225, 206 },
+      { 103,  73, 187, 235, 178, 183, 237, 178, 250, 224, 246 },
+      {  41,  61, 146, 228, 162, 176, 236, 177, 252, 223, 222 },
+      {  17,  49, 105, 210, 139, 168, 233, 172, 253, 222, 242 },
+      {   5,  33,  61, 167, 111, 150, 221, 152, 252, 220, 231 },
+      {   1,  16,  28,  92,  90, 137, 168, 119, 244, 193, 231 }
     }
   }
 };
 static const vp9_coeff_probs default_coef_probs_8x8[BLOCK_TYPES_8X8] = {
   { /* block Type 0 */
     { /* Coeff Band 0 */
-      { 140, 101, 214, 227, 176, 182, 218, 167, 233, 205, 164 },
-      {  96, 101, 176, 204, 161, 173, 193, 152, 223, 182, 182 },
-      {  27,  84, 123, 176, 140, 162, 190, 142, 238, 189, 210 },
+      { 166,  99, 221, 217, 170, 176, 208, 164, 239, 192, 168 },
+      {  99,  92, 179, 196, 159, 166, 180, 144, 220, 173, 193 },
+      {  25,  74, 122, 166, 142, 159, 167, 136, 219, 171, 197 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 178, 218, 240, 189, 189, 238, 184, 250, 232, 189 },
-      {  69, 146, 204, 239, 187, 189, 238, 183, 251, 226, 221 },
-      {  16,  98, 157, 234, 170, 185, 237, 183, 252, 220, 218 },
-      {   3,  49,  78, 172, 122, 154, 204, 150, 242, 198, 207 }
+      {   1, 179, 220, 233, 183, 182, 224, 169, 251, 219, 255 },
+      {  77, 156, 208, 233, 182, 180, 224, 171, 250, 216, 255 },
+      {  29, 116, 174, 230, 174, 179, 226, 169, 250, 217, 247 },
+      {  16,  87, 132, 219, 150, 171, 228, 171, 250, 214, 251 },
+      {   6,  58,  86, 174, 122, 153, 223, 151, 251, 217, 247 },
+      {   2,  29,  42,  97, 105, 142, 144, 113, 233, 173, 217 }
     }, { /* Coeff Band 2 */
-      {   1, 165, 207, 230, 179, 181, 234, 172, 252, 228, 218 },
-      {  25, 130, 175, 224, 169, 177, 232, 169, 252, 230, 207 },
-      {   4,  81, 118, 205, 144, 167, 227, 162, 252, 225, 219 },
-      {   2,  51,  63, 150, 114, 148, 197, 138, 244, 202, 204 }
+      {   1, 160, 212, 230, 181, 179, 220, 167, 246, 207, 246 },
+      {  26, 134, 178, 222, 169, 175, 218, 163, 244, 202, 236 },
+      {   4,  87, 128, 205, 150, 165, 214, 157, 246, 202, 240 },
+      {   1,  61,  91, 180, 128, 157, 206, 147, 245, 199, 237 },
+      {   1,  38,  56, 135, 108, 146, 184, 132, 242, 190, 235 },
+      {   1,  20,  29,  77,  98, 138, 124, 108, 226, 159, 211 }
     }, { /* Coeff Band 3 */
-      {   1, 181, 222, 247, 200, 197, 246, 199, 252, 232, 228 },
-      {  25, 142, 200, 244, 190, 193, 245, 195, 253, 233, 204 },
-      {   3,  90, 146, 233, 166, 181, 242, 188, 252, 229, 216 },
-      {   1,  47,  79, 188, 124, 157, 222, 162, 245, 213, 203 }
+      {   1, 177, 218, 239, 191, 187, 231, 177, 249, 212, 244 },
+      {  40, 138, 193, 234, 180, 183, 231, 175, 250, 213, 246 },
+      {   6,  93, 144, 222, 160, 175, 228, 170, 250, 213, 230 },
+      {   1,  63, 101, 200, 136, 164, 223, 162, 250, 210, 241 },
+      {   1,  36,  59, 151, 109, 148, 204, 142, 249, 208, 235 },
+      {   1,  17,  27,  82,  93, 136, 142, 110, 236, 177, 227 }
     }, { /* Coeff Band 4 */
-      {   1, 179, 220, 242, 195, 191, 237, 182, 251, 217, 231 },
-      {  27, 144, 200, 241, 188, 190, 238, 185, 250, 224, 235 },
-      {   3,  93, 149, 230, 166, 180, 235, 180, 249, 222, 221 },
-      {   1,  47,  79, 181, 125, 157, 211, 154, 241, 205, 198 }
+      {   1, 182, 219, 238, 190, 186, 233, 175, 251, 223, 247 },
+      {  23, 142, 192, 232, 179, 182, 233, 173, 252, 220, 244 },
+      {   2,  90, 139, 220, 158, 173, 230, 170, 252, 220, 245 },
+      {   1,  59,  95, 196, 133, 162, 225, 161, 252, 218, 253 },
+      {   1,  34,  55, 147, 106, 146, 208, 139, 251, 212, 239 },
+      {   1,  17,  27,  79,  94, 135, 143, 109, 239, 181, 228 }
     }, { /* Coeff Band 5 */
-      {   1, 176, 222, 247, 202, 198, 247, 199, 252, 234, 219 },
-      {  24, 139, 197, 244, 190, 192, 246, 196, 253, 232, 220 },
-      {   2,  89, 140, 229, 161, 178, 243, 185, 253, 233, 234 },
-      {   1,  49,  76, 176, 121, 154, 214, 153, 243, 209, 208 }
-    }, { /* Coeff Band 6 */
-      {   1, 197, 233, 251, 213, 205, 247, 206, 249, 222, 247 },
-      {  35, 159, 216, 249, 203, 201, 246, 203, 250, 222, 223 },
-      {   4, 108, 167, 240, 178, 188, 244, 195, 248, 220, 235 },
-      {   1,  58,  93, 198, 133, 161, 220, 167, 233, 195, 221 }
-    }, { /* Coeff Band 7 */
-      {   1, 188, 240, 253, 221, 209, 248, 207, 252, 223, 255 },
-      {  84, 153, 227, 251, 212, 205, 247, 205, 254, 215, 255 },
-      {  25, 117, 182, 244, 186, 192, 243, 198, 250, 209, 255 },
-      {   7,  72, 108, 197, 138, 162, 203, 161, 240, 178, 247 }
+      {   1, 186, 221, 243, 195, 190, 241, 186, 254, 227, 245 },
+      {  36, 141, 196, 237, 182, 185, 240, 184, 254, 226, 252 },
+      {   5,  94, 147, 226, 161, 176, 238, 178, 254, 224, 239 },
+      {   1,  63, 103, 205, 137, 165, 233, 168, 254, 226, 246 },
+      {   1,  37,  61, 160, 110, 149, 215, 146, 253, 220, 247 },
+      {   1,  18,  29,  87,  93, 134, 157, 112, 246, 187, 244 }
     }
   }, { /* block Type 1 */
     { /* Coeff Band 0 */
-      { 229,  64, 235, 236, 189, 190, 227, 179, 247, 203, 226 },
-      { 148,  70, 194, 228, 175, 182, 216, 170, 238, 192, 224 },
-      {  53,  63, 134, 207, 150, 169, 213, 161, 247, 204, 232 },
+      { 217,  55, 235, 221, 182, 179, 198, 159, 228, 177, 165 },
+      { 121,  67, 195, 209, 172, 172, 193, 148, 231, 185, 202 },
+      {  42,  71, 146, 205, 161, 174, 189, 150, 231, 182, 206 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 173, 234, 244, 201, 193, 239, 180, 252, 214, 255 },
-      { 160, 156, 222, 243, 200, 193, 237, 179, 253, 216, 255 },
-      {  55, 119, 187, 240, 189, 192, 236, 180, 253, 226, 255 },
-      {  14,  65, 105, 193, 142, 165, 205, 151, 249, 200, 250 }
+      {   1, 171, 234, 242, 204, 191, 227, 172, 248, 204, 128 },
+      { 152, 158, 225, 241, 202, 189, 224, 173, 245, 203, 255 },
+      {  54, 133, 198, 239, 193, 188, 228, 178, 239, 218, 255 },
+      {  24, 104, 156, 229, 163, 181, 227, 176, 253, 212, 255 },
+      {  12,  62,  93, 185, 127, 156, 224, 162, 250, 213, 201 },
+      {   6,  28,  41,  99, 100, 141, 151, 111, 229, 175, 197 }
     }, { /* Coeff Band 2 */
-      {   1, 124, 218, 246, 195, 196, 242, 198, 254, 229, 255 },
-      {  85, 114, 180, 240, 179, 187, 239, 191, 253, 223, 239 },
-      {  18,  81, 128, 220, 152, 173, 232, 176, 252, 221, 254 },
-      {   2,  42,  64, 150, 115, 149, 192, 137, 247, 197, 247 }
+      {   1, 126, 218, 245, 199, 196, 231, 180, 253, 218, 128 },
+      {  71, 117, 186, 237, 185, 189, 225, 173, 253, 213, 255 },
+      {  13,  90, 137, 218, 158, 175, 221, 165, 250, 213, 255 },
+      {   4,  66,  96, 189, 132, 158, 215, 161, 250, 206, 244 },
+      {   1,  41,  58, 137, 115, 143, 188, 132, 247, 198, 236 },
+      {   1,  17,  27,  75, 100, 136, 118, 105, 215, 153, 188 }
     }, { /* Coeff Band 3 */
-      {   1, 164, 230, 251, 210, 204, 245, 201, 255, 238, 255 },
-      {  96, 137, 210, 248, 199, 199, 244, 198, 254, 218, 255 },
-      {  20,  97, 169, 240, 179, 188, 242, 190, 254, 228, 255 },
-      {   2,  58,  95, 197, 137, 164, 220, 158, 252, 217, 248 }
+      {   1, 171, 230, 245, 204, 193, 237, 183, 253, 214, 128 },
+      {  84, 144, 210, 241, 193, 189, 234, 178, 249, 215, 255 },
+      {  18, 111, 171, 230, 175, 180, 227, 173, 249, 212, 224 },
+      {   4,  79, 123, 211, 151, 171, 223, 165, 249, 219, 236 },
+      {   1,  43,  70, 167, 118, 152, 204, 150, 245, 202, 229 },
+      {   1,  18,  28,  87,  95, 137, 138, 113, 222, 167, 185 }
     }, { /* Coeff Band 4 */
-      {   1, 193, 236, 245, 203, 194, 243, 191, 254, 223, 255 },
-      {  86, 163, 217, 241, 190, 188, 242, 189, 253, 220, 255 },
-      {  14, 108, 161, 228, 167, 178, 238, 180, 253, 224, 255 },
-      {   1,  51,  84, 186, 127, 159, 216, 155, 251, 208, 243 }
+      {   1, 181, 235, 247, 211, 196, 237, 183, 255, 215, 128 },
+      {  74, 152, 213, 241, 196, 192, 233, 181, 246, 217, 239 },
+      {  13, 107, 162, 230, 172, 180, 228, 173, 251, 209, 255 },
+      {   2,  71, 112, 208, 141, 167, 222, 168, 245, 215, 239 },
+      {   1,  40,  61, 160, 110, 150, 204, 146, 247, 197, 235 },
+      {   1,  15,  25,  76,  92, 138, 134, 106, 226, 167, 209 }
     }, { /* Coeff Band 5 */
-      {   1, 183, 235, 248, 209, 197, 244, 195, 253, 236, 239 },
-      {  79, 144, 208, 243, 193, 190, 244, 191, 254, 231, 255 },
-      {  13, 100, 151, 227, 163, 176, 240, 180, 255, 233, 244 },
-      {   1,  48,  77, 171, 121, 153, 214, 150, 252, 214, 245 }
-    }, { /* Coeff Band 6 */
-      {   1, 202, 234, 252, 215, 207, 248, 207, 254, 242, 255 },
-      {  75, 153, 216, 249, 203, 201, 248, 203, 255, 239, 255 },
-      {  11, 104, 168, 241, 179, 189, 245, 194, 255, 237, 128 },
-      {   1,  57,  95, 201, 134, 163, 229, 165, 254, 223, 246 }
-    }, { /* Coeff Band 7 */
-      {   1, 184, 236, 254, 222, 212, 254, 225, 255, 255, 128 },
-      {  74, 149, 220, 252, 210, 208, 253, 223, 255, 249, 128 },
-      {  18, 109, 175, 247, 184, 195, 253, 211, 255, 250, 128 },
-      {   3,  64, 113, 219, 144, 171, 246, 187, 255, 250, 128 }
+      {   1, 195, 238, 246, 208, 196, 239, 186, 252, 215, 128 },
+      {  78, 156, 217, 241, 194, 191, 236, 181, 254, 219, 128 },
+      {  14, 108, 164, 229, 170, 180, 232, 173, 251, 225, 255 },
+      {   2,  70, 111, 206, 143, 165, 226, 166, 251, 220, 255 },
+      {   1,  37,  61, 155, 110, 148, 208, 143, 250, 211, 255 },
+      {   1,  16,  26,  80,  88, 138, 144, 108, 238, 183, 226 }
     }
   }
 };
 static const vp9_coeff_probs default_hybrid_coef_probs_8x8[BLOCK_TYPES_8X8_HYBRID] = {
   { /* block Type 0 */
     { /* Coeff Band 0 */
-      { 118,  27, 105, 170, 137, 166, 183, 137, 243, 189, 241 },
-      {  44,  34,  85, 142, 127, 158, 161, 128, 232, 174, 213 },
-      {   8,  26,  47, 104, 108, 145, 143, 117, 226, 168, 207 },
+      {  93,  40, 105, 152, 129, 148, 184, 131, 233, 185, 181 },
+      {  30,  34,  68, 124, 118, 145, 154, 121, 222, 174, 179 },
+      {   5,  23,  40,  94, 105, 141, 128, 115, 209, 155, 183 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 134, 172, 217, 163, 175, 226, 167, 251, 220, 204 },
-      {  56, 129, 168, 217, 161, 174, 223, 164, 249, 218, 223 },
-      {  20, 110, 151, 215, 158, 174, 221, 165, 249, 209, 221 },
-      {   2,  59,  88, 169, 128, 157, 192, 143, 239, 189, 214 }
+      {   1, 106, 149, 201, 153, 167, 216, 163, 249, 198, 192 },
+      {  48, 100, 142, 200, 153, 168, 214, 156, 243, 199, 213 },
+      {  26,  88, 131, 201, 147, 167, 211, 155, 244, 211, 171 },
+      {  13,  74, 113, 192, 136, 161, 212, 159, 237, 194, 214 },
+      {   3,  54,  84, 170, 121, 151, 207, 149, 243, 198, 214 },
+      {   1,  27,  41, 105, 103, 142, 151, 122, 219, 169, 189 }
     }, { /* Coeff Band 2 */
-      {   1,  65, 126, 191, 140, 163, 218, 153, 252, 218, 229 },
-      {  21,  57,  92, 175, 126, 156, 214, 148, 252, 218, 229 },
-      {   4,  44,  66, 148, 114, 148, 200, 136, 251, 211, 228 },
-      {   1,  28,  42, 108, 104, 141, 158, 119, 235, 180, 210 }
+      {   1,  79, 131, 195, 143, 162, 211, 156, 245, 203, 215 },
+      {  22,  76, 110, 183, 133, 159, 205, 147, 246, 206, 232 },
+      {   7,  65,  92, 165, 128, 150, 197, 139, 243, 198, 208 },
+      {   2,  53,  75, 151, 124, 150, 187, 135, 242, 186, 223 },
+      {   1,  36,  55, 124, 112, 147, 164, 125, 232, 174, 214 },
+      {   1,  17,  25,  72,  91, 134, 108, 110, 197, 149, 169 }
     }, { /* Coeff Band 3 */
-      {   1, 114, 172, 227, 166, 177, 236, 178, 252, 226, 233 },
-      {  41,  94, 152, 218, 156, 172, 233, 172, 251, 223, 231 },
-      {   9,  69, 116, 202, 142, 165, 226, 162, 251, 221, 227 },
-      {   1,  36,  60, 151, 113, 148, 195, 140, 241, 198, 211 }
+      {   1, 154, 188, 221, 170, 174, 218, 163, 244, 204, 206 },
+      {  39, 112, 161, 213, 159, 172, 216, 160, 244, 204, 224 },
+      {   7,  83, 125, 200, 147, 164, 210, 156, 243, 198, 212 },
+      {   2,  59,  94, 182, 131, 157, 205, 149, 240, 194, 217 },
+      {   1,  36,  58, 143, 112, 148, 187, 137, 237, 186, 212 },
+      {   1,  15,  24,  73,  93, 134, 121, 109, 206, 156, 180 }
     }, { /* Coeff Band 4 */
-      {   1, 186, 200, 227, 174, 178, 230, 169, 248, 210, 238 },
-      {  27, 148, 181, 221, 167, 176, 226, 166, 250, 218, 228 },
-      {   3,  96, 139, 208, 154, 170, 219, 161, 249, 214, 229 },
-      {   1,  44,  70, 156, 120, 152, 188, 139, 239, 193, 200 }
+      {   1, 154, 179, 223, 168, 176, 220, 166, 244, 205, 215 },
+      {  21, 111, 156, 215, 160, 171, 218, 164, 244, 201, 208 },
+      {   4,  79, 121, 202, 147, 167, 213, 160, 244, 202, 213 },
+      {   1,  57,  90, 181, 131, 159, 202, 152, 241, 199, 204 },
+      {   1,  34,  54, 136, 108, 146, 182, 134, 237, 188, 205 },
+      {   1,  14,  21,  65,  91, 138, 110, 106, 200, 154, 174 }
     }, { /* Coeff Band 5 */
-      {   1, 169, 203, 238, 186, 186, 238, 184, 252, 224, 230 },
-      {  32, 119, 173, 232, 172, 181, 236, 182, 252, 222, 237 },
-      {   6,  84, 128, 215, 150, 170, 232, 172, 251, 221, 235 },
-      {   1,  49,  78, 167, 124, 154, 200, 145, 243, 198, 217 }
-    }, { /* Coeff Band 6 */
-      {   1, 193, 215, 244, 197, 195, 239, 192, 249, 213, 240 },
-      {  52, 136, 193, 239, 184, 189, 237, 189, 248, 211, 226 },
-      {  13,  90, 146, 227, 162, 178, 233, 182, 248, 211, 231 },
-      {   1,  49,  79, 177, 124, 156, 201, 154, 234, 188, 212 }
-    }, { /* Coeff Band 7 */
-      {   1, 189, 238, 248, 219, 196, 232, 180, 253, 211, 255 },
-      { 104, 148, 224, 245, 211, 194, 225, 171, 251, 206, 255 },
-      {  43, 116, 190, 231, 179, 183, 217, 168, 249, 199, 255 },
-      {  13,  65,  92, 154, 131, 152, 167, 132, 238, 174, 243 }
+      {   1, 175, 204, 235, 184, 182, 228, 171, 247, 214, 232 },
+      {  38, 122, 178, 227, 172, 179, 227, 171, 248, 207, 216 },
+      {   9,  86, 136, 214, 154, 170, 222, 165, 247, 206, 244 },
+      {   2,  60,  98, 192, 134, 160, 214, 157, 245, 206, 218 },
+      {   1,  34,  58, 145, 110, 148, 191, 138, 242, 194, 220 },
+      {   1,  13,  22,  69,  89, 136, 121, 110, 212, 159, 192 }
     }
   }
 };
 static const vp9_coeff_probs default_coef_probs_16x16[BLOCK_TYPES_16X16] = {
   { /* block Type 0 */
     { /* Coeff Band 0 */
-      {  14,  78, 225, 217, 173, 181, 198, 153, 228, 185, 176 },
-      {   9,  74, 179, 191, 157, 171, 178, 143, 229, 175, 209 },
-      {   3,  48,  92, 128, 130, 155, 135, 123, 220, 155, 219 },
+      {  53,  59, 216, 198, 162, 169, 182, 147, 210, 176, 132 },
+      {  19,  55, 157, 175, 153, 162, 156, 136, 198, 163, 161 },
+      {   5,  45,  93, 140, 136, 156, 136, 126, 194, 154, 163 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 178, 209, 214, 173, 175, 208, 152, 252, 210, 237 },
-      { 142, 151, 193, 212, 170, 175, 209, 151, 251, 208, 237 },
-      {  38, 105, 150, 206, 159, 173, 208, 151, 250, 209, 238 },
-      {   5,  44,  61, 128, 114, 147, 167, 125, 239, 184, 217 }
+      {   1, 180, 204, 215, 172, 178, 207, 155, 238, 193, 241 },
+      { 140, 160, 195, 214, 169, 177, 203, 158, 235, 191, 190 },
+      {  65, 129, 172, 211, 163, 174, 206, 155, 238, 195, 240 },
+      {  36,  96, 137, 199, 148, 167, 204, 155, 240, 195, 216 },
+      {  15,  62,  88, 161, 125, 153, 193, 138, 239, 192, 216 },
+      {   3,  25,  37,  81, 104, 141, 114, 112, 200, 151, 176 }
     }, { /* Coeff Band 2 */
-      {   1, 154, 195, 202, 166, 173, 184, 144, 245, 184, 236 },
-      {  49, 110, 150, 188, 155, 168, 180, 141, 244, 183, 239 },
-      {   4,  63,  90, 158, 132, 157, 171, 134, 243, 179, 239 },
-      {   1,  25,  37,  93, 104, 141, 133, 114, 231, 161, 226 }
+      {   1, 152, 202, 213, 171, 172, 198, 157, 239, 193, 205 },
+      {  41, 116, 158, 200, 158, 169, 193, 148, 235, 190, 213 },
+      {   8,  79, 111, 179, 140, 165, 184, 144, 233, 178, 212 },
+      {   2,  55,  80, 154, 123, 155, 176, 138, 231, 181, 203 },
+      {   1,  32,  48, 111, 107, 140, 154, 120, 223, 170, 208 },
+      {   1,  14,  21,  54,  96, 134,  88, 101, 182, 137, 170 }
     }, { /* Coeff Band 3 */
-      {   1, 184, 201, 223, 173, 177, 224, 164, 253, 220, 238 },
-      {  42, 127, 170, 215, 164, 173, 223, 162, 253, 219, 233 },
-      {   4,  75, 114, 195, 142, 164, 218, 155, 253, 217, 235 },
-      {   1,  32,  50, 128, 108, 144, 180, 127, 247, 197, 219 }
+      {   1, 198, 204, 232, 183, 182, 227, 172, 249, 213, 217 },
+      {  13, 133, 174, 224, 169, 177, 227, 169, 249, 213, 220 },
+      {   1,  82, 126, 210, 149, 169, 223, 165, 249, 211, 223 },
+      {   1,  54,  87, 185, 128, 159, 216, 155, 249, 210, 228 },
+      {   1,  31,  51, 136, 105, 144, 193, 134, 246, 201, 225 },
+      {   1,  14,  22,  68,  91, 135, 122, 104, 219, 162, 194 }
     }, { /* Coeff Band 4 */
-      {   1, 190, 207, 232, 181, 184, 228, 172, 251, 216, 212 },
-      {  35, 136, 180, 227, 173, 180, 227, 171, 251, 216, 218 },
-      {   2,  85, 131, 214, 154, 173, 224, 166, 250, 214, 225 },
-      {   1,  44,  71, 162, 120, 153, 195, 143, 240, 195, 197 }
+      {   1, 193, 208, 224, 179, 178, 212, 160, 242, 198, 211 },
+      {  23, 135, 175, 216, 166, 174, 211, 157, 244, 198, 214 },
+      {   2,  83, 123, 199, 148, 166, 206, 153, 243, 196, 228 },
+      {   1,  53,  83, 173, 126, 157, 199, 144, 242, 195, 214 },
+      {   1,  29,  46, 123, 103, 143, 175, 127, 238, 186, 222 },
+      {   1,  12,  19,  57,  92, 133, 104, 101, 205, 149, 190 }
     }, { /* Coeff Band 5 */
-      {   1, 185, 201, 230, 177, 180, 232, 172, 253, 225, 235 },
-      {  27, 122, 165, 221, 164, 175, 230, 169, 253, 224, 220 },
-      {   1,  72, 108, 197, 139, 163, 224, 159, 253, 224, 226 },
-      {   1,  33,  51, 132, 107, 144, 186, 130, 245, 201, 206 }
-    }, { /* Coeff Band 6 */
-      {   1, 203, 214, 240, 193, 191, 235, 178, 252, 225, 224 },
-      {  20, 140, 188, 235, 182, 186, 234, 177, 252, 226, 226 },
-      {   1,  85, 132, 218, 155, 174, 230, 170, 251, 224, 227 },
-      {   1,  39,  62, 154, 114, 150, 199, 141, 241, 203, 214 }
-    }, { /* Coeff Band 7 */
-      {   1, 217, 224, 244, 202, 193, 241, 187, 252, 227, 239 },
-      {  22, 151, 200, 239, 187, 188, 240, 184, 252, 226, 237 },
-      {   2,  90, 138, 222, 158, 174, 237, 176, 252, 226, 239 },
-      {   1,  41,  66, 163, 116, 151, 206, 146, 243, 201, 230 }
+      {   1, 207, 207, 231, 182, 182, 224, 169, 249, 209, 231 },
+      {  13, 136, 176, 223, 169, 177, 223, 167, 249, 209, 226 },
+      {   1,  82, 125, 208, 149, 169, 220, 163, 248, 208, 231 },
+      {   1,  53,  85, 182, 126, 158, 212, 153, 248, 205, 230 },
+      {   1,  29,  48, 131, 104, 143, 188, 131, 245, 197, 230 },
+      {   1,  13,  20,  63,  90, 133, 116, 102, 221, 160, 204 }
     }
   }, { /* block Type 1 */
     { /* Coeff Band 0 */
-      { 223,  34, 236, 234, 193, 185, 216, 169, 239, 189, 229 },
-      { 125,  40, 195, 221, 173, 175, 209, 165, 220, 181, 196 },
-      {  41,  37, 127, 185, 145, 162, 191, 150, 227, 180, 219 },
+      { 216,  35, 225, 222, 187, 173, 172, 156, 169, 181, 120 },
+      { 104,  42, 176, 202, 167, 168, 169, 151, 194, 171, 133 },
+      {  37,  44, 117, 169, 149, 166, 142, 132, 189, 161, 143 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 160, 224, 239, 193, 190, 213, 178, 244, 174, 255 },
-      { 199, 154, 212, 238, 190, 190, 210, 173, 246, 183, 249 },
-      {  88, 122, 178, 234, 180, 187, 213, 174, 244, 182, 247 },
-      {  27,  69, 100, 174, 139, 165, 159, 142, 225, 157, 240 }
+      {   1, 177, 232, 220, 177, 171, 206, 159, 213, 137, 128 },
+      { 197, 169, 225, 208, 177, 161, 214, 151, 192, 228, 255 },
+      { 117, 147, 210, 211, 171, 174, 190, 165, 216, 190,  51 },
+      {  66, 118, 169, 200, 172, 180, 189, 146, 226, 134, 255 },
+      {  31,  77,  99, 166, 129, 165, 172, 141, 213, 184, 231 },
+      {   8,  28,  33,  70, 107, 128, 107, 120, 181, 142, 165 }
     }, { /* Coeff Band 2 */
-      {   1, 118, 207, 237, 179, 185, 234, 189, 241, 194, 237 },
-      {  86, 103, 161, 227, 163, 176, 231, 183, 241, 196, 234 },
-      {  19,  69, 113, 205, 140, 166, 220, 169, 240, 188, 242 },
-      {   3,  32,  49, 106, 111, 144, 132, 121, 225, 151, 237 }
+      {   1, 109, 219, 228, 185, 169, 213, 167, 230, 190, 255 },
+      {  98, 113, 171, 208, 167, 169, 189, 132, 242, 141, 255 },
+      {  21,  81, 108, 181, 138, 148, 181, 140, 248, 169, 128 },
+      {   6,  59,  72, 154, 114, 158, 176, 140, 237, 181, 230 },
+      {   1,  43,  50,  98, 110, 148, 135, 126, 225, 151, 175 },
+      {   1,  11,  14,  41, 100, 158,  72,  97, 157, 122, 144 }
     }, { /* Coeff Band 3 */
-      {   1, 160, 218, 245, 197, 195, 235, 189, 254, 218, 255 },
-      {  90, 127, 193, 240, 186, 189, 235, 187, 251, 217, 230 },
-      {  18,  92, 148, 229, 164, 179, 228, 180, 254, 212, 229 },
-      {   2,  50,  79, 163, 126, 156, 186, 140, 247, 191, 236 }
+      {   1, 198, 210, 228, 183, 181, 222, 165, 244, 216, 224 },
+      {  35, 133, 177, 219, 167, 173, 220, 160, 245, 207, 200 },
+      {   5,  83, 128, 204, 148, 169, 216, 157, 241, 196, 213 },
+      {   1,  53,  87, 177, 123, 155, 209, 149, 247, 197, 219 },
+      {   1,  29,  49, 127, 102, 144, 182, 127, 234, 192, 224 },
+      {   1,  12,  19,  54,  86, 127, 103, 101, 201, 151, 179 }
     }, { /* Coeff Band 4 */
-      {   1, 196, 231, 240, 203, 191, 225, 171, 253, 214, 255 },
-      {  71, 167, 210, 234, 194, 188, 218, 165, 253, 215, 236 },
-      {  11, 119, 165, 217, 171, 177, 213, 155, 252, 209, 255 },
-      {   1,  46,  70, 145, 121, 153, 180, 131, 249, 192, 246 }
+      {   1, 185, 218, 226, 181, 183, 200, 162, 233, 177, 163 },
+      {  65, 138, 177, 210, 171, 174, 194, 138, 233, 183, 243 },
+      {   6,  84, 125, 193, 147, 171, 183, 147, 230, 174, 189 },
+      {   1,  52,  77, 159, 128, 154, 176, 149, 228, 198, 234 },
+      {   1,  25,  39, 106,  99, 141, 156, 128, 231, 166, 224 },
+      {   1,  10,  15,  45,  99, 137,  83,  99, 186, 139, 175 }
     }, { /* Coeff Band 5 */
-      {   1, 176, 223, 242, 202, 194, 222, 169, 253, 211, 244 },
-      {  62, 131, 191, 233, 185, 186, 219, 164, 251, 211, 252 },
-      {   7,  89, 133, 207, 156, 173, 211, 157, 251, 206, 247 },
-      {   1,  36,  56, 127, 113, 147, 166, 125, 243, 183, 242 }
-    }, { /* Coeff Band 6 */
-      {   1, 203, 232, 249, 213, 202, 245, 193, 254, 237, 255 },
-      {  51, 155, 212, 245, 199, 195, 244, 192, 254, 234, 255 },
-      {   7, 101, 158, 233, 170, 181, 244, 185, 253, 242, 255 },
-      {   1,  49,  82, 185, 123, 157, 226, 156, 252, 225, 240 }
-    }, { /* Coeff Band 7 */
-      {   1, 222, 233, 252, 220, 207, 247, 206, 255, 240, 128 },
-      {  40, 159, 216, 250, 205, 201, 248, 207, 249, 219, 255 },
-      {   6, 106, 163, 240, 176, 188, 247, 198, 251, 222, 255 },
-      {   1,  51,  88, 196, 127, 159, 232, 169, 252, 214, 255 }
+      {   1, 197, 206, 224, 182, 179, 220, 162, 247, 215, 255 },
+      {  23, 129, 170, 214, 164, 172, 211, 158, 247, 206, 219 },
+      {   2,  78, 120, 196, 145, 165, 211, 155, 247, 195, 209 },
+      {   1,  48,  80, 171, 118, 154, 200, 145, 240, 191, 235 },
+      {   1,  25,  45, 120, 101, 146, 176, 127, 237, 183, 225 },
+      {   1,  10,  19,  53,  89, 133, 105,  98, 203, 148, 204 }
     }
   }
 };
 static const vp9_coeff_probs default_hybrid_coef_probs_16x16[BLOCK_TYPES_16X16_HYBRID] = {
   { /* block Type 0 */
     { /* Coeff Band 0 */
-      {   3,  29,  86, 140, 130, 163, 135, 131, 190, 148, 186 },
-      {   1,  26,  61, 105, 124, 156, 105, 119, 178, 138, 173 },
-      {   1,  15,  28,  60, 105, 142,  80, 105, 173, 128, 178 },
+      {  93,  40, 105, 152, 129, 148, 184, 131, 233, 185, 181 },
+      {  30,  34,  68, 124, 118, 145, 154, 121, 222, 174, 179 },
+      {   5,  23,  40,  94, 105, 141, 128, 115, 209, 155, 183 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 130, 142, 172, 141, 161, 191, 140, 244, 193, 216 },
-      {  61, 124, 141, 173, 141, 161, 190, 139, 244, 194, 215 },
-      {  28, 103, 124, 171, 138, 160, 190, 140, 243, 194, 225 },
-      {   1,  36,  51, 111, 109, 144, 152, 120, 227, 173, 205 }
+      {   1, 106, 149, 201, 153, 167, 216, 163, 249, 198, 192 },
+      {  48, 100, 142, 200, 153, 168, 214, 156, 243, 199, 213 },
+      {  26,  88, 131, 201, 147, 167, 211, 155, 244, 211, 171 },
+      {  13,  74, 113, 192, 136, 161, 212, 159, 237, 194, 214 },
+      {   3,  54,  84, 170, 121, 151, 207, 149, 243, 198, 214 },
+      {   1,  27,  41, 105, 103, 142, 151, 122, 219, 169, 189 }
     }, { /* Coeff Band 2 */
-      {   1,  60, 125, 153, 143, 159, 156, 127, 234, 170, 233 },
-      {  22,  48,  78, 129, 124, 152, 151, 123, 234, 170, 233 },
-      {   3,  32,  46,  98, 107, 142, 138, 114, 232, 165, 232 },
-      {   1,  15,  23,  61,  96, 135, 101, 103, 210, 144, 213 }
+      {   1,  79, 131, 195, 143, 162, 211, 156, 245, 203, 215 },
+      {  22,  76, 110, 183, 133, 159, 205, 147, 246, 206, 232 },
+      {   7,  65,  92, 165, 128, 150, 197, 139, 243, 198, 208 },
+      {   2,  53,  75, 151, 124, 150, 187, 135, 242, 186, 223 },
+      {   1,  36,  55, 124, 112, 147, 164, 125, 232, 174, 214 },
+      {   1,  17,  25,  72,  91, 134, 108, 110, 197, 149, 169 }
     }, { /* Coeff Band 3 */
-      {   1, 102, 144, 182, 146, 162, 194, 143, 246, 196, 239 },
-      {  34,  76, 116, 171, 136, 159, 192, 140, 246, 195, 239 },
-      {   4,  51,  81, 153, 124, 153, 184, 135, 246, 192, 239 },
-      {   1,  23,  37,  98, 102, 140, 142, 116, 230, 167, 227 }
+      {   1, 154, 188, 221, 170, 174, 218, 163, 244, 204, 206 },
+      {  39, 112, 161, 213, 159, 172, 216, 160, 244, 204, 224 },
+      {   7,  83, 125, 200, 147, 164, 210, 156, 243, 198, 212 },
+      {   2,  59,  94, 182, 131, 157, 205, 149, 240, 194, 217 },
+      {   1,  36,  58, 143, 112, 148, 187, 137, 237, 186, 212 },
+      {   1,  15,  24,  73,  93, 134, 121, 109, 206, 156, 180 }
     }, { /* Coeff Band 4 */
-      {   1, 165, 171, 214, 163, 174, 214, 160, 245, 203, 219 },
-      {  16, 120, 154, 210, 158, 172, 212, 159, 245, 201, 219 },
-      {   1,  80, 122, 199, 147, 167, 208, 154, 244, 200, 223 },
-      {   1,  40,  65, 145, 118, 151, 171, 135, 226, 175, 202 }
+      {   1, 154, 179, 223, 168, 176, 220, 166, 244, 205, 215 },
+      {  21, 111, 156, 215, 160, 171, 218, 164, 244, 201, 208 },
+      {   4,  79, 121, 202, 147, 167, 213, 160, 244, 202, 213 },
+      {   1,  57,  90, 181, 131, 159, 202, 152, 241, 199, 204 },
+      {   1,  34,  54, 136, 108, 146, 182, 134, 237, 188, 205 },
+      {   1,  14,  21,  65,  91, 138, 110, 106, 200, 154, 174 }
     }, { /* Coeff Band 5 */
-      {   1, 146, 162, 215, 159, 172, 226, 165, 251, 218, 231 },
-      {  16,  92, 131, 205, 147, 167, 224, 162, 252, 217, 228 },
-      {   2,  60,  92, 182, 129, 158, 216, 152, 251, 214, 234 },
-      {   1,  32,  50, 126, 107, 144, 176, 128, 240, 189, 216 }
-    }, { /* Coeff Band 6 */
-      {   1, 178, 186, 224, 172, 178, 224, 167, 251, 214, 232 },
-      {  14, 118, 158, 215, 160, 173, 223, 164, 250, 214, 228 },
-      {   2,  70, 109, 194, 139, 164, 217, 156, 250, 213, 227 },
-      {   1,  32,  51, 129, 108, 146, 175, 128, 240, 187, 218 }
-    }, { /* Coeff Band 7 */
-      {   1, 210, 214, 240, 192, 188, 235, 182, 251, 221, 228 },
-      {  22, 140, 187, 233, 177, 183, 234, 178, 251, 219, 233 },
-      {   3,  82, 130, 215, 152, 171, 229, 171, 250, 217, 232 },
-      {   1,  38,  63, 154, 115, 149, 195, 141, 240, 196, 219 }
+      {   1, 175, 204, 235, 184, 182, 228, 171, 247, 214, 232 },
+      {  38, 122, 178, 227, 172, 179, 227, 171, 248, 207, 216 },
+      {   9,  86, 136, 214, 154, 170, 222, 165, 247, 206, 244 },
+      {   2,  60,  98, 192, 134, 160, 214, 157, 245, 206, 218 },
+      {   1,  34,  58, 145, 110, 148, 191, 138, 242, 194, 220 },
+      {   1,  13,  22,  69,  89, 136, 121, 110, 212, 159, 192 }
     }
   }
 };
 static const vp9_coeff_probs default_coef_probs_32x32[BLOCK_TYPES_32X32] = {
   { /* block Type 0 */
     { /* Coeff Band 0 */
-      {   8,  40, 224, 217, 183, 181, 180, 148, 200, 180, 123 },
-      {   6,  37, 178, 193, 173, 171, 160, 139, 205, 166, 173 },
-      {   3,  27,  93, 133, 143, 159, 115, 125, 183, 141, 178 },
+      {  34,  33, 198, 199, 178, 175, 165, 143, 201, 180, 114 },
+      {  18,  27, 136, 172, 153, 164, 154, 133, 196, 174, 127 },
+      {   6,  23,  69, 126, 129, 154, 129, 122, 184, 159, 122 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
+      { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 },
       { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
     }, { /* Coeff Band 1 */
-      {   1, 170, 209, 202, 172, 175, 179, 143, 238, 181, 214 },
-      { 184, 164, 199, 199, 169, 173, 180, 143, 238, 184, 217 },
-      {  99, 128, 165, 194, 161, 171, 180, 142, 239, 182, 219 },
-      {  17,  49,  59, 102, 117, 148, 122, 116, 208, 152, 191 }
+      {   1, 172, 209, 214, 169, 166, 184, 110, 237, 176, 154 },
+      { 190, 162, 204, 209, 171, 172, 190, 142, 227, 170, 205 },
+      { 137, 137, 189, 210, 164, 174, 188, 154, 225, 195, 186 },
+      {  89, 111, 161, 205, 173, 165, 191, 147, 243, 190, 171 },
+      {  41,  73, 113, 176, 133, 161, 199, 147, 230, 170, 177 },
+      {   6,  30,  42,  85, 113, 141, 115, 111, 148, 134, 110 }
     }, { /* Coeff Band 2 */
-      {   1, 136, 200, 197, 172, 172, 168, 142, 226, 170, 216 },
-      {  66, 104, 146, 175, 152, 165, 163, 139, 225, 170, 219 },
-      {  11,  52,  83, 144, 130, 156, 151, 130, 222, 165, 216 },
-      {   1,  16,  25,  65,  99, 137,  96, 106, 190, 138, 184 }
+      {   1, 133, 202, 201, 167, 167, 174, 159, 228, 164, 177 },
+      {  81, 120, 158, 181, 154, 171, 151, 140, 227, 167, 150 },
+      {  22,  91, 114, 170, 147, 154, 141, 137, 212, 146, 184 },
+      {   7,  61,  75, 155, 116, 166, 143, 138, 215, 153, 178 },
+      {   1,  34,  42, 103, 102, 137, 133, 138, 219, 161, 170 },
+      {   1,   9,  11,  33,  94, 135,  51,  99, 130, 117,  96 }
     }, { /* Coeff Band 3 */
-      {   1, 180, 203, 198, 166, 170, 190, 143, 241, 190, 227 },
-      {  74, 125, 161, 187, 154, 165, 187, 142, 241, 189, 224 },
-      {  15,  70,  98, 163, 133, 157, 182, 137, 241, 187, 226 },
-      {   1,  25,  37,  89, 104, 140, 128, 113, 218, 158, 206 }
+      {   1, 217, 188, 204, 169, 169, 192, 147, 237, 186, 213 },
+      {  11, 124, 151, 189, 153, 165, 188, 144, 236, 186, 211 },
+      {   1,  68, 100, 170, 135, 159, 185, 141, 237, 185, 217 },
+      {   1,  41,  64, 142, 115, 150, 176, 133, 235, 183, 212 },
+      {   1,  22,  35,  97,  99, 138, 152, 117, 231, 174, 210 },
+      {   1,   9,  15,  44,  89, 133,  83,  97, 186, 137, 170 }
     }, { /* Coeff Band 4 */
-      {   1, 191, 208, 213, 169, 173, 212, 156, 246, 206, 217 },
-      {  53, 136, 170, 205, 159, 170, 211, 156, 246, 205, 208 },
-      {   3,  75, 112, 189, 140, 163, 209, 151, 246, 205, 215 },
-      {   1,  32,  51, 127, 108, 145, 171, 128, 231, 183, 197 }
+      {   1, 197, 215, 225, 181, 177, 197, 161, 215, 167, 178 },
+      {  47, 142, 183, 215, 171, 171, 192, 149, 210, 177, 175 },
+      {   8,  94, 132, 195, 152, 170, 185, 140, 216, 183, 169 },
+      {   1,  59,  86, 166, 127, 163, 175, 143, 216, 176, 144 },
+      {   1,  28,  43, 108, 106, 145, 142, 126, 197, 159, 168 },
+      {   1,   6,  10,  25,  89, 131,  46,  96, 114, 118, 111 }
     }, { /* Coeff Band 5 */
-      {   1, 183, 195, 202, 161, 168, 206, 150, 247, 202, 229 },
-      {  42, 113, 144, 190, 147, 163, 203, 148, 247, 202, 229 },
-      {   2,  56,  82, 160, 124, 153, 195, 140, 246, 200, 229 },
-      {   1,  22,  34,  93,  99, 138, 143, 115, 227, 170, 206 }
-    }, { /* Coeff Band 6 */
-      {   1, 202, 193, 221, 168, 175, 227, 167, 251, 217, 236 },
-      {  26, 122, 158, 213, 157, 171, 225, 165, 251, 216, 242 },
-      {   1,  68, 105, 194, 136, 162, 221, 158, 251, 215, 239 },
-      {   1,  32,  51, 131, 107, 145, 179, 130, 240, 188, 231 }
-    }, { /* Coeff Band 7 */
-      {   1, 234, 212, 243, 195, 192, 240, 187, 253, 226, 227 },
-      {  14, 141, 186, 237, 181, 186, 239, 184, 253, 226, 233 },
-      {   1,  85, 132, 221, 155, 174, 235, 176, 253, 224, 226 },
-      {   1,  39,  65, 159, 115, 150, 202, 144, 245, 202, 214 }
+      {   1, 226, 201, 212, 176, 173, 188, 148, 231, 178, 208 },
+      {  13, 135, 163, 196, 159, 169, 183, 148, 225, 177, 199 },
+      {   1,  74, 107, 177, 139, 162, 181, 144, 228, 176, 203 },
+      {   1,  43,  67, 145, 118, 152, 170, 135, 226, 174, 201 },
+      {   1,  22,  34,  94, 100, 138, 142, 116, 220, 166, 201 },
+      {   1,   7,  12,  36,  88, 133,  70,  96, 168, 128, 158 }
     }
   }
 };
index ec96b4489fb366cf9ec48ea4df15e8fa83afd040..4e19ba0a4833459536668ee4bae3deb3c3ad3a57 100644 (file)
@@ -43,14 +43,18 @@ DECLARE_ALIGNED(16, const uint8_t, vp9_norm[256]) = {
 
 // Unified coefficient band structure used by all block sizes
 DECLARE_ALIGNED(16, const int, vp9_coef_bands[32]) = {
-  0, 1, 2, 3, 5, 4, 4, 5,
-  5, 3, 6, 6, 6, 6, 6, 7,
-  7, 7, 7, 7, 7, 7, 7, 7,
-  7, 7, 7, 7, 7, 7, 7, 7
+  0, 1, 2, 3, 3, 3, 4, 4,
+  4, 4, 4, 4, 4, 4, 4, 5,
+  5, 5, 5, 5, 5, 5, 5, 5,
+  5, 5, 5, 5, 5, 5, 5, 5
+};
+DECLARE_ALIGNED(16, const int, vp9_coef_bands4x4[16]) = {
+  0, 1, 2, 3, 3, 3, 4, 4,
+  4, 4, 5, 5, 5, 5, 5, 5
 };
 
-DECLARE_ALIGNED(16, const uint8_t, vp9_prev_token_class[MAX_ENTROPY_TOKENS]) = {
-  0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 3, 0
+DECLARE_ALIGNED(16, const uint8_t, vp9_pt_energy_class[MAX_ENTROPY_TOKENS]) = {
+  0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5
 };
 
 DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_4x4[16]) = {
@@ -231,17 +235,21 @@ int vp9_get_coef_context(int * recent_energy, int token) {
   // int token_energy;
   // int av_energy;
 
-  // Placeholder code for experiments with token energy
-  // as a coefficient context.
   /*token_energy = ((token != DCT_EOB_TOKEN) ? token : 0);
-  if (token_energy) {
-    av_energy = (token_energy + *recent_energy + 1) >> 1;
+  if (!token_energy) {
+    if (!(*recent_energy)) {
+      av_energy = 0;
+    } else {
+      av_energy = 1;
+    }
   } else {
-    av_energy = 0;
+    av_energy = ((token_energy + *recent_energy + 1) >> 1) + 1;
+    if (av_energy > DCT_VAL_CATEGORY6)
+      av_energy = DCT_VAL_CATEGORY6;
   }
   *recent_energy = token_energy;*/
 
-  return vp9_prev_token_class[token];
+  return vp9_pt_energy_class[token];
 };
 
 void vp9_default_coef_probs(VP9_COMMON *pc) {
index 8e9f60b2699345abec7524c85926ae72e3573d54..323bd4741a8f0b94cd82c2c6dbfb89e8e9bada23 100644 (file)
@@ -71,18 +71,16 @@ extern vp9_extra_bit_struct vp9_extra_bits[12];    /* indexed by token value */
 
 #define BLOCK_TYPES_32X32 1
 
-/* Middle dimension is a coarsening of the coefficient's
-   position within the 4x4 DCT. */
-
-#define COEF_BANDS 8
-
-/* Inside dimension is 3-valued measure of nearby complexity, that is,
-   the extent to which nearby coefficients are nonzero.  For the first
-   coefficient (DC, unless block type is 0), we look at the (already encoded)
-   blocks above and to the left of the current block.  The context index is
-   then the number (0,1,or 2) of these blocks having nonzero coefficients.
-   After decoding a coefficient, the measure is roughly the size of the
-   most recently decoded coefficient (0 for 0, 1 for 1, 2 for >1).
+/* Middle dimension reflects the coefficient position within the transform. */
+#define COEF_BANDS 6
+
+/* Inside dimension is measure of nearby complexity, that reflects the energy
+   of nearby coefficients are nonzero.  For the first coefficient (DC, unless
+   block type is 0), we look at the (already encoded) blocks above and to the
+   left of the current block.  The context index is then the number (0,1,or 2)
+   of these blocks having nonzero coefficients.
+   After decoding a coefficient, the measure is determined by the size of the
+   most recently decoded coefficient.
    Note that the intuitive meaning of this measure changes as coefficients
    are decoded, e.g., prior to the first token, a zero means that my neighbors
    are empty while, after the first token, because of the use of end-of-block,
@@ -93,7 +91,7 @@ extern vp9_extra_bit_struct vp9_extra_bits[12];    /* indexed by token value */
    distinct bands). */
 
 /*# define DC_TOKEN_CONTEXTS        3*/ /* 00, 0!0, !0!0 */
-#define PREV_COEF_CONTEXTS          4
+#define PREV_COEF_CONTEXTS          6
 
 typedef unsigned int vp9_coeff_count[COEF_BANDS][PREV_COEF_CONTEXTS]
                                     [MAX_ENTROPY_TOKENS];
@@ -126,11 +124,18 @@ static void vp9_reset_mb_tokens_context(MACROBLOCKD* const xd) {
 }
 
 extern const int vp9_coef_bands[32];
-static int get_coef_band(int coef_index) {
-  if (coef_index < 32)
-    return vp9_coef_bands[coef_index];
-  else
-    return 7;
+extern const int vp9_coef_bands4x4[16];
+
+static int get_coef_band(TX_SIZE tx_size, int coef_index) {
+  if (tx_size == TX_4X4) {
+    return vp9_coef_bands4x4[coef_index];
+  } else {
+    if (coef_index < 32)
+      return vp9_coef_bands[coef_index];
+    else
+      return 5;
+  }
 }
 extern int vp9_get_coef_context(int * recent_energy, int token);
+
 #endif  // VP9_COMMON_VP9_ENTROPY_H_
index 8eca8a8bcd7ca4d26a970cf16409517339890386..f9f1d135e542dba3f9ae1d574ff6d7df80fa6b19 100644 (file)
@@ -58,9 +58,18 @@ static INLINE vp9_prob clip_prob(int p) {
   return (p > 255) ? 255u : (p < 1) ? 1u : p;
 }
 
+// int64 is not needed for normal frame level calculations.
+// However when outputing entropy stats accumulated over many frames
+// or even clips we can overflow int math.
+#ifdef ENTROPY_STATS
+static INLINE vp9_prob get_prob(int num, int den) {
+  return (den == 0) ? 128u : clip_prob(((int64_t)num * 256 + (den >> 1)) / den);
+}
+#else
 static INLINE vp9_prob get_prob(int num, int den) {
   return (den == 0) ? 128u : clip_prob((num * 256 + (den >> 1)) / den);
 }
+#endif
 
 static INLINE vp9_prob get_binary_prob(int n0, int n1) {
   return get_prob(n0, n0 + n1);
index f84dfdaacd32cdf3cc6a7f60f89edae72ada054c..e42f2089754d90dfa3e9ec9a01e5958e57959f12 100644 (file)
@@ -65,7 +65,7 @@ static int get_signed(BOOL_DECODER *br, int value_to_sign) {
 
 #define INCREMENT_COUNT(token)               \
   do {                                       \
-    coef_counts[type][get_coef_band(c)][pt][token]++;     \
+    coef_counts[type][get_coef_band(txfm_size, c)][pt][token]++;     \
     pt = vp9_get_coef_context(&recent_energy, token);         \
   } while (0)
 
@@ -176,7 +176,7 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
     int val;
     const uint8_t *cat6 = cat6_prob;
     if (c >= seg_eob) break;
-    prob = coef_probs[type][get_coef_band(c)][pt];
+    prob = coef_probs[type][get_coef_band(txfm_size, c)][pt];
     if (!vp9_read(br, prob[EOB_CONTEXT_NODE]))
       break;
 SKIP_START:
@@ -184,7 +184,7 @@ SKIP_START:
     if (!vp9_read(br, prob[ZERO_CONTEXT_NODE])) {
       INCREMENT_COUNT(ZERO_TOKEN);
       ++c;
-      prob = coef_probs[type][get_coef_band(c)][pt];
+      prob = coef_probs[type][get_coef_band(txfm_size, c)][pt];
       goto SKIP_START;
     }
     // ONE_CONTEXT_NODE_0_
@@ -248,7 +248,7 @@ SKIP_START:
   }
 
   if (c < seg_eob)
-    coef_counts[type][get_coef_band(c)][pt][DCT_EOB_TOKEN]++;
+    coef_counts[type][get_coef_band(txfm_size, c)][pt][DCT_EOB_TOKEN]++;
 
   A0[aidx] = L0[lidx] = (c > 0);
   if (txfm_size >= TX_8X8) {
index 6ad277b8412fb6e5d028f59b2a80df290a6270f7..dd4d66a186601c5ddbfde6ee89ca8165c3be7f17 100644 (file)
@@ -1277,6 +1277,7 @@ static void update_coef_probs_common(vp9_writer* const bc,
           const vp9_prob upd = COEF_UPDATE_PROB;
           int s = prev_coef_savings[t];
           int u = 0;
+
           if (k >= 3 && j == 0)
             continue;
 #if defined(SEARCH_NEWP)
index a4a0de6ed5a352e40348456940282cd2db39991d..95b36c9fffcdd554d7789b8b5e2fec95f9480bf2 100644 (file)
@@ -415,7 +415,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type,
       t0 = (vp9_dct_value_tokens_ptr + x)->Token;
       /* Consider both possible successor states. */
       if (next < default_eob) {
-        band = get_coef_band(i + 1);
+        band = get_coef_band(tx_size, i + 1);
         pt = trellis_get_coeff_context(t0);
         rate0 +=
           mb->token_costs[tx_size][type][band][pt][tokens[next][0].token];
@@ -462,7 +462,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type,
         t0 = t1 = (vp9_dct_value_tokens_ptr + x)->Token;
       }
       if (next < default_eob) {
-        band = get_coef_band(i + 1);
+        band = get_coef_band(tx_size, i + 1);
         if (t0 != DCT_EOB_TOKEN) {
           pt = trellis_get_coeff_context(t0);
           rate0 += mb->token_costs[tx_size][type][band][pt][
@@ -497,7 +497,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type,
      *  add a new trellis node, but we do need to update the costs.
      */
     else {
-      band = get_coef_band(i + 1);
+      band = get_coef_band(tx_size, i + 1);
       t0 = tokens[next][0].token;
       t1 = tokens[next][1].token;
       /* Update the cost of each path if we're past the EOB token. */
@@ -514,7 +514,7 @@ static void optimize_b(MACROBLOCK *mb, int i, PLANE_TYPE type,
   }
 
   /* Now pick the best path through the whole trellis. */
-  band = get_coef_band(i + 1);
+  band = get_coef_band(tx_size, i + 1);
   VP9_COMBINEENTROPYCONTEXTS(pt, *a, *l);
   rate0 = tokens[next][0].rate;
   rate1 = tokens[next][1].rate;
index 8d005d7fd546623fdb1782ba764e27a51fcd5db9..fd2c2b01f7b20583eea71dad0501548078f151ec 100644 (file)
@@ -458,24 +458,24 @@ static INLINE int cost_coeffs(MACROBLOCK *mb,
     for (; c < eob; c++) {
       int v = qcoeff_ptr[scan[c]];
       int t = vp9_dct_value_tokens_ptr[v].Token;
-      cost += token_costs[get_coef_band(c)][pt][t];
+      cost += token_costs[get_coef_band(tx_size, c)][pt][t];
       cost += vp9_dct_value_cost_ptr[v];
       pt = vp9_get_coef_context(&recent_energy, t);
     }
     if (c < seg_eob)
-      cost += mb->hybrid_token_costs[tx_size][type][get_coef_band(c)]
+      cost += mb->hybrid_token_costs[tx_size][type][get_coef_band(tx_size, c)]
           [pt][DCT_EOB_TOKEN];
   } else {
     int recent_energy = 0;
     for (; c < eob; c++) {
       int v = qcoeff_ptr[scan[c]];
       int t = vp9_dct_value_tokens_ptr[v].Token;
-      cost += token_costs[get_coef_band(c)][pt][t];
+      cost += token_costs[get_coef_band(tx_size, c)][pt][t];
       cost += vp9_dct_value_cost_ptr[v];
       pt = vp9_get_coef_context(&recent_energy, t);
     }
     if (c < seg_eob)
-      cost += mb->token_costs[tx_size][type][get_coef_band(c)]
+      cost += mb->token_costs[tx_size][type][get_coef_band(tx_size, c)]
           [pt][DCT_EOB_TOKEN];
   }
 
index 17eae463f018aa5b389ffd5dbb017013b1ff2f83..4401b24f431481c5fd8fe6b803f5183c3039ec8f 100644 (file)
@@ -214,7 +214,7 @@ static void tokenize_b(VP9_COMP *cpi,
     seg_eob = 0;
 
   do {
-    const int band = get_coef_band(c);
+    const int band = get_coef_band(tx_size, c);
     int token;
 
     if (c < eob) {
@@ -738,7 +738,7 @@ static INLINE void stuff_b(VP9_COMP *cpi,
 
   VP9_COMBINEENTROPYCONTEXTS(pt, a_ec, l_ec);
 
-  band = get_coef_band(0);
+  band = get_coef_band(tx_size, 0);
   t->Token = DCT_EOB_TOKEN;
   t->context_tree = probs[type][band][pt];
   t->skip_eob_node = 0;