summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_reconinter.c
AgeCommit message (Collapse)Author
2013-06-10Fixed point reference picture scalingTero Rintaluoma
Fixed point scaling factors are calculated once for each reference frame by using integer division. Otherwise fixed point scaling routines are used in all scaling calculations. This makes it possible to calculate fixed point scaling factors on device driver software and pass them to hardware and thus avoid division on hardware. TODO: - Missing check for maximum frame dimensions (currently scaling uses 14 bits) - Missing check for maximum scaling ratio (upscaling 16:1, downscaling 2:1) Problems: - Straightforward fixed point implementation can cause error +-1 compared to integer division (i.e. in x_step_q4). Should only be an issue for frames larger than 16k. Change-Id: I3cf4dabd610a4dc18da3bdb31ae244ebaf5d579c
2013-06-06Change ref frame coding.Ronald S. Bultje
Code intra/inter, then comp/single, then the ref frame selection. Use contextualization for all steps. Don't code two past frames in comp pred mode. Change-Id: I4639a78cd5cccb283023265dbcc07898c3e7cf95
2013-05-31Merge "Adding plane_block_width and plane_block_height functions." into ↵Dmitry Kovalev
experimental
2013-05-31Renaming 'motion_vector' to 'mv' for consistency.Dmitry Kovalev
Change-Id: Ie869ea4992e26867caec46cb878fc86a646aeb9f
2013-05-31Adding plane_block_width and plane_block_height functions.Dmitry Kovalev
Change-Id: I02c17fb733c0f3c22dc3167c3d3182797415f1ae
2013-05-30Remove splitmv.Ronald S. Bultje
We leave it in rdopt.c as a local define for now - this can be removed later. In all other places, we remove it, thereby slightly decreasing the size of some arrays in the bitstream. Change-Id: Ic2a9beb97a4eda0b086f62c039d994b192f99ca5
2013-05-16Initial version of alpha channel supportJohn Koleszar
This is a mostly-working implementation of an extra channel in the bitstream. Configure with --enable-alpha to test. Notable TODOs: - Add extra channel to all mismatch tests, PSNR, SSIM, etc - Configurable subsampling - Variable number of planes (currently always uses all 4) - Loop filtering - Per-plane lossless quantizer - ARNR support This implementation just uses the same contents as the Y channel for the A channel, due to lack of content and general pain in playing back 4 channel content. A later patch will use the actual alpha channel passed in from outside the codec. Change-Id: Ibf81f023b1c570bd84b3064e9b4b8ae52e087592
2013-05-15Moving the same code to new function vp9_setup_scale_factors.Dmitry Kovalev
Change-Id: I2408ad22717784a40e23701ccb9d978265440e4f
2013-05-14Moving several static functions from vp9_reconinter.h to vp9_reconinter.c.Dmitry Kovalev
Change-Id: I5da9c16bab26f6ff0c9d3a2a29ef6c84f5093161
2013-05-09Fix non-4:2:0 chroma MV calculation for SPLITMVJohn Koleszar
The previous code was somewhat vestigial for 16x16 MI units, but was incorrect when called with chroma blocks larger than 4x4 because the block index caused a reference to a non-existent BMI. This patch uses the same MV for all chroma subblocks in SPLITMV mode, which is suboptimal for non-4:2:0 subsamplings, but as SPLITMV may be removed in the near future, will use this as a stop gap. Change-Id: I3211cee5ccf1cfb426e5eef5353b0ce5bb92b4cd
2013-05-08Eliminating several YV12_BUFFER_CONFIG usages.Dmitry Kovalev
Change-Id: Ia85b987c935d545920dcae5a6f44136b1a08a008
2013-05-07Deprecate comp_interintra_pred experiment.Paul Wilkins
Delete code under the CONFIG_COMP_INTERINTRA_PRED flag. Change-Id: I3d1079cf46305c08f7e11d738596ea112e7b547f
2013-05-07Remove enable_6tap filter experiment.Paul Wilkins
Clean out code under CONFIG_ENABLE_6TAP flag. Change-Id: Ic45b624081181027d6ba24d55dd644c3197f9830
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-04-30sb8x8 integration in rd loop.Ronald S. Bultje
Work-in-progress, not yet ready for review. TODO items: - bitstream writing (encoder) and reading (decoder) - decoder reconstruction Change-Id: I5afb7284e7e0480847b47cd0097cb469433c9081
2013-04-26Grow MODE_INFO array to use an 8x8 basis.Ronald S. Bultje
Change-Id: I087e08e7909a406b71715b8525c104208daa6889
2013-04-26Removed bmi from blockdScott LaVarnway
This originally was "Removed update_blockd_bmi()". Now, this patch removed bmi from blockd and uses the bmi found in mode_info_context. Eliminates unnecessary bmi copies between blockd and mode_info_context. Change-Id: I287a4972974bb363f49e528daa9b2a2293f4bc76
2013-04-25Merge "Removing unused mi_mv_pred_row and mi_mv_pred_col functions." into ↵Dmitry Kovalev
experimental
2013-04-23Removing unused mi_mv_pred_row and mi_mv_pred_col functions.Dmitry Kovalev
Change-Id: If8ba37bf0b86e8dea88c27d911e8ddb0f6d5a3c5
2013-04-23Enable rectangular support for comp inter-intraJingning Han
This commit enables rectangular block prediction of compound inter-intra mode. It combines the mb/sb32/sb64 prediction functions into a unified version with configurable block width and height. This fixes the enc/dec mismatch of the codebase when comp-interintra-pred is enabled. Change-Id: I1d0db2f1f184007802df04fcd12b9dadb3189ff0
2013-04-22Removing the implicit compound inter experimentDeb Mukherjee
Removing this experiment for now, since it has been broken with the latest code changes. Change-Id: I1be2181b56de490fcb577f5905b5e147a8ed82d8
2013-04-22Move pre, second_pre to per-plane MACROBLOCKD dataJohn Koleszar
Continue moving framebuffers to per-plane data. Change-Id: I237e5a998b364c4ec20316e7249206c0bff8631a
2013-04-22reconinter: remove unnecessary functions, paramsJohn Koleszar
Removes the redundant dst pointers from vp9_build_inter_predictors_sb{y,uv} and the remaining mb specific functions. Change-Id: I7b6bf439d9394b85ea79b4fe61a3ffc1025720da
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-19make build_inter_predictors block size agnostic (split)John Koleszar
All build_inter_predictors can now be serviced by the same inner function. Change-Id: I40b08bee8f047286db4b1aad9dcae37b879c3f2a
2013-04-19Removing rounding from UV MV calculation for SPLITMVJohn Koleszar
Similar to the prior change that removed the rounding from non-SPLITMV modes. Improves quality by a similar amount (Additional +0.087% on derf) Change-Id: I39d80b4a3037a3aa7e285eb2320346ddaf646f52
2013-04-18make buid_inter_predictors block size agnostic (chroma)John Koleszar
Updates to make non-SPLITMV inter predictors work for all plane types. Change-Id: I25dbef40b7ffcac30254b43eed1e22fc732378ae
2013-04-18Removing rounding from UV MV calculationJohn Koleszar
Consider the previous behavior for the MV 1 3/8 (11/8 pel). In the existing code, the fractional part of the MV is considered separately, and rounded is applied, giving a result of 6/8. Rounding is not required in this case, as we're increasing the precision from a q3 to a q4, and the correct value 11/16 can be represented exactly. Slight gain observed (+.033 average on derf) Change-Id: I320e160e8b12f1dd66aa0ce7966b5088870fe9f8
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-18Make the use of pred buffers consistent in MB/SBJingning Han
Use in-place buffers (dst of MACROBLOCKD) for macroblock prediction. This makes the macroblock buffer handling consistent with those of superblock. Remove predictor buffer MACROBLOCKD. Change-Id: Id1bcd898961097b1e6230c10f0130753a59fc6df
2013-04-17Fix edge bug in recent merge of 64x64 and 32x32 inter predictors.Ronald S. Bultje
Change-Id: I83aa188d414922db19cccb210c4001c02d5a404c
2013-04-16Optimize the scaling calculationYunqing Wang
In decoder, the scaling calculation, such as (mv * x_num / x_den), is fairly time-consuming. In this patch, we check if the scaling happens or not at frame level, and then decide which function to call to skip scaling calculation when no scaling is needed. Tests showed a 3% decoder performance gain. Change-Id: I270901dd0331048e50368cfd51ce273dd82b8733
2013-04-12Enable inter predictor for rectangular block sizeJingning Han
Combine superblock inter predictors into a unified function that allows configurable block width and height. The inter predictions of block sizes smaller than 16x16 are handled differently. To be continued on merging them later. Change-Id: I14075959dd5e221f00c205c99ca35c1c31ef728e
2013-04-11WIP: removing predictor buffer usage from decoderScott LaVarnway
This patch will use the dest buffer instead of the predictor buffer. This will allow us in future commits to remove the extra mem copy that occurs in the dequant functions when eob == 0. We should also be able to remove extra params that are passed into the dequant functions. Change-Id: I7241bc1ab797a430418b1f3a95b5476db7455f6a
2013-04-08Fix typo which breaks 4x4 splitmv compound prediction RD code.Ronald S. Bultje
0.15% quality increase on derf, particularly noticeable on hard clips at the higher bitrate end. Change-Id: I02415a96eb9bbc361cba923069625fae71844bc9
2013-04-05Remove full-pixel-related code.Ronald S. Bultje
This is a VP8-only feature (part of profile 3) that is unsupported in VP9. Change-Id: I78016eede8d9c834d44d4c517f3e8b8fc2a378b1
2013-04-03Modify vp9_setup_interp_filters functionYunqing Wang
Took vp9_setup_scale_factors_for_frame() out from vp9_setup_interp_filters(), so that it is only called once per frame instead of per macroblock. Decoder tests showed a 1.5% performance gain. Change-Id: I770cb09eb2140ab85132f82aed388ac0bdd3a0aa
2013-04-01Merge "Removing redundant function arguments." into experimentalJohn Koleszar
2013-03-27Removing redundant function arguments.Dmitry Kovalev
Almost all arguments for vp9_build_inter32x32_predictors_sb and vp9_build_inter64x64_predictors_sb can be deduced from the first macroblock argument. Change-Id: I5d477a607586d05698d5b3b9b9bc03891dd3fe83
2013-03-27Extracting common motion vector prediction code.Dmitry Kovalev
Adding b_mv_pred_row and b_mv_pred_col functions, updating mi_mv_pred_row and mi_mv_pred_row functions. Change-Id: I9af068442d4474478375943cc6fce1605d6fc0a5
2013-03-26Implicit weighted prediction experimentDeb Mukherjee
Adds an experiment to use a weighted prediction of two INTER predictors, where the weight is one of (1/4, 3/4), (3/8, 5/8), (1/2, 1/2), (5/8, 3/8) or (3/4, 1/4), and is chosen implicitly based on consistency of the predictors to the already reconstructed pixels to the top and left of the current macroblock or superblock. Currently the weighting is not applied to SPLITMV modes, which default to the usual (1/2, 1/2) weighting. However the code is in place controlled by a macro. The same weighting is used for Y and UV components, where the weight is derived from analyzing the Y component only. Results (over compound inter-intra experiment) derf: +0.18% yt: +0.34% hd: +0.49% stdhd: +0.23% The experiment suggests bigger benefit for explicitly signaled weights. Change-Id: I5438539ff4485c5752874cd1eb078ff14bf5235a
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-13Fix pulsing issue with scalingJohn Koleszar
Updates the YV12_BUFFER_CONFIG structure to be crop-aware. The exiting width/height parameters are left unchanged, storing the width and height algined to a 16 byte boundary. The cropped dimensions are added as new fields. This fixes a nasty visual pulse when switching between scaled and unscaled frame dimensions due to a mismatch between the scaling ratio and the 16-byte aligned sizes. Change-Id: Id4a3f6aea6b9b9ae38bdfa1b87b7eb2cfcdd57b6
2013-03-12fix an assumption about uv_strideJohn Koleszar
Use the uv_stride from the framebuffer rather than deriving it from the y_stride. Change-Id: I94581cb741539d094ff062b3d008235556903b8c
2013-03-01Code cleanup and simplification of build_4x4uvmvs function.Dmitry Kovalev
Change-Id: Iab0176f058045181821ded95ff1cf423af1625f9
2013-02-27Use 256-byte aligned filter tablesJohn Koleszar
This avoids duplicating all the filters twice. Includes fixups to the convolve routines and associated tests to make this work. Change-Id: I922f86021594e55072ddb63b42b2313605db6e00
2013-02-27Set scale factors consistently for SPLITMVJohn Koleszar
This commit updates the 4x4 prediction to consistently use the build_2x1_inter_predictor() method. That function is updated to calculate the scale offset, rather than relying on the caller to calculate it. In the case that the 2x1 prediction can not be used, the scale offset is recalculated for each 1x1 block. The idea here is that the offsets are calculated before each call to vp9_build_scaled_inter_predictor(). Change-Id: I0ac3343dd54e2846efa3c4195fcd328b709ca04d
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-26Refactor inter recon functions to support scalingJohn Koleszar
Ensure that all inter prediction goes through a common code path that takes scaling into account. Removes a bunch of duplicate 1st/2nd predictor code. Also introduces a 16x8 mode for 8x8 MVs, similar to the 8x4 trick we were doing before. This has an unexpected effect with EIGHTTAP_SMOOTH, so it's disabled in that case for now. Change-Id: Ia053e823a8bc616a988a0af30452e1e75a739cba
2013-02-08Replace as_mv struct with arrayJohn Koleszar
Replace as_mv.{first, second} with a two element array, so that they can easily be processed with an index variable. Change-Id: I1e429155544d2a94a5b72a5b467c53d8b8728190