summaryrefslogtreecommitdiff
path: root/vp9/vp9_cx_iface.c
AgeCommit message (Collapse)Author
2018-05-14VP9: Add speed 9 for subpel search.Jerome Jiang
Set subpel search stop to 2 when motion vector is non zero. 10% speedup on 1 and 2 threads on Samsung Galaxy S8+. Change-Id: I7323bb913000229cf60a37495bf88bcc51d0ac96
2018-04-24vp9-svc: Add GET control to get SVC pattern info.Marco Paniconi
Copy ref frame index in SVC struct after set in encoder. Rename ext_{lst,gld,alt}_fb_idx to {lst,gld,alt}_fb_idx. Bump up ABI version. BUG=webm:1527 Change-Id: I06209040cb83d374030f40b79f0b36b0efe9f97d
2018-04-13Clean up is_two_pass_svc.Jerome Jiang
Change-Id: I9e92616471be380d3ba4e2b85399d7eb9f687d2f
2018-03-26vp9-svc: Allow for setting frame drop thresholds per layer.Marco Paniconi
Add encoder control to set the frame drop thresholds per spatial layer, and add a frame drop mode: 0 = per-layer drop, and 1 = constrained drop mode (a drop on a given layer forces drops to all upper layers). Default is mode 0 (per-layer dropping). Implementation for mode 1 will come in subsequent change. If the control is not used, then the spatial layer frame drop thresholds (water mark) are all equal and set to the value given by the encoder config (oxcf->drop_frames_water_mark). Bump up the ABI version. Change-Id: Id038d4181b86fa98b3d44d026f96d5f344d81629
2018-03-20VP9 SVC: Add control to disable inter layer prediction.Jerome Jiang
Add VP9E_SET_SVC_INTER_LAYER_PRED to disable inter layer (spatial) prediction. 0: prediction on 1: prediction off for all frames 2: prediction off for non key frames Bump up ABI version. Change-Id: I5ab2a96b47e6bef202290fe726bed5f99bd4951f
2018-03-20vp9-svc: Improve frame dropper for spatial layers.Marco Paniconi
SVC frame dropper: modify the logic to allow for individual spatial layers to drop. This removes the constraint that all upper spatial layers must drop when a given spatial layer drops. Add a flag to the pkt to indicate whether a spatial layer is encoded or dropped. This is needed for applications that enable this feature (frame dropping for SVC). For a current spatial layer, if its previous spatial layer is dropped, then disable certain features for that layer: inter-layer prediction, base_mv, partition_reuse, copy partition. Also add the constraint to never drop a spatial layer if its base layer is a key frame. Updates to sample encoder (vp9_spatial_svc_encoder) and the SVC datarate unittests to properly handle frame dropping. Bump up ABI version. Change-Id: I7d14ccf67b8d014a7abfce5ba3989fc623e94067
2018-03-15vp9-svc: Frame dropper for SVC.Marco Paniconi
If a given spatial layer decides to drop, due to the buffer/overshoot conditions for that layer, then drop that current spatial layer and all spatial layers above. In the current implementation the svc frame counter (and hence the pattern for the non-flexible SVC case) are updated on frame drops. Also add last spatial layer encoded to the pkt. This is useful for RTC applications that enable frame dropping for SVC. Update to the SVC datarate tests: enabled frame dropper on all SVC datarate tests, and made a fix to properly set the temporal_layer_id, which works now even on frame drops. Change-Id: If828c193f3cb6b1839803fd52fe9fbbda5b5a039
2018-03-15Merge "remove spatial svc experiment"Johann Koenig
2018-03-14vp9-svc: Bugfix to dyanmic enabling/disabling of layers.Marco Paniconi
Fix a bug when middle and top spatial layer are skip encoded (disabled) and then re-enabled again, during the sequence. Issue is that pending_frame_count in the packing may be incremented on middle layer, even though that layer is skipped (not encoded and hence zero size). Fix is to add size check. Modified existing unitest to reproduce the issue. Change-Id: I86d806a112d468e06b04fbf7c46ae07db9e0ad93
2018-03-14remove spatial svc experimentJohann
Change-Id: Ifda11caaf992d10f2d93d6cd1d07b79b6047be05
2018-02-12vp9_cx_iface: Remove else when returning from the other branch.Jerome Jiang
Change-Id: I2fc15ec25cc5587cafc6621176d0a6d7c376fc7c
2018-02-09Reland "Add ROI support for VP9."Jerome Jiang
Extended ROI struct suitable for VP9. ROI input from user is passed into internal struct and applied on every frame (except key frame). Enabled usage of all 4 VP9 segment features (delta_qp, delta_lf, skip, ref_frame) via the ROI map input. Made changes to nonrd_pickmode for the ref_frame feature. Only works for realtime speed >= 5. AQ_MODE needs to be turned off for ROI to take effect. Change example in the sample encoder: vpx_temporal_svc_encoder.c to be suitable for VP9. Add datarate test. Bump up ABI version. BUG=webm:1470 Change-Id: I663b8c89862328646f4cc6119752b66efc5dc9ac
2018-01-24Merge "Fix frame sizes in pkt to support spatial layers."Jerome Jiang
2018-01-22Fix frame sizes in pkt to support spatial layers.Jerome Jiang
Add test for svc frame sizes in pkt. BUG=webm:1485 Change-Id: I983dc229e526d72d22360d7f3016d8358d6beae7
2018-01-18clang-format v5.0.0 vp9/Johann
Remove trailing commas to keep multiple elements on one line. Add blank lines to prevent comments from being treated as blocks. clang-format guards for struct with a comment in the middle. Change-Id: I3bcb8313ae8aaf69179249a13b4087b1272cdbc0
2018-01-11vp9: Skip encoding of enhancement layers on the fly.Marco
For SVC: if an enhancement layer (spatial_layer > 0) has 0 bandwidth, skip/drop the encoding of the layer. This allows the application to dynamically disable higher layers for SVC. Add flag to signal the skip encoding, this is needed to modify the packing of the superframe when the top layer is skipped/dropped. Also moved some updates (current_video_frame counter and the last_avg_frame_bandwidth) to the postencode_update_drop_frame(). Added datarate unittest for dynamically going from 3 to 2 and then back to 3 spatial layers. Change-Id: Idaccdb4aca25ba1d822ed1b4219f94e2e8640d43
2017-12-06Add frame width & height to frame pkt. Add test.Jerome Jiang
Used to return correct frame width and height when dynamic resizing happens. BUG=webm:1474 Change-Id: Ia2043f7e1635b3821848a67b9b134f47f14b0f3a
2017-11-30decouple spatial-svc from encoder abiJames Zern
this is only meant for testing. along with --enable-experimental --enable-spatial-svc require VPX_TEST_SPATIAL_SVC to be defined rather than bumping the encoder ABI. Change-Id: I7f34d9f60300fa31ccf22e1a4aa619392c391b2e
2017-11-13vp9 svc: Change conditions on VPX_ENCODER_ABI_VERSION.Jerome Jiang
VPX_ENCODER_ABI_VERSION was bumped up in 93e83f. Change-Id: Id5707f9f9db56fa96549bc8f54e1cfa04e7fa4cd
2017-11-08CVBR command line option.paulwilkins
Added command line control of Corpus VBR. The new corpus vbr mode is a variant of standard VBR (end-usage=0) where the complexity distribution mid point is passed in rather than calculated for a specific clip or chunk. The new variant is enabled by setting a new command line parameter --corpus-complexity to a zero value. Omitting this parameter or setting it to 0 will cause the codec to use standard vbr mode. The correct value for a given corpus needs to be derived experimentally using a training set such that the average rate for the corpus is close to the target value. For example our using our low res test set with upper and lower vbr limits of 50%-150% and a corpus complexity value of 650 gives a similar average data rate across the set to using standard vbr. However, with the corpus mode easier clips will be allocated fewer bits and harder clips more bits rather than having the same rate target for all. Change-Id: I03f0fc8c6fb0ee32dc03720fea6a3f1949118589
2017-09-14VP9 level targeting: add a new AUTO modeHui Su
In the new AUTO mode, restrict the minimum alt-ref interval and max column tiles adaptively based on picture size, while not applying any rate control constraints. This mode aims to produce encodings that fit into levels corresponding to the source picture size, with minimum compression quality lost. However, the bitstream is not guaranteed to be level compatible, e.g., the average bitrate may exceed level limit. BUG=b/64451920 Change-Id: I02080b169cbbef4ab2e08c0df4697ce894aad83c
2017-08-16Prevent parameters that can cause invalid ARF groups.paulwilkins
Having a very low "lag_in_frames" value could cause the encoder to create incorrect / corrupt ARF groups including displayed frames that update the ARF buffer and false overlay frames that are coded at low rate but are not actually overlays of a real ARF frame. This is linked to a reported unit test "slow down" where the chosen parameters (lag of 3 frames) gave rise to such "broken" ARF group(s). See also BUG=webm:1454 Change-Id: If52d0236243ed5552537d1ea9ed3fed8c867232c
2017-07-11remove vp9_firstpass.c w/CONFIG_REALTIME_ONLYJames Zern
BUG=webm:1446 Change-Id: I6e0ea9342c715d354c641109737172afa649b85b
2017-07-05vp9: remove (un)lock_buffer_poolJames Zern
there is no threaded access to this pool after the removal of frame_parallel_decode BUG=webm:1395 Change-Id: I710769b87102edc898c59eb9a2e7a91d8c49107f
2017-06-20VP9 level targeting: properly handle max_gf_intervalhui su
Don't overide max_gf_interval if it's not specified. It will be assigned with a default value in vp9_rc_set_gf_interval_range(). BUG=b/62803416 Change-Id: Ide46ce00279ed076865fc54ce98c55a994f0c798
2017-06-07vp9 level targeting: more strict constraint on min_gf_intervalhui su
min_gf_interval should be no less than min_altref_distance + 1, as the encoder may produce bitstream with alt-ref distance being min_gf_interval - 1. BUG=b/38450599 Change-Id: Ifb733daa643ebc668d1b23e1ce92db94b66dabe8
2017-04-24Make the row based multi-threaded encoder deterministicYunqing Wang
This patch followed allow_exhaustive_searches feature modification and continued to modify the encoder to achieve the determinism in the row based multi-threaded encoding. While row-mt = 1 and using multiple threads, the adaptive feature in encoder was disabled, which gave BDRate gain(at speed 1, -0.6% ~ -0.7%; at speed 2, -0.46% ~ -0.59%), but some encoder speed losses(7% ~ 10% at speed 1 and 3% ~ 6% at speed 2). These speed losses were acceptable considering the speed gains obtained from row-mt. Change-Id: I60d87a25346ebc487a864b57d559f560b7e398bb
2017-04-06VP9 motion vector unit testYunqing Wang
To prevent the motion vector out of range bug, added a motion vector unit test in VP9. In the 4k video encoding, always forced to use extreme motion vectors and also encouraged to use INTER modes. In the decoding, checked if the motion vector was valid, and also checked the encoder/decoder mismatch. The tests showed that this unit test could reveal the issue we saw before. Change-Id: I0a880bd847dad8a13f7fd2012faf6868b02fa3b4
2017-02-28Set row_mt to 0 by defaultYunqing Wang
Set row_mt to 0 for now. Change-Id: I922536a6d71a765e435daeaf4d932ef14363d19a
2017-02-27vp9: Rename new_mt to row_mtVignesh Venkatasubramanian
new_mt is a very generic name that will get obsolete soon enough. Since this is exposed as a codec control, renaming it to row_mt to signify row level paralellism. Also renaming the ETHREAD_BIT_MATCH codec control to ROW_MT_BIT_EXACT. Change-Id: Ic7872d78bb3b12fb4cf92ba028ec8e08eb3a9558
2017-02-15Row based multi-threading of encoding stageRanjit Kumar Tulabandu
(Yunqing Wang) This patch implements the row-based multi-threading within tiles in the encoding pass, and substantially speeds up the multi-threaded encoder in VP9. Speed tests at speed 1 on STDHD(using 4 tiles) set show that the average speedups of the encoding pass(second pass in the 2-pass encoding) is 7% while using 2 threads, 16% while using 4 threads, 85% while using 8 threads, and 116% while using 16 threads. Change-Id: I12e41dbc171951958af9e6d098efd6e2c82827de
2017-02-13The bitstream bit match test in multi-threaded encoderYunqing Wang
While the new-mt mode is enabled(namely, allowing to use row-based multi-threading in encoder), several speed features that adaptively adjust encoding parameters during encoding would cause mismatch between single-thread encoded bitstream and multi-thread encoded bitstream. This patch provides a set_control API to disable these features, so that the bit match bitstream is obtained in the unit test. Change-Id: Ie9868bafdfe196296d1dd29e0dca517f6a9a4d60
2017-01-24Multi-threading of first pass stats collectionRanjit Kumar Tulabandu
(yunqingwang) 1. Rebased the patch. Incorporated recent first pass changes. 2. Turned on the first pass unit test. Change-Id: Ia2f7ba8152d0b6dd6bf8efb9dfaf505ba7d8edee
2017-01-13vp9_cx_iface,encoder_encode: check validate_img returnJames Zern
before calling vp9_apply_encoding_flags() which may crash if the resolution was invalid. this is the same change as: c0523090b vp8e_encode: check validate_config return BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1315288 Change-Id: Icd2aab322422e83d3a778fca6d7789e5000239d7
2017-01-06Add support for VP9 level targetinghui su
Constraints on encoder config: -target_bandwidth is no larger than 80% of level bitrate limit -target_bandwidth * (1 + max_over_shoot_pct) is no larger than 88% of level bitrate limit -min_gf_interval is no smaller than level limit -tile_columns is no larger than level limit Constraints on rate control: -current frame size plus previous three frames' size is no larger than the CPB level limit -current frame size is no larger than 50%/40%/20% of the CPB level limit if it's a key/alt-ref/other frame. Change-Id: I84d1a2d6d6e3c82bfd533b3309ce999cfaba2c8b
2016-11-21Add validation of frame_parallel_decoding_modeYaowu Xu
This is a boolean value that is written into bitstream, any value other than 0 or 1 could have led to unexpected behavior. This commit fix the issue by adding validation of the value to make sure it is boolean. BUG=webm:1339 Change-Id: I2d3e69e8dbefcab9a0db9cb39a91a40ce531c5a1
2016-09-15apply clang-formatclang-format
Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487
2016-08-24Add --alt-ref-aq=<int> optionYury Gitman
In the future this option will activate adaptive quantization special for altref frames. Encoder will create the adaptive quantization map on the basis of lookahead buffers similarity which is the estimate of the future motion compensation performance. Change-Id: Ia0088b3babb0f9a4899c79d8d819947ba5a03df2
2016-08-03vp9/decoder,vp9/*.[hc]: apply clang-formatclang-format
Change-Id: Ic38ea06c7b2fb3e8e94a4c0910e82672a1acaea7
2016-07-25vp9 svc: Enable different speed setting for each spatial layer.jackychen
This change only affects 1 pass cbr svc mode. Change-Id: If0da87bb200f7e7762755340c40c8157cc7a16ca
2016-07-12Fix encoder crashes for odd size inputYaowu Xu
Change-Id: Id5c30c419282369cc8c3280d9a70b34a859a71d8
2016-07-01Make set_reference control API work in VP9Yunqing Wang
Moved the API patch from NextGenv2. An example was included. To try it, for example, run the following command: $ examples/vpx_cx_set_ref vp9 352 288 in.yuv out.ivf 4 30 Change-Id: I4cf8f23b86d7ebd85ffd2630dcfbd799c0b88101
2016-06-17Output frames in first pass for VPX_DL_REALTIME.Tom Finegan
Since combining VPX_DL_REALTIME with VPX_RC_FIRST_PASS is basically nonsense, ignore the user's pass setting when this happens and behave as if the requested encode is a single pass encode. BUG=webm:1233 Change-Id: I5ee4c4e5838c4ca6d24988890aae490b10826db2
2016-06-16Fix ubsan warning: vp9_cx_iface.cYaowu Xu
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1219 Change-Id: I77584af8b9e25db484d9ced6013da3163a9592c0
2016-06-15Add vp9 encoder API VP9E_GET_LEVEL to provide bitstream levelhui su
Change-Id: I1ef3df0192491035728fe9d5eb25cc66dc2965de
2016-05-11Fix typos in control function for VP9E_SET_TARGET_LEVELhui su
Change-Id: Ic797c6be579c3434681a5e9dbb3900ae49c43958
2016-05-10Add VP9 encoder API for level specification.hui su
Add control API VP9E_SET_TARGET_LEVEL that allows the encoder to control the output bitstream level and/or keep level related statistics. Usage: 255 do not care about level (default) 0 keep level related stats only 10 target for level 1 11 target for level 1.1 . . . 62 target for level 6.2 Usage for vpxenc: --target-level=0/255/10/11... Change-Id: I31d1aeca19358b893e7577b4e63748c8e614034a
2016-03-24Merge "Add a TODO for using tile rows while encoding with multiple threads"James Zern
2016-03-23Merge "Allows sub-second frame rates in vp9"Johann Koenig
2016-03-23Add a TODO for using tile rows while encoding with multiple threadsYunqing Wang
Added a TODO in vp9_cx_iface.c. Change-Id: Ib987f20cab8417340a23ae676616de1df48e8a12