summaryrefslogtreecommitdiff
path: root/vp9/common
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/common')
-rw-r--r--vp9/common/vp9_alloccommon.c2
-rw-r--r--vp9/common/vp9_blockd.h10
-rw-r--r--vp9/common/vp9_convolve.c38
-rw-r--r--vp9/common/vp9_entropymode.c6
-rw-r--r--vp9/common/vp9_entropymv.c16
-rw-r--r--vp9/common/vp9_entropymv.h2
-rw-r--r--vp9/common/vp9_findnearmv.h8
-rw-r--r--vp9/common/vp9_onyxc_int.h6
-rw-r--r--vp9/common/x86/vp9_asm_stubs.c12
-rw-r--r--vp9/common/x86/vp9_subpixel_8t_ssse3.asm16
10 files changed, 58 insertions, 58 deletions
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c
index 0628a88b7..e142362b2 100644
--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -85,7 +85,7 @@ int vp9_alloc_frame_buffers(VP9_COMMON *oci, int width, int height) {
oci->new_fb_idx = NUM_YV12_BUFFERS - 1;
oci->fb_idx_ref_cnt[oci->new_fb_idx] = 1;
- for (i = 0; i < 3; i++)
+ for (i = 0; i < ALLOWED_REFS_PER_FRAME; i++)
oci->active_ref_idx[i] = i;
for (i = 0; i < NUM_REF_FRAMES; i++) {
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h
index 9525a0e14..7eb9f8e86 100644
--- a/vp9/common/vp9_blockd.h
+++ b/vp9/common/vp9_blockd.h
@@ -26,6 +26,10 @@
#define MB_FEATURE_TREE_PROBS 3
#define PREDICTION_PROBS 3
+#define DEFAULT_PRED_PROB_0 120
+#define DEFAULT_PRED_PROB_1 80
+#define DEFAULT_PRED_PROB_2 40
+
#define MBSKIP_CONTEXTS 3
#define MAX_MB_SEGMENTS 4
@@ -51,8 +55,10 @@ typedef struct {
ENTROPY_CONTEXT v[2];
} ENTROPY_CONTEXT_PLANES;
-#define VP9_COMBINEENTROPYCONTEXTS(Dest, A, B) \
- Dest = ((A)!=0) + ((B)!=0);
+static INLINE int combine_entropy_contexts(ENTROPY_CONTEXT a,
+ ENTROPY_CONTEXT b) {
+ return (a != 0) + (b != 0);
+}
typedef enum {
KEY_FRAME = 0,
diff --git a/vp9/common/vp9_convolve.c b/vp9/common/vp9_convolve.c
index 3ab8bec7a..a27ca6f5d 100644
--- a/vp9/common/vp9_convolve.c
+++ b/vp9/common/vp9_convolve.c
@@ -331,14 +331,14 @@ static void convolve_c(const uint8_t *src, int src_stride,
const int16_t *filter_y, int y_step_q4,
int w, int h, int taps) {
/* Fixed size intermediate buffer places limits on parameters.
- * Maximum intermediate_height is 39, for y_step_q4 == 32,
- * h == 16, taps == 8.
+ * Maximum intermediate_height is 135, for y_step_q4 == 32,
+ * h == 64, taps == 8.
*/
- uint8_t temp[16 * 39];
+ uint8_t temp[64 * 135];
int intermediate_height = ((h * y_step_q4) >> 4) + taps - 1;
- assert(w <= 16);
- assert(h <= 16);
+ assert(w <= 64);
+ assert(h <= 64);
assert(taps <= 8);
assert(y_step_q4 <= 32);
@@ -346,10 +346,10 @@ static void convolve_c(const uint8_t *src, int src_stride,
intermediate_height = h;
convolve_horiz_c(src - src_stride * (taps / 2 - 1), src_stride,
- temp, 16,
+ temp, 64,
filter_x, x_step_q4, filter_y, y_step_q4,
w, intermediate_height, taps);
- convolve_vert_c(temp + 16 * (taps / 2 - 1), 16, dst, dst_stride,
+ convolve_vert_c(temp + 64 * (taps / 2 - 1), 64, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, taps);
}
@@ -360,14 +360,14 @@ static void convolve_avg_c(const uint8_t *src, int src_stride,
const int16_t *filter_y, int y_step_q4,
int w, int h, int taps) {
/* Fixed size intermediate buffer places limits on parameters.
- * Maximum intermediate_height is 39, for y_step_q4 == 32,
- * h == 16, taps == 8.
+ * Maximum intermediate_height is 135, for y_step_q4 == 32,
+ * h == 64, taps == 8.
*/
- uint8_t temp[16 * 39];
+ uint8_t temp[64 * 135];
int intermediate_height = ((h * y_step_q4) >> 4) + taps - 1;
- assert(w <= 16);
- assert(h <= 16);
+ assert(w <= 64);
+ assert(h <= 64);
assert(taps <= 8);
assert(y_step_q4 <= 32);
@@ -375,10 +375,10 @@ static void convolve_avg_c(const uint8_t *src, int src_stride,
intermediate_height = h;
convolve_horiz_c(src - src_stride * (taps / 2 - 1), src_stride,
- temp, 16,
+ temp, 64,
filter_x, x_step_q4, filter_y, y_step_q4,
w, intermediate_height, taps);
- convolve_avg_vert_c(temp + 16 * (taps / 2 - 1), 16, dst, dst_stride,
+ convolve_avg_vert_c(temp + 64 * (taps / 2 - 1), 64, dst, dst_stride,
filter_x, x_step_q4, filter_y, y_step_q4,
w, h, taps);
}
@@ -563,16 +563,16 @@ void vp9_convolve8_avg_c(const uint8_t *src, int src_stride,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
/* Fixed size intermediate buffer places limits on parameters. */
- DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 16 * 16);
- assert(w <= 16);
- assert(h <= 16);
+ DECLARE_ALIGNED_ARRAY(16, uint8_t, temp, 64 * 64);
+ assert(w <= 64);
+ assert(h <= 64);
vp9_convolve8(src, src_stride,
- temp, 16,
+ temp, 64,
filter_x, x_step_q4,
filter_y, y_step_q4,
w, h);
- vp9_convolve_avg(temp, 16,
+ vp9_convolve_avg(temp, 64,
dst, dst_stride,
NULL, 0, /* These unused parameter should be removed! */
NULL, 0, /* These unused parameter should be removed! */
diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c
index 865034913..0db2de6ee 100644
--- a/vp9/common/vp9_entropymode.c
+++ b/vp9/common/vp9_entropymode.c
@@ -364,9 +364,9 @@ void vp9_init_mbmode_probs(VP9_COMMON *x) {
#if CONFIG_COMP_INTERINTRA_PRED
x->fc.interintra_prob = VP9_DEF_INTERINTRA_PROB;
#endif
- x->ref_pred_probs[0] = 120;
- x->ref_pred_probs[1] = 80;
- x->ref_pred_probs[2] = 40;
+ x->ref_pred_probs[0] = DEFAULT_PRED_PROB_0;
+ x->ref_pred_probs[1] = DEFAULT_PRED_PROB_1;
+ x->ref_pred_probs[2] = DEFAULT_PRED_PROB_2;
}
diff --git a/vp9/common/vp9_entropymv.c b/vp9/common/vp9_entropymv.c
index fe3667725..0a81015cb 100644
--- a/vp9/common/vp9_entropymv.c
+++ b/vp9/common/vp9_entropymv.c
@@ -87,12 +87,12 @@ const nmv_context vp9_default_nmv_context = {
},
};
-MV_JOINT_TYPE vp9_get_mv_joint(MV mv) {
- if (mv.row == 0 && mv.col == 0)
+MV_JOINT_TYPE vp9_get_mv_joint(const MV *mv) {
+ if (mv->row == 0 && mv->col == 0)
return MV_JOINT_ZERO;
- else if (mv.row == 0 && mv.col != 0)
+ else if (mv->row == 0 && mv->col != 0)
return MV_JOINT_HNZVZ;
- else if (mv.row != 0 && mv.col == 0)
+ else if (mv->row != 0 && mv->col == 0)
return MV_JOINT_HZVNZ;
else
return MV_JOINT_HNZVNZ;
@@ -209,13 +209,13 @@ static void counts_to_context(nmv_component_counts *mvcomp, int usehp) {
void vp9_increment_nmv(const MV *mv, const MV *ref, nmv_context_counts *mvctx,
int usehp) {
- const MV_JOINT_TYPE type = vp9_get_mv_joint(*mv);
- mvctx->joints[type]++;
+ const MV_JOINT_TYPE j = vp9_get_mv_joint(mv);
+ mvctx->joints[j]++;
usehp = usehp && vp9_use_nmv_hp(ref);
- if (mv_joint_vertical(type))
+ if (mv_joint_vertical(j))
increment_nmv_component_count(mv->row, &mvctx->comps[0], 1, usehp);
- if (mv_joint_horizontal(type))
+ if (mv_joint_horizontal(j))
increment_nmv_component_count(mv->col, &mvctx->comps[1], 1, usehp);
}
diff --git a/vp9/common/vp9_entropymv.h b/vp9/common/vp9_entropymv.h
index 715b5bb2b..de1bd4383 100644
--- a/vp9/common/vp9_entropymv.h
+++ b/vp9/common/vp9_entropymv.h
@@ -105,7 +105,7 @@ typedef struct {
nmv_component comps[2];
} nmv_context;
-MV_JOINT_TYPE vp9_get_mv_joint(MV mv);
+MV_JOINT_TYPE vp9_get_mv_joint(const MV *mv);
MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset);
int vp9_get_mv_mag(MV_CLASS_TYPE c, int offset);
diff --git a/vp9/common/vp9_findnearmv.h b/vp9/common/vp9_findnearmv.h
index 72b6128c1..a31893b27 100644
--- a/vp9/common/vp9_findnearmv.h
+++ b/vp9/common/vp9_findnearmv.h
@@ -74,11 +74,9 @@ static int clamp_mv2(int_mv *mv, const MACROBLOCKD *xd) {
return mv_clampped;
}
-static unsigned int check_mv_bounds(int_mv *mv,
- int mb_to_left_edge,
- int mb_to_right_edge,
- int mb_to_top_edge,
- int mb_to_bottom_edge) {
+static int check_mv_bounds(int_mv *mv,
+ int mb_to_left_edge, int mb_to_right_edge,
+ int mb_to_top_edge, int mb_to_bottom_edge) {
return mv->as_mv.col < mb_to_left_edge ||
mv->as_mv.col > mb_to_right_edge ||
mv->as_mv.row < mb_to_top_edge ||
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h
index 66698f71a..13ec8657f 100644
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -231,9 +231,9 @@ typedef struct VP9Common {
int base_qindex;
int last_kf_gf_q; /* Q used on the last GF or KF */
- int y1dc_delta_q;
- int uvdc_delta_q;
- int uvac_delta_q;
+ int y_dc_delta_q;
+ int uv_dc_delta_q;
+ int uv_ac_delta_q;
unsigned int frames_since_golden;
unsigned int frames_till_alt_ref_frame;
diff --git a/vp9/common/x86/vp9_asm_stubs.c b/vp9/common/x86/vp9_asm_stubs.c
index 6d3bb021a..310f8ed24 100644
--- a/vp9/common/x86/vp9_asm_stubs.c
+++ b/vp9/common/x86/vp9_asm_stubs.c
@@ -278,11 +278,9 @@ void vp9_convolve8_ssse3(const uint8_t *src, int src_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
- DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 16*23);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 16*71);
- // check w/h due to fixed size fdata2 array
- assert(w <= 16);
- assert(h <= 16);
+ assert(h <= 64);
if (x_step_q4 == 16 && y_step_q4 == 16 &&
filter_x[3] != 128 && filter_y[3] != 128) {
@@ -324,11 +322,9 @@ void vp9_convolve8_avg_ssse3(const uint8_t *src, int src_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
- DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 16*23);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 16*71);
- // check w/h due to fixed size fdata2 array
- assert(w <= 16);
- assert(h <= 16);
+ assert(h <= 64);
if (x_step_q4 == 16 && y_step_q4 == 16 &&
filter_x[3] != 128 && filter_y[3] != 128) {
diff --git a/vp9/common/x86/vp9_subpixel_8t_ssse3.asm b/vp9/common/x86/vp9_subpixel_8t_ssse3.asm
index 32f00e289..bbf9888ca 100644
--- a/vp9/common/x86/vp9_subpixel_8t_ssse3.asm
+++ b/vp9/common/x86/vp9_subpixel_8t_ssse3.asm
@@ -81,10 +81,10 @@
pmaddubsw xmm4, k4k5
pmaddubsw xmm6, k6k7
+ paddsw xmm0, xmm6
paddsw xmm0, xmm2
- paddsw xmm0, krd
- paddsw xmm4, xmm6
paddsw xmm0, xmm4
+ paddsw xmm0, krd
psraw xmm0, 7
packuswb xmm0, xmm0
@@ -165,10 +165,10 @@
pmaddubsw xmm4, k4k5
pmaddubsw xmm6, k6k7
+ paddsw xmm0, xmm6
paddsw xmm0, xmm2
- paddsw xmm0, krd
- paddsw xmm4, xmm6
paddsw xmm0, xmm4
+ paddsw xmm0, krd
psraw xmm0, 7
packuswb xmm0, xmm0
@@ -250,10 +250,10 @@
pmaddubsw xmm4, k4k5
pmaddubsw xmm6, k6k7
+ paddsw xmm0, xmm6
paddsw xmm0, xmm2
- paddsw xmm0, krd
- paddsw xmm4, xmm6
paddsw xmm0, xmm4
+ paddsw xmm0, krd
psraw xmm0, 7
packuswb xmm0, xmm0
@@ -285,10 +285,10 @@
pmaddubsw xmm4, k4k5
pmaddubsw xmm6, k6k7
+ paddsw xmm0, xmm6
paddsw xmm0, xmm2
- paddsw xmm4, xmm6
- paddsw xmm0, krd
paddsw xmm0, xmm4
+ paddsw xmm0, krd
psraw xmm0, 7
packuswb xmm0, xmm0