From 0f7a66e962027609bda58ffdae966713a88a216d Mon Sep 17 00:00:00 2001
From: John Koleszar <jkoleszar@google.com>
Date: Fri, 14 Jun 2013 15:12:31 -0700
Subject: [PATCH] Remove constant vp9_coef_update_prob table

All elements of this table are equal to 252, so replace it with a
single constant VP9_COEF_UPDATE_PROB.

Change-Id: I1e2d1d284326ce6df9899a740c2fc344b3ec81c9
---
 vp9/common/vp9_coefupdateprobs.h | 21 ---------------------
 vp9/common/vp9_entropy.c         |  1 -
 vp9/common/vp9_entropy.h         |  2 +-
 vp9/decoder/vp9_decodframe.c     |  2 +-
 vp9/encoder/vp9_bitstream.c      |  4 ++--
 vp9/vp9_common.mk                |  1 -
 6 files changed, 4 insertions(+), 27 deletions(-)
 delete mode 100644 vp9/common/vp9_coefupdateprobs.h

diff --git a/vp9/common/vp9_coefupdateprobs.h b/vp9/common/vp9_coefupdateprobs.h
deleted file mode 100644
index e86200802d..0000000000
--- a/vp9/common/vp9_coefupdateprobs.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef VP9_COMMON_VP9_COEFUPDATEPROBS_H_
-#define VP9_COMMON_VP9_COEFUPDATEPROBS_H_
-
-/* 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[UNCONSTRAINED_NODES] = {
-  252, 252, 252,
-};
-
-#endif  // VP9_COMMON_VP9_COEFUPDATEPROBS_H__
diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c
index 7b5273b0f6..080867e7a4 100644
--- a/vp9/common/vp9_entropy.c
+++ b/vp9/common/vp9_entropy.c
@@ -14,7 +14,6 @@
 #include "vp9/common/vp9_entropymode.h"
 #include "vpx_mem/vpx_mem.h"
 #include "vpx/vpx_integer.h"
-#include "vp9/common/vp9_coefupdateprobs.h"
 
 DECLARE_ALIGNED(16, const uint8_t, vp9_norm[256]) = {
   0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h
index 27e3bec5ae..7f2bf3d6e8 100644
--- a/vp9/common/vp9_entropy.h
+++ b/vp9/common/vp9_entropy.h
@@ -220,6 +220,6 @@ static INLINE const int* get_scan_16x16(TX_TYPE tx_type) {
   }
 }
 
-#include "vp9/common/vp9_coefupdateprobs.h"
+enum { VP9_COEF_UPDATE_PROB = 252 };
 
 #endif  // VP9_COMMON_VP9_ENTROPY_H_
diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c
index 1342b31f8c..5fda068acb 100644
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -575,7 +575,7 @@ static void read_coef_probs_common(FRAME_CONTEXT *fc, TX_SIZE tx_size,
             for (m = mstart; m < entropy_nodes_update; m++) {
               vp9_prob *const p = coef_probs[i][j][k][l] + m;
 
-              if (vp9_read(r, vp9_coef_update_prob[m])) {
+              if (vp9_read(r, VP9_COEF_UPDATE_PROB)) {
                 *p = vp9_read_prob_diff_update(r, *p);
               }
             }
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index fafe4a46b8..e18394b1e7 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -1089,7 +1089,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
           for (t = tstart; t < entropy_nodes_update; ++t) {
             vp9_prob newp = new_frame_coef_probs[i][j][k][l][t];
             const vp9_prob oldp = old_frame_coef_probs[i][j][k][l][t];
-            const vp9_prob upd = vp9_coef_update_prob[t];
+            const vp9_prob upd = VP9_COEF_UPDATE_PROB;
             int s;
             int u = 0;
 
@@ -1131,7 +1131,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
           for (t = tstart; t < entropy_nodes_update; ++t) {
             vp9_prob newp = new_frame_coef_probs[i][j][k][l][t];
             vp9_prob *oldp = old_frame_coef_probs[i][j][k][l] + t;
-            const vp9_prob upd = vp9_coef_update_prob[t];
+            const vp9_prob upd = VP9_COEF_UPDATE_PROB;
             int s;
             int u = 0;
             if (l >= 3 && k == 0)
diff --git a/vp9/vp9_common.mk b/vp9/vp9_common.mk
index 88e10da04f..b6d50f8efb 100644
--- a/vp9/vp9_common.mk
+++ b/vp9/vp9_common.mk
@@ -15,7 +15,6 @@ VP9_COMMON_SRCS-yes += common/vp9_ppflags.h
 VP9_COMMON_SRCS-yes += common/vp9_onyx.h
 VP9_COMMON_SRCS-yes += common/vp9_alloccommon.c
 VP9_COMMON_SRCS-yes += common/vp9_asm_com_offsets.c
-VP9_COMMON_SRCS-yes += common/vp9_coefupdateprobs.h
 VP9_COMMON_SRCS-yes += common/vp9_convolve.c
 VP9_COMMON_SRCS-yes += common/vp9_convolve.h
 VP9_COMMON_SRCS-yes += common/vp9_debugmodes.c
-- 
GitLab