summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorJingning Han <jingning@google.com>2013-03-11 21:51:00 -0700
committerJingning Han <jingning@google.com>2013-03-13 14:08:27 -0700
commit76c12ab9c9d08a76f79e6b50af278ebf1e5f49ad (patch)
tree33004c08b5f4538376f26f0a06e0d6d3f2dc412c /vp9
parentbd9cd9a1859aa464b3092f2023b3a4040166572d (diff)
downloadlibvpx-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')
-rw-r--r--vp9/common/vp9_entropymv.c40
-rw-r--r--vp9/common/vp9_entropymv.h3
-rw-r--r--vp9/encoder/vp9_mcomp.h2
3 files changed, 24 insertions, 21 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];
diff --git a/vp9/encoder/vp9_mcomp.h b/vp9/encoder/vp9_mcomp.h
index d5c7032a9..fd1bb2b4e 100644
--- a/vp9/encoder/vp9_mcomp.h
+++ b/vp9/encoder/vp9_mcomp.h
@@ -21,7 +21,7 @@ void print_mode_context(VP9_COMMON *pc);
// The maximum number of steps in a step search given the largest
// allowed initial step
-#define MAX_MVSEARCH_STEPS 10
+#define MAX_MVSEARCH_STEPS 11
// Max full pel mv specified in 1 pel units
#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1)
// Maximum size of the first step in full pel units