summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ratectrl.c
AgeCommit message (Collapse)Author
2017-02-15vp9. Use same source_sad threshold for all speeds.Marco
Only affects real-time mode. Change-Id: Iba836f110c4da936f5173cc0f54424d5b6121bff
2017-02-15Merge "Aggressive VBR method."Paul Wilkins
2017-02-13cosmetics,vp9_ratectrl: apply clang-formatJames Zern
broken since: c3f095c8b Merge "Fix to avoid abrupt relaxation of max qindex in recode path" 5f21aba4b Fix to avoid abrupt relaxation of max qindex in recode path the original change pre-dated the addition of .clang-format Change-Id: If5e399d9a805bcad9147360b13b36fbc8c560a7c
2017-02-13Aggressive VBR method.paulwilkins
VBR method that allows a wider Q range for the first normal frame in each ARF group and then centers the min - max range for the rest of the arf group on the chosen Q value for that first frame. This allows for quite rapid adjustment of the active Q range even if the initial estimate is poor. In some cases where the ARF frames themselves are tending to undershoot but the normal frames are overshooting this can still give net undershoot. This can be corrected by allowing a larger Q delta for arf frames but is usually is a sign that the allocation to the arfs was to high. Change-Id: Icec87758925d8f7aeb2dca29aac0ff9496237469
2017-02-09Merge "Fix to avoid abrupt relaxation of max qindex in recode path"Paul Wilkins
2017-02-07vp9: Adjust rate_err threshold for setting active_worst factor.Marco
Only affects 1 pass vbr. Small improvement on ytlive set. Change-Id: I09a7456fe658fbea82ece1035cf683bd8bd8bd14
2017-01-26vp9: Fixes for usage of skin_map for high bit depth.Marco
Also avoid noise_estimation and source_sad if use_highbitdepth is set. Change-Id: I5fea396b8f8380ea377045d99ba22a52b92daa46
2017-01-23vp9: Adjust the threshold to set avg_source_sad_sb flag.Jerome Jiang
Affect only speed 8. Small/Negligible regression on rtc set. Change-Id: I67a6b6b4008a22ed798bd980336d95bb799f64b4
2017-01-20vp9: Add feature to use block source_sad for realtime mode.Marco
Only for speed >= 7, and affects skipping of intra modes. Threshold is set low for now, needs to be tuned. Small/no difference in metrics on rtc clips. Change-Id: If9bdbd43f08d1f80407cdd2e9e5e96780dcd2424
2017-01-16Fix to avoid abrupt relaxation of max qindex in recode pathRanjit Kumar Tulabandu
The fix relaxes the max qindex based on the data from previous loop of coding if output frame size is greater than maximum frame size allowed Change-Id: Iac1f63ec67559d68766e090a7cbb80b812b2560f
2017-01-13vp9: Add speed feature flag for computing average source sad.Marco
If enabled will compute source_sad for every superblock on every frame, prior to encoding. Off by default, only on for speed=8 when copy_partition is set. Change-Id: Iab7903180a23dad369135e8234b7f896f20e1231
2017-01-10vp9: 1 pass cbr: Adjustments to usage of gf_cbr_boost and aq=3 mode.Marco
When aq=3 mode is on and the gf_cbr_boost is set: make sure golden frame is always refreshed, and don't incorporate segement cost in qp setting on the boosted golden frame. Better performance on RTC set with gf_cbr_boost on, for example with gf_cbr_boost=50, gains from ~0.5-3%. Change-Id: Ie811f5e4d444ff3320bd6e2c1745b2c4c09a8460
2017-01-09vp9: 1 pass cbr: Fix to qp clamping when gf_cbr_boost_pct is used.Marco
Avoid the qp-clamping on gf/alt frame if gf_cbr_boost_pct is set. Change only affect CBR mode when gf_cbr_boost_pct is set. Change-Id: I0655ed4f2b047c8ed1ed33a070c17960ad776704
2017-01-09Merge "vp9: 1 pass cbr mode: increase threshold for gf_cbr_boost_pct usage."Marco Paniconi
2017-01-06vp9: 1 pass cbr mode: increase threshold for gf_cbr_boost_pct usage.Marco
Increase the boost threshold below which GOLDEN update will use same rate correction factor as INTER_NORMAL. Improves performance when gf_cbr_boost_pct is set (between 0 and 100) in CBR mode. Change-Id: I9f54cc18664786a100b13a416b7137ae03bd0cab
2017-01-06vp9: Compute source sad for every superblock when partition copy is on.Jerome Jiang
The source sad could be used to copy the partition without going into choose_partitioning function to speed up vp9 encoding. Computing source sad takes little time. Speed test on Android and Linux shows little encoding time gain (less than 1.4%). Turned off for now since partition copy is turned off. Change-Id: I61c9d5b8f22329760cb29a4ee30a7f9c232ce8d3
2016-12-14vp9: Fix to usage of flag USE_ALTREF_FOR_ONE_PASSMarco
The flag USE_ALTREF_FOR_ONE_PASS allows for alt-ref lookahead in 1 pass vbr (from https://chromium-review.googlesource.com/#/c/365498). This change is to make sure this macro flag only has effect if the config flag cpi->oxcf.enable_auto_altef is also on. No change in ytlive encoding, as USE_ALTREF_FOR_ONE_PASS is not yet enabled. Change-Id: I1a69681e4a15c5244581a3dab4587fca08f02e0f
2016-10-111 pass vbr: Allow for lookahead alt-ref in real-time mode.Marco
For 1 pass vbr real-time mode: Allow for the usage of alt-ref frame when non-zero lag-in-frames is used. Use non-filtered alt-ref, and select usage based on fast scene/content analysis/detection within the lag of frames. Positive gains on ytlive set: overall avgPSNR ~3-4%. Several clips are up between 5-14%, a few clips are neutral/small change. Current speed decrease is about ~5-10%. Use the flag USE_ALTREF_FOR_ONE_PASS to enable this feature (off by default for now). Change-Id: I802d2bf3d44f9cf01f6d15c76be9c90192314769
2016-10-11vp9: 1 pass vbr: some adjustments to gf interval.Marco
Put limit on gf interval based on lag, and allow for the adjustment on next gf group also on key frame. Small/neutral change on ytlive metrics. Change only affects 1 pass vbr real-time mode. Change-Id: I339c8f4398848698b6e10fe9482c52ca661b94a5
2016-09-16Merge changes from topic 'clang-format'James Zern
* changes: apply clang-format .clang-format: update to 3.8.1
2016-09-15vp9: Small code cleanup.Marco
Remove the experiment LIMIT_QP_ONEPASS_VBR_LAG, as its not currently used and no plan to use in near future. Change-Id: Ib069f8d7225195be04b765d0ab477510dfba6a3b
2016-09-15apply clang-formatclang-format
Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487
2016-09-01Merge "Casts to remove some warnings."Yaowu Xu
2016-09-01Casts to remove some warnings.paulwilkins
Added casts to remove warnings: BUG=webm:1274 In regards to the safety of these casts they are of two types:- - Normalized bits per (16x16) MB stored in a 32 bit int (This is safe as bits per MB even with << 9 normalization cant overflow 32 bits. Even raw 12 bits hdr source even would only be 29 bits :- (4+4+12+9) and the encoder imposes much stricter limits than this on max bit rate. - Cast as part of variance calculations. There is an internal cast up to 64 bit for the Sum X Sum calculation, but after normalization dividing by the number of points the result will always be <= the SSE value. Change-Id: I4e700236ed83d6b2b1955e92e84c3b1978b9eaa0
2016-08-31Modified resize loop constraints.paulwilkins
Using a tighter resize constraint on undershoot seems to help results (especially SSIM) as significant undershoot on a frame seems to have more of a damaging impact than overshoot. This patch has been tuned so that in local testing using the derf set it is encode speed neutral for speed setting 2. Average quality result for speed 2 (psnr,ssim) were as follows:- lowres 0.039, 0.453 midres 0.249, 0.853 hdres 0.159, 0.659 NetFlix -0.241, 0.360 Change-Id: Ie8d3a0d7d6f7ea89d9965d1821be17f8bda85062
2016-08-04vp9_ratectrl.c: apply clang-formatclang-format
after: ff0a87c vp9 1pass vbr: Adjustment to gf interval. Change-Id: I1296e53e601bf0c2b562e3a34082ac45c294a5f1
2016-08-04Merge "vp9 1pass vbr: Adjustment to gf interval."Marco Paniconi
2016-08-03vp9 1pass vbr: Adjustment to gf interval.Marco
Increase the minimum distance. Reduces the overshoot somewhat on some clips, small gain in avgPSNR (~0.1%) on ytlive set. Change-Id: Id5ddde20c2907dbdb536e79542eff775019c142b
2016-08-02vp9/encoder: apply clang-formatclang-format
Change-Id: I45d9fb4013f50766b24363a86365e8063e8954c2
2016-07-22vp9 1pass-vbr: Adjust gf setting for nonzero-lag case.Marco
Change-Id: I230c586c6d5ae56ee9a6d37b7d9452351bb4bd80
2016-07-20vp9: Fix the clang warning of unsigned int type.jackychen
Change-Id: I6308db16bd626fa5943925471e9171f567669350
2016-07-18vp9: Allow usage of lookahead for real-time, 1 pass vbr.Marco
Allow usage of lookahead for VBR in real-time mode, for 1 pass vbr. Current usage is for fast checking of future scene cuts/changes, and adjusting rate control (gf interval and active_worst/target size). Added unittests (datarate) for 1 pass vbr mode, with non-zero lag. Added an experimental option to limit QP based on lookahead. Overall positive gain in metrics on ytlive set: avgPNSR/SSIM up on average ~1-3%; several clips up by 5, 7%. Change-Id: I960d57dfc89de121c4824b9a9bf88d2814e74b56
2016-07-07vp9: Adjustment of gfu_boost and af_ratio for 1 pass vbr.Marco
Modify the gfu_boost and af_ratio setting based on the average frame motion level. Change only affects 1 pass vbr. Metrics overall positive on ytlive set. On average up by ~1%, several clips up by 2-4%. Change-Id: Ic18c49eb2df74cb4986b63cdb11be36d86ab5e8d
2016-06-10vp9: Put lower limit on frames_to_key adjustment to gf interval.Marco
For 1 pass vbr. Change-Id: I6c1c1cca3944150140e896e175b07ed518641b9b
2016-06-08vp9: Reduce overshoot factor for setting longer gf interval.Marco
Only affects 1 pass vbr mode. Change-Id: Ifd7ff3771eabe322a371b35b159cace6baa3b070
2016-06-07vp9: Replace the avg_size_inter metric, for 1 pass vbr.Marco
Code cleaup, use existing rolling_actual/target metrics instead, set threshold to get same/similar effect. Little/no change in metrics on ytlive set. Change-Id: I74f3c3d0a143a9cf20dc9c3dee54c0f7e6a97a51
2016-06-07vp9: Small ajustment to settings gf_interval, 1 pass vbr.Marco
Add a max condition and lower the min value. No change in behavior (metrics for yt live set) for the default min/max_gf_interval=4/16 settings. Small positive change when min/max_gf_interval=7/16 (for 60fps clips on ytlive set). Change-Id: I1c1d72425c86c69419ea43fb9730130e81062f91
2016-06-03Adjustment to VBR rate correction.paulwilkins
Changes to the function the redistributes bits from overshoot or undershoot throughout the rest of the clip to respond more quickly. Change-Id: I90f10900cdd82cf2ce1d8da4b6f91eb5934310da
2016-06-03Remove gf_zeromotion_pct.paulwilkins
The use of this value is preventing rate adjustment on clips or sections that have very little motion but high noise and this can give rise to some sections with massive overshoot. Change-Id: I9a65c7c1148dc5d3a7d8b23e50fc1733f3661621
2016-05-13vp9: Update to rc-metric for keeping track of average frame size.Marco
Rename and change to how its updated. Only affects 1 pass vbr. Small change in metrics (< ~0.1%) on ytlive set. Change-Id: Ibb1fe485699b6c4a8194951c8f229abe2f64b9a5
2016-05-11vp9: Fix to quality regression issue for 1 pass.Marco
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1217 Issue introduced in https://chromium-review.googlesource.com/#/c/339162/. The factor on avg_frame_qindex[INTER_FRAME] in that CL, used for q-basis to set active_best, can cause the QP to decrease too slowly or get stuck in some cases when max-q=63. Removing that factor fixes the regression in issue#1217. Change-Id: I97fe28dca3c2bc2d852b1775f39c62164e032d4f
2016-05-09vp9: 1 pass vbr: Reduce base qp for active_best_quality for inter-frames.Marco
Reduce factor for setting base-qp for active_best_quality (for inter-frames). Small increase in metrics on yt live set. Change-Id: I9cf0ac797783aeddbfaf1ff510696c9035d7c5ee
2016-05-05vp9: Modify logic for gf setting based on up-coming key frame.Marco
For 1 pass vbr mode: Refactor to move the logic for gf setting based on up-coming key frames to a separate function, so same logic can be used for scene-cuts/changes. Change-Id: Ic4ede308e08ba869bb62e4566e19ea31222c5229
2016-04-28vp9: Move the initialization of some rc variables to rc_init.Marco
And initialize a variable (avg_source_sad) that was not initialized to 0. Change-Id: I63223e20fffe2a2ea38f03da62dad16af0618ea4
2016-04-25vp9: 1 pass vbr: Adjust gf boost/interval on motion level.Marco
Add some adjustment for high motion case. Change-Id: If700be1ce849c187ed031221ea7cabbc8d91ec2b
2016-04-25vp9: Add rc quantity to track amount of low motion in scene.Marco
Use it for now in noise estimation to bypass estimation if motion level is high. Change-Id: I033662dc909f2060e4e81abf562a7ad262dc8170
2016-04-20vp9: 1 pass vbr: Small fix on reset avg_intersize_gfint on scene cut.Marco
Change-Id: Ie73d1bbc2c953d010b32097440698f0d060750be
2016-04-20vp9: 1 pass vbr: small adjustment to active_best factor for inter.Marco
Change-Id: I9c68aa9e72969b0ffbf57eb186380ff666745aeb
2016-04-19vp9: Adjust gf period for high average Q and overshoot.Marco
For 1 pass vbr mode. Increase the gf interval for case where average Q is close to max and high overshoot is detected. Small increase in overall avg_psnr/sssim metrics (~0.2/0.1%) for ytlive, but improves the low-end (low bitrate) for several clips (less overshoot). Change-Id: Ifba40f25b4861b2e0d9832c82d5359a6a3dce9f2
2016-04-18vp9: 1 pass vbr: More even spacing for gf near key frame.Marco
More even spacing near key frame and avoid gf on scene cut if its close to key frame. Small increase in metrics for ytlive set (which uses key-period=150). (~0.2% gain) Change only affects 1 pass vbr mode. Change-Id: If1e5a59baf1e0befbaf998522fbc47d94ac5b5df