Merge "Merge branch 'master' into nextgenv2" into nextgenv2

This commit is contained in:
Yaowu Xu
2016-02-03 22:54:25 +00:00
committed by Gerrit Code Review
6 changed files with 32 additions and 9 deletions

View File

@@ -69,6 +69,7 @@ typedef struct {
struct loopfilter { struct loopfilter {
int filter_level; int filter_level;
int last_filt_level;
int sharpness_level; int sharpness_level;
int last_sharpness_level; int last_sharpness_level;

View File

@@ -75,7 +75,8 @@ int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
// This function is used by both c and sse2 denoiser implementations. // This function is used by both c and sse2 denoiser implementations.
// Define it as a static function within the scope where vp9_denoiser.h // Define it as a static function within the scope where vp9_denoiser.h
// is referenced. // is referenced.
static int total_adj_strong_thresh(BLOCK_SIZE bs, int increase_denoising) { static INLINE int total_adj_strong_thresh(BLOCK_SIZE bs,
int increase_denoising) {
return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 3 : 2); return (1 << num_pels_log2_lookup[bs]) * (increase_denoising ? 3 : 2);
} }
#endif #endif

View File

@@ -2823,6 +2823,7 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
if (xd->lossless) { if (xd->lossless) {
lf->filter_level = 0; lf->filter_level = 0;
lf->last_filt_level = 0;
} else { } else {
struct vpx_usec_timer timer; struct vpx_usec_timer timer;
@@ -2830,7 +2831,16 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
vpx_usec_timer_start(&timer); vpx_usec_timer_start(&timer);
vp9_pick_filter_level(cpi->Source, cpi, cpi->sf.lpf_pick); if (!cpi->rc.is_src_frame_alt_ref) {
if ((cpi->common.frame_type == KEY_FRAME) &&
(!cpi->rc.this_key_frame_forced)) {
lf->last_filt_level = 0;
}
vp9_pick_filter_level(cpi->Source, cpi, cpi->sf.lpf_pick);
lf->last_filt_level = lf->filter_level;
} else {
lf->filter_level = 0;
}
vpx_usec_timer_mark(&timer); vpx_usec_timer_mark(&timer);
cpi->time_pick_lpf += vpx_usec_timer_elapsed(&timer); cpi->time_pick_lpf += vpx_usec_timer_elapsed(&timer);
@@ -3023,7 +3033,7 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
"%7.2lf %7.2lf %7.2lf %7.2lf %7.2lf" "%7.2lf %7.2lf %7.2lf %7.2lf %7.2lf"
"%6d %6d %5d %5d %5d " "%6d %6d %5d %5d %5d "
"%10"PRId64" %10.3lf" "%10"PRId64" %10.3lf"
"%10lf %8u %10"PRId64" %10d %10d %10d\n", "%10lf %8u %10"PRId64" %10d %10d %10d %10d\n",
cpi->common.current_video_frame, cpi->common.current_video_frame,
cm->width, cm->height, cm->width, cm->height,
cpi->td.rd_counts.m_search_count, cpi->td.rd_counts.m_search_count,
@@ -3055,7 +3065,8 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
(1 + cpi->twopass.total_left_stats.coded_error), (1 + cpi->twopass.total_left_stats.coded_error),
cpi->tot_recode_hits, recon_err, cpi->rc.kf_boost, cpi->tot_recode_hits, recon_err, cpi->rc.kf_boost,
cpi->twopass.kf_zeromotion_pct, cpi->twopass.kf_zeromotion_pct,
cpi->twopass.fr_content_type); cpi->twopass.fr_content_type,
cm->lf.filter_level);
fclose(f); fclose(f);
@@ -4326,7 +4337,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
cpi->svc.layer_context[cpi->svc.spatial_layer_id].has_alt_frame = 1; cpi->svc.layer_context[cpi->svc.spatial_layer_id].has_alt_frame = 1;
#endif #endif
if (oxcf->arnr_max_frames > 0) { if ((oxcf->arnr_max_frames > 0) && (oxcf->arnr_strength > 0)) {
// Produce the filtered ARF frame. // Produce the filtered ARF frame.
vp9_temporal_filter(cpi, arf_src_index); vp9_temporal_filter(cpi, arf_src_index);
vpx_extend_frame_borders(&cpi->alt_ref_buffer); vpx_extend_frame_borders(&cpi->alt_ref_buffer);

View File

@@ -86,7 +86,9 @@ static int mv_err_cost(const MV *mv, const MV *ref,
if (mvcost) { if (mvcost) {
const MV diff = { mv->row - ref->row, const MV diff = { mv->row - ref->row,
mv->col - ref->col }; mv->col - ref->col };
return ROUND_POWER_OF_TWO(mv_cost(&diff, mvjcost, mvcost) * // TODO(aconverse): See if this shift needs to be tied to
// VP9_PROB_COST_SHIFT.
return ROUND_POWER_OF_TWO((unsigned)mv_cost(&diff, mvjcost, mvcost) *
error_per_bit, 13); error_per_bit, 13);
} }
return 0; return 0;
@@ -96,8 +98,9 @@ static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref,
int error_per_bit) { int error_per_bit) {
const MV diff = { mv->row - ref->row, const MV diff = { mv->row - ref->row,
mv->col - ref->col }; mv->col - ref->col };
return ROUND_POWER_OF_TWO(mv_cost(&diff, x->nmvjointsadcost, // TODO(aconverse): See if this shift needs to be tied to VP9_PROB_COST_SHIFT.
x->nmvsadcost) * error_per_bit, 8); return ROUND_POWER_OF_TWO((unsigned)mv_cost(&diff, x->nmvjointsadcost,
x->nmvsadcost) * error_per_bit, 8);
} }
void vp9_init_dsmotion_compensation(search_site_config *cfg, int stride) { void vp9_init_dsmotion_compensation(search_site_config *cfg, int stride) {

View File

@@ -78,7 +78,8 @@ static int search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
// Start the search at the previous frame filter level unless it is now out of // Start the search at the previous frame filter level unless it is now out of
// range. // range.
int filt_mid = clamp(lf->filter_level, min_filter_level, max_filter_level); int filt_mid =
clamp(lf->last_filt_level, min_filter_level, max_filter_level);
int filter_step = filt_mid < 16 ? 4 : filt_mid / 4; int filter_step = filt_mid < 16 ? 4 : filt_mid / 4;
// Sum squared error at each filter level // Sum squared error at each filter level
int64_t ss_err[MAX_LOOP_FILTER + 1]; int64_t ss_err[MAX_LOOP_FILTER + 1];

View File

@@ -454,6 +454,9 @@ static const arg_def_t *vp9_args[] = {
&frame_parallel_decoding, &aq_mode, &frame_periodic_boost, &frame_parallel_decoding, &aq_mode, &frame_periodic_boost,
&noise_sens, &tune_content, &input_color_space, &noise_sens, &tune_content, &input_color_space,
&min_gf_interval, &max_gf_interval, &min_gf_interval, &max_gf_interval,
#if CONFIG_VP9_HIGHBITDEPTH
&bitdeptharg, &inbitdeptharg,
#endif // CONFIG_VP9_HIGHBITDEPTH
NULL NULL
}; };
static const int vp9_arg_ctrl_map[] = { static const int vp9_arg_ctrl_map[] = {
@@ -480,6 +483,9 @@ static const arg_def_t *vp10_args[] = {
&frame_parallel_decoding, &aq_mode, &frame_periodic_boost, &frame_parallel_decoding, &aq_mode, &frame_periodic_boost,
&noise_sens, &tune_content, &input_color_space, &noise_sens, &tune_content, &input_color_space,
&min_gf_interval, &max_gf_interval, &min_gf_interval, &max_gf_interval,
#if CONFIG_VP9_HIGHBITDEPTH
&bitdeptharg, &inbitdeptharg,
#endif // CONFIG_VP9_HIGHBITDEPTH
NULL NULL
}; };
static const int vp10_arg_ctrl_map[] = { static const int vp10_arg_ctrl_map[] = {