/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
// TODO(chengchen): can we simplify it even if resize has to be considered? staticint get_num_mbs(const BLOCK_SIZE fp_block_size, constint num_mbs_16X16) { constint width_mi_log2 = mi_size_wide_log2[fp_block_size]; constint height_mi_log2 = mi_size_high_log2[fp_block_size]; constint mb_width_mi_log2 = mi_size_wide_log2[BLOCK_16X16]; constint mb_height_mi_log2 = mi_size_high_log2[BLOCK_16X16]; // TODO(chengchen): Now this function assumes a square block is used. // It does not support rectangular block sizes.
assert(width_mi_log2 == height_mi_log2); if (width_mi_log2 > mb_width_mi_log2) { return num_mbs_16X16 >> ((width_mi_log2 - mb_width_mi_log2) +
(height_mi_log2 - mb_height_mi_log2));
}
// Refine the motion search range according to the frame dimension // for first pass test. staticint get_search_range(int width, int height) { int sr = 0; constint dim = AOMMIN(width, height);
while ((dim << sr) < MAX_FULL_PEL_VAL) ++sr; return sr;
}
// For AVIF applications, even the source frames can have changing resolution, // so we need to manually check for the strides :( // AV1_COMP::mv_search_params.search_site_config is a compressor level cache // that's shared by multiple threads. In most cases where all frames have the // same resolution, the cache contains the search site config that we need. const MotionVectorSearchParams *mv_search_params = &cpi->mv_search_params; if (ref_stride == mv_search_params->search_site_cfg[SS_CFG_FPF]->stride) { return mv_search_params->search_site_cfg[SS_CFG_FPF];
}
// If the cache does not contain the correct stride, then we will need to rely // on the thread level config MACROBLOCK::search_site_cfg_buf. If even the // thread level config doesn't match, then we need to update it.
search_method = search_method_lookup[search_method];
assert(search_method_lookup[search_method] == search_method && "The search_method_lookup table should be idempotent."); if (ref_stride != x->search_site_cfg_buf[search_method].stride) {
av1_refresh_search_site_config(x->search_site_cfg_buf, search_method,
ref_stride);
}
int i; for (i = 0; i < raw_motion_err_counts; i++) {
sum_raw_err += raw_motion_err_list[i];
}
raw_err_avg = (double)sum_raw_err / raw_motion_err_counts; for (i = 0; i < raw_motion_err_counts; i++) {
raw_err_stdev += (raw_motion_err_list[i] - raw_err_avg) *
(raw_motion_err_list[i] - raw_err_avg);
} // Calculate the standard deviation for the motion error of all the inter // blocks of the 0,0 motion using the last source // frame as the reference.
raw_err_stdev = sqrt(raw_err_stdev / raw_motion_err_counts); return raw_err_stdev;
}
// copy source data to recon buffer, as the recon buffer will be used as a // reference frame subsequently.
copy_rect(dst, dst_stride, src, src_stride, block_size_wide[bsize],
block_size_high[bsize], seq_params->use_highbitdepth);
}
#define UL_INTRA_THRESH 50 #define INVALID_ROW -1 // Computes and returns the intra pred error of a block. // intra pred error: sum of squared error of the intra predicted residual. // Inputs: // cpi: the encoder setting. Only a few params in it will be used. // this_frame: the current frame buffer. // tile: tile information (not used in first pass, already init to zero) // unit_row: row index in the unit of first pass block size. // unit_col: column index in the unit of first pass block size. // y_offset: the offset of y frame buffer, indicating the starting point of // the current block. // uv_offset: the offset of u and v frame buffer, indicating the starting // point of the current block. // fp_block_size: first pass block size. // qindex: quantization step size to encode the frame. // stats: frame encoding stats. // Modifies: // stats->intra_skip_count // stats->image_data_start_row // stats->intra_factor // stats->brightness_factor // stats->intra_error // stats->frame_avg_wavelet_energy // Returns: // this_intra_error. staticint firstpass_intra_prediction(
AV1_COMP *cpi, ThreadData *td, YV12_BUFFER_CONFIG *const this_frame, const TileInfo *const tile, constint unit_row, constint unit_col, constint y_offset, constint uv_offset, const BLOCK_SIZE fp_block_size, constint qindex, FRAME_STATS *const stats) { const AV1_COMMON *const cm = &cpi->common; const CommonModeInfoParams *const mi_params = &cm->mi_params; const SequenceHeader *const seq_params = cm->seq_params;
MACROBLOCK *const x = &td->mb;
MACROBLOCKD *const xd = &x->e_mbd; constint unit_scale = mi_size_wide[fp_block_size]; constint num_planes = av1_num_planes(cm); const BLOCK_SIZE bsize =
get_bsize(mi_params, fp_block_size, unit_row, unit_col);
int level_sample; if (seq_params->use_highbitdepth) {
level_sample = CONVERT_TO_SHORTPTR(x->plane[0].src.buf)[0];
} else {
level_sample = x->plane[0].src.buf[0];
}
if (seq_params->use_highbitdepth) { switch (seq_params->bit_depth) { case AOM_BITS_8: break; case AOM_BITS_10: level_sample >>= 2; break; case AOM_BITS_12: level_sample >>= 4; break; default:
assert(0 && "seq_params->bit_depth should be AOM_BITS_8, " "AOM_BITS_10 or AOM_BITS_12"); return -1;
}
} if ((level_sample < DARK_THRESH) && (log_intra < 9.0)) {
stats->brightness_factor += 1.0 + (0.01 * (DARK_THRESH - level_sample));
} else {
stats->brightness_factor += 1.0;
}
// Intrapenalty below deals with situations where the intra and inter // error scores are very low (e.g. a plain black frame). // We do not have special cases in first pass for 0,0 and nearest etc so // all inter modes carry an overhead cost estimate for the mv. // When the error score is very low this causes us to pick all or lots of // INTRA modes and throw lots of key frames. // This penalty adds a cost matching that of a 0,0 mv to the intra case.
this_intra_error += INTRA_MODE_PENALTY;
// Accumulate the intra error.
stats->intra_error += (int64_t)this_intra_error;
// Stats based on wavelet energy is used in the following cases : // 1. ML model which predicts if a flat structure (golden-frame only structure // without ALT-REF and Internal-ARFs) is better. This ML model is enabled in // constant quality mode under certain conditions. // 2. Delta qindex mode is set as DELTA_Q_PERCEPTUAL. // Thus, wavelet energy calculation is enabled for the above cases. if (calc_wavelet_energy(&cpi->oxcf)) { constint hbd = is_cur_buf_hbd(xd); constint stride = x->plane[0].src.stride; constint num_8x8_rows = block_size_high[fp_block_size] / 8; constint num_8x8_cols = block_size_wide[fp_block_size] / 8; const uint8_t *buf = x->plane[0].src.buf;
stats->frame_avg_wavelet_energy += av1_haar_ac_sad_mxn_uint8_input(
buf, stride, hbd, num_8x8_rows, num_8x8_cols);
} else {
stats->frame_avg_wavelet_energy = INVALID_FP_STATS_TO_PREDICT_FLAT_GOP;
}
return this_intra_error;
}
// Returns the sum of square error between source and reference blocks. staticint get_prediction_error_bitdepth(constint is_high_bitdepth, constint bitdepth, const BLOCK_SIZE block_size, conststruct buf_2d *src, conststruct buf_2d *ref) {
(void)is_high_bitdepth;
(void)bitdepth; #if CONFIG_AV1_HIGHBITDEPTH if (is_high_bitdepth) { return highbd_get_prediction_error(block_size, src, ref, bitdepth);
} #endif// CONFIG_AV1_HIGHBITDEPTH return get_prediction_error(block_size, src, ref);
}
++stats->mv_count; // Non-zero vector, was it different from the last non zero vector? if (!is_equal_mv(&best_mv, last_non_zero_mv)) ++stats->new_mv_count;
*last_non_zero_mv = best_mv;
// Does the row vector point inwards or outwards? if (mb_row < mb_rows / 2) { if (mv.row > 0) {
--stats->sum_in_vectors;
} elseif (mv.row < 0) {
++stats->sum_in_vectors;
}
} elseif (mb_row > mb_rows / 2) { if (mv.row > 0) {
++stats->sum_in_vectors;
} elseif (mv.row < 0) {
--stats->sum_in_vectors;
}
}
// Does the col vector point inwards or outwards? if (mb_col < mb_cols / 2) { if (mv.col > 0) {
--stats->sum_in_vectors;
} elseif (mv.col < 0) {
++stats->sum_in_vectors;
}
} elseif (mb_col > mb_cols / 2) { if (mv.col > 0) {
++stats->sum_in_vectors;
} elseif (mv.col < 0) {
--stats->sum_in_vectors;
}
}
}
// Computes and returns the inter prediction error from the last frame. // Computes inter prediction errors from the golden and alt ref frams and // Updates stats accordingly. // Inputs: // cpi: the encoder setting. Only a few params in it will be used. // last_frame: the frame buffer of the last frame. // golden_frame: the frame buffer of the golden frame. // unit_row: row index in the unit of first pass block size. // unit_col: column index in the unit of first pass block size. // recon_yoffset: the y offset of the reconstructed frame buffer, // indicating the starting point of the current block. // recont_uvoffset: the u/v offset of the reconstructed frame buffer, // indicating the starting point of the current block. // src_yoffset: the y offset of the source frame buffer. // fp_block_size: first pass block size. // this_intra_error: the intra prediction error of this block. // raw_motion_err_counts: the count of raw motion vectors. // raw_motion_err_list: the array that records the raw motion error. // ref_mv: the reference used to start the motion search // best_mv: the best mv found // last_non_zero_mv: the last non zero mv found in this tile row. // stats: frame encoding stats. // Modifies: // raw_motion_err_list // best_ref_mv // last_mv // stats: many member params in it. // Returns: // this_inter_error staticint firstpass_inter_prediction(
AV1_COMP *cpi, ThreadData *td, const YV12_BUFFER_CONFIG *const last_frame, const YV12_BUFFER_CONFIG *const golden_frame, constint unit_row, constint unit_col, constint recon_yoffset, constint recon_uvoffset, constint src_yoffset, const BLOCK_SIZE fp_block_size, constint this_intra_error, constint raw_motion_err_counts, int *raw_motion_err_list, const MV ref_mv, MV *best_mv,
MV *last_non_zero_mv, FRAME_STATS *stats) { int this_inter_error = this_intra_error;
AV1_COMMON *const cm = &cpi->common; const CommonModeInfoParams *const mi_params = &cm->mi_params;
CurrentFrame *const current_frame = &cm->current_frame;
MACROBLOCK *const x = &td->mb;
MACROBLOCKD *const xd = &x->e_mbd; constint is_high_bitdepth = is_cur_buf_hbd(xd); constint bitdepth = xd->bd; constint unit_scale = mi_size_wide[fp_block_size]; const BLOCK_SIZE bsize =
get_bsize(mi_params, fp_block_size, unit_row, unit_col); constint fp_block_size_height = block_size_wide[fp_block_size]; constint unit_width = mi_size_wide[fp_block_size]; constint unit_rows = get_unit_rows(fp_block_size, mi_params->mb_rows); constint unit_cols = get_unit_cols(fp_block_size, mi_params->mb_cols); // Assume 0,0 motion with no mv overhead.
FULLPEL_MV mv = kZeroFullMv;
xd->plane[0].pre[0].buf = last_frame->y_buffer + recon_yoffset; // Set up limit values for motion vectors to prevent them extending // outside the UMV borders.
av1_set_mv_col_limits(mi_params, &x->mv_limits, unit_col * unit_width,
fp_block_size_height >> MI_SIZE_LOG2,
cpi->oxcf.border_in_pixels);
int motion_error =
get_prediction_error_bitdepth(is_high_bitdepth, bitdepth, bsize,
&x->plane[0].src, &xd->plane[0].pre[0]);
// Compute the motion error of the 0,0 motion using the last source // frame as the reference. Skip the further motion search on // reconstructed frame if this error is small. // TODO(chiyotsai): The unscaled last source might be different dimension // as the current source. See BUG=aomedia:3413 struct buf_2d unscaled_last_source_buf_2d;
unscaled_last_source_buf_2d.buf =
cpi->unscaled_last_source->y_buffer + src_yoffset;
unscaled_last_source_buf_2d.stride = cpi->unscaled_last_source->y_stride; constint raw_motion_error = get_prediction_error_bitdepth(
is_high_bitdepth, bitdepth, bsize, &x->plane[0].src,
&unscaled_last_source_buf_2d);
raw_motion_err_list[raw_motion_err_counts] = raw_motion_error; const FIRST_PASS_SPEED_FEATURES *const fp_sf = &cpi->sf.fp_sf;
if (raw_motion_error > fp_sf->skip_motion_search_threshold) { // Test last reference frame using the previous best mv as the // starting point (best reference) for the search.
first_pass_motion_search(cpi, x, &ref_mv, &mv, &motion_error);
// If the current best reference mv is not centered on 0,0 then do a // 0,0 based search as well. if ((fp_sf->skip_zeromv_motion_search == 0) && !is_zero_mv(&ref_mv)) {
FULLPEL_MV tmp_mv = kZeroFullMv; int tmp_err = INT_MAX;
first_pass_motion_search(cpi, x, &kZeroMv, &tmp_mv, &tmp_err);
// Motion search in 2nd reference frame. int gf_motion_error = motion_error; if ((current_frame->frame_number > 1) && golden_frame != NULL) {
FULLPEL_MV tmp_mv = kZeroFullMv; // Assume 0,0 motion with no mv overhead.
av1_setup_pre_planes(xd, 0, golden_frame, 0, 0, NULL, 1);
xd->plane[0].pre[0].buf += recon_yoffset;
gf_motion_error =
get_prediction_error_bitdepth(is_high_bitdepth, bitdepth, bsize,
&x->plane[0].src, &xd->plane[0].pre[0]);
first_pass_motion_search(cpi, x, &kZeroMv, &tmp_mv, &gf_motion_error);
} if (gf_motion_error < motion_error && gf_motion_error < this_intra_error) {
++stats->second_ref_count;
} // In accumulating a score for the 2nd reference frame take the // best of the motion predicted score and the intra coded error // (just as will be done for) accumulation of "coded_error" for // the last frame. if ((current_frame->frame_number > 1) && golden_frame != NULL) {
stats->sr_coded_error += AOMMIN(gf_motion_error, this_intra_error);
} else { // TODO(chengchen): I believe logically this should also be changed to // stats->sr_coded_error += AOMMIN(gf_motion_error, this_intra_error).
stats->sr_coded_error += motion_error;
}
// Reset to last frame as reference buffer.
xd->plane[0].pre[0].buf = last_frame->y_buffer + recon_yoffset; if (av1_num_planes(&cpi->common) > 1) {
xd->plane[1].pre[0].buf = last_frame->u_buffer + recon_uvoffset;
xd->plane[2].pre[0].buf = last_frame->v_buffer + recon_uvoffset;
}
// Start by assuming that intra mode is best.
*best_mv = kZeroMv;
if (motion_error <= this_intra_error) { // Keep a count of cases where the inter and intra were very close // and very low. This helps with scene cut detection for example in // cropped clips with black bars at the sides or top and bottom. if (((this_intra_error - INTRA_MODE_PENALTY) * 9 <= motion_error * 10) &&
(this_intra_error < (2 * INTRA_MODE_PENALTY))) {
stats->neutral_count += 1.0; // Also track cases where the intra is not much worse than the inter // and use this in limiting the GF/arf group length.
} elseif ((this_intra_error > NCOUNT_INTRA_THRESH) &&
(this_intra_error < (NCOUNT_INTRA_FACTOR * motion_error))) {
stats->neutral_count +=
(double)motion_error / DOUBLE_DIVIDE_CHECK((double)this_intra_error);
}
// Normalize the first pass stats. // Error / counters are normalized to each MB. // MVs are normalized to the width/height of the frame. staticvoid normalize_firstpass_stats(FIRSTPASS_STATS *fps, double num_mbs_16x16, double f_w, double f_h) {
fps->coded_error /= num_mbs_16x16;
fps->sr_coded_error /= num_mbs_16x16;
fps->intra_error /= num_mbs_16x16;
fps->frame_avg_wavelet_energy /= num_mbs_16x16;
fps->log_coded_error = log1p(fps->coded_error);
fps->log_intra_error = log1p(fps->intra_error);
fps->MVr /= f_h;
fps->mvr_abs /= f_h;
fps->MVc /= f_w;
fps->mvc_abs /= f_w;
fps->MVrv /= (f_h * f_h);
fps->MVcv /= (f_w * f_w);
fps->new_mv_count /= num_mbs_16x16;
}
// Updates the first pass stats of this frame. // Input: // cpi: the encoder setting. Only a few params in it will be used. // stats: stats accumulated for this frame. // raw_err_stdev: the statndard deviation for the motion error of all the // inter blocks of the (0,0) motion using the last source // frame as the reference. // frame_number: current frame number. // ts_duration: Duration of the frame / collection of frames. // Updates: // twopass->total_stats: the accumulated stats. // twopass->stats_buf_ctx->stats_in_end: the pointer to the current stats, // update its value and its position // in the buffer. staticvoid update_firstpass_stats(AV1_COMP *cpi, const FRAME_STATS *const stats, constdouble raw_err_stdev, constint frame_number, const int64_t ts_duration, const BLOCK_SIZE fp_block_size) {
TWO_PASS *twopass = &cpi->ppi->twopass;
AV1_COMMON *const cm = &cpi->common; const CommonModeInfoParams *const mi_params = &cm->mi_params;
FIRSTPASS_STATS *this_frame_stats = twopass->stats_buf_ctx->stats_in_end;
FIRSTPASS_STATS fps; // The minimum error here insures some bit allocation to frames even // in static regions. The allocation per MB declines for larger formats // where the typical "real" energy per MB also falls. // Initial estimate here uses sqrt(mbs) to define the min_err, where the // number of mbs is proportional to the image area. constint num_mbs_16X16 = (cpi->oxcf.resize_cfg.resize_mode != RESIZE_NONE)
? cpi->initial_mbs
: mi_params->MBs; // Number of actual units used in the first pass, it can be other square // block sizes than 16X16. constint num_mbs = get_num_mbs(fp_block_size, num_mbs_16X16); constdouble min_err = 200 * sqrt(num_mbs);
// TODO(paulwilkins): Handle the case when duration is set to 0, or // something less than the full time between subsequent values of // cpi->source_time_stamp.
fps.duration = (double)ts_duration;
// We will store the stats inside the persistent twopass struct (and NOT the // local variable 'fps'), and then cpi->output_pkt_list will point to it.
*this_frame_stats = fps; if (!cpi->ppi->lap_enabled) {
output_stats(this_frame_stats, cpi->ppi->output_pkt_list);
} else {
av1_firstpass_info_push(&twopass->firstpass_info, this_frame_stats);
} if (cpi->ppi->twopass.stats_buf_ctx->total_stats != NULL) {
av1_accumulate_stats(cpi->ppi->twopass.stats_buf_ctx->total_stats, &fps);
}
twopass->stats_buf_ctx->stats_in_end++; // When ducky encode is on, we always use linear buffer for stats_buf_ctx. if (cpi->use_ducky_encode == 0) { // TODO(angiebird): Figure out why first pass uses circular buffer. /* In the case of two pass, first pass uses it as a circular buffer,
* when LAP is enabled it is used as a linear buffer*/ if ((cpi->oxcf.pass == AOM_RC_FIRST_PASS) &&
(twopass->stats_buf_ctx->stats_in_end >=
twopass->stats_buf_ctx->stats_in_buf_end)) {
twopass->stats_buf_ctx->stats_in_end =
twopass->stats_buf_ctx->stats_in_start;
}
}
}
staticvoid print_reconstruction_frame( const YV12_BUFFER_CONFIG *const last_frame, int frame_number, int do_print) { if (!do_print) return;
// Set up limit values for motion vectors to prevent them extending // outside the UMV borders.
av1_set_mv_row_limits(
mi_params, &x->mv_limits, (unit_row << unit_height_log2),
(fp_block_size_height >> MI_SIZE_LOG2), cpi->oxcf.border_in_pixels);
// Fix - zero the 16x16 block first. This ensures correct this_intra_error for // block sizes smaller than 16x16.
av1_zero_array(x->plane[0].src_diff, 256);
#if CONFIG_MULTITHREAD if (cpi->ppi->p_mt_info.num_workers > 1) {
pthread_mutex_lock(enc_row_mt->mutex_); bool firstpass_mt_exit = enc_row_mt->firstpass_mt_exit;
pthread_mutex_unlock(enc_row_mt->mutex_); // Exit in case any worker has encountered an error. if (firstpass_mt_exit) return;
} #endif
// Adjust to the next column of MBs.
x->plane[0].src.buf += fp_block_size_width; if (num_planes > 1) {
x->plane[1].src.buf += uv_mb_height;
x->plane[2].src.buf += uv_mb_height;
}
// Detect if the key frame is screen content type. if (frame_is_intra_only(cm)) {
FeatureFlags *const features = &cm->features;
assert(cpi->source != NULL);
xd->cur_buf = cpi->source;
av1_set_screen_content_options(cpi, features);
}
// Prepare the speed features
av1_set_speed_features_framesize_independent(cpi, cpi->oxcf.speed);
// Unit size for the first pass encoding. const BLOCK_SIZE fp_block_size =
get_fp_block_size(cpi->is_screen_content_type);
int max_mb_rows = mi_params->mb_rows; int max_mb_cols = mi_params->mb_cols; if (cpi->oxcf.frm_dim_cfg.forced_max_frame_width) { int max_mi_cols = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_width);
max_mb_cols = ROUND_POWER_OF_TWO(max_mi_cols, 2);
} if (cpi->oxcf.frm_dim_cfg.forced_max_frame_height) { int max_mi_rows = size_in_mi(cpi->oxcf.frm_dim_cfg.forced_max_frame_height);
max_mb_rows = ROUND_POWER_OF_TWO(max_mi_rows, 2);
}
// Number of rows in the unit size. // Note max_mb_rows and max_mb_cols are in the unit of 16x16. constint unit_rows = get_unit_rows(fp_block_size, max_mb_rows); constint unit_cols = get_unit_cols(fp_block_size, max_mb_cols);
// Set fp_block_size, for the convenience of multi-thread usage.
cpi->fp_block_size = fp_block_size;
// Clamp the image start to rows/2. This number of rows is discarded top // and bottom as dead data so rows / 2 means the frame is blank. if ((stats.image_data_start_row > unit_rows / 2) ||
(stats.image_data_start_row == INVALID_ROW)) {
stats.image_data_start_row = unit_rows / 2;
} // Exclude any image dead zone if (stats.image_data_start_row > 0) {
stats.intra_skip_count =
AOMMAX(0, stats.intra_skip_count -
(stats.image_data_start_row * unit_cols * 2));
}
TWO_PASS *twopass = &cpi->ppi->twopass; constint num_mbs_16X16 = (cpi->oxcf.resize_cfg.resize_mode != RESIZE_NONE)
? cpi->initial_mbs
: mi_params->MBs; // Number of actual units used in the first pass, it can be other square // block sizes than 16X16. constint num_mbs = get_num_mbs(fp_block_size, num_mbs_16X16);
stats.intra_factor = stats.intra_factor / (double)num_mbs;
stats.brightness_factor = stats.brightness_factor / (double)num_mbs;
FIRSTPASS_STATS *this_frame_stats = twopass->stats_buf_ctx->stats_in_end;
update_firstpass_stats(cpi, &stats, raw_err_stdev,
current_frame->frame_number, ts_duration,
fp_block_size);
// Copy the previous Last Frame back into gf buffer if the prediction is good // enough... but also don't allow it to lag too far. if ((twopass->sr_update_lag > 3) ||
((current_frame->frame_number > 0) &&
(this_frame_stats->pcnt_inter > 0.20) &&
((this_frame_stats->intra_error /
DOUBLE_DIVIDE_CHECK(this_frame_stats->coded_error)) > 2.0))) { if (golden_frame != NULL) {
assign_frame_buffer_p(
&cm->ref_frame_map[get_ref_frame_map_idx(cm, GOLDEN_FRAME)],
cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME)]);
}
twopass->sr_update_lag = 1;
} else {
++twopass->sr_update_lag;
}
aom_extend_frame_borders(this_frame, num_planes);
// The frame we just compressed now becomes the last frame.
assign_frame_buffer_p(
&cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME)], cm->cur_frame);
// Special case for the first frame. Copy into the GF buffer as a second // reference. if (current_frame->frame_number == 0 &&
get_ref_frame_map_idx(cm, GOLDEN_FRAME) != INVALID_IDX) {
assign_frame_buffer_p(
&cm->ref_frame_map[get_ref_frame_map_idx(cm, GOLDEN_FRAME)],
cm->ref_frame_map[get_ref_frame_map_idx(cm, LAST_FRAME)]);
}
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.