Граф коммитов

81 Коммитов

Автор SHA1 Сообщение Дата
Dmitry Kovalev 76d166e413 Removing foreach_predicted_block_uv function.
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-12 13:54:13 -07:00
Dmitry Kovalev 8ffe85ad00 Moving scale_factors and related code to separate files.
Change-Id: I531829e5aee2a4a7a112d528ecccbddf052d0e74
2013-08-09 14:07:09 -07:00
Dmitry Kovalev 6fd2407035 Using buf_2d struct instead of separate buffer and stride vars.
Change-Id: Id5cc3566cc16d1e3030ddb4d1c58459320321dca
2013-08-08 21:25:48 -07:00
Dmitry Kovalev a766d8918e Cleanup inside vp9_reconinter.c.
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-07 17:02:28 -07:00
Dmitry Kovalev 1c552e79bd Using only one scale function in scale_factors struct.
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-06 15:43:56 -07:00
Dmitry Kovalev b9c7d04e95 Finally removing all old block size constants.
Change-Id: I3aae21e88b876d53ecc955260479980ffe04ad8d
2013-08-05 15:23:49 -07:00
Dmitry Kovalev 5f0a52faaf Cleaning up vp9_build_inter_predictor function.
Change-Id: I94f6b4272b95ac101de6d10f048116ba065788b0
2013-08-02 16:53:18 -07:00
Dmitry Kovalev 25b77e2569 Changing function arg type from int_mv* to MV*.
Change-Id: Ic878d31df2ce783a2c9a8c4bc9ed301ec8ffe25e
2013-08-02 15:26:32 -07:00
Dmitry Kovalev 422d38bca1 Cleanup: reusing clamp_mv function.
Change-Id: I8715f08a3554bdb557c5f935f1dfbd671f18e766
2013-08-01 15:06:34 -07:00
Dmitry Kovalev cc0ff7ecfa Cleanup: replacing xd->mode_info_context with temp variable.
Change-Id: I5a3e83102784cabb918a5404405fcab99c5bb9b6
2013-07-26 19:05:37 -07:00
Dmitry Kovalev 7131cb0e3d General cleanups.
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-25 14:13:48 -07:00
Ronald S. Bultje 5ebe503f04 Merge scale_factors and scale_factors_uv.
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-18 14:10:56 -07:00
Yaowu Xu 5b915ebd92 Change to extend full border only when needed
This is a short term optimization till we work out a decoder
implementation requiring no frame border extension.

Change-Id: I02d15bfde4d926b50a4e58b393d8c4062d1be70f
2013-07-15 20:52:13 -07:00
Ronald S. Bultje decead7336 Replace copy_memNxM functions with a generic copy/avg function.
Change-Id: I3ce849452ed4f08527de9565a9914d5ee36170aa
2013-07-10 18:27:24 -07:00
Jim Bankoski 6591cf2f7e remove warnings when NDEBUG is set
Change-Id: Ie0cb732fdcb98616a422c4463bff80642248d136
2013-07-10 14:27:20 -07:00
Ronald S. Bultje 5b87240230 Remove unused function vp9_build_inter4x4_predictors_mbuv().
Change-Id: Ibfd2def2c088f4bc541a1de25990d73480b53d4b
2013-07-02 16:34:24 -07:00
Dmitry Kovalev 3231da0a9e Decoder's code cleanup.
Using vp9_set_pred_flag function instead of custom code, adding
decode_tokens function which is now called from decode_atom,
decode_sb_intra, and decode_sb.

Change-Id: Ie163a7106c0241099da9c5fe03069bd71f9d9ff8
2013-06-27 16:15:43 -07:00
Dmitry Kovalev f27f76dfb3 Transforming scale_mv_component_q4 into scale_mv_q4 function.
Using MV instead of int_mv for function arguments.

Change-Id: Ic25e13dccbc98fac1fa1b3255127e00cca2a57f6
2013-06-21 15:34:29 -07:00
Tero Rintaluoma 86bb6df005 Fixed point reference picture scaling
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-10 08:07:55 -07:00
Ronald S. Bultje 6ef805eb9d Change ref frame coding.
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-06-06 17:28:09 -07:00
Dmitry Kovalev 317d832d38 Merge "Adding plane_block_width and plane_block_height functions." into experimental 2013-05-31 15:28:45 -07:00
Dmitry Kovalev d771bba27e Renaming 'motion_vector' to 'mv' for consistency.
Change-Id: Ie869ea4992e26867caec46cb878fc86a646aeb9f
2013-05-31 12:32:53 -07:00
Dmitry Kovalev 120a878199 Adding plane_block_width and plane_block_height functions.
Change-Id: I02c17fb733c0f3c22dc3167c3d3182797415f1ae
2013-05-31 12:31:49 -07:00
Ronald S. Bultje e6485581fe Remove splitmv.
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-30 17:21:01 -07:00
John Koleszar 679e4abdd5 Initial version of alpha channel support
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-16 22:21:09 -07:00
Dmitry Kovalev 5c5582242d Moving the same code to new function vp9_setup_scale_factors.
Change-Id: I2408ad22717784a40e23701ccb9d978265440e4f
2013-05-15 16:33:36 -07:00
Dmitry Kovalev 6706e674b1 Moving several static functions from vp9_reconinter.h to vp9_reconinter.c.
Change-Id: I5da9c16bab26f6ff0c9d3a2a29ef6c84f5093161
2013-05-14 17:49:41 -07:00
John Koleszar a37ee9d2e8 Fix non-4:2:0 chroma MV calculation for SPLITMV
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-09 20:14:39 -07:00
Dmitry Kovalev 81f33bc091 Eliminating several YV12_BUFFER_CONFIG usages.
Change-Id: Ia85b987c935d545920dcae5a6f44136b1a08a008
2013-05-08 14:11:47 -07:00
Paul Wilkins 1ed57a6a62 Deprecate comp_interintra_pred experiment.
Delete code under the CONFIG_COMP_INTERINTRA_PRED
flag.

