OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 if (external_frame_size != (size_t)external_frame_size) | 192 if (external_frame_size != (size_t)external_frame_size) |
193 return -1; | 193 return -1; |
194 | 194 |
195 // Allocation to hold larger frame, or first allocation. | 195 // Allocation to hold larger frame, or first allocation. |
196 if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) | 196 if (cb(cb_priv, (size_t)external_frame_size, fb) < 0) |
197 return -1; | 197 return -1; |
198 | 198 |
199 if (fb->data == NULL || fb->size < external_frame_size) | 199 if (fb->data == NULL || fb->size < external_frame_size) |
200 return -1; | 200 return -1; |
201 | 201 |
202 // This memset is needed for fixing valgrind error from C loop filter | |
203 // due to access uninitialized memory in frame border. It could be | |
204 // removed if border is totally removed. | |
205 vpx_memset(fb->data, 0, fb->size); | |
206 | |
207 ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32); | 202 ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32); |
208 } else if (frame_size > (size_t)ybf->buffer_alloc_sz) { | 203 } else if (frame_size > (size_t)ybf->buffer_alloc_sz) { |
209 // Allocation to hold larger frame, or first allocation. | 204 // Allocation to hold larger frame, or first allocation. |
210 vpx_free(ybf->buffer_alloc); | 205 vpx_free(ybf->buffer_alloc); |
211 ybf->buffer_alloc = NULL; | 206 ybf->buffer_alloc = NULL; |
212 | 207 |
213 if (frame_size != (size_t)frame_size) | 208 if (frame_size != (size_t)frame_size) |
214 return -1; | 209 return -1; |
215 | 210 |
216 ybf->buffer_alloc = (uint8_t *)vpx_memalign(32, (size_t)frame_size); | 211 ybf->buffer_alloc = (uint8_t *)vpx_memalign(32, (size_t)frame_size); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 vp9_free_frame_buffer(ybf); | 293 vp9_free_frame_buffer(ybf); |
299 return vp9_realloc_frame_buffer(ybf, width, height, ss_x, ss_y, | 294 return vp9_realloc_frame_buffer(ybf, width, height, ss_x, ss_y, |
300 #if CONFIG_VP9_HIGHBITDEPTH | 295 #if CONFIG_VP9_HIGHBITDEPTH |
301 use_highbitdepth, | 296 use_highbitdepth, |
302 #endif | 297 #endif |
303 border, NULL, NULL, NULL); | 298 border, NULL, NULL, NULL); |
304 } | 299 } |
305 return -2; | 300 return -2; |
306 } | 301 } |
307 #endif | 302 #endif |
OLD | NEW |