summaryrefslogtreecommitdiff
path: root/vpx_scale/yv12config.h
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2013-02-06 14:22:17 -0800
committerJohn Koleszar <jkoleszar@google.com>2013-02-08 12:20:30 -0800
commitc03d45def9ff03fd1ee35070f59928f702e7b8e9 (patch)
tree0af950dd7413665deeedcbd3fa41205e430a153b /vpx_scale/yv12config.h
parent88f99f4ec29d1df6cb99e47562734df7bd9a6892 (diff)
downloadlibvpx-c03d45def9ff03fd1ee35070f59928f702e7b8e9.tar
libvpx-c03d45def9ff03fd1ee35070f59928f702e7b8e9.tar.gz
libvpx-c03d45def9ff03fd1ee35070f59928f702e7b8e9.tar.bz2
libvpx-c03d45def9ff03fd1ee35070f59928f702e7b8e9.zip
Avoid allocating memory when resizing frames
As long as the new frame is smaller than the size that was originally allocated, we don't need to free and reallocate the memory allocated. Instead, do the allocation on the size of the first frame. We could make this passed in from the application instead, if we wanted to support external upscaling. Change-Id: I204d17a130728bbd91155bb4bd863a99bb99b038
Diffstat (limited to 'vpx_scale/yv12config.h')
-rw-r--r--vpx_scale/yv12config.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/vpx_scale/yv12config.h b/vpx_scale/yv12config.h
index 23be8f3dd..45e57f401 100644
--- a/vpx_scale/yv12config.h
+++ b/vpx_scale/yv12config.h
@@ -55,6 +55,7 @@ extern "C" {
uint8_t *v_buffer;
uint8_t *buffer_alloc;
+ int buffer_alloc_sz;
int border;
int frame_size;
YUV_TYPE clrtype;
@@ -65,6 +66,8 @@ extern "C" {
int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int width, int height, int border);
+ int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
+ int width, int height, int border);
int vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf);
#ifdef __cplusplus