diff options
author | Dmitry Kovalev <dkovalev@google.com> | 2014-03-21 12:02:42 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2014-03-21 12:02:42 -0700 |
commit | a57de9da0374231dc08a97533baabaca9f28ec00 (patch) | |
tree | c85fa6dee668f46f0c8f2cfa09d6c575c3ab08b2 /vp9/common | |
parent | d82766155ceb3b4422f44154b0fe03e207efe57d (diff) | |
parent | 7ad40117f118892e8d321e12ba5aa2b612fda831 (diff) | |
download | libvpx-a57de9da0374231dc08a97533baabaca9f28ec00.tar libvpx-a57de9da0374231dc08a97533baabaca9f28ec00.tar.gz libvpx-a57de9da0374231dc08a97533baabaca9f28ec00.tar.bz2 libvpx-a57de9da0374231dc08a97533baabaca9f28ec00.zip |
Merge "Reusing {above, left}_seg_context vars in both encoder and decoder."
Diffstat (limited to 'vp9/common')
-rw-r--r-- | vp9/common/vp9_alloccommon.c | 17 | ||||
-rw-r--r-- | vp9/common/vp9_onyxc_int.h | 2 |
2 files changed, 19 insertions, 0 deletions
diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c index 08ab27a8c..ad11d1c94 100644 --- a/vp9/common/vp9_alloccommon.c +++ b/vp9/common/vp9_alloccommon.c @@ -108,6 +108,9 @@ void vp9_free_frame_buffers(VP9_COMMON *cm) { vpx_free(cm->last_frame_seg_map); cm->last_frame_seg_map = NULL; + + vpx_free(cm->above_seg_context); + cm->above_seg_context = NULL; } int vp9_resize_frame_buffers(VP9_COMMON *cm, int width, int height) { @@ -134,6 +137,13 @@ int vp9_resize_frame_buffers(VP9_COMMON *cm, int width, int height) { if (!cm->last_frame_seg_map) goto fail; + vpx_free(cm->above_seg_context); + cm->above_seg_context = + (PARTITION_CONTEXT *)vpx_calloc(mi_cols_aligned_to_sb(cm->mi_cols), + sizeof(*cm->above_seg_context)); + if (!cm->above_seg_context) + goto fail; + return 0; fail: @@ -182,6 +192,13 @@ int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height) { if (!cm->last_frame_seg_map) goto fail; + + cm->above_seg_context = + (PARTITION_CONTEXT *)vpx_calloc(mi_cols_aligned_to_sb(cm->mi_cols), + sizeof(*cm->above_seg_context)); + if (!cm->above_seg_context) + goto fail; + return 0; fail: diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 52889f75f..a049db109 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -202,6 +202,8 @@ typedef struct VP9Common { // Handles memory for the codec. InternalFrameBufferList int_frame_buffers; + + PARTITION_CONTEXT *above_seg_context; } VP9_COMMON; static INLINE YV12_BUFFER_CONFIG *get_frame_new_buffer(VP9_COMMON *cm) { |