Commit Graph

1050 Commits

Author SHA1 Message Date
Dmitry Kovalev
66307bf2c8 Moving costs from MACROBLOCK to VP9_COMP.
Change-Id: I61471dd0f77d1547abec13cbf9670e1c4eb9131a
2014-05-01 16:12:23 -07:00
Adrian Grange
0423a96469 Fix mode selection bug when ARNR filtering disabled
When ARNR filtering is disabled, by setting
arnr_max_frames=0, mode_skip_mask was being set to
-1 for the ARF frame resulting in no mode being
selected for the block.

The intent is to restrict the reference frame to the
previous ARF frame and the mode to one of ZEROMV,
NEARMV or NEARESTMV.

Change-Id: Ifc3920b153142cd01d422910c94d2f20ffb6f129
2014-05-01 14:38:58 -07:00
Dmitry Kovalev
dd1a393624 Replacing int_mv with MV.
Change-Id: Idccb530c814cb8a2fb9f7d0c11eaef25044efe5e
2014-04-30 15:50:13 -07:00
Dmitry Kovalev
4788d4534c Removing MODE_TEST_HIT_STATS.
It seems nobody uses it now.

Change-Id: Ided479cb7f5023559efc8f102ecead43884f4441
2014-04-30 14:17:05 -07:00
Dmitry Kovalev
e608418899 Renaming MB_PREDICTION_MODE to PREDICTION_MODE.
Actually, it would be great to have two separate enums INTRA_MODES and
INTER_MODES in future.

Change-Id: I6c4147cf0002853da9c1e03fe9514eab876f01c8
2014-04-22 17:48:31 -07:00
Dmitry Kovalev
ef003078e8 Renaming "onyx" to "encoder".
Actual renames:
  vp9_onyx_if.c -> vp9_encoder.c
  vp9_onyx_int.h -> vp9_encoder.h

Change-Id: I80532a80b118d0060518e6c6a0d640e3f411783c
2014-04-22 14:57:05 -07:00
Dmitry Kovalev
ece689650a Merge "Cleaning up vp9_rdopt.c." 2014-04-21 10:41:04 -07:00
Dmitry Kovalev
d5d26f7692 Cleaning up vp9_rdopt.c.
Change-Id: Ifd008968326e61ab492162351e358bf0ac0dac0a
2014-04-18 16:56:43 -07:00
Dmitry Kovalev
76d58ba414 Moving set_rd_speed_thresholds{,_sub8x8} to vp9_rdopt.{h, c}.
Change-Id: I983364b33e8f103b43a0448821e890989176f1cc
2014-04-18 16:34:01 -07:00
Dmitry Kovalev
69b88df206 Merge "Adding is_best_mode() function." 2014-04-17 18:26:54 -07:00
Jim Bankoski
1355af5c42 Merge "rename labels2mode because it was a terrible name." 2014-04-17 15:42:41 -07:00
Jim Bankoski
209d348c92 Merge "renamed pick_best_mbsegmentation and remove rd_check_segment_txsize" 2014-04-17 15:42:36 -07:00
Jim Bankoski
d9db2aa12a Merge "rename mode_index to ref index in vp9_rd_pick_inter_mode_sub_8x8" 2014-04-17 15:42:27 -07:00
Dmitry Kovalev
52549b4e78 Adding is_best_mode() function.
Change-Id: Idca7c1cd8a12df465c58b6ba064a99404b3b4bce
2014-04-17 15:09:55 -07:00
Jim Bankoski
d3ccf55674 rename labels2mode because it was a terrible name.
Change-Id: I2d577d11966fcc5ffaaf0896bf51d18078ad1e9c
2014-04-17 13:48:54 -07:00
Jim Bankoski
fba9b09f7e renamed pick_best_mbsegmentation and remove rd_check_segment_txsize
Change-Id: Ia7d33bc3eb595965bccf4b2231df1e3b2a0243c6
2014-04-17 09:11:23 -07:00
Jim Bankoski
5c28d1a1f0 rename mode_index to ref index in vp9_rd_pick_inter_mode_sub_8x8
Change-Id: I00bceb9de2009963c91e5102564c05c31ac1ad78
2014-04-17 08:40:47 -07:00
Dmitry Kovalev
2c8c1f5370 Replacing cpu_used with speed in VP9_CONFIG.
Change-Id: I86b85b5c11388e84a48f8936330c0d920df5d1f0
2014-04-16 18:31:42 -07:00
Alex Converse
0d8e4f91a2 Unfork rd_thresh sub8x8.
Remove duplicate rd_thresh code introduced when vp9_rd_pick_inter_mode_sub8x8()
was forked from vp9_rd_pick_inter_mode_sb().

