summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_encodeframe.c31
-rw-r--r--vp9/encoder/vp9_encoder.c36
-rw-r--r--vp9/encoder/vp9_encoder.h2
-rw-r--r--vp9/encoder/vp9_rdopt.c20
-rw-r--r--vp9/encoder/vp9_rdopt.h4
-rw-r--r--vp9/encoder/vp9_speed_features.c13
-rw-r--r--vp9/vp9cx.mk8
7 files changed, 101 insertions, 13 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c
index e510ee1fd..e67d3857d 100644
--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -37,11 +37,14 @@
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_seg_common.h"
#include "vp9/common/vp9_tile_common.h"
-
+#if !CONFIG_REALTIME_ONLY
#include "vp9/encoder/vp9_aq_360.h"
#include "vp9/encoder/vp9_aq_complexity.h"
+#endif
#include "vp9/encoder/vp9_aq_cyclicrefresh.h"
+#if !CONFIG_REALTIME_ONLY
#include "vp9/encoder/vp9_aq_variance.h"
+#endif
#include "vp9/encoder/vp9_encodeframe.h"
#include "vp9/encoder/vp9_encodemb.h"
#include "vp9/encoder/vp9_encodemv.h"
@@ -156,6 +159,7 @@ unsigned int vp9_high_get_sby_perpixel_variance(VP9_COMP *cpi,
}
#endif // CONFIG_VP9_HIGHBITDEPTH
+#if !CONFIG_REALTIME_ONLY
static unsigned int get_sby_perpixel_diff_variance(VP9_COMP *cpi,
const struct buf_2d *ref,
int mi_row, int mi_col,
@@ -184,6 +188,7 @@ static BLOCK_SIZE get_rd_var_based_fixed_partition(VP9_COMP *cpi, MACROBLOCK *x,
else
return BLOCK_8X8;
}
+#endif // !CONFIG_REALTIME_ONLY
static void set_segment_index(VP9_COMP *cpi, MACROBLOCK *const x, int mi_row,
int mi_col, BLOCK_SIZE bsize, int segment_index) {
@@ -206,6 +211,7 @@ static void set_segment_index(VP9_COMP *cpi, MACROBLOCK *const x, int mi_row,
case CYCLIC_REFRESH_AQ:
mi->segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col);
break;
+#if !CONFIG_REALTIME_ONLY
case VARIANCE_AQ:
if (cm->frame_type == KEY_FRAME || cpi->refresh_alt_ref_frame ||
cpi->force_update_segmentation ||
@@ -225,15 +231,16 @@ static void set_segment_index(VP9_COMP *cpi, MACROBLOCK *const x, int mi_row,
mi->segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col);
}
break;
- case LOOKAHEAD_AQ:
- mi->segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col);
- break;
case EQUATOR360_AQ:
if (cm->frame_type == KEY_FRAME || cpi->force_update_segmentation)
mi->segment_id = vp9_360aq_segment_id(mi_row, cm->mi_rows);
else
mi->segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col);
break;
+#endif
+ case LOOKAHEAD_AQ:
+ mi->segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col);
+ break;
case PSNR_AQ: mi->segment_id = segment_index; break;
case PERCEPTUAL_AQ: mi->segment_id = x->segment_id; break;
default:
@@ -1765,6 +1772,7 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
return 0;
}
+#if !CONFIG_REALTIME_ONLY
static void update_state(VP9_COMP *cpi, ThreadData *td, PICK_MODE_CONTEXT *ctx,
int mi_row, int mi_col, BLOCK_SIZE bsize,
int output_enabled) {
@@ -1893,6 +1901,7 @@ static void update_state(VP9_COMP *cpi, ThreadData *td, PICK_MODE_CONTEXT *ctx,
}
}
}
+#endif // !CONFIG_REALTIME_ONLY
void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src,
int mi_row, int mi_col) {
@@ -1935,6 +1944,7 @@ static void set_mode_info_seg_skip(MACROBLOCK *x, TX_MODE tx_mode,
vp9_rd_cost_init(rd_cost);
}
+#if !CONFIG_REALTIME_ONLY
static void set_segment_rdmult(VP9_COMP *const cpi, MACROBLOCK *const x,
int mi_row, int mi_col, BLOCK_SIZE bsize,
AQ_MODE aq_mode) {
@@ -2073,6 +2083,7 @@ static void rd_pick_sb_modes(VP9_COMP *cpi, TileDataEnc *tile_data,
ctx->rate = rd_cost->rate;
ctx->dist = rd_cost->dist;
}
+#endif // !CONFIG_REALTIME_ONLY
static void update_stats(VP9_COMMON *cm, ThreadData *td) {
const MACROBLOCK *x = &td->mb;
@@ -2133,6 +2144,7 @@ static void update_stats(VP9_COMMON *cm, ThreadData *td) {
}
}
+#if !CONFIG_REALTIME_ONLY
static void restore_context(MACROBLOCK *const x, int mi_row, int mi_col,
ENTROPY_CONTEXT a[16 * MAX_MB_PLANE],
ENTROPY_CONTEXT l[16 * MAX_MB_PLANE],
@@ -2286,6 +2298,7 @@ static void encode_sb(VP9_COMP *cpi, ThreadData *td, const TileInfo *const tile,
if (partition != PARTITION_SPLIT || bsize == BLOCK_8X8)
update_partition_context(xd, mi_row, mi_col, subsize, bsize);
}
+#endif // !CONFIG_REALTIME_ONLY
// Check to see if the given partition size is allowed for a specified number
// of 8x8 block rows and columns remaining in the image.
@@ -2622,6 +2635,7 @@ static void encode_sb_rt(VP9_COMP *cpi, ThreadData *td,
update_partition_context(xd, mi_row, mi_col, subsize, bsize);
}
+#if !CONFIG_REALTIME_ONLY
static void rd_use_partition(VP9_COMP *cpi, ThreadData *td,
TileDataEnc *tile_data, MODE_INFO **mi_8x8,
TOKENEXTRA **tp, int mi_row, int mi_col,
@@ -3060,6 +3074,7 @@ static void set_partition_range(VP9_COMMON *cm, MACROBLOCKD *xd, int mi_row,
*min_bs = min_size;
*max_bs = max_size;
}
+#endif // !CONFIG_REALTIME_ONLY
static INLINE void store_pred_mv(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx) {
memcpy(ctx->pred_mv, x->pred_mv, sizeof(x->pred_mv));
@@ -3164,6 +3179,7 @@ static void nn_predict(const float *features, const NN_CONFIG *nn_config,
}
}
+#if !CONFIG_REALTIME_ONLY
#define FEATURES 7
// Machine-learning based partition search early termination.
// Return 1 to skip split and rect partitions.
@@ -3613,6 +3629,7 @@ static void ml_predict_var_rd_paritioning(const VP9_COMP *const cpi,
}
}
#undef FEATURES
+#endif // !CONFIG_REALTIME_ONLY
static double log_wiener_var(int64_t wiener_variance) {
return log(1.0 + wiener_variance) / log(2.0);
@@ -3668,6 +3685,7 @@ static void build_kmeans_segmentation(VP9_COMP *cpi) {
}
}
+#if !CONFIG_REALTIME_ONLY
static int wiener_var_segment(VP9_COMP *cpi, BLOCK_SIZE bsize, int mi_row,
int mi_col) {
VP9_COMMON *cm = &cpi->common;
@@ -3759,7 +3777,9 @@ static int get_rdmult_delta(VP9_COMP *cpi, BLOCK_SIZE bsize, int mi_row,
return dr;
}
+#endif // !CONFIG_REALTIME_ONLY
+#if !CONFIG_REALTIME_ONLY
// TODO(jingning,jimbankoski,rbultje): properly skip partition types that are
// unlikely to be selected depending on previous rate-distortion optimization
// results, for encoding speed-up.
@@ -4441,6 +4461,7 @@ static void encode_rd_sb_row(VP9_COMP *cpi, ThreadData *td,
sb_col_in_tile, num_sb_cols);
}
}
+#endif // !CONFIG_REALTIME_ONLY
static void init_encode_frame_mb_context(VP9_COMP *cpi) {
MACROBLOCK *const x = &cpi->td.mb;
@@ -5731,8 +5752,10 @@ void vp9_encode_sb_row(VP9_COMP *cpi, ThreadData *td, int tile_row,
if (cpi->sf.use_nonrd_pick_mode)
encode_nonrd_sb_row(cpi, td, this_tile, mi_row, &tok);
+#if !CONFIG_REALTIME_ONLY
else
encode_rd_sb_row(cpi, td, this_tile, mi_row, &tok);
+#endif
cpi->tplist[tile_row][tile_col][tile_sb_row].stop = tok;
cpi->tplist[tile_row][tile_col][tile_sb_row].count =
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index fde91fadc..900d92f85 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -44,11 +44,15 @@
#include "vp9/common/vp9_tile_common.h"
#include "vp9/common/vp9_scan.h"
+#if !CONFIG_REALTIME_ONLY
#include "vp9/encoder/vp9_alt_ref_aq.h"
#include "vp9/encoder/vp9_aq_360.h"
#include "vp9/encoder/vp9_aq_complexity.h"
+#endif
#include "vp9/encoder/vp9_aq_cyclicrefresh.h"
+#if !CONFIG_REALTIME_ONLY
#include "vp9/encoder/vp9_aq_variance.h"
+#endif
#include "vp9/encoder/vp9_bitstream.h"
#if CONFIG_INTERNAL_STATS
#include "vp9/encoder/vp9_blockiness.h"
@@ -127,6 +131,7 @@ void highbd_wht_fwd_txfm(int16_t *src_diff, int bw, tran_low_t *coeff,
void wht_fwd_txfm(int16_t *src_diff, int bw, tran_low_t *coeff,
TX_SIZE tx_size);
+#if !CONFIG_REALTIME_ONLY
// compute adaptive threshold for skip recoding
static int compute_context_model_thresh(const VP9_COMP *const cpi) {
const VP9_COMMON *const cm = &cpi->common;
@@ -451,6 +456,7 @@ static int compute_context_model_diff(const VP9_COMMON *const cm) {
return -diff;
}
+#endif // !CONFIG_REALTIME_ONLY
// Test for whether to calculate metrics for the frame.
static int is_psnr_calc_enabled(VP9_COMP *cpi) {
@@ -2180,7 +2186,9 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
cm, cpi->skin_map,
vpx_calloc(cm->mi_rows * cm->mi_cols, sizeof(cpi->skin_map[0])));
+#if !CONFIG_REALTIME_ONLY
CHECK_MEM_ERROR(cm, cpi->alt_ref_aq, vp9_alt_ref_aq_create());
+#endif
CHECK_MEM_ERROR(
cm, cpi->consec_zero_mv,
@@ -2655,7 +2663,9 @@ void vp9_remove_compressor(VP9_COMP *cpi) {
vp9_bitstream_encode_tiles_buffer_dealloc(cpi);
}
+#if !CONFIG_REALTIME_ONLY
vp9_alt_ref_aq_destroy(cpi->alt_ref_aq);
+#endif
dealloc_compressor_data(cpi);
@@ -2942,6 +2952,7 @@ static void scale_and_extend_frame(const YV12_BUFFER_CONFIG *src,
}
#endif // CONFIG_VP9_HIGHBITDEPTH
+#if !CONFIG_REALTIME_ONLY
static int scale_down(VP9_COMP *cpi, int q) {
RATE_CONTROL *const rc = &cpi->rc;
GF_GROUP *const gf_group = &cpi->twopass.gf_group;
@@ -3045,6 +3056,7 @@ static int recode_loop_test(VP9_COMP *cpi, int high_limit, int low_limit, int q,
}
return force_recode;
}
+#endif // !CONFIG_REALTIME_ONLY
static void update_ref_frames(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
@@ -3972,6 +3984,7 @@ static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
}
}
+#if !CONFIG_REALTIME_ONLY
// Variance adaptive and in frame q adjustment experiments are mutually
// exclusive.
if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
@@ -3980,15 +3993,20 @@ static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
vp9_360aq_frame_setup(cpi);
} else if (cpi->oxcf.aq_mode == COMPLEXITY_AQ) {
vp9_setup_in_frame_q_adj(cpi);
- } else if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
- vp9_cyclic_refresh_setup(cpi);
} else if (cpi->oxcf.aq_mode == LOOKAHEAD_AQ) {
// it may be pretty bad for rate-control,
// and I should handle it somehow
vp9_alt_ref_aq_setup_map(cpi->alt_ref_aq, cpi);
- } else if (cpi->roi.enabled && !frame_is_intra_only(cm)) {
- apply_roi_map(cpi);
+ } else {
+#endif
+ if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
+ vp9_cyclic_refresh_setup(cpi);
+ } else if (cpi->roi.enabled && !frame_is_intra_only(cm)) {
+ apply_roi_map(cpi);
+ }
+#if !CONFIG_REALTIME_ONLY
}
+#endif
apply_active_map(cpi);
@@ -4041,6 +4059,7 @@ static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
return 1;
}
+#if !CONFIG_REALTIME_ONLY
#define MAX_QSTEP_ADJ 4
static int get_qstep_adj(int rate_excess, int rate_limit) {
int qstep =
@@ -4403,6 +4422,7 @@ static void encode_with_recode_loop(VP9_COMP *cpi, size_t *size,
restore_coding_context(cpi);
}
}
+#endif // !CONFIG_REALTIME_ONLY
static int get_ref_frame_flags(const VP9_COMP *cpi) {
const int *const map = cpi->common.ref_frame_map;
@@ -4696,6 +4716,7 @@ static void spatial_denoise_frame(VP9_COMP *cpi) {
}
#endif // ENABLE_KF_DENOISE
+#if !CONFIG_REALTIME_ONLY
static void vp9_try_disable_lookahead_aq(VP9_COMP *cpi, size_t *size,
uint8_t *dest) {
if (cpi->common.seg.enabled)
@@ -4719,6 +4740,7 @@ static void vp9_try_disable_lookahead_aq(VP9_COMP *cpi, size_t *size,
vp9_enable_segmentation(&cpi->common.seg);
}
}
+#endif
static void set_frame_index(VP9_COMP *cpi, VP9_COMMON *cm) {
RefCntBuffer *const ref_buffer = get_ref_cnt_buffer(cm, cm->new_fb_idx);
@@ -5054,7 +5076,9 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
if (cpi->sf.recode_loop == DISALLOW_RECODE) {
if (!encode_without_recode_loop(cpi, size, dest)) return;
} else {
+#if !CONFIG_REALTIME_ONLY
encode_with_recode_loop(cpi, size, dest);
+#endif
}
// TODO(jingning): When using show existing frame mode, we assume that the
@@ -5066,9 +5090,11 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
cm->ref_frame_map[cpi->alt_fb_idx]);
}
+#if !CONFIG_REALTIME_ONLY
// Disable segmentation if it decrease rate/distortion ratio
if (cpi->oxcf.aq_mode == LOOKAHEAD_AQ)
vp9_try_disable_lookahead_aq(cpi, size, dest);
+#endif
#if CONFIG_VP9_TEMPORAL_DENOISING
#ifdef OUTPUT_YUV_DENOISED
@@ -5228,8 +5254,10 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
cpi->force_update_segmentation = 0;
+#if !CONFIG_REALTIME_ONLY
if (cpi->oxcf.aq_mode == LOOKAHEAD_AQ)
vp9_alt_ref_aq_unset_all(cpi->alt_ref_aq, cpi);
+#endif
cpi->svc.previous_frame_is_intra_only = cm->intra_only;
cpi->svc.set_intra_only_frame = 0;
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index ddba3275e..738b1415e 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -29,7 +29,9 @@
#include "vp9/common/vp9_thread_common.h"
#include "vp9/common/vp9_onyxc_int.h"
+#if !CONFIG_REALTIME_ONLY
#include "vp9/encoder/vp9_alt_ref_aq.h"
+#endif
#include "vp9/encoder/vp9_aq_cyclicrefresh.h"
#include "vp9/encoder/vp9_context_tree.h"
#include "vp9/encoder/vp9_encodemb.h"
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index 6c7c4e0f8..abe6caa59 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -31,6 +31,9 @@
#include "vp9/common/vp9_scan.h"
#include "vp9/common/vp9_seg_common.h"
+#if !CONFIG_REALTIME_ONLY
+#include "vp9/encoder/vp9_aq_variance.h"
+#endif
#include "vp9/encoder/vp9_cost.h"
#include "vp9/encoder/vp9_encodemb.h"
#include "vp9/encoder/vp9_encodemv.h"
@@ -40,7 +43,6 @@
#include "vp9/encoder/vp9_ratectrl.h"
#include "vp9/encoder/vp9_rd.h"
#include "vp9/encoder/vp9_rdopt.h"
-#include "vp9/encoder/vp9_aq_variance.h"
#define LAST_FRAME_MODE_MASK \
((1 << GOLDEN_FRAME) | (1 << ALTREF_FRAME) | (1 << INTRA_FRAME))
@@ -81,6 +83,8 @@ struct rdcost_block_args {
};
#define LAST_NEW_MV_INDEX 6
+
+#if !CONFIG_REALTIME_ONLY
static const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
{ NEARESTMV, { LAST_FRAME, NONE } },
{ NEARESTMV, { ALTREF_FRAME, NONE } },
@@ -128,6 +132,7 @@ static const REF_DEFINITION vp9_ref_order[MAX_REFS] = {
{ { ALTREF_FRAME, NONE } }, { { LAST_FRAME, ALTREF_FRAME } },
{ { GOLDEN_FRAME, ALTREF_FRAME } }, { { INTRA_FRAME, NONE } },
};
+#endif // !CONFIG_REALTIME_ONLY
static void swap_block_ptr(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, int m, int n,
int min_plane, int max_plane) {
@@ -154,6 +159,7 @@ static void swap_block_ptr(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx, int m, int n,
}
}
+#if !CONFIG_REALTIME_ONLY
static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x,
MACROBLOCKD *xd, int *out_rate_sum,
int64_t *out_dist_sum, int *skip_txfm_sb,
@@ -278,6 +284,7 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize, MACROBLOCK *x,
*out_rate_sum = (int)rate_sum;
*out_dist_sum = dist_sum << VP9_DIST_SCALE_LOG2;
}
+#endif // !CONFIG_REALTIME_ONLY
#if CONFIG_VP9_HIGHBITDEPTH
int64_t vp9_highbd_block_error_c(const tran_low_t *coeff,
@@ -1517,6 +1524,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
return best_rd;
}
+#if !CONFIG_REALTIME_ONLY
static int64_t rd_sbuv_dcpred(const VP9_COMP *cpi, MACROBLOCK *x, int *rate,
int *rate_tokenonly, int64_t *distortion,
int *skippable, BLOCK_SIZE bsize) {
@@ -1728,6 +1736,7 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi, MACROBLOCK *x,
return RDCOST(x->rdmult, x->rddiv, *labelyrate, *distortion);
}
+#endif // !CONFIG_REALTIME_ONLY
typedef struct {
int eobs;
@@ -1790,6 +1799,7 @@ static INLINE int mv_has_subpel(const MV *mv) {
return (mv->row & 0x0F) || (mv->col & 0x0F);
}
+#if !CONFIG_REALTIME_ONLY
// Check if NEARESTMV/NEARMV/ZEROMV is the cheapest way encode zero motion.
// TODO(aconverse): Find out if this is still productive then clean up or remove
static int check_best_zero_mv(const VP9_COMP *cpi,
@@ -2651,6 +2661,7 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
for (i = 0; i < MAX_MB_PLANE; i++) xd->plane[i].pre[0] = backup_yv12[i];
}
}
+#endif // !CONFIG_REALTIME_ONLY
static INLINE void restore_dst_buf(MACROBLOCKD *xd,
uint8_t *orig_dst[MAX_MB_PLANE],
@@ -2662,6 +2673,7 @@ static INLINE void restore_dst_buf(MACROBLOCKD *xd,
}
}
+#if !CONFIG_REALTIME_ONLY
// In some situations we want to discount tha pparent cost of a new motion
// vector. Where there is a subtle motion field and especially where there is
// low spatial complexity then it can be hard to cover the cost of a new motion
@@ -3075,6 +3087,7 @@ static int64_t handle_inter_mode(
restore_dst_buf(xd, orig_dst, orig_dst_stride);
return 0; // The rate-distortion cost will be re-calculated by caller.
}
+#endif // !CONFIG_REALTIME_ONLY
void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost,
BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
@@ -3128,6 +3141,7 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *rd_cost,
rd_cost->rdcost = RDCOST(x->rdmult, x->rddiv, rd_cost->rate, rd_cost->dist);
}
+#if !CONFIG_REALTIME_ONLY
// This function is designed to apply a bias or adjustment to an rd value based
// on the relative variance of the source and reconstruction.
#define LOW_VAR_THRESH 250
@@ -3217,6 +3231,7 @@ static void rd_variance_adjustment(VP9_COMP *cpi, MACROBLOCK *x,
(void)xd;
}
+#endif // !CONFIG_REALTIME_ONLY
// Do we have an internal image edge (e.g. formatting bars).
int vp9_internal_image_edge(VP9_COMP *cpi) {
@@ -3287,6 +3302,7 @@ int vp9_active_edge_sb(VP9_COMP *cpi, int mi_row, int mi_col) {
vp9_active_v_edge(cpi, mi_col, MI_BLOCK_SIZE);
}
+#if !CONFIG_REALTIME_ONLY
void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
MACROBLOCK *x, int mi_row, int mi_col,
RD_COST *rd_cost, BLOCK_SIZE bsize,
@@ -3779,7 +3795,6 @@ void vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, TileDataEnc *tile_data,
}
}
}
-
// Apply an adjustment to the rd value based on the similarity of the
// source variance and reconstructed variance.
rd_variance_adjustment(cpi, x, bsize, &this_rd, recon, ref_frame,
@@ -4748,3 +4763,4 @@ void vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, TileDataEnc *tile_data,
store_coding_context(x, ctx, best_ref_index, best_pred_diff, best_filter_diff,
0);
}
+#endif // !CONFIG_REALTIME_ONLY
diff --git a/vp9/encoder/vp9_rdopt.h b/vp9/encoder/vp9_rdopt.h
index 8b810bc47..e1147ff94 100644
--- a/vp9/encoder/vp9_rdopt.h
+++ b/vp9/encoder/vp9_rdopt.h
@@ -29,6 +29,7 @@ void vp9_rd_pick_intra_mode_sb(struct VP9_COMP *cpi, struct macroblock *x,
struct RD_COST *rd_cost, BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx, int64_t best_rd);
+#if !CONFIG_REALTIME_ONLY
void vp9_rd_pick_inter_mode_sb(struct VP9_COMP *cpi,
struct TileDataEnc *tile_data,
struct macroblock *x, int mi_row, int mi_col,
@@ -39,18 +40,21 @@ void vp9_rd_pick_inter_mode_sb_seg_skip(
struct VP9_COMP *cpi, struct TileDataEnc *tile_data, struct macroblock *x,
struct RD_COST *rd_cost, BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
int64_t best_rd_so_far);
+#endif
int vp9_internal_image_edge(struct VP9_COMP *cpi);
int vp9_active_h_edge(struct VP9_COMP *cpi, int mi_row, int mi_step);
int vp9_active_v_edge(struct VP9_COMP *cpi, int mi_col, int mi_step);
int vp9_active_edge_sb(struct VP9_COMP *cpi, int mi_row, int mi_col);
+#if !CONFIG_REALTIME_ONLY
void vp9_rd_pick_inter_mode_sub8x8(struct VP9_COMP *cpi,
struct TileDataEnc *tile_data,
struct macroblock *x, int mi_row, int mi_col,
struct RD_COST *rd_cost, BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx,
int64_t best_rd_so_far);
+#endif
#ifdef __cplusplus
} // extern "C"
diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c
index 64881a5f9..529dca040 100644
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -20,6 +20,7 @@ static MESH_PATTERN best_quality_mesh_pattern[MAX_MESH_STEP] = {
{ 64, 4 }, { 28, 2 }, { 15, 1 }, { 7, 1 }
};
+#if !CONFIG_REALTIME_ONLY
// Define 3 mesh density levels to control the number of searches.
#define MESH_DENSITY_LEVELS 3
static MESH_PATTERN
@@ -385,6 +386,7 @@ static void set_good_speed_feature_framesize_independent(VP9_COMP *cpi,
sf->simple_model_rd_from_var = 1;
}
}
+#endif // !CONFIG_REALTIME_ONLY
static void set_rt_speed_feature_framesize_dependent(VP9_COMP *cpi,
SPEED_FEATURES *sf,
@@ -832,11 +834,12 @@ void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi, int speed) {
sf->rd_ml_partition.search_early_termination = 0;
sf->rd_ml_partition.search_breakout = 0;
- if (oxcf->mode == REALTIME) {
+ if (oxcf->mode == REALTIME)
set_rt_speed_feature_framesize_dependent(cpi, sf, speed);
- } else if (oxcf->mode == GOOD) {
+#if !CONFIG_REALTIME_ONLY
+ else if (oxcf->mode == GOOD)
set_good_speed_feature_framesize_dependent(cpi, sf, speed);
- }
+#endif
if (sf->disable_split_mask == DISABLE_ALL_SPLIT) {
sf->adaptive_pred_interp_filter = 0;
@@ -866,7 +869,9 @@ void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi, int speed) {
void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi, int speed) {
SPEED_FEATURES *const sf = &cpi->sf;
+#if !CONFIG_REALTIME_ONLY
VP9_COMMON *const cm = &cpi->common;
+#endif
MACROBLOCK *const x = &cpi->td.mb;
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
int i;
@@ -979,8 +984,10 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi, int speed) {
if (oxcf->mode == REALTIME)
set_rt_speed_feature_framesize_independent(cpi, sf, speed, oxcf->content);
+#if !CONFIG_REALTIME_ONLY
else if (oxcf->mode == GOOD)
set_good_speed_feature_framesize_independent(cpi, cm, sf, speed);
+#endif
cpi->diamond_search_sad = vp9_diamond_search_sad;
diff --git a/vp9/vp9cx.mk b/vp9/vp9cx.mk
index 1b276bfb1..736ff0170 100644
--- a/vp9/vp9cx.mk
+++ b/vp9/vp9cx.mk
@@ -154,5 +154,13 @@ VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_temporal_filter.c
VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/x86/temporal_filter_sse4.c
VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/x86/temporal_filter_constants.h
VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/x86/highbd_temporal_filter_sse4.c
+VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_alt_ref_aq.h
+VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_alt_ref_aq.c
+VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_aq_variance.c
+VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_aq_variance.h
+VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_aq_360.c
+VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_aq_360.h
+VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_aq_complexity.c
+VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_aq_complexity.h
VP9_CX_SRCS-yes := $(filter-out $(VP9_CX_SRCS_REMOVE-yes),$(VP9_CX_SRCS-yes))