diff options
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_blockd.h | 50 | ||||
-rw-r--r-- | vp9/common/vp9_common.h | 3 | ||||
-rw-r--r-- | vp9/common/vp9_entropymode.c | 56 | ||||
-rw-r--r-- | vp9/common/vp9_findnearmv.c | 2 | ||||
-rw-r--r-- | vp9/common/vp9_mvref_common.c | 8 | ||||
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 8 | ||||
-rw-r--r-- | vp9/common/vp9_reconintra4x4.c | 52 | ||||
-rw-r--r-- | vp9/common/vp9_rtcd_defs.sh | 56 |
8 files changed, 145 insertions, 90 deletions
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index fb2ffc539..bc93d1fab 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -21,9 +21,6 @@ #include "vp9/common/vp9_common.h" #include "vp9/common/vp9_enums.h" -#define TRUE 1 -#define FALSE 0 - // #define MODE_STATS #define MB_FEATURE_TREE_PROBS 3 @@ -131,18 +128,15 @@ typedef enum { typedef enum { B_DC_PRED, /* average of above and left pixels */ + B_V_PRED, /* vertical prediction */ + B_H_PRED, /* horizontal prediction */ + B_D45_PRED, + B_D135_PRED, + B_D117_PRED, + B_D153_PRED, + B_D27_PRED, + B_D63_PRED, B_TM_PRED, - - B_VE_PRED, /* vertical prediction */ - B_HE_PRED, /* horizontal prediction */ - - B_LD_PRED, - B_RD_PRED, - - B_VR_PRED, - B_VL_PRED, - B_HD_PRED, - B_HU_PRED, #if CONFIG_NEWBINTRAMODES B_CONTEXT_PRED, #endif @@ -464,15 +458,15 @@ typedef struct macroblockd { static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) { switch (mode) { case DC_PRED: return B_DC_PRED; - case V_PRED: return B_VE_PRED; - case H_PRED: return B_HE_PRED; + case V_PRED: return B_V_PRED; + case H_PRED: return B_H_PRED; case TM_PRED: return B_TM_PRED; - case D45_PRED: return B_LD_PRED; - case D135_PRED: return B_RD_PRED; - case D117_PRED: return B_VR_PRED; - case D153_PRED: return B_HD_PRED; - case D27_PRED: return B_HU_PRED; - case D63_PRED: return B_VL_PRED; + case D45_PRED: return B_D45_PRED; + case D135_PRED: return B_D135_PRED; + case D117_PRED: return B_D117_PRED; + case D153_PRED: return B_D153_PRED; + case D27_PRED: return B_D27_PRED; + case D63_PRED: return B_D63_PRED; default: assert(0); return B_MODE_COUNT; // Dummy value @@ -483,16 +477,16 @@ static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) { static TX_TYPE txfm_map(B_PREDICTION_MODE bmode) { switch (bmode) { case B_TM_PRED : - case B_RD_PRED : + case B_D135_PRED : return ADST_ADST; - case B_VE_PRED : - case B_VR_PRED : + case B_V_PRED : + case B_D117_PRED : return ADST_DCT; - case B_HE_PRED : - case B_HD_PRED : - case B_HU_PRED : + case B_H_PRED : + case B_D153_PRED : + case B_D27_PRED : return DCT_ADST; #if CONFIG_NEWBINTRAMODES diff --git a/vp9/common/vp9_common.h b/vp9/common/vp9_common.h index 3ffa513ea..dbfb9ed46 100644 --- a/vp9/common/vp9_common.h +++ b/vp9/common/vp9_common.h @@ -19,9 +19,6 @@ #include "vpx_mem/vpx_mem.h" #include "vpx/vpx_integer.h" -#define TRUE 1 -#define FALSE 0 - #define MIN(x, y) (((x) < (y)) ? (x) : (y)) #define MAX(x, y) (((x) > (y)) ? (x) : (y)) diff --git a/vp9/common/vp9_entropymode.c b/vp9/common/vp9_entropymode.c index 61e0d02a4..ed3c6a554 100644 --- a/vp9/common/vp9_entropymode.c +++ b/vp9/common/vp9_entropymode.c @@ -72,18 +72,18 @@ static const unsigned int kf_uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = { static const unsigned int bmode_cts[VP9_NKF_BINTRAMODES] = { #if CONFIG_NEWBINTRAMODES #if CONTEXT_PRED_REPLACEMENTS == 6 - /* DC TM VE HE CONTEXT */ + /* DC TM V H CONTEXT */ 43891, 17694, 10036, 3920, 20000 #elif CONTEXT_PRED_REPLACEMENTS == 4 - /* DC TM VE HE LD RD CONTEXT */ + /* DC TM V H D45 D135 CONTEXT */ 43891, 17694, 10036, 3920, 3363, 2546, 14000 #elif CONTEXT_PRED_REPLACEMENTS == 0 - /* DC TM VE HE LD RD VR VL HD HU CONTEXT */ - 43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723, 50000 + /* DC V H D45 D135 D117 D153 D27 D63 TM CONTEXT */ + 43891, 10036, 3920, 3363, 2546, 5119, 2471, 1723, 3221, 17694, 50000 #endif #else - /* DC TM VE HE LD RD VR VL HD HU */ - 43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723 + /* DC V H D45 D135 D117 D153 D27 D63 TM */ + 43891, 10036, 3920, 3363, 2546, 5119, 2471, 1723, 3221, 17694 #endif }; @@ -156,13 +156,13 @@ const vp9_prob vp9_mbsplit_probs [VP9_NUMMBSPLITS - 1] = { 110, 111, 150}; const vp9_tree_index vp9_kf_bmode_tree[VP9_KF_BINTRAMODES * 2 - 2] = { -B_DC_PRED, 2, /* 0 = DC_NODE */ -B_TM_PRED, 4, /* 1 = TM_NODE */ - -B_VE_PRED, 6, /* 2 = VE_NODE */ + -B_V_PRED, 6, /* 2 = V_NODE */ 8, 12, /* 3 = COM_NODE */ - -B_HE_PRED, 10, /* 4 = HE_NODE */ - -B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */ - -B_LD_PRED, 14, /* 6 = LD_NODE */ - -B_VL_PRED, 16, /* 7 = VL_NODE */ - -B_HD_PRED, -B_HU_PRED /* 8 = HD_NODE */ + -B_H_PRED, 10, /* 4 = H_NODE */ + -B_D135_PRED, -B_D117_PRED, /* 5 = D135_NODE */ + -B_D45_PRED, 14, /* 6 = D45_NODE */ + -B_D63_PRED, 16, /* 7 = D63_NODE */ + -B_D153_PRED, -B_D27_PRED /* 8 = D153_NODE */ }; const vp9_tree_index vp9_bmode_tree[VP9_NKF_BINTRAMODES * 2 - 2] = { @@ -171,36 +171,36 @@ const vp9_tree_index vp9_bmode_tree[VP9_NKF_BINTRAMODES * 2 - 2] = { -B_DC_PRED, 2, -B_TM_PRED, 4, 6, -(B_CONTEXT_PRED - CONTEXT_PRED_REPLACEMENTS), - -B_VE_PRED, -B_HE_PRED + -B_V_PRED, -B_H_PRED #elif CONTEXT_PRED_REPLACEMENTS == 4 -B_DC_PRED, 2, -B_TM_PRED, 4, 6, 8, - -B_VE_PRED, -B_HE_PRED, + -B_V_PRED, -B_H_PRED, 10, -(B_CONTEXT_PRED - CONTEXT_PRED_REPLACEMENTS), - -B_RD_PRED, -B_LD_PRED, + -B_D135_PRED, -B_D45_PRED, #elif CONTEXT_PRED_REPLACEMENTS == 0 -B_DC_PRED, 2, /* 0 = DC_NODE */ -B_TM_PRED, 4, /* 1 = TM_NODE */ - -B_VE_PRED, 6, /* 2 = VE_NODE */ + -B_V_PRED, 6, /* 2 = V_NODE */ 8, 12, /* 3 = COM_NODE */ - -B_HE_PRED, 10, /* 4 = HE_NODE */ - -B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */ - -B_LD_PRED, 14, /* 6 = LD_NODE */ - -B_VL_PRED, 16, /* 7 = VL_NODE */ - -B_HD_PRED, 18, - -B_HU_PRED, -B_CONTEXT_PRED + -B_H_PRED, 10, /* 4 = H_NODE */ + -B_D135_PRED, -B_D117_PRED, /* 5 = D135_NODE */ + -B_D45_PRED, 14, /* 6 = D45_NODE */ + -B_D63_PRED, 16, /* 7 = D63_NODE */ + -B_D153_PRED, 18, /* 8 = D153_NODE */ + -B_D27_PRED, -B_CONTEXT_PRED /* 9 = D27_NODE */ #endif #else -B_DC_PRED, 2, /* 0 = DC_NODE */ -B_TM_PRED, 4, /* 1 = TM_NODE */ - -B_VE_PRED, 6, /* 2 = VE_NODE */ + -B_V_PRED, 6, /* 2 = V_NODE */ 8, 12, /* 3 = COM_NODE */ - -B_HE_PRED, 10, /* 4 = HE_NODE */ - -B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */ - -B_LD_PRED, 14, /* 6 = LD_NODE */ - -B_VL_PRED, 16, /* 7 = VL_NODE */ - -B_HD_PRED, -B_HU_PRED /* 8 = HD_NODE */ + -B_H_PRED, 10, /* 4 = H_NODE */ + -B_D135_PRED, -B_D117_PRED, /* 5 = D135_NODE */ + -B_D45_PRED, 14, /* 6 = D45_NODE */ + -B_D63_PRED, 16, /* 7 = D63_NODE */ + -B_D153_PRED, -B_D27_PRED /* 8 = D153_NODE */ #endif }; diff --git a/vp9/common/vp9_findnearmv.c b/vp9/common/vp9_findnearmv.c index 053895840..bbbc2f62c 100644 --- a/vp9/common/vp9_findnearmv.c +++ b/vp9/common/vp9_findnearmv.c @@ -141,7 +141,7 @@ void vp9_find_best_ref_mvs(MACROBLOCKD *xd, unsigned int sse; unsigned int ref_scores[MAX_MV_REF_CANDIDATES] = {0}; int_mv sorted_mvs[MAX_MV_REF_CANDIDATES]; - int zero_seen = FALSE; + int zero_seen = 0; if (ref_y_buffer) { diff --git a/vp9/common/vp9_mvref_common.c b/vp9/common/vp9_mvref_common.c index e1a12e411..666197366 100644 --- a/vp9/common/vp9_mvref_common.c +++ b/vp9/common/vp9_mvref_common.c @@ -158,7 +158,7 @@ static void addmv_and_shuffle( int i; int insert_point; - int duplicate_found = FALSE; + int duplicate_found = 0; // Check for duplicates. If there is one increase its score. // We only compare vs the current top candidates. @@ -171,7 +171,7 @@ static void addmv_and_shuffle( while (i > 0) { i--; if (candidate_mv.as_int == mv_list[i].as_int) { - duplicate_found = TRUE; + duplicate_found = 1; mv_scores[i] += weight; break; } @@ -251,7 +251,7 @@ void vp9_find_mv_refs(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here, int split_count = 0; int (*mv_ref_search)[2]; int *ref_distance_weight; - int zero_seen = FALSE; + int zero_seen = 0; const int mb_col = (-xd->mb_to_left_edge) >> 7; // Blank the reference vector lists and other local structures. @@ -395,7 +395,7 @@ void vp9_find_mv_refs(VP9_COMMON *cm, MACROBLOCKD *xd, MODE_INFO *here, // Scan for 0,0 case and clamp non zero choices for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) { if (candidate_mvs[i].as_int == 0) { - zero_seen = TRUE; + zero_seen = 1; } else { clamp_mv_ref(xd, &candidate_mvs[i]); } diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 6f928f5e0..c7ca67efe 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -18,6 +18,7 @@ #include "vp9/common/vp9_entropymv.h" #include "vp9/common/vp9_entropy.h" #include "vp9/common/vp9_entropymode.h" + #if CONFIG_POSTPROC #include "vp9/common/vp9_postproc.h" #endif @@ -37,8 +38,13 @@ void vp9_initialize_common(void); #define QINDEX_RANGE (MAXQ + 1) +#if CONFIG_MULTIPLE_ARF +#define NUM_REF_FRAMES 8 +#define NUM_REF_FRAMES_LG2 3 +#else #define NUM_REF_FRAMES 3 #define NUM_REF_FRAMES_LG2 2 +#endif #define ALLOWED_REFS_PER_FRAME 3 @@ -52,6 +58,8 @@ void vp9_initialize_common(void); #define COMP_PRED_CONTEXTS 2 +#define MAX_LAG_BUFFERS 25 + typedef struct frame_contexts { vp9_prob bmode_prob[VP9_NKF_BINTRAMODES - 1]; vp9_prob ymode_prob[VP9_YMODES - 1]; /* interframe intra mode probs */ diff --git a/vp9/common/vp9_reconintra4x4.c b/vp9/common/vp9_reconintra4x4.c index 08bfd1d8e..f1ecd33dc 100644 --- a/vp9/common/vp9_reconintra4x4.c +++ b/vp9/common/vp9_reconintra4x4.c @@ -57,17 +57,17 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr, */ switch (imin) { case 1: - return B_HD_PRED; + return B_D153_PRED; case 2: - return B_RD_PRED; + return B_D135_PRED; case 3: - return B_VR_PRED; + return B_D117_PRED; case 5: - return B_VL_PRED; + return B_D63_PRED; case 6: - return B_LD_PRED; + return B_D45_PRED; case 7: - return B_HU_PRED; + return B_D27_PRED; default: assert(0); } @@ -93,13 +93,13 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr, */ switch (imin) { case 1: - return B_HD_PRED; + return B_D153_PRED; case 3: - return B_VR_PRED; + return B_D117_PRED; case 5: - return B_VL_PRED; + return B_D63_PRED; case 7: - return B_HU_PRED; + return B_D27_PRED; default: assert(0); } @@ -126,21 +126,21 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr, switch (imin) { case 0: - return B_HE_PRED; + return B_H_PRED; case 1: - return B_HD_PRED; + return B_D153_PRED; case 2: - return B_RD_PRED; + return B_D135_PRED; case 3: - return B_VR_PRED; + return B_D117_PRED; case 4: - return B_VE_PRED; + return B_V_PRED; case 5: - return B_VL_PRED; + return B_D63_PRED; case 6: - return B_LD_PRED; + return B_D45_PRED; case 7: - return B_HU_PRED; + return B_D27_PRED; default: assert(0); } @@ -293,7 +293,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, } break; - case B_VE_PRED: { + case B_V_PRED: { unsigned int ap[4]; ap[0] = above[0]; @@ -311,7 +311,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, } break; - case B_HE_PRED: { + case B_H_PRED: { unsigned int lp[4]; lp[0] = left[0]; @@ -328,7 +328,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, } } break; - case B_LD_PRED: { + case B_D45_PRED: { uint8_t *ptr = above; predictor[0 * ps + 0] = (ptr[0] + ptr[1] * 2 + ptr[2] + 2) >> 2; @@ -350,7 +350,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, } break; - case B_RD_PRED: { + case B_D135_PRED: { uint8_t pp[9]; pp[0] = left[3]; @@ -382,7 +382,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, } break; - case B_VR_PRED: { + case B_D117_PRED: { uint8_t pp[9]; pp[0] = left[3]; @@ -414,7 +414,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, } break; - case B_VL_PRED: { + case B_D63_PRED: { uint8_t *pp = above; predictor[0 * ps + 0] = (pp[0] + pp[1] + 1) >> 1; @@ -436,7 +436,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, } break; - case B_HD_PRED: { + case B_D153_PRED: { uint8_t pp[9]; pp[0] = left[3]; @@ -470,7 +470,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd, break; - case B_HU_PRED: { + case B_D27_PRED: { uint8_t *pp = left; predictor[0 * ps + 0] = (pp[0] + pp[1] + 1) >> 1; predictor[0 * ps + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2; diff --git a/vp9/common/vp9_rtcd_defs.sh b/vp9/common/vp9_rtcd_defs.sh index a89ca0ef1..0073660a4 100644 --- a/vp9/common/vp9_rtcd_defs.sh +++ b/vp9/common/vp9_rtcd_defs.sh @@ -376,6 +376,20 @@ if [ "$CONFIG_VP9_ENCODER" = "yes" ]; then # variance [ $arch = "x86_64" ] && mmx_x86_64=mmx && sse2_x86_64=sse2 +#if CONFIG_SBSEGMENT +prototype unsigned int vp9_variance32x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" +specialize vp9_variance32x16 + +prototype unsigned int vp9_variance16x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" +specialize vp9_variance16x32 + +prototype unsigned int vp9_variance64x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" +specialize vp9_variance64x32 + +prototype unsigned int vp9_variance32x64 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" +specialize vp9_variance32x64 +#endif + prototype unsigned int vp9_variance32x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" specialize vp9_variance32x32 @@ -410,6 +424,20 @@ vp9_variance4x4_mmx=vp9_variance4x4_mmx prototype unsigned int vp9_sub_pixel_variance64x64 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" specialize vp9_sub_pixel_variance64x64 sse2 +#if CONFIG_SBSEGMENT +prototype unsigned int vp9_sub_pixel_variance32x64 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" +specialize vp9_sub_pixel_variance32x64 + +prototype unsigned int vp9_sub_pixel_variance64x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" +specialize vp9_sub_pixel_variance64x32 + +prototype unsigned int vp9_sub_pixel_variance32x16 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" +specialize vp9_sub_pixel_variance32x16 + +prototype unsigned int vp9_sub_pixel_variance16x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" +specialize vp9_sub_pixel_variance16x32 +#endif + prototype unsigned int vp9_sub_pixel_variance32x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse" specialize vp9_sub_pixel_variance32x32 sse2 @@ -436,6 +464,20 @@ vp9_sub_pixel_variance4x4_sse2=vp9_sub_pixel_variance4x4_wmt prototype unsigned int vp9_sad64x64 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad" specialize vp9_sad64x64 sse2 +#if CONFIG_SBSEGMENT +prototype unsigned int vp9_sad32x64 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad" +specialize vp9_sad32x64 + +prototype unsigned int vp9_sad64x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad" +specialize vp9_sad64x32 + +prototype unsigned int vp9_sad32x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad" +specialize vp9_sad32x16 + +prototype unsigned int vp9_sad16x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad" +specialize vp9_sad16x32 +#endif + prototype unsigned int vp9_sad32x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad" specialize vp9_sad32x32 sse2 @@ -529,6 +571,20 @@ specialize vp9_sad4x4x8 sse4 prototype void vp9_sad64x64x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array" specialize vp9_sad64x64x4d sse2 +#if CONFIG_SBSEGMENT +prototype void vp9_sad32x64x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array" +specialize vp9_sad32x64x4d + +prototype void vp9_sad64x32x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array" +specialize vp9_sad64x32x4d + +prototype void vp9_sad32x16x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array" +specialize vp9_sad32x16x4d + +prototype void vp9_sad16x32x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array" +specialize vp9_sad16x32x4d +#endif + prototype void vp9_sad32x32x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array" specialize vp9_sad32x32x4d sse2 |