summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_alloccommon.c
AgeCommit message (Collapse)Author
2014-11-04Fix the memory leak due to missing free frame_mvs.hkuang
Change-Id: I2ceee7341d906259002c0ea31ea009ae32c04bfd
2014-10-31Bind motion vectors with frame buffer structure.hkuang
This will save a lot of memory for decoder due to removing of prev_mi, but prev_mi is still needed in encoder. So this will increase a little bit memory for encoder. Change-Id: I24b2f1a423ebffa55a9bd2fcee1077dac995b2ed
2014-09-19Remove mi_grid_* structures.hkuang
mi_grid_* are arrays of pointer to pointer. They save the pointers that point to the MIs in cm->mi. But they are unnecessary and complicated. The original goal was to remove MODE_INFO_t copy. But with an extra MODE_INFO_t pointer inside MODE_INFO_t, same goal could be achieved. This commit totally removes the mi_grid_* structures. But there are still many dummy MODE_INFO_t inside cm->mi which are a waste of memory. Next commit will do on-demand MODE_INFO_t allocation in order to save these memories. Change-Id: I3a05cf1610679fed26e0b2eadd315a9ae91afdd6
2014-09-02Adds config opt for highbitdepth + misc. vpxDeb Mukherjee
Adds config parameter vp9_highbitdepth, to support highbitdepth profiles. Also includes most vpx level high bit-depth functions. However encode/decode in the highbitdepth profiles will not work until the rest of the code is in place. Change-Id: I34c53b253c38873611057a6cbc89a1361b8985a6
2014-08-14Fix bug 837: realloc mode info buffers on resizeAdrian Grange
The test to determine if the mode info buffers need to be resized when the frame size changes was incorrect, as per bug 837. By storing the size of the allocated data structure, a simple test determines whether to allocate more memory when the frame size changes. Change-Id: I1544698f2882cf958fc672485614f2f46e9719bd
2014-07-17Modified frame buffer handlingAdrian Grange
This patch is the first step toward simplifying the frame buffer handling. The final goal is to have a common frame buffer handling framework for both encoder and decoder that incorporates the existing ability to use externally allocated memory. Change-Id: I2c378a4f54a39908915f46c4260e17a080db7ff1
2014-06-27vp9: disable postproc buffer alloc when unnecessaryJames Zern
the buffer is only used in encoding and only when CONFIG_INTERNAL_STATS or CONFIG_VP9_POSTPROC is enabled. a future change should decouple this from the frame buffer allocation and make it conditional based on runtime flags when the above config options are enabled. reduces decode heap usage by at least 12% Change-Id: Id0b97620d4936afefa538d3aadf32106743d9caf
2014-06-23Allocate buffers based on correct chroma formatAdrian Grange
The encoder currently allocates frame buffers before it establishes what the chroma sub-sampling factor is, always allocating based on the 4:4:4 format. This patch detects the chroma format as early as possible allowing the encoder to allocate buffers of the correct size. Future patches will change the encoder to allocate frame buffers on demand to further reduce the memory profile of the encoder and rationalize the buffer management in the encoder and decoder. Change-Id: Ifd41dd96e67d0011719ba40fada0bae74f3a0d57
2014-06-10Add mode info arrays and mode info index.hkuang
In non frame-parallel decoding, this works the same way as current decoding scheme. Every time after decoder finish decoding a frame, it will swap the current mode info pointer and previous mode info pointer if the decoded frame needs to be shown. Both mode info pointer and previous mode info pointer are from mode info arrays. In frame-parallel decoding, this will become more complicated as current frame's mode info pointer will be shared with next frame as previous mode info pointer. But when one decoder thread finishes decoding one frame and starts to work on next available frame, it needs to retain the decoded frame's mode info pointers until next frame finishes decoding. The mode info index will serve this purpose. The decoder will use different buffer in the mode info arrays and use the other buffer to save previous decoded frame’s mode info. Change-Id: If11d57d8eb0ee38c8876158e5482177fcb229428
2014-04-01Renaming two members in MACROBLOCKD struct.Dmitry Kovalev
Renames: mi_8x8 -> mi mode_info_stride -> mi_stride Change-Id: I66f3e5fd1e7b7f46f108af5bb711c5fd9493c1be
2014-03-25Moving above_context to VP9_COMMON.Dmitry Kovalev
Change-Id: I713af99d1e17e05a20eab20df51d74ebfd1a68d2
2014-03-24Initialization code cleanup.Dmitry Kovalev
Change-Id: I47a8b4bf9a6cc0063d1a6785eaaad641d0659e24
2014-03-21Renaming and making vp9_update_mode_info_border() static.Dmitry Kovalev
Change-Id: Ibb72a29cae9ca9443aae56fc4c5458d190eae279
2014-03-20Reusing {above, left}_seg_context vars in both encoder and decoder.Dmitry Kovalev
Change-Id: Id1fa36c92cb007b73a450cc8552e810cedad38b9
2014-03-19Adding alloc_mi() function.Dmitry Kovalev
Change-Id: I3b944884c048f589c86e0169aeb3c3855bc8b729
2014-03-13Adding vp9_swap_mi_and_prev_mi() function.Dmitry Kovalev
Change-Id: I18b3939f0b51085cdd25c9182c3a9c7536ca7e3e
2014-03-10Adding type casts to remove C++ compiler errors.Dmitry Kovalev
Change-Id: I224e49955ad6c833d204feb8efc4056e37d206be
2014-03-01Remove vp9_create_common()Yaowu Xu
The function has evolved over time, now only calls vp9_rtcd(), so this commit removes the function and changes to call vp9_rtcd() directly. Change-Id: I8cfa6190daa4b28f6f3d1e11bb3a07f9c95322bf
2014-02-26Removing vp9_systemdependent.c.Dmitry Kovalev
Change-Id: I7b9738a7113c0c4687e5d320581ff69d98a8b271
2014-02-10Add get release decoder frame buffer functions.Frank Galligan
This CL changes libvpx to call a function when a frame buffer is needed for decode. Libvpx will call a release callback when no other frames reference the frame buffer. This CL adds a default implementation of the frame buffer callbacks. Currently only VP9 is supported. A future CL will add support for applications to supply their own frame buffer callbacks. Change-Id: I1405a320118f1cdd95f80c670d52b085a62cb10d
2014-01-29Combining fb_idx_ref_cnt[] and yv12_fb[] arrays.Dmitry Kovalev
Adding new RefCntBuffer struct which contains reference counter and image buffer. Change-Id: I71c1f532faa13442c32c43fc03ec45b6f88fb844
2014-01-24Revert external frame buffer code.Frank Galligan
A future CL will add external frame buffers differently. Squash commit of four revert commits: Revert "Increase required number of external frame buffers" This reverts commit 9e41d569d7c84dd9ca8f0047c15377a883945685. Revert "Add external constants." This reverts commit bbf53047b03106e3c2e24b28cb836cc838db5ee8. Revert "Add frame buffer lru cache." This reverts commit fbada948fa345e67acf9aa41a8f9a78f5dfe8648. Conflicts: vpxdec.c Change-Id: I76fe42419923a6ea6c75d9997cbbf941d73d3005 Revert "Add support to pass in external frame buffers." This reverts commit 10f891696bc4c972c13cc9fde2c53470501a03e2. Conflicts: test/external_frame_buffer_test.cc vp9/common/vp9_alloccommon.c vp9/common/vp9_reconinter.c vp9/decoder/vp9_decodeframe.c vp9/encoder/vp9_onyx_if.c vp9/vp9_dx_iface.c vpx/vpx_decoder.h vpx/vpx_external_frame_buffer.h vpx_scale/generic/yv12config.c vpxdec.c Change-Id: I7434cf590f1c852b38569980e4247fad0d939c2e
2014-01-21Seperate the border size for encoder and decoder.hkuang
Encoder's boarder is still 160, while decoder's boarder will be 32. With on demand and separate boarder buffer for boarder extension. The decoder's boarder does not need to to 160 anymore. Change-Id: I93d5aaff15a33a2213e9761eaa37c5f2870747db
2014-01-03Adding RefBuffer struct.Dmitry Kovalev
Adding RefBuffer to simplify reference buffer management. The struct has a pointer to image data and scale factors relative to the current frame. Change-Id: If38eb1491ff687cc11428aee339f3e052e2c5d9e
2013-12-19Removing vp9_findnearmv.{h, c} files.Dmitry Kovalev
Moving all code from that files to vp9_mvref_common.{h, c}. Change-Id: Ibc4afcb8cea6847166ff411130e93611ebe63b20
2013-12-15Add frame buffer lru cache.Frank Galligan
Add an option for libvpx to return the least recently used frame buffer. Change-Id: I886a96ffb94984f1c42de53086e0131922df3260
2013-12-15Add support to pass in external frame buffers.Frank Galligan
VP9 decoder can now use frame buffers passed in by the application. Change-Id: I599527ec85c577f3f5552831d79a693884fafb73
2013-12-06Merge "Renaming constants."Dmitry Kovalev
2013-12-05Renaming constants.Dmitry Kovalev
NUM_YV12_BUFFERS => FRAME_BUFFERS ALLOWED_REFS_PER_FRAME => REFS_PER_FRAME NUM_REF_FRAMES_LOG2 => REF_FRAMES_LOG2 NUM_REF_FRAMES => REF_FRAMES NUM_FRAME_CONTEXTS_LOG2 => FRAME_CONTEXTS_LOG2 NUM_FRAME_CONTEXTS => FRAME_CONTEXTS Change-Id: I4e1ada08f25d8fa30fdf03aebe1b1c9df0f87e63
2013-12-05Remove redundant calls to vp9_update_mode_info_borderAdrian Grange
Removed calls to vp9_update_mode_info_border since they immediately followed code that initialized the entire buffer to 0. Change-Id: Ife06794daa20439a0b607a83a87f88df59afac40
2013-12-03Merge "Removing dummy assignments."Dmitry Kovalev
2013-11-27Moving token-encoding related stuff from common to encoder.Dmitry Kovalev
Change-Id: I0e59d320407b3bed0ba3622a7b29975f6fad7ebf
2013-11-26Removing dummy assignments.Dmitry Kovalev
Change-Id: I10d1a4bcac751a982d9dd135f019e3a4d92f8522
2013-11-26Moving mode encodings from common to encoder + cleanup.Dmitry Kovalev
Change-Id: I248ccb1532e2cd95314d0b95108f2c2e71cf084f
2013-11-25Moving mv entropy encodings calculation to the encoder side.Dmitry Kovalev
Moved arrays: vp9_mv_joint_encodings vp9_mv_class_encodings vp9_mv_class0_encodings vp9_mv_fp_encodings Change-Id: Iaf5008c579fcbd6d77fdd81d1aef8c71b5f308b7
2013-11-22Renaming COMPPREDMODE_TYPE enum and its members.Dmitry Kovalev
List of renames: COMPPREDMODE_TYPE => REFERENCE_MODE SINGLE_PREDICTION_ONLY => SINGLE_REFERENCE COMP_PREDICTION_ONLY => COMPOUND_REFERENCE HYBRID_PREDICTION => REFERENCE_MODE_SELECT (like TX_MODE_SELECT) NB_PREDICTION_TYPES => REFERENCE_MODES Change-Id: If723dabe9435325d0165dcd028142a2c78b417b4
2013-11-14fix scalling bug by buffer auto-reallocationAdrian Grange
Change-Id: Ib748eb287520c794631697204da6ebe19523ce95
2013-10-28vp9: remove partition+entropy contexts from commonJames Zern
these are now handled separately by the encoder and decoder Change-Id: If9b16f7d734e992fb94a510a6d88f2690d7fb7cb
2013-10-07Moving all scan/iscan code into separate vp9_scan.{h, c} files.Dmitry Kovalev
Now we have entropy code separate from scan/iscan code. The next step in future is to move iscan code from common part to the encoder. Change-Id: Id9732f7d80aec00af35c1d58d1137c4c96c91451
2013-10-01Moving get_token_alloc function from common to the encoder.Dmitry Kovalev
Also renaming mb_row -> mi_row, mb_col -> mi_col arguments and calculate mb_rows/mb_cols values from mi_rows/mi_cols. Change-Id: I6919a279f560648e23bc9a12f507d17c21ffd5d7
2013-09-27Removing unnecessary function calls.Dmitry Kovalev
Both vp9_init_mbmode_probs() and vp9_zero(cm->ref_frame_sign_bias) are called inside vp9_setup_past_independence() which called in any case for encoder/decoder after VP9_COMMON struct creation. Change-Id: I3724d1a4fb8060101ff0290dd6a158f0b5c57bb4
2013-09-11New mode_info_context storage -- undo revertScott LaVarnway
mode_info_context was stored as a grid of MODE_INFO structs. The grid now constists of pointers to MODE_INFO structs. The MODE_INFO structs are now stored as a stream (decoder only), eliminating unnecessary copies and is a little more cache friendly. Change-Id: I031d376284c6eb98a38ad5595b797f048a6cfc0d
2013-09-09Revert "New mode_info_context storage"James Zern
This reverts commit dae17734ece414091ba1184f7becd0aa6c0004f1 Encode crashes, leaks and increases integer overflow errors. Change-Id: I595aa2649bb8d0b6552ff91652837a74c103fda2
2013-09-06New mode_info_context storageScott LaVarnway
mode_info_context was stored as a grid of MODE_INFO structs. The grid now constists of a pointer to a MODE_INFO struct and a "in the image" flag. The MODE_INFO structs are now stored as a stream, eliminating unnecessary copies and is a little more cache friendly. For the test clips used, the decoder performance improved by ~4.3% (1080p) and ~9.7% (720p). Patch Set 2: Re-encoded clips with latest. Now ~1.7% (1080p) and 5.9% (720p). Change-Id: I846f29e88610fce2523ca697a9a9ef2a182e9256
2013-08-29consistently name VP9_COMMON variables #2James Zern
oci -> cm Change-Id: Ifd75c809d9cc99034d3c2fccc4653a78b3aec21f
2013-08-22rename LOG2_* defines to *_LOG2James Zern
gets rid of a mix of styles Change-Id: I3591d312157bc6f53a25438bf047765c671fd8a8
2013-08-16Merge "Added resizing & initialization of last frame segment map"Adrian Grange
2013-08-15Added resizing & initialization of last frame segment mapAdrian Grange
When the frame size changes the last frame segment map must be resized to match and initialized to 0. Change-Id: Idc10de109f55dbe9af3a6caae355a2974712243d
2013-08-14Renaming in MB_MODE_INFOPaul Wilkins
The macro block mode info context originally contained an entry for each 16x16 macroblock. In VP9 each entry refers to an 8x8 region not a macro block, so the naming is misleading. This first stage clean up changes the names of 3 entries in the structure to remove the mb_ prefix. TODO clean up the nomenclature more widely in respect of mbmi and bmi. Change-Id: Ia7305c6d0cb805dfe8cdc98dad21338f502e49c6
2013-08-12Entropy context related cleanups.Dmitry Kovalev
Adding set_skip_context() function used from both encoder and decoder. Change-Id: Ia22cfad3211a00a63eb294f64f857b78f4aa9b85