/* * Copyright (c) 2014 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.
*/
void vp9_free_internal_frame_buffers(InternalFrameBufferList *list) { int i;
assert(list != NULL);
for (i = 0; i < list->num_internal_frame_buffers; ++i) {
vpx_free(list->int_fb[i].data);
list->int_fb[i].data = NULL;
}
vpx_free(list->int_fb);
list->int_fb = NULL;
list->num_internal_frame_buffers = 0;
}
int vp9_get_frame_buffer(void *cb_priv, size_t min_size,
vpx_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) {
vpx_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 *)vpx_calloc(1, min_size); if (!int_fb_list->int_fb[i].data) 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.