vp10 cleanup: remove nonrd and real-time code

Code cleanup.

Change-Id: I668bd5a4e5fbe96969d51d9ee777fc5f1d8abfe6
This commit is contained in:
Yunqing Wang 2015-08-26 13:36:54 -07:00
parent 413a0392c0
commit 1c0769107b
11 changed files with 14 additions and 3048 deletions

File diff suppressed because it is too large Load Diff

View File

@ -3341,8 +3341,7 @@ static void encode_with_recode_loop(VP10_COMP *cpi,
// to recode.
if (cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF) {
save_coding_context(cpi);
if (!cpi->sf.use_nonrd_pick_mode)
vp10_pack_bitstream(cpi, dest, size);
vp10_pack_bitstream(cpi, dest, size);
rc->projected_frame_size = (int)(*size) << 3;
restore_coding_context(cpi);

View File

@ -146,23 +146,6 @@ void vp10_encode_tiles_mt(VP10_COMP *cpi) {
memcpy(thread_data->td->counts, &cpi->common.counts,
sizeof(cpi->common.counts));
}
// Handle use_nonrd_pick_mode case.
if (cpi->sf.use_nonrd_pick_mode) {
MACROBLOCK *const x = &thread_data->td->mb;
MACROBLOCKD *const xd = &x->e_mbd;
struct macroblock_plane *const p = x->plane;
struct macroblockd_plane *const pd = xd->plane;
PICK_MODE_CONTEXT *ctx = &thread_data->td->pc_root->none;
int j;
for (j = 0; j < MAX_MB_PLANE; ++j) {
p[j].coeff = ctx->coeff_pbuf[j][0];
p[j].qcoeff = ctx->qcoeff_pbuf[j][0];
pd[j].dqcoeff = ctx->dqcoeff_pbuf[j][0];
p[j].eobs = ctx->eobs_pbuf[j][0];
}
}
}
// Encode a frame

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +0,0 @@
/*
* Copyright (c) 2014 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef VP10_ENCODER_PICKMODE_H_
#define VP10_ENCODER_PICKMODE_H_
#include "vp10/encoder/encoder.h"
#ifdef __cplusplus
extern "C" {
#endif
void vp10_pick_intra_mode(VP10_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost,
BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx);
void vp10_pick_inter_mode(VP10_COMP *cpi, MACROBLOCK *x,
TileDataEnc *tile_data,
int mi_row, int mi_col, RD_COST *rd_cost,
BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx);
void vp10_pick_inter_mode_sub8x8(VP10_COMP *cpi, MACROBLOCK *x,
int mi_row, int mi_col, RD_COST *rd_cost,
BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // VP10_ENCODER_PICKMODE_H_

View File

@ -1180,15 +1180,7 @@ int vp10_rc_pick_q_and_bounds(const VP10_COMP *cpi,
} else {
q = rc_pick_q_and_bounds_two_pass(cpi, bottom_index, top_index);
}
if (cpi->sf.use_nonrd_pick_mode) {
if (cpi->sf.force_frame_boost == 1)
q -= cpi->sf.max_delta_qindex;
if (q < *bottom_index)
*bottom_index = q;
else if (q > *top_index)
*top_index = q;
}
return q;
}

View File

@ -285,8 +285,7 @@ void vp10_initialize_rd_consts(VP10_COMP *cpi) {
set_block_thresholds(cm, rd);
set_partition_probs(cm, xd);
if (!cpi->sf.use_nonrd_pick_mode || cm->frame_type == KEY_FRAME)
fill_token_costs(x->token_costs, cm->fc->coef_probs);
fill_token_costs(x->token_costs, cm->fc->coef_probs);
if (cpi->sf.partition_search_type != VAR_BASED_PARTITION ||
cm->frame_type == KEY_FRAME) {
@ -295,20 +294,17 @@ void vp10_initialize_rd_consts(VP10_COMP *cpi) {
vp10_partition_tree);
}
if (!cpi->sf.use_nonrd_pick_mode || (cm->current_video_frame & 0x07) == 1 ||
cm->frame_type == KEY_FRAME) {
fill_mode_costs(cpi);
fill_mode_costs(cpi);
if (!frame_is_intra_only(cm)) {
vp10_build_nmv_cost_table(x->nmvjointcost,
cm->allow_high_precision_mv ? x->nmvcost_hp
: x->nmvcost,
&cm->fc->nmvc, cm->allow_high_precision_mv);
if (!frame_is_intra_only(cm)) {
vp10_build_nmv_cost_table(x->nmvjointcost,
cm->allow_high_precision_mv ? x->nmvcost_hp
: x->nmvcost,
&cm->fc->nmvc, cm->allow_high_precision_mv);
for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
vp10_cost_tokens((int *)cpi->inter_mode_cost[i],
cm->fc->inter_mode_probs[i], vp10_inter_mode_tree);
}
for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
vp10_cost_tokens((int *)cpi->inter_mode_cost[i],
cm->fc->inter_mode_probs[i], vp10_inter_mode_tree);
}
}

View File

@ -1060,16 +1060,6 @@ static int64_t rd_pick_intra_sby_mode(VP10_COMP *cpi, MACROBLOCK *x,
memset(x->skip_txfm, SKIP_TXFM_NONE, sizeof(x->skip_txfm));
/* Y Search for intra prediction mode */
for (mode = DC_PRED; mode <= TM_PRED; mode++) {
if (cpi->sf.use_nonrd_pick_mode) {
// These speed features are turned on in hybrid non-RD and RD mode
// for key frame coding in the context of real-time setting.
if (conditional_skipintra(mode, mode_selected))
continue;
if (*skippable)
break;
}
mic->mbmi.mode = mode;
super_block_yrd(cpi, x, &this_rate_tokenonly, &this_distortion,

View File

@ -348,7 +348,6 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
(frames_since_key % (sf->last_partitioning_redo_frequency << 1) == 1);
sf->max_delta_qindex = is_keyframe ? 20 : 15;
sf->partition_search_type = REFERENCE_PARTITION;
sf->use_nonrd_pick_mode = 1;
sf->allow_skip_recode = 0;
sf->inter_mode_mask[BLOCK_32X32] = INTER_NEAREST_NEW_ZERO;
sf->inter_mode_mask[BLOCK_32X64] = INTER_NEAREST_NEW_ZERO;
@ -384,7 +383,6 @@ static void set_rt_speed_feature(VP10_COMP *cpi, SPEED_FEATURES *sf,
// Adaptively switch between SOURCE_VAR_BASED_PARTITION and FIXED_PARTITION.
sf->partition_search_type = VAR_BASED_PARTITION;
// Turn on this to use non-RD key frame coding mode.
sf->use_nonrd_pick_mode = 1;
sf->mv.search_method = NSTEP;
sf->mv.reduce_first_step_size = 1;
sf->skip_encode_sb = 0;
@ -493,7 +491,6 @@ void vp10_set_speed_features_framesize_independent(VP10_COMP *cpi) {
sf->use_fast_coef_costing = 0;
sf->mode_skip_start = MAX_MODES; // Mode index at which mode skip mask set
sf->schedule_mode_search = 0;
sf->use_nonrd_pick_mode = 0;
for (i = 0; i < BLOCK_SIZES; ++i)
sf->inter_mode_mask[i] = INTER_ALL;
sf->max_intra_bsize = BLOCK_64X64;

View File

@ -141,7 +141,7 @@ typedef enum {
} INTERP_FILTER_MASK;
typedef enum {
// Search partitions using RD/NONRD criterion
// Search partitions using RD criterion
SEARCH_PARTITION,
// Always use a fixed size partition
@ -363,9 +363,6 @@ typedef struct SPEED_FEATURES {
// by only looking at counts from 1/2 the bands.
FAST_COEFF_UPDATE use_fast_coef_updates;
// This flag controls the use of non-RD mode decision.
int use_nonrd_pick_mode;
// A binary mask indicating if NEARESTMV, NEARMV, ZEROMV, NEWMV
// modes are used in order from LSB to MSB for each BLOCK_SIZE.
int inter_mode_mask[BLOCK_SIZES];

View File

@ -48,7 +48,6 @@ VP10_CX_SRCS-yes += encoder/quantize.h
VP10_CX_SRCS-yes += encoder/ratectrl.h
VP10_CX_SRCS-yes += encoder/rd.h
VP10_CX_SRCS-yes += encoder/rdopt.h
VP10_CX_SRCS-yes += encoder/pickmode.h
VP10_CX_SRCS-yes += encoder/svc_layercontext.h
VP10_CX_SRCS-yes += encoder/tokenize.h
VP10_CX_SRCS-yes += encoder/treewriter.h
@ -60,7 +59,6 @@ VP10_CX_SRCS-yes += encoder/quantize.c
VP10_CX_SRCS-yes += encoder/ratectrl.c
VP10_CX_SRCS-yes += encoder/rd.c
VP10_CX_SRCS-yes += encoder/rdopt.c
VP10_CX_SRCS-yes += encoder/pickmode.c
VP10_CX_SRCS-yes += encoder/segmentation.c
VP10_CX_SRCS-yes += encoder/segmentation.h
VP10_CX_SRCS-yes += encoder/speed_features.c