diff options
author | Yaowu Xu <yaowu@google.com> | 2012-04-04 07:24:10 -0700 |
---|---|---|
committer | Paul Wilkins <paulwilkins@google.com> | 2012-04-12 13:41:54 +0100 |
commit | 636b2f385e81cf9a8d5d4d78af90a763796d59c4 (patch) | |
tree | be381b961a981ab62c5474f2f81f1f47a5f4e5a7 /vp8/encoder/mbgraph.c | |
parent | d6f4b71d9f895dd77624022cbe0fbbc40dbdf03f (diff) | |
download | libvpx-636b2f385e81cf9a8d5d4d78af90a763796d59c4.tar libvpx-636b2f385e81cf9a8d5d4d78af90a763796d59c4.tar.gz libvpx-636b2f385e81cf9a8d5d4d78af90a763796d59c4.tar.bz2 libvpx-636b2f385e81cf9a8d5d4d78af90a763796d59c4.zip |
a set of minor fixes
This commit tries to address an issue related to the oddity shown on
HD _mobcal clip, where some rather ugly blocks shown in the second
frame at low-mid bit rates if the third frame is not made a key frame
by he encoder. The fixes include: 1) made calls to sad_16x16 to be
consistent with function prototype. 2) remove the error bias to intra
and golden in mbgraph search. 3) changed the error accumulation on
inter_segment encoding to avoid potential out-of-range. 1) has no
effect on encoding results.
Encoding test show that the overall effect of the commit helps about
.2%(HD) to .3%(cif)
Change-Id: I930975a2d0c06252f01c39e0a02351529774e30b
Diffstat (limited to 'vp8/encoder/mbgraph.c')
-rw-r--r-- | vp8/encoder/mbgraph.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/vp8/encoder/mbgraph.c b/vp8/encoder/mbgraph.c index 3089be893..ebdb9b504 100644 --- a/vp8/encoder/mbgraph.c +++ b/vp8/encoder/mbgraph.c @@ -109,7 +109,7 @@ static unsigned int do_16x16_motion_iteration //VARIANCE_INVOKE(&cpi->rtcd.variance, satd16x16) best_err = VARIANCE_INVOKE(&cpi->rtcd.variance, sad16x16) (xd->dst.y_buffer, xd->dst.y_stride, - xd->predictor, 16, best_err); + xd->predictor, 16, INT_MAX); /* restore UMV window */ x->mv_col_min = tmp_col_min; @@ -255,7 +255,7 @@ static int find_best_16x16_intra err = VARIANCE_INVOKE(&cpi->rtcd.variance, sad16x16) (xd->predictor, 16, buf->y_buffer + mb_y_offset, - buf->y_stride, err); + buf->y_stride, best_err); // find best if (err < best_err) { @@ -454,12 +454,8 @@ void separate_arf_mbs &frame_stats->mb_stats[offset + mb_col]; int altref_err = mb_stats->ref[ALTREF_FRAME].err; - - int intra_err = - mb_stats->ref[INTRA_FRAME ].err + 250; - - int golden_err = - mb_stats->ref[GOLDEN_FRAME].err + 250; + int intra_err = mb_stats->ref[INTRA_FRAME ].err; + int golden_err = mb_stats->ref[GOLDEN_FRAME].err; // Test for altref vs intra and gf and that its mv was 0,0. if ( (altref_err > 1000) || @@ -531,6 +527,8 @@ void vp8_update_mbgraph_stats // being a GF - so exit if we don't look ahead beyond that if (n_frames <= cpi->frames_till_gf_update_due) return; + if( n_frames > cpi->common.frames_till_alt_ref_frame) + n_frames = cpi->common.frames_till_alt_ref_frame; if (n_frames > MAX_LAG_BUFFERS) n_frames = MAX_LAG_BUFFERS; |