Change-Id: I3c9b7143d182e1f28b29c16518eaca81dc2ecfed
2014-04-16 10:23:37 -07:00
Dmitry Kovalev
f3739f9052 Consistent mode names.
Change-Id: Icb4851d98c951506fe5d73d8d5a8ac7e53fecfd0
2014-04-14 14:09:39 -07:00
Dmitry Kovalev
07dddfa3fd Merge "Cleaning up check_best_zero_mv()." 2014-04-14 10:33:43 -07:00
Dmitry Kovalev
1f58f9d092 Fixing error found by ioc.
vp9/encoder/vp9_rdopt.c:3913:44: runtime error: index -1 out of bounds for
type 'RefBuffer [3]'.

Change-Id: Ic0ec755328853b359e3a1ee84d319589183e38b7
2014-04-11 17:14:15 -07:00
Dmitry Kovalev
35a63b7c0f Cleaning up check_best_zero_mv().
Change-Id: I5c450a4932fb4f20449487596932458ee3b48ae0
2014-04-11 14:32:07 -07:00
Dmitry Kovalev
6653bf7178 Merge "Adding RD_OPT struct." 2014-04-11 14:08:16 -07:00
Dmitry Kovalev
1ff4aa33de Adding RD_OPT struct.
Change-Id: I2d1b5c1481aefe226082e1f096ca9edd340d4d31
2014-04-11 10:58:37 -07:00
Dmitry Kovalev
63fa722179 Removing unused cost arguments from mcomp functions.
Change-Id: Id81a76d18be6b2de69f81bb563d74c3bb356d434
2014-04-11 10:24:36 -07:00
Dmitry Kovalev
73aa5b7656 Replacing int_mv with MV.
Change-Id: I1020dec1ac2e9404a8efcc04681a050417b8b065
2014-04-10 23:48:09 -07:00
Alex Converse
67affd9ec9 Merge "Remove vestiges of large tx sizes in sub8x8 code." 2014-04-10 11:13:50 -07:00
Alex Converse
6a9b44c281 Merge "Cleanup table declarations in vp9_rdopt." 2014-04-10 11:13:44 -07:00
Yaowu Xu
675d95f9d9 Merge "Prevent the usage of invalid best_mode_index" 2014-04-10 09:04:10 -07:00
Alex Converse
dad9e4abaa Remove vestiges of large tx sizes in sub8x8 code.
Change-Id: I27015ed57b4c4390cfde3d0eecd82c3e76fd3786
2014-04-09 18:43:29 -07:00
Yaowu Xu
1dcc1aa942 Prevent the usage of invalid best_mode_index
This commit changed the initialization of best_mode_index to -1 to make
sure it is not mistakenly used for mode masking.

