summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_reconinter.c
AgeCommit message (Collapse)Author
2014-01-03Adding RefBuffer struct.Dmitry Kovalev
Adding RefBuffer to simplify reference buffer management. The struct has a pointer to image data and scale factors relative to the current frame. Change-Id: If38eb1491ff687cc11428aee339f3e052e2c5d9e
2013-12-19Using single struct to represent scale factors.Dmitry Kovalev
Moving back to scale_factors struct. We don't need anymore x_offset_q4 and y_offset_q4 because both values are calculated locally inside vp9_scale_mv function. Change-Id: I78a2122ba253c428a14558bda0e78ece738d2b5b
2013-12-19Call set_scaled_offsets() just before scale_mv() call.Dmitry Kovalev
Before mv scaling it is required to calculate x_offset_q4/y_offset_q4 by calling set_scaled_offsets(). Now offset configuration can not be missed because it happens just before scale_mv(). Change-Id: I7dd1a85b85811a6cc67c46c9b01e6ccbbb06ce3a
2013-12-15Merge "Add support to pass in external frame buffers."Frank Galligan
2013-12-15Add support to pass in external frame buffers.Frank Galligan
VP9 decoder can now use frame buffers passed in by the application. Change-Id: I599527ec85c577f3f5552831d79a693884fafb73
2013-12-11Merge "Fix valgrind error."hkuang
2013-12-11Fix valgrind error.hkuang
Temporarily change memcpy to memmove. Change-Id: I700a197bc1ce496be1ddad7118429c5da465b0ca
2013-12-10Refactor inter_predictor function.hkuang
Change-Id: Ic429b2f16462e926f30efb3af4da3080026359d8
2013-12-09Implenment on demand border extension. In place extendhkuang
the border now. Next commit will totally remove the border. Change-Id: Ic1e1ca9cc34f81c688715b3948689b47df63a151
2013-12-05Renaming constants.Dmitry Kovalev
NUM_YV12_BUFFERS => FRAME_BUFFERS ALLOWED_REFS_PER_FRAME => REFS_PER_FRAME NUM_REF_FRAMES_LOG2 => REF_FRAMES_LOG2 NUM_REF_FRAMES => REF_FRAMES NUM_FRAME_CONTEXTS_LOG2 => FRAME_CONTEXTS_LOG2 NUM_FRAME_CONTEXTS => FRAME_CONTEXTS Change-Id: I4e1ada08f25d8fa30fdf03aebe1b1c9df0f87e63
2013-12-04Cleaning up vp9_dec_build_inter_predictors_sb function.Dmitry Kovalev
Using get_plane_block_size() instead of manipulation with subsampling values, calculating all required values only once without redundant calls to b_width_log2(). Change-Id: I00303f2a0926f9c4cb17f34591adda60615f8919
2013-11-25Use separate inter predictors for enc/decJingning Han
The decoder will construct inter predictor using lazy border extension, while the encoder, going with multiple runs of motion search in the rate- distortion optimization loop for each block, does border extension at frame level. This commit makes separate the inter predictors for encoder and decoder, respectively. Change-Id: Ieca2fecba3a7201a6d64ef9f219e5d91e50559c3
2013-11-25Merge "Separate setup_scale_factor/extend_frame_borders"Jingning Han
2013-11-22Separate setup_scale_factor/extend_frame_bordersJingning Han
This commit takes out vp9_extend_frame_borders from vp9_setup_scale_factors. The refactoring is for the preparation of the use of lazy border extension at decoder. This makes it necessary to handle border extension separately at encoder/decoder. The use of vp9_extend_frame_borders will be removed, when lazy border extension is ready. Change-Id: Ia3baba3d179d5f11eee1634f19b3b319d2a59186
2013-11-20Removing plane_block_{width, height} functions.Dmitry Kovalev
Change-Id: I29c0dfcf41a1253d5e2a0d2ff740c0c38ebaa5a2
2013-11-19Move vp9_setup_interp_filter() to encoderYaowu Xu
As it is used in encoder only. Change-Id: I5f2a8abbe72bb18cbf6ce36a3dc7e132aeae8ec2
2013-11-11Removing function pointers from inter prediction.Dmitry Kovalev
Removing foreach_predicted_block_visitor and calling build_inter_predictors directly. Change-Id: I11bb3c872b99b47c2680b01b0dbcc01c558c4a2b
2013-10-29Fix x_offset_q4/y_offset_q4 calculationYunqing Wang
"<< SUBPEL_BITS" needs to be added in the calculation. Call set_scaled_offsets() to calculate x_offset_q4 and y_offset_q4. Change-Id: Ied130ea771510e918f51cd1dc3abe57f4c0962b5
2013-10-24Merge changes I1868fb75,I9ff504c6Dmitry Kovalev
* changes: Renaming INTERPOLATIONFILTERTYPE to INTERPOLATION_TYPE. Adding VP9_FRAME_MARKER constant.
2013-10-23Renaming INTERPOLATIONFILTERTYPE to INTERPOLATION_TYPE.Dmitry Kovalev
Change-Id: I1868fb75ed88bfa65c1c2ca24677d65f2894d713
2013-10-22Improve scale_factors structYunqing Wang
The ref's scale_factors are set at frame level, and then copied for each partition block. Since the struct members are mostly constant, this patch separated the constant and non-constant members, and reduced struct copying. This gave 0.5% ~ 1.4% decoder speed gain. Change-Id: I94043bf5a6995c8042da52e5c661818dfa6f6d4c
2013-10-16Get rid of "this_mi", use "mi_8x8[0]" everywhere insteadGuillaume Martres
The only case where they were intentionally pointing to different structures was in mbgraph, and this didn't have the expected behavior because both of these pointers are used interchangeably through the code Change-Id: I979251782f90885fe962305bcc845bc05907f80c
2013-10-04Cleaning up foreach_predicted_block_in_plane() function.Dmitry Kovalev
Change-Id: Ibb3d9667eba56621667412f62097aa7a392659c2
2013-10-03Adding vp9_get_filter_kernel() function.Dmitry Kovalev
Moving INTERPOLATIONFILTERTYPE enum and subpix_fn_table struct to vp9_filter.h. Adding convenient typedef for subpel kernels. Function vp9_setup_interp_filters() besides setting xd->subpix.filter_x & xd->subpix.filter_y has a side effect of also setting scale factors. This is not required inside decode_modes_b() because scale factors have been already set by set_ref() calls. That's why replacing vp9_setup_interp_filters() call with newly created vp9_get_filter_kernel() call. The behavior of vp9_setup_interp_filters() is unchanged (it is used from the encoder). Change-Id: I3f36d3f7cd8d15195a6e2fafd1777cdaf9ecb847
2013-09-25Using is_inter_block and has_second_ref functions.Dmitry Kovalev
Change-Id: I60dee58a4fd24d3c4f3c101a49d30e217309f43a
2013-09-19fix integer overflow errorsYaowu Xu
Change-Id: I76f440a917832c02d7a727697b225bac66b99f56
2013-09-11New mode_info_context storage -- undo revertScott LaVarnway
mode_info_context was stored as a grid of MODE_INFO structs. The grid now constists of pointers to MODE_INFO structs. The MODE_INFO structs are now stored as a stream (decoder only), eliminating unnecessary copies and is a little more cache friendly. Change-Id: I031d376284c6eb98a38ad5595b797f048a6cfc0d
2013-09-09Revert "New mode_info_context storage"James Zern
This reverts commit dae17734ece414091ba1184f7becd0aa6c0004f1 Encode crashes, leaks and increases integer overflow errors. Change-Id: I595aa2649bb8d0b6552ff91652837a74c103fda2
2013-09-06New mode_info_context storageScott LaVarnway
mode_info_context was stored as a grid of MODE_INFO structs. The grid now constists of a pointer to a MODE_INFO struct and a "in the image" flag. The MODE_INFO structs are now stored as a stream, eliminating unnecessary copies and is a little more cache friendly. For the test clips used, the decoder performance improved by ~4.3% (1080p) and ~9.7% (720p). Patch Set 2: Re-encoded clips with latest. Now ~1.7% (1080p) and 5.9% (720p). Change-Id: I846f29e88610fce2523ca697a9a9ef2a182e9256
2013-08-26Renaming BLOCK_SIZE_TYPE to BLOCK_SIZE in the common/decoder.Dmitry Kovalev
Adding temporary "typedef BLOCK_SIZE BLOCK_SIZE_TYPE" which will go away after encoder's patch. Change-Id: I06ec6a6f079401439843ec981d1496234fd7775c
2013-08-22Checking scale factors on access.Dmitry Kovalev
It is possible to have invalid scale factors and not access them during decoding. Error is reported if we really try to use invalid scale factors. Change-Id: Ie532d3ea7325ee0c7a6ada08269f804350c80fdf
2013-08-22Adding vp9_is_scaled function.Dmitry Kovalev
Change-Id: Ieb7077ca3586b9491912027eed450a4f6fd38d30
2013-08-22Merge "Removing unused foreach_predicted_block function."Dmitry Kovalev
2013-08-21Adding scale factor check.Dmitry Kovalev
We support only [1/16, 2] scale factors, enforcing this now. Change-Id: I0822eb7cea51720df6814e42d3f35ff340963061
2013-08-20Removing unused foreach_predicted_block function.Dmitry Kovalev
Moving foreach_predicted_block_in_plane function to vp9_reconinter.c because there is only one usage. Change-Id: I9852feae43fc3cf809b817fc541d043bc5496209
2013-08-16Removing unused or redundant arguments from *_args structures.Dmitry Kovalev
Redundant dst, pre[2] from build_inter_predictors_args, unused cm from encode_b_args. Change-Id: I2c476cd328c5c0cca4c78ba451ca6ba2a2c37e2d
2013-08-12Removing foreach_predicted_block_uv function.Dmitry Kovalev
Adding function build_inter_predictors_for_planes to build inter predictors for specified planes. This function allows to remove condition "#if CONFIG_ALPHA" and use MAX_MB_PLANE for general case. Renaming 'which_mv' local var to 'ref', and 'weight' argument to 'ref'. Change-Id: I1a97160c9263006929d38953f266bc68e9c56c7d
2013-08-09Moving scale_factors and related code to separate files.Dmitry Kovalev
Change-Id: I531829e5aee2a4a7a112d528ecccbddf052d0e74
2013-08-08Using buf_2d struct instead of separate buffer and stride vars.Dmitry Kovalev
Change-Id: Id5cc3566cc16d1e3030ddb4d1c58459320321dca
2013-08-07Cleanup inside vp9_reconinter.c.Dmitry Kovalev
Using block width and block height instead of their logarithms. Using SUBPEL_BITS and SUBPEL_SHIFTS constants instead of magic numbers. Change-Id: I4e10e93c907c8a5e1cb27dfe74d1fcdcc4995448
2013-08-06Using only one scale function in scale_factors struct.Dmitry Kovalev
Functions scale_mv_q4 and scale_mv_q3_to_q4 were almost identical except q3->q4 conversion in scale_mv_q3_to_q4. Now q3->q4 conversion happens directly in vp9_build_inter_predictor. Also adding useful constants: SUBPEL_BITS and SUBPEL_MASK. Change-Id: Ia0a6ad2ac07c45fdf95a5139ece6286c035e9639
2013-08-05Finally removing all old block size constants.Dmitry Kovalev
Change-Id: I3aae21e88b876d53ecc955260479980ffe04ad8d
2013-08-02Cleaning up vp9_build_inter_predictor function.Dmitry Kovalev
Change-Id: I94f6b4272b95ac101de6d10f048116ba065788b0
2013-08-02Changing function arg type from int_mv* to MV*.Dmitry Kovalev
Change-Id: Ic878d31df2ce783a2c9a8c4bc9ed301ec8ffe25e
2013-08-01Cleanup: reusing clamp_mv function.Dmitry Kovalev
Change-Id: I8715f08a3554bdb557c5f935f1dfbd671f18e766
2013-07-26Cleanup: replacing xd->mode_info_context with temp variable.Dmitry Kovalev
Change-Id: I5a3e83102784cabb918a5404405fcab99c5bb9b6
2013-07-25General cleanups.Dmitry Kovalev
Removing unused constants, macros, and function declarations. Using ROUND_POWER_OF_TWO macro, vp9_zero, vp9_copy where possible. Moving #include from *.h to *.c. Merging for loops for motion vectors. Change-Id: Ic3bf841764a2bb177128bb3a6d7aa8f68229cd13
2013-07-18Merge scale_factors and scale_factors_uv.Ronald S. Bultje
This prevents a duplicate memcpy of a 128-byte struct every time set_scale_factors() is called (which is a lot), thus leading to a decrease from 3.7 MB to 1.85 MB of struct copying per 64x64 block RD/partition loop. Overall, this decreases encoding time of the first 50 frames of bus @ 1500kbps (speed 0) from 1min5.9 to 1min4.9, i.e. about a 1.5% overall speedup. We can likely get more gains by removing the copy of the other struct (and replacing it with an indexing) as well. Change-Id: I3dceb7e79f71e6fe911b11cc994cf89a869dde7a
2013-07-15Change to extend full border only when neededYaowu Xu
This is a short term optimization till we work out a decoder implementation requiring no frame border extension. Change-Id: I02d15bfde4d926b50a4e58b393d8c4062d1be70f
2013-07-10Replace copy_memNxM functions with a generic copy/avg function.Ronald S. Bultje
Change-Id: I3ce849452ed4f08527de9565a9914d5ee36170aa