Merge "remove vp9_firstpass.c w/CONFIG_REALTIME_ONLY"
This commit is contained in:
@@ -2105,6 +2105,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
|
||||
|
||||
cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED;
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
if (oxcf->pass == 1) {
|
||||
vp9_init_first_pass(cpi);
|
||||
} else if (oxcf->pass == 2) {
|
||||
@@ -2169,6 +2170,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
|
||||
vp9_init_second_pass(cpi);
|
||||
}
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
|
||||
vp9_set_speed_features_framesize_independent(cpi);
|
||||
vp9_set_speed_features_framesize_dependent(cpi);
|
||||
@@ -3260,6 +3262,7 @@ static void set_frame_size(VP9_COMP *cpi) {
|
||||
VP9EncoderConfig *const oxcf = &cpi->oxcf;
|
||||
MACROBLOCKD *const xd = &cpi->td.mb.e_mbd;
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
if (oxcf->pass == 2 && oxcf->rc_mode == VPX_VBR &&
|
||||
((oxcf->resize_mode == RESIZE_FIXED && cm->current_video_frame == 0) ||
|
||||
(oxcf->resize_mode == RESIZE_DYNAMIC && cpi->resize_pending))) {
|
||||
@@ -3270,6 +3273,7 @@ static void set_frame_size(VP9_COMP *cpi) {
|
||||
vp9_set_size_literal(cpi, oxcf->scaled_frame_width,
|
||||
oxcf->scaled_frame_height);
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
|
||||
if (oxcf->pass == 0 && oxcf->rc_mode == VPX_CBR && !cpi->use_svc &&
|
||||
oxcf->resize_mode == RESIZE_DYNAMIC && cpi->resize_pending != 0) {
|
||||
@@ -4496,6 +4500,7 @@ static void Pass0Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
|
||||
encode_frame_to_data_rate(cpi, size, dest, frame_flags);
|
||||
}
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
static void Pass2Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
|
||||
unsigned int *frame_flags) {
|
||||
cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED;
|
||||
@@ -4504,6 +4509,7 @@ static void Pass2Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
|
||||
if (!(is_two_pass_svc(cpi) && cpi->svc.encode_empty_frame_state == ENCODING))
|
||||
vp9_twopass_postencode_update(cpi);
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
|
||||
static void init_ref_frame_bufs(VP9_COMMON *cm) {
|
||||
int i;
|
||||
@@ -5079,10 +5085,12 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
|
||||
|
||||
} else {
|
||||
*size = 0;
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
if (flush && oxcf->pass == 1 && !cpi->twopass.first_pass_done) {
|
||||
vp9_end_first_pass(cpi); /* get last stats packet */
|
||||
cpi->twopass.first_pass_done = 1;
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -5129,6 +5137,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
|
||||
|
||||
cpi->frame_flags = *frame_flags;
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
if ((oxcf->pass == 2) &&
|
||||
(!cpi->use_svc || (is_two_pass_svc(cpi) &&
|
||||
cpi->svc.encode_empty_frame_state != ENCODING))) {
|
||||
@@ -5136,6 +5145,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
|
||||
} else if (oxcf->pass == 1) {
|
||||
set_frame_size(cpi);
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
|
||||
if (oxcf->pass != 1 && cpi->level_constraint.level_index >= 0 &&
|
||||
cpi->level_constraint.fail_flag == 0)
|
||||
@@ -5146,6 +5156,14 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
|
||||
}
|
||||
|
||||
cpi->td.mb.fp_src_pred = 0;
|
||||
#if CONFIG_REALTIME_ONLY
|
||||
if (cpi->use_svc) {
|
||||
SvcEncode(cpi, size, dest, frame_flags);
|
||||
} else {
|
||||
// One pass encode
|
||||
Pass0Encode(cpi, size, dest, frame_flags);
|
||||
}
|
||||
#else // !CONFIG_REALTIME_ONLY
|
||||
if (oxcf->pass == 1 && (!cpi->use_svc || is_two_pass_svc(cpi))) {
|
||||
const int lossless = is_lossless_requested(oxcf);
|
||||
#if CONFIG_VP9_HIGHBITDEPTH
|
||||
@@ -5169,6 +5187,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
|
||||
// One pass encode
|
||||
Pass0Encode(cpi, size, dest, frame_flags);
|
||||
}
|
||||
#endif // CONFIG_REALTIME_ONLY
|
||||
|
||||
if (cm->refresh_frame_context)
|
||||
cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
|
||||
|
@@ -217,6 +217,7 @@ void vp9_encode_tiles_mt(VP9_COMP *cpi) {
|
||||
}
|
||||
}
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
static void accumulate_fp_tile_stat(TileDataEnc *tile_data,
|
||||
TileDataEnc *tile_data_t) {
|
||||
tile_data->fp_data.intra_factor += tile_data_t->fp_data.intra_factor;
|
||||
@@ -251,6 +252,7 @@ static void accumulate_fp_tile_stat(TileDataEnc *tile_data,
|
||||
: VPXMIN(tile_data->fp_data.image_data_start_row,
|
||||
tile_data_t->fp_data.image_data_start_row);
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
|
||||
// Allocate memory for row synchronization
|
||||
void vp9_row_mt_sync_mem_alloc(VP9RowMTSync *row_mt_sync, VP9_COMMON *cm,
|
||||
@@ -379,6 +381,7 @@ void vp9_row_mt_sync_write_dummy(VP9RowMTSync *const row_mt_sync, int r, int c,
|
||||
return;
|
||||
}
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
static int first_pass_worker_hook(EncWorkerData *const thread_data,
|
||||
MultiThreadHandle *multi_thread_ctxt) {
|
||||
VP9_COMP *const cpi = thread_data->cpi;
|
||||
@@ -468,6 +471,7 @@ void vp9_encode_fp_row_mt(VP9_COMP *cpi) {
|
||||
accumulate_fp_tile_stat(first_tile_col, this_tile);
|
||||
}
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
|
||||
static int temporal_filter_worker_hook(EncWorkerData *const thread_data,
|
||||
MultiThreadHandle *multi_thread_ctxt) {
|
||||
|
@@ -352,6 +352,7 @@ void vp9_save_layer_context(VP9_COMP *const cpi) {
|
||||
}
|
||||
}
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
void vp9_init_second_pass_spatial_svc(VP9_COMP *cpi) {
|
||||
SVC *const svc = &cpi->svc;
|
||||
int i;
|
||||
@@ -367,6 +368,7 @@ void vp9_init_second_pass_spatial_svc(VP9_COMP *cpi) {
|
||||
}
|
||||
svc->spatial_layer_id = 0;
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
|
||||
void vp9_inc_frame_in_layer(VP9_COMP *const cpi) {
|
||||
LAYER_CONTEXT *const lc =
|
||||
|
@@ -176,7 +176,11 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
|
||||
RANGE_CHECK_HI(cfg, rc_dropframe_thresh, 100);
|
||||
RANGE_CHECK_HI(cfg, rc_resize_up_thresh, 100);
|
||||
RANGE_CHECK_HI(cfg, rc_resize_down_thresh, 100);
|
||||
#if CONFIG_REALTIME_ONLY
|
||||
RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_ONE_PASS);
|
||||
#else
|
||||
RANGE_CHECK(cfg, g_pass, VPX_RC_ONE_PASS, VPX_RC_LAST_PASS);
|
||||
#endif
|
||||
RANGE_CHECK(extra_cfg, min_gf_interval, 0, (MAX_LAG_BUFFERS - 1));
|
||||
RANGE_CHECK(extra_cfg, max_gf_interval, 0, (MAX_LAG_BUFFERS - 1));
|
||||
if (extra_cfg->max_gf_interval > 0) {
|
||||
@@ -269,6 +273,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
|
||||
if (extra_cfg->tuning == VP8_TUNE_SSIM)
|
||||
ERROR("Option --tune=ssim is not currently supported in VP9.");
|
||||
|
||||
#if !CONFIG_REALTIME_ONLY
|
||||
if (cfg->g_pass == VPX_RC_LAST_PASS) {
|
||||
const size_t packet_sz = sizeof(FIRSTPASS_STATS);
|
||||
const int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz);
|
||||
@@ -320,6 +325,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
|
||||
ERROR("rc_twopass_stats_in missing EOS stats packet");
|
||||
}
|
||||
}
|
||||
#endif // !CONFIG_REALTIME_ONLY
|
||||
|
||||
#if !CONFIG_VP9_HIGHBITDEPTH
|
||||
if (cfg->g_profile > (unsigned int)PROFILE_1) {
|
||||
@@ -939,6 +945,10 @@ static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx,
|
||||
unsigned long deadline) {
|
||||
MODE new_mode = BEST;
|
||||
|
||||
#if CONFIG_REALTIME_ONLY
|
||||
(void)duration;
|
||||
deadline = VPX_DL_REALTIME;
|
||||
#else
|
||||
switch (ctx->cfg.g_pass) {
|
||||
case VPX_RC_ONE_PASS:
|
||||
if (deadline > 0) {
|
||||
@@ -959,6 +969,7 @@ static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx,
|
||||
case VPX_RC_FIRST_PASS: break;
|
||||
case VPX_RC_LAST_PASS: new_mode = deadline > 0 ? GOOD : BEST; break;
|
||||
}
|
||||
#endif // CONFIG_REALTIME_ONLY
|
||||
|
||||
if (deadline == VPX_DL_REALTIME) {
|
||||
ctx->oxcf.pass = 0;
|
||||
|
@@ -138,4 +138,7 @@ VP9_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/vp9_fdct8x8_msa.c
|
||||
VP9_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/vp9_fdct16x16_msa.c
|
||||
VP9_CX_SRCS-$(HAVE_MSA) += encoder/mips/msa/vp9_fdct_msa.h
|
||||
|
||||
# Strip unnecessary files with CONFIG_REALTIME_ONLY
|
||||
VP9_CX_SRCS_REMOVE-$(CONFIG_REALTIME_ONLY) += encoder/vp9_firstpass.c
|
||||
|
||||
VP9_CX_SRCS-yes := $(filter-out $(VP9_CX_SRCS_REMOVE-yes),$(VP9_CX_SRCS-yes))
|
||||
|
Reference in New Issue
Block a user