Change-Id: I75b05db51466070dd23c4ee57a4d4b40764dc019
2014-04-09 17:56:06 -07:00
Alex Converse
71ffc7d7ff Merge "Remove unused tile arguments from vp_rdopt." 2014-04-09 16:45:46 -07:00
Alex Converse
1eee13c0ab Merge "Cleanup vp9_rd_pick_inter_mode_sub8x8()." 2014-04-09 16:45:41 -07:00
Yaowu Xu
2dc92482d0 Merge "Fix the setting of mode_skip_mask" 2014-04-09 14:29:23 -07:00
Alex Converse
666ecf21df Cleanup table declarations in vp9_rdopt.
Change-Id: Ia4bef41a6b0252593ad84612a2a143c724fd03ea
2014-04-09 14:22:39 -07:00
Alex Converse
3ab4d57196 Remove unused tile arguments from vp_rdopt.
Change-Id: I721ff26e3d5dbef80b8cd2dd562adae3748f6687
2014-04-09 11:48:30 -07:00
Alex Converse
dcb5157608 Cleanup vp9_rd_pick_inter_mode_sub8x8().
Change-Id: I9be2e4e9aeda0fae6dc946deae2999be51daebe0
2014-04-09 11:48:24 -07:00
Yaowu Xu
4f95a7fe3e Fix the setting of mode_skip_mask
In mode selection loop, once mode_index pass mode_skip_start, all
modes with a different reference frame from current best mode are
masked out using mode_skip_mask.

However, the setting of mode_skip_mask may use an invalid mode if
there is no mode tested yet. This commit fixes the issue by making
sure a mode has been tested and selected. Otherwise, no mode will be
masked out because of their reference frame.

Change-Id: Ib0009e8a96836a65cf5347440fff8a2e1a67f29f
2014-04-09 11:42:28 -07:00
Jingning Han
06ec873f2c Select prediction filter type in non-RD mode decision
This commit allows the non-RD mode decision flow to  select
prediction filter type in NEWMV mode. It provides 8.14% compression
performance gains in both settings of AQ=0 and 3. The current speed
impact is about 5% to 10% slower.

Change-Id: Id66ecebf77abd8f90fb3f6a066c0e8dfb4bf1c42
2014-04-08 16:47:42 -07:00
Dmitry Kovalev
a9f324fa7f Removing interp_kernel from MACROBLOCKD.
Now interp_kernel is obtained when it is really required (based on
mbmi->interp_filter value).

Change-Id: I4c7a93c179d1045eba16e7526c293d02c9b8b47e
2014-04-03 15:28:42 -07:00
Dmitry Kovalev
86f44a91f4 Renaming two members in MACROBLOCKD struct.
Renames:
  mi_8x8 -> mi
  mode_info_stride -> mi_stride

Change-Id: I66f3e5fd1e7b7f46f108af5bb711c5fd9493c1be
2014-04-01 17:46:40 -07:00
Alex Converse
79e68bce8a Remove a duplicate block_size variable.
Change-Id: Ia6b1e3c5a8ac21219bbfe9eecdb4801f3eaa10e5
2014-03-27 14:01:11 -07:00
Dmitry Kovalev
0abe813c0e Moving thresh_mult{,_sub8x8} from SPEED_FEATURES to VP9_COMP.
SPEED_FEATURES should contain only configuration parameters.

Change-Id: I7d6d0636879c3e87dad09bc9455c1cf1dc039da8
2014-03-26 11:29:10 -07:00
Alex Converse
9fe1450da3 Refactor out zero motion vector equivalence.
Change-Id: I6b20248b6f76545356f910ca6386f5466e287b6e
2014-03-25 14:17:55 -07:00
Alex Converse
de3fc51712 Add consts to cost_mv_ref.
Change-Id: Ie5dadb5c2bcfe80a703edb58a71dc453644c9ade
2014-03-25 14:17:55 -07:00
Dmitry Kovalev
6b32e5f04a Using local variable for token_cache.
We use local variable for token_cache in the decoder.

Change-Id: I032763fa7894313cffe73e3f14863ae1d0527665
2014-03-21 12:14:05 -07:00
Yunqing Wang
cf07d3e332 Remove unused mode_sad
Removed mode_sad.

Change-Id: I230b42ac9b617ae2c375e297057aa0756bd355fe
2014-03-20 09:28:16 -07:00
Dmitry Kovalev
66bf94965e Rearranging and removing unused defines.
Change-Id: I03049f89565ce19a297e65e2d53db127dc6f77d9
2014-03-18 11:20:06 -07:00
Dmitry Kovalev
fec0d4bc7d Merge "Removing last_mi from MACROBLOCKD struct." 2014-03-12 12:19:43 -07:00
Alex Converse
59853f8fdf Fix some active_map corner cases.
These were discovered by ActiveMapTest.

