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

Side by Side Diff: source/libvpx/vp9/common/vp9_alloccommon.c

Issue 1124333011: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: only update to last nights LKGR Created 5 years, 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 cm->seg_map_array[i] = NULL; 76 cm->seg_map_array[i] = NULL;
77 } 77 }
78 78
79 cm->current_frame_seg_map = NULL; 79 cm->current_frame_seg_map = NULL;
80 80
81 if (!cm->frame_parallel_decode) { 81 if (!cm->frame_parallel_decode) {
82 cm->last_frame_seg_map = NULL; 82 cm->last_frame_seg_map = NULL;
83 } 83 }
84 } 84 }
85 85
86 void vp9_free_ref_frame_buffers(VP9_COMMON *cm) { 86 void vp9_free_ref_frame_buffers(BufferPool *pool) {
87 BufferPool *const pool = cm->buffer_pool;
88 int i; 87 int i;
89 88
90 for (i = 0; i < FRAME_BUFFERS; ++i) { 89 for (i = 0; i < FRAME_BUFFERS; ++i) {
91 if (pool->frame_bufs[i].ref_count > 0 && 90 if (pool->frame_bufs[i].ref_count > 0 &&
92 pool->frame_bufs[i].raw_frame_buffer.data != NULL) { 91 pool->frame_bufs[i].raw_frame_buffer.data != NULL) {
93 pool->release_fb_cb(pool->cb_priv, &pool->frame_bufs[i].raw_frame_buffer); 92 pool->release_fb_cb(pool->cb_priv, &pool->frame_bufs[i].raw_frame_buffer);
94 pool->frame_bufs[i].ref_count = 0; 93 pool->frame_bufs[i].ref_count = 0;
95 } 94 }
96 vpx_free(pool->frame_bufs[i].mvs); 95 vpx_free(pool->frame_bufs[i].mvs);
97 pool->frame_bufs[i].mvs = NULL; 96 pool->frame_bufs[i].mvs = NULL;
98 vp9_free_frame_buffer(&pool->frame_bufs[i].buf); 97 vp9_free_frame_buffer(&pool->frame_bufs[i].buf);
99 } 98 }
99 }
100 100
101 void vp9_free_postproc_buffers(VP9_COMMON *cm) {
101 #if CONFIG_VP9_POSTPROC 102 #if CONFIG_VP9_POSTPROC
102 vp9_free_frame_buffer(&cm->post_proc_buffer); 103 vp9_free_frame_buffer(&cm->post_proc_buffer);
103 vp9_free_frame_buffer(&cm->post_proc_buffer_int); 104 vp9_free_frame_buffer(&cm->post_proc_buffer_int);
105 #else
106 (void)cm;
104 #endif 107 #endif
105 } 108 }
106 109
107 void vp9_free_context_buffers(VP9_COMMON *cm) { 110 void vp9_free_context_buffers(VP9_COMMON *cm) {
108 cm->free_mi(cm); 111 cm->free_mi(cm);
109 free_seg_map(cm); 112 free_seg_map(cm);
110 vpx_free(cm->above_context); 113 vpx_free(cm->above_context);
111 cm->above_context = NULL; 114 cm->above_context = NULL;
112 vpx_free(cm->above_seg_context); 115 vpx_free(cm->above_seg_context);
113 cm->above_seg_context = NULL; 116 cm->above_seg_context = NULL;
(...skipping 21 matching lines...) Expand all
135 if (!cm->above_seg_context) goto fail; 138 if (!cm->above_seg_context) goto fail;
136 139
137 return 0; 140 return 0;
138 141
139 fail: 142 fail:
140 vp9_free_context_buffers(cm); 143 vp9_free_context_buffers(cm);
141 return 1; 144 return 1;
142 } 145 }
143 146
144 void vp9_remove_common(VP9_COMMON *cm) { 147 void vp9_remove_common(VP9_COMMON *cm) {
145 vp9_free_ref_frame_buffers(cm);
146 vp9_free_context_buffers(cm); 148 vp9_free_context_buffers(cm);
147 149
148 vpx_free(cm->fc); 150 vpx_free(cm->fc);
149 cm->fc = NULL; 151 cm->fc = NULL;
150 vpx_free(cm->frame_contexts); 152 vpx_free(cm->frame_contexts);
151 cm->frame_contexts = NULL; 153 cm->frame_contexts = NULL;
152 } 154 }
153 155
154 void vp9_init_context_buffers(VP9_COMMON *cm) { 156 void vp9_init_context_buffers(VP9_COMMON *cm) {
155 cm->setup_mi(cm); 157 cm->setup_mi(cm);
156 if (cm->last_frame_seg_map && !cm->frame_parallel_decode) 158 if (cm->last_frame_seg_map && !cm->frame_parallel_decode)
157 vpx_memset(cm->last_frame_seg_map, 0, cm->mi_rows * cm->mi_cols); 159 memset(cm->last_frame_seg_map, 0, cm->mi_rows * cm->mi_cols);
158 } 160 }
159 161
160 void vp9_swap_current_and_last_seg_map(VP9_COMMON *cm) { 162 void vp9_swap_current_and_last_seg_map(VP9_COMMON *cm) {
161 // Swap indices. 163 // Swap indices.
162 const int tmp = cm->seg_map_idx; 164 const int tmp = cm->seg_map_idx;
163 cm->seg_map_idx = cm->prev_seg_map_idx; 165 cm->seg_map_idx = cm->prev_seg_map_idx;
164 cm->prev_seg_map_idx = tmp; 166 cm->prev_seg_map_idx = tmp;
165 167
166 cm->current_frame_seg_map = cm->seg_map_array[cm->seg_map_idx]; 168 cm->current_frame_seg_map = cm->seg_map_array[cm->seg_map_idx];
167 cm->last_frame_seg_map = cm->seg_map_array[cm->prev_seg_map_idx]; 169 cm->last_frame_seg_map = cm->seg_map_array[cm->prev_seg_map_idx];
168 } 170 }
OLDNEW
« 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