diff options
author | Jingning Han <jingning@google.com> | 2013-03-11 21:51:00 -0700 |
---|---|---|
committer | Jingning Han <jingning@google.com> | 2013-03-13 14:08:27 -0700 |
commit | 76c12ab9c9d08a76f79e6b50af278ebf1e5f49ad (patch) | |
tree | 33004c08b5f4538376f26f0a06e0d6d3f2dc412c /vp9/common | |
parent | bd9cd9a1859aa464b3092f2023b3a4040166572d (diff) | |
download | libvpx-76c12ab9c9d08a76f79e6b50af278ebf1e5f49ad.tar libvpx-76c12ab9c9d08a76f79e6b50af278ebf1e5f49ad.tar.gz libvpx-76c12ab9c9d08a76f79e6b50af278ebf1e5f49ad.tar.bz2 libvpx-76c12ab9c9d08a76f79e6b50af278ebf1e5f49ad.zip |
Support +/-2048 motion vector coding
Enable entropy coding of motion vectors up to +/-2048. Also
extend the motion search range accordingly.
Change-Id: Iac2bb015e8934521cef83a19edbe967d9f097436
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_entropymv.c | 40 | ||||
-rw-r--r-- | vp9/common/vp9_entropymv.h | 3 |
2 files changed, 23 insertions, 20 deletions
diff --git a/vp9/common/vp9_entropymv.c b/vp9/common/vp9_entropymv.c index 9a7be4578..89dea4edc 100644 --- a/vp9/common/vp9_entropymv.c +++ b/vp9/common/vp9_entropymv.c @@ -42,9 +42,10 @@ const vp9_tree_index vp9_mv_class_tree[2 * MV_CLASSES - 2] = { -MV_CLASS_2, -MV_CLASS_3, 10, 12, -MV_CLASS_4, -MV_CLASS_5, - 14, 16, - -MV_CLASS_6, -MV_CLASS_7, - -MV_CLASS_8, -MV_CLASS_9, + -MV_CLASS_6, 14, + 16, 18, + -MV_CLASS_7, -MV_CLASS_8, + -MV_CLASS_9, -MV_CLASS_10, }; struct vp9_token_struct vp9_mv_class_encodings[MV_CLASSES]; @@ -64,24 +65,24 @@ const nmv_context vp9_default_nmv_context = { {32, 64, 96}, { { /* vert component */ - 128, /* sign */ - {224, 144, 192, 168, 192, 176, 192, 198, 198}, /* class */ - {216}, /* class0 */ - {136, 140, 148, 160, 176, 192, 224, 234, 234}, /* bits */ - {{128, 128, 64}, {96, 112, 64}}, /* class0_fp */ - {64, 96, 64}, /* fp */ - 160, /* class0_hp bit */ - 128, /* hp */ + 128, /* sign */ + {224, 144, 192, 168, 192, 176, 192, 198, 198, 245}, /* class */ + {216}, /* class0 */ + {136, 140, 148, 160, 176, 192, 224, 234, 234, 240}, /* bits */ + {{128, 128, 64}, {96, 112, 64}}, /* class0_fp */ + {64, 96, 64}, /* fp */ + 160, /* class0_hp bit */ + 128, /* hp */ }, { /* hor component */ - 128, /* sign */ - {216, 128, 176, 160, 176, 176, 192, 198, 198}, /* class */ - {208}, /* class0 */ - {136, 140, 148, 160, 176, 192, 224, 234, 234}, /* bits */ - {{128, 128, 64}, {96, 112, 64}}, /* class0_fp */ - {64, 96, 64}, /* fp */ - 160, /* class0_hp bit */ - 128, /* hp */ + 128, /* sign */ + {216, 128, 176, 160, 176, 176, 192, 198, 198, 208}, /* class */ + {208}, /* class0 */ + {136, 140, 148, 160, 176, 192, 224, 234, 234, 240}, /* bits */ + {{128, 128, 64}, {96, 112, 64}}, /* class0_fp */ + {64, 96, 64}, /* fp */ + 160, /* class0_hp bit */ + 128, /* hp */ } }, }; @@ -107,6 +108,7 @@ MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset) { else if (z < CLASS0_SIZE * 1024) c = MV_CLASS_7; else if (z < CLASS0_SIZE * 2048) c = MV_CLASS_8; else if (z < CLASS0_SIZE * 4096) c = MV_CLASS_9; + else if (z < CLASS0_SIZE * 8192) c = MV_CLASS_10; else assert(0); if (offset) *offset = z - mv_class_base(c); diff --git a/vp9/common/vp9_entropymv.h b/vp9/common/vp9_entropymv.h index 33500069e..162d2b44f 100644 --- a/vp9/common/vp9_entropymv.h +++ b/vp9/common/vp9_entropymv.h @@ -49,7 +49,7 @@ extern const vp9_tree_index vp9_mv_joint_tree[2 * MV_JOINTS - 2]; extern struct vp9_token_struct vp9_mv_joint_encodings [MV_JOINTS]; /* Symbols for coding magnitude class of nonzero components */ -#define MV_CLASSES 10 +#define MV_CLASSES 11 typedef enum { MV_CLASS_0 = 0, /* (0, 2] integer pel */ MV_CLASS_1 = 1, /* (2, 4] integer pel */ @@ -61,6 +61,7 @@ typedef enum { MV_CLASS_7 = 7, /* (128, 256] integer pel */ MV_CLASS_8 = 8, /* (256, 512] integer pel */ MV_CLASS_9 = 9, /* (512, 1024] integer pel */ + MV_CLASS_10 = 10, /* (1024,2048] integer pel */ } MV_CLASS_TYPE; extern const vp9_tree_index vp9_mv_class_tree[2 * MV_CLASSES - 2]; |