summaryrefslogtreecommitdiff
path: root/vpx_scale/generic/yv12config.c
AgeCommit message (Collapse)Author
2021-10-08vp8_yv12_realloc_frame_buffer: move allocation checkJames Zern
to before the memset used under msan to avoid any spurious reports in OOM conditions Change-Id: I0c4ee92829bbcb356e94f503a4615caf891bb49d
2019-01-14Reset buffer_alloc_sz after freeing buffer_alloc.Wan-Teh Chang
ybf->buffer_alloc and ybf->buffer_alloc_sz should ideally be kept in sync. If ybf->buffer_alloc is reset to NULL after being freed, then ybf->buffer_alloc_sz should be reset to 0. Change-Id: I7e7566b563ddf145d0e46050c5b6bd141084f8b3
2018-12-21Bound the total allocated memory of frame bufferkyslov
This CL allows to limit memory consumption of the frame buffer pool. As the result if compiled with VPX_MAX_ALLOCABLE_MEMORY set codec will fail if frame resolution requires more memory This is backported CL aae2183cb58b60d01b8e4e15269ee9f48dd72908 from aomedia Tested: configure --extra-cflags="-DVPX_MAX_ALLOCABLE_MEMORY=536870912" make ./test_libvpx BUG=webm:1579 Change-Id: Ic62213b600a7562917d5a339a344ad8db4b6f481
2018-11-20Declare buffer_alloc_sz and frame_size as size_t.Wan-Teh Chang
Change-Id: Id632ddcbfb0bd3a4258aebdfb98f9dc2e4d04438
2018-11-20Validate the |border| parameter earlier.Wan-Teh Chang
vpx_realloc_frame_buffer() should validate the |border| parameter earlier, before it allocates the buffer and preferrably before it uses |border|. This backports libaom commit 2860b3ae8b764bdfa2b8c7a06df2673e907b993f: https://aomedia-review.googlesource.com/c/aom/+/74324 Change-Id: Ib9d59d74e27430ccb1e83c6ad5424aff9672c989
2018-11-09vp8: Init buffers and pred arrays for mt after allocation.Jerome Jiang
Buffers and arrays used for prediction are not initialized after allocation. BUG=902691 Change-Id: Ic727e5dab7456e91ec9d6c80694f60a1a3600640
2018-07-26Move CONFIG_SIZE_LIMIT check in yv12config.c.Tom Finegan
Avoids a C90 compile error. BUG=webm:1551 Change-Id: Iee0f208de053c2a399aafa015d370c0496878816
2018-07-24Check size limit in vpx_realloc_frame_buffer.Wan-Teh Chang
If CONFIG_SIZE_LIMIT is defined, vpx_realloc_frame_buffer should fail if width or height is too big. This carries over commit ebc2714d71a834fc32a19eef0a81f51fbc47db01 of libaom: https://aomedia-review.googlesource.com/c/aom/+/65521 Change-Id: Id7645c5cefbe1847714695d41f506ff30ea985f6
2018-01-11adopt some clang 5.0.0 formattingJohann
At least the changes that don't conflict with 4.0.1 Change-Id: I9b6a7c14dadc0738cd0f628a10ece90fc7ee89fd
2017-11-03fail early on oversize framesJohann
Even though frame_size is calculated in uint64_t, it winds up in an int size value. This was exposed with the msan test because the memset is called with (int)frame_size, leading to a segfault. Change-Id: I7fd930360dca274adb8f3e43e5e6785204808861
2016-07-26vpx_scale: apply clang-formatclang-format
Change-Id: Ia07ba57756f75911d3d06318e1f9b1982e1ca8c5
2016-06-17remove vp10James Zern
development has moved to the nextgenv2 branch and a snapshot from here was used to seed aomedia BUG=b/29457125 Change-Id: Iedaca11ec7870fb3a4e50b2c9ea0c2b056a0d3c0
2016-05-19Revert "Extend the external fb interface to allocate individual planes."James Zern
This reverts commit 6dd7f2b50a65373aa906d678cb5a29fb65531a55. conversion warnings, crashes in 32-bit builds Change-Id: I529ead34cd93c862dd07c9a29d8542dda2fc20ea
2016-05-18Extend the external fb interface to allocate individual planes.Daniele Castagna
Change-Id: I73e1b9ea6f4c76ae539e2b3292ee4c751d9c7de4
2016-02-02yv12config.c: remove dead CONFIG_ALPHA codeJames Zern
the rest was removed with: 5926e7c Remove unfinished VP9 alpha channel. Change-Id: I0c1d92765e5334e1380ad027b069b401e4ae9b8f
2015-11-02vpx_scale: fix the issue in msan test.jackychen
Do memset to fix msan issue due to the access of uninitialized memory. BUG=https://code.google.com/p/chromium/issues/detail?id=549155 Change-Id: I02f995ede79e3574e72587cc078df1a0d11af002
2015-08-14Change vp9_ prefix function names in vpx_scale to vpx_Jingning Han
Change-Id: Iac85902cbbb3e752801dc85de9a3c778e47304aa
2015-08-11Fork VP9 and VP10 codebaseJingning Han
This commit folks the VP9 and VP10 codebase and makes libvpx support VP8, VP9, and VP10. Change-Id: I81782e0b809acb3c9844bee8c8ec8f4d5e8fa356
2015-05-13Relocate memory operations for common codeJohann
With the sad functions, and hopefully the variance functions soon, moving to the vpx_dsp location, place the defines used in the reference C code in a common location. Change-Id: I4c8ce7778eb38a0a3ee674d2f1c488eda01cfeca
2015-04-28vpx_mem: remove vpx_memsetJames Zern
vestigial. replace instances with memset() which they already were being defined to. Change-Id: Ie030cfaaa3e890dd92cf1a995fcb1927ba175201
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-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-10-11yv12config: fix highbitdepth buildJames Zern
Change-Id: Ie8a4caae19fb514d5bd22e0ae35ca0edcd3484ae
2014-10-02Fix subsampling check for images 1 pixel wide/tallAlex Converse
Change-Id: I0e262ede7eb4a4ae0c86181922d744e542e93350
2014-09-15Remove memset of every external frame buffer.Frank Galligan
Libvpx was memseting every external frame buffer before decode. This was to work around a valgrind issue in our C loop filter. Most of the time this was not needed and we have noticed some significant performance loss on some platforms. Now we require the application to zero out the buffers if it is using external frame buffers. Change-Id: I7330d00a315e65137ed30edd5f813e8929b76242
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-07-24Set and use uv_crop_[width|height]Johann
Ensure consistent border extension by rounding uv_crop_* at image creation time. Where it was rounded problems could arise with the right and bottom extensions. When padding = 32, y_width = 64, and y_crop_width = 63: (padding + width - crop_width + 1) / 2 32 + 64 - 63 + 1 should equal 32 *but* 32 + 1 + 1 equals 34 giving a right buffer of 17 instead of 16. By calculating uv_crop_* earlier we round up at the appropriate time and for the same values: (y_crop_width + 1) / 2 63 + 1 / 2 64 (padding / 2) + uv_width - uv_crop_width 16 + 16 - 16 16 Change-Id: If866cd1b63444771440edb1432280ac83875969b
2014-07-18Fix visual studio build failureYunqing Wang
Cast frame_size to be int for now to fix build warnings. Change-Id: I411ba2b1fd429a383c8f6e832b4fa4147914c824
2014-07-17fail allocation of buffers if size_t < frame_sizeJim Bankoski
Change-Id: I25c595e8c197ab0a9955d2373f1a74d42fbd1638
2014-04-24Remove test against NULL before freeing memoryAdrian Grange
Change-Id: I6ce6395b74019345c8b7242d874761f981ad53af
2014-02-13Adding explicit casts in yv12config.c.Dmitry Kovalev
This patch fixes c++ compiler errors. Change-Id: I4d4b5af3bdaada101d753f3bc19819f5252b4e44
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-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-10Fix Issue #679: vp9 C loop filter produces valgrind warning.hkuang
Fix the valgrind error due to access uninitialized memory in loopfilter. Change-Id: I52fccf5ede845ee1f4c13d3bd909b8f220c0bdff
2013-12-16Avoid mixed comparisonJohann
Silences warning C4018: '>' : signed/unsigned mismatch Change-Id: I07d34060043e8ada7d995ea6dc8276cb881c7d95
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-11-14fix scalling bug by buffer auto-reallocationAdrian Grange
Change-Id: Ib748eb287520c794631697204da6ebe19523ce95
2013-08-16Fixed typos and formattingAdrian Grange
Change-Id: I3814984a624bc64147c57efa74fbdda8eda47262
2013-07-30Cleanup typos, remove unnecessary lines, replace switchAdrian Grange
Removed unnecessary code lines, replaced switch with an if, fixed spelling errors and formatting. Change-Id: Ie48aa4604aa0ed48362ca359d792fb21b2ec1dc6
2013-06-25Only do metrics on cropped (visible) area of picture.Ronald S. Bultje
The part where we align it by 8 or 16 is an implementation detail that shouldn't matter to the outside world. Change-Id: I9edd6f08b51b31c839c0ea91f767640bccb08d53
2013-06-07Align frame size to 8 instead of 16.Ronald S. Bultje
Change-Id: Ic606ef1b31e49963a779455a1e010a9ebb0f3f1f
2013-05-16Initial version of alpha channel supportJohn Koleszar
This is a mostly-working implementation of an extra channel in the bitstream. Configure with --enable-alpha to test. Notable TODOs: - Add extra channel to all mismatch tests, PSNR, SSIM, etc - Configurable subsampling - Variable number of planes (currently always uses all 4) - Loop filtering - Per-plane lossless quantizer - ARNR support This implementation just uses the same contents as the Y channel for the A channel, due to lack of content and general pain in playing back 4 channel content. A later patch will use the actual alpha channel passed in from outside the codec. Change-Id: Ibf81f023b1c570bd84b3064e9b4b8ae52e087592
2013-05-15Adding alpha plane to YV12_BUFFER_CONFIG structure.Dmitry Kovalev
Change-Id: I8b2687138df636b2b78c8cc5156e3882b0009de0
2013-05-09Subsampling aware allocs and bitstreamJohn Koleszar
Make framebuffer allocations according to the chroma subsamping factors in use. A bit is placed in the raw part of the frame header for each of the two subsampling factors. This will be moved in a future commit to make them part of the TBD feature set bits, probably only set on keyframes, etc. Change-Id: I59ed38d3a3c0d4af3c7c277617de28d04a001853
2013-03-13Fix pulsing issue with scalingJohn Koleszar
Updates the YV12_BUFFER_CONFIG structure to be crop-aware. The exiting width/height parameters are left unchanged, storing the width and height algined to a 16 byte boundary. The cropped dimensions are added as new fields. This fixes a nasty visual pulse when switching between scaled and unscaled frame dimensions due to a mismatch between the scaling ratio and the 16-byte aligned sizes. Change-Id: Id4a3f6aea6b9b9ae38bdfa1b87b7eb2cfcdd57b6
2013-02-08Avoid allocating memory when resizing framesJohn Koleszar
As long as the new frame is smaller than the size that was originally allocated, we don't need to free and reallocate the memory allocated. Instead, do the allocation on the size of the first frame. We could make this passed in from the application instead, if we wanted to support external upscaling. Change-Id: I204d17a130728bbd91155bb4bd863a99bb99b038
2012-07-17Restyle codeJohn Koleszar
Approximate the Google style guide[1] so that that there's a written document to follow and tools to check compliance[2]. [1]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml [2]: http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py Change-Id: Idf40e3d8dddcc72150f6af127b13e5dab838685f
2011-07-20Increase chrow row alignment to 16 bytes.Timothy B. Terriberry
This is done by expanding luma row to 32-byte alignment, since there is currently a bunch of code that assumes that uv_stride == y_stride/2 (see, for example, vp8/common/postproc.c, common/reconinter.c, common/arm/neon/recon16x16mb_neon.asm, encoder/temporal_filter.c, and possibly others; I haven't done a full audit). It also uses replaces the hardcoded border of 16 in a number of encoder buffers with VP8BORDERINPIXELS (currently 32), as the chroma rows start at an offset of border/2. Together, these two changes have the nice advantage that simply dumping the frame memory as a contiguous blob produces a valid, if padded, image. Change-Id: Iaf5ea722ae5c82d5daa50f6e2dade9de753f1003
2011-07-13Better allocate yuv buffers.Fritz Koenig
Previously allocated more memory than necessary for yuv buffers. This makes it harder to track bugs with reading uninitialized data. Change-Id: I510f7b298d3c647c869be6e5d51608becc63cce9