ref: 6bdfc8cd0b2f4d5078048e56feb4516e63af9baf
parent: 0437575848c511decf9d298532309e588ec8ce23
parent: abdb0650b41eb635e9c8a26f0712dcf57a013a9a
author: Jingning Han <jingning@google.com>
date: Wed Mar 26 12:06:01 EDT 2014
Merge "Motion referenced partition search for non-RD coding flow"
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1463,6 +1463,8 @@
// from argument list.
(void)ctx;
+ *(xd->mi_8x8[0]) = ctx->mic;
+
// Check for reseting segment_id and update cyclic map.
if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && seg->enabled) {
vp9_cyclic_refresh_update_segment(cpi, &xd->mi_8x8[0]->mbmi,
@@ -1481,8 +1483,8 @@
}
static void encode_b_rt(VP9_COMP *cpi, const TileInfo *const tile,
- TOKENEXTRA **tp, int mi_row, int mi_col,
- int output_enabled, BLOCK_SIZE bsize) {
+ TOKENEXTRA **tp, int mi_row, int mi_col,
+ int output_enabled, BLOCK_SIZE bsize) {
MACROBLOCK *const x = &cpi->mb;
if (bsize < BLOCK_8X8) {
@@ -2930,7 +2932,7 @@
vp9_cyclic_refresh_set_rate_and_dist_sb(cpi->cyclic_refresh,
best_rate, best_dist);
- encode_sb(cpi, tile, tp, mi_row, mi_col, output_enabled, bsize);
+ encode_sb_rt(cpi, tile, tp, mi_row, mi_col, output_enabled, bsize);
}
if (bsize == BLOCK_64X64) {
@@ -2951,6 +2953,7 @@
int *totrate, int64_t *totdist) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->mb;
+ MACROBLOCKD *const xd = &x->e_mbd;
const int bsl = b_width_log2(bsize), hbs = (1 << bsl) / 4;
const int mis = cm->mode_info_stride;
PARTITION_TYPE partition;
@@ -2972,14 +2975,17 @@
switch (partition) {
case PARTITION_NONE:
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
+ (get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
break;
case PARTITION_VERT:
*get_sb_index(x, subsize) = 0;
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
+ (get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
if (mi_col + hbs < cm->mi_cols) {
*get_sb_index(x, subsize) = 1;
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + hbs,
&rate, &dist, subsize);
+ (get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
if (rate != INT_MAX && dist != INT64_MAX &&
*totrate != INT_MAX && *totdist != INT64_MAX) {
*totrate += rate;
@@ -2990,10 +2996,12 @@
case PARTITION_HORZ:
*get_sb_index(x, subsize) = 0;
nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
+ (get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
if (mi_row + hbs < cm->mi_rows) {
*get_sb_index(x, subsize) = 1;
nonrd_pick_sb_modes(cpi, tile, mi_row + hbs, mi_col,
&rate, &dist, subsize);
+ (get_block_context(x, subsize))->mic.mbmi = xd->mi_8x8[0]->mbmi;
if (rate != INT_MAX && dist != INT64_MAX &&
*totrate != INT_MAX && *totdist != INT64_MAX) {
*totrate += rate;
@@ -3070,6 +3078,7 @@
get_nonrd_var_based_fixed_partition(cpi, mi_row, mi_col);
cpi->mb.source_variance = UINT_MAX;
+ vp9_zero(cpi->mb.pred_mv);
// Set the partition type of the 64X64 block
switch (cpi->sf.partition_search_type) {
@@ -3085,16 +3094,11 @@
1, &dummy_rate, &dummy_dist);
break;
case REFERENCE_PARTITION:
- if (cpi->sf.partition_check) {
- vp9_zero(cpi->mb.pred_mv);
+ if (cpi->sf.partition_check || sb_has_motion(cm, prev_mi_8x8)) {
nonrd_pick_partition(cpi, tile, tp, mi_row, mi_col, BLOCK_64X64,
&dummy_rate, &dummy_dist, 1, INT64_MAX);
} else {
- if (!sb_has_motion(cm, prev_mi_8x8))
- copy_partitioning(cm, mi_8x8, prev_mi_8x8);
- else
- set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col, bsize);
-
+ copy_partitioning(cm, mi_8x8, prev_mi_8x8);
nonrd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col,
BLOCK_64X64, 1, &dummy_rate, &dummy_dist);
}
--
⑨