/* * Copyright (c) 2010 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_alloc_loop_filter(VP9_COMMON *cm) {
vpx_free(cm->lf.lfm); // Each lfm holds bit masks for all the 8x8 blocks in a 64x64 region. The // stride and rows are rounded up / truncated to a multiple of 8.
cm->lf.lfm_stride = (cm->mi_cols + (MI_BLOCK_SIZE - 1)) >> 3;
cm->lf.lfm = (LOOP_FILTER_MASK *)vpx_calloc(
((cm->mi_rows + (MI_BLOCK_SIZE - 1)) >> 3) * cm->lf.lfm_stride, sizeof(*cm->lf.lfm)); if (!cm->lf.lfm) return 1; return 0;
}
int vp9_alloc_context_buffers(VP9_COMMON *cm, int width, int height) { int new_mi_size;
vp9_set_mb_mi(cm, width, height);
new_mi_size = cm->mi_stride * calc_mi_size(cm->mi_rows); if (cm->mi_alloc_size < new_mi_size) {
cm->free_mi(cm); if (cm->alloc_mi(cm, new_mi_size)) goto fail;
} if (cm->above_context_alloc_cols < cm->mi_cols) {
vpx_free(cm->above_context);
cm->above_context = (ENTROPY_CONTEXT *)vpx_calloc(
2 * mi_cols_aligned_to_sb(cm->mi_cols) * MAX_MB_PLANE, sizeof(*cm->above_context)); if (!cm->above_context) goto fail;
if (cm->seg_map_alloc_size < cm->mi_rows * cm->mi_cols) { // Create the segmentation map structure and set to 0.
free_seg_map(cm); if (alloc_seg_map(cm, cm->mi_rows * cm->mi_cols)) goto fail;
}
if (vp9_alloc_loop_filter(cm)) goto fail;
return 0;
fail: // clear the mi_* values to force a realloc on resync
vp9_set_mb_mi(cm, 0, 0);
vp9_free_context_buffers(cm); return 1;
}
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.