/* * Copyright (c) 2012 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
int vp9_compound_reference_allowed(const VP9_COMMON *cm) { int i; for (i = 1; i < REFS_PER_FRAME; ++i) if (cm->ref_frame_sign_bias[i + 1] != cm->ref_frame_sign_bias[1]) return 1;
int vp9_get_reference_mode_context(const VP9_COMMON *cm, const MACROBLOCKD *xd) { int ctx; const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; constint has_above = !!above_mi; constint has_left = !!left_mi; // Note: // The mode info data structure has a one element border above and to the // left of the entries corresponding to real macroblocks. // The prediction flags in these dummy entries are initialized to 0. if (has_above && has_left) { // both edges available if (!has_second_ref(above_mi) && !has_second_ref(left_mi)) // neither edge uses comp pred (0/1)
ctx = (above_mi->ref_frame[0] == cm->comp_fixed_ref) ^
(left_mi->ref_frame[0] == cm->comp_fixed_ref); elseif (!has_second_ref(above_mi)) // one of two edges uses comp pred (2/3)
ctx = 2 + (above_mi->ref_frame[0] == cm->comp_fixed_ref ||
!is_inter_block(above_mi)); elseif (!has_second_ref(left_mi)) // one of two edges uses comp pred (2/3)
ctx = 2 + (left_mi->ref_frame[0] == cm->comp_fixed_ref ||
!is_inter_block(left_mi)); else// both edges use comp pred (4)
ctx = 4;
} elseif (has_above || has_left) { // one edge available const MODE_INFO *edge_mi = has_above ? above_mi : left_mi;
if (!has_second_ref(edge_mi)) // edge does not use comp pred (0/1)
ctx = edge_mi->ref_frame[0] == cm->comp_fixed_ref; else // edge uses comp pred (3)
ctx = 3;
} else { // no edges available (1)
ctx = 1;
}
assert(ctx >= 0 && ctx < COMP_INTER_CONTEXTS); return ctx;
}
// Returns a context number for the given MB prediction signal int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm, const MACROBLOCKD *xd) { int pred_context; const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; constint above_in_image = !!above_mi; constint left_in_image = !!left_mi;
// Note: // The mode info data structure has a one element border above and to the // left of the entries corresponding to real macroblocks. // The prediction flags in these dummy entries are initialized to 0. constint fix_ref_idx = cm->ref_frame_sign_bias[cm->comp_fixed_ref]; constint var_ref_idx = !fix_ref_idx;
if (above_in_image && left_in_image) { // both edges available constint above_intra = !is_inter_block(above_mi); constint left_intra = !is_inter_block(left_mi);
int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) { int pred_context; const MODE_INFO *const above_mi = xd->above_mi; const MODE_INFO *const left_mi = xd->left_mi; constint has_above = !!above_mi; constint has_left = !!left_mi; // Note: // The mode info data structure has a one element border above and to the // left of the entries corresponding to real macroblocks. // The prediction flags in these dummy entries are initialized to 0. if (has_above && has_left) { // both edges available constint above_intra = !is_inter_block(above_mi); constint left_intra = !is_inter_block(left_mi);
// Note: // The mode info data structure has a one element border above and to the // left of the entries corresponding to real macroblocks. // The prediction flags in these dummy entries are initialized to 0. if (has_above && has_left) { // both edges available constint above_intra = !is_inter_block(above_mi); constint left_intra = !is_inter_block(left_mi);
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.