summaryrefslogtreecommitdiff
path: root/vp9/common
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2013-05-30 20:58:19 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2013-05-30 20:58:19 -0700
commit310bc1030afa740dd1196a995b7031d172ce13bd (patch)
tree4f16edf334c994576e4349d17b4b5bede54359ae /vp9/common
parent7d549870f7c2390d57af98d5bd6d4b0e2e32793b (diff)
parenta433abbcad40ea2498bc3418f2ee8090e1b42ffb (diff)
downloadlibvpx-310bc1030afa740dd1196a995b7031d172ce13bd.tar
libvpx-310bc1030afa740dd1196a995b7031d172ce13bd.tar.gz
libvpx-310bc1030afa740dd1196a995b7031d172ce13bd.tar.bz2
libvpx-310bc1030afa740dd1196a995b7031d172ce13bd.zip
Merge "Merge VP9_YMODES, VP9_UV_MODES, INTRA_MODE_COUNT and cousins." into experimental
Diffstat (limited to 'vp9/common')
-rw-r--r--vp9/common/vp9_blockd.h8
-rw-r--r--vp9/common/vp9_entropymode.c30
-rw-r--r--vp9/common/vp9_entropymode.h8
-rw-r--r--vp9/common/vp9_modecontext.c6
-rw-r--r--vp9/common/vp9_onyxc_int.h22
-rw-r--r--vp9/common/vp9_postproc.c2
6 files changed, 36 insertions, 40 deletions
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h
index 4456fd983..07628324d 100644
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -89,8 +89,6 @@ static INLINE int is_inter_mode(MB_PREDICTION_MODE mode) {
return mode >= NEARESTMV && mode <= NEWMV;
}
-#define INTRA_MODE_COUNT (TM_PRED + 1)
-
// Segment level features.
typedef enum {
SEG_LVL_ALT_Q = 0, // Use alternate Quantizer ....
@@ -116,16 +114,12 @@ typedef enum {
ADST_ADST = 3 // ADST in both directions
} TX_TYPE;
-#define VP9_YMODES (TM_PRED + 1)
-#define VP9_UV_MODES (TM_PRED + 1)
-#define VP9_I32X32_MODES (TM_PRED + 1)
+#define VP9_INTRA_MODES (TM_PRED + 1)
#define VP9_MVREFS (1 + NEWMV - NEARESTMV)
#define WHT_UPSCALE_FACTOR 2
-#define VP9_BINTRAMODES INTRA_MODE_COUNT
-
/* For keyframes, intra block modes are predicted by the (already decoded)
modes for the Y blocks to the left and above us; for interframes, there
is a single probability table. */
diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c
index e12710913..c823bf4c9 100644
--- a/vp9/common/vp9_entropymode.c
+++ b/vp9/common/vp9_entropymode.c
@@ -15,12 +15,12 @@
#include "vp9/common/vp9_alloccommon.h"
#include "vpx_mem/vpx_mem.h"
-static const unsigned int y_mode_cts[VP9_BINTRAMODES] = {
+static const unsigned int y_mode_cts[VP9_INTRA_MODES] = {
/* DC V H D45 D135 D117 D153 D27 D63 TM */
98, 19, 15, 14, 14, 14, 14, 12, 12, 13,
};
-static const unsigned int uv_mode_cts[VP9_YMODES][VP9_UV_MODES] = {
+static const unsigned int uv_mode_cts[VP9_INTRA_MODES][VP9_INTRA_MODES] = {
/* DC V H D45 135 117 153 D27 D63 TM */
{ 200, 15, 15, 10, 10, 10, 10, 10, 10, 6}, /* DC */
{ 130, 75, 10, 10, 10, 10, 10, 10, 10, 6}, /* V */
@@ -34,7 +34,7 @@ static const unsigned int uv_mode_cts[VP9_YMODES][VP9_UV_MODES] = {
{ 160, 30, 30, 10, 10, 10, 10, 10, 10, 16}, /* TM */
};
-static const unsigned int kf_uv_mode_cts[VP9_YMODES][VP9_UV_MODES] = {
+static const unsigned int kf_uv_mode_cts[VP9_INTRA_MODES][VP9_INTRA_MODES] = {
// DC V H D45 135 117 153 D27 D63 TM
{ 160, 24, 24, 20, 20, 20, 20, 20, 20, 8}, /* DC */
{ 102, 64, 30, 20, 20, 20, 20, 20, 20, 10}, /* V */
@@ -70,7 +70,7 @@ const vp9_prob vp9_partition_probs[NUM_PARTITION_CONTEXTS]
};
/* Array indices are identical to previously-existing INTRAMODECONTEXTNODES. */
-const vp9_tree_index vp9_intra_mode_tree[VP9_BINTRAMODES * 2 - 2] = {
+const vp9_tree_index vp9_intra_mode_tree[VP9_INTRA_MODES * 2 - 2] = {
-DC_PRED, 2, /* 0 = DC_NODE */
-TM_PRED, 4, /* 1 = TM_NODE */
-V_PRED, 6, /* 2 = V_NODE */
@@ -94,20 +94,20 @@ const vp9_tree_index vp9_partition_tree[6] = {
-PARTITION_VERT, -PARTITION_SPLIT
};
-struct vp9_token vp9_intra_mode_encodings[VP9_BINTRAMODES];
+struct vp9_token vp9_intra_mode_encodings[VP9_INTRA_MODES];
struct vp9_token vp9_sb_mv_ref_encoding_array[VP9_MVREFS];
struct vp9_token vp9_partition_encodings[PARTITION_TYPES];
void vp9_init_mbmode_probs(VP9_COMMON *x) {
- unsigned int bct[VP9_YMODES][2]; // num Ymodes > num UV modes
+ unsigned int bct[VP9_INTRA_MODES][2]; // num Ymodes > num UV modes
int i;
vp9_tree_probs_from_distribution(vp9_intra_mode_tree, x->fc.y_mode_prob,
bct, y_mode_cts, 0);
- for (i = 0; i < VP9_YMODES; i++) {
+ for (i = 0; i < VP9_INTRA_MODES; i++) {
vp9_tree_probs_from_distribution(vp9_intra_mode_tree, x->kf_uv_mode_prob[i],
bct, kf_uv_mode_cts[i], 0);
vp9_tree_probs_from_distribution(vp9_intra_mode_tree, x->fc.uv_mode_prob[i],
@@ -247,15 +247,15 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
int t;
printf("static const unsigned int\nymode_counts"
- "[VP9_YMODES] = {\n");
- for (t = 0; t < VP9_YMODES; ++t)
+ "[VP9_INTRA_MODES] = {\n");
+ for (t = 0; t < VP9_INTRA_MODES; ++t)
printf("%d, ", fc->ymode_counts[t]);
printf("};\n");
printf("static const unsigned int\nuv_mode_counts"
- "[VP9_YMODES] [VP9_UV_MODES] = {\n");
- for (i = 0; i < VP9_YMODES; ++i) {
+ "[VP9_INTRA_MODES] [VP9_INTRA_MODES] = {\n");
+ for (i = 0; i < VP9_INTRA_MODES; ++i) {
printf(" {");
- for (t = 0; t < VP9_UV_MODES; ++t)
+ for (t = 0; t < VP9_INTRA_MODES; ++t)
printf("%d, ", fc->uv_mode_counts[i][t]);
printf("},\n");
}
@@ -277,12 +277,12 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
printf("};\n");
#endif
- update_mode_probs(VP9_YMODES, vp9_intra_mode_tree,
+ update_mode_probs(VP9_INTRA_MODES, vp9_intra_mode_tree,
fc->y_mode_counts, fc->pre_y_mode_prob,
fc->y_mode_prob, 0);
- for (i = 0; i < VP9_YMODES; ++i)
- update_mode_probs(VP9_UV_MODES, vp9_intra_mode_tree,
+ for (i = 0; i < VP9_INTRA_MODES; ++i)
+ update_mode_probs(VP9_INTRA_MODES, vp9_intra_mode_tree,
fc->uv_mode_counts[i], fc->pre_uv_mode_prob[i],
fc->uv_mode_prob[i], 0);
diff --git a/vp9/common/vp9_entropymode.h b/vp9/common/vp9_entropymode.h
index 120c81d4c..b7315603e 100644
--- a/vp9/common/vp9_entropymode.h
+++ b/vp9/common/vp9_entropymode.h
@@ -19,14 +19,14 @@
extern int vp9_mv_cont(const int_mv *l, const int_mv *a);
-extern const vp9_prob vp9_kf_default_bmode_probs[VP9_BINTRAMODES]
- [VP9_BINTRAMODES]
- [VP9_BINTRAMODES -1 ];
+extern const vp9_prob vp9_kf_default_bmode_probs[VP9_INTRA_MODES]
+ [VP9_INTRA_MODES]
+ [VP9_INTRA_MODES -1 ];
extern const vp9_tree_index vp9_intra_mode_tree[];
extern const vp9_tree_index vp9_sb_mv_ref_tree[];
-extern struct vp9_token vp9_intra_mode_encodings[VP9_BINTRAMODES];
+extern struct vp9_token vp9_intra_mode_encodings[VP9_INTRA_MODES];
/* Inter mode values do not start at zero */
diff --git a/vp9/common/vp9_modecontext.c b/vp9/common/vp9_modecontext.c
index 5f084eadc..39d53f57b 100644
--- a/vp9/common/vp9_modecontext.c
+++ b/vp9/common/vp9_modecontext.c
@@ -11,9 +11,9 @@
#include "vp9/common/vp9_entropymode.h"
-const vp9_prob vp9_kf_default_bmode_probs[VP9_BINTRAMODES]
- [VP9_BINTRAMODES]
- [VP9_BINTRAMODES-1] = {
+const vp9_prob vp9_kf_default_bmode_probs[VP9_INTRA_MODES]
+ [VP9_INTRA_MODES]
+ [VP9_INTRA_MODES-1] = {
{ // Above 0
{ 231, 9, 124, 138, 96, 200, 76, 42, 88, }, // left 0
{ 152, 11, 187, 112, 170, 139, 130, 91, 113, }, // left 1
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h
index 4bc296d0a..3800884e0 100644
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -47,17 +47,19 @@ void vp9_initialize_common(void);
#define MAX_LAG_BUFFERS 25
typedef struct frame_contexts {
- vp9_prob y_mode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
- vp9_prob uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
+ vp9_prob y_mode_prob[VP9_INTRA_MODES - 1]; /* interframe intra mode probs */
+ vp9_prob uv_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES - 1];
vp9_prob partition_prob[NUM_PARTITION_CONTEXTS][PARTITION_TYPES - 1];
nmv_context nmvc;
nmv_context pre_nmvc;
- vp9_prob pre_y_mode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */
- vp9_prob pre_uv_mode_prob[VP9_YMODES][VP9_UV_MODES - 1];
+ /* interframe intra mode probs */
+ vp9_prob pre_y_mode_prob[VP9_INTRA_MODES - 1];
+ vp9_prob pre_uv_mode_prob[VP9_INTRA_MODES][VP9_INTRA_MODES - 1];
vp9_prob pre_partition_prob[NUM_PARTITION_CONTEXTS][PARTITION_TYPES - 1];
- unsigned int y_mode_counts[VP9_YMODES]; /* interframe intra mode probs */
- unsigned int uv_mode_counts[VP9_YMODES][VP9_UV_MODES];
+ /* interframe intra mode probs */
+ unsigned int y_mode_counts[VP9_INTRA_MODES];
+ unsigned int uv_mode_counts[VP9_INTRA_MODES][VP9_INTRA_MODES];
unsigned int partition_counts[NUM_PARTITION_CONTEXTS][PARTITION_TYPES];
vp9_coeff_probs_model coef_probs_4x4[BLOCK_TYPES];
@@ -217,10 +219,10 @@ typedef struct VP9Common {
/* keyframe block modes are predicted by their above, left neighbors */
- vp9_prob kf_y_mode_prob[VP9_BINTRAMODES]
- [VP9_BINTRAMODES]
- [VP9_BINTRAMODES - 1];
- vp9_prob kf_uv_mode_prob[VP9_YMODES] [VP9_UV_MODES - 1];
+ vp9_prob kf_y_mode_prob[VP9_INTRA_MODES]
+ [VP9_INTRA_MODES]
+ [VP9_INTRA_MODES - 1];
+ vp9_prob kf_uv_mode_prob[VP9_INTRA_MODES] [VP9_INTRA_MODES - 1];
vp9_prob prob_intra_coded;
vp9_prob prob_last_coded;
diff --git a/vp9/common/vp9_postproc.c b/vp9/common/vp9_postproc.c
index 3aae669bf..4282ddd1c 100644
--- a/vp9/common/vp9_postproc.c
+++ b/vp9/common/vp9_postproc.c
@@ -53,7 +53,7 @@ static const unsigned char MB_PREDICTION_MODE_colors[MB_MODE_COUNT][3] = {
{ RGB_TO_YUV(0xCC33FF) }, /* Magenta */
};
-static const unsigned char B_PREDICTION_MODE_colors[INTRA_MODE_COUNT][3] = {
+static const unsigned char B_PREDICTION_MODE_colors[VP9_INTRA_MODES][3] = {
{ RGB_TO_YUV(0x6633ff) }, /* Purple */
{ RGB_TO_YUV(0xcc33ff) }, /* Magenta */
{ RGB_TO_YUV(0xff33cc) }, /* Pink */