summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2014-10-03 14:41:12 -0700
committerYaowu Xu <yaowu@google.com>2014-10-03 15:01:53 -0700
commit0065b734814d7347886de4f7e35639d04a2a9483 (patch)
tree66470d866d70edf2187b32f5bfe0b6a84970d643 /vp9
parent9712bc691d01a3dcc3a510d88065606376598c4b (diff)
downloadlibvpx-0065b734814d7347886de4f7e35639d04a2a9483.tar
libvpx-0065b734814d7347886de4f7e35639d04a2a9483.tar.gz
libvpx-0065b734814d7347886de4f7e35639d04a2a9483.tar.bz2
libvpx-0065b734814d7347886de4f7e35639d04a2a9483.zip
Properly initialize segmentID in nonrd coding path
This commit adds proper initialization of segment id for variance AQ mode in non-rd coding path. It fixes the enc/dec mismatch issue of rt=7 with --aq-mode=1, as reported in issue #816 Change-Id: I02fa41b96345bf2e66077d5ea553f85ba800f7bb
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encodeframe.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index 6b1a2597c..505785e89 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1384,12 +1384,18 @@ static void update_state_rt(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
*(xd->mi[0].src_mi) = ctx->mic;
xd->mi[0].src_mi = &xd->mi[0];
-
- // For in frame adaptive Q, check for reseting the segment_id and updating
- // the cyclic refresh map.
- if ((cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) && seg->enabled) {
- vp9_cyclic_refresh_update_segment(cpi, &xd->mi[0].src_mi->mbmi,
- mi_row, mi_col, bsize, 1);
+ if (seg->enabled && cpi->oxcf.aq_mode) {
+ // For in frame complexity AQ or variance AQ, copy segment_id from
+ // segmentation_map.
+ if (cpi->oxcf.aq_mode == COMPLEXITY_AQ ||
+ cpi->oxcf.aq_mode == VARIANCE_AQ ) {
+ const uint8_t *const map = seg->update_map ? cpi->segmentation_map
+ : cm->last_frame_seg_map;
+ mbmi->segment_id = vp9_get_segment_id(cm, map, bsize, mi_row, mi_col);
+ } else {
+ // Setting segmentation map for cyclic_refresh
+ vp9_cyclic_refresh_update_segment(cpi, mbmi, mi_row, mi_col, bsize, 1);
+ }
vp9_init_plane_quantizers(cpi, x);
}
@@ -1758,7 +1764,7 @@ static void rd_use_partition(VP9_COMP *cpi,
// We must have chosen a partitioning and encoding or we'll fail later on.
// No other opportunities for success.
- if ( bsize == BLOCK_64X64)
+ if (bsize == BLOCK_64X64)
assert(chosen_rate < INT_MAX && chosen_dist < INT64_MAX);
if (do_recon) {