Change-Id: I3d1079cf46305c08f7e11d738596ea112e7b547f
2013-05-07 16:24:08 -07:00
Paul Wilkins 0bfcd30768 Remove enable_6tap filter experiment.
Clean out code under CONFIG_ENABLE_6TAP flag.

Change-Id: Ic45b624081181027d6ba24d55dd644c3197f9830
2013-05-07 16:13:02 -07:00
Jingning Han 776c1482a3 Merge SB8X8 into the codebase
Pull sb8x8 out of experimental list. verified via borg run tests.
Fixed unit test failures.

Change-Id: I12a4bbd17395930580c048ab68becad1ffe46e76
2013-05-07 09:08:25 -07:00
Ronald S. Bultje d068d869b9 sb8x8 integration in rd loop.
Work-in-progress, not yet ready for review. TODO items:
- bitstream writing (encoder) and reading (decoder)
- decoder reconstruction

Change-Id: I5afb7284e7e0480847b47cd0097cb469433c9081
2013-04-30 16:13:20 -07:00
Ronald S. Bultje 1a46b30ebe Grow MODE_INFO array to use an 8x8 basis.
Change-Id: I087e08e7909a406b71715b8525c104208daa6889
2013-04-26 11:57:17 -07:00
Scott LaVarnway 57f180b388 Removed bmi from blockd
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-26 10:19:43 -04:00
Dmitry Kovalev 2cf0675a52 Merge "Removing unused mi_mv_pred_row and mi_mv_pred_col functions." into experimental 2013-04-25 10:18:07 -07:00
Dmitry Kovalev 9828a33ebb Removing unused mi_mv_pred_row and mi_mv_pred_col functions.
Change-Id: If8ba37bf0b86e8dea88c27d911e8ddb0f6d5a3c5
2013-04-23 16:34:22 -07:00
Jingning Han a26c1edbb4 Enable rectangular support for comp inter-intra
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-23 15:39:19 -07:00
Deb Mukherjee 735febf1ce Removing the implicit compound inter experiment
Removing this experiment for now, since it has been broken with
the latest code changes.

Change-Id: I1be2181b56de490fcb577f5905b5e147a8ed82d8
2013-04-22 16:46:54 -07:00
John Koleszar a443447b8b Move pre, second_pre to per-plane MACROBLOCKD data
Continue moving framebuffers to per-plane data.

Change-Id: I237e5a998b364c4ec20316e7249206c0bff8631a
2013-04-22 12:05:24 -07:00
John Koleszar 6d5ac8f2e1 reconinter: remove unnecessary functions, params
Removes the redundant dst pointers from vp9_build_inter_predictors_sb{y,uv}
and the remaining mb specific functions.

Change-Id: I7b6bf439d9394b85ea79b4fe61a3ffc1025720da
2013-04-22 08:20:54 -07:00
John Koleszar d12376aa2c Move dst to per-plane MACROBLOCKD data
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-19 16:16:10 -07:00
John Koleszar 0053b46d51 make build_inter_predictors block size agnostic (split)
All build_inter_predictors can now be serviced by the same inner
function.

Change-Id: I40b08bee8f047286db4b1aad9dcae37b879c3f2a
2013-04-19 10:29:42 -07:00
John Koleszar e0df9b213d Removing rounding from UV MV calculation for SPLITMV
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-19 10:23:26 -07:00
John Koleszar fc49a377d7 make buid_inter_predictors block size agnostic (chroma)
Updates to make non-SPLITMV inter predictors work for all
plane types.

Change-Id: I25dbef40b7ffcac30254b43eed1e22fc732378ae
2013-04-18 17:50:22 -07:00
John Koleszar 2987fa1dc1 Removing rounding from UV MV calculation
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-18 17:47:17 -07:00
John Koleszar 4924934d2b make buid_inter_predictors block size agnostic (luma)
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-18 17:42:55 -07:00
Jingning Han 6f43ff5824 Make the use of pred buffers consistent in MB/SB
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-18 14:59:36 -07:00
Ronald S. Bultje d63826ac12 Fix edge bug in recent merge of 64x64 and 32x32 inter predictors.
Change-Id: I83aa188d414922db19cccb210c4001c02d5a404c
2013-04-17 16:12:02 -07:00
Yunqing Wang 148eb803bb Optimize the scaling calculation
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-16 08:52:40 -07:00