summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encoder.c
AgeCommit message (Collapse)Author
2015-03-04Make encoder buffer allocation dynamicAdrian Grange
Frame buffers are now allocated dynamically on-demand. Entries in the reference frame map, cm->ref_frame_map, may now be set to -1 (INVALID_IDX) to indicate that there is not a valid reference buffer in that "slot". All slots in the reference frame map are now initialized to the empty state (-1) and each buffer is initialized to have a reference count of 0. Change-Id: Id1afe98de98db4ae8b2dfefed7889c3b28c68582
2015-02-27Fix calc_highbd_psnrAdrian Grange
Should use the crop dimensions of the frame rather than the extended size. Change-Id: I49ed041a46ff0753d43e074020857b7ff2f95e17
2015-02-26Fix the encoder to support profile changeYaowu Xu
Change-Id: Iefb928ad1174e274409facfb44f80265ff0f7683
2015-02-26Correct parameter order in a function callYaowu Xu
Change-Id: Ibd87db1c4371edcbe193d39df2fdc07d3842c21a
2015-02-11Add skin detection.Marco
Simple skin detection, from vp8; works reasonable on most of the RTC clips, but could miss sometimes. Added debug flag to write out skin map over source input. Change-Id: I2caea7592f1c459047aac46627eeb24a94946464
2015-02-10Move computation up to frame levelYaowu Xu
This is to avoid redo the same calculation repeatly, and also allow easier adjustments for further experiments. This commit shall have no effect on quality/compression. Change-Id: I4460acf5c808ff5518da18d21e002c5da58af857
2015-02-10Auto-adaptive encoder frame resizing logicAdrian Grange
Note: This feature is still in development. Add an option for the encoder to decide the resolution at which to encode each frame. Each KF/GF/ARF goup is tested to see if it would be better encoded at a lower resolution. At present, each KF/GF/ARF is coded first at full-size and if the coded size exceeds a threshold (twice target data rate) at the maximum active Q then the entire group is encoded at lower resolution. This feature is enabled in vpxenc by setting: --resize-allowed=1 In addition, if the vpxenc command line also specifies valid frame dimensions using: --resize-width=XXXX & --resize_height=YYYY then *all* frames will be encoded at this resolution. Change-Id: I13f341e0a82512f9e84e144e0f3b5aed8a65402b
2015-02-02Merge "Allow larger encoder configurations."Alex Converse
2015-01-30Try again to merge branch 'frame-parallel' into master branch.hkuang
In frame parallel decode, libvpx decoder decodes several frames on all cpus in parallel fashion. If not being flushed, it will only return frame when all the cpus are busy. If getting flushed, it will return all the frames in the decoder. Compare with current serial decode mode in which libvpx decoder is idle between decode calls, libvpx decoder is busy between decode calls. Current frame parallel decode will only speed up the decoding for frame parallel encoded videos. For non frame parallel encoded videos, frame parallel decode is slower than serial decode due to lack of loopfilter worker thread. There are still some known issues that need to be addressed. For example: decode frame parallel videos with segmentation enabled is not right sometimes. * frame-parallel: Add error handling for frame parallel decode and unit test for that. Fix a bug in frame parallel decode and add a unit test for that. Add two test vectors to test frame parallel decode. Add key frame seeking to webmdec and webm_video_source. Implement frame parallel decode for VP9. Increase the thread test range to cover 5, 6, 7, 8 threads. Fix a bug in adding frame parallel unit test. Add VP9 frame-parallel unit test. Manually pick "Make the api behavior conform to api spec." from master branch. Move vp9_dec_build_inter_predictors_* to decoder folder. Add segmentation map array for current and last frame segmentation. Include the right header for VP9 worker thread. Move vp9_thread.* to common. ctrl_get_reference does not need user_priv. Seperate the frame buffers from VP9 encoder/decoder structure. Revert "Revert "Revert "Revert 3 patches from Hangyu to get Chrome to build:""" Conflicts: test/codec_factory.h test/decode_test_driver.cc test/decode_test_driver.h test/invalid_file_test.cc test/test-data.sha1 test/test.mk test/test_vectors.cc vp8/vp8_dx_iface.c vp9/common/vp9_alloccommon.c vp9/common/vp9_entropymode.c vp9/common/vp9_loopfilter_thread.c vp9/common/vp9_loopfilter_thread.h vp9/common/vp9_mvref_common.c vp9/common/vp9_onyxc_int.h vp9/common/vp9_reconinter.c vp9/decoder/vp9_decodeframe.c vp9/decoder/vp9_decodeframe.h vp9/decoder/vp9_decodemv.c vp9/decoder/vp9_decoder.c vp9/decoder/vp9_decoder.h vp9/encoder/vp9_encoder.c vp9/encoder/vp9_pickmode.c vp9/encoder/vp9_rdopt.c vp9/vp9_cx_iface.c vp9/vp9_dx_iface.c This reverts commit a18da9760a74d9ce6fb9f875706dc639c95402f5. Change-Id: I361442ffec1586d036ea2e0ee97ce4f077585f02
2015-01-29Allow larger encoder configurations.Alex Converse
Allow changing colorspace in the encoder and increasing frame size. Change-Id: I8e7c3b891af29ce420a15beb4f6f9c250245b2bb
2015-01-28Change to update of rate control factors.Paul Wilkins
Remove damping parameter and use the damping formula introduced by Yaowu Xu in all cases. Change-Id: I18db7e0d0f262d5140102f259ab07821d374d285
2015-01-23Revert "Merge branch 'frame-parallel' to enable frame parallel decode in ↵Johann
master branch." This reverts commit bde04ce5039cbcf86c8b34bdb4127e18d7e1d0c7 Change-Id: I053dae04c761b04a36dc239558503905a14d2470
2015-01-22Merge branch 'frame-parallel' to enable frame parallel decode in master branch.hkuang
In frame parallel decode, libvpx decoder decodes several frames on all cpus in parallel fashion. If not being flushed, it will only return frame when all the cpus are busy. If getting flushed, it will return all the frames in the decoder. Compare with current serial decode mode in which libvpx decoder is idle between decode calls, libvpx decoder is busy between decode calls. VP9 frame parallel decode is >30% faster than serial decode with tile parallel threading which will makes devices play 1080P VP9 videos more easily. * frame-parallel: Add error handling for frame parallel decode and unit test for that. Fix a bug in frame parallel decode and add a unit test for that. Add two test vectors to test frame parallel decode. Add key frame seeking to webmdec and webm_video_source. Implement frame parallel decode for VP9. Increase the thread test range to cover 5, 6, 7, 8 threads. Fix a bug in adding frame parallel unit test. Add VP9 frame-parallel unit test. Manually pick "Make the api behavior conform to api spec." from master branch. Move vp9_dec_build_inter_predictors_* to decoder folder. Add segmentation map array for current and last frame segmentation. Include the right header for VP9 worker thread. Move vp9_thread.* to common. ctrl_get_reference does not need user_priv. Seperate the frame buffers from VP9 encoder/decoder structure. Revert "Revert "Revert "Revert 3 patches from Hangyu to get Chrome to build:""" Conflicts: test/codec_factory.h test/decode_test_driver.cc test/decode_test_driver.h test/invalid_file_test.cc test/test-data.sha1 test/test.mk test/test_vectors.cc vp8/vp8_dx_iface.c vp9/common/vp9_alloccommon.c vp9/common/vp9_entropymode.c vp9/common/vp9_loopfilter_thread.c vp9/common/vp9_loopfilter_thread.h vp9/common/vp9_mvref_common.c vp9/common/vp9_onyxc_int.h vp9/common/vp9_reconinter.c vp9/decoder/vp9_decodeframe.c vp9/decoder/vp9_decodeframe.h vp9/decoder/vp9_decodemv.c vp9/decoder/vp9_decoder.c vp9/decoder/vp9_decoder.h vp9/encoder/vp9_encoder.c vp9/encoder/vp9_pickmode.c vp9/encoder/vp9_rdopt.c vp9/vp9_cx_iface.c vp9/vp9_dx_iface.c Change-Id: Ib92eb35851c172d0624970e312ed515054e5ca64
2015-01-21Allow external resize via vpx_codec_enc_config_setAlex Converse
Change-Id: I3d324e2baa4de2d266c5f7ca7b635b62372e90a7
2015-01-16vp9_ethread: add parallel loopfilterYunqing Wang
1. Added row-based loopfilter in encoder; 2. Moved common multi-threaded loopfilter functions from decoder to common; 3. Merged multi-threaded loopfilter code, and made encoder/ decoder call same function to reduce code duplication. Encoder tests showed that 1% - 2% speedup was seen for good-quality 2-pass mode(at speed 3); 1% - 3% speedup using 2 threads and 4% - 6% speedup using 4 threads were seen for real-time mode(at speed 7). Change-Id: I8a4ac51c2ad9bab9fa7b864e90743931c53ec1c4
2015-01-14Add encoder control for setting color spaceYaowu Xu
This commit adds encoder side control for vp9 to set color space info in the output compressed bitstream. It also amends the "vp9_encoder_params_get_to_decoder" test to verify the correct color space information is passed from the encoder end to decoder end. Change-Id: Ibf5fba2edcb2a8dc37557f6fae5c7816efa52650
2015-01-13Merge "Added plumbing for setting color space"Yaowu Xu
2015-01-11Merge "Fix comments and color format"Yaowu Xu
2015-01-09Added plumbing for setting color spaceYaowu Xu
Change-Id: If64052cc6e404abc8a64a889f42930d14fad21d3
2015-01-09Fix comments and color formatYaowu Xu
Replaced "color space" with "color format" in comments where color sampling format is concerned, so to differentiate from the concept defined in COLOR_SPACE. Change-Id: I8c935034c166b24307a99352dab1686531276bb8
2015-01-09Merge "Use 64 bit to accumulate frame sse."Paul Wilkins
2015-01-08Merge "vp9: fix -Wclobbered (longjmp + local variables)"James Zern
2015-01-07Always check and free denoiser buffer memory spaceJingning Han
The vp9_denoiser_free() function will internally check if the buffer pointers are NULL. This commit makes the encoder always call vp9_denoiser_free() after finishing encoding. It protects the case where noise_sensitivity_level is changed during encoding process and happen to be turned off towards the end of sequence, which could result memory space allocated to denoiser not being released. Change-Id: Ie20dc2f2e6e5fb6333fbab3356bc153978a6a0f8
2015-01-07Skip duplicate denoiser frame buffer allocationJingning Han
Allocate the frame buffer allocation for denoiser once during the encoder initialization. This avoids allocating frame buffer multiple times and overwriting the buffer pointer without proper releasing. Change-Id: I9b3baa6283449d86fd164534d344c036bb035700
2015-01-07Use 64 bit to accumulate frame sse.Paul Wilkins
When testing frame sse to choose a loop filter value and when checking ambient error in kf Q selection, use 64 bit values for accumulating the sse, to avoid risk of overflow for large image formats. Change-Id: I03765d16c843d0ade61a45b0cd46312472697e57
2015-01-03Fix denoised video output functionJingning Han
This commit fixes the buffer alignment control in denoised video output function. The encoder is now able to properly store the denoised input video into provided file when enabled. Change-Id: I258e272c8d4a9b52592e16d6d09976c6f5c21728
2014-12-23WIP: Remove giant value cost tableJim Bankoski
Change-Id: Iabe8a8868a747626c24bb13f1796f4c7827af367
2014-12-23vp9: fix -Wclobbered (longjmp + local variables)James Zern
Local variables used at the setjmp() site need to be marked volatile. Relevant excerpt from the 'man longjmp': =============== The values of automatic variables are unspecified after a call to longjmp() if they meet all the following criteria: · they are local to the function that made the corresponding setjmp(3) call; · their values are changed between the calls to setjmp(3) and longjmp(); and · they are not declared as volatile. =============== Change-Id: I093e6eeeedbf5f781d202248ca701ba2c29d3064
2014-12-22Merge "make vp9_coef_encodings const"Jim Bankoski
2014-12-22Merge "remove static initializers for partition tree"Jim Bankoski
2014-12-22make vp9_coef_encodings constJim Bankoski
Change-Id: I28a3d342a4a4b23e02a0f47bb8037c4403f71d61
2014-12-19resolve visual studio warnings around initializersJim Bankoski
Change-Id: Id2ad4fb24242f7ca8fa7a152f0889fded4113613
2014-12-18Merge "make vp9 encoder static initializers thread safe"James Zern
2014-12-18make vp9 encoder static initializers thread safeJim Bankoski
Change-Id: If2d0888d13ebe52bc7c3b16f16319408a86ab6de
2014-12-18Remove mode dependent zbin boost.Paul Wilkins
Initial patch to remove get_zbin_mode_boost() and cpi->zbin_mode_boost. For now sets a dummy value of 0 for zbin extra pending a further clean up patch. Change-Id: I64a1e1eca2d39baa8ffb0871b515a0be05c9a6af
2014-12-17remove static initializers for partition treeJim Bankoski
Could have problem with 2 encoders. Change-Id: I92d326933c00fee688f77b54acf467ca5a8516bc see: https://code.google.com/p/webm/issues/detail?id=900&thanks=900&ts=1418843841
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-12-09Substantial restructuring of AQ mode 2.Paul Wilkins
The restructure moves the decision into the rd pick modes loop and makes a decision based at the 16x16 block level instead of only the 64x64 level. This gives finer granularity and better visual results on the clips I have tested. Metrics results are worse than the old AQ2 especially for PSNR and this mode now falls between AQ0 and AQ1 in terms of visual impact and metrics results. Further tuning of this to follow. It should be noted that if there are multiple iterations of the recode loop the segment for a MB could change in each loop if the previous loop causes a change in the complexity / variance bin of the block. Also where a block gets a delta Q this will alter the rd multiplier for this block in subsequent recode iterations and frames where the segmentation is applied. Change-Id: I20256c125daa14734c16f7cc9aefab656ab808f7
2014-12-05Merge "vp9: fix frame-parallel encoding"James Zern
2014-12-05vp9: fix frame-parallel encodingJames Zern
the flag in the header wasn't being set based on the encoder configuration in non-intra only mode broken since: fbc2fbf Adding oxcf temp variable. Change-Id: Ib4cff9901889824bc4e68d7f0f6deb1e41df2f53
2014-12-05Some internal-stats, vp9-highbitdepth bug fixesDeb Mukherjee
Change-Id: I0363d98f6f6558a43276aec48f27dca37c93f5ad
2014-12-05Merge "vp9_ethread: the tile-based multi-threaded encoder"Yunqing Wang
2014-12-04vp9_ethread: the tile-based multi-threaded encoderYunqing Wang
Currently, VP9 supports column-tile encoding, which allows a frame to be encoded in multiple column tiles independently. The number of column tiles are set by encoder option "--tile-columns". This provides a way to encode a frame in parallel. Based on previous set of patches, this patch implemented the tile- based multi-threaded encoder. Each thread processes one or more tiles. Usage: For HD clips: --tile-columns=2 --threads=1/2/3/4 While using 4 threads, tests showed that the encoder achieved 2.3X - 2.5X speedup at good-quality speed 3, and 2X speedup at realtime speed 5. Change-Id: Ied987f8f2618b1283a8643ad255e88341733c9d4
2014-12-04Merge "Free motion vector array before re-allocating"Adrian Grange
2014-12-03Merge "Use memset for initialization to 0"Adrian Grange
2014-12-03Free motion vector array before re-allocatingAdrian Grange
Change-Id: I0c39136d67e1e83020d61f86b062a04182ec9b00
2014-12-03Use memset for initialization to 0Adrian Grange
Change-Id: I714ca22b5d51016bf8b035cf457616c707257641
2014-12-02Fix a warning related to VPX_EFLAG_FORCE_KF checkDeb Mukherjee
Fixes a warning in chrome build. Change-Id: I8fa0fd3e7ba1aecf89e5f79ce94cd64ed6a9567c