Change-Id: Ifcd305ae2d954b6ec7edcaed0f80baf18c769e01
2014-03-11 16:39:42 -07:00
Alex Converse
75272c97cb Merge "Add a conservative RD based active map in vp9." 2014-03-11 13:39:33 -07:00
Dmitry Kovalev
ff935ff781 Removing last_mi from MACROBLOCKD struct.
Change-Id: Ied12b39c55667b26fd3bf90eb331e601c53a10f6
2014-03-10 16:02:03 -07:00
Alex Converse
29a487c77f Add a conservative RD based active map in vp9.
Change-Id: I47b3c38aadfd8f3ea08515a18a5948aa1375c650
2014-03-10 15:48:43 -07:00
Dmitry Kovalev
bbfa9f6959 Cleaning up vp9_rdopt.c.
Change-Id: I8f06d03689ee90a19c9067840b24748bfe2d741f
2014-03-10 15:21:30 -07:00
Deb Mukherjee
44a203f5cd Merge "Support for a fast diamond search" 2014-03-10 09:53:21 -07:00
Jim Bankoski
622f06eb59 Merge "vp9_reconinter.h static functions in header converted to global" 2014-03-10 07:36:05 -07:00
Deb Mukherjee
bead2e8fb4 Support for a fast diamond search
Adds a fast diamond search which is about 5% faster than FAST_HEX
with only a 0.1% drop in psnr when turned on for both speeds 5 and 7.
This search is turned on for speed 7.

Change-Id: I497630aa88a5148926086bb3038e7975e5f4eb98
2014-03-07 17:15:09 -08:00
Jingning Han
6849cde893 Merge "Use modeled rate distortion costs for non-RD mode" 2014-03-07 09:06:24 -08:00
Jingning Han
539c961ed4 Use modeled rate distortion costs for non-RD mode
This commit replaces SAD cost with modeled rate-distortion cost
for non-RD mode decision. It translates the prediction residual
SSE into estimate rate and reconstruction distorion costs, hence
capturing the quantization setting effect. The compression
performance of speed -7 for rtc set is improved by 14.79%.

Change-Id: Ifda014eb0501d13109fe7f92680bf1410b463632
2014-03-06 23:00:48 -08:00
Dmitry Kovalev
daf18d6d6c Cleaning up labels2mode() function.
Change-Id: I76e39f7c5545ba4e0cd537f530c574531356e94a
2014-03-06 11:43:53 -08:00
Dmitry Kovalev
7a7db0f060 Merge "Combining mode_mv[] and second_mode_mv[]." 2014-03-05 22:29:56 -08:00
Dmitry Kovalev
eb63569d5e Merge "Cleaning up mode cost manipulations." 2014-03-05 22:28:05 -08:00
Dmitry Kovalev
bd1d7c9c81 Merge "Adding vp9_cost.{h, c} files." 2014-03-05 22:26:28 -08:00
Dmitry Kovalev
89c3da568f Merge "Inlining and removing vp9_set_mbmode_and_mvs()." 2014-03-05 21:45:48 -08:00
Jingning Han
3dfa93b058 Merge "Move set_speed_feature out of frame encoding" 2014-03-05 16:00:50 -08:00
Dmitry Kovalev
c9f79ca85c Inlining and removing vp9_set_mbmode_and_mvs().
Change-Id: I9717ef611ef9c39b109b2358c9771bf7fae2dd50
2014-03-05 14:22:31 -08:00
Dmitry Kovalev
627720fa81 Cleaning up mode cost manipulations.
Change-Id: If175d97990454b171b6abeddb76d142497484487
2014-03-05 12:29:44 -08:00
Dmitry Kovalev
021073fd5f Adding vp9_cost.{h, c} files.
Change-Id: If90c1bc822873156d4e38fca1938e4907f6c95f0
2014-03-05 11:57:57 -08:00
Dmitry Kovalev
a16f1a9bb4 Combining mode_mv[] and second_mode_mv[].
Change-Id: Ie5f69d39b49a4169cc731d4487e4668fb5af4b4f
2014-03-05 11:12:00 -08:00
Jingning Han
a57cff2132 Move set_speed_feature out of frame encoding
Set speed features before running frame encoding. This avoids
redundant RD threshold calculation in key frame coding.

