/* * 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.
*/
void av1_free_internal_frame_buffers(InternalFrameBufferList *list) { int i;
assert(list != NULL);
for (i = 0; i < list->num_internal_frame_buffers; ++i) {
aom_free(list->int_fb[i].data);
list->int_fb[i].data = NULL;
}
aom_free(list->int_fb);
list->int_fb = NULL;
list->num_internal_frame_buffers = 0;
}
void av1_zero_unused_internal_frame_buffers(InternalFrameBufferList *list) { int i;
assert(list != NULL);
for (i = 0; i < list->num_internal_frame_buffers; ++i) { if (list->int_fb[i].data && !list->int_fb[i].in_use)
memset(list->int_fb[i].data, 0, list->int_fb[i].size);
}
}
int av1_get_frame_buffer(void *cb_priv, size_t min_size,
aom_codec_frame_buffer_t *fb) { int i;
InternalFrameBufferList *const int_fb_list =
(InternalFrameBufferList *)cb_priv; if (int_fb_list == NULL) return -1;
// Find a free frame buffer. for (i = 0; i < int_fb_list->num_internal_frame_buffers; ++i) { if (!int_fb_list->int_fb[i].in_use) break;
}
if (i == int_fb_list->num_internal_frame_buffers) return -1;
if (int_fb_list->int_fb[i].size < min_size) {
aom_free(int_fb_list->int_fb[i].data); // The data must be zeroed to fix a valgrind error from the C loop filter // due to access uninitialized memory in frame border. It could be // skipped if border were totally removed.
int_fb_list->int_fb[i].data = (uint8_t *)aom_calloc(1, min_size); if (!int_fb_list->int_fb[i].data) {
int_fb_list->int_fb[i].size = 0; return -1;
}
int_fb_list->int_fb[i].size = min_size;
}
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.