summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_firstpass.c
AgeCommit message (Collapse)Author
2013-05-30Remove i4x4_pred.Ronald S. Bultje
It remains as a local define in rdopt.c so we can distinguish between split and non-split modes in the RD loop, but disappears outside that scope in the codec. Change-Id: I98c18fe5ab7e4fbd1d6620ec5695e2ea20513ce9
2013-05-16Remove vp9_extend_mb_row()John Koleszar
This code is no longer needed for correct intra prediction. Change-Id: I822d1a8b0ad0a00e7c4c6e7b2931790c39d1267d
2013-05-15Add vp9_extend_frame_bordersJohn Koleszar
Adds a subsampling aware border extension function. This may be reworked soon to support more than 3 planes. Change-Id: I76b81901ad10bb1e678dd4f0d22740ca6c76c43b
2013-05-15Fix first-pass encoding testJingning Han
Always initialize the mode_info with sb_type of BLOCK_SIZE_MB16X16 for the first-pass encoding test. Change-Id: Ic86393eeef981bdd523a5b44cfac3f0b24c068b7
2013-05-13Merge "Code cleanup inside vp9_firstpass.c." into experimentalDmitry Kovalev
2013-05-10Merge "Subsampling aware allocs and bitstream" into experimentalJohn Koleszar
2013-05-09Subsampling aware allocs and bitstreamJohn Koleszar
Make framebuffer allocations according to the chroma subsamping factors in use. A bit is placed in the raw part of the frame header for each of the two subsampling factors. This will be moved in a future commit to make them part of the TBD feature set bits, probably only set on keyframes, etc. Change-Id: I59ed38d3a3c0d4af3c7c277617de28d04a001853
2013-05-09Make firstpass encode Y-onlyJohn Koleszar
The chroma planes are not used during the first pass encode, but the vp9_encode_sb() function was operating on them anyway. This was causing the use of uninitialized memory. Change-Id: I5ebafcd3d5e34ed91a8336dad159b573995a939f
2013-05-08Code cleanup inside vp9_firstpass.c.Dmitry Kovalev
Change-Id: Ia2814402e3c2ec97c24c536c05f0f526fe1a431c
2013-05-07Removing vp9_swap_yv12_buffer function and corresponding files.Dmitry Kovalev
Adding static swap_yv12 function to vp9_firstpass.c. Change-Id: I7da9caab9720498db4a74c627901bf37816ed06c
2013-05-07Merge "Merge SB8X8 into the codebase" into experimentalJingning Han
2013-05-07Merge SB8X8 into the codebaseJingning Han
Pull sb8x8 out of experimental list. verified via borg run tests. Fixed unit test failures. Change-Id: I12a4bbd17395930580c048ab68becad1ffe46e76
2013-05-07Merge "Removed vp9_setup_intra_recon()" into experimentalScott LaVarnway
2013-05-06Remove heap alloc of FIRSTPASS_STATSJohn Koleszar
There is only one instance of these structures, no need for them to be allocated separately on the heap. Change-Id: I1333cc92d06bbe21be643c2b2f0e3936f0264cac
2013-05-06Removed vp9_setup_intra_recon()Scott LaVarnway
This setup is now handled by vp9_build_intra_predictors() when left_available and/or up_available is zero. Change-Id: I59cec0ab95f8be69ce885fd20727510e4deef8a0
2013-05-02Create common vp9_encode_sb{,y}John Koleszar
Creates a common encode (subtract, transform, quantize, optimize, inverse transform, reconstruct) function for all sb sizes, including the old 16x16 path. Change-Id: I964dff1ea7a0a5c378046a069ad83495f54df007
2013-04-26Grow MODE_INFO array to use an 8x8 basis.Ronald S. Bultje
Change-Id: I087e08e7909a406b71715b8525c104208daa6889
2013-04-26Remove BLOCKD structureJohn Koleszar
All members can be referenced from their per-plane counterparts, and removes assumptions about 24 blocks per macroblock. Change-Id: I7ff2fa72d22c29163eb558981c8193765a8113d9
2013-04-25Remove predictor pointers from BLOCKDJohn Koleszar
Access these members from MACROBLOCKD instead. Change-Id: I2574622e577bb9feede47f6b7ccbb11f3e928ca8
2013-04-25Remove BLOCK structureJohn Koleszar
All members can be referenced from their per-plane counterparts, and removes assumptions about 24 blocks per macroblock. Change-Id: I593fb0715e74cd84b48facd1c9b18c3ae1185d4b
2013-04-24Merge two similar functions into oneYaowu Xu
Function set_mb_row() and set_mb_col() do similar work and are always called together, this commit merged them into a single function for clarity and easy maintainence. This was a TODO item. Change-Id: I956bd9ed6afb8b2b0469b20fd8bc893b26f8a0f3
2013-04-23Remove coeff from BLOCKJohn Koleszar
Lookup the data per-plane from the MACROBLOCK struct. Change-Id: I9253c4d3cf886aa9ab4aeab23a2156bfcf994ede
2013-04-22Move pre, second_pre to per-plane MACROBLOCKD dataJohn Koleszar
Continue moving framebuffers to per-plane data. Change-Id: I237e5a998b364c4ec20316e7249206c0bff8631a
2013-04-19Move dst to per-plane MACROBLOCKD dataJohn Koleszar
First in a series of commits moving the framebuffers pointers to per-plane data, so that they can be indexed numerically rather than by name. Change-Id: I6e0d60fd4d51e6375c384eb7321776564df21775
2013-04-19Merge "Adjustments to key frame sizing." into experimentalPaul Wilkins
2013-04-19Adjustments to key frame sizing.Paul Wilkins
Adjustments take heavier account of the frame near a kf in deciding boost and limit the total number that can contribute. Also adjusted the minq calculations such that in most cases we generate a smaller key frame. Modified the code that accounts for how static the sequence is and added some adjustment based on image size. This is still very crude but smaller images tend to behave better with a larger delta between KF Q and other frames than larger image formats. Changes give sizable gains in overall PSNR on all the test sets but the biggest gains (~3%) were on the std-hd set. The gains were smaller for SSIM but still significant. Average PSNR results are mixed because this metric can very easily be altered by having a very good / lossless coding of one or two frames. Some of the YT and YT-HD clips in particular have blank lead ins and allowing lossless coding of these appears to make a big difference to average PSNR but it reality does not help much at all. Change-Id: I6bfe485a1d330b47c783832f1717c95c535464ec
2013-04-18make buid_inter_predictors block size agnostic (luma)John Koleszar
This commit converts the luma versions of vp9_build_inter_predictors_sb to use a common function. Update the convolution functions to support block sizes larger than 16x16, and add a foreach_predicted_block walker. Next step will be to calculate the UV motion vector and implement SBUV, then fold in vp9_build_inter16x16_predictors_mb and SPLITMV. At the 16x16, 32x32, and 64x64 levels implemented in this commit, each plane is predicted with only a single call to vp9_build_inter_predictor. This is not yet called for SPLITMV. If the notion of SPLITMV/I8X8/I4X4 goes away, then the prediction block walker can go away, since we'll always predict the whole bsize in a single step. Implemented using a block walker at this stage for SPLITMV, as a 4x4 "prediction block size" within the BLOCK_SIZE_MB16X16 macroblock. It would also support other rectangular sizes too, if the blocks smaller than 16x16 remain implemented as a SPLITMV-like thing. Just using 4x4 for now. There's also a potential to combine with the foreach_transformed_block walker if the logic for calculating the size of the subsampled transform is made more straightforward, perhaps as a consequence of supporing smaller macroblocks than 16x16. Will watch what happens there. Change-Id: Iddd9973398542216601b630c628b9b7fdee33fe2
2013-04-18Merge "Renaming y1dc_delta_q, uvdc_delta_q, uvac_delta_q fields from ↵Dmitry Kovalev
VP9Common." into experimental
2013-04-17Merge "Make alt_extra_bits a local variable" into experimentalAdrian Grange
2013-04-17Make alt_extra_bits a local variableAdrian Grange
alt_extra_bits is now only used in a local context so remove it from the twopass_rc structure. Change-Id: I5bbf0a3dba9712a3da45760f7bb865243705b53e
2013-04-17Merge "Move configure_arnr_filter function" into experimentalAdrian Grange
2013-04-17Merge "Fixed overflow test on boost calculation" into experimentalAdrian Grange
2013-04-16Move configure_arnr_filter functionAdrian Grange
This function is now called from configures the ARNR filter so it belongs with the other temporal filter functions. Change-Id: I64211875918364b5b8edfb97743e573c6def1663
2013-04-16Fixed overflow test on boost calculationAdrian Grange
Normalization of the frame boost value was being done when it reached the value 1028. The intention was to keep to a range of 10 bits, so it should have been clipped above 1023. Change-Id: I0afdddc1d2eb9e7822ec4578903cbe6ec0b33b91
2013-04-16Renaming y1dc_delta_q, uvdc_delta_q, uvac_delta_q fields from VP9Common.Dmitry Kovalev
New names are y_dc_delta_q, uv_dc_delta_q, uv_ac_delta_q. Change-Id: I4acae1fc23a4697ce2c5a5becb8dc28ef0a4b552
2013-04-15Removing TRUE and FALSE macro definitions.Dmitry Kovalev
Using regular 0 and 1 constants now. Change-Id: Ie763503cbb727847cc8f1d6506cd6f2ee607f056
2013-04-15Initial addition of multiple ARF framesAdrian Grange
This is work-in-progress, it implements multiple ARF encoding behind an experimental flag. It adds the ability to insert multiple ARF frames into a single ARF group. This patch implements the reordering of the coded frames, and implements a fixed-length coding pattern. It applies a fixed quantizer strategy based on where the frame is in the coding sequence. Further work to modify the rate control strategy is ongoing and will be submitted via a set of future patches. In this first step, each ARF group is recursively bisected and an ARF frame added at that position in the sequence. The recursion continues until ARF frames are within MIN_GF_INTERVAL frames. The code sits behind the "multiple-arf" experimental flag ("CONFIG_MULTIPLE_ARF"). The experimental flag "oneshotq" ("CONFIG_ONESHOTQ") also needs to be enabled for this patch to work correctly. Change-Id: Ie473b05ebb43ac473c0cfb659b2b8042823085e2
2013-03-28Adjust mv_ratio_accumulator threshold.Paul Wilkins
This threshold effectively limits the amount of motion from one end of a GF/ARF group to the other. This patch makes the threshold depend on image size. Change-Id: Id45d1d7bced815f86ddd037be53164894b00b82f
2013-03-20Code cleanup: lower case variable names.Dmitry Kovalev
Renaming Width to width, Height to height and Version to version in several structs and function signatures. Change-Id: I084c3f7e747cb2ce3345aff27a3dff9b13a87543
2013-03-18Merge "Adapt ARNR filter length and strength." into experimentalPaul Wilkins
2013-03-18Adapt ARNR filter length and strength.Paul Wilkins
Adjust the filter length and strength for each ARF group based on a measure of difficulty (the boost) and the active q range. Remove lower limit on RDMULT value. Average gains on the different sets in range 0.4%-0.9%. However the ARNR changes give a very big boost on a few clips. Eg. Soccer ~5%, in derf set and Cyclist ~ 10% in the std-hd set Change-Id: I2078d78798e27ad2bcc2b32d703ea37b67412ec4
2013-03-15Fix use of NaN in firstpassJohn Koleszar
If the second reference is better than the first in the long term, it was possible to try to take the fractional exponent of a negative number, giving an undefined result. Change-Id: I1dd08286747ceae960eb03bb5d98a383cc9d253b
2013-03-11Changes to maximum gf/arf interval.Paul Wilkins
This patch puts in an adjustment to the maximum gf/arf interval based on the active q range. It sets a fixed baseline maximum of 16 but can drop this down to 12 at lower q. This required some re-ordering in the first pass code to insure we have a Q range estimate before defining the first gf sequence. The main gains seed are int he STD hd set on 50fps clips where previously the interval could rise as high as 25. On the std hd clip the gains are around 2.8% with limit set to 300 frames. When combined with the one shot rate control flags we get combined of: derf 1.55% (limit300), yt 7.25%, hd 5.17% std-hd 5.84% (limit300) Change-Id: Ib380d51354511f2ff0f171a8df4e74291c0421f9
2013-03-08Extend diff MV limit from +/-256 to +/-1024Jingning Han
Increase the motion search range by 4x. Change MV_CLASS tree of the entropy coding to allow two additional mv classes to cover the extended motion vector limit. The codec determines the effective motion search range conditioned on the actual frame dimension. It provides coding gains: stdhd 0.39% yt 0.56% hd 0.47% Major coding performance gains are packed in several sequences with intense motion activities, e.g., ped_1080p gains 7% at high bit-rates, and on average 3%. TODO: Need to further tune the rate control and motion search units. Change-Id: Ib842540a6796fbee5a797809433ef6a477c6d78d
2013-03-01Merge master branch into experimentalJohn Koleszar
Picks up some build system changes, compiler warning fixes, etc. Change-Id: I2712f99e653502818a101a72696ad54018152d4e
2013-02-28firstpass.c: correct casting around gf_group_bitsJames Zern
gf_group_bits is int64_t remove casts to int. Change-Id: I3b4225905041fac9af9fdfcbcb6f1c357ea4b593
2013-02-27Use ref_frame_map vice active_ref_idx on the encoderJohn Koleszar
This patch makes the encoder's use of ref_frame_map and active_ref_idx consistent with the decoder. ref_frame_map[] maps a reference buffer index to its actual location in the yv12_fb array, since many references may share an underlying buffer. active_ref_idx[] mirrors cpi->{lst,gld,alt}_fb_idx, holding the active references in each slot. This also fixes a bug in setup_buffer_inter() where the incorrect reference was used to populate the scaling factors. Change-Id: Id3728f6d77cffcd27c248903bf51f9c3e594287e
2013-02-26Spatial resamping of ZEROMV predictorsJohn Koleszar
This patch allows coding frames using references of different resolution, in ZEROMV mode. For compound prediction, either reference may be scaled. To test, I use the resize_test and enable WRITE_RECON_BUFFER in vp9_onyxd_if.c. It's also useful to apply this patch to test/i420_video_source.h: --- a/test/i420_video_source.h +++ b/test/i420_video_source.h @@ -93,6 +93,7 @@ class I420VideoSource : public VideoSource { virtual void FillFrame() { // Read a frame from input_file. + if (frame_ != 3) if (fread(img_->img_data, raw_sz_, 1, input_file_) == 0) { limit_ = frame_; } This forces the frame that the resolution changes on to be coded with no motion, only scaling, and improves the quality of the result. Change-Id: I1ee75d19a437ff801192f767fd02a36bcbd1d496
2013-02-25vp9: promote gf_group_bits calculation to 64-bitJames Zern
avoids signed integer overflow Change-Id: I9ffcdba90b21edb324d1b173fd11d613e0592931
2013-02-25Minor rate control refactoring and experiments.Paul Wilkins
Some minor refactoring code relating to estimates of bits per MB at a given Q and estimating the allowed Q range. Most of the changes here were included in a previous commit. This commit seeks to separate out the refactoring from more the material changes. Two #define control flags have been added for experimentation. ONE_SHOT_Q_ESTIMATE force the two pass encoder to use its initial Q range estimate for the whole clip even if this results in a miss on the target data rate. In effect this tightens the Q range seen at the expense of rate control accuracy. DISABLE_RC_LONG_TERM_MEM is a related flag that disables the long term memory in the rate control. Local adjustments are still made to try and better hit the rate target on a per frame basis but the impact of rate control misses is not propagated to the remainder of the clip. This means that for example an overshoot early on will not cause frames later in the clip to be starved of bits. Again the result of this relaxation amy be less rate control accuracy especially on short clips. The flags are disabled by default for now. Change-Id: I7482f980146d8ea033b5d50cc689f772e4bd119e