Change-Id: If8e3cf2c02976baa59b310c1c23af9eea0c46e36
2014-03-04 18:49:56 -08:00
Alex Converse
bbc8c9d29a Prune RT mode decisions for BLOCK_32x32 and up
* Remove all non-DC intra modes for BLOCK_32x32 and up
* Remove all intra modes for blocks bigger than BLOCK_32x32
* Remove ZEROMV for BLOCK_32x32 and up
* Only consider NEARESTMV for blocks bigger than BLOCK_32x32

Change-Id: Ia18351a238213e2f072f9e481d622949346a245f
2014-03-04 09:48:31 -08:00
Deb Mukherjee
b80020d4db Refactoring motion search libs
The core motion estimation fucntions all return sad now consistently.
The only exception is vp9_full_pixel_diamond(), however the core diamond
and refining search routines called from vp9_full_pixel_diamond() also
return SAD. If variance of pred error + mv cost is desired it must be
calculated explicitly outside these functions. For very fast encoding,
hopefully this will eliminate some redundant computations.

Also suggests reimplementing FAST_HEX with the vp9_pattern_search
framework. It is not exactly the same as the existing FAST_HEX, but
performance is slightly better and speed is very similar. Enables
removing a lot of duplicate code.

Change-Id: I152736393438c25bdf7e96b37cbb8ce330f4f94a
2014-03-03 15:13:59 -08:00
Jim Bankoski
e5e9b05d68 vp9_reconinter.h static functions in header converted to global
Change-Id: I916944950deb22f4c2301d83a803b732bf3ecd77
2014-03-03 14:58:43 -08:00
Dmitry Kovalev
f084af5ca7 Merge "Adding consts and cleaning up vp9_rdopt." 2014-03-03 14:17:31 -08:00
Jim Bankoski
b247c14c07 Merge "cost_coefs approximation speed up" 2014-03-03 14:08:24 -08:00
Alex Converse
0873dc3ab4 Merge "Enforce intra_y_mode_mask for inter rd." 2014-03-03 12:55:25 -08:00
Dmitry Kovalev
c288367678 Adding consts and cleaning up vp9_rdopt.
Change-Id: I9423b543e1be414e5c9e10480b813f06e6b88f8a
2014-03-03 12:19:51 -08:00
Jim Bankoski
9c63e887e6 cost_coefs approximation speed up
This patch adds a new speed feature which doesn't do the rather
expensive entropy context lookup or save to the table,  while
doing costing.

The speed up on desktop36p.y4m is around 10% other clips much less.

On the RTC test set this was + 1% in overall datarate.

Change-Id: Ia5144bbf45270671e7be9c8e4055369909e2f738
2014-03-03 11:49:13 -08:00
Alex Converse
f466fc8bfa Refactor ZEROMV equivalence
This gets more accurate mode hit stats. It's also the first step to
handling ZEROMV not being allowed more intelligently.

Change-Id: I5de6734507b5177bf73e9ddbad923f218c39f3e4
2014-03-03 11:32:24 -08:00
Alex Converse
0fa1e7ee09 Enforce intra_y_mode_mask for inter rd.
intra_y_mode_mask is already enforced for the sub8x8 case.
intra_uv_mode_mask is already enforced for all sizes.

