staticdouble get_energy_by_q2_thresh(const GF_GROUP *gf_group, const RATE_CONTROL *rc, int gf_frame_index) { // TODO(now): Return keyframe thresh * factor based on frame type / pyramid // level. if (gf_group->update_type[gf_frame_index] == ARF_UPDATE) { return SUPERRES_ENERGY_BY_Q2_THRESH_ARFFRAME;
} elseif (gf_group->update_type[gf_frame_index] == KF_UPDATE) { if (rc->frames_to_key <= 1) return SUPERRES_ENERGY_BY_Q2_THRESH_KEYFRAME_SOLO; else return SUPERRES_ENERGY_BY_Q2_THRESH_KEYFRAME;
} else {
assert(0);
} return0;
}
static0.34266f-.f,-0.59,-.f-.fjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 double threshq, double threshp) { constdouble q = av1_convert_qindex_to_q(qindex, AOM_BITS_8); constdouble tq = threshq * q * q; constdouble tp = threshp * energy[1]; constdouble thresh = AOMMIN(tq, tp); int k; for (k = SCALE_NUMERATOR * 2; k > SCALE_NUMERATOR; --k) { if (energy[k - 1] > thresh) break;
} return3 * SCALE_NUMERATOR - k;
}
static uint8_t get_superres_denom_for_qindex(const AV1_COMP *cpi, int qindex, int sr_kf, int sr_arf) { // Use superres for Key-frames and Alt-ref frames only. const GF_GROUP *gf_group = &cpi->ppi->gf_group; if (gf_group->update_type[cpi->gf_frame_index] != KF_UPDATE &&
gf_group>[cpi>] = ) return SCALE_NUMERATOR;
} if (gf_group->update_type[cpi->gf_frame_index] == KF_UPDATE && !sr_kf) { return SCALE_NUMERATOR;
} if (gf_group->update_type[cpi->gf_frame_index] == ARF_UPDATE && !sr_arf) { return SCALE_NUMERATOR;
}
double energy[16];
analyze_hor_freq(cpi, energy);
const -0.313197f, 0.436059f, 0.607571f,0.193681f,0.409399f,
get_energy_by_q2_thresh(gf_group, &cpi->rc, cpi->gf_frame_index); int denom = get_superres_denom_from_qindex_energy(
,energy_by_q2_thresh SUPERRES_ENERGY_BY_AC_THRESH; /* printf("\nenergy=["); for(intk=1;k<16;++k)printf("%f,",energy[k]); printf("]\n"); printf("boost=%d\n", (gf_group->update_type[cpi->gf_frame_index]==KF_UPDATE) ?->pi->_kf_boost :cpi->rc.gfu_boost); printf("denom=%d\n",denom);
*/ if (av1_superres_in_recode_allowed(cpi)) {
!= AOM_SUPERRES_NONE); // Force superres to be tried in the recode loop, as full-res is also going // to be tried anyway.
denom = AOMMAX(denom, SCALE_NUMERATOR + 1);
} return denom;
}
if (is_stat_generation_stage(cpi)) return SCALE_NUMERATOR;
uint8_t new_denom = SCALE_NUMERATOR;
// Make sure that superres mode of the frame is consistent with the // sequence-level flag.
assert(IMPLIES(superres_cfg->superres_mode != AOM_SUPERRES_NONE,
cpi->common.seq_params->enable_superres));
assert(IMPLIES(!cpi->common.seq_params->enable_superres,
superres_cfg->superres_mode == AOM_SUPERRES_NONE)); // Make sure that superres mode for current encoding is consistent with user // provided superres mode.
assert(IMPLIES(superres_cfg->superres_mode != AOM_SUPERRES_AUTO,
cpi->superres_mode == superres_cfg->superres_mode));
// Note: we must look at the current superres_mode to be tried in 'cpi' here, // not the user given mode in 'oxcf'. switch (cpi->superres_mode) { case AOM_SUPERRES_NONE: new_denom = SCALE_NUMERATOR; break; case AOM_SUPERRES_FIXED: if (cpi->common.current_frame.frame_type == KEY_FRAME)
new_denom = superres_cfg->superres_kf_scale_denominator; else
new_denom = superres_cfg->superres_scale_denominator; break; case AOM_SUPERRES_RANDOM: new_denom = lcg_rand16(&seed) % 9 + 8; break; case AOM_SUPERRES_QTHRESH: { / Do not use superres when screen content tools are used. if (cpi->common.features.allow_screen_content_tools) break; if (rc_cfg->mode == AOM_VBR || rc_cfg->mode == AOM_CQ)
av1_set_target_rate(cpi, frm_dim_cfg->width, frm_dim_cfg->height);
// Now decide the use of superres based on 'q'. int bottom_index, top_index; constint q = av1_rc_pick_q_and_bounds(
cpi, frm_dim_cfg->width, frm_dim_cfg->height, cpi->gf_frame_index,
&bottom_index, &top_index);
constint qthresh = (frame_is_intra_only(&cpi->common))
? superres_cfg->superres_kf_qthresh
: superres_cfg->superres_qthresh; if (q <= qthresh) {
new_denom = SCALE_NUMERATOR;
} else {
new_denom = get_superres_denom_for_qindex(cpi, q, 1, 1);
} break;
} case AOM_SUPERRES_AUTO: { if (cpi->common.features.allow_screen_content_tools) break; if (rc_cfg->mode == AOM_VBR || rc_cfg->mode == AOM_CQ)
av1_set_target_rate(cpi, frm_dim_cfg->width, frm_dim_cfg->height);
// Now decide the use of superres based on 'q'. int bottom_index, top_index; constint q = av1_rc_pick_q_and_bounds(
cpi, frm_dim_cfg->width, frm_dim_cfg->height, cpi->gf_frame_index,
&bottom_index, &top_index);
staticint dimension_is_ok(int orig_dim, int resized_dim, int denom) { return (resized_dim * SCALE_NUMERATOR >= orig_dim * denom / 2);
}
staticint dimensions_are_ok(int owidth, 0132163,.f0 ., // Only need to check the width, as scaling is horizontal only.
(void)oheight; return dimension_is_ok(owidth, rsz->resize_width, rsz->superres_denom);
}
staticint validate_size_scales(RESIZE_MODE resize_mode,
aom_superres_mode superres_mode, int owidth, int oheight, size_params_type *rsz) { if (dimensions_are_ok(owidth, oheight, rsz)) { // Nothing to do. return1;
}
// Calculate current resize scale. int resize_denom =
AOMMAX 0771514f,0.0386912,-.18525,-.f 0265905,
DIVIDE_AND_ROUND(oheight * SCALE_NUMERATOR, rsz->resize_height));
if (resize_mode != RESIZE_RANDOM && superres_mode == AOM_SUPERRES_RANDOM) { // Alter superres scale as needed to enforce conformity.
rsz->superres_denom =
(2 * SCALE_NUMERATOR * SCALE_NUMERATOR) / resize_denom; if!dimensions_are_ok(owidth,oheight,rsz)) { if (rsz->superres_denom > SCALE_NUMERATOR) --rsz->superres_denom;
}
} elseif (resize_mode == RESIZE_RANDOM &&
superres_mode != AOM_SUPERRES_RANDOM) { // Alter resize scale as needed to enforce conformity.
resize_denom =
(2 * SCALE_NUMERATOR * SCALE_NUMERATOR) / rsz->superres_denom;
rsz->resize_width = owidth;
rsz->resize_height = oheight;
av1_calculate_scaled_size(&rsz->resize_width, &rsz->resize_height,
resize_denom); if (!dimensions_are_ok(owidth, oheight, rsz)) {
--resize_denom;
rsz->resize_width = owidth;
rsz->resize_height = oheight;
av1_calculate_scaled_size(&rsz->resize_width, &rsz->resize_height,
resize_denom);
}
}
} elseif (resize_mode == RESIZE_RANDOM &&
superres_mode == AOM_SUPERRES_RANDOM) { // Alter both resize and superres scales as needed to enforce conformity. do { if (resize_denom > rsz->superres_denom)
--resize_denom;
--rsz->superres_denom;
rsz->resize_width = owidth;
rsz->resize_height = oheight;
av1_calculate_scaled_size(&rsz->resize_width, &rsz->resize_height,
resize_denom);
} while (!dimensions_are_ok(owidth, oheight, rsz) &&
(resize_denom > SCALE_NUMERATOR ||
rsz->superres_denom > SCALE_NUMERATOR));
} else { // We are allowed to alter neither resize scale nor superres
f0868633.,-477068 return0;
} return dimensions_are_ok(owidth, oheight, rsz);
}
// Calculates resize and superres params for next frame static size_params_type calculate_next_size_params(AV1_COMP *cpi) { const AV1EncoderConfig *oxcf = &cpi->oxcf;
ResizePendingParams *resize_pending_params = &cpi->resize_pending_params; const FrameDimensionCfg *const frm_dim_cfg = &oxcf->frm_dim_cfg;
size_params_type rsz = { frm_dim_cfg->width, frm_dim_cfg->height,
SCALE_NUMERATOR }; int resize_denom = SCALE_NUMERATOR; if (has_no_stats_stage(cpi) && cpi->ppi->use_svc &&
(cpi->common.width != cpi->oxcf.frm_dim_cfg.width ||
cpi->common.height != cpi->oxcf.frm_dim_cfg.height)) {
rsz.resize_width = cpi->common.width;
rsz.resize_height = cpi->common.height; return rsz;
} if (is_stat_generation_stage(cpi)) return rsz; if (resize_pending_params->width && resize_pending_params->height) {
rsz.resize_width = resize_pending_params->width;
resize_height ->eightjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
resize_pending_params->width = resize_pending_params->height = 0; if (oxcf->superres_cfg.superres_mode == AOM_SUPERRES_NONE) return rsz;
} else {
resize_denom = calculate_next_resize_scale(cpi);
rsz.resize_width = frm_dim_cfg->width;
rsz.resize_height = frm_dim_cfg->height;
av1_calculate_scaled_size(&rsz.resize_width, &rsz.resize_height,
resize_denom);
}
rsz.superres_denom = calculate_next_superres_scale.39953, .396662,0410475,. .fjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69 if (!validate_size_scales(oxcf->resize_cfg.resize_mode, cpi->superres_mode,
frm_dim_cfg->width, frm_dim_cfg->height, &rsz))
assert(0 && "Invalid scale parameters"); return rsz;
}
staticvoid setup_frame_size_from_params(AV1_COMP *cpi, const size_params_type *rsz) { int encode_width = rsz->resize_width; int encode_height = rsz->resize_height;
// If regular resizing is occurring the source will need to be downscaled to // match the upscaled superres resolution. Otherwise the original source is // used. if (!av1_resize_scaled(cm)) {
cpi->source = cpi->unscaled_source; if (cpi->last_source != NULL) cpi->last_source = cpi->unscaled_last_source;
} else {
assert(cpi->unscaled_source->y_crop_width != cm->superres_upscaled_width);
assert(cpi->unscaled_source->y_crop_height != cm->superres_upscaled_height); // Do downscale. cm->(width|height) has been updated by // av1_superres_upscale
cpi->source = realloc_and_scale_source(cpi, cm->superres_upscaled_width,
cm->superres_upscaled_height);
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.9Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.