summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ratectrl.h
AgeCommit message (Collapse)Author
2015-05-20Fast feedback of bits on undershoot.paulwilkins
This patch provides a partial rapid feedback of bits resulting from extreme undershoot. Some improvement on some problem animated material but in its current form only a small impact on the metrics results of our standard test sets. Change-Id: Ie03036ea8123bc2553437cb8c8c9e7a9fc5dac5d
2015-05-15vp9: correct some function signaturesJames Zern
silences missing prototype warnings Change-Id: Idaf68d83d2cb03847f3ee002c4d00c2ac79da604
2015-05-01Adjust ARF min and max interval.paulwilkins
Previously limit on max interval set to 0.5 seconds. Though this helped some low frame rate material it appears to be a bit too aggressive for some 24 and 25 fps content. This patch relaxes the limit to 0.75 seconds. The patch also adds a new minimum interval variable to replace the current hard wired value. This allows us to impose a limit on the maximum number of primary arfs per second for high frame rate (e.g. 50 & 60fps) content. This is to address concerns regarding playback performance on some platforms if there is a high base frame rate and very frequent arfs. Change-Id: I373e8b6b2a8ef522eced6c6d2cceb234ff763fcf
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-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-21Bug when last group before forced key frame is short.Paul Wilkins
Just before a forced key frame we often get a foreshortened arf/gf group. In such a case, we do not want to update rc->last_boosted_qindex, which is used to define the Q range for the forced key frame itself. This gives a small average metrics gain for the YT and YT-HD sets (eg. YT SSIM +0.141%). Change-Id: Ie06698bc4f249e87183b8f8fb27ff8f3fde216d9
2014-12-01Cyclic refresh: factor segment delta-q into rate control.Marco Paniconi
Incorporate segment delta-q into estimated bits. This generally improves the rate control under cyclic refresh (aq=3) mode. Change-Id: I1dc60fb230e7d08357fae18909d8ed27bf58e037
2014-11-18Prevent severe rate control errors in CBR modeYaowu Xu
In rare cases, the interaction between rate correction factor and Q choices may cause severe oscillating frame sizes that are way off target bandwidth. This commit adds tracking of rate control results for last two frames, and use the information to prevent oscillating Q choices. Change-Id: I9a6d125a15652b9bcac0e1fec6d7a1aedc4ed97e
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-13Add adaptation option for VBR.Paul Wilkins
Allow min and maxQ to creep when the undershoot or overshoot exceeds thresholds controlled by the command line under_shoot_pct and over_shoot_pct values. Default is 100%,100% which ~disables adaptation. Derf results for example undershoot% / overshoot%:- Head:- Mean abs (%rate error) = 14.4% This check in:- 25%/25% - Mean abs (%rate error) = 6.7% PSNR hit -1% SSIM -0.1% 5% / 5% - Mean abs (%rate error) = 2.2% PSNR hit -3.3% SSIM - 1.1% Most of the remaining error and most of the quality hit is at extreme data rates. The adaptation code still has an exception for material that is in effect static so that we don't over adjust and over spend on YT slide show type content. (Rebase of If25a2449a415449c150acff23df713e9598d64c9 to resolve a auto-merge error) Change-Id: Iec4e1613ef0d067454751d8220edb7058dfbd816
2014-10-10Revert "Add adaptation option for VBR."Alex Converse
This reverts commit 869d4ca51957614dcf5093ebb9e322cc8a8405ca. This breaks the build via conflict with e18edd5eb651f9b7563cbd829744807402bfe0d8. Change-Id: If544b99e367a449452834eb8cce600f58c34ec0d
2014-10-10Add adaptation option for VBR.Paul Wilkins
Allow min and maxQ to creep when the undershoot or overshoot exceeds thresholds controlled by the command line under_shoot_pct and over_shoot_pct values. Default is 100%,100% which ~disables adaptation. Derf results for example undershoot% / overshoot%:- Head:- Mean abs (%rate error) = 14.4% This check in:- 25%/25% - Mean abs (%rate error) = 6.7% PSNR hit -1% SSIM -0.1% 5% / 5% - Mean abs (%rate error) = 2.2% PSNR hit -3.3% SSIM - 1.1% Most of the remaining error and most of the quality hit is at extreme data rates. The adaptation code still has an exception for material that is in effect static so that we don't over adjust and over spend on YT slide show type content. Change-Id: If25a2449a415449c150acff23df713e9598d64c9
2014-09-18Substantial reworking of code for arf and kf groups.Paul Wilkins
Substantial restructuring of the way we estimate the rate of decay in prediction quality and determine the arf interval and amount of boost used. Also other changes to support moving to a lower first pass Q which exposes some new features and allows us to better distinguish genuinely static blocks from low motion or noisy blocks. Net gains now visible on all the test sets with std-hd PSNR up 1.87%. There are still some bad outlier cases but most of these are low motion or slide show type content where the metrics are already high at any given rate. The best + case is up by more than 10%. Change-Id: I18e25170053bdf3188f493ff8062f48a74515815
2014-09-16Adds high bitdepth quantization functionsDeb Mukherjee
Adds various high bitdepth quantization functions. Change-Id: I36fc0bf75a1bd15128ed271df8723de0ac134b0c
2014-07-14[spatial svc]Implement alt reference framesMinghai Shang
All changes are for spatial svc only. 1. Enable encoding hidden frames in each layer and use alt reference idex to reference the hidden frame in each layer 2. Use golden reference idx for spatial reference 3. For those layers that don't have hidden frames (caused by lack of frame buffers), reference a hidden frame in lower layers 4. Add "auto-alt-refs" in svc options Change-Id: Idf27d1fd2fb5f3ffd9e86d2119235e3dad36c178
2014-06-24Experiment for mid group second arf.Paul Wilkins
This patch implements a mechanism for inserting a second arf at the mid position of arf groups. It is currently disabled by default using the flag multi_arf_enabled. Results are currently down somewhat in initial testing if multi-arf is enabled. Most of the loss is attributable to the fact that code to preserve the previous golden frame (in the arf buffer) in cases where we are coding an overlay frame, is currently disabled in the multi-arf case. Change-Id: I1d777318ca09f147db2e8c86d7315fe86168c865
2014-06-03Using 2 instead of 3 elements for avg_frame_qindex array.Dmitry Kovalev
The third array element was unused. 2 elements now: key- and interframe. Change-Id: I5b8b9f5d889cc96a204cedfc432059293256298e
2014-06-03Adding buffer levels to RATE_CONTROL struct.Dmitry Kovalev
Change-Id: Ib35ff854378764dc3c6745844c67a33dee545663
2014-05-30Merge "Re-factor some duplicate code."Paul Wilkins
2014-05-28Re-factor some duplicate code.Paul Wilkins
Change-Id: I89a1dbea39c50c7633f746d9c93fec3a289f1b42
2014-05-27Using 2 instead of 3 elements for last_q array.Dmitry Kovalev
Change-Id: I2c6950e7d79fc89c6f97e6dcf47317ef66c453a5
2014-04-30Moving #defines to *.c from *.h.Dmitry Kovalev
Change-Id: I7cc6f441f414ca1b4d95dad3f789fff6faf8c3c4
2014-04-21Merge "Add experimental VBR adaptation method."Yaowu Xu
2014-04-18Renaming VP9_CONFIG to VP9EncoderConfig.Dmitry Kovalev
Change-Id: Id48edd12c6f649c82113128491ef6ea7410e93b2
2014-04-16Add experimental VBR adaptation method.Paul Wilkins
Add code to monitor over and under spend and apply limited correction to the data rate of subsequent frames. To prevent the problem of starvation or overspend on individual frames (especially near the end of a clip) the maximum adjustment on a single frame is limited to a % of its un-modified allocation. Change-Id: I6e1ca035ab8afb0c98eac4392115d0752d9cbd7f
2014-04-15Renaming av_per_frame_bandwidth to avg_frame_bandwidth.Dmitry Kovalev
Just to be consistent with min_frame_bandwidth & max_frame_bandwidth names. Change-Id: I36702c708cba9ad1a5c36393f37758a2edeadb90
2014-04-11Adding vp9_rc_update_framerate() function.Dmitry Kovalev
Change-Id: Ie0c905b6f32a37e4360bbb44ceeae77c42ad1dc5
2014-04-10Moving last_frame_type update out from vp9_rc_postencode_update.Dmitry Kovalev
Change-Id: Ib00a694b9cf8e0c276dfefddab8cb36b8693e022
2014-04-08Merge "Moving init_rate_control() to vp9_ratectrl.{c, h}."Dmitry Kovalev
2014-04-08Merge "vp9_firstpass: Get rid of magic number in bits per MB calculation"Yaowu Xu
2014-04-07Moving compute_qdelta functions into vp9_ratectrl.{h, c}.Dmitry Kovalev
Change-Id: I512f2a287dd8765879a2d1144e2f028dc65f71ff
2014-04-07Moving init_rate_control() to vp9_ratectrl.{c, h}.Dmitry Kovalev
Change-Id: Iab3effc39064f265426c82b455ef38d37dcce5a8
2014-04-07Moving {restore, save}_coding_context to vp9_onyx_if.cDmitry Kovalev
These functions do nothing about rate control. Change-Id: I714e80b1c1f4f9aa157a56df705247fce6db138d
2014-04-07vp9_firstpass: Get rid of magic number in bits per MB calculationGuillaume Martres
Change-Id: Ib3886cb7cafc211581f4f9e7f76782d9d1984434
2014-04-02Rate ctrl changes to track target bitrates closerDeb Mukherjee
Turns off the DISABLE_RC_LONG_TERM_MEM macro and makes other changes in the way the bits are updated, to make 2-pass rate control track target bitrates closer. Change-Id: I5f3be4b11c2908e6a9a9a1dd4fcf4e65531c44d8
2014-03-25Merge "Moving setup_{key, inter}_frame() to vp9_onyx_if.c."Dmitry Kovalev
2014-03-24Initialization code cleanup.Dmitry Kovalev
Change-Id: I47a8b4bf9a6cc0063d1a6785eaaad641d0659e24
2014-03-24Moving setup_{key, inter}_frame() to vp9_onyx_if.c.Dmitry Kovalev
Change-Id: I044e393438c7b58a6393e20efa38fd03d745ad33
2014-03-13Move svc layer_context to separate file.Marco Paniconi
Change-Id: Ie47c139d48cb18409d71f98f6a5b9eeb9f9437a9
2014-03-10Moving static_scene_max_gf_interval to RATE_CONTROL struct.Dmitry Kovalev
Change-Id: Id63e114a8f0615dbafd6a816019cdebffb983d2c
2014-02-14Merge "vp9_ratectrl - convert buffers to int64 to avoid casting"Jim Bankoski
2014-02-14vp9_ratectrl - convert buffers to int64 to avoid castingJim Bankoski
Change-Id: Ifd6b2d36d91237b5f38853a3a8a529d8be38ba09
2014-02-14vp9_ratectrl.h resolve visual studio warningsJim Bankoski
Change-Id: If3a2edd744eb76337fa78f34d0e059cda2c6da54
2014-02-11Removes active_worst_quality feedbackDeb Mukherjee
Removes certain cases of feedback of active_worst_quality, and removes it from the RATE_CONTROL structure. Now active worst quality is expected to be computed locally in the q picking function during the encode. Making temporal filter strength depend on avg_frame_qindex rather than on active_worst_quality actually improves performance esp. for yt. derf: +0.038% yt: +0.359% Change-Id: I1fe5a343034b55af9322289165321f00ac0827b1
2014-02-05One-pass rate control cleanups/fixes/refactoringDeb Mukherjee
Inlcudes a number cleanups: 1. Moves the one-pass pre-encode parameter setting functions to vp9_ratectrl.c 2. Deprecates per_frame_bandwidth in RATE_CONTROL structure 3. Removes target_bandwidth in cpi structure since it is not used. 4. Various renaming of functions There is no bit-stream change in 2-pass, one-pass cbr and one-pass vbr modes. Change-Id: Ifd9916bf4d485b7d04c5f52044ffe6703254ccbd
2014-01-28Moving RATE_CONTROL struct to vp9_ratectrl.h.Dmitry Kovalev
Change-Id: I0c286e3d68a4a4ecf6df02e6fd9990327b0ceb22
2014-01-23vp9/encoder: add extern "C" to headersJames Zern
Change-Id: I4f51ce859a97bf1b8fd2b37ac585b7c643232b69
2014-01-07Further rate control cleanupsDeb Mukherjee
Some cleanups on frames_to_key, frames_since_key. Also removes the unused fixed_q parameters in vp9. Change-Id: If8743a32c71de30a8d17136477b53d607a7acda8
2013-12-18Updates for 1-pass CBR rate control.Marco Paniconi
Adjustments based on buffer level, frame dropper. Change-Id: Iaa85b570493526a60c4b9fb7ded4c0226b1b3a33
2013-12-16Rate control changes on active_worst_qualityDeb Mukherjee
Various cleanups and refactoring. Removes feedback of active worst qaulity and uses last_q instead to make the interface cleaner. Active worst quality is now decided only once for a frame being coded in the beginning based on last_q and other stats. Also, adds other cleaups on last_q to store also the last_q for altref frames, and reduces the altref interval a little. The output does change a little. derfraw300: +0.224% (global psnr) stdhdraw250: +0.442% (global psnr) Change-Id: Ie634cdc032697044c472dd0fe79c109b3e7f9767