Clean up fpmt configuration macros from fpmt unit test code
Cleaned up CONFIG_FRAME_PARALLEL_ENCODE and
CONFIG_FRAME_PARALLEL_ENCODE_2 from FPMT unit test related code. Now
the configuration macro CONFIG_FPMT_TEST is independent.
Change-Id: I9ab970c8d99395866d715162d0839ef486dec1a0
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 5291732..a3fc7b8 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -99,7 +99,7 @@
int film_grain_test_vector;
const char *film_grain_table_filename;
unsigned int motion_vector_unit_test;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
unsigned int fpmt_unit_test;
#endif
unsigned int cdf_update_mode;
@@ -270,7 +270,7 @@
0, // film_grain_test_vector
NULL, // film_grain_table_filename
0, // motion_vector_unit_test
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
0, // fpmt_unit_test
#endif
1, // CDF update mode
@@ -416,7 +416,7 @@
0, // film_grain_test_vector
NULL, // film_grain_table_filename
0, // motion_vector_unit_test
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
0, // fpmt_unit_test
#endif
1, // CDF update mode
@@ -676,7 +676,7 @@
RANGE_CHECK_HI(extra_cfg, cdf_update_mode, 2);
RANGE_CHECK_HI(extra_cfg, motion_vector_unit_test, 2);
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
RANGE_CHECK_HI(extra_cfg, fpmt_unit_test, 1);
#endif
RANGE_CHECK_HI(extra_cfg, sb_multipass_unit_test, 1);
@@ -2335,7 +2335,7 @@
static aom_codec_err_t ctrl_enable_fpmt_unit_test(aom_codec_alg_priv_t *ctx,
va_list args) {
-#if !(CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST)
+#if !CONFIG_FPMT_TEST
(void)args;
(void)ctx;
return AOM_CODEC_INCAPABLE;
@@ -2967,7 +2967,7 @@
cpi->ref_refresh_index = INVALID_IDX;
cpi->refresh_idx_available = false;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
simulate_parallel_frame =
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE ? 1 : 0;
if (simulate_parallel_frame) {
@@ -2980,7 +2980,7 @@
status = av1_get_compressed_data(cpi, &cpi_data);
}
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
if (!simulate_parallel_frame) {
if (ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
status = av1_get_compressed_data(cpi, &cpi_data);
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index ba9802b..a9d138a 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -188,8 +188,7 @@
// current frame
const int current_ref_type = get_current_frame_ref_type(cpi);
int wanted_fb = cpi->ppi->fb_of_context_type[current_ref_type];
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FRAME_PARALLEL_ENCODE_2 && \
- CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
GF_GROUP *const gf_group = &cpi->ppi->gf_group;
if (gf_group->update_type[cpi->gf_frame_index] == INTNL_ARF_UPDATE) {
@@ -207,8 +206,7 @@
}
}
}
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FRAME_PARALLEL_ENCODE_2 &&
- // CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
int primary_ref_frame = PRIMARY_REF_NONE;
for (int ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
if (get_ref_frame_map_idx(cm, ref_frame) == wanted_fb) {
@@ -345,11 +343,11 @@
frame_params->show_frame = *pop_lookahead;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_ENCODE) {
#else
{
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
// Future frame in parallel encode set
if (gf_group->src_offset[cpi->gf_frame_index] != 0 &&
!is_stat_generation_stage(cpi))
@@ -1023,11 +1021,11 @@
gf_group->frame_parallel_level[gf_index - 1] == 1 &&
gf_group->update_type[gf_index - 1] == INTNL_ARF_UPDATE) {
assert(gf_group->update_type[gf_index] == INTNL_ARF_UPDATE);
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
is_parallel_encode = (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_ENCODE)
? is_parallel_encode
: 0;
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
// If parallel cpis are active, use ref_idx_to_skip, else, use display
// index.
assert(IMPLIES(is_parallel_encode, cpi->ref_idx_to_skip != INVALID_IDX));
@@ -1261,11 +1259,11 @@
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
for (int i = 0; i < RATE_FACTOR_LEVELS; i++) {
cpi->rc.frame_level_rate_correction_factors[i] =
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE)
? cpi->ppi->p_rc.temp_rate_correction_factors[i]
:
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
cpi->ppi->p_rc.rate_correction_factors[i];
}
}
@@ -1343,13 +1341,13 @@
av1_apply_encoding_flags(cpi, source->flags);
*frame_flags = (source->flags & AOM_EFLAG_FORCE_KF) ? FRAMEFLAGS_KEY : 0;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
cpi->framerate = cpi->temp_framerate;
}
}
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
// Shown frames and arf-overlay frames need frame-rate considering
if (frame_params.show_frame)
@@ -1463,10 +1461,10 @@
cpi->common.current_frame.frame_number + order_offset;
int get_ref_frames = 0;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
get_ref_frames =
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 1 : 0;
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
if (get_ref_frames ||
gf_group->frame_parallel_level[cpi->gf_frame_index] == 0) {
if (!ext_flags->refresh_frame.update_pending) {
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index e0d6a16..b487907 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1370,7 +1370,7 @@
FeatureFlags *const features = &cm->features;
MACROBLOCKD *const xd = &x->e_mbd;
RD_COUNTS *const rdc = &cpi->td.rd_counts;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
FrameProbInfo *const temp_frame_probs = &cpi->ppi->temp_frame_probs;
FrameProbInfo *const temp_frame_probs_simulation =
&cpi->ppi->temp_frame_probs_simulation;
@@ -1409,11 +1409,11 @@
const FRAME_UPDATE_TYPE update_type =
get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
int warped_probability =
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE
? temp_frame_probs->warped_probs[update_type]
:
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
frame_probs->warped_probs[update_type];
if (warped_probability < cpi->sf.inter_sf.prune_warped_prob_thresh)
features->allow_warped_motion = 0;
@@ -1698,7 +1698,7 @@
const int new_prob =
sum ? MAX_TX_TYPE_PROB * cpi->td.rd_counts.tx_type_used[i][j] / sum
: (j ? 0 : MAX_TX_TYPE_PROB);
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] ==
0) {
@@ -1720,7 +1720,7 @@
}
update_txtype_frameprobs = 0;
}
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
// Track the frame probabilities of parallel encode frames to update
// during postencode stage.
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
@@ -1757,7 +1757,7 @@
const int new_prob =
sum ? 128 * cpi->td.rd_counts.obmc_used[i][1] / sum : 0;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
temp_frame_probs_simulation->obmc_probs[update_type][i] =
@@ -1773,7 +1773,7 @@
}
update_obmc_frameprobs = 0;
}
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
// Track the frame probabilities of parallel encode frames to update
// during postencode stage.
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
@@ -1796,7 +1796,7 @@
int sum = 0;
for (i = 0; i < 2; i++) sum += cpi->td.rd_counts.warped_used[i];
const int new_prob = sum ? 128 * cpi->td.rd_counts.warped_used[1] / sum : 0;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
temp_frame_probs_simulation->warped_probs[update_type] =
@@ -1812,7 +1812,7 @@
}
update_warp_frameprobs = 0;
}
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
// Track the frame probabilities of parallel encode frames to update
// during postencode stage.
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
@@ -1846,7 +1846,7 @@
const int new_prob =
sum ? 1536 * cpi->td.counts->switchable_interp[i][j] / sum
: (j ? 0 : 1536);
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] ==
0) {
@@ -1868,7 +1868,7 @@
}
update_interpfilter_frameprobs = 0;
}
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
// Track the frame probabilities of parallel encode frames to update
// during postencode stage.
if (cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) {
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index ef02ec0..8254214 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -2385,10 +2385,10 @@
}
int scale_references = 0;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
scale_references =
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE ? 1 : 0;
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
if (scale_references ||
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
// For SVC the inter-layer/spatial prediction is not done for newmv
@@ -2639,10 +2639,10 @@
}
int scale_references = 0;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
scale_references =
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE ? 1 : 0;
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
if (scale_references ||
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
if (!frame_is_intra_only(cm)) {
@@ -3623,10 +3623,10 @@
}
int release_scaled_refs = 0;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
release_scaled_refs =
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 1 : 0;
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
if (release_scaled_refs ||
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] == 0) {
if (frame_is_intra_only(cm) == 0) {
@@ -4245,7 +4245,7 @@
}
}
int update_actual_stats = 1;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
update_actual_stats =
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
if (!update_actual_stats) {
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index cecdc8d..81e508e 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -135,13 +135,13 @@
FRAMEFLAGS_ERROR_RESILIENT = 1 << 6,
} UENUM1BYTE(FRAMETYPE_FLAGS);
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
enum {
PARALLEL_ENCODE = 0,
PARALLEL_SIMULATION_ENCODE,
NUM_FPMT_TEST_ENCODES
} UENUM1BYTE(FPMT_TEST_ENC_CFG);
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
// 0 level frames are sometimes used for rate control purposes, but for
// reference mapping purposes, the minimum level should be 1.
#define MIN_PYR_LEVEL 1
@@ -2406,7 +2406,7 @@
* encode set.
*/
struct AV1_COMP_DATA parallel_frames_data[MAX_PARALLEL_FRAMES - 1];
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
/*!
* Flag which enables/disables simulation path for fpmt unit test.
* 0 - FPMT integration
@@ -2431,7 +2431,7 @@
* model across frames.
*/
int temp_valid_gm_model_found[FRAME_UPDATE_TYPES];
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
/*!
* Copy of cm->ref_frame_map maintained to facilitate sequential update of
* ref_frame_map by lower layer depth frames encoded ahead of time in a
@@ -2471,8 +2471,7 @@
/*!
* Encode stage top level structure
- * When CONFIG_FRAME_PARALLEL_ENCODE is enabled this is the same as
- * parallel_cpi[0]
+ * During frame parallel encode, this is the same as parallel_cpi[0]
*/
struct AV1_COMP *cpi;
@@ -3037,7 +3036,7 @@
*/
int do_update_frame_probs_interpfilter[NUM_RECODES_PER_FRAME];
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
/*!
* Temporary variable for simulation.
* Previous frame's framerate.
@@ -3272,7 +3271,7 @@
* encode set of lower layer frames.
*/
int ref_idx_to_skip;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
/*!
* Stores the wanted frame buffer index for choosing primary ref frame by a
* frame_parallel_level 2 frame in a parallel encode set of lower layer
@@ -3280,7 +3279,7 @@
*/
int wanted_fb;
-#endif // CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#endif // CONFIG_FPMT_TEST
/*!
* A flag to indicate frames that will update their data to the primary
@@ -3639,7 +3638,7 @@
}
}
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
static AOM_INLINE void calc_frame_data_update_flag(
GF_GROUP *const gf_group, int gf_frame_index,
bool *const do_frame_data_update) {
diff --git a/av1/encoder/encoder_utils.c b/av1/encoder/encoder_utils.c
index 7b093cb..9a2da28 100644
--- a/av1/encoder/encoder_utils.c
+++ b/av1/encoder/encoder_utils.c
@@ -311,7 +311,7 @@
struct segmentation *const seg = &cm->seg;
double avg_q;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
avg_q = ((cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) &&
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE))
? cpi->ppi->p_rc.temp_avg_q
@@ -914,7 +914,7 @@
AV1_COMMON *const cm = &cpi->common;
FeatureFlags *const features = &cm->features;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
projected_size_pass[pass] =
((cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0) &&
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE))
diff --git a/av1/encoder/encoder_utils.h b/av1/encoder/encoder_utils.h
index da73292..effdd2f 100644
--- a/av1/encoder/encoder_utils.h
+++ b/av1/encoder/encoder_utils.h
@@ -872,7 +872,7 @@
default_switchable_interp_probs);
}
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) {
FrameProbInfo *const temp_frame_probs = &cpi->ppi->temp_frame_probs;
if (cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats) {
diff --git a/av1/encoder/global_motion_facade.c b/av1/encoder/global_motion_facade.c
index 4fe4411..323b4e8 100644
--- a/av1/encoder/global_motion_facade.c
+++ b/av1/encoder/global_motion_facade.c
@@ -468,7 +468,7 @@
if (cpi->gf_frame_index == 0) {
for (int i = 0; i < FRAME_UPDATE_TYPES; i++) {
cpi->ppi->valid_gm_model_found[i] = INT32_MAX;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE)
cpi->ppi->temp_valid_gm_model_found[i] = INT32_MAX;
#endif
diff --git a/av1/encoder/interp_search.c b/av1/encoder/interp_search.c
index c313372..2b7eb91 100644
--- a/av1/encoder/interp_search.c
+++ b/av1/encoder/interp_search.c
@@ -448,7 +448,7 @@
int use_actual_frame_probs = 1;
const int *switchable_interp_p0;
const int *switchable_interp_p1;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
use_actual_frame_probs =
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
if (!use_actual_frame_probs) {
diff --git a/av1/encoder/pass2_strategy.c b/av1/encoder/pass2_strategy.c
index 0d6ee34..8d9818d 100644
--- a/av1/encoder/pass2_strategy.c
+++ b/av1/encoder/pass2_strategy.c
@@ -220,7 +220,7 @@
double rolling_arf_group_target_bits =
(double)twopass->rolling_arf_group_target_bits;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int is_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 ? 1 : 0;
const int simulate_parallel_frame =
@@ -4070,7 +4070,7 @@
p_rc->rate_error_estimate = 0;
}
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
/* The variables temp_vbr_bits_off_target, temp_bits_left,
* temp_rolling_arf_group_target_bits, temp_rolling_arf_group_actual_bits
* temp_rate_error_estimate are introduced for quality simulation purpose,
@@ -4202,7 +4202,7 @@
}
}
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
if (cpi->do_frame_data_update && !show_existing_between_parallel_frames &&
simulate_parallel_frame) {
cpi->ppi->p_rc.temp_vbr_bits_off_target_fast =
@@ -4216,7 +4216,7 @@
// Update the frame probabilities obtained from parallel encode frames
FrameProbInfo *const frame_probs = &cpi->ppi->frame_probs;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
/* The variable temp_active_best_quality is introduced only for quality
* simulation purpose, it retains the value previous to the parallel
* encode frames. The variable is updated based on the update flag.
@@ -4257,7 +4257,7 @@
for (j = TX_TYPES - 1; j >= 0; j--) {
const int new_prob =
cpi->frame_new_probs[loop].tx_type_probs[update_type][i][j];
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
int prob =
(temp_frame_probs_simulation->tx_type_probs[update_type][i][j] +
new_prob) >>
@@ -4285,7 +4285,7 @@
for (i = 0; i < BLOCK_SIZES_ALL; i++) {
const int new_prob =
cpi->frame_new_probs[loop].obmc_probs[update_type][i];
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
temp_frame_probs_simulation->obmc_probs[update_type][i] =
(temp_frame_probs_simulation->obmc_probs[update_type][i] +
new_prob) >>
@@ -4303,7 +4303,7 @@
const FRAME_UPDATE_TYPE update_type =
get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
const int new_prob = cpi->frame_new_probs[loop].warped_probs[update_type];
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
temp_frame_probs_simulation->warped_probs[update_type] =
(temp_frame_probs_simulation->warped_probs[update_type] + new_prob) >>
1;
@@ -4325,7 +4325,7 @@
for (j = SWITCHABLE_FILTERS - 1; j >= 0; j--) {
const int new_prob = cpi->frame_new_probs[loop]
.switchable_interp_probs[update_type][i][j];
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
int prob = (temp_frame_probs_simulation
->switchable_interp_probs[update_type][i][j] +
new_prob) >>
@@ -4348,7 +4348,7 @@
}
}
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
// Copying temp_frame_probs_simulation to temp_frame_probs based on
// the flag
if (cpi->do_frame_data_update &&
@@ -4382,7 +4382,7 @@
if (cpi->common.show_frame &&
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0)
cpi->framerate = cpi->new_framerate;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
// SIMULATION PURPOSE
int show_existing_between_parallel_frames_cndn =
(cpi->ppi->gf_group.update_type[cpi->gf_frame_index] ==
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c
index 40da4f4..bccb2cc 100644
--- a/av1/encoder/ratectrl.c
+++ b/av1/encoder/ratectrl.c
@@ -269,7 +269,7 @@
if (cpi->ppi->use_svc)
update_layer_buffer_level(&cpi->svc, encoded_frame_size);
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
/* The variable temp_buffer_level is introduced for quality
* simulation purpose, it retains the value previous to the parallel
* encode frames. The variable is updated based on the update flag.
@@ -400,7 +400,7 @@
const AV1EncoderConfig *oxcf = &cpi->oxcf;
RATE_CONTROL *const rc = &cpi->rc;
PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
@@ -873,7 +873,7 @@
int active_worst_quality;
int last_q_key_frame;
int last_q_inter_frame;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
@@ -1237,7 +1237,7 @@
av1_compute_qdelta(rc, q_val, q_val * 0.25, bit_depth);
active_best_quality = AOMMAX(qindex + delta_qindex, rc->best_quality);
} else if (p_rc->this_key_frame_forced) {
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
@@ -1352,7 +1352,7 @@
// Special case code to try and match quality with forced key frames
} else if ((current_frame->frame_type == KEY_FRAME) &&
p_rc->this_key_frame_forced) {
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
@@ -1448,7 +1448,7 @@
double last_boosted_q;
int delta_qindex;
int qindex;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
@@ -1535,7 +1535,7 @@
const int bit_depth = cpi->common.seq_params->bit_depth;
int active_best_quality = *active_best;
int active_worst_quality = *active_worst;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
@@ -1554,7 +1554,7 @@
(!rc->is_src_frame_alt_ref &&
(refresh_frame->golden_frame || is_intrl_arf_boost ||
refresh_frame->alt_ref_frame))) {
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
active_best_quality -= (extend_minq + extend_minq_fast);
active_worst_quality += (extend_maxq / 2);
#else
@@ -1563,7 +1563,7 @@
active_worst_quality += (cpi->ppi->twopass.extend_maxq / 2);
#endif
} else {
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
active_best_quality -= (extend_minq + extend_minq_fast) / 2;
active_worst_quality += extend_maxq;
#else
@@ -1625,7 +1625,7 @@
const RATE_CONTROL *const rc = &cpi->rc;
const PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
int q;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg;
@@ -1872,7 +1872,7 @@
active_best_quality = get_active_best_quality(cpi, active_worst_quality,
cq_level, gf_index);
} else {
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
@@ -2101,7 +2101,7 @@
// Update the Golden frame stats as appropriate.
update_golden_frame_stats(cpi);
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
/*The variables temp_avg_frame_qindex, temp_last_q, temp_avg_q,
* temp_last_boosted_qindex are introduced only for quality simulation
* purpose, it retains the value previous to the parallel encode frames. The
@@ -2293,7 +2293,7 @@
static void vbr_rate_correction(AV1_COMP *cpi, int *this_frame_target) {
RATE_CONTROL *const rc = &cpi->rc;
PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppi->p_rc;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
const int simulate_parallel_frame =
cpi->ppi->gf_group.frame_parallel_level[cpi->gf_frame_index] > 0 &&
cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE;
@@ -2320,7 +2320,7 @@
*this_frame_target += (vbr_bits_off_target >= 0) ? max_delta : -max_delta;
}
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
int64_t vbr_bits_off_target_fast =
simulate_parallel_frame ? cpi->ppi->p_rc.temp_vbr_bits_off_target_fast
: p_rc->vbr_bits_off_target_fast;
@@ -2328,7 +2328,7 @@
// Fast redistribution of bits arising from massive local undershoot.
// Dont do it for kf,arf,gf or overlay frames.
if (!frame_is_kf_gf_arf(cpi) &&
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
vbr_bits_off_target_fast &&
#else
p_rc->vbr_bits_off_target_fast &&
@@ -2336,7 +2336,7 @@
!rc->is_src_frame_alt_ref) {
int one_frame_bits = AOMMAX(rc->avg_frame_bandwidth, *this_frame_target);
int fast_extra_bits;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
fast_extra_bits = (int)AOMMIN(vbr_bits_off_target_fast, one_frame_bits);
fast_extra_bits =
(int)AOMMIN(fast_extra_bits,
diff --git a/av1/encoder/ratectrl.h b/av1/encoder/ratectrl.h
index 5ac9660..aef5bc5 100644
--- a/av1/encoder/ratectrl.h
+++ b/av1/encoder/ratectrl.h
@@ -355,7 +355,7 @@
*/
int avg_frame_qindex[FRAME_TYPES];
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
/*!
* Temporary variable used in simulating the delayed update of
* active_best_quality.
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 6185762..a51b200 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -1354,7 +1354,7 @@
get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
int use_actual_frame_probs = 1;
int prune_obmc;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
use_actual_frame_probs =
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
if (!use_actual_frame_probs) {
@@ -4052,7 +4052,7 @@
get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
int use_actual_frame_probs = 1;
int prune_obmc;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
use_actual_frame_probs =
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
if (!use_actual_frame_probs) {
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 6e288a0..b164ec3 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -129,7 +129,7 @@
{ 1, 1, 0 },
{ 1, 1, 1 } };
-#if !(CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST)
+#if !CONFIG_FPMT_TEST
// This table holds the maximum number of reference frames for global motion.
// The table is indexed as per the speed feature 'gm_search_type'.
// 0 : All reference frames are allowed.
@@ -2205,7 +2205,7 @@
sf->inter_sf.inter_mode_rd_model_estimation = 2;
}
-#if !(CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST)
+#if !CONFIG_FPMT_TEST
// Disable the speed feature 'prune_ref_frame_for_gm_search' to achieve
// better parallelism when number of threads available are greater than or
// equal to maximum number of reference frames allowed for global motion.
diff --git a/av1/encoder/tx_search.c b/av1/encoder/tx_search.c
index 095a883..c4eafdd 100644
--- a/av1/encoder/tx_search.c
+++ b/av1/encoder/tx_search.c
@@ -1737,7 +1737,7 @@
get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
int use_actual_frame_probs = 1;
const int *tx_type_probs;
-#if CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST
+#if CONFIG_FPMT_TEST
use_actual_frame_probs =
(cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
if (!use_actual_frame_probs) {
diff --git a/test/frame_parallel_enc_test.cc b/test/frame_parallel_enc_test.cc
index cb14d39..7508eb7 100644
--- a/test/frame_parallel_enc_test.cc
+++ b/test/frame_parallel_enc_test.cc
@@ -21,7 +21,7 @@
namespace {
-#if (CONFIG_FRAME_PARALLEL_ENCODE && CONFIG_FPMT_TEST && !CONFIG_REALTIME_ONLY)
+#if CONFIG_FPMT_TEST && !CONFIG_REALTIME_ONLY
class AVxFrameParallelThreadEncodeTest
: public ::libaom_test::CodecTestWith3Params<int, int, int>,
public ::libaom_test::EncoderTest {
@@ -192,7 +192,6 @@
AV1_INSTANTIATE_TEST_SUITE(AVxFrameParallelThreadEncodeLowResTest,
::testing::Values(4, 5, 6), ::testing::Values(1),
::testing::Values(0));
-#endif // CONFIG_FRAME_PARALLEL_ENCODE &&
- // CONFIG_FPMT_TEST && !CONFIG_REALTIME_ONLY
+#endif // CONFIG_FPMT_TEST && !CONFIG_REALTIME_ONLY
} // namespace
diff --git a/test/test.cmake b/test/test.cmake
index 016e19d..726d600 100644
--- a/test/test.cmake
+++ b/test/test.cmake
@@ -260,9 +260,7 @@
"${AOM_ROOT}/test/simd_neon_test.cc")
endif()
- if(CONFIG_FRAME_PARALLEL_ENCODE
- AND CONFIG_FPMT_TEST
- AND (NOT CONFIG_REALTIME_ONLY))
+ if(CONFIG_FPMT_TEST AND (NOT CONFIG_REALTIME_ONLY))
list(APPEND AOM_UNIT_TEST_COMMON_SOURCES
"${AOM_ROOT}/test/frame_parallel_enc_test.cc")
endif()