Minor code clean up

Change-Id: Ifa864e0acb253b238b03cdeed0fe5d6ee30a45d8
This commit is contained in:
Paul Wilkins
2013-03-21 18:37:48 +00:00
parent 1c75e77b6d
commit 815734e5fb
4 changed files with 11 additions and 25 deletions

View File

@@ -2090,9 +2090,11 @@ static void encode_macroblock(VP9_COMP *cpi, TOKENEXTRA **t,
else else
cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST; cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST;
} else if (mbmi->mode == SPLITMV) } else if (mbmi->mode == SPLITMV)
cpi->zbin_mode_boost = 0; cpi->zbin_mode_boost = SPLIT_MV_ZBIN_BOOST;
else else
cpi->zbin_mode_boost = MV_ZBIN_BOOST; cpi->zbin_mode_boost = MV_ZBIN_BOOST;
} else {
cpi->zbin_mode_boost = INTRA_ZBIN_BOOST;
} }
} }
@@ -2346,9 +2348,11 @@ static void encode_superblock32(VP9_COMP *cpi, TOKENEXTRA **t,
else else
cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST; cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST;
} else if (xd->mode_info_context->mbmi.mode == SPLITMV) } else if (xd->mode_info_context->mbmi.mode == SPLITMV)
cpi->zbin_mode_boost = 0; cpi->zbin_mode_boost = SPLIT_MV_ZBIN_BOOST;
else else
cpi->zbin_mode_boost = MV_ZBIN_BOOST; cpi->zbin_mode_boost = MV_ZBIN_BOOST;
} else {
cpi->zbin_mode_boost = INTRA_ZBIN_BOOST;
} }
} }
@@ -2565,10 +2569,12 @@ static void encode_superblock64(VP9_COMP *cpi, TOKENEXTRA **t,
else else
cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST; cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST;
} else if (xd->mode_info_context->mbmi.mode == SPLITMV) { } else if (xd->mode_info_context->mbmi.mode == SPLITMV) {
cpi->zbin_mode_boost = 0; cpi->zbin_mode_boost = SPLIT_MV_ZBIN_BOOST;
} else { } else {
cpi->zbin_mode_boost = MV_ZBIN_BOOST; cpi->zbin_mode_boost = MV_ZBIN_BOOST;
} }
} else {
cpi->zbin_mode_boost = INTRA_ZBIN_BOOST;
} }
} }

View File

@@ -342,9 +342,7 @@ static void dealloc_compressor_data(VP9_COMP *cpi) {
vp8_yv12_de_alloc_frame_buffer(&cpi->last_frame_uf); vp8_yv12_de_alloc_frame_buffer(&cpi->last_frame_uf);
vp8_yv12_de_alloc_frame_buffer(&cpi->scaled_source); vp8_yv12_de_alloc_frame_buffer(&cpi->scaled_source);
#if VP9_TEMPORAL_ALT_REF
vp8_yv12_de_alloc_frame_buffer(&cpi->alt_ref_buffer); vp8_yv12_de_alloc_frame_buffer(&cpi->alt_ref_buffer);
#endif
vp9_lookahead_destroy(cpi->lookahead); vp9_lookahead_destroy(cpi->lookahead);
vpx_free(cpi->tok); vpx_free(cpi->tok);
@@ -879,15 +877,11 @@ static void alloc_raw_frame_buffers(VP9_COMP *cpi) {
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate lag buffers"); "Failed to allocate lag buffers");
#if VP9_TEMPORAL_ALT_REF
if (vp8_yv12_alloc_frame_buffer(&cpi->alt_ref_buffer, if (vp8_yv12_alloc_frame_buffer(&cpi->alt_ref_buffer,
cpi->oxcf.Width, cpi->oxcf.Height, cpi->oxcf.Width, cpi->oxcf.Height,
VP9BORDERINPIXELS)) VP9BORDERINPIXELS))
vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate altref buffer"); "Failed to allocate altref buffer");
#endif
} }
static int alloc_partition_data(VP9_COMP *cpi) { static int alloc_partition_data(VP9_COMP *cpi) {
@@ -1146,16 +1140,12 @@ static void init_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
set_tile_limits(cpi); set_tile_limits(cpi);
#if VP9_TEMPORAL_ALT_REF
{ {
int i; int i;
cpi->fixed_divide[0] = 0; cpi->fixed_divide[0] = 0;
for (i = 1; i < 512; i++) for (i = 1; i < 512; i++)
cpi->fixed_divide[i] = 0x80000 / i; cpi->fixed_divide[i] = 0x80000 / i;
} }
#endif
} }

View File

@@ -42,10 +42,6 @@
#define MAX_LAG_BUFFERS 25 #define MAX_LAG_BUFFERS 25
#define AF_THRESH 25
#define AF_THRESH2 100
#define ARF_DECAY_THRESH 12
#if CONFIG_COMP_INTERINTRA_PRED #if CONFIG_COMP_INTERINTRA_PRED
#define MAX_MODES 54 #define MAX_MODES 54
#else #else
@@ -58,8 +54,8 @@
#define GF_ZEROMV_ZBIN_BOOST 12 #define GF_ZEROMV_ZBIN_BOOST 12
#define LF_ZEROMV_ZBIN_BOOST 6 #define LF_ZEROMV_ZBIN_BOOST 6
#define MV_ZBIN_BOOST 4 #define MV_ZBIN_BOOST 4
#define SPLIT_MV_ZBIN_BOOST 0
#define VP9_TEMPORAL_ALT_REF 1 #define INTRA_ZBIN_BOOST 0
typedef struct { typedef struct {
nmv_context nmvc; nmv_context nmvc;
@@ -625,11 +621,9 @@ typedef struct VP9_COMP {
double est_max_qcorrection_factor; double est_max_qcorrection_factor;
} twopass; } twopass;
#if VP9_TEMPORAL_ALT_REF
YV12_BUFFER_CONFIG alt_ref_buffer; YV12_BUFFER_CONFIG alt_ref_buffer;
YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS]; YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS];
int fixed_divide[512]; int fixed_divide[512];
#endif
#if CONFIG_INTERNAL_STATS #if CONFIG_INTERNAL_STATS
int count; int count;

View File

@@ -32,9 +32,6 @@
#define ALT_REF_MC_ENABLED 1 // dis/enable MC in AltRef filtering #define ALT_REF_MC_ENABLED 1 // dis/enable MC in AltRef filtering
#define ALT_REF_SUBPEL_ENABLED 1 // dis/enable subpel in MC AltRef filtering #define ALT_REF_SUBPEL_ENABLED 1 // dis/enable subpel in MC AltRef filtering
#if VP9_TEMPORAL_ALT_REF
static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd, static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
uint8_t *y_mb_ptr, uint8_t *y_mb_ptr,
uint8_t *u_mb_ptr, uint8_t *u_mb_ptr,
@@ -476,4 +473,3 @@ void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance) {
frames_to_blur_backward, frames_to_blur_backward,
strength); strength);
} }
#endif