]> granicus.if.org Git - libvpx/commitdiff
Remove one (unused) entry from mvref tables.
authorRonald S. Bultje <rbultje@google.com>
Thu, 30 May 2013 22:26:23 +0000 (15:26 -0700)
committerRonald S. Bultje <rbultje@google.com>
Fri, 31 May 2013 00:21:06 +0000 (17:21 -0700)
Change-Id: Ieb4669ae564bec9f3051485ecdf186cb4e00decb

vp9/common/vp9_entropymode.c
vp9/common/vp9_modecont.c
vp9/common/vp9_modecont.h
vp9/common/vp9_onyxc_int.h
vp9/decoder/vp9_decodframe.c
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_onyx_int.h

index ed763d10eb58848a3aeb89d5f9cc0f2dc3c39bce..e1271091395dd164d7fc94ee285c37977750f36d 100644 (file)
@@ -178,7 +178,7 @@ void vp9_init_mode_contexts(VP9_COMMON *pc) {
 void vp9_accum_mv_refs(VP9_COMMON *pc,
                        MB_PREDICTION_MODE m,
                        const int context) {
-  unsigned int (*mv_ref_ct)[4][2] = pc->fc.mv_ref_ct;
+  unsigned int (*mv_ref_ct)[VP9_MVREFS - 1][2] = pc->fc.mv_ref_ct;
 
   if (m == ZEROMV) {
     ++mv_ref_ct[context][0][0];
@@ -201,8 +201,8 @@ void vp9_accum_mv_refs(VP9_COMMON *pc,
 #define MVREF_MAX_UPDATE_FACTOR 128
 void vp9_adapt_mode_context(VP9_COMMON *pc) {
   int i, j;
-  unsigned int (*mv_ref_ct)[4][2] = pc->fc.mv_ref_ct;
-  int (*mode_context)[4] = pc->fc.vp9_mode_contexts;
+  unsigned int (*mv_ref_ct)[VP9_MVREFS - 1][2] = pc->fc.mv_ref_ct;
+  int (*mode_context)[VP9_MVREFS - 1] = pc->fc.vp9_mode_contexts;
 
   for (j = 0; j < INTER_MODE_CONTEXTS; j++) {
     for (i = 0; i < 4; i++) {
index 86a8fb85013b4431e57ab51d474002802c1b104b..973bb068c9a65a98fa06808035355e602fbe3491 100644 (file)
 
 #include "vp9/common/vp9_entropy.h"
 
-const int vp9_default_mode_contexts[INTER_MODE_CONTEXTS][4] = {
-  {2,       173,   34,   229},  // 0 = both zero mv
-  {7,       145,   85,   225},  // 1 = one zero mv + one a predicted mv
-  {7,       166,   63,   231},  // 2 = two predicted mvs
-  {7,       94,    66,   219},  // 3 = one predicted/zero and one new mv
-  {8,       64,    46,   213},  // 4 = two new mvs
-  {17,      81,    31,   231},  // 5 = one intra neighbour + x
-  {25,      29,    30,   246},  // 6 = two intra neighbours
+const int vp9_default_mode_contexts[INTER_MODE_CONTEXTS][VP9_MVREFS - 1] = {
+  {2,       173,   34},  // 0 = both zero mv
+  {7,       145,   85},  // 1 = one zero mv + one a predicted mv
+  {7,       166,   63},  // 2 = two predicted mvs
+  {7,       94,    66},  // 3 = one predicted/zero and one new mv
+  {8,       64,    46},  // 4 = two new mvs
+  {17,      81,    31},  // 5 = one intra neighbour + x
+  {25,      29,    30},  // 6 = two intra neighbours
 };
index 30deb72d3efa6e1ebc0068aa70a0892972abc371..a6c489325eb6421a566935af7ca22de13556c65c 100644 (file)
@@ -13,6 +13,6 @@
 
 #include "vp9/common/vp9_entropy.h"
 
-extern const int vp9_default_mode_contexts[INTER_MODE_CONTEXTS][4];
+extern const int vp9_default_mode_contexts[INTER_MODE_CONTEXTS][VP9_MVREFS - 1];
 
 #endif  // VP9_COMMON_VP9_MODECONT_H_
index 946c33dd51c2d341de4323acbb140d4aca769aeb..fe5aa01be4d5ca1535f7238793f5d70073d77b35 100644 (file)
@@ -79,8 +79,8 @@ typedef struct frame_contexts {
   vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
                                  [VP9_SWITCHABLE_FILTERS - 1];
 
-  int vp9_mode_contexts[INTER_MODE_CONTEXTS][4];
-  unsigned int mv_ref_ct[INTER_MODE_CONTEXTS][4][2];
+  int vp9_mode_contexts[INTER_MODE_CONTEXTS][VP9_MVREFS - 1];
+  unsigned int mv_ref_ct[INTER_MODE_CONTEXTS][VP9_MVREFS - 1][2];
 } FRAME_CONTEXT;
 
 typedef enum {
index b58204df6d441270c236947f438092a5efb2f085..3800dff14c743edec7eb2ae742fb8a342c490a93 100644 (file)
@@ -1067,7 +1067,7 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
   if (!keyframe) {
     int i, j;
     for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
-      for (j = 0; j < 4; ++j)
+      for (j = 0; j < VP9_MVREFS - 1; ++j)
         if (vp9_read(&header_bc, 252))
           pc->fc.vp9_mode_contexts[i][j] = vp9_read_prob(&header_bc);
   }
index 102ec6f8acd7cf52280d120d6ef02437e1ddddfe..6809bd358e6c4f30633df4ec0ef3bde22276cc53 100644 (file)
@@ -321,15 +321,15 @@ static void update_refpred_stats(VP9_COMP *cpi) {
 // The branch counts table is re-populated during the actual pack stage and in
 // the decoder to facilitate backwards update of the context.
 static void update_inter_mode_probs(VP9_COMMON *cm,
-                                    int mode_context[INTER_MODE_CONTEXTS][4]) {
+    int mode_context[INTER_MODE_CONTEXTS][VP9_MVREFS - 1]) {
   int i, j;
-  unsigned int (*mv_ref_ct)[4][2] = cm->fc.mv_ref_ct;
+  unsigned int (*mv_ref_ct)[VP9_MVREFS - 1][2] = cm->fc.mv_ref_ct;
 
   vpx_memcpy(mode_context, cm->fc.vp9_mode_contexts,
              sizeof(cm->fc.vp9_mode_contexts));
 
   for (i = 0; i < INTER_MODE_CONTEXTS; i++) {
-    for (j = 0; j < 4; j++) {
+    for (j = 0; j < VP9_MVREFS - 1; j++) {
       int new_prob, old_cost, new_cost;
 
       // Work out cost of coding branches with the old and optimal probability
@@ -1637,7 +1637,7 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
   // changes in the bitstream.
   if (pc->frame_type != KEY_FRAME) {
     int i, j;
-    int new_context[INTER_MODE_CONTEXTS][4];
+    int new_context[INTER_MODE_CONTEXTS][VP9_MVREFS - 1];
     if (!cpi->dummy_packing) {
       update_inter_mode_probs(pc, new_context);
     } else {
@@ -1647,7 +1647,7 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
     }
 
     for (i = 0; i < INTER_MODE_CONTEXTS; i++) {
-      for (j = 0; j < 4; j++) {
+      for (j = 0; j < VP9_MVREFS - 1; j++) {
         if (new_context[i][j] != pc->fc.vp9_mode_contexts[i][j]) {
           vp9_write(&header_bc, 1, 252);
           vp9_write_prob(&header_bc, new_context[i][j]);
index a38adaadeed24c6a5569471df1efd07ff5d88806..5dd8fd02be556170937cfa66b1e26ca6aee6c98f 100644 (file)
@@ -537,7 +537,7 @@ void vp9_update_mode_context_stats(VP9_COMP *cpi) {
 
   // Add in the values for this frame
   for (i = 0; i < INTER_MODE_CONTEXTS; i++) {
-    for (j = 0; j < 4; j++) {
+    for (j = 0; j < VP9_MVREFS - 1; j++) {
       mv_ref_stats[i][j][0] += (int64_t)mv_ref_ct[i][j][0];
       mv_ref_stats[i][j][1] += (int64_t)mv_ref_ct[i][j][1];
     }
@@ -554,12 +554,13 @@ void print_mode_context(VP9_COMP *cpi) {
   int i, j;
 
   fprintf(f, "#include \"vp9_entropy.h\"\n");
-  fprintf(f, "const int vp9_mode_contexts[INTER_MODE_CONTEXTS][4] =");
+  fprintf(f,
+          "const int vp9_mode_contexts[INTER_MODE_CONTEXTS][VP9_MVREFS - 1] =");
   fprintf(f, "{\n");
   for (j = 0; j < INTER_MODE_CONTEXTS; j++) {
     fprintf(f, "  {/* %d */ ", j);
     fprintf(f, "    ");
-    for (i = 0; i < 4; i++) {
+    for (i = 0; i < VP9_MVREFS - 1; i++) {
       int this_prob;
       int64_t count = cpi->mv_ref_stats[j][i][0] + cpi->mv_ref_stats[j][i][1];
       if (count)
index da3179aa27588db3f45271699b14caa0f1d52137..cb787866e00328ebc9faf30e5d9cd95fd2bc9460 100644 (file)
@@ -88,8 +88,8 @@ typedef struct {
   vp9_prob switchable_interp_prob[VP9_SWITCHABLE_FILTERS + 1]
                                  [VP9_SWITCHABLE_FILTERS - 1];
 
-  int mv_ref_ct[INTER_MODE_CONTEXTS][4][2];
-  int vp9_mode_contexts[INTER_MODE_CONTEXTS][4];
+  int mv_ref_ct[INTER_MODE_CONTEXTS][VP9_MVREFS - 1][2];
+  int vp9_mode_contexts[INTER_MODE_CONTEXTS][VP9_MVREFS - 1];
 
 } CODING_CONTEXT;
 
@@ -615,7 +615,7 @@ typedef struct VP9_COMP {
 #endif
 
 #ifdef ENTROPY_STATS
-  int64_t mv_ref_stats[INTER_MODE_CONTEXTS][4][2];
+  int64_t mv_ref_stats[INTER_MODE_CONTEXTS][VP9_MVREFS - 1][2];
 #endif
 } VP9_COMP;