summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_rd.c
AgeCommit message (Collapse)Author
2015-06-16Eliminated frame_type check in get_partition_probs()Scott LaVarnway
Moved the frame_type check to the tile level and stored the prob ptr in MACROBLOCKD. Change-Id: I10b5a4abd58213dc7610e3ade1a1583c01526842
2015-05-15vp9: correct some function signaturesJames Zern
silences missing prototype warnings Change-Id: Idaf68d83d2cb03847f3ee002c4d00c2ac79da604
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_memcpyJames Zern
vestigial. replace instances with memcpy() which they already were being defined to. Change-Id: Icfd1b0bc5d95b70efab91b9ae777ace1e81d2d7c
2015-04-21Revert "Remove mi_grid_* structures."Scott LaVarnway
(see I3a05cf1610679fed26e0b2eadd315a9ae91afdd6) For the test clip used, the decoder performance improved by ~2%. This is also an intermediate step towards adding back the mode_info streams. Change-Id: Idddc4a3f46e4180fbebddc156c4bbf177d5c2e0d
2015-03-20vp9_pred_mv(): misc fixes and optimizationsYaowu Xu
1. skip near if it is same as nearest 2. correct rounding for converting mv to fullpel position 3. update pred_mv_sad after new mv search. Overall .1%~.25% compression gains on rtc set for speed 5, 6, 7, 8. Change-Id: Ic300ca53f7da18073771f1bb993c58cde9deee89
2015-03-18vp9_mv_pred: quiet a static analysis warningJames Zern
add an assert to validate pred_mv array size Change-Id: I532b882b71e2baff3ac76e07ed133ec5a11bd0fc
2015-03-06vp9_ethread: fix me consts initialization to support aq_mode=3 encodingYunqing Wang
While turning on "--aq_mode=3", the quantizers are updated by each thread. Fixed the me consts initialization function to make sure that the correct thread data are updated. Change-Id: Ied27bb7bae76fc3fa2cda4f8c35ac0b46271bef4
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-11Update partition rate cost in rtc speed 5Jingning Han
The block partition rate cost should be updated when recursive partition search is needed. Change-Id: I7bc5ad1fc2cbd3577dee7f7e8da111a2742bdeb9
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-22Remove elevate_newmv_thresh from SPEED_FEATURES (unused)Adrian Grange
Change-Id: I78ef7f89586a329787f6bc4c58ec83af210989a3
2014-12-24Enable sub8x8 inter block search for RTC coding modeJingning Han
This commit enables sub8x8 inter block coding for RTC mode. The use of sub8x8 blocks can be turned on by allowing choose_partitioning function to select 4x4/4x8/8x4 block sizes. Change-Id: Ifbf1fb3888fe4c094fc85158ac3aa89867d8494a
2014-12-15Simplify rate-distortion modeling functionJingning Han
Use left shift to replace one multiplication. The computation outcome remains identical. Change-Id: I1e1737af0a245de0d2a2bde10f0c171477199fc1
2014-11-24vp9_ethread: modify VP9_COMP structureYunqing Wang
This patch modified struct VP9_COMP. Created a struct ThreadData to include data that need to be copied for each thread. In multiple thread case, one thread processes one tile. all threads share one copy of VP9_COMP, (refer to VP9_COMP *cpi in the code) but each thread has its own copy of ThreadData, (refer to ThreadData *td in the code). Therefore, within the scope of encode_tiles(), both cpi and td need to be passed as function parameters. In single thread case, the FRAME_COUNTS pointer in ThreadData points to "counts" in VP9_COMMON. Change-Id: Ib37908b2d8e2c0f4f9c18f38017df5ce60e8b13e
2014-11-20vp9_ethread: move max/min partition size to mb structYunqing Wang
The max_partition_size and max_partition_size are set at the beginning while setting speed features, and then adjusted at SB level. Moving them to mb struct ensures there is a local copy for each thread. Change-Id: I7dd08dc918d9f772fcd718bbd6533e0787720ad4
2014-11-13Prepare for dynamic frame resizing in the recode loopAdrian Grange
Prepare for the introduction of frame-size change logic into the recode loop. Separated the speed dependent features into separate static and dynamic parts, the latter being those features that are dependent on the frame size. Change-Id: Ia693e28c5cf069a1a7bf12e49ecf83e440e1d313
2014-10-31Merge "Refactor vp9_update_rd_thresh_fact"Jingning Han
2014-10-30Refactor vp9_update_rd_thresh_factJingning Han
Reduce the scope of function parameters. Change-Id: Ifef2cfb559908a97498ffdbd6ea53da1cd45a73c
2014-10-29Merge "Enable mode search threshold update in non-RD coding mode"Jingning Han
2014-10-29Enable mode search threshold update in non-RD coding modeJingning Han
Adaptively adjust the mode thresholds after each mode search round to skip checking less likely selected modes. Local tests indicate 5% - 10% speed-up in speed -5 and -6. Average coding performance loss is -1.055%. speed -5 vidyo1 720p 1000 kbps 16533 b/f, 40.851 dB, 12607 ms -> 16556 b/f, 40.796 dB, 11831 ms nik 720p 1000 kbps 33229 b/f, 39.127 dB, 11468 ms -> 33235 b/f, 39.131 dB, 10919 ms speed -6 vidyo1 720p 1000 kbps 16549 b/f, 40.268 dB, 10138 ms -> 16538 b/f, 40.212 dB, 8456 ms nik 720p 1000 kbps 33271 b/f, 38.433 dB, 7886 ms -> 33279 b/f, 38.416 dB, 7843 ms Change-Id: I2c2963f1ce4ed9c1cf233b5b2c880b682e1c1e8b
2014-10-29Simplify vp9_set_rd_speed_thresholds_sub8x8Adrian Grange
Change-Id: I4bf0f9a38697f5aea564a47afd7f02bb8b2888b6
2014-10-22Merge "vp9_ethread: allocate frame contexts outside VP9_COMMON struct"Yunqing Wang
2014-10-22vp9_ethread: allocate frame contexts outside VP9_COMMON structYunqing Wang
This patch allocated frame contexts outside VP9_COMMON. This allows multiple threads to share the same copy of frame contexts, and reduces the overhead. It also guarantees the correct update of these contexts during bitstream packing. This patch doesn't change encoding result. Change-Id: Ic181a2460b891d1d587278a6d02d8057b9dbd353
2014-10-15Add init and reset functions for RD_COST structJingning Han
Change-Id: I2902de7051a883fd22e27a655209233733969cfd
2014-10-03rdmult data type changeDeb Mukherjee
To fix a VS warning. Change-Id: I4c530c0afe8d06acdb8cc78b7995aba57a25373d
2014-10-02rdmult data type change to fix high bit-depthDeb Mukherjee
Fixes an intermittent assert failure for highbitdepth. Change-Id: If8cad0209a94f1184b69c7b3f1d587934f857d9b
2014-09-25Adds various high bit-depth encode functionsDeb Mukherjee
Change-Id: I6f67b171022bbc8199c6d674190b57f6bab1b62f
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-16Adds high bitdepth quantization functionsDeb Mukherjee
Adds various high bitdepth quantization functions. Change-Id: I36fc0bf75a1bd15128ed271df8723de0ac134b0c
2014-09-16Use non-zero mode threshold for NEARESTMV modesJingning Han
This commit makes the encoder to use non-zero mode threshold for NEARESTMV modes. The runtime for test clips of speed 3 is reduced by about 1%. pedestrian 1080p 2000 kbps, 143239 ms -> 141989 ms bus CIF 1000 kbps, 7835 ms -> 7749 ms The compression performance change is about -0.02% for both derf and stdhd. Change-Id: Ib71808922c41ae2997100cb7c561f68dcebfa08e
2014-09-12Remove redundant reference frame threshold settingsJingning Han
When a reference frame type is not in the frame buffer, the mode search threshold will be set to INT_MAX, so as to effectively turn off the mode entries in the rate-distortion optimization loop that involves this reference frame type. This operation is now integrated in the ref_frame_skip_mask scheme. This commit hence removes the redundant mode search threshold setting. Change-Id: Ib18f45da611afda2af275201efd367df7f5101ab
2014-09-04Enable adaptive motion search for ARF codingJingning Han
This commit turns on adaptive motion search for ARF coding, in addition to other normal inter frame coding. It improves the average compression efficiency: stdhd 0.1% derf 0.04% For the test sequences, the speed 3 runtime is reduced: pedestrian 1080p 2000 kbps, 149932 ms -> 144580 ms, (3.3% speed-up) bus CIF 1000 kbps, 8050 ms -> 7895 ms, (1.9%) highway CIF 100 bkps, 45033 ms -> 44078 ms, (2.2%) Change-Id: I5228565b609f99e8ae04f6140a2bf2b64a831d21
2014-08-26Replacing int_mv with MV.Dmitry Kovalev
Change-Id: I483a2fefc5f9ea4533dfd64448f3b6b426dd9eed
2014-08-21Removing is_best_mode() function.Dmitry Kovalev
Change-Id: Iccd7cec885e8aeb0e54613d888f9960c393cee0b
2014-08-08Moving pass from VP9_COMP to VP9EncoderConfig.Dmitry Kovalev
We had a very complicated way to initialize cpi->pass from cfg->g_pass: switch (cfg->g_pass) { case VPX_RC_ONE_PASS: oxcf->mode = ONE_PASS_GOOD; break; case VPX_RC_FIRST_PASS: oxcf->mode = TWO_PASS_FIRST; break; case VPX_RC_LAST_PASS: oxcf->mode = TWO_PASS_SECOND_BEST; break; } cpi->pass = get_pass(oxcf->mode). Now pass is moved to VP9EncoderConfig and initialization is simple: switch (cfg->g_pass) { case VPX_RC_ONE_PASS: oxcf->pass = 0; break; case VPX_RC_FIRST_PASS: oxcf->pass = 1; break; case VPX_RC_LAST_PASS: oxcf->pass = 2; break; } Change-Id: I8f582203a4575f5e39b071598484a8ad2b72e0d9
2014-08-06vp9_rd.c: cleanup ugly expressionJim Bankoski
Change-Id: I066763c2e3ae69ab772bb986da97af9b504f0329
2014-08-04break at the end of clauses with assert(0) to avoid gcc warningJim Bankoski
Change-Id: I1b3c5337f018dde27dc819ab18bd081d169a91e8
2014-08-04avoid signed mismatch warning in gccJim Bankoski
Change-Id: I9d995178fd764be252e571fa23901da0f991bbb8
2014-07-21Remove unfinished VP9 alpha channel.Alex Converse
Change-Id: Ic5d3a3a0dac10b49495771886a31e793bb78b5ca
2014-07-16Changes to rd balance and multi-arf bug fix.Paul Wilkins
2 pass only change to calculation of rd mult based on Q. Make a small adjustment based on frame type and also replace adjustment based on iifactor with an one based on the ambient GF/ARF boost level. Also fix multi arf bug / issue. Overall these change give an slight improvement in ssim but hurt psnr a little. Change-Id: I5e1751e3ff5390a26f543d7855059e6fbcce105e
2014-07-02Cleanup vp9_rd.Alex Converse
Change-Id: I39a37335ba5b3a969d328afb1f425ddb2cf7ddda
2014-07-02Split vp9_rdopt into vp9_rdopt and vp9_rd.Alex Converse
vp9_rdopt is for making rd optimal mode decisions. vp9_rd is for all other rd related routines. Anything used outside of making an rd optimal decision belongs in rd. Change-Id: I772a3073f7588bdf139f551fb9810b6864d8e64b