diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2013-07-16 00:52:53 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-07-16 00:52:53 -0700 |
commit | e8e7620a1f9330bc4e70de24f02d6f4e87cbf68f (patch) | |
tree | 943f8941f54a06bd6ba60e2ba2e8fda64b444eb2 /vp9/common | |
parent | c5b0cd84059cd1cd6241aedd9c74e76965b58f91 (diff) | |
parent | ca75f1255feb1f9885d84c6b75f9b245f171adaa (diff) | |
download | libvpx-e8e7620a1f9330bc4e70de24f02d6f4e87cbf68f.tar libvpx-e8e7620a1f9330bc4e70de24f02d6f4e87cbf68f.tar.gz libvpx-e8e7620a1f9330bc4e70de24f02d6f4e87cbf68f.tar.bz2 libvpx-e8e7620a1f9330bc4e70de24f02d6f4e87cbf68f.zip |
Merge "Removing and moving around constant definitions."
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_blockd.h | 6 | ||||
-rw-r--r-- | vp9/common/vp9_entropy.c | 7 | ||||
-rw-r--r-- | vp9/common/vp9_entropy.h | 5 | ||||
-rw-r--r-- | vp9/common/vp9_idct.h | 2 | ||||
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 9 |
5 files changed, 12 insertions, 17 deletions
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index 5d3d8f1a2..2ca9898c5 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -87,6 +87,10 @@ typedef enum { MB_MODE_COUNT } MB_PREDICTION_MODE; +static INLINE int is_intra_mode(MB_PREDICTION_MODE mode) { + return mode <= TM_PRED; +} + static INLINE int is_inter_mode(MB_PREDICTION_MODE mode) { return mode >= NEARESTMV && mode <= NEWMV; } @@ -95,8 +99,6 @@ static INLINE int is_inter_mode(MB_PREDICTION_MODE mode) { #define VP9_INTER_MODES (1 + NEWMV - NEARESTMV) -#define WHT_UPSCALE_FACTOR 2 - /* 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_entropy.c b/vp9/common/vp9_entropy.c index f5d5c1aee..5e8af6c91 100644 --- a/vp9/common/vp9_entropy.c +++ b/vp9/common/vp9_entropy.c @@ -15,6 +15,8 @@ #include "vpx_mem/vpx_mem.h" #include "vpx/vpx_integer.h" +#define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES) + 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, @@ -252,7 +254,7 @@ const vp9_tree_index vp9_coefmodel_tree[6] = { // the probabilities for the rest of the nodes. // beta = 8 -const vp9_prob vp9_modelcoefprobs_pareto8[COEFPROB_MODELS][MODEL_NODES] = { +static const vp9_prob modelcoefprobs_pareto8[COEFPROB_MODELS][MODEL_NODES] = { { 3, 86, 128, 6, 86, 23, 88, 29}, { 9, 86, 129, 17, 88, 61, 94, 76}, { 15, 87, 129, 28, 89, 93, 100, 110}, @@ -386,8 +388,7 @@ const vp9_prob vp9_modelcoefprobs_pareto8[COEFPROB_MODELS][MODEL_NODES] = { static void extend_model_to_full_distribution(vp9_prob p, vp9_prob *tree_probs) { const int l = ((p - 1) / 2); - const vp9_prob (*model)[MODEL_NODES]; - model = vp9_modelcoefprobs_pareto8; + const vp9_prob (*model)[MODEL_NODES] = modelcoefprobs_pareto8; if (p & 1) { vpx_memcpy(tree_probs + UNCONSTRAINED_NODES, model[l], MODEL_NODES * sizeof(vp9_prob)); diff --git a/vp9/common/vp9_entropy.h b/vp9/common/vp9_entropy.h index 68c36eaef..1da846dce 100644 --- a/vp9/common/vp9_entropy.h +++ b/vp9/common/vp9_entropy.h @@ -52,8 +52,6 @@ typedef struct { extern vp9_extra_bit vp9_extra_bits[12]; /* indexed by token value */ -#define PROB_UPDATE_BASELINE_COST 7 - #define MAX_PROB 255 #define DCT_MAX_VALUE 16384 @@ -183,7 +181,6 @@ const int16_t *vp9_get_coef_neighbors_handle(const int16_t *scan); #define COEFPROB_MODELS 128 #define UNCONSTRAINED_NODES 3 -#define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES) #define PIVOT_NODE 2 // which node is pivot @@ -200,8 +197,6 @@ typedef unsigned int vp9_coeff_stats_model[REF_TYPES][COEF_BANDS] void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full); -extern const vp9_prob vp9_modelcoefprobs[COEFPROB_MODELS][ENTROPY_NODES - 1]; - static INLINE const int16_t* get_scan_4x4(TX_TYPE tx_type) { switch (tx_type) { case ADST_DCT: diff --git a/vp9/common/vp9_idct.h b/vp9/common/vp9_idct.h index 279b580a3..2d959f0ea 100644 --- a/vp9/common/vp9_idct.h +++ b/vp9/common/vp9_idct.h @@ -22,6 +22,8 @@ #define DCT_CONST_BITS 14 #define DCT_CONST_ROUNDING (1 << (DCT_CONST_BITS - 1)) +#define WHT_UPSCALE_FACTOR 2 + #define pair_set_epi16(a, b) \ _mm_set1_epi32(((uint16_t)(a)) + (((uint16_t)(b)) << 16)) diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 46fcb2f2c..ad4471af5 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -24,13 +24,10 @@ #include "vp9/common/vp9_postproc.h" #endif -/* Create/destroy static data structures. */ +#define ALLOWED_REFS_PER_FRAME 3 -// Define the number of candidate reference buffers. -#define NUM_REF_FRAMES 8 #define NUM_REF_FRAMES_LOG2 3 - -#define ALLOWED_REFS_PER_FRAME 3 +#define NUM_REF_FRAMES (1 << NUM_REF_FRAMES_LOG2) // 1 scratch frame for the new frame, 3 for scaled references on the encoder // TODO(jkoleszar): These 3 extra references could probably come from the @@ -40,8 +37,6 @@ #define NUM_FRAME_CONTEXTS_LOG2 2 #define NUM_FRAME_CONTEXTS (1 << NUM_FRAME_CONTEXTS_LOG2) -#define MAX_LAG_BUFFERS 25 - typedef struct frame_contexts { // y_mode, uv_mode, partition vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][VP9_INTRA_MODES - 1]; |