Index: source/libvpx/vp9/common/vp9_onyxc_int.h |
diff --git a/source/libvpx/vp9/common/vp9_onyxc_int.h b/source/libvpx/vp9/common/vp9_onyxc_int.h |
index 5179c6906339f0f374bce5d4dbfa697beeac8e39..188b03d41e5c4de27ab9851f092f27b884088380 100644 |
--- a/source/libvpx/vp9/common/vp9_onyxc_int.h |
+++ b/source/libvpx/vp9/common/vp9_onyxc_int.h |
@@ -14,6 +14,7 @@ |
#include "./vpx_config.h" |
#include "vpx/internal/vpx_codec_internal.h" |
#include "./vp9_rtcd.h" |
+#include "vp9/common/vp9_alloccommon.h" |
#include "vp9/common/vp9_loopfilter.h" |
#include "vp9/common/vp9_entropymv.h" |
#include "vp9/common/vp9_entropy.h" |
@@ -220,6 +221,7 @@ typedef struct VP9Common { |
uint8_t *seg_map_array[NUM_PING_PONG_BUFFERS]; |
uint8_t *last_frame_seg_map; |
uint8_t *current_frame_seg_map; |
+ int seg_map_alloc_size; |
INTERP_FILTER interp_filter; |
@@ -276,6 +278,7 @@ typedef struct VP9Common { |
PARTITION_CONTEXT *above_seg_context; |
ENTROPY_CONTEXT *above_context; |
+ int above_context_alloc_cols; |
} VP9_COMMON; |
// TODO(hkuang): Don't need to lock the whole pool after implementing atomic |
@@ -305,8 +308,13 @@ static INLINE int get_free_fb(VP9_COMMON *cm) { |
if (frame_bufs[i].ref_count == 0) |
break; |
- assert(i < FRAME_BUFFERS); |
- frame_bufs[i].ref_count = 1; |
+ if (i != FRAME_BUFFERS) { |
+ frame_bufs[i].ref_count = 1; |
+ } else { |
+ // Reset i to be INVALID_IDX to indicate no free buffer found. |
+ i = INVALID_IDX; |
+ } |
+ |
unlock_buffer_pool(cm->buffer_pool); |
return i; |
} |