Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: source/libvpx/vp9/common/vp9_alloccommon.c

Issue 148913004: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/common/vp9_alloccommon.h ('k') | source/libvpx/vp9/common/vp9_blockd.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/common/vp9_alloccommon.c
===================================================================
--- source/libvpx/vp9/common/vp9_alloccommon.c (revision 247498)
+++ source/libvpx/vp9/common/vp9_alloccommon.c (working copy)
@@ -33,7 +33,7 @@
void vp9_free_frame_buffers(VP9_COMMON *cm) {
int i;
- for (i = 0; i < cm->fb_count; i++)
+ for (i = 0; i < FRAME_BUFFERS; i++)
vp9_free_frame_buffer(&cm->yv12_fb[i]);
vp9_free_frame_buffer(&cm->post_proc_buffer);
@@ -85,7 +85,7 @@
int mi_size;
if (vp9_realloc_frame_buffer(&cm->post_proc_buffer, width, height, ss_x, ss_y,
- VP9BORDERINPIXELS, NULL, NULL, NULL) < 0)
+ VP9_DEC_BORDER_IN_PIXELS) < 0)
goto fail;
set_mb_mi(cm, aligned_width, aligned_height);
@@ -137,40 +137,25 @@
const int ss_y = cm->subsampling_y;
int mi_size;
- if (cm->fb_count == 0) {
- cm->fb_count = FRAME_BUFFERS;
- CHECK_MEM_ERROR(cm, cm->yv12_fb,
- vpx_calloc(cm->fb_count, sizeof(*cm->yv12_fb)));
- CHECK_MEM_ERROR(cm, cm->fb_idx_ref_cnt,
- vpx_calloc(cm->fb_count, sizeof(*cm->fb_idx_ref_cnt)));
- if (cm->fb_lru) {
- CHECK_MEM_ERROR(cm, cm->fb_idx_ref_lru,
- vpx_calloc(cm->fb_count, sizeof(*cm->fb_idx_ref_lru)));
- }
- }
-
vp9_free_frame_buffers(cm);
- for (i = 0; i < cm->fb_count; i++) {
+ for (i = 0; i < FRAME_BUFFERS; i++) {
cm->fb_idx_ref_cnt[i] = 0;
if (vp9_alloc_frame_buffer(&cm->yv12_fb[i], width, height, ss_x, ss_y,
- VP9BORDERINPIXELS) < 0)
+ VP9_ENC_BORDER_IN_PIXELS) < 0)
goto fail;
}
- cm->new_fb_idx = cm->fb_count - 1;
+ cm->new_fb_idx = FRAME_BUFFERS - 1;
cm->fb_idx_ref_cnt[cm->new_fb_idx] = 1;
- for (i = 0; i < REFS_PER_FRAME; i++)
- cm->active_ref_idx[i] = i;
-
for (i = 0; i < REF_FRAMES; i++) {
cm->ref_frame_map[i] = i;
cm->fb_idx_ref_cnt[i] = 1;
}
if (vp9_alloc_frame_buffer(&cm->post_proc_buffer, width, height, ss_x, ss_y,
- VP9BORDERINPIXELS) < 0)
+ VP9_ENC_BORDER_IN_PIXELS) < 0)
goto fail;
set_mb_mi(cm, aligned_width, aligned_height);
@@ -214,14 +199,6 @@
void vp9_remove_common(VP9_COMMON *cm) {
vp9_free_frame_buffers(cm);
-
- vpx_free(cm->yv12_fb);
- vpx_free(cm->fb_idx_ref_cnt);
- vpx_free(cm->fb_idx_ref_lru);
-
- cm->yv12_fb = NULL;
- cm->fb_idx_ref_cnt = NULL;
- cm->fb_idx_ref_lru = NULL;
}
void vp9_initialize_common() {
« no previous file with comments | « source/libvpx/vp9/common/vp9_alloccommon.h ('k') | source/libvpx/vp9/common/vp9_blockd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698