find_arf_order(gf_group, layer_depth, index_counter, depth + 1, mid + 1, end);
}
-static void define_gf_group_structure(VP9_COMP *cpi) {
+static int define_gf_group_structure(VP9_COMP *cpi) {
RATE_CONTROL *const rc = &cpi->rc;
TWO_PASS *const twopass = &cpi->twopass;
GF_GROUP *const gf_group = &twopass->gf_group;
(void)layer_depth;
- return;
+ return frame_index;
}
// Note index of the first normal inter frame int eh group (not gf kf arf)
// Note whether multi-arf was enabled this group for next time.
cpi->multi_arf_last_grp_enabled = cpi->multi_arf_enabled;
+
+ return frame_index;
}
static void allocate_gf_multi_arf_bits(VP9_COMP *cpi, int64_t gf_group_bits,
double this_frame_score = 1.0;
// Define the GF structure and specify
- define_gf_group_structure(cpi);
+ int gop_frames = define_gf_group_structure(cpi);
key_frame = cpi->common.frame_type == KEY_FRAME;
else
normal_frame_bits = (int)total_group_bits;
+ if (cpi->multi_layer_arf) {
+ int idx;
+ target_frame_size = normal_frame_bits;
+ target_frame_size =
+ clamp(target_frame_size, 0, VPXMIN(max_bits, (int)total_group_bits));
+
+ for (idx = frame_index; idx < gop_frames; ++idx) {
+ if (gf_group->update_type[idx] == USE_BUF_FRAME)
+ gf_group->bit_allocation[idx] = 0;
+ else
+ gf_group->bit_allocation[idx] = target_frame_size;
+ }
+ gf_group->bit_allocation[idx] = 0;
+
+ for (idx = 0; idx < gop_frames; ++idx)
+ if (gf_group->update_type[idx] == LF_UPDATE) break;
+ gf_group->first_inter_index = idx;
+
+ return;
+ }
+
if (oxcf->vbr_corpus_complexity) {
av_score = get_distribution_av_err(cpi, twopass);
tot_norm_frame_score = calculate_group_score(cpi, av_score, normal_frames);