summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_firstpass.h
AgeCommit message (Collapse)Author
2021-07-23Remove unused old FP_MB_STATS codeYunqing Wang
Change-Id: I78ac1f8ce1598de295efd2ac1fe8244072d9b501
2021-06-21Add use_simple_encode_api to oxcfAngie Chiang
Use this flag to change the encoder behavior when SimpleEncode APIs are used BUG=webm:1733 Change-Id: I9f0852a03ff99faa01cdd8eee8ab71718cc58632
2021-06-07L2E: properly init two pass rc parametersCheng Chen
Two pass rc parameters are only initialized in the second pass in vp9 normal two pass encoding. However, the simple_encode API queries the keyframe group, arf group, and number of coding frames without going throught the two pass route. Since recent libvpx rc changes, parameters in the TWO_PASS struct have a great influence on the determination of the above information. We therefore need to properly init two pass rc parameters in the simple_encode related environment. Change-Id: Ie14b86d6e7ebf171b638d2da24a7fdcf5a15c3d9
2021-05-26Fix simple encodeCheng Chen
Properly init and delete cpi struct in simple encode functions. Change-Id: I6e66bcac852cbb3dec9b754ba3fb01a348ac98b8
2021-04-20Further normalization of Vizier parameters.Paul Wilkins
Further changes to normalize the Vizier command line parameters. The intent is that the default behavior for any given parameter is signaled by the value 1.0 (expressed on the command line as a rational). The final values used in the two pass code are obtained by multiplying the passed in factors by a default values if use_vizier_rc_params is 1. Where use_vizier_rc_params is 0 the values are explicitly set to the defaults. This patch also changes the default value of each parameter to 1.0 even if not set explicitly. This should ensure safe /default behavior if the user sets use_vizier_rc_params to 1 but does not set all the the individual parameters. Change-Id: Ied08b3c22df18f42f446a4cc9363473cad097f69
2021-04-13Set vizier rc parametersCheng Chen
If pass --use-vizier-rc-params=1, the rc parameters are overwittern by pass in values. It --use-vizier-rc-params=0, the rc parameters remain the default values. Change-Id: I7a3e806e0918f49e8970997379a6e99af6bb7cac
2021-04-07Merge "Fix compilation for CONFIG_RATE_CTRL"Cheng Chen
2021-04-06Fix compilation for CONFIG_RATE_CTRLCheng Chen
Recently, some function signatures have been changed. This change fixes compilation error if --enable-rate-ctrl is used. Change-Id: Ib8e9cb5e181ba1d4a6969883e377f3dd93e9289a
2021-04-06Change zm_factor for Vizier.Paul Wilkins
Changes the exposed zm_factor parameter. This patch alters the meaning of the zm_factor parameter that will be exposed for the Vizier project. The previous power factor was hard to interpret in terms of its meaning and effect and has been replaced by a linear factor. Given that the initial Vizier results suggested a lower zero motion effect for all formats, the default impact has been reduced. The patch as it stands gives a modest improvement for PSNR but is slightly down on some sets for SSIM (overall psnr, ssim % bdrate change: -ve is better) lowres -0.111, 0.001 ugc360p -0.282, -0.068 midres2 -0.183, 0.059 hdres2 -0.042, 0.172 Change-Id: Id6566433ceed8470d5fad1f30282daed56de385d
2021-03-18Change SR_diff calculation and representationPaul Wilkins
This patch changes the way prediction decay is calculated. We expect that frames that are further from an ALT-REF frame (or Golden Frame) will be less well predicted by that ALT-REF frame. As such it is desirable that they should contribute less to the boost calculation used to assign bits to the ALT_REF. This code looks at the reduction in prediction quality between the last frame and the second reference frame (usually two frames old). We make the assumption that we can accumulate this to get a proxy for the likely loss of prediction quality over multiple frames. Previously the calculation looked at the absolute difference in the coded errors. The issue here is that the meaning of a unit difference is not the same for very complex frames as it is for easy frames. In this patch we scale the decay value based on how the error difference compares to the overall frame complexity as represented by the intra coding error. This was tuned experimentally to give test results that were approximately neutral for our various test sets. There was a slight drop in Overall PSNR but a consistent improvement in SSIM. This balance may be improved with tuning further as it is noteworthy that it was much better on the hd_res set. Results (Overall PSNR, SSIM -ve better) for low_res, ugc360, midres2, ugc480P and hd_res are as follows: 0.173 -0.688 0.118 -0.153 0.132 -0.239 0.261 -0.405 -0.305 -1.109 As part of this adjustment the contribution of motion amplitude was removed. This patch also changes the control mechanism that will be exposed on the command line for use by the Vizier project. The control is now a linear factor which defaults to 1.0, where values < 1.0 mean a lower decay rate and values > 1.0 mean an increased decay rate. This presents a more easily understandable interface for use in optimizing the decay behavior for various formats, where it is clear what a passed in value means relative to the default. With the new decay mechanism the current values for various formats are almost certainly wrong and we still need to define sensible upper and lower bounds for use during future training. Change-Id: Ib1074bbea97c725cdbf25772ee8ed66831461ce3
2021-03-10Vizier: Add in field for min kf frame boost.Paul Wilkins
Added kf_frame_min_boost field to hold the minimum per frame boost in key frame boost calculations. Replaces hard wired value. To be used in conjunction with and tied to the maximum value. Change-Id: I67a39ecb3f21b5918512a5ccd9a1b214d7971e45
2021-03-08Further integration for Vizier.Paul Wilkins
Further integration of Vizier adjustable parameters, This patch connects up additional configurable two pass rate control parameters for the Vizier project. This still needs to be connected up to a command line interface and at the moment should still be using default values that match previous behavior. Do not submit until verified that defaults are all working correctly. Change-Id: If1241c2dba6759395e6efa349c4659a0c345361d
2020-05-26Add functions to compute/observe key frame mapangiebird
Change-Id: I2fc0efb2ac35e64af3350bddaa802a206d1aa13c
2020-05-26Add GOP_COMMANDangiebird
Send GOP_COMMAND to vp9 for setting gop decisions on the fly. GOP_COMMAND has three members. use: use this command to set gop or use vp9's gop decision. show_frame_count: number of show frames in this gop. use_alt_ref: use alt ref frame or not. Move the logic of processing external_arf_indexes_ from get_gop_coding_frame_num() to GetGopCommand() and GetCodingFrameNumFromGopMap(). Change-Id: Ic1942c7a4cf6eecdf3507864577688350c7ef0cf
2020-02-24Make external arf consistent with vp9Cheng Chen
Add a test to ensure that encoding with the external arfs gets the same result as long as the arfs are the same as the vp9 baseline. Change-Id: I92c79001018f4df3bc16e9fc56c733509bebb9dc
2020-02-24Allow external arf to determine gop sizeCheng Chen
When "rate_ctrl" experiment is on, we allow the external arf passed from outside to determine group of picture size in define_gf_group(). Change-Id: I0b8c3e1bf3087f21a4e484354168df4967d35bba
2020-02-20Add kGoldenFrame and kOverlayFrame to FrameTypeangiebird
Add coding_index to EncodeFrameInfo Add start_coding_index to GroupOfPicture Add frame_coding_index_ to SimpleEncode The definition of coding index is as follows. Each show or no show frame is assigned with a coding index based on its coding order (starting from zero) in the coding process of the entire video. The coding index for each frame is unique. Change-Id: I43e18434a0dff0d1cd6f927a693d6860e4038337
2019-12-12Cosmetic change of vp9_get_gop_coding_frame_countangiebird
Move the output parameter to the end. Change-Id: I39c718b683a76cd7c5998724c3a07e88275198bf
2019-12-11Cosmetic changes for RATE_CTRL related functionsangiebird
Move input parameters ahead of output parameters. Change-Id: I384f69523b6be92224535d05373ebb33467a040e
2019-12-10Rename parameter two_pass to twopass.angiebird
Change-Id: I54f60f62f27f9ef96db892d5b6219c9591ce2dc9
2019-12-10Add GetNextEncodeFrameInfo ObserveGroupOfPictureangiebird
GetNextEncodeFrameInfo() Gets encode_frame_info for the next coding frame. ObserveGroupOfPicture() Provides the group of pictures that the next coding frame is in. Change-Id: Idbc437d32c392f25b06efb2d4e1ec01347d678f2
2019-12-09Add vp9_get_gop_coding_frame_count()angiebird
Call this function before coding a new group of picture to get information about it. Change-Id: I3d88d719dd27c6d7383eb8f92307a93096b30706
2019-12-06Add GetKeyFrameGroupSize()angiebird
Makes vp9_get_frames_to_next_key() public. Change-Id: I903cefbb3925d6ffc641412c6d60d95a2ff256a4
2019-11-18Add ComputeFirstPassStats()angiebird
Change-Id: Iaed87a4fa35f456aec5d88d07fade636280eb211
2019-10-29vp9_get_coding_frame_num()angiebird
Change-Id: I36fa92d9acfc272fc9a2f700bcd1466e95f1443c
2019-10-21Pass first_pass_info/show_idx to test_candidate_kfangiebird
Change-Id: I5c18de464be9981236f95c62391258c4963e469b
2019-10-15Add check_transition_to_still()angiebird
The behavior is the same as that of detect_transition_still, only we void using cpi and twopass->stats_in Change-Id: I07722c817d98d8e4991a0a883235a582db8b5c3c
2019-10-11Simplify the logics of computing gf_group_err etcangiebird
Move the logics of computing gf_group_err, gf_group_raw_error, gf_group_noise, gf_group_skip_pct, gf_group_inactive_zone_rowsa, gf_group_inter, gf_group_motion into one for loop The behavior stays the same. Change-Id: Idbc338a88469bf7a2786c831880e8aba8ed4feb5
2019-10-10Add first_pass_info in TWO_PASSangiebird
This is part of the change aims at replacing stats_in/stats_in_start/stats_in_end by first_pass_info. Change-Id: Ibcd2a08e57cb749fe68996f33fe3a5e7f92b1758
2019-07-16Merge "Limit active best quality of layered ARF frames"Paul Wilkins
2019-05-17Limit active best quality of layered ARF framesDeepa K G
For higher layer ARF frames, limit active best quality to the qindex of the lower layer ARF frame. Change-Id: I957cbd8ae02313cbc94eda2175e63a26d788459a
2019-05-16Fix section intra rating for first ARF intervalDeepa K G
The section intra rating used for the frames in the first ARF interval was based on entire key frame interval. However, for subsequent ARF intervals it was based on that ARF interval. This discrepancy is fixed. Change-Id: I3df358861d720e536c9c6f15da1cbd78f2dfffbc
2019-03-20Merge "Store a group level noise metric from first pass."Paul Wilkins
2019-03-14Enclose macro arguments in parenthesesJerome Jiang
BUG=webm:1606 Change-Id: I661485b860243c95b6450035dbac77b0dd4d9ff4
2019-03-11Store a group level noise metric from first pass.Paul Wilkins
Adds a variable to GF group structure to store a noise energy metric for the current group that can be used in things like film grain retention code. Change-Id: I81b07630d3242f7928110f19a6c1ed4c86125f05
2018-11-05Refactor find_arf_order()Jingning Han
Make the maximum layer depth allowed a control parameter in GF_GROUP. No coding stats would change. Change-Id: I9d17167da322831e7013d761980e1c16375a161b
2018-10-15Record gop sizeJingning Han
Keep the frame operations needed within a group of picture. Change-Id: Iece2e855f21860c930b34a3c586f084f7c61db00
2018-10-15Add frame_gop_index to GF_GROUPJingning Han
Add frame_gop_index to track the frame offset within a group of picture. This reworks the GOP frame offset calculation and use case. The coding stats remain identical. Change-Id: I94d0957bcc327f6bbeac6e84157635663c36b953
2018-10-03Clean up vp9_firstpass.hJingning Han
Remove unused functions and macros. Change-Id: I46458a60f75637c66af0e18ad876a2634e5818bb
2018-09-28Remove deprecated arf_update_index from GF_GROUPJingning Han
As we move to unify the GOP structure layout control, the variable arf_update_idx and arf_ref_idx are deprecated. Change-Id: Iadcb9e6033d419d4b2015fe747c23be59a7da787
2018-09-27Add MID_OVERLAY_UPDATE frame typeJingning Han
Add a MID_OVERLAY_UPDATE abstract to support multi-layer ARF-Overlay frame based approach. When setting the frame update type to be USE_BUF_FRAME, the encoder will use show_existing_frame to process the intermediate ARF frames. When setting the frame update type to be MID_OVERLAY_UPDATE, the intermediate ARF frames will go through an overlay frame for display. Change-Id: Ia0c91452c09d39312ac22d855cdf681b7da851c5
2018-09-27Remove deprecated variables from GF_GROUP structureJingning Han
Change-Id: I8c02216a369be6a51af9872f3ce05045038fc481
2018-09-18Add frame_start/end to gf_groupJingning Han
Keep the start and end frame index for each group of pictures. Change-Id: I23c0d22e643218cf7486b238c2986101282d3fbe
2018-09-15cosmetics: normalize include guardsJames Zern
use the recommended format [1] of: <PROJECT>_<PATH>_<FILE>_H_ [1] https://google.github.io/styleguide/cppguide.html#The__define_Guard "All header files should have #define guards to prevent multiple inclusion. The format of the symbol name should be <PROJECT>_<PATH>_<FILE>_H_." Change-Id: I2e8ab0b32fb23c30fa43cff5fec12d043c0d2037
2018-09-12Remove deprecated first_inter_indexJingning Han
With the refactoring of logics that determines if a frame needs re-code runs to adapt to the target bit-rate, the variable first_inter_index is no longer in effect use. Hence remove it. Change-Id: I045894ad1f8b1e00fa40d5a55d762bad0d31b27d
2018-09-12Remove some deprecated FRAME_UPDATE_TYPE elements.Paul Wilkins
Removal of some frame types relating to deprecated multi-arf work. Added a dummy value for the USE_BUF_FRAME frame type in the declaration of the rd_frame_type_factor[FRAME_UPDATE_TYPES] structure. Change-Id: I7173f2fe33a53117e1bde6f9621efc1a5951240b
2018-09-05Adaptive ARF factor decisionJingning Han
Re-count the factors to decide bit boost factor for the intermediate layer ARFs. Make the gfu_boost factor assigned to each ARF adapt to its local factors. This and the recursive change 5bfe9eb together improves the multi-layer ARF compression performance: avg_psnr ovr_psnr ssim lowres -0.39% -0.54% -1.6% midres -0.98% -1.26% -2.3% hdres -0.95% -1.13% -2.3% Change-Id: I5fec3ea75cae58825787dc88dadc7e8697a041ea
2018-09-05Enable adaptive rate allocation for multi-layer ARFsJingning Han
Increase the bit allocation for the intermediate layer ARFs. The current strategy assigns higher offset to the lower layer ARFs. The needed budget is borrowed from the base layer ARF allocation. Change-Id: I16b6e9cce4dab8e73e7b097674d1a8504205026e
2018-08-31Build arf index stackJingning Han
Stack the ARF frame indexes. Use the most recent one as the ARF reference frame for frame coding. Change-Id: I88a2202fa5deb2587d861b434d27ab8de0642cf7
2018-08-21Add USE_BUF_FRAME enum to FRAME_UPDATE_TYPEJingning Han
This enum indicates the use of show existing frame, and conducts no reference frame buffer update. Change-Id: I8bf3121376640baf24b580ebea58e9ccbdd641da