/* * 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.
*/
// Segmentation only makes sense if the target bits per SB is above a threshold. // Below this the overheads will usually outweigh any benefit. staticbool is_sb_aq_enabled(const AV1_COMP *const cpi) { return cpi->rc.sb64_target_rate >= 256;
}
// For AQ complexity mode, we dont allow Q0 in a segment if the base // Q is not 0. Q0 (lossless) implies 4x4 only and in AQ mode 2 a segment // Q delta is sometimes applied without going back around the rd loop. // This could lead to an illegal combination of partition size and q. if ((base_qindex != 0) && ((base_qindex + qindex_delta) == 0)) {
qindex_delta = -base_qindex + 1;
} if ((base_qindex + qindex_delta) > 0) {
av1_enable_segfeature(seg, segment, SEG_LVL_ALT_Q);
av1_set_segdata(seg, segment, SEG_LVL_ALT_Q, qindex_delta);
}
}
}
}
#define DEFAULT_LV_THRESH 10.0 #define MIN_DEFAULT_LV_THRESH 8.0 // Select a segment for the current block. // The choice of segment for a block depends on the ratio of the projected // bits for the block vs a target average and its spatial complexity. void av1_caq_select_segment(const AV1_COMP *cpi, MACROBLOCK *mb, BLOCK_SIZE bs, int mi_row, int mi_col, int projected_rate) { if ((!is_frame_aq_enabled(cpi)) || (!is_sb_aq_enabled(cpi))) return; const AV1_COMMON *const cm = &cpi->common; constint num_planes = av1_num_planes(cm);
segment = AQ_C_SEGMENTS - 1; // Just in case no break out below. for (i = 0; i < AQ_C_SEGMENTS; ++i) { // Test rate against a threshold value and variance against a threshold. // Increasing segment number (higher variance and complexity) = higher Q. if ((projected_rate < target_rate * aq_c_transitions[aq_strength][i]) &&
(logvar < (low_var_thresh + aq_c_var_thresholds[aq_strength][i]))) {
segment = i; break;
}
}
// Fill in the entires in the segment map corresponding to this SB64. constint mi_stride = cm->mi_params.mi_cols;
set_segment_id(cpi->enc_seg.map, mi_offset, xmis, ymis, mi_stride, segment);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet)
¤
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.