summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_alloccommon.c
AgeCommit message (Collapse)Author
2014-12-15Revert "Revert "Add support for setting byte alignment.""Frank Galligan
This reverts commit 91471d6aad285ff10e7582e485d8adadd1986fe2. Fixes the compile issues if post_proc is enabled. Change-Id: Ib40a15ce2c194f9b5adfa65a17ab01ddf60f5a59
2014-12-15Revert "Add support for setting byte alignment."Paul Wilkins
Fails to compile. Bad calls to vp9_alloc_frame_buffer and vp9_realloc_frame_buffer in postproc.c This reverts commit 399823b6f50fb7465f62822d1395e2192e7b07fc. Change-Id: I29f0e173f8e185d3a303cfdb17813e1eccb51e3a
2014-12-12Merge "Add support for setting byte alignment."Frank Galligan
2014-12-12Add support for setting byte alignment.Frank Galligan
Add support for setting byte alignment on the Y, U, and V plane of the reference buffers. The byte alignment must be a power of 2, from 32 to 1024. A value of 0 sets legacy alignment. Change-Id: I7c1399622f7aa68e123646369216b32047dda73d
2014-12-12vp9: make postproc members depend on CONFIG_VP9_POSTPROCJames Zern
Change-Id: Id64218386968cee3132269e4a0572650f20fd980
2014-12-12vp9_postproc: remove redundant CONFIG_* checksJames Zern
the entire module is wrapped in CONFIG_VP9_POSTPROC which is forcibly enabled with CONFIG_INTERNAL_STATS + a similar change in vp9_alloccommon.c Change-Id: I374993297a9fba5bef2f0b71f984eba42f0995a3
2014-12-11Multiframe Quality Enhancement(MFQE) in VP9.JackyChen
It is the first version of MFQE in VP9. There are a few TODOs included in this version. Usage: Add flag --enable-vp9-postproc to config the project. In decoder, use flag --mfqe in the command line to enable MFQE in postproc. Note: Need to have key frame with low quality to see the effect of this new patch. In my experiment, I fixed the qindex to 200 in key frame. Change-Id: I021f9ce4616ed3574c81e48d968662994b56a396
2014-11-06Modify the frame context memory deallocationYunqing Wang
This patch was to fix the vpxdec fuzzing3 test failure. When an error occurs, setjmp() is invoked, which calls the decoder removing routine. In multiple thread situation, other threads could try to access the frame context memory that is already deallocated, thus causing a segfault. An invalid unit test was added for this issue. Change-Id: Ida7442154f3d89759483f0f4fe0324041fffb952
2014-11-05Merge "Totally remove prev_mi in VP9 decoder."hkuang
2014-11-05Totally remove prev_mi in VP9 decoder.hkuang
This will save the memory and improve the decode speed due to removing unnecessary memset of big prev_mi array for all the key frames. Decoding a all key frames 1080p video shows speed improve around 2%. Change-Id: I6284a445c1291056e3c15135c3c20d502f791c10
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