summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
Diffstat (limited to 'vp9')
-rw-r--r--vp9/common/vp9_alloccommon.c12
-rw-r--r--vp9/common/vp9_blockd.h5
-rw-r--r--vp9/common/vp9_coefupdateprobs.h8
-rw-r--r--vp9/common/vp9_default_coef_probs.h691
-rw-r--r--vp9/common/vp9_entropy.c404
-rw-r--r--vp9/common/vp9_entropy.h13
-rw-r--r--vp9/common/vp9_extend.c20
-rw-r--r--vp9/common/vp9_mbpitch.c5
-rw-r--r--vp9/common/vp9_onyxc_int.h22
-rw-r--r--vp9/common/vp9_postproc.c40
-rw-r--r--vp9/common/vp9_reconinter.c15
-rw-r--r--vp9/common/vp9_reconinter.h12
-rw-r--r--vp9/decoder/vp9_decodemv.c40
-rw-r--r--vp9/decoder/vp9_decodframe.c11
-rw-r--r--vp9/decoder/vp9_detokenize.c23
-rw-r--r--vp9/encoder/vp9_bitstream.c66
-rw-r--r--vp9/encoder/vp9_encodeframe.c47
-rw-r--r--vp9/encoder/vp9_encodemb.c1
-rw-r--r--vp9/encoder/vp9_lookahead.c12
-rw-r--r--vp9/encoder/vp9_onyx_if.c33
-rw-r--r--vp9/encoder/vp9_onyx_int.h15
-rw-r--r--vp9/encoder/vp9_quantize.c37
-rw-r--r--vp9/encoder/vp9_rdopt.c33
-rw-r--r--vp9/encoder/vp9_temporal_filter.c13
-rw-r--r--vp9/encoder/vp9_tokenize.c6
-rw-r--r--vp9/encoder/vp9_tokenize.h2
-rw-r--r--vp9/vp9_iface_common.h7
27 files changed, 370 insertions, 1223 deletions
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c
index d149f31b4..73f26f6b8 100644
--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -144,15 +144,19 @@ int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height) {
// FIXME(jkoleszar): allocate subsampled arrays for U/V once subsampling
// information is exposed at this level
mi_cols = mi_cols_aligned_to_sb(oci);
+# if CONFIG_ALPHA
+ // TODO(jkoleszar): Why is this * 2?
+ oci->above_context[0] = vpx_calloc(sizeof(ENTROPY_CONTEXT) * 8 * mi_cols, 1);
+#else
oci->above_context[0] = vpx_calloc(sizeof(ENTROPY_CONTEXT) * 6 * mi_cols, 1);
+#endif
if (!oci->above_context[0]) {
vp9_free_frame_buffers(oci);
return 1;
}
- oci->above_context[1] =
- oci->above_context[0] + sizeof(ENTROPY_CONTEXT) * 2 * mi_cols;
- oci->above_context[2] =
- oci->above_context[1] + sizeof(ENTROPY_CONTEXT) * 2 * mi_cols;
+ for (i = 1; i < MAX_MB_PLANE; i++)
+ oci->above_context[i] =
+ oci->above_context[0] + i * sizeof(ENTROPY_CONTEXT) * 2 * mi_cols;
oci->above_seg_context =
vpx_calloc(sizeof(PARTITION_CONTEXT) * mi_cols, 1);
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h
index 26458e8a2..71d1dd934 100644
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -296,7 +296,11 @@ struct scale_factors {
convolve_fn_t predict[2][2][2]; // horiz, vert, avg
};
+#if CONFIG_ALPHA
+enum { MAX_MB_PLANE = 4 };
+#else
enum { MAX_MB_PLANE = 3 };
+#endif
struct buf_2d {
uint8_t *buf;
@@ -307,7 +311,6 @@ struct macroblockd_plane {
DECLARE_ALIGNED(16, int16_t, qcoeff[64 * 64]);
DECLARE_ALIGNED(16, int16_t, dqcoeff[64 * 64]);
DECLARE_ALIGNED(16, uint16_t, eobs[256]);
- DECLARE_ALIGNED(16, int16_t, diff[64 * 64]);
PLANE_TYPE plane_type;
int subsampling_x;
int subsampling_y;
diff --git a/vp9/common/vp9_coefupdateprobs.h b/vp9/common/vp9_coefupdateprobs.h
index 231def1bd..e86200802 100644
--- a/vp9/common/vp9_coefupdateprobs.h
+++ b/vp9/common/vp9_coefupdateprobs.h
@@ -14,12 +14,8 @@
/* Update probabilities for the nodes in the token entropy tree.
Generated file included by vp9_entropy.c */
-static const vp9_prob vp9_coef_update_prob[ENTROPY_NODES] = {
- 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252
+static const vp9_prob vp9_coef_update_prob[UNCONSTRAINED_NODES] = {
+ 252, 252, 252,
};
-#if CONFIG_MODELCOEFPROB
-#define COEF_MODEL_UPDATE_PROB 16
-#endif
-
#endif // VP9_COMMON_VP9_COEFUPDATEPROBS_H__
diff --git a/vp9/common/vp9_default_coef_probs.h b/vp9/common/vp9_default_coef_probs.h
index 5ce966407..3e8211954 100644
--- a/vp9/common/vp9_default_coef_probs.h
+++ b/vp9/common/vp9_default_coef_probs.h
@@ -11,11 +11,6 @@
/*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.
-#if CONFIG_MODELCOEFPROB
static const vp9_coeff_probs_model default_coef_probs_4x4[BLOCK_TYPES] = {
{ /* block Type 0 */
{ /* Intra */
@@ -700,689 +695,3 @@ static const vp9_coeff_probs_model default_coef_probs_32x32[BLOCK_TYPES] = {
}
}
};
-#else
-static const vp9_coeff_probs default_coef_probs_4x4[BLOCK_TYPES] = {
- { /* block Type 0 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 208, 32, 178, 198, 161, 167, 196, 147, 244, 194, 210 },
- { 102, 43, 132, 185, 148, 162, 185, 141, 237, 181, 215 },
- { 15, 36, 68, 143, 119, 151, 169, 133, 230, 173, 214 }
- }, { /* Coeff Band 1 */
- { 71, 91, 178, 226, 169, 176, 232, 170, 252, 219, 231 },
- { 72, 88, 174, 226, 168, 176, 232, 170, 252, 219, 234 },
- { 40, 79, 154, 222, 161, 174, 231, 169, 251, 219, 238 },
- { 21, 68, 126, 211, 144, 167, 230, 167, 252, 219, 236 },
- { 7, 49, 84, 175, 121, 152, 223, 151, 251, 218, 237 },
- { 1, 20, 32, 100, 97, 140, 163, 116, 237, 186, 222 }
- }, { /* Coeff Band 2 */
- { 108, 110, 206, 237, 182, 183, 239, 181, 252, 221, 245 },
- { 72, 98, 191, 236, 180, 182, 240, 183, 252, 223, 239 },
- { 26, 77, 152, 230, 166, 179, 239, 181, 252, 222, 241 },
- { 7, 57, 106, 212, 141, 167, 236, 173, 252, 223, 243 },
- { 1, 35, 60, 171, 110, 149, 225, 155, 251, 218, 240 },
- { 1, 14, 22, 90, 86, 134, 163, 116, 238, 181, 233 }
- }, { /* Coeff Band 3 */
- { 105, 139, 222, 245, 196, 192, 245, 195, 253, 229, 255 },
- { 76, 118, 205, 245, 192, 192, 247, 198, 254, 230, 255 },
- { 21, 88, 164, 240, 175, 186, 246, 197, 255, 232, 255 },
- { 5, 63, 118, 222, 149, 172, 242, 185, 255, 230, 254 },
- { 1, 42, 74, 186, 120, 157, 227, 161, 253, 220, 250 },
- { 1, 18, 30, 97, 92, 136, 163, 118, 244, 184, 244 }
- }, { /* Coeff Band 4 */
- { 143, 117, 233, 251, 207, 201, 250, 210, 255, 239, 128 },
- { 99, 104, 214, 249, 200, 199, 251, 211, 255, 238, 255 },
- { 26, 81, 170, 245, 183, 192, 250, 206, 255, 242, 255 },
- { 6, 60, 116, 226, 151, 176, 242, 187, 255, 235, 255 },
- { 1, 38, 65, 178, 114, 153, 224, 157, 254, 224, 255 },
- { 1, 15, 26, 86, 88, 133, 163, 110, 251, 197, 252 }
- }, { /* Coeff Band 5 */
- { 155, 74, 238, 252, 215, 206, 252, 223, 255, 255, 128 },
- { 152, 64, 223, 250, 205, 201, 254, 219, 255, 255, 128 },
- { 67, 55, 182, 246, 187, 192, 251, 210, 255, 240, 128 },
- { 27, 44, 127, 227, 155, 176, 244, 186, 255, 240, 255 },
- { 9, 27, 69, 176, 115, 152, 227, 154, 255, 229, 255 },
- { 2, 11, 28, 91, 84, 133, 177, 115, 254, 210, 255 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 207, 112, 234, 244, 192, 193, 246, 194, 255, 237, 255 },
- { 145, 120, 212, 233, 178, 183, 232, 177, 252, 216, 228 },
- { 77, 114, 177, 214, 164, 174, 210, 159, 245, 199, 230 }
- }, { /* Coeff Band 1 */
- { 93, 174, 243, 248, 205, 200, 245, 195, 255, 232, 255 },
- { 100, 144, 231, 248, 204, 200, 244, 193, 255, 232, 255 },
- { 28, 101, 186, 247, 194, 199, 244, 194, 255, 232, 255 },
- { 9, 73, 132, 238, 155, 186, 245, 197, 255, 232, 250 },
- { 2, 44, 76, 187, 112, 151, 240, 172, 255, 235, 249 },
- { 1, 19, 33, 98, 92, 138, 176, 113, 252, 208, 249 }
- }, { /* Coeff Band 2 */
- { 116, 175, 246, 250, 212, 202, 248, 198, 255, 238, 255 },
- { 78, 142, 231, 250, 208, 203, 249, 200, 255, 241, 255 },
- { 14, 93, 177, 245, 186, 196, 248, 198, 255, 241, 255 },
- { 4, 65, 122, 227, 148, 177, 244, 186, 255, 241, 243 },
- { 1, 38, 69, 180, 111, 152, 235, 162, 255, 237, 247 },
- { 1, 18, 30, 101, 89, 133, 190, 116, 255, 219, 246 }
- }, { /* Coeff Band 3 */
- { 138, 183, 249, 253, 220, 209, 252, 210, 255, 251, 128 },
- { 93, 147, 237, 252, 213, 209, 253, 213, 255, 251, 128 },
- { 21, 104, 187, 247, 185, 196, 252, 210, 255, 249, 128 },
- { 6, 73, 131, 225, 147, 174, 248, 190, 255, 248, 128 },
- { 1, 47, 83, 189, 119, 155, 239, 167, 255, 246, 128 },
- { 1, 26, 44, 130, 96, 139, 209, 129, 255, 235, 255 }
- }, { /* Coeff Band 4 */
- { 188, 143, 252, 255, 228, 218, 253, 218, 255, 209, 128 },
- { 137, 124, 241, 253, 215, 211, 254, 221, 255, 255, 128 },
- { 32, 89, 188, 248, 186, 198, 254, 216, 255, 253, 128 },
- { 7, 61, 122, 231, 146, 176, 252, 201, 255, 250, 128 },
- { 1, 34, 66, 186, 103, 149, 246, 176, 255, 249, 128 },
- { 1, 18, 34, 115, 91, 134, 217, 124, 255, 233, 255 }
- }, { /* Coeff Band 5 */
- { 198, 92, 253, 255, 231, 222, 255, 230, 128, 128, 128 },
- { 189, 79, 244, 254, 220, 217, 255, 237, 255, 255, 128 },
- { 78, 61, 200, 252, 196, 207, 255, 231, 255, 255, 128 },
- { 34, 50, 146, 242, 161, 187, 255, 222, 255, 255, 128 },
- { 11, 38, 93, 215, 122, 159, 253, 202, 255, 255, 128 },
- { 1, 31, 55, 143, 102, 143, 227, 148, 255, 238, 128 }
- }
- }
- }, { /* block Type 1 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 207, 35, 219, 243, 195, 192, 243, 188, 251, 232, 238 },
- { 126, 46, 182, 230, 177, 182, 228, 171, 248, 214, 232 },
- { 51, 47, 125, 196, 147, 166, 206, 151, 245, 199, 229 }
- }, { /* Coeff Band 1 */
- { 114, 124, 220, 244, 197, 192, 242, 189, 253, 226, 255 },
- { 142, 116, 213, 243, 194, 191, 241, 188, 252, 226, 255 },
- { 81, 101, 190, 242, 188, 190, 242, 190, 253, 229, 255 },
- { 42, 83, 155, 235, 166, 183, 241, 190, 253, 227, 246 },
- { 16, 62, 104, 205, 133, 161, 238, 176, 254, 227, 250 },
- { 6, 40, 60, 132, 109, 145, 190, 128, 248, 202, 239 }
- }, { /* Coeff Band 2 */
- { 139, 149, 228, 248, 205, 198, 244, 196, 255, 223, 255 },
- { 115, 127, 221, 248, 202, 198, 245, 198, 255, 228, 255 },
- { 43, 100, 189, 246, 195, 195, 244, 196, 254, 234, 228 },
- { 13, 77, 141, 238, 168, 187, 243, 191, 255, 232, 255 },
- { 3, 49, 88, 203, 125, 160, 237, 178, 253, 227, 251 },
- { 1, 23, 41, 118, 97, 136, 191, 127, 250, 207, 247 }
- }, { /* Coeff Band 3 */
- { 119, 185, 236, 251, 216, 205, 249, 202, 253, 237, 255 },
- { 89, 140, 224, 251, 211, 205, 250, 208, 255, 241, 255 },
- { 34, 105, 189, 248, 195, 197, 250, 208, 255, 245, 255 },
- { 14, 78, 142, 235, 166, 182, 246, 194, 255, 242, 255 },
- { 5, 49, 90, 196, 128, 160, 235, 165, 255, 237, 255 },
- { 1, 22, 41, 114, 97, 139, 180, 124, 252, 201, 249 }
- }, { /* Coeff Band 4 */
- { 162, 142, 244, 254, 228, 215, 255, 230, 128, 128, 128 },
- { 129, 120, 231, 253, 216, 210, 255, 228, 255, 255, 128 },
- { 44, 90, 189, 249, 195, 199, 253, 217, 255, 240, 128 },
- { 14, 65, 132, 234, 158, 181, 249, 203, 255, 248, 128 },
- { 3, 38, 72, 188, 112, 154, 239, 171, 255, 243, 128 },
- { 1, 17, 39, 110, 86, 141, 201, 123, 255, 240, 128 }
- }, { /* Coeff Band 5 */
- { 167, 96, 247, 255, 230, 218, 249, 231, 255, 255, 128 },
- { 163, 84, 234, 253, 214, 209, 255, 231, 255, 255, 128 },
- { 70, 63, 185, 249, 189, 197, 255, 230, 255, 255, 128 },
- { 30, 44, 132, 238, 157, 180, 251, 210, 255, 220, 128 },
- { 13, 30, 80, 195, 121, 153, 243, 179, 255, 224, 128 },
- { 5, 13, 38, 103, 109, 128, 196, 147, 255, 255, 128 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 242, 90, 246, 244, 200, 192, 242, 189, 255, 234, 255 },
- { 186, 102, 228, 233, 187, 182, 231, 172, 254, 225, 252 },
- { 102, 108, 203, 228, 181, 180, 218, 167, 243, 201, 223 }
- }, { /* Coeff Band 1 */
- { 152, 169, 250, 253, 223, 209, 251, 208, 255, 250, 128 },
- { 164, 149, 242, 253, 222, 209, 249, 207, 253, 238, 255 },
- { 63, 108, 204, 252, 215, 211, 251, 211, 255, 242, 128 },
- { 39, 83, 153, 248, 175, 199, 250, 214, 255, 245, 128 },
- { 31, 66, 108, 214, 130, 161, 251, 196, 255, 237, 128 },
- { 27, 65, 71, 150, 112, 149, 213, 133, 255, 230, 255 }
- }, { /* Coeff Band 2 */
- { 161, 174, 250, 254, 226, 215, 254, 226, 255, 230, 128 },
- { 133, 150, 239, 254, 222, 213, 254, 225, 255, 255, 128 },
- { 32, 105, 197, 252, 206, 207, 253, 220, 255, 255, 128 },
- { 10, 78, 147, 245, 173, 193, 253, 212, 255, 255, 128 },
- { 2, 49, 99, 221, 133, 164, 250, 198, 255, 252, 128 },
- { 1, 26, 53, 154, 96, 135, 234, 142, 255, 240, 128 }
- }, { /* Coeff Band 3 */
- { 160, 187, 251, 255, 234, 223, 255, 233, 128, 128, 128 },
- { 131, 155, 241, 255, 228, 222, 255, 232, 255, 255, 128 },
- { 42, 108, 198, 253, 207, 212, 255, 234, 255, 255, 128 },
- { 18, 81, 151, 246, 176, 194, 254, 222, 255, 255, 128 },
- { 9, 60, 112, 225, 144, 167, 252, 199, 255, 255, 128 },
- { 5, 35, 49, 163, 113, 150, 237, 118, 255, 255, 128 }
- }, { /* Coeff Band 4 */
- { 195, 141, 253, 255, 242, 232, 255, 255, 128, 128, 128 },
- { 169, 128, 245, 255, 235, 227, 255, 248, 128, 128, 128 },
- { 62, 91, 204, 255, 216, 220, 255, 233, 128, 128, 128 },
- { 23, 70, 150, 248, 178, 202, 255, 223, 128, 128, 128 },
- { 2, 44, 78, 220, 110, 164, 255, 209, 128, 128, 128 },
- { 1, 1, 128, 255, 255, 128, 128, 128, 128, 128, 128 }
- }, { /* Coeff Band 5 */
- { 195, 104, 253, 255, 246, 246, 255, 171, 128, 128, 128 },
- { 197, 92, 248, 255, 239, 228, 255, 239, 128, 128, 128 },
- { 88, 71, 214, 255, 219, 220, 255, 244, 128, 128, 128 },
- { 39, 56, 160, 250, 187, 204, 255, 255, 128, 128, 128 },
- { 18, 28, 90, 217, 81, 137, 255, 128, 128, 128, 128 },
- { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
- }
- }
- }
-};
-static const vp9_coeff_probs default_coef_probs_8x8[BLOCK_TYPES] = {
- { /* block Type 0 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 196, 40, 199, 180, 158, 161, 172, 135, 226, 183, 140 },
- { 83, 38, 128, 153, 142, 157, 155, 128, 222, 164, 202 },
- { 10, 29, 55, 116, 113, 146, 150, 122, 223, 169, 200 }
- }, { /* Coeff Band 1 */
- { 33, 114, 160, 211, 155, 169, 223, 162, 248, 212, 215 },
- { 69, 107, 155, 210, 154, 169, 224, 163, 248, 212, 216 },
- { 30, 91, 138, 207, 150, 168, 223, 162, 248, 212, 216 },
- { 12, 74, 115, 200, 140, 164, 222, 160, 249, 212, 219 },
- { 4, 52, 80, 172, 121, 153, 216, 149, 249, 212, 226 },
- { 1, 27, 40, 105, 101, 141, 157, 120, 231, 177, 210 }
- }, { /* Coeff Band 2 */
- { 38, 159, 190, 227, 171, 177, 229, 172, 250, 214, 237 },
- { 34, 130, 182, 229, 173, 180, 231, 174, 249, 215, 234 },
- { 10, 97, 153, 226, 164, 178, 232, 175, 250, 215, 241 },
- { 3, 71, 115, 213, 145, 170, 230, 171, 251, 217, 235 },
- { 1, 41, 68, 172, 114, 152, 219, 154, 250, 212, 235 },
- { 1, 16, 27, 88, 90, 135, 155, 113, 235, 180, 216 }
- }, { /* Coeff Band 3 */
- { 41, 184, 214, 238, 187, 186, 235, 180, 252, 217, 236 },
- { 24, 142, 199, 241, 188, 189, 237, 184, 252, 220, 235 },
- { 6, 97, 159, 235, 172, 184, 239, 185, 252, 221, 243 },
- { 1, 63, 110, 214, 144, 170, 234, 174, 253, 223, 243 },
- { 1, 32, 58, 166, 109, 149, 218, 152, 251, 215, 238 },
- { 1, 12, 21, 78, 85, 131, 152, 109, 236, 180, 224 }
- }, { /* Coeff Band 4 */
- { 54, 207, 231, 245, 201, 193, 238, 186, 252, 221, 220 },
- { 32, 156, 213, 246, 198, 195, 242, 192, 252, 224, 245 },
- { 7, 98, 164, 240, 177, 187, 243, 193, 252, 227, 244 },
- { 2, 62, 108, 216, 143, 170, 237, 177, 254, 227, 248 },
- { 1, 32, 57, 165, 108, 148, 219, 152, 252, 217, 243 },
- { 1, 13, 22, 79, 87, 132, 153, 109, 240, 182, 232 }
- }, { /* Coeff Band 5 */
- { 89, 208, 239, 250, 216, 200, 240, 190, 255, 222, 219 },
- { 53, 155, 223, 250, 209, 202, 245, 199, 253, 225, 246 },
- { 12, 102, 170, 243, 183, 192, 246, 198, 254, 230, 255 },
- { 3, 67, 111, 218, 144, 171, 239, 180, 254, 231, 248 },
- { 1, 38, 60, 164, 108, 148, 221, 152, 253, 220, 246 },
- { 1, 18, 26, 81, 88, 132, 157, 108, 245, 188, 241 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 205, 121, 244, 237, 187, 188, 229, 174, 248, 215, 228 },
- { 140, 120, 211, 219, 174, 177, 207, 158, 241, 195, 214 },
- { 51, 100, 152, 198, 155, 168, 199, 148, 240, 193, 207 }
- }, { /* Coeff Band 1 */
- { 66, 196, 236, 247, 202, 197, 243, 193, 254, 228, 246 },
- { 99, 164, 223, 246, 199, 196, 243, 193, 254, 226, 255 },
- { 29, 122, 187, 244, 187, 194, 244, 193, 255, 227, 239 },
- { 14, 95, 145, 234, 156, 181, 244, 194, 254, 229, 246 },
- { 6, 68, 97, 190, 123, 155, 240, 168, 254, 232, 245 },
- { 3, 43, 50, 112, 105, 143, 170, 118, 245, 195, 230 }
- }, { /* Coeff Band 2 */
- { 66, 202, 238, 248, 206, 199, 245, 196, 254, 233, 244 },
- { 45, 155, 218, 248, 200, 199, 245, 197, 254, 229, 208 },
- { 6, 96, 163, 242, 178, 191, 245, 196, 254, 233, 228 },
- { 2, 64, 110, 224, 142, 175, 242, 185, 254, 232, 247 },
- { 1, 34, 61, 172, 103, 147, 232, 164, 254, 226, 244 },
- { 1, 13, 24, 82, 85, 133, 165, 105, 248, 199, 242 }
- }, { /* Coeff Band 3 */
- { 66, 204, 242, 251, 213, 204, 248, 204, 255, 236, 255 },
- { 38, 158, 222, 251, 206, 205, 249, 206, 255, 238, 255 },
- { 6, 95, 166, 244, 178, 194, 249, 205, 255, 236, 255 },
- { 2, 61, 111, 223, 141, 173, 244, 187, 255, 237, 255 },
- { 1, 31, 59, 171, 104, 149, 230, 158, 255, 230, 252 },
- { 1, 12, 22, 82, 79, 128, 171, 111, 251, 203, 249 }
- }, { /* Coeff Band 4 */
- { 63, 214, 245, 252, 219, 208, 249, 206, 255, 241, 128 },
- { 38, 164, 228, 252, 210, 208, 251, 212, 255, 245, 255 },
- { 5, 101, 174, 246, 182, 196, 251, 207, 255, 244, 255 },
- { 1, 64, 116, 224, 142, 174, 246, 190, 255, 241, 228 },
- { 1, 34, 63, 172, 105, 148, 233, 160, 255, 235, 237 },
- { 1, 14, 26, 88, 85, 130, 177, 110, 252, 210, 250 }
- }, { /* Coeff Band 5 */
- { 91, 214, 246, 254, 226, 213, 251, 210, 255, 239, 255 },
- { 55, 162, 233, 253, 215, 210, 253, 216, 255, 244, 128 },
- { 10, 104, 179, 247, 184, 196, 252, 212, 255, 247, 255 },
- { 2, 67, 119, 226, 143, 173, 249, 195, 255, 245, 255 },
- { 1, 37, 66, 175, 106, 149, 237, 164, 255, 240, 255 },
- { 1, 16, 30, 96, 87, 132, 188, 113, 255, 222, 255 }
- }
- }
- }, { /* block Type 1 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 211, 32, 212, 235, 185, 184, 223, 167, 239, 210, 182 },
- { 121, 47, 171, 224, 171, 180, 211, 162, 238, 195, 221 },
- { 40, 51, 118, 203, 145, 168, 211, 160, 246, 200, 236 }
- }, { /* Coeff Band 1 */
- { 71, 129, 209, 244, 192, 194, 242, 188, 255, 230, 255 },
- { 118, 122, 206, 244, 192, 192, 241, 187, 254, 227, 255 },
- { 53, 104, 184, 241, 186, 190, 241, 184, 254, 232, 255 },
- { 20, 81, 148, 234, 168, 183, 240, 183, 254, 231, 240 },
- { 3, 47, 82, 197, 127, 160, 234, 166, 254, 228, 251 },
- { 1, 18, 28, 96, 88, 134, 174, 116, 247, 194, 247 }
- }, { /* Coeff Band 2 */
- { 86, 162, 220, 247, 203, 198, 245, 193, 255, 237, 255 },
- { 84, 134, 216, 247, 201, 197, 244, 192, 255, 233, 255 },
- { 26, 102, 186, 243, 190, 192, 244, 192, 255, 232, 255 },
- { 7, 75, 135, 231, 163, 181, 240, 183, 255, 234, 255 },
- { 1, 46, 79, 193, 121, 157, 233, 168, 255, 225, 242 },
- { 1, 20, 35, 113, 94, 136, 191, 123, 252, 209, 250 }
- }, { /* Coeff Band 3 */
- { 89, 191, 232, 250, 211, 203, 248, 202, 255, 230, 128 },
- { 67, 148, 223, 250, 207, 201, 250, 207, 255, 247, 255 },
- { 19, 105, 183, 245, 189, 193, 249, 202, 255, 244, 255 },
- { 5, 72, 127, 228, 156, 177, 245, 186, 255, 238, 255 },
- { 1, 44, 76, 190, 119, 156, 234, 167, 255, 231, 255 },
- { 1, 21, 36, 116, 92, 138, 195, 128, 250, 208, 241 }
- }, { /* Coeff Band 4 */
- { 94, 210, 236, 252, 215, 206, 253, 209, 255, 247, 128 },
- { 68, 153, 224, 251, 209, 204, 251, 213, 255, 240, 128 },
- { 14, 103, 178, 246, 188, 195, 251, 209, 255, 239, 128 },
- { 2, 70, 122, 230, 154, 177, 247, 194, 255, 239, 128 },
- { 1, 42, 72, 189, 115, 153, 234, 166, 255, 229, 255 },
- { 1, 19, 34, 104, 98, 143, 180, 124, 252, 200, 255 }
- }, { /* Coeff Band 5 */
- { 87, 200, 238, 254, 226, 214, 250, 212, 255, 226, 128 },
- { 55, 151, 225, 253, 217, 212, 253, 217, 255, 233, 128 },
- { 11, 106, 179, 249, 193, 200, 252, 213, 255, 247, 128 },
- { 2, 72, 124, 232, 155, 180, 246, 195, 255, 230, 128 },
- { 1, 42, 70, 182, 114, 153, 232, 163, 255, 236, 255 },
- { 1, 17, 28, 95, 92, 137, 170, 115, 252, 208, 228 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 238, 66, 250, 245, 205, 193, 232, 180, 254, 228, 255 },
- { 178, 84, 226, 237, 192, 185, 230, 176, 253, 217, 251 },
- { 76, 83, 168, 218, 166, 173, 225, 162, 252, 220, 243 }
- }, { /* Coeff Band 1 */
- { 137, 176, 246, 252, 218, 207, 251, 208, 255, 238, 128 },
- { 176, 160, 237, 252, 217, 206, 249, 209, 255, 247, 128 },
- { 68, 128, 205, 251, 209, 207, 251, 207, 255, 248, 128 },
- { 40, 105, 167, 246, 172, 192, 252, 215, 255, 247, 128 },
- { 22, 84, 131, 214, 144, 164, 249, 185, 255, 250, 255 },
- { 11, 60, 91, 161, 130, 155, 194, 133, 253, 214, 255 }
- }, { /* Coeff Band 2 */
- { 124, 192, 247, 253, 223, 210, 254, 215, 255, 255, 128 },
- { 103, 161, 234, 253, 218, 209, 253, 214, 255, 255, 128 },
- { 19, 108, 190, 250, 202, 202, 251, 213, 255, 241, 128 },
- { 6, 74, 131, 242, 165, 191, 251, 207, 255, 244, 128 },
- { 1, 41, 72, 198, 111, 151, 249, 185, 255, 248, 128 },
- { 1, 14, 24, 82, 90, 140, 185, 96, 254, 224, 255 }
- }, { /* Coeff Band 3 */
- { 118, 200, 248, 254, 228, 216, 254, 222, 255, 213, 128 },
- { 91, 166, 235, 254, 220, 212, 254, 223, 255, 233, 128 },
- { 16, 110, 186, 251, 197, 201, 255, 225, 255, 255, 128 },
- { 3, 72, 124, 239, 160, 186, 253, 209, 255, 239, 128 },
- { 1, 39, 66, 198, 106, 151, 248, 191, 255, 247, 128 },
- { 1, 14, 19, 94, 74, 124, 209, 109, 255, 245, 128 }
- }, { /* Coeff Band 4 */
- { 112, 213, 248, 255, 231, 218, 255, 234, 255, 255, 128 },
- { 80, 172, 234, 254, 220, 216, 255, 233, 255, 255, 128 },
- { 11, 112, 182, 251, 195, 204, 255, 231, 255, 224, 128 },
- { 2, 73, 126, 241, 159, 186, 254, 219, 255, 255, 128 },
- { 1, 40, 69, 207, 111, 159, 249, 191, 255, 255, 128 },
- { 1, 16, 24, 83, 78, 138, 230, 134, 255, 239, 128 }
- }, { /* Coeff Band 5 */
- { 100, 209, 245, 255, 236, 225, 248, 231, 255, 192, 128 },
- { 65, 164, 232, 255, 226, 221, 255, 240, 255, 255, 128 },
- { 11, 117, 186, 253, 203, 209, 255, 240, 255, 255, 128 },
- { 2, 83, 136, 245, 167, 191, 253, 222, 255, 255, 128 },
- { 1, 55, 88, 213, 122, 157, 248, 182, 255, 255, 128 },
- { 1, 10, 38, 58, 85, 43, 198, 107, 255, 255, 128 }
- }
- }
- }
-};
-static const vp9_coeff_probs default_coef_probs_16x16[BLOCK_TYPES] = {
- { /* block Type 0 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 8, 26, 101, 170, 141, 159, 166, 138, 205, 164, 158 },
- { 2, 25, 67, 119, 124, 152, 121, 123, 189, 145, 175 },
- { 1, 15, 28, 67, 102, 139, 95, 107, 191, 136, 187 }
- }, { /* Coeff Band 1 */
- { 22, 73, 118, 160, 137, 157, 175, 132, 242, 184, 229 },
- { 43, 73, 116, 160, 137, 157, 177, 132, 242, 185, 231 },
- { 24, 66, 105, 158, 134, 156, 175, 133, 242, 185, 232 },
- { 9, 54, 85, 150, 126, 153, 175, 132, 242, 185, 231 },
- { 2, 34, 54, 123, 109, 145, 168, 124, 242, 183, 231 },
- { 1, 14, 22, 63, 93, 134, 108, 103, 214, 149, 206 }
- }, { /* Coeff Band 2 */
- { 34, 123, 149, 186, 148, 163, 195, 143, 245, 195, 233 },
- { 34, 106, 147, 189, 149, 164, 198, 146, 246, 197, 234 },
- { 10, 81, 123, 186, 143, 162, 200, 147, 246, 198, 235 },
- { 2, 56, 87, 170, 127, 156, 201, 143, 248, 202, 234 },
- { 1, 35, 56, 138, 109, 146, 187, 133, 246, 196, 233 },
- { 1, 17, 27, 80, 93, 135, 136, 109, 229, 168, 215 }
- }, { /* Coeff Band 3 */
- { 27, 159, 171, 208, 161, 171, 211, 155, 249, 205, 239 },
- { 17, 119, 162, 213, 160, 172, 218, 160, 250, 210, 238 },
- { 3, 81, 128, 207, 149, 168, 220, 161, 250, 213, 238 },
- { 1, 53, 87, 183, 128, 158, 217, 153, 251, 214, 239 },
- { 1, 31, 52, 143, 106, 145, 199, 137, 249, 205, 235 },
- { 1, 14, 24, 77, 89, 133, 142, 109, 234, 174, 215 }
- }, { /* Coeff Band 4 */
- { 24, 189, 200, 224, 177, 178, 221, 164, 250, 212, 234 },
- { 14, 136, 184, 230, 176, 181, 228, 172, 252, 215, 231 },
- { 2, 87, 140, 222, 159, 176, 230, 172, 252, 218, 238 },
- { 1, 54, 90, 193, 130, 161, 223, 160, 252, 217, 241 },
- { 1, 28, 49, 142, 103, 144, 202, 139, 250, 208, 233 },
- { 1, 12, 21, 73, 87, 132, 141, 106, 234, 176, 209 }
- }, { /* Coeff Band 5 */
- { 32, 220, 227, 242, 199, 190, 234, 180, 251, 220, 232 },
- { 12, 155, 200, 242, 190, 191, 240, 187, 252, 225, 230 },
- { 1, 90, 144, 231, 164, 180, 240, 184, 253, 229, 239 },
- { 1, 53, 90, 198, 130, 162, 230, 165, 253, 226, 238 },
- { 1, 28, 50, 145, 103, 144, 207, 140, 251, 213, 236 },
- { 1, 13, 22, 74, 88, 132, 142, 107, 233, 176, 216 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 5, 61, 234, 230, 183, 183, 212, 164, 241, 199, 205 },
- { 3, 65, 184, 199, 164, 170, 182, 145, 232, 175, 223 },
- { 1, 56, 104, 154, 137, 158, 156, 131, 221, 165, 210 }
- }, { /* Coeff Band 1 */
- { 46, 183, 210, 229, 181, 182, 222, 165, 252, 214, 251 },
- { 122, 166, 202, 228, 179, 181, 223, 164, 252, 217, 250 },
- { 49, 125, 177, 225, 172, 179, 223, 163, 252, 215, 253 },
- { 22, 99, 142, 216, 155, 173, 222, 164, 252, 215, 250 },
- { 8, 69, 95, 180, 127, 156, 220, 153, 252, 214, 250 },
- { 2, 38, 51, 112, 109, 144, 159, 118, 243, 184, 232 }
- }, { /* Coeff Band 2 */
- { 56, 196, 218, 236, 187, 185, 231, 172, 254, 223, 239 },
- { 38, 141, 195, 235, 182, 185, 233, 174, 254, 225, 232 },
- { 7, 93, 147, 225, 164, 178, 233, 173, 255, 226, 248 },
- { 2, 63, 101, 201, 137, 165, 227, 162, 254, 225, 248 },
- { 1, 39, 61, 159, 110, 148, 213, 146, 254, 218, 247 },
- { 1, 20, 33, 98, 95, 136, 166, 115, 247, 192, 231 }
- }, { /* Coeff Band 3 */
- { 44, 206, 223, 240, 193, 189, 235, 177, 255, 231, 224 },
- { 27, 147, 200, 240, 188, 189, 238, 181, 255, 229, 239 },
- { 4, 93, 147, 230, 165, 180, 238, 180, 255, 231, 237 },
- { 1, 58, 95, 201, 134, 164, 229, 164, 255, 228, 254 },
- { 1, 32, 52, 152, 105, 146, 212, 142, 254, 221, 255 },
- { 1, 14, 23, 81, 87, 133, 156, 109, 248, 191, 236 }
- }, { /* Coeff Band 4 */
- { 39, 216, 227, 244, 200, 194, 237, 179, 255, 231, 255 },
- { 22, 152, 204, 243, 192, 193, 240, 186, 255, 231, 240 },
- { 2, 92, 148, 232, 167, 183, 239, 182, 255, 232, 255 },
- { 1, 55, 91, 200, 132, 164, 229, 164, 255, 230, 255 },
- { 1, 28, 47, 144, 99, 142, 211, 141, 255, 222, 251 },
- { 1, 13, 21, 75, 86, 131, 152, 103, 249, 193, 242 }
- }, { /* Coeff Band 5 */
- { 34, 228, 234, 249, 213, 201, 246, 194, 255, 239, 255 },
- { 13, 161, 208, 247, 198, 197, 248, 197, 255, 243, 255 },
- { 1, 95, 148, 234, 166, 183, 246, 190, 255, 243, 236 },
- { 1, 55, 90, 199, 128, 161, 237, 168, 255, 239, 255 },
- { 1, 30, 51, 147, 102, 144, 218, 142, 255, 232, 254 },
- { 1, 16, 25, 86, 88, 131, 168, 109, 252, 207, 245 }
- }
- }
- }, { /* block Type 1 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 204, 33, 217, 233, 185, 184, 199, 165, 204, 163, 162 },
- { 93, 48, 151, 209, 157, 171, 193, 161, 203, 167, 189 },
- { 18, 43, 86, 173, 126, 156, 203, 149, 231, 193, 200 }
- }, { /* Coeff Band 1 */
- { 43, 121, 184, 233, 173, 182, 235, 187, 248, 211, 237 },
- { 93, 117, 177, 232, 170, 180, 235, 182, 246, 204, 224 },
- { 33, 101, 158, 229, 165, 179, 235, 182, 245, 207, 236 },
- { 11, 81, 129, 221, 153, 173, 233, 179, 246, 203, 229 },
- { 2, 51, 82, 188, 124, 158, 224, 162, 248, 206, 228 },
- { 1, 18, 29, 88, 93, 137, 141, 116, 222, 161, 217 }
- }, { /* Coeff Band 2 */
- { 63, 154, 199, 239, 184, 187, 236, 187, 248, 209, 221 },
- { 53, 128, 191, 239, 182, 188, 236, 188, 251, 209, 255 },
- { 14, 99, 160, 235, 172, 184, 235, 187, 249, 207, 240 },
- { 4, 75, 122, 219, 150, 173, 226, 177, 250, 204, 240 },
- { 1, 47, 77, 176, 121, 154, 207, 153, 245, 197, 237 },
- { 1, 18, 30, 84, 95, 136, 138, 112, 229, 167, 228 }
- }, { /* Coeff Band 3 */
- { 48, 193, 210, 245, 194, 194, 241, 196, 252, 213, 255 },
- { 26, 145, 201, 245, 194, 196, 240, 195, 251, 215, 240 },
- { 6, 104, 165, 241, 179, 190, 239, 191, 253, 222, 255 },
- { 1, 73, 120, 218, 151, 174, 227, 172, 251, 219, 248 },
- { 1, 42, 69, 167, 118, 153, 205, 146, 251, 206, 245 },
- { 1, 16, 27, 84, 89, 133, 148, 112, 240, 179, 238 }
- }, { /* Coeff Band 4 */
- { 47, 213, 225, 248, 203, 199, 240, 194, 254, 211, 255 },
- { 32, 153, 212, 248, 201, 199, 241, 196, 251, 226, 255 },
- { 6, 102, 168, 240, 181, 190, 240, 187, 251, 225, 238 },
- { 1, 66, 111, 211, 146, 169, 229, 167, 255, 224, 244 },
- { 1, 36, 60, 157, 110, 148, 209, 143, 252, 215, 255 },
- { 1, 16, 27, 83, 90, 133, 152, 111, 244, 184, 250 }
- }, { /* Coeff Band 5 */
- { 46, 225, 232, 252, 219, 208, 247, 204, 254, 233, 255 },
- { 24, 162, 214, 250, 208, 204, 247, 201, 254, 236, 255 },
- { 3, 106, 165, 242, 182, 191, 245, 196, 255, 231, 255 },
- { 1, 66, 108, 213, 142, 169, 235, 175, 255, 226, 247 },
- { 1, 35, 59, 158, 108, 147, 216, 146, 254, 220, 255 },
- { 1, 16, 27, 85, 90, 131, 159, 110, 248, 191, 252 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 229, 28, 245, 227, 195, 182, 200, 145, 253, 186, 255 },
- { 151, 44, 210, 214, 180, 175, 193, 146, 247, 185, 254 },
- { 55, 48, 131, 183, 148, 163, 194, 138, 249, 201, 246 }
- }, { /* Coeff Band 1 */
- { 126, 165, 239, 250, 206, 204, 248, 193, 255, 255, 128 },
- { 199, 158, 231, 248, 206, 198, 247, 200, 243, 255, 255 },
- { 102, 136, 209, 248, 203, 197, 247, 201, 255, 244, 128 },
- { 64, 116, 181, 245, 185, 196, 248, 201, 255, 233, 128 },
- { 44, 98, 151, 233, 162, 179, 248, 195, 255, 242, 128 },
- { 44, 81, 119, 204, 140, 165, 222, 163, 252, 217, 255 }
- }, { /* Coeff Band 2 */
- { 108, 185, 239, 252, 216, 209, 248, 205, 255, 230, 128 },
- { 91, 155, 224, 252, 211, 205, 251, 211, 255, 230, 128 },
- { 20, 116, 185, 248, 194, 196, 252, 206, 255, 255, 128 },
- { 8, 86, 141, 239, 168, 185, 248, 196, 255, 247, 128 },
- { 3, 50, 92, 206, 125, 164, 242, 176, 255, 246, 128 },
- { 1, 21, 40, 131, 85, 141, 200, 131, 247, 236, 255 }
- }, { /* Coeff Band 3 */
- { 94, 198, 243, 254, 226, 215, 254, 220, 255, 255, 128 },
- { 67, 164, 228, 253, 217, 208, 250, 216, 255, 213, 128 },
- { 14, 120, 185, 250, 196, 205, 248, 205, 255, 255, 128 },
- { 4, 83, 134, 238, 161, 181, 250, 202, 255, 233, 128 },
- { 1, 48, 82, 196, 119, 157, 248, 178, 255, 255, 128 },
- { 1, 26, 38, 96, 84, 132, 221, 110, 255, 209, 128 }
- }, { /* Coeff Band 4 */
- { 82, 210, 245, 255, 230, 215, 246, 221, 255, 255, 128 },
- { 55, 170, 231, 254, 222, 213, 255, 220, 255, 255, 128 },
- { 8, 118, 184, 251, 200, 207, 255, 219, 255, 255, 128 },
- { 2, 78, 126, 239, 156, 185, 251, 216, 255, 255, 128 },
- { 1, 43, 68, 189, 108, 151, 247, 187, 255, 228, 128 },
- { 1, 34, 40, 121, 114, 102, 205, 96, 255, 255, 128 }
- }, { /* Coeff Band 5 */
- { 65, 228, 241, 255, 231, 214, 253, 222, 255, 255, 128 },
- { 33, 173, 226, 254, 222, 216, 255, 231, 255, 255, 128 },
- { 5, 120, 180, 251, 197, 205, 251, 226, 255, 233, 128 },
- { 1, 81, 130, 240, 159, 187, 251, 206, 255, 205, 128 },
- { 1, 51, 78, 198, 119, 168, 238, 181, 255, 171, 128 },
- { 1, 18, 49, 183, 119, 160, 255, 171, 128, 128, 128 }
- }
- }
- }
-};
-static const vp9_coeff_probs default_coef_probs_32x32[BLOCK_TYPES] = {
- { /* block Type 0 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 37, 34, 137, 205, 154, 170, 151, 159, 109, 172, 44 },
- { 3, 26, 60, 113, 123, 154, 100, 124, 152, 131, 144 },
- { 1, 13, 23, 54, 102, 139, 71, 106, 146, 123, 148 }
- }, { /* Coeff Band 1 */
- { 26, 77, 122, 152, 144, 160, 143, 129, 216, 158, 201 },
- { 43, 76, 123, 152, 142, 159, 145, 129, 218, 160, 204 },
- { 25, 67, 112, 150, 141, 159, 144, 128, 218, 159, 204 },
- { 9, 54, 90, 143, 134, 156, 144, 127, 218, 159, 204 },
- { 2, 32, 52, 116, 114, 148, 138, 123, 217, 158, 207 },
- { 1, 10, 15, 44, 91, 133, 75, 99, 172, 128, 169 }
- }, { /* Coeff Band 2 */
- { 32, 122, 143, 163, 145, 161, 162, 131, 226, 171, 206 },
- { 46, 105, 143, 168, 148, 161, 165, 133, 228, 174, 204 },
- { 17, 79, 116, 164, 142, 161, 166, 134, 229, 174, 206 },
- { 4, 53, 78, 143, 125, 153, 163, 129, 232, 175, 213 },
- { 1, 29, 44, 105, 105, 142, 147, 120, 228, 168, 211 },
- { 1, 12, 18, 52, 91, 133, 92, 100, 193, 140, 183 }
- }, { /* Coeff Band 3 */
- { 33, 157, 160, 182, 149, 163, 185, 141, 236, 185, 218 },
- { 20, 116, 152, 188, 152, 165, 191, 144, 238, 188, 217 },
- { 4, 74, 114, 180, 141, 162, 192, 143, 240, 191, 219 },
- { 1, 44, 69, 148, 119, 151, 183, 134, 243, 192, 227 },
- { 1, 25, 40, 110, 101, 141, 162, 121, 238, 181, 223 },
- { 1, 12, 18, 56, 89, 132, 103, 101, 206, 148, 196 }
- }, { /* Coeff Band 4 */
- { 25, 183, 174, 207, 159, 171, 205, 156, 243, 194, 228 },
- { 13, 124, 159, 209, 157, 171, 213, 160, 243, 200, 228 },
- { 2, 75, 117, 199, 143, 166, 215, 158, 246, 205, 230 },
- { 1, 45, 73, 165, 119, 153, 204, 144, 248, 205, 231 },
- { 1, 26, 43, 120, 101, 141, 178, 127, 242, 192, 226 },
- { 1, 12, 19, 59, 89, 132, 112, 102, 215, 154, 201 }
- }, { /* Coeff Band 5 */
- { 13, 232, 223, 239, 196, 188, 225, 172, 248, 209, 226 },
- { 4, 155, 187, 237, 184, 187, 233, 180, 250, 216, 232 },
- { 1, 86, 131, 222, 156, 175, 233, 176, 251, 218, 237 },
- { 1, 49, 79, 181, 123, 157, 218, 155, 251, 214, 237 },
- { 1, 26, 43, 125, 100, 141, 188, 130, 246, 199, 231 },
- { 1, 12, 20, 62, 88, 131, 119, 102, 222, 161, 209 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 51, 37, 227, 237, 205, 184, 200, 162, 231, 187, 207 },
- { 9, 36, 172, 204, 176, 173, 171, 145, 217, 167, 197 },
- { 21, 26, 112, 162, 145, 162, 155, 133, 215, 165, 191 }
- }, { /* Coeff Band 1 */
- { 79, 169, 219, 223, 176, 177, 222, 161, 248, 213, 244 },
- { 177, 166, 216, 222, 175, 178, 222, 161, 246, 212, 226 },
- { 119, 141, 196, 222, 174, 176, 220, 163, 250, 212, 236 },
- { 63, 117, 165, 217, 163, 175, 218, 161, 248, 209, 231 },
- { 30, 87, 117, 192, 138, 162, 216, 157, 247, 211, 224 },
- { 14, 56, 60, 119, 111, 146, 156, 123, 227, 171, 220 }
- }, { /* Coeff Band 2 */
- { 88, 195, 225, 229, 181, 181, 229, 171, 252, 212, 221 },
- { 66, 145, 202, 229, 177, 180, 230, 172, 253, 220, 255 },
- { 12, 97, 152, 221, 162, 174, 230, 169, 253, 218, 249 },
- { 3, 66, 103, 198, 138, 165, 223, 159, 253, 219, 251 },
- { 1, 38, 61, 158, 110, 148, 209, 146, 252, 212, 238 },
- { 1, 19, 30, 94, 94, 136, 160, 114, 244, 185, 236 }
- }, { /* Coeff Band 3 */
- { 79, 211, 228, 235, 186, 184, 233, 176, 255, 225, 255 },
- { 50, 151, 205, 235, 182, 185, 237, 177, 254, 223, 255 },
- { 7, 95, 149, 225, 162, 176, 236, 177, 254, 229, 219 },
- { 1, 62, 98, 198, 134, 164, 228, 162, 254, 224, 238 },
- { 1, 35, 57, 156, 108, 148, 211, 143, 253, 215, 238 },
- { 1, 17, 26, 87, 89, 135, 161, 113, 246, 189, 237 }
- }, { /* Coeff Band 4 */
- { 68, 225, 230, 239, 190, 187, 238, 180, 252, 234, 255 },
- { 39, 156, 206, 239, 185, 187, 241, 187, 254, 231, 255 },
- { 4, 94, 147, 229, 163, 178, 242, 183, 255, 236, 224 },
- { 1, 58, 94, 200, 132, 163, 232, 166, 254, 230, 255 },
- { 1, 32, 52, 153, 104, 146, 214, 144, 253, 222, 236 },
- { 1, 15, 24, 84, 89, 131, 159, 109, 247, 192, 240 }
- }, { /* Coeff Band 5 */
- { 45, 248, 234, 248, 208, 198, 244, 193, 255, 233, 255 },
- { 19, 169, 204, 246, 195, 195, 246, 199, 255, 233, 255 },
- { 2, 98, 145, 235, 166, 183, 245, 192, 255, 235, 255 },
- { 1, 59, 92, 205, 131, 164, 236, 172, 254, 231, 250 },
- { 1, 33, 52, 152, 103, 145, 216, 144, 253, 221, 240 },
- { 1, 15, 24, 83, 87, 133, 156, 110, 246, 191, 242 }
- }
- }
- }, { /* block Type 1 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 179, 23, 200, 222, 180, 182, 150, 152, 148, 135, 125 },
- { 60, 33, 113, 185, 143, 166, 168, 144, 189, 168, 152 },
- { 8, 31, 59, 137, 114, 150, 163, 132, 206, 171, 169 }
- }, { /* Coeff Band 1 */
- { 27, 103, 158, 215, 157, 174, 209, 165, 239, 191, 233 },
- { 90, 101, 159, 213, 156, 173, 212, 164, 230, 185, 237 },
- { 39, 91, 146, 212, 155, 169, 212, 165, 232, 186, 207 },
- { 16, 75, 120, 203, 144, 169, 210, 161, 233, 189, 227 },
- { 3, 48, 76, 167, 120, 154, 199, 146, 236, 190, 218 },
- { 1, 18, 26, 72, 95, 137, 113, 109, 197, 146, 186 }
- }, { /* Coeff Band 2 */
- { 45, 137, 177, 218, 166, 174, 206, 163, 234, 184, 214 },
- { 47, 117, 167, 218, 166, 176, 206, 164, 234, 182, 229 },
- { 16, 90, 136, 211, 153, 172, 205, 162, 236, 192, 231 },
- { 6, 65, 100, 188, 136, 162, 193, 155, 237, 177, 228 },
- { 1, 37, 58, 137, 113, 150, 166, 134, 229, 167, 234 },
- { 1, 13, 19, 55, 90, 132, 93, 103, 196, 137, 202 }
- }, { /* Coeff Band 3 */
- { 36, 171, 194, 227, 177, 179, 208, 165, 244, 196, 245 },
- { 19, 129, 178, 227, 175, 184, 214, 165, 246, 188, 255 },
- { 5, 90, 139, 217, 158, 174, 213, 166, 246, 198, 255 },
- { 1, 59, 93, 182, 134, 162, 193, 150, 242, 188, 241 },
- { 1, 31, 49, 122, 108, 145, 160, 127, 235, 172, 229 },
- { 1, 10, 18, 54, 89, 132, 101, 99, 213, 144, 217 }
- }, { /* Coeff Band 4 */
- { 37, 197, 210, 233, 187, 186, 216, 172, 250, 202, 255 },
- { 20, 142, 191, 234, 183, 186, 219, 170, 249, 207, 246 },
- { 3, 93, 144, 222, 163, 176, 219, 170, 249, 204, 224 },
- { 1, 56, 88, 179, 130, 159, 199, 148, 246, 197, 243 },
- { 1, 29, 47, 123, 104, 144, 172, 127, 244, 185, 234 },
- { 1, 14, 22, 66, 91, 130, 120, 103, 225, 158, 221 }
- }, { /* Coeff Band 5 */
- { 19, 227, 223, 245, 203, 194, 238, 187, 251, 225, 217 },
- { 6, 152, 192, 242, 189, 190, 241, 190, 253, 225, 255 },
- { 1, 89, 138, 228, 161, 177, 239, 181, 254, 224, 248 },
- { 1, 52, 84, 188, 127, 157, 224, 159, 253, 222, 247 },
- { 1, 29, 47, 132, 102, 140, 196, 132, 251, 208, 244 },
- { 1, 14, 23, 71, 90, 133, 134, 103, 239, 174, 233 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 205, 14, 245, 235, 216, 189, 190, 146, 249, 201, 255 },
- { 97, 19, 213, 210, 194, 174, 176, 139, 241, 183, 250 },
- { 31, 20, 144, 183, 160, 167, 171, 132, 240, 184, 253 }
- }, { /* Coeff Band 1 */
- { 137, 182, 245, 254, 221, 216, 255, 160, 128, 128, 128 },
- { 231, 185, 242, 251, 218, 205, 255, 233, 128, 128, 128 },
- { 170, 175, 229, 252, 205, 209, 255, 211, 128, 128, 128 },
- { 107, 157, 213, 250, 199, 205, 251, 207, 255, 255, 128 },
- { 77, 126, 183, 243, 182, 183, 252, 206, 255, 255, 128 },
- { 69, 96, 149, 229, 157, 170, 247, 169, 255, 255, 128 }
- }, { /* Coeff Band 2 */
- { 107, 196, 241, 252, 211, 208, 255, 210, 128, 128, 128 },
- { 92, 162, 221, 249, 203, 195, 255, 199, 128, 128, 128 },
- { 20, 108, 181, 244, 190, 191, 250, 200, 255, 255, 128 },
- { 7, 80, 132, 241, 172, 197, 253, 191, 255, 255, 128 },
- { 2, 43, 75, 219, 122, 150, 255, 203, 128, 128, 128 },
- { 1, 15, 48, 98, 51, 192, 255, 160, 128, 128, 128 }
- }, { /* Coeff Band 3 */
- { 107, 202, 244, 254, 226, 215, 255, 192, 128, 128, 128 },
- { 77, 167, 224, 252, 215, 212, 255, 235, 128, 128, 128 },
- { 14, 117, 179, 249, 191, 196, 255, 212, 128, 128, 128 },
- { 3, 84, 134, 237, 160, 194, 248, 216, 255, 255, 128 },
- { 1, 57, 84, 216, 145, 136, 255, 161, 128, 128, 128 },
- { 1, 1, 1, 255, 128, 255, 128, 128, 128, 128, 128 }
- }, { /* Coeff Band 4 */
- { 88, 219, 248, 255, 239, 225, 255, 255, 128, 128, 128 },
- { 61, 178, 234, 255, 227, 227, 255, 217, 128, 128, 128 },
- { 6, 127, 188, 252, 201, 211, 255, 244, 128, 128, 128 },
- { 1, 83, 130, 248, 173, 197, 255, 175, 128, 128, 128 },
- { 1, 61, 66, 211, 121, 188, 255, 213, 128, 128, 128 },
- { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }
- }, { /* Coeff Band 5 */
- { 73, 243, 250, 255, 244, 220, 255, 205, 128, 128, 128 },
- { 42, 197, 242, 255, 237, 227, 242, 166, 255, 255, 128 },
- { 10, 137, 197, 252, 214, 199, 255, 238, 128, 128, 128 },
- { 2, 85, 134, 242, 163, 185, 224, 238, 255, 255, 128 },
- { 1, 70, 69, 199, 110, 64, 255, 213, 128, 128, 128 },
- { 1, 1, 1, 1, 128, 128, 255, 1, 128, 128, 128 }
- }
- }
- }
-};
-#endif
diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c
index 1b1d3421a..1f1c5d9f8 100644
--- a/vp9/common/vp9_entropy.c
+++ b/vp9/common/vp9_entropy.c
@@ -380,17 +380,17 @@ DECLARE_ALIGNED(16, const int, vp9_default_zig_zag1d_32x32[1024]) = {
const vp9_tree_index vp9_coef_tree[ 22] = /* corresponding _CONTEXT_NODEs */
{
- -DCT_EOB_TOKEN, 2, /* 0 = EOB */
- -ZERO_TOKEN, 4, /* 1 = ZERO */
- -ONE_TOKEN, 6, /* 2 = ONE */
- 8, 12, /* 3 = LOW_VAL */
- -TWO_TOKEN, 10, /* 4 = TWO */
+ -DCT_EOB_TOKEN, 2, /* 0 = EOB */
+ -ZERO_TOKEN, 4, /* 1 = ZERO */
+ -ONE_TOKEN, 6, /* 2 = ONE */
+ 8, 12, /* 3 = LOW_VAL */
+ -TWO_TOKEN, 10, /* 4 = TWO */
-THREE_TOKEN, -FOUR_TOKEN, /* 5 = THREE */
- 14, 16, /* 6 = HIGH_LOW */
+ 14, 16, /* 6 = HIGH_LOW */
-DCT_VAL_CATEGORY1, -DCT_VAL_CATEGORY2, /* 7 = CAT_ONE */
18, 20, /* 8 = CAT_THREEFOUR */
- -DCT_VAL_CATEGORY3, -DCT_VAL_CATEGORY4, /* 9 = CAT_THREE */
- -DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6 /* 10 = CAT_FIVE */
+ -DCT_VAL_CATEGORY3, -DCT_VAL_CATEGORY4, /* 9 = CAT_THREE */
+ -DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6 /* 10 = CAT_FIVE */
};
struct vp9_token vp9_coef_encodings[MAX_ENTROPY_TOKENS];
@@ -407,300 +407,111 @@ static const vp9_prob Pcat6[] = {
254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129
};
-#if CONFIG_MODELCOEFPROB
const vp9_tree_index vp9_coefmodel_tree[6] = {
-DCT_EOB_MODEL_TOKEN, 2, /* 0 = EOB */
-ZERO_TOKEN, 4, /* 1 = ZERO */
-ONE_TOKEN, -TWO_TOKEN, /* 2 = ONE */
};
-const vp9_prob vp9_modelcoefprobs_gg75p1[COEFPROB_MODELS][MODEL_NODES] = {
- // Probs generated with a Generalized Gaussian (with shape parameter 0.75)
- // source model with varying quantizer step size for a uniform quantizer
- { 3, 86, 129, 6, 87, 21, 90, 26,},
- { 9, 87, 130, 16, 89, 55, 96, 65,},
- { 14, 88, 130, 26, 90, 82, 101, 95,},
- { 20, 89, 131, 35, 92, 105, 105, 119,},
- { 25, 90, 132, 44, 93, 124, 110, 138,},
- { 30, 91, 132, 52, 95, 141, 114, 155,},
- { 35, 92, 133, 60, 96, 155, 118, 168,},
- { 40, 93, 134, 68, 97, 167, 123, 180,},
- { 44, 94, 134, 75, 99, 178, 127, 190,},
- { 49, 94, 135, 82, 100, 187, 131, 199,},
- { 54, 95, 135, 88, 101, 195, 135, 206,},
- { 58, 96, 136, 95, 102, 202, 138, 213,},
- { 63, 97, 137, 101, 104, 209, 142, 218,},
- { 67, 98, 137, 107, 105, 214, 146, 223,},
- { 71, 98, 138, 113, 106, 219, 150, 227,},
- { 76, 99, 138, 118, 107, 223, 153, 231,},
- { 80, 100, 139, 123, 109, 227, 157, 234,},
- { 84, 101, 140, 128, 110, 231, 160, 237,},
- { 88, 102, 140, 133, 111, 234, 164, 239,},
- { 92, 102, 141, 138, 112, 236, 167, 241,},
- { 95, 103, 141, 143, 114, 238, 170, 243,},
- { 99, 104, 142, 147, 115, 241, 173, 245,},
- { 103, 105, 142, 151, 116, 242, 176, 246,},
- { 107, 105, 143, 156, 117, 244, 180, 248,},
- { 110, 106, 144, 159, 119, 245, 182, 249,},
- { 114, 107, 144, 163, 120, 247, 185, 250,},
- { 117, 108, 145, 167, 121, 248, 188, 250,},
- { 121, 109, 145, 171, 123, 249, 191, 251,},
- { 124, 110, 146, 174, 124, 250, 194, 252,},
- { 127, 110, 147, 177, 125, 250, 196, 252,},
- { 130, 111, 147, 181, 127, 251, 199, 253,},
- { 134, 112, 148, 184, 128, 252, 201, 253,},
- { 137, 113, 148, 187, 129, 252, 204, 254,},
- { 140, 114, 149, 190, 130, 253, 206, 254,},
- { 143, 115, 150, 192, 132, 253, 208, 254,},
- { 146, 115, 150, 195, 133, 254, 210, 254,},
- { 149, 116, 151, 198, 134, 254, 212, 255,},
- { 152, 117, 151, 200, 136, 254, 214, 255,},
- { 154, 118, 152, 203, 137, 254, 216, 255,},
- { 157, 119, 153, 205, 139, 255, 218, 255,},
- { 160, 120, 153, 207, 140, 255, 220, 255,},
- { 163, 121, 154, 210, 141, 255, 222, 255,},
- { 165, 122, 154, 212, 143, 255, 223, 255,},
- { 168, 123, 155, 214, 144, 255, 225, 255,},
- { 170, 123, 156, 216, 145, 255, 227, 255,},
- { 173, 124, 156, 218, 147, 255, 228, 255,},
- { 175, 125, 157, 219, 148, 255, 230, 255,},
- { 178, 126, 158, 221, 150, 255, 231, 255,},
- { 180, 127, 158, 223, 151, 255, 232, 255,},
- { 182, 128, 159, 224, 152, 255, 234, 255,},
- { 184, 129, 160, 226, 154, 255, 235, 255,},
- { 187, 130, 160, 227, 155, 255, 236, 255,},
- { 189, 131, 161, 229, 157, 255, 237, 255,},
- { 191, 132, 162, 230, 158, 255, 238, 255,},
- { 193, 133, 163, 232, 159, 255, 239, 255,},
- { 195, 134, 163, 233, 161, 255, 240, 255,},
- { 197, 135, 164, 234, 162, 255, 241, 255,},
- { 199, 136, 165, 235, 164, 255, 242, 255,},
- { 201, 137, 165, 236, 165, 255, 243, 255,},
- { 203, 138, 166, 237, 167, 255, 244, 255,},
- { 205, 139, 167, 238, 168, 255, 244, 255,},
- { 206, 141, 168, 239, 170, 255, 245, 255,},
- { 208, 142, 168, 240, 171, 255, 246, 255,},
- { 210, 143, 169, 241, 173, 255, 246, 255,},
- { 212, 144, 170, 242, 174, 255, 247, 255,},
- { 213, 145, 171, 243, 176, 255, 248, 255,},
- { 215, 146, 171, 244, 177, 255, 248, 255,},
- { 216, 147, 172, 244, 179, 255, 249, 255,},
- { 218, 148, 173, 245, 180, 255, 249, 255,},
- { 220, 150, 174, 246, 181, 255, 250, 255,},
- { 221, 151, 175, 246, 183, 255, 250, 255,},
- { 222, 152, 175, 247, 184, 255, 251, 255,},
- { 224, 153, 176, 248, 186, 255, 251, 255,},
- { 225, 154, 177, 248, 187, 255, 251, 255,},
- { 226, 156, 178, 249, 189, 255, 252, 255,},
- { 228, 157, 179, 249, 190, 255, 252, 255,},
- { 229, 158, 180, 250, 192, 255, 252, 255,},
- { 230, 159, 181, 250, 193, 255, 253, 255,},
- { 231, 161, 181, 251, 195, 255, 253, 255,},
- { 233, 162, 182, 251, 196, 255, 253, 255,},
- { 234, 163, 183, 251, 198, 255, 253, 255,},
- { 235, 165, 184, 252, 199, 255, 254, 255,},
- { 236, 166, 185, 252, 201, 255, 254, 255,},
- { 237, 167, 186, 252, 202, 255, 254, 255,},
- { 238, 169, 187, 253, 204, 255, 254, 255,},
- { 239, 170, 188, 253, 205, 255, 254, 255,},
- { 240, 172, 189, 253, 207, 255, 255, 255,},
- { 241, 173, 190, 253, 208, 255, 255, 255,},
- { 242, 175, 191, 254, 210, 255, 255, 255,},
- { 242, 176, 192, 254, 211, 255, 255, 255,},
- { 243, 177, 193, 254, 213, 255, 255, 255,},
- { 244, 179, 194, 254, 214, 255, 255, 255,},
- { 245, 181, 195, 254, 216, 255, 255, 255,},
- { 245, 182, 196, 255, 217, 255, 255, 255,},
- { 246, 184, 197, 255, 218, 255, 255, 255,},
- { 247, 185, 199, 255, 220, 255, 255, 255,},
- { 247, 187, 200, 255, 221, 255, 255, 255,},
- { 248, 188, 201, 255, 223, 255, 255, 255,},
- { 249, 190, 202, 255, 224, 255, 255, 255,},
- { 249, 192, 203, 255, 225, 255, 255, 255,},
- { 250, 193, 205, 255, 227, 255, 255, 255,},
- { 250, 195, 206, 255, 228, 255, 255, 255,},
- { 251, 197, 207, 255, 229, 255, 255, 255,},
- { 251, 199, 208, 255, 231, 255, 255, 255,},
- { 252, 201, 210, 255, 232, 255, 255, 255,},
- { 252, 202, 211, 255, 233, 255, 255, 255,},
- { 252, 204, 212, 255, 235, 255, 255, 255,},
- { 253, 206, 214, 255, 236, 255, 255, 255,},
- { 253, 208, 215, 255, 237, 255, 255, 255,},
- { 254, 210, 217, 255, 238, 255, 255, 255,},
- { 254, 212, 218, 255, 240, 255, 255, 255,},
- { 254, 214, 220, 255, 241, 255, 255, 255,},
- { 254, 216, 221, 255, 242, 255, 255, 255,},
- { 255, 218, 223, 255, 243, 255, 255, 255,},
- { 255, 220, 225, 255, 244, 255, 255, 255,},
- { 255, 222, 226, 255, 245, 255, 255, 255,},
- { 255, 224, 228, 255, 247, 255, 255, 255,},
- { 255, 227, 230, 255, 248, 255, 255, 255,},
- { 255, 229, 232, 255, 249, 255, 255, 255,},
- { 255, 231, 234, 255, 250, 255, 255, 255,},
- { 255, 234, 236, 255, 251, 255, 255, 255,},
- { 255, 236, 238, 255, 252, 255, 255, 255,},
- { 255, 239, 240, 255, 252, 255, 255, 255,},
- { 255, 241, 242, 255, 253, 255, 255, 255,},
- { 255, 244, 245, 255, 254, 255, 255, 255,},
- { 255, 247, 247, 255, 255, 255, 255, 255,},
- { 255, 250, 250, 255, 255, 255, 255, 255,},
- { 255, 254, 254, 255, 255, 255, 255, 255,},
-};
-
-const vp9_prob vp9_modelcoefprobs_gg625p1[COEFPROB_MODELS][MODEL_NODES] = {
- // Probs generated with a Generalized Gaussian (with shape parameter 0.625)
- // source model with varying quantizer step size for a uniform quantizer
- { 3, 87, 129, 6, 87, 20, 91, 24,},
- { 8, 88, 130, 15, 90, 50, 97, 56,},
- { 14, 90, 131, 24, 91, 74, 102, 81,},
- { 19, 91, 132, 33, 93, 93, 106, 101,},
- { 24, 92, 133, 40, 94, 110, 110, 118,},
- { 29, 93, 134, 48, 96, 125, 113, 132,},
- { 33, 93, 134, 55, 97, 138, 117, 145,},
- { 38, 94, 135, 62, 98, 149, 120, 155,},
- { 42, 95, 136, 68, 99, 159, 124, 165,},
- { 47, 96, 136, 74, 100, 168, 127, 174,},
- { 51, 97, 137, 80, 102, 176, 130, 181,},
- { 55, 98, 137, 86, 103, 184, 133, 188,},
- { 59, 98, 138, 91, 104, 190, 136, 194,},
- { 64, 99, 139, 97, 105, 196, 139, 200,},
- { 68, 100, 139, 102, 106, 201, 142, 205,},
- { 71, 101, 140, 107, 107, 206, 145, 209,},
- { 75, 102, 140, 112, 108, 211, 148, 213,},
- { 79, 102, 141, 116, 109, 215, 150, 217,},
- { 83, 103, 141, 121, 110, 218, 153, 220,},
- { 87, 104, 142, 125, 112, 222, 156, 224,},
- { 90, 105, 143, 129, 113, 225, 159, 226,},
- { 94, 105, 143, 133, 114, 227, 161, 229,},
- { 97, 106, 144, 137, 115, 230, 164, 231,},
- { 101, 107, 144, 141, 116, 232, 166, 233,},
- { 104, 108, 145, 145, 117, 234, 169, 235,},
- { 107, 108, 145, 149, 118, 236, 171, 237,},
- { 111, 109, 146, 152, 119, 238, 174, 239,},
- { 114, 110, 146, 156, 120, 240, 176, 240,},
- { 117, 111, 147, 159, 121, 241, 178, 242,},
- { 120, 112, 148, 162, 122, 242, 181, 243,},
- { 123, 112, 148, 165, 124, 244, 183, 244,},
- { 126, 113, 149, 168, 125, 245, 185, 245,},
- { 129, 114, 149, 171, 126, 246, 187, 246,},
- { 132, 115, 150, 174, 127, 247, 189, 247,},
- { 135, 116, 150, 177, 128, 248, 192, 248,},
- { 138, 116, 151, 180, 129, 248, 194, 249,},
- { 141, 117, 152, 183, 130, 249, 196, 249,},
- { 143, 118, 152, 185, 131, 250, 198, 250,},
- { 146, 119, 153, 188, 132, 250, 200, 250,},
- { 149, 120, 153, 190, 134, 251, 201, 251,},
- { 151, 120, 154, 192, 135, 251, 203, 251,},
- { 154, 121, 155, 195, 136, 252, 205, 252,},
- { 157, 122, 155, 197, 137, 252, 207, 252,},
- { 159, 123, 156, 199, 138, 253, 209, 253,},
- { 162, 124, 156, 201, 139, 253, 210, 253,},
- { 164, 125, 157, 203, 140, 253, 212, 253,},
- { 166, 126, 158, 205, 142, 254, 214, 253,},
- { 169, 126, 158, 207, 143, 254, 215, 254,},
- { 171, 127, 159, 209, 144, 254, 217, 254,},
- { 173, 128, 159, 211, 145, 254, 218, 254,},
- { 176, 129, 160, 213, 146, 254, 220, 254,},
- { 178, 130, 161, 214, 148, 255, 221, 255,},
- { 180, 131, 161, 216, 149, 255, 223, 255,},
- { 182, 132, 162, 218, 150, 255, 224, 255,},
- { 184, 133, 163, 219, 151, 255, 225, 255,},
- { 186, 134, 163, 221, 152, 255, 226, 255,},
- { 188, 135, 164, 222, 154, 255, 228, 255,},
- { 190, 136, 165, 224, 155, 255, 229, 255,},
- { 192, 137, 165, 225, 156, 255, 230, 255,},
- { 194, 137, 166, 226, 157, 255, 231, 255,},
- { 196, 138, 167, 228, 159, 255, 232, 255,},
- { 198, 139, 167, 229, 160, 255, 233, 255,},
- { 200, 140, 168, 230, 161, 255, 234, 255,},
- { 202, 141, 169, 231, 163, 255, 235, 255,},
- { 203, 142, 169, 233, 164, 255, 236, 255,},
- { 205, 143, 170, 234, 165, 255, 237, 255,},
- { 207, 145, 171, 235, 166, 255, 238, 255,},
- { 209, 146, 171, 236, 168, 255, 239, 255,},
- { 210, 147, 172, 237, 169, 255, 240, 255,},
- { 212, 148, 173, 238, 170, 255, 241, 255,},
- { 213, 149, 174, 239, 172, 255, 242, 255,},
- { 215, 150, 174, 240, 173, 255, 242, 255,},
- { 216, 151, 175, 240, 174, 255, 243, 255,},
- { 218, 152, 176, 241, 176, 255, 244, 255,},
- { 219, 153, 177, 242, 177, 255, 244, 255,},
- { 221, 154, 178, 243, 178, 255, 245, 255,},
- { 222, 156, 178, 244, 180, 255, 246, 255,},
- { 223, 157, 179, 244, 181, 255, 246, 255,},
- { 225, 158, 180, 245, 183, 255, 247, 255,},
- { 226, 159, 181, 246, 184, 255, 247, 255,},
- { 227, 160, 182, 246, 185, 255, 248, 255,},
- { 229, 162, 183, 247, 187, 255, 248, 255,},
- { 230, 163, 183, 247, 188, 255, 249, 255,},
- { 231, 164, 184, 248, 190, 255, 249, 255,},
- { 232, 165, 185, 248, 191, 255, 250, 255,},
- { 233, 167, 186, 249, 192, 255, 250, 255,},
- { 234, 168, 187, 249, 194, 255, 251, 255,},
- { 235, 169, 188, 250, 195, 255, 251, 255,},
- { 236, 171, 189, 250, 197, 255, 251, 255,},
- { 237, 172, 190, 251, 198, 255, 252, 255,},
- { 238, 173, 191, 251, 200, 255, 252, 255,},
- { 239, 175, 192, 251, 201, 255, 252, 255,},
- { 240, 176, 193, 252, 203, 255, 253, 255,},
- { 241, 178, 194, 252, 204, 255, 253, 255,},
- { 242, 179, 195, 252, 206, 255, 253, 255,},
- { 243, 181, 196, 253, 207, 255, 253, 255,},
- { 244, 182, 197, 253, 209, 255, 254, 255,},
- { 244, 184, 198, 253, 210, 255, 254, 255,},
- { 245, 185, 199, 254, 212, 255, 254, 255,},
- { 246, 187, 200, 254, 213, 255, 254, 255,},
- { 247, 189, 201, 254, 215, 255, 254, 255,},
- { 247, 190, 203, 254, 216, 255, 255, 255,},
- { 248, 192, 204, 254, 218, 255, 255, 255,},
- { 249, 194, 205, 255, 219, 255, 255, 255,},
- { 249, 195, 206, 255, 221, 255, 255, 255,},
- { 250, 197, 208, 255, 222, 255, 255, 255,},
- { 250, 199, 209, 255, 224, 255, 255, 255,},
- { 251, 201, 210, 255, 225, 255, 255, 255,},
- { 251, 203, 212, 255, 227, 255, 255, 255,},
- { 252, 205, 213, 255, 228, 255, 255, 255,},
- { 252, 207, 215, 255, 230, 255, 255, 255,},
- { 253, 209, 216, 255, 231, 255, 255, 255,},
- { 253, 211, 218, 255, 233, 255, 255, 255,},
- { 253, 213, 219, 255, 234, 255, 255, 255,},
- { 254, 215, 221, 255, 236, 255, 255, 255,},
- { 254, 217, 223, 255, 238, 255, 255, 255,},
- { 254, 219, 224, 255, 239, 255, 255, 255,},
- { 255, 222, 226, 255, 241, 255, 255, 255,},
- { 255, 224, 228, 255, 242, 255, 255, 255,},
- { 255, 227, 230, 255, 244, 255, 255, 255,},
- { 255, 229, 232, 255, 245, 255, 255, 255,},
- { 255, 232, 234, 255, 247, 255, 255, 255,},
- { 255, 235, 237, 255, 248, 255, 255, 255,},
- { 255, 238, 239, 255, 250, 255, 255, 255,},
- { 255, 241, 242, 255, 251, 255, 255, 255,},
- { 255, 244, 245, 255, 253, 255, 255, 255,},
- { 255, 248, 248, 255, 254, 255, 255, 255,},
- { 255, 253, 253, 255, 255, 255, 255, 255,},
+// Model obtained from a 2-sided zero-centerd distribuition derived
+// from a Pareto distribution. The cdf of the distribution is:
+// cdf(x) = 0.5 + 0.5 * sgn(x) * [1 - {alpha/(alpha + |x|)} ^ beta]
+//
+// For a given beta and a given probablity of the 1-node, the alpha
+// is first solved, and then the {alpha, beta} pair is used to generate
+// the probabilities for the rest of the nodes.
+
+// beta = 8
+const vp9_prob vp9_modelcoefprobs_pareto8[COEFPROB_MODELS][MODEL_NODES] = {
+ { 3, 86, 128, 6, 86, 23, 88, 29},
+ { 9, 86, 129, 17, 88, 61, 94, 76},
+ { 20, 88, 130, 38, 91, 118, 106, 136},
+ { 31, 90, 131, 58, 94, 156, 117, 171},
+ { 42, 91, 132, 75, 97, 183, 127, 194},
+ { 52, 93, 133, 90, 100, 201, 137, 208},
+ { 62, 94, 135, 105, 103, 214, 146, 218},
+ { 71, 96, 136, 117, 106, 224, 155, 225},
+ { 80, 98, 137, 129, 109, 231, 162, 231},
+ { 89, 99, 138, 140, 112, 236, 170, 235},
+ { 97, 101, 140, 149, 115, 240, 176, 238},
+ { 105, 103, 141, 158, 118, 243, 182, 240},
+ { 113, 104, 142, 166, 120, 245, 187, 242},
+ { 120, 106, 143, 173, 123, 247, 192, 244},
+ { 127, 108, 145, 180, 126, 249, 197, 245},
+ { 134, 110, 146, 186, 129, 250, 201, 246},
+ { 140, 112, 147, 192, 132, 251, 205, 247},
+ { 146, 114, 149, 197, 135, 252, 208, 248},
+ { 152, 115, 150, 201, 138, 252, 211, 248},
+ { 158, 117, 151, 206, 140, 253, 214, 249},
+ { 163, 119, 153, 210, 143, 253, 217, 249},
+ { 168, 121, 154, 213, 146, 254, 220, 250},
+ { 173, 123, 155, 217, 148, 254, 222, 250},
+ { 178, 125, 157, 220, 151, 254, 224, 251},
+ { 183, 127, 158, 222, 153, 254, 226, 251},
+ { 187, 129, 160, 225, 156, 255, 228, 251},
+ { 191, 132, 161, 227, 159, 255, 229, 251},
+ { 195, 134, 163, 230, 161, 255, 231, 252},
+ { 199, 136, 164, 232, 163, 255, 232, 252},
+ { 202, 138, 166, 233, 166, 255, 233, 252},
+ { 206, 140, 167, 235, 168, 255, 235, 252},
+ { 212, 145, 170, 238, 173, 255, 237, 252},
+ { 218, 149, 173, 241, 177, 255, 239, 253},
+ { 223, 154, 177, 243, 182, 255, 240, 253},
+ { 228, 159, 180, 245, 186, 255, 242, 253},
+ { 232, 164, 184, 247, 190, 255, 243, 253},
+ { 236, 169, 187, 248, 194, 255, 244, 253},
+ { 239, 174, 191, 249, 198, 255, 245, 254},
+ { 242, 179, 195, 250, 202, 255, 246, 254},
+ { 244, 185, 199, 251, 206, 255, 247, 254},
+ { 247, 191, 203, 252, 209, 255, 248, 254},
+ { 249, 197, 207, 253, 213, 255, 249, 254},
+ { 250, 203, 212, 253, 216, 255, 249, 254},
+ { 252, 209, 217, 254, 220, 255, 250, 254},
+ { 253, 216, 222, 254, 224, 255, 251, 254},
+ { 254, 224, 228, 255, 227, 255, 251, 254},
+ { 255, 232, 235, 255, 232, 255, 252, 254},
+ { 255, 246, 247, 255, 239, 255, 253, 255}
};
void vp9_get_model_distribution(vp9_prob p, vp9_prob *tree_probs,
int b, int r) {
const vp9_prob (*model)[MODEL_NODES];
- 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_gg625p1;
- if (p & 1) { // odd
+ model = vp9_modelcoefprobs_pareto8;
+ if (p == 1) {
vpx_memcpy(tree_probs + UNCONSTRAINED_NODES,
- model[(p - 1) / 2],
- (ENTROPY_NODES - UNCONSTRAINED_NODES) * sizeof(vp9_prob));
- } else {
+ model[2], MODEL_NODES * sizeof(vp9_prob));
+ } else if (p == 2) {
// interpolate
int i;
for (i = UNCONSTRAINED_NODES; i < ENTROPY_NODES; ++i)
- tree_probs[i] = (model[p / 2 - 1][i - UNCONSTRAINED_NODES] +
- model[p / 2][i - UNCONSTRAINED_NODES]) >> 1;
+ tree_probs[i] = (model[0][i - UNCONSTRAINED_NODES] +
+ model[1][i - UNCONSTRAINED_NODES]) >> 1;
+ } else if (p < 119) {
+ // interpolate
+ int i, k, l;
+ k = (p - 3) & 3;
+ l = ((p - 3) >> 2) + 1;
+ if (k) {
+ for (i = UNCONSTRAINED_NODES; i < ENTROPY_NODES; ++i)
+ tree_probs[i] = (model[l][i - UNCONSTRAINED_NODES] * (4 - k) +
+ model[l + 1][i - UNCONSTRAINED_NODES] * k + 1) >> 2;
+ } else {
+ vpx_memcpy(tree_probs + UNCONSTRAINED_NODES,
+ model[l], MODEL_NODES * sizeof(vp9_prob));
+ }
+ } else {
+ // interpolate
+ int i, k, l;
+ k = (p - 119) & 7;
+ l = ((p - 119) >> 3) + 30;
+ if (k) {
+ for (i = UNCONSTRAINED_NODES; i < ENTROPY_NODES; ++i)
+ tree_probs[i] = (model[l][i - UNCONSTRAINED_NODES] * (8 - k) +
+ model[l + 1][i - UNCONSTRAINED_NODES] * k + 3) >> 3;
+ } else {
+ vpx_memcpy(tree_probs + UNCONSTRAINED_NODES,
+ model[l], MODEL_NODES * sizeof(vp9_prob));
+ }
}
}
@@ -719,7 +530,6 @@ void vp9_model_to_full_probs_sb(
vp9_model_to_full_probs(model[c][p], b, r, full[c][p]);
}
}
-#endif
static vp9_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[28];
@@ -956,7 +766,6 @@ void vp9_coef_tree_initialize() {
#define COEF_COUNT_SAT_AFTER_KEY 24
#define COEF_MAX_UPDATE_FACTOR_AFTER_KEY 128
-#if CONFIG_MODELCOEFPROB
void vp9_full_to_model_counts(
vp9_coeff_count_model *model_count, vp9_coeff_count *full_count) {
int i, j, k, l;
@@ -979,32 +788,19 @@ void vp9_full_to_model_counts(
full_count[i][j][k][l][DCT_EOB_TOKEN];
}
}
-#endif
static void adapt_coef_probs(
-#if CONFIG_MODELCOEFPROB
vp9_coeff_probs_model *dst_coef_probs,
vp9_coeff_probs_model *pre_coef_probs,
vp9_coeff_count_model *coef_counts,
-#else
- vp9_coeff_probs *dst_coef_probs,
- vp9_coeff_probs *pre_coef_probs,
- vp9_coeff_count *coef_counts,
-#endif
unsigned int (*eob_branch_count)[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS],
int count_sat,
int update_factor) {
int t, i, j, k, l, count;
int factor;
-#if CONFIG_MODELCOEFPROB
unsigned int branch_ct[UNCONSTRAINED_NODES][2];
vp9_prob coef_probs[UNCONSTRAINED_NODES];
int entropy_nodes_adapt = UNCONSTRAINED_NODES;
-#else
- unsigned int branch_ct[ENTROPY_NODES][2];
- vp9_prob coef_probs[ENTROPY_NODES];
- int entropy_nodes_adapt = ENTROPY_NODES;
-#endif
for (i = 0; i < BLOCK_TYPES; ++i)
for (j = 0; j < REF_TYPES; ++j)
@@ -1013,11 +809,7 @@ static void adapt_coef_probs(
if (l >= 3 && k == 0)
continue;
vp9_tree_probs_from_distribution(
-#if CONFIG_MODELCOEFPROB
vp9_coefmodel_tree,
-#else
- vp9_coef_tree,
-#endif
coef_probs, branch_ct,
coef_counts[i][j][k][l], 0);
branch_ct[0][1] = eob_branch_count[i][j][k][l] - branch_ct[0][0];
diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h
index d5f6002bc..068719e60 100644
--- a/vp9/common/vp9_entropy.h
+++ b/vp9/common/vp9_entropy.h
@@ -38,10 +38,8 @@
extern const vp9_tree_index vp9_coef_tree[];
-#if CONFIG_MODELCOEFPROB
#define DCT_EOB_MODEL_TOKEN 3 /* EOB Extra Bits 0+0 */
extern const vp9_tree_index vp9_coefmodel_tree[];
-#endif
extern struct vp9_token vp9_coef_encodings[MAX_ENTROPY_TOKENS];
@@ -156,8 +154,14 @@ extern int vp9_get_coef_context(const int *scan, const int *neighbors,
int nb_pad, uint8_t *token_cache, int c, int l);
const int *vp9_get_coef_neighbors_handle(const int *scan, int *pad);
-#if CONFIG_MODELCOEFPROB
-#define COEFPROB_MODELS 128 // 128 lists stored for probs 1, 3, ..., 255
+
+// 48 lists of probabilities are stored for the following ONE node probs:
+// 1, (count 1)
+// 3, 7, 11, 15, ..., 115, 119, (count 30)
+// 127, 135, 143, ..., 247, 255 (count 17)
+// In between probabilities are interpolated linearly
+
+#define COEFPROB_MODELS 48
#define UNCONSTRAINED_NODES 3
#define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES)
@@ -186,7 +190,6 @@ void vp9_model_to_full_probs_sb(
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);
-#endif // CONFIG_MODELCOEFPROB
static INLINE const int* get_scan_4x4(TX_TYPE tx_type) {
switch (tx_type) {
diff --git a/vp9/common/vp9_extend.c b/vp9/common/vp9_extend.c
index 6aeadf6aa..95ec59061 100644
--- a/vp9/common/vp9_extend.c
+++ b/vp9/common/vp9_extend.c
@@ -60,10 +60,22 @@ void vp9_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
const int eb_y = dst->border + dst->y_height - src->y_height;
const int er_y = dst->border + dst->y_width - src->y_width;
- const int et_uv = dst->border >> 1;
- const int el_uv = dst->border >> 1;
- const int eb_uv = (dst->border >> 1) + dst->uv_height - src->uv_height;
- const int er_uv = (dst->border >> 1) + dst->uv_width - src->uv_width;
+ const int et_uv = dst->border >> (dst->uv_height != dst->y_height);
+ const int el_uv = dst->border >> (dst->uv_width != dst->y_width);
+ const int eb_uv = et_uv + dst->uv_height - src->uv_height;
+ const int er_uv = el_uv + dst->uv_width - src->uv_width;
+
+#if CONFIG_ALPHA
+ const int et_a = dst->border >> (dst->alpha_height != dst->y_height);
+ const int el_a = dst->border >> (dst->alpha_width != dst->y_width);
+ const int eb_a = et_a + dst->alpha_height - src->alpha_height;
+ const int er_a = el_a + dst->alpha_width - src->alpha_width;
+
+ copy_and_extend_plane(src->alpha_buffer, src->alpha_stride,
+ dst->alpha_buffer, dst->alpha_stride,
+ src->alpha_width, src->alpha_height,
+ et_a, el_a, eb_a, er_a);
+#endif
copy_and_extend_plane(src->y_buffer, src->y_stride,
dst->y_buffer, dst->y_stride,
diff --git a/vp9/common/vp9_mbpitch.c b/vp9/common/vp9_mbpitch.c
index d9f892b76..3cf37ffab 100644
--- a/vp9/common/vp9_mbpitch.c
+++ b/vp9/common/vp9_mbpitch.c
@@ -20,4 +20,9 @@ void vp9_setup_block_dptrs(MACROBLOCKD *mb,
mb->plane[i].subsampling_x = i ? subsampling_x : 0;
mb->plane[i].subsampling_y = i ? subsampling_y : 0;
}
+#if CONFIG_ALPHA
+ // TODO(jkoleszar): Using the Y w/h for now
+ mb->plane[3].subsampling_x = 0;
+ mb->plane[3].subsampling_y = 0;
+#endif
}
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h
index 6ddc356fb..acca8479b 100644
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -73,7 +73,6 @@ typedef struct frame_contexts {
unsigned int sub_mv_ref_counts[SUBMVREF_COUNT][VP9_SUBMVREFS];
unsigned int partition_counts[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
-#if CONFIG_MODELCOEFPROB
vp9_coeff_probs_model coef_probs_4x4[BLOCK_TYPES];
vp9_coeff_probs_model coef_probs_8x8[BLOCK_TYPES];
vp9_coeff_probs_model coef_probs_16x16[BLOCK_TYPES];
@@ -86,20 +85,6 @@ typedef struct frame_contexts {
vp9_coeff_count_model coef_counts_8x8[BLOCK_TYPES];
vp9_coeff_count_model coef_counts_16x16[BLOCK_TYPES];
vp9_coeff_count_model coef_counts_32x32[BLOCK_TYPES];
-#else
- vp9_coeff_probs coef_probs_4x4[BLOCK_TYPES];
- vp9_coeff_probs coef_probs_8x8[BLOCK_TYPES];
- vp9_coeff_probs coef_probs_16x16[BLOCK_TYPES];
- vp9_coeff_probs coef_probs_32x32[BLOCK_TYPES];
- vp9_coeff_probs pre_coef_probs_4x4[BLOCK_TYPES];
- vp9_coeff_probs pre_coef_probs_8x8[BLOCK_TYPES];
- vp9_coeff_probs pre_coef_probs_16x16[BLOCK_TYPES];
- vp9_coeff_probs pre_coef_probs_32x32[BLOCK_TYPES];
- vp9_coeff_count coef_counts_4x4[BLOCK_TYPES];
- vp9_coeff_count coef_counts_8x8[BLOCK_TYPES];
- vp9_coeff_count coef_counts_16x16[BLOCK_TYPES];
- vp9_coeff_count coef_counts_32x32[BLOCK_TYPES];
-#endif
unsigned int eob_branch_counts[TX_SIZE_MAX_SB][BLOCK_TYPES][REF_TYPES]
[COEF_BANDS][PREV_COEF_CONTEXTS];
@@ -132,6 +117,9 @@ typedef struct VP9Common {
DECLARE_ALIGNED(16, int16_t, y_dequant[QINDEX_RANGE][2]);
DECLARE_ALIGNED(16, int16_t, uv_dequant[QINDEX_RANGE][2]);
+#if CONFIG_ALPHA
+ DECLARE_ALIGNED(16, int16_t, a_dequant[QINDEX_RANGE][2]);
+#endif
int width;
int height;
@@ -194,6 +182,10 @@ typedef struct VP9Common {
int y_dc_delta_q;
int uv_dc_delta_q;
int uv_ac_delta_q;
+#if CONFIG_ALPHA
+ int a_dc_delta_q;
+ int a_ac_delta_q;
+#endif
unsigned int frames_since_golden;
unsigned int frames_till_alt_ref_frame;
diff --git a/vp9/common/vp9_postproc.c b/vp9/common/vp9_postproc.c
index 8001adb29..d2c52edfd 100644
--- a/vp9/common/vp9_postproc.c
+++ b/vp9/common/vp9_postproc.c
@@ -320,13 +320,19 @@ void vp9_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
+ 0.0065 + 0.5);
int i;
- const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
- const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
- const int src_widths[3] = {src->y_width, src->uv_width, src->uv_width};
- const int src_heights[3] = {src->y_height, src->uv_height, src->uv_height};
-
- uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer};
- const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride};
+ const uint8_t *const srcs[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
+ src->alpha_buffer};
+ const int src_strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
+ src->alpha_stride};
+ const int src_widths[4] = {src->y_width, src->uv_width, src->uv_width,
+ src->alpha_width};
+ const int src_heights[4] = {src->y_height, src->uv_height, src->uv_height,
+ src->alpha_height};
+
+ uint8_t *const dsts[4] = {dst->y_buffer, dst->u_buffer, dst->v_buffer,
+ dst->alpha_buffer};
+ const int dst_strides[4] = {dst->y_stride, dst->uv_stride, dst->uv_stride,
+ dst->alpha_stride};
for (i = 0; i < MAX_MB_PLANE; ++i)
vp9_post_proc_down_and_across(srcs[i], dsts[i],
@@ -340,13 +346,19 @@ void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
+ 0.0065 + 0.5);
int i;
- const uint8_t *const srcs[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
- const int src_strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
- const int src_widths[3] = {src->y_width, src->uv_width, src->uv_width};
- const int src_heights[3] = {src->y_height, src->uv_height, src->uv_height};
-
- uint8_t *const dsts[3] = {dst->y_buffer, dst->u_buffer, dst->v_buffer};
- const int dst_strides[3] = {dst->y_stride, dst->uv_stride, dst->uv_stride};
+ const uint8_t *const srcs[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
+ src->alpha_buffer};
+ const int src_strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
+ src->alpha_stride};
+ const int src_widths[4] = {src->y_width, src->uv_width, src->uv_width,
+ src->alpha_width};
+ const int src_heights[4] = {src->y_height, src->uv_height, src->uv_height,
+ src->alpha_height};
+
+ uint8_t *const dsts[4] = {dst->y_buffer, dst->u_buffer, dst->v_buffer,
+ dst->alpha_buffer};
+ const int dst_strides[4] = {dst->y_stride, dst->uv_stride, dst->uv_stride,
+ dst->alpha_stride};
for (i = 0; i < MAX_MB_PLANE; ++i) {
const int src_stride = src_strides[i];
diff --git a/vp9/common/vp9_reconinter.c b/vp9/common/vp9_reconinter.c
index e7303f15f..cd0ba8445 100644
--- a/vp9/common/vp9_reconinter.c
+++ b/vp9/common/vp9_reconinter.c
@@ -469,12 +469,27 @@ void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd,
BLOCK_SIZE_TYPE bsize) {
struct build_inter_predictors_args args = {
xd, mi_col * MI_SIZE, mi_row * MI_SIZE,
+#if CONFIG_ALPHA
+ {NULL, xd->plane[1].dst.buf, xd->plane[2].dst.buf,
+ xd->plane[3].dst.buf},
+ {0, xd->plane[1].dst.stride, xd->plane[1].dst.stride,
+ xd->plane[3].dst.stride},
+ {{NULL, xd->plane[1].pre[0].buf, xd->plane[2].pre[0].buf,
+ xd->plane[3].pre[0].buf},
+ {NULL, xd->plane[1].pre[1].buf, xd->plane[2].pre[1].buf,
+ xd->plane[3].pre[1].buf}},
+ {{0, xd->plane[1].pre[0].stride, xd->plane[1].pre[0].stride,
+ xd->plane[3].pre[0].stride},
+ {0, xd->plane[1].pre[1].stride, xd->plane[1].pre[1].stride,
+ xd->plane[3].pre[1].stride}},
+#else
{NULL, xd->plane[1].dst.buf, xd->plane[2].dst.buf},
{0, xd->plane[1].dst.stride, xd->plane[1].dst.stride},
{{NULL, xd->plane[1].pre[0].buf, xd->plane[2].pre[0].buf},
{NULL, xd->plane[1].pre[1].buf, xd->plane[2].pre[1].buf}},
{{0, xd->plane[1].pre[0].stride, xd->plane[1].pre[0].stride},
{0, xd->plane[1].pre[1].stride, xd->plane[1].pre[1].stride}},
+#endif
};
foreach_predicted_block_uv(xd, bsize, build_inter_predictors, &args);
}
diff --git a/vp9/common/vp9_reconinter.h b/vp9/common/vp9_reconinter.h
index 8f7619520..af289d27e 100644
--- a/vp9/common/vp9_reconinter.h
+++ b/vp9/common/vp9_reconinter.h
@@ -74,8 +74,10 @@ static void setup_pred_plane(struct buf_2d *dst,
static void setup_dst_planes(MACROBLOCKD *xd,
const YV12_BUFFER_CONFIG *src,
int mi_row, int mi_col) {
- uint8_t *buffers[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
- int strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
+ uint8_t *buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
+ src->alpha_buffer};
+ int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
+ src->alpha_stride};
int i;
for (i = 0; i < MAX_MB_PLANE; ++i) {
@@ -97,8 +99,10 @@ static void setup_pre_planes(MACROBLOCKD *xd,
for (i = 0; i < 2; ++i) {
const YV12_BUFFER_CONFIG *src = srcs[i];
if (src) {
- uint8_t* buffers[3] = {src->y_buffer, src->u_buffer, src->v_buffer};
- int strides[3] = {src->y_stride, src->uv_stride, src->uv_stride};
+ uint8_t* buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
+ src->alpha_buffer};
+ int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
+ src->alpha_stride};
for (j = 0; j < MAX_MB_PLANE; ++j) {
struct macroblockd_plane *pd = &xd->plane[j];
diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c
index d1166858d..ac66fb644 100644
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -103,7 +103,6 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
vp9_reader *r) {
VP9_COMMON *const cm = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
- const int mis = cm->mode_info_stride;
m->mbmi.ref_frame = INTRA_FRAME;
// Read segmentation map if it is being updated explicitly this frame
@@ -138,14 +137,18 @@ static void kfread_modes(VP9D_COMP *pbi, MODE_INFO *m,
#else
if (m->mbmi.mode == I4X4_PRED) {
#endif
- int i;
- for (i = 0; i < 4; ++i) {
- const B_PREDICTION_MODE a = above_block_mode(m, i, mis);
- const B_PREDICTION_MODE l = xd->left_available ||
- (i & 1) ?
- left_block_mode(m, i) : B_DC_PRED;
- m->bmi[i].as_mode.first = read_kf_bmode(r, cm->kf_bmode_prob[a][l]);
- }
+ int idx, idy;
+ int bw = 1 << b_width_log2(m->mbmi.sb_type);
+ int bh = 1 << b_height_log2(m->mbmi.sb_type);
+ // FIXME(jingning): fix intra4x4 rate-distortion optimization, then
+ // use bw and bh as the increment values.
+#if !CONFIG_AB4X4 || CONFIG_AB4X4
+ bw = 1, bh = 1;
+#endif
+ for (idy = 0; idy < 2; idy += bh)
+ for (idx = 0; idx < 2; idx += bw)
+ m->bmi[idy * 2 + idx].as_mode.first =
+ read_kf_sb_ymode(r, cm->sb_kf_ymode_prob[cm->kf_ymode_probs_index]);
}
m->mbmi.uv_mode = read_uv_mode(r, cm->kf_uv_mode_prob[m->mbmi.mode]);
@@ -854,12 +857,19 @@ static void read_mb_modes_mv(VP9D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
#else
if (mbmi->mode == I4X4_PRED) {
#endif
- int j = 0;
- do {
- int m = read_bmode(r, cm->fc.bmode_prob);
- mi->bmi[j].as_mode.first = m;
- cm->fc.bmode_counts[m]++;
- } while (++j < 4);
+ int idx, idy;
+ // FIXME(jingning): fix intra4x4 rate-distortion optimization, then
+ // use bw and bh as the increment values.
+#if !CONFIG_AB4X4 || CONFIG_AB4X4
+ bw = 1, bh = 1;
+#endif
+ for (idy = 0; idy < 2; idy += bh) {
+ for (idx = 0; idx < 2; idx += bw) {
+ int m = read_sb_ymode(r, cm->fc.sb_ymode_prob);
+ mi->bmi[idy * 2 + idx].as_mode.first = m;
+ cm->fc.sb_ymode_counts[m]++;
+ }
+ }
}
mbmi->uv_mode = read_uv_mode(r, cm->fc.uv_mode_prob[mbmi->mode]);
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index 83fb8f9d9..449e4269e 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -551,18 +551,10 @@ static void init_frame(VP9D_COMP *pbi) {
}
static void read_coef_probs_common(
-#if CONFIG_MODELCOEFPROB
vp9_coeff_probs_model *coef_probs,
-#else
- vp9_coeff_probs *coef_probs,
-#endif
TX_SIZE tx_size,
vp9_reader *r) {
-#if CONFIG_MODELCOEFPROB
const int entropy_nodes_update = UNCONSTRAINED_NODES;
-#else
- const int entropy_nodes_update = ENTROPY_NODES;
-#endif
int i, j, k, l, m;
@@ -1068,10 +1060,9 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
if (vp9_read(&header_bc, 252))
pc->fc.vp9_mode_contexts[i][j] = vp9_read_prob(&header_bc);
}
-#if CONFIG_MODELCOEFPROB
+ // Is this needed ?
if (pc->frame_type == KEY_FRAME)
vp9_default_coef_probs(pc);
-#endif
update_frame_context(&pc->fc);
diff --git a/vp9/decoder/vp9_detokenize.c b/vp9/decoder/vp9_detokenize.c
index 076f4a89c..1b0991b0d 100644
--- a/vp9/decoder/vp9_detokenize.c
+++ b/vp9/decoder/vp9_detokenize.c
@@ -60,7 +60,6 @@ static const vp9_prob cat6_prob[15] = {
DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
-#if CONFIG_MODELCOEFPROB
#define INCREMENT_COUNT(token) \
do { \
coef_counts[type][ref][band][pt] \
@@ -69,14 +68,6 @@ DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
token]++; \
token_cache[scan[c]] = token; \
} while (0)
-#else
-#define INCREMENT_COUNT(token) \
- do { \
- coef_counts[type][ref][band] \
- [pt][token]++; \
- token_cache[scan[c]] = token; \
- } while (0)
-#endif
#define WRITE_COEF_CONTINUE(val, token) \
{ \
@@ -102,7 +93,6 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
FRAME_CONTEXT *const fc = &dx->common.fc;
int pt, c = 0, pad, default_eob;
int band;
-#if CONFIG_MODELCOEFPROB
vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES];
vp9_prob coef_probs_full[COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES];
uint8_t load_map[COEF_BANDS][PREV_COEF_CONTEXTS] = {
@@ -113,16 +103,9 @@ static int decode_coefs(VP9D_COMP *dx, const MACROBLOCKD *xd,
{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0},
};
-#else
- vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][ENTROPY_NODES];
-#endif
vp9_prob *prob;
-#if CONFIG_MODELCOEFPROB
vp9_coeff_count_model *coef_counts;
-#else
- vp9_coeff_count *coef_counts;
-#endif
const int ref = xd->mode_info_context->mbmi.ref_frame != INTRA_FRAME;
TX_TYPE tx_type = DCT_DCT;
const int *scan, *nb;
@@ -221,7 +204,6 @@ SKIP_START:
if (!vp9_read(r, prob[ONE_CONTEXT_NODE])) {
WRITE_COEF_CONTINUE(1, ONE_TOKEN);
}
-#if CONFIG_MODELCOEFPROB
// Load full probabilities if not already loaded
if (!load_map[band][pt]) {
vp9_model_to_full_probs(coef_probs[band][pt], type, ref,
@@ -229,7 +211,6 @@ SKIP_START:
load_map[band][pt] = 1;
}
prob = coef_probs_full[band][pt];
-#endif
// LOW_VAL_CONTEXT_NODE_0_
if (!vp9_read(r, prob[LOW_VAL_CONTEXT_NODE])) {
if (!vp9_read(r, prob[TWO_CONTEXT_NODE])) {
@@ -287,11 +268,7 @@ SKIP_START:
}
if (c < seg_eob)
-#if CONFIG_MODELCOEFPROB
coef_counts[type][ref][band][pt][DCT_EOB_MODEL_TOKEN]++;
-#else
- coef_counts[type][ref][band][pt][DCT_EOB_TOKEN]++;
-#endif
for (pt = 0; pt < (1 << txfm_size); pt++) {
A[pt] = L[pt] = c > 0;
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index b5b135576..88943330f 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -369,10 +369,11 @@ static void write_uv_mode(vp9_writer *bc, int m, const vp9_prob *p) {
write_token(bc, vp9_uv_mode_tree, p, vp9_uv_mode_encodings + m);
}
-
+#if !CONFIG_AB4X4
static void write_bmode(vp9_writer *bc, int m, const vp9_prob *p) {
write_token(bc, vp9_bmode_tree, p, vp9_bmode_encodings + m);
}
+#endif
static void write_kf_bmode(vp9_writer *bc, int m, const vp9_prob *p) {
write_token(bc, vp9_kf_bmode_tree, p, vp9_kf_bmode_encodings + m);
@@ -411,7 +412,6 @@ static int prob_diff_update_savings_search(const unsigned int *ct,
return bestsavings;
}
-#if CONFIG_MODELCOEFPROB
static int prob_diff_update_savings_search_model(const unsigned int *ct,
const vp9_prob *oldp,
vp9_prob *bestp,
@@ -448,7 +448,6 @@ static int prob_diff_update_savings_search_model(const unsigned int *ct,
*bestp = bestnewp;
return bestsavings;
}
-#endif
static void vp9_cond_prob_update(vp9_writer *bc, vp9_prob *oldp, vp9_prob upd,
unsigned int *ct) {
@@ -479,15 +478,12 @@ static void pack_mb_tokens(vp9_writer* const bc,
int v = a->value;
int n = a->len;
int ncount = n;
-#if CONFIG_MODELCOEFPROB
vp9_prob probs[ENTROPY_NODES];
-#endif
if (t == EOSB_TOKEN) {
++p;
break;
}
-#if CONFIG_MODELCOEFPROB
if (t >= TWO_TOKEN) {
vp9_model_to_full_probs(p->context_tree,
p->block_type, p->ref_type, probs);
@@ -495,9 +491,6 @@ static void pack_mb_tokens(vp9_writer* const bc,
} else {
pp = p->context_tree;
}
-#else
- pp = p->context_tree;
-#endif
assert(pp != 0);
/* skip one or two nodes */
@@ -744,11 +737,18 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
#else
if (mode == I4X4_PRED) {
#endif
- int j = 0;
- do {
- write_bmode(bc, m->bmi[j].as_mode.first,
- pc->fc.bmode_prob);
- } while (++j < 4);
+ int idx, idy;
+ int bw = 1 << b_width_log2(mi->sb_type);
+ int bh = 1 << b_height_log2(mi->sb_type);
+ // FIXME(jingning): fix intra4x4 rate-distortion optimization, then
+ // use bw and bh as the increment values.
+#if !CONFIG_AB4X4 || CONFIG_AB4X4
+ bw = 1, bh = 1;
+#endif
+ for (idy = 0; idy < 2; idy += bh)
+ for (idx = 0; idx < 2; idx += bw)
+ write_sb_ymode(bc, m->bmi[idy * 2 + idx].as_mode.first,
+ pc->fc.sb_ymode_prob);
}
write_uv_mode(bc, mi->uv_mode,
pc->fc.uv_mode_prob[mode]);
@@ -891,7 +891,6 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
vp9_writer *bc, int mi_row, int mi_col) {
const VP9_COMMON *const c = &cpi->common;
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
- const int mis = c->mode_info_stride;
const int ym = m->mbmi.mode;
const int segment_id = m->mbmi.segment_id;
int skip_coeff;
@@ -921,19 +920,18 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
#else
if (ym == I4X4_PRED) {
#endif
- int i = 0;
- do {
- const B_PREDICTION_MODE a = above_block_mode(m, i, mis);
- const B_PREDICTION_MODE l = (xd->left_available ||
- (i & 1)) ?
- left_block_mode(m, i) : B_DC_PRED;
- const int bm = m->bmi[i].as_mode.first;
-
-/*#ifdef ENTROPY_STATS
- ++intra_mode_stats [A] [L] [bm];
-#endif*/
- write_kf_bmode(bc, bm, c->kf_bmode_prob[a][l]);
- } while (++i < 4);
+ int idx, idy;
+ int bw = 1 << b_width_log2(m->mbmi.sb_type);
+ int bh = 1 << b_height_log2(m->mbmi.sb_type);
+ // FIXME(jingning): fix intra4x4 rate-distortion optimization, then
+ // use bw and bh as the increment values.
+#if !CONFIG_AB4X4 || CONFIG_AB4X4
+ bw = 1, bh = 1;
+#endif
+ for (idy = 0; idy < 2; idy += bh)
+ for (idx = 0; idx < 2; idx += bw)
+ sb_kfwrite_ymode(bc, m->bmi[idy * 2 + idx].as_mode.first,
+ c->sb_kf_ymode_prob[c->kf_ymode_probs_index]);
}
write_uv_mode(bc, m->mbmi.uv_mode, c->kf_uv_mode_prob[ym]);
@@ -1219,22 +1217,14 @@ static void update_coef_probs_common(
vp9_coeff_stats *tree_update_hist,
#endif
vp9_coeff_probs *new_frame_coef_probs,
-#if CONFIG_MODELCOEFPROB
vp9_coeff_probs_model *old_frame_coef_probs,
-#else
- vp9_coeff_probs *old_frame_coef_probs,
-#endif
vp9_coeff_stats *frame_branch_ct,
TX_SIZE tx_size) {
int i, j, k, l, t;
int update[2] = {0, 0};
int savings;
-#if CONFIG_MODELCOEFPROB
const int entropy_nodes_update = UNCONSTRAINED_NODES;
-#else
- const int entropy_nodes_update = ENTROPY_NODES;
-#endif
// vp9_prob bestupd = find_coef_update_prob(cpi);
const int tstart = 0;
@@ -1254,13 +1244,11 @@ static void update_coef_probs_common(
if (l >= 3 && k == 0)
continue;
-#if CONFIG_MODELCOEFPROB
if (t == PIVOT_NODE)
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)
@@ -1298,13 +1286,11 @@ static void update_coef_probs_common(
if (l >= 3 && k == 0)
continue;
-#if CONFIG_MODELCOEFPROB
if (t == PIVOT_NODE)
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);
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index f3a03f3c8..b6f611c87 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -503,21 +503,19 @@ static unsigned find_seg_id(uint8_t *buf, BLOCK_SIZE_TYPE bsize,
void vp9_setup_src_planes(MACROBLOCK *x,
const YV12_BUFFER_CONFIG *src,
int mb_row, int mb_col) {
- setup_pred_plane(&x->plane[0].src,
- src->y_buffer, src->y_stride,
- mb_row, mb_col, NULL,
- x->e_mbd.plane[0].subsampling_x,
- x->e_mbd.plane[0].subsampling_y);
- setup_pred_plane(&x->plane[1].src,
- src->u_buffer, src->uv_stride,
- mb_row, mb_col, NULL,
- x->e_mbd.plane[1].subsampling_x,
- x->e_mbd.plane[1].subsampling_y);
- setup_pred_plane(&x->plane[2].src,
- src->v_buffer, src->uv_stride,
- mb_row, mb_col, NULL,
- x->e_mbd.plane[2].subsampling_x,
- x->e_mbd.plane[2].subsampling_y);
+ uint8_t *buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
+ src->alpha_buffer};
+ int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
+ src->alpha_stride};
+ int i;
+
+ for (i = 0; i < MAX_MB_PLANE; i++) {
+ setup_pred_plane(&x->plane[i].src,
+ buffers[i], strides[i],
+ mb_row, mb_col, NULL,
+ x->e_mbd.plane[i].subsampling_x,
+ x->e_mbd.plane[i].subsampling_y);
+ }
}
static void set_offsets(VP9_COMP *cpi,
@@ -1614,11 +1612,20 @@ static void sum_intra_stats(VP9_COMP *cpi, MACROBLOCK *x) {
}
++cpi->y_uv_mode_count[m][uvm];
if (m == I4X4_PRED) {
- int b = 0;
- do {
- int m = xd->mode_info_context->bmi[b].as_mode.first;
- ++cpi->bmode_count[m];
- } while (++b < 4);
+ int idx, idy;
+ int bw = 1 << b_width_log2(xd->mode_info_context->mbmi.sb_type);
+ int bh = 1 << b_height_log2(xd->mode_info_context->mbmi.sb_type);
+ // FIXME(jingning): fix intra4x4 rate-distortion optimization, then
+ // use bw and bh as the increment values.
+#if !CONFIG_AB4X4 || CONFIG_AB4X4
+ bw = 1, bh = 1;
+#endif
+ for (idy = 0; idy < 2; idy += bh) {
+ for (idx = 0; idx < 2; idx += bw) {
+ int m = xd->mode_info_context->bmi[idy * 2 + idx].as_mode.first;
+ ++cpi->sb_ymode_count[m];
+ }
+ }
}
}
diff --git a/vp9/encoder/vp9_encodemb.c b/vp9/encoder/vp9_encodemb.c
index 84b350792..5990773bb 100644
--- a/vp9/encoder/vp9_encodemb.c
+++ b/vp9/encoder/vp9_encodemb.c
@@ -44,7 +44,6 @@ static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE_TYPE bsize, int plane) {
const uint8_t *src = x->plane[plane].src.buf;
const int src_stride = x->plane[plane].src.stride;
- assert(plane < 3);
vp9_subtract_block(bh, bw,
x->plane[plane].src_diff, bw, src, src_stride,
xd->plane[plane].dst.buf, xd->plane[plane].dst.stride);
diff --git a/vp9/encoder/vp9_lookahead.c b/vp9/encoder/vp9_lookahead.c
index 708fe4549..b07d92a44 100644
--- a/vp9/encoder/vp9_lookahead.c
+++ b/vp9/encoder/vp9_lookahead.c
@@ -84,20 +84,27 @@ bail:
return NULL;
}
+#define USE_PARTIAL_COPY 0
int vp9_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
int64_t ts_start, int64_t ts_end, unsigned int flags,
unsigned char *active_map) {
struct lookahead_entry *buf;
+#if USE_PARTIAL_COPY
int row, col, active_end;
int mb_rows = (src->y_height + 15) >> 4;
int mb_cols = (src->y_width + 15) >> 4;
+#endif
if (ctx->sz + 1 > ctx->max_sz)
return 1;
ctx->sz++;
buf = pop(ctx, &ctx->write_idx);
+#if USE_PARTIAL_COPY
+ // TODO(jkoleszar): This is disabled for now, as
+ // vp9_copy_and_extend_frame_with_rect is not subsampling/alpha aware.
+
// Only do this partial copy if the following conditions are all met:
// 1. Lookahead queue has has size of 1.
// 2. Active map is provided.
@@ -140,6 +147,11 @@ int vp9_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
} else {
vp9_copy_and_extend_frame(src, &buf->img);
}
+#else
+ // Partial copy not implemented yet
+ vp9_copy_and_extend_frame(src, &buf->img);
+#endif
+
buf->ts_start = ts_start;
buf->ts_end = ts_end;
buf->flags = flags;
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 02d46cb7d..5a98c628b 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -2086,6 +2086,18 @@ void vp9_write_yuv_rec_frame(VP9_COMMON *cm) {
fwrite(src, s->uv_width, 1, yuv_rec_file);
src += s->uv_stride;
} while (--h);
+
+#if CONFIG_ALPHA
+ if (s->alpha_buffer) {
+ src = s->alpha_buffer;
+ h = s->alpha_height;
+ do {
+ fwrite(src, s->alpha_width, 1, yuv_rec_file);
+ src += s->alpha_stride;
+ } while (--h);
+ }
+#endif
+
fflush(yuv_rec_file);
}
#endif
@@ -2098,11 +2110,15 @@ static void scale_and_extend_frame(YV12_BUFFER_CONFIG *src_fb,
const int out_h = dst_fb->y_crop_height;
int x, y, i;
- uint8_t *srcs[3] = {src_fb->y_buffer, src_fb->u_buffer, src_fb->v_buffer};
- int src_strides[3] = {src_fb->y_stride, src_fb->uv_stride, src_fb->uv_stride};
+ uint8_t *srcs[4] = {src_fb->y_buffer, src_fb->u_buffer, src_fb->v_buffer,
+ src_fb->alpha_buffer};
+ int src_strides[4] = {src_fb->y_stride, src_fb->uv_stride, src_fb->uv_stride,
+ src_fb->alpha_stride};
- uint8_t *dsts[3] = {dst_fb->y_buffer, dst_fb->u_buffer, dst_fb->v_buffer};
- int dst_strides[3] = {dst_fb->y_stride, dst_fb->uv_stride, dst_fb->uv_stride};
+ uint8_t *dsts[4] = {dst_fb->y_buffer, dst_fb->u_buffer, dst_fb->v_buffer,
+ dst_fb->alpha_buffer};
+ int dst_strides[4] = {dst_fb->y_stride, dst_fb->uv_stride, dst_fb->uv_stride,
+ dst_fb->alpha_stride};
for (y = 0; y < out_h; y += 16) {
for (x = 0; x < out_w; x += 16) {
@@ -2922,11 +2938,9 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
#endif
// transform / motion compensation build reconstruction frame
-#if CONFIG_MODELCOEFPROB
if (cm->frame_type == KEY_FRAME) {
vp9_default_coef_probs(cm);
}
-#endif
vp9_encode_frame(cpi);
@@ -3175,7 +3189,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
release_scaled_references(cpi);
update_reference_frames(cpi);
-#if CONFIG_MODELCOEFPROB
vp9_full_to_model_counts(cpi->common.fc.coef_counts_4x4,
cpi->coef_counts_4x4);
vp9_full_to_model_counts(cpi->common.fc.coef_counts_8x8,
@@ -3184,12 +3197,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
cpi->coef_counts_16x16);
vp9_full_to_model_counts(cpi->common.fc.coef_counts_32x32,
cpi->coef_counts_32x32);
-#else
- vp9_copy(cpi->common.fc.coef_counts_4x4, cpi->coef_counts_4x4);
- vp9_copy(cpi->common.fc.coef_counts_8x8, cpi->coef_counts_8x8);
- vp9_copy(cpi->common.fc.coef_counts_16x16, cpi->coef_counts_16x16);
- vp9_copy(cpi->common.fc.coef_counts_32x32, cpi->coef_counts_32x32);
-#endif
if (!cpi->common.error_resilient_mode &&
!cpi->common.frame_parallel_decoding_mode) {
vp9_adapt_coef_probs(&cpi->common);
diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h
index 57d19ca63..d1204d494 100644
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -76,17 +76,10 @@ typedef struct {
// 0 = I4X4_PRED, ZERO_MV, MV, SPLIT
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];
-#if CONFIG_MODELCOEFPROB
vp9_coeff_probs_model coef_probs_4x4[BLOCK_TYPES];
vp9_coeff_probs_model coef_probs_8x8[BLOCK_TYPES];
vp9_coeff_probs_model coef_probs_16x16[BLOCK_TYPES];
vp9_coeff_probs_model coef_probs_32x32[BLOCK_TYPES];
-#else
- vp9_coeff_probs coef_probs_4x4[BLOCK_TYPES];
- vp9_coeff_probs coef_probs_8x8[BLOCK_TYPES];
- vp9_coeff_probs coef_probs_16x16[BLOCK_TYPES];
- vp9_coeff_probs coef_probs_32x32[BLOCK_TYPES];
-#endif
vp9_prob sb_ymode_prob[VP9_I32X32_MODES - 1];
vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
@@ -265,6 +258,14 @@ typedef struct VP9_COMP {
DECLARE_ALIGNED(16, short, uv_zbin[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, uv_round[QINDEX_RANGE][16]);
+#if CONFIG_ALPHA
+ DECLARE_ALIGNED(16, short, a_quant[QINDEX_RANGE][16]);
+ DECLARE_ALIGNED(16, unsigned char, a_quant_shift[QINDEX_RANGE][16]);
+ DECLARE_ALIGNED(16, short, a_zbin[QINDEX_RANGE][16]);
+ DECLARE_ALIGNED(16, short, a_round[QINDEX_RANGE][16]);
+
+ DECLARE_ALIGNED(16, short, zrun_zbin_boost_a[QINDEX_RANGE][16]);
+#endif
DECLARE_ALIGNED(16, short, zrun_zbin_boost_y[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, zrun_zbin_boost_uv[QINDEX_RANGE][16]);
diff --git a/vp9/encoder/vp9_quantize.c b/vp9/encoder/vp9_quantize.c
index aea350bc4..9beda3466 100644
--- a/vp9/encoder/vp9_quantize.c
+++ b/vp9/encoder/vp9_quantize.c
@@ -148,6 +148,9 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
int i;
int quant_val;
int quant_uv_val;
+#if CONFIG_ALPHA
+ int quant_alpha_val;
+#endif
int q;
static const int zbin_boost[16] = { 0, 0, 0, 8, 8, 8, 10, 12,
@@ -168,7 +171,6 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
cpi->common.y_dequant[q][0] = quant_val;
cpi->zrun_zbin_boost_y[q][0] = (quant_val * zbin_boost[0]) >> 7;
-
quant_val = vp9_dc_quant(q, cpi->common.uv_dc_delta_q);
invert_quant(cpi->uv_quant[q] + 0, cpi->uv_quant_shift[q] + 0, quant_val);
cpi->uv_zbin[q][0] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7);
@@ -176,10 +178,23 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
cpi->common.uv_dequant[q][0] = quant_val;
cpi->zrun_zbin_boost_uv[q][0] = (quant_val * zbin_boost[0]) >> 7;
+#if CONFIG_ALPHA
+ quant_val = vp9_dc_quant(q, cpi->common.a_dc_delta_q);
+ invert_quant(cpi->a_quant[q] + 0, cpi->a_quant_shift[q] + 0, quant_val);
+ cpi->a_zbin[q][0] = ROUND_POWER_OF_TWO(qzbin_factor * quant_val, 7);
+ cpi->a_round[q][0] = (qrounding_factor * quant_val) >> 7;
+ cpi->common.a_dequant[q][0] = quant_val;
+ cpi->zrun_zbin_boost_a[q][0] = (quant_val * zbin_boost[0]) >> 7;
+#endif
+
quant_val = vp9_ac_quant(q, 0);
cpi->common.y_dequant[q][1] = quant_val;
quant_uv_val = vp9_ac_quant(q, cpi->common.uv_ac_delta_q);
cpi->common.uv_dequant[q][1] = quant_uv_val;
+#if CONFIG_ALPHA
+ quant_alpha_val = vp9_ac_quant(q, cpi->common.a_ac_delta_q);
+ cpi->common.a_dequant[q][1] = quant_alpha_val;
+#endif
// all the 4x4 ac values =;
for (i = 1; i < 16; i++) {
int rc = vp9_default_zig_zag1d_4x4[i];
@@ -196,6 +211,16 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
cpi->uv_round[q][rc] = (qrounding_factor * quant_uv_val) >> 7;
cpi->zrun_zbin_boost_uv[q][i] =
ROUND_POWER_OF_TWO(quant_uv_val * zbin_boost[i], 7);
+
+#if CONFIG_ALPHA
+ invert_quant(cpi->a_quant[q] + rc, cpi->a_quant_shift[q] + rc,
+ quant_alpha_val);
+ cpi->a_zbin[q][rc] =
+ ROUND_POWER_OF_TWO(qzbin_factor * quant_alpha_val, 7);
+ cpi->a_round[q][rc] = (qrounding_factor * quant_alpha_val) >> 7;
+ cpi->zrun_zbin_boost_a[q][i] =
+ ROUND_POWER_OF_TWO(quant_alpha_val * zbin_boost[i], 7);
+#endif
}
}
}
@@ -233,6 +258,16 @@ void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) {
x->e_mbd.plane[i].dequant = cpi->common.uv_dequant[qindex];
}
+#if CONFIG_ALPHA
+ x->plane[3].quant = cpi->a_quant[qindex];
+ x->plane[3].quant_shift = cpi->a_quant_shift[qindex];
+ x->plane[3].zbin = cpi->a_zbin[qindex];
+ x->plane[3].round = cpi->a_round[qindex];
+ x->plane[3].zrun_zbin_boost = cpi->zrun_zbin_boost_a[qindex];
+ x->plane[3].zbin_extra = (int16_t)zbin_extra;
+ x->e_mbd.plane[3].dequant = cpi->common.a_dequant[qindex];
+#endif
+
x->skip_block = vp9_segfeature_active(xd, segment_id, SEG_LVL_SKIP);
/* save this macroblock QIndex for vp9_update_zbin_extra() */
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 8c1ef4915..c6d58df40 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -106,11 +106,7 @@ const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
};
static void fill_token_costs(vp9_coeff_count *c,
-#if CONFIG_MODELCOEFPROB
vp9_coeff_probs_model *p,
-#else
- vp9_coeff_probs *p,
-#endif
TX_SIZE tx_size) {
int i, j, k, l;
@@ -118,15 +114,10 @@ static void fill_token_costs(vp9_coeff_count *c,
for (j = 0; j < REF_TYPES; j++)
for (k = 0; k < COEF_BANDS; k++)
for (l = 0; l < PREV_COEF_CONTEXTS; l++) {
-#if CONFIG_MODELCOEFPROB
vp9_prob probs[ENTROPY_NODES];
vp9_model_to_full_probs(p[i][j][k][l], i, j, probs);
vp9_cost_tokens_skip((int *)c[i][j][k][l], probs,
vp9_coef_tree);
-#else
- vp9_cost_tokens_skip((int *)c[i][j][k][l], p[i][j][k][l],
- vp9_coef_tree);
-#endif
}
}
@@ -280,11 +271,7 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
TX_TYPE tx_type = DCT_DCT;
const int segment_id = xd->mode_info_context->mbmi.segment_id;
-#if CONFIG_MODELCOEFPROB
vp9_prob coef_probs[COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES];
-#else
- vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][ENTROPY_NODES];
-#endif
int seg_eob, default_eob;
uint8_t token_cache[1024];
const uint8_t * band_translate;
@@ -304,12 +291,8 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
get_tx_type_4x4(xd, block) : DCT_DCT;
above_ec = A[0] != 0;
left_ec = L[0] != 0;
-#if CONFIG_MODELCOEFPROB
vp9_model_to_full_probs_sb(cm->fc.coef_probs_4x4[type][ref],
type, ref, coef_probs);
-#else
- coef_probs = cm->fc.coef_probs_4x4[type][ref];
-#endif
seg_eob = 16;
scan = get_scan_4x4(tx_type);
band_translate = vp9_coefband_trans_4x4;
@@ -324,12 +307,8 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
above_ec = (A[0] + A[1]) != 0;
left_ec = (L[0] + L[1]) != 0;
scan = get_scan_8x8(tx_type);
-#if CONFIG_MODELCOEFPROB
vp9_model_to_full_probs_sb(cm->fc.coef_probs_8x8[type][ref],
type, ref, coef_probs);
-#else
- coef_probs = cm->fc.coef_probs_8x8[type][ref];
-#endif
seg_eob = 64;
band_translate = vp9_coefband_trans_8x8plus;
break;
@@ -341,12 +320,8 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
TX_TYPE tx_type = (type == PLANE_TYPE_Y_WITH_DC) ?
get_tx_type_16x16(xd, y + (x >> 2)) : DCT_DCT;
scan = get_scan_16x16(tx_type);
-#if CONFIG_MODELCOEFPROB
vp9_model_to_full_probs_sb(cm->fc.coef_probs_16x16[type][ref],
type, ref, coef_probs);
-#else
- coef_probs = cm->fc.coef_probs_16x16[type][ref];
-#endif
seg_eob = 256;
above_ec = (A[0] + A[1] + A[2] + A[3]) != 0;
left_ec = (L[0] + L[1] + L[2] + L[3]) != 0;
@@ -355,12 +330,8 @@ static INLINE int cost_coeffs(VP9_COMMON *const cm, MACROBLOCK *mb,
}
case TX_32X32:
scan = vp9_default_zig_zag1d_32x32;
-#if CONFIG_MODELCOEFPROB
vp9_model_to_full_probs_sb(cm->fc.coef_probs_32x32[type][ref],
type, ref, coef_probs);
-#else
- coef_probs = cm->fc.coef_probs_32x32[type][ref];
-#endif
seg_eob = 1024;
above_ec = (A[0] + A[1] + A[2] + A[3] + A[4] + A[5] + A[6] + A[7]) != 0;
left_ec = (L[0] + L[1] + L[2] + L[3] + L[4] + L[5] + L[6] + L[7]) != 0;
@@ -1912,6 +1883,10 @@ static void setup_pred_block(const MACROBLOCKD *xd,
dst[1].buf = src->u_buffer;
dst[2].buf = src->v_buffer;
dst[1].stride = dst[2].stride = src->uv_stride;
+#if CONFIG_ALPHA
+ dst[3].buf = src->alpha_buffer;
+ dst[3].stride = src->alpha_stride;
+#endif
// TODO(jkoleszar): Make scale factors per-plane data
for (i = 0; i < MAX_MB_PLANE; i++) {
diff --git a/vp9/encoder/vp9_temporal_filter.c b/vp9/encoder/vp9_temporal_filter.c
index 30143d77d..47792fcc2 100644
--- a/vp9/encoder/vp9_temporal_filter.c
+++ b/vp9/encoder/vp9_temporal_filter.c
@@ -205,9 +205,11 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
DECLARE_ALIGNED_ARRAY(16, uint8_t, predictor, 16 * 16 + 8 * 8 + 8 * 8);
// Save input state
- uint8_t *y_buffer = mbd->plane[0].pre[0].buf;
- uint8_t *u_buffer = mbd->plane[1].pre[0].buf;
- uint8_t *v_buffer = mbd->plane[2].pre[0].buf;
+ uint8_t* input_buffer[MAX_MB_PLANE];
+ int i;
+
+ for (i = 0; i < MAX_MB_PLANE; i++)
+ input_buffer[i] = mbd->plane[i].pre[0].buf;
for (mb_row = 0; mb_row < mb_rows; mb_row++) {
#if ALT_REF_MC_ENABLED
@@ -352,9 +354,8 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
}
// Restore input state
- mbd->plane[0].pre[0].buf = y_buffer;
- mbd->plane[1].pre[0].buf = u_buffer;
- mbd->plane[2].pre[0].buf = v_buffer;
+ for (i = 0; i < MAX_MB_PLANE; i++)
+ mbd->plane[i].pre[0].buf = input_buffer[i];
}
void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance) {
diff --git a/vp9/encoder/vp9_tokenize.c b/vp9/encoder/vp9_tokenize.c
index 9ed16ffc3..87bde289b 100644
--- a/vp9/encoder/vp9_tokenize.c
+++ b/vp9/encoder/vp9_tokenize.c
@@ -136,11 +136,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
const int segment_id = mbmi->segment_id;
const int *scan, *nb;
vp9_coeff_count *counts;
-#if CONFIG_MODELCOEFPROB
vp9_coeff_probs_model *coef_probs;
-#else
- vp9_coeff_probs *coef_probs;
-#endif
const int ref = mbmi->ref_frame != INTRA_FRAME;
ENTROPY_CONTEXT above_ec, left_ec;
uint8_t token_cache[1024];
@@ -228,10 +224,8 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE_TYPE bsize,
t->token = token;
t->context_tree = coef_probs[type][ref][band][pt];
-#if CONFIG_MODELCOEFPROB
t->block_type = type;
t->ref_type = ref;
-#endif
t->skip_eob_node = (c > 0) && (token_cache[scan[c - 1]] == 0);
assert(vp9_coef_encodings[t->token].len - t->skip_eob_node > 0);
diff --git a/vp9/encoder/vp9_tokenize.h b/vp9/encoder/vp9_tokenize.h
index 2a56da8d1..3332dad1c 100644
--- a/vp9/encoder/vp9_tokenize.h
+++ b/vp9/encoder/vp9_tokenize.h
@@ -26,10 +26,8 @@ typedef struct {
int16_t extra;
uint8_t token;
uint8_t skip_eob_node;
-#if CONFIG_MODELCOEFPROB
uint8_t block_type;
uint8_t ref_type;
-#endif
} TOKENEXTRA;
typedef int64_t vp9_coeff_accum[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
diff --git a/vp9/vp9_iface_common.h b/vp9/vp9_iface_common.h
index 84b4d398b..1c3cc62d2 100644
--- a/vp9/vp9_iface_common.h
+++ b/vp9/vp9_iface_common.h
@@ -76,6 +76,13 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2;
yv12->clrtype = REG_YUV;
+#if CONFIG_ALPHA
+ // For development purposes, force alpha to hold the same data a Y for now.
+ yv12->alpha_buffer = yv12->y_buffer;
+ yv12->alpha_width = yv12->y_width;
+ yv12->alpha_height = yv12->y_height;
+ yv12->alpha_stride = yv12->y_stride;
+#endif
return VPX_CODEC_OK;
}