Change-Id: Ia9dd14701cb49873c2e8f24eb5f8b255eaf76a1f
2014-03-03 10:50:17 -08:00
Alex Converse
07c4d2252b Merge "Cleanup conditions in vp9_rd_pick_inter_mode_sb()." 2014-03-03 10:23:51 -08:00
Dmitry Kovalev
f97afbc8ea Merge "Using ref_mv[2] instead of two separate variables." 2014-02-28 16:07:45 -08:00
Dmitry Kovalev
3557dfc20f Merge "Sorting includes in vp9_rdopt.c." 2014-02-28 15:37:51 -08:00
Dmitry Kovalev
aed826b065 Using ref_mv[2] instead of two separate variables.
Change-Id: I909a81991aa0cc18afe6526542c7513837445213
2014-02-28 14:10:51 -08:00
Dmitry Kovalev
d89bdd3674 Sorting includes in vp9_rdopt.c.
Change-Id: I7e2591b4b54e0eac8521e128c7d97f62d2057ed8
2014-02-28 14:00:15 -08:00
Deb Mukherjee
f872a98b1b Adds speed 8 to vp9 as reference
Adds a speed 8 to VP9 where only the nearestmv (0 mv) is searched.
This seems to be about the same speed as vp8 speed 5.

Adds a new speed feature to disable inter modes based on a mask for
each blocksize.

Adds code for having lower complexity motion search methods
in nonrd pick mode function, even though speed 7 still uses DIAMOND
search for now.

Also uses HEX search for speed 6 rather than FAST_HEX which improves
psnr by 0.56% without any noticeable speed drop (tested on gipsmotion).

Change-Id: Ic13176572dbd3aed5884a26786940a4b1bbd8a75
2014-02-28 12:29:23 -08:00
Dmitry Kovalev
28bd1dd15e Merge "Adding consts to arguments of vp9_block_error()." 2014-02-28 10:51:43 -08:00
Dmitry Kovalev
0429c08823 Merge "Removing unnecessary clamp() call." 2014-02-28 10:49:35 -08:00
Dmitry Kovalev
9d0d6d1945 Merge "Explicit lossless handling in rd_pick_intra4x4block()." 2014-02-28 10:49:11 -08:00
Alex Converse
4c8d70d771 Cleanup conditions in vp9_rd_pick_inter_mode_sb().
Change-Id: I4e5ca10f7aef2d37fda835b369828d0bbff7c8a0
2014-02-27 19:16:50 -08:00
Dmitry Kovalev
9004091e8c Removing unnecessary clamp() call.
Change-Id: Iaaa16b4b2c581eaeb9e4ecfcfe60f98b8a0fa40b
2014-02-27 18:48:29 -08:00
Dmitry Kovalev
791e9bdac9 Adding consts to arguments of vp9_block_error().
Change-Id: Id145da99259866109cfee8b47a1d8f309944b937
2014-02-27 18:17:08 -08:00
Alex Converse
a70ae5d9ed Precompute vp9_rd_pick_inter_mode_sb loop escape conditions.
All escape conditions that remain require knowledge of best_rd or
best_mode_index.

Change-Id: I6f77e4e629cacd54c8149ad0a98d54c8ee4ae249
2014-02-27 17:05:52 -08:00
Jingning Han
2c6ddcc606 Cosmetic change mbmi->ref_frame to refs
In handle_inter_mode, the reference frames are set in refs buffer.
One can use refs buffer directly to avoid redundant fetch.

Change-Id: I811d408cae52dcd5e053dd4bfe69550eb6a2ff56
2014-02-27 11:43:03 -08:00
Dmitry Kovalev
f81822a568 Merge "Moving common code into vp9_get_entropy_contexts()." 2014-02-27 09:55:46 -08:00
Dmitry Kovalev
129c994f3a Merge "Replacing int_mv with MV in single_motion_search()." 2014-02-27 09:55:18 -08:00
Dmitry Kovalev
a05faf74d4 Replacing int_mv with MV in single_motion_search().
Change-Id: I527c42fa776c772c26c027a47f3dada129f5c33e
2014-02-26 17:07:06 -08:00
Dmitry Kovalev
9349b82bd2 Moving common code into vp9_get_entropy_contexts().
Change-Id: I197670a405f7c2e7796424faa187a61081db8567
2014-02-26 16:20:17 -08:00
Dmitry Kovalev
c313c54835 Cleaning up cost_coeffs().
Change-Id: I02f097fd7c4c787035f03114ddde5b04b2640b39
2014-02-26 14:56:00 -08:00