Commit Graph

972 Commits

Author SHA1 Message Date
Jingning Han
734c5ffa2c Apply constrained partition search range to non-RD mode decision
This commit enables a chessboard pattern for partition search. All
the black blocks run regular partition search ranging from 8x8 to
32x32. The rest white blocks take the nearby blocks' information
to adaptively decide the effective search range.

The compression performance for rtc set at speed -5 is down by 1.5%.
For pedestrian 1080p at speed -5, the runtime goes from 41594 ms to
39697 ms, i.e., about 5% faster.

Change-Id: Ia4b96e237abfaada487c743bca08fe1afd298685
2014-05-09 17:07:19 -07:00
Dmitry Kovalev
dc554abc59 Merge "Cleaning up vp9_encode_frame() function." 2014-05-07 14:10:07 -07:00
Dmitry Kovalev
e8bbb3d9db Making vp9_get_sse_sum_{8x8, 16x16} static.
Change-Id: Ifb7937c977308c682986f0ce9645a0807d2aa46a
2014-05-05 19:12:38 -07:00
Dmitry Kovalev
9f44467878 Cleaning up vp9_encode_frame() function.
Change-Id: I2b618dfe753f8c6139cecadc5caf14826abb67d9
2014-05-01 15:00:25 -07:00
Dmitry Kovalev
14967cd4f5 Removing unused alt_activity_measure() function.
Change-Id: I6b520553cb5334b44356dc4651a2dbc1cb93cca5
2014-04-29 16:58:22 -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
Jingning Han
80a4f55989 Enable background detection for adaptive quantizer control
This commit enables a background detection approach for adaptive
quantizer control. It combines the cyclic refresh pattern and the
background information to determine the segment id for adaptive
quantizer selection, prior to the non-RD mode decision process.
It hence allows proper quantization information update for a more
precise rate-distortion modeling in the non-RD mode decision.

The compression performance of speed -5 for rtc set is improved
by 2.5%, at no speed change.

Change-Id: Ic3713e8ed9185b403b5b1679d19dabd57506d452
2014-04-21 08:57:53 -07:00
Jingning Han
741c6bb619 Merge "Fix broken encoding process at sub8x8 block size" 2014-04-18 08:46:54 -07:00
Jingning Han
a7c69a71d9 Fix broken encoding process at sub8x8 block size
Use the correct buffer to update the coding mode decision for
sub8x8 blocks.

Change-Id: I091ef27d2047eeb8b73ceb7c2c7c45b38ba8c6d5
2014-04-17 15:33:46 -07:00
Jingning Han
42c1f6dbf4 Skip fetching original frame pointers for UV in background check
The background detection only tracks luma component. This commits
removes the frame buffer pointer retrieval for chroma components.

Change-Id: I098bd2950f5e5829ed5dc2b48568167248da7fad
2014-04-17 11:07:32 -07:00
Jingning Han
96a381c255 Merge "Remove redundant buffer initialization and mode_info assignments" 2014-04-17 09:36:30 -07:00
Jim Bankoski
e890c2579b add a context tree structure to encoder
This patch sets up a quad_tree structure (pc_tree) for holding all of
pick_mode_context data we use at any square block size during encoding
or picking modes.  That includes contexts for 2 horizontal and 2 vertical
splits, one none, and pointers to 4 sub pc_tree nodes corresponding
to split.  It also includes a pointer to the current chosen partitioning.

This replaces code that held an index for every level in the pick
modes array including:  sb_index, mb_index,
b_index, ab_index.

These were used as stateful indexes that pointed to the current pick mode
contexts you had at each level stored in the following arrays

array ab4x4_context[][][],
sb8x4_context[][][], sb4x8_context[][][], sb8x8_context[][][],
sb8x16_context[][][], sb16x8_context[][][], mb_context[][], sb32x16[][],
sb16x32[],  sb32_context[], sb32x64_context[], sb64x32_context[],
sb64_context

and the partitioning that had been stored in the following:
b_partitioning, mb_partitioning, sb_partitioning, and sb64_partitioning.

Prior to this patch before doing an encode you had to set the appropriate
index for your block size ( switch statement),  update it ( up to 3
lookups for the index array value) and then make your call into a recursive
function at which point you'd have to call get_context which then
had to do a switch statement based on the blocksize,  and then up to 3
lookups based upon the block size to find the context to use.

With the new code the context for the block size is passed around directly
avoiding the extraneous switch statements and multi dimensional array
look ups that were listed above.   At any level in the search all of the
contexts are local to the pc_tree you are working on (in?).

In addition in most places code that used to call sub functions and
then check if the block size was 4x4 and index was > 0 and return
now don't preferring instead to call the right none function on the inside.



Change-Id: I06e39318269d9af2ce37961b3f95e181b57f5ed9
2014-04-17 07:30:55 -07:00
Jingning Han
b6ec6930e5 Remove redundant buffer initialization and mode_info assignments
There is no need to initialize source/dst frame buffers at frame
level. These will be done at block coding stage. This commit hence
removes the redundant operations.

Change-Id: I11d9f2556058c6205c8e58ed53e31f78622c41b7
2014-04-16 17:00:27 -07:00
Jingning Han
ef2f6dae6f Merge "Enable more precise background detection for partition decision" 2014-04-16 17:00:13 -07:00
Paul Wilkins
fdc198c9de Merge "Remove old activity masking code." 2014-04-16 14:24:25 -07:00
Jingning Han
e88a280573 Enable more precise background detection for partition decision
This commit compares the current original frame to the previous
original frame at 64x64 block level and decides if the entire
block belongs to background area. If it is in the background area,
skip non-RD partition search and copy the partition types of the
collocated block in the previous frame.

For vidyo1 in the rtc set, this makes the speed -5 coding speed
about 8% faster. The overall compression performance is down by
1.37% for rtc set.

Change-Id: Iccf920562fcc88f21d377fb6a44c547c8689b7ea
2014-04-16 14:00:52 -07:00
Yaowu Xu
4ec5569f50 Merge "Add consts in set_fixed_partitioning()" 2014-04-16 12:55:48 -07:00
Yaowu Xu
b12014b860 Merge "Refactor common code into a function" 2014-04-16 12:29:12 -07:00
Paul Wilkins
e434d08fd9 Remove old activity masking code.
Delete code relating to the old VP8_TUNE_SSIM flag
as this code does not currently work and is largely made
redundant in VP9 by the various AQ modes.

Change-Id: I71f28e1f680573d296422254489000678552b17b
2014-04-16 12:22:41 -07:00
Yaowu Xu
8f6f6ab244 Add consts in set_fixed_partitioning()
Change-Id: Ib8c1b3b0a5a5689d3261dc822a69e9d473b89be1
2014-04-15 11:49:49 -07:00
Dmitry Kovalev
398de52f92 Merge "Adding get_skip_encode_frame()." 2014-04-15 10:24:59 -07:00
Yaowu Xu
1cda057261 Refactor common code into a function
Change-Id: Id156af5662ebe6fbe1cab636564f5f4bedb85ab0
2014-04-15 10:10:23 -07:00
Dmitry Kovalev
41a4b88a04 Adding get_skip_encode_frame().
Change-Id: Id687aa617650a859463e7ae63dd4c0dc4f3e4779
2014-04-14 15:19:43 -07:00
Yaowu Xu
54306b5861 Reduce code duplication
Change-Id: I6ea1c335da9ca5b65f6a11466b417ad196fd0d65
2014-04-14 11:23:19 -07:00
Yaowu Xu
9168f18069 Add a few "const"
Change-Id: I258351fc1fff70ff2e9fa4845e575b0bb6a423d1
2014-04-11 15:50:16 -07:00
Yaowu Xu
eb0c52baca Merge "Replace the call to set_offsets()" 2014-04-11 15:50:02 -07:00
Yaowu Xu
1243d265cf Replace the call to set_offsets()
With a more approriate one vp9_setup_src_planes() as only src buffer
pointers need to be initialized here.

Change-Id: I40fac4d8b2d39eb7d0c65b9b6afab45138a13936
2014-04-11 13:03:28 -07:00
Dmitry Kovalev
1ff4aa33de Adding RD_OPT struct.
Change-Id: I2d1b5c1481aefe226082e1f096ca9edd340d4d31
2014-04-11 10:58:37 -07:00
Yunqing Wang
c3e08e4aeb Merge "Define var threshold as unsigned int to match the type" 2014-04-10 15:59:05 -07:00
Dmitry Kovalev
35c18baa26 Merge "Regrouping code in rd_pick_sb_modes()." 2014-04-10 11:14:59 -07:00
Dmitry Kovalev
91ff90760a Merge "Cleaning up get_sby_perpixel_{, diff_}variance()." 2014-04-10 11:14:24 -07:00
Yunqing Wang
eb505a3f3f Define var threshold as unsigned int to match the type
Minor change to use matching type in comparison.

Change-Id: I670cae2d584918c67c1af791a797629f392f599e
2014-04-10 09:48:33 -07:00
Yunqing Wang
81056e2d5e Merge "Minor code cleanup" 2014-04-10 08:25:10 -07:00
Dmitry Kovalev
65e650e0c0 Merge "Revert "Converting set_prev_mi() to get_prev_mi()."" 2014-04-09 20:44:30 -07:00
Dmitry Kovalev
60def47f21 Revert "Converting set_prev_mi() to get_prev_mi()."
This reverts commit 22a3e30790

Change-Id: I460d905edf5fb2006da58c18fbe02c04d0c631bb
2014-04-09 15:23:16 -07:00
Dmitry Kovalev
876059f7c2 Regrouping code in rd_pick_sb_modes().
Change-Id: I51c71dd4aee6592fb90feebcf864bccc87dacec6
2014-04-09 13:00:02 -07:00
Yunqing Wang
7c891ed2e0 Minor code cleanup
Cleanup.

Change-Id: I54d989e24b35323cda7290654e425565d5c9ea2d
2014-04-09 12:08:07 -07:00
Dmitry Kovalev
0ba14e600c Fixing broken build.
Change-Id: I9b8f9a3f4fa9d48695149dd68ecb5e8d84accafe
2014-04-09 10:46:54 -07:00
Dmitry Kovalev
5ed83c3220 Merge "Converting set_prev_mi() to get_prev_mi()." 2014-04-09 10:27:05 -07:00
Yunqing Wang
2e7d327789 Merge "Use source frame difference to make partition decision" 2014-04-09 10:26:42 -07:00
Jingning Han
ae6485663a Merge "Select prediction filter type in non-RD mode decision" 2014-04-09 09:07:45 -07:00
Dmitry Kovalev
191dfa8dc7 Cleaning up get_sby_perpixel_{, diff_}variance().
Change-Id: Icbfeb04647d654253866d290abd4775a877b4f61
2014-04-08 19:00:12 -07:00
Dmitry Kovalev
c27bdb9bc1 Merge "Cleaning up encode_frame_internal()." 2014-04-08 18:23:15 -07:00
Yunqing Wang
4e66293fcb Use source frame difference to make partition decision
Calculate the difference variance between last source frame and
current source frame. The variance is calculated at 16x16 block
level. The variances are compared to several thresholds to decide
final partition sizes.

An adaptive strategy is implemented to decide using
SOURCE_VAR_BASED_PARTITION or FIXED_PARTITION based on motions
in the video. The switching test is done once every
search_type_check_frequency frames.

The selection of source_var_thresh needs to be investigated
further later.

RTC set Borg test showed 0.424% overall psnr gain, and 0.357%
ssim gain. For clips with large enough static area, the
encoding speedup is around 2% to 15%.

Change-Id: Id7d268f1d8cbca7fb8026aa4a53b3c77459dc156
2014-04-08 17:03:02 -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
22a3e30790 Converting set_prev_mi() to get_prev_mi().
Change-Id: Iad4002d7aecaae0e25d88e286bacde7e6cd7264f
2014-04-07 16:01:34 -07:00
Dmitry Kovalev
8204140891 Cleaning up encode_frame_internal().
Change-Id: I9c5f7edc2d5d1ec5aee396b87bdfc99ee21c435a
2014-04-07 15:51:48 -07:00
Marco Paniconi
181949948e Add constrained-copy partition to speed features.
Copy up to a certain bsize, otherwise set to a fixed bsize.
This helsp to reduce artifact near moving boundary caused by full partition
copy without checking motion of super-block.
This artifact can occur at speeds 3,4 in real-time mode.
Issue: https://code.google.com/p/webm/issues/detail?id=738.

Change-Id: I05812521fd38816a467f72eb6a951cae4c227931
2014-04-07 14:58:28 -07:00
Dmitry Kovalev
bbffaf627b Merge "General vp9_encodeframe.c cleanup." 2014-04-07 14:35:54 -07:00
Dmitry Kovalev
0cb65fe5cc Merge "Removing unused seg0_* vars." 2014-04-07 13:16:06 -07:00
Dmitry Kovalev
c48f2bd807 General vp9_encodeframe.c cleanup.
Change-Id: Ie364fe837002de96923da2c1c0ff8bb4b8d469a7
2014-04-04 10:44:58 -07:00
Dmitry Kovalev
0e8f35de85 Merge "Removing interp_kernel from MACROBLOCKD." 2014-04-03 16:58:21 -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
Paul Wilkins
009ee2b737 Fix complexity Aq mode.
This was broken by change
Icc4b66f3935fad5ec4516a4d57e843d12c365e64

Change-Id: I49e3fc525664eb7a433f55f76b8f8628fe251eab
2014-04-03 14:34:43 +01:00
Dmitry Kovalev
6a2fb54484 Removing unused seg0_* vars.
Change-Id: I87b0668e23c54429a06bba85437606c4780be9ba
2014-04-02 12:00:11 -07:00
Deb Mukherjee
97f4fb7b5f Rate ctrl changes to track target bitrates closer
Turns off the DISABLE_RC_LONG_TERM_MEM macro and makes other changes
in the way the bits are updated, to make 2-pass rate control track
target bitrates closer.

Change-Id: I5f3be4b11c2908e6a9a9a1dd4fcf4e65531c44d8
2014-04-02 11:16:20 -07:00
Dmitry Kovalev
4f8a440083 Clearing all encoder counts with single vp9_zero() call.
Change-Id: I4341d16ef83acd1cc9e55f7c5eff4af921bf57d4
2014-04-01 20:09:35 -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
Dmitry Kovalev
06159fcd18 Merge "Common configuration for MACROBLOCKD struct." 2014-04-01 15:54:34 -07:00
Alex Converse
d0a2988dbd Merge "Propagate active map state." 2014-04-01 13:49:26 -07:00
Dmitry Kovalev
d42976c515 Common configuration for MACROBLOCKD struct.
Change-Id: Ie2ea9dd8bd338cc9fe12ca9033df64f7644c68b3
2014-04-01 10:57:59 -07:00
Alex Converse
12dd53d06a Propagate active map state.
This fixes active map for non-rd realtime speeds.

Change-Id: I1bf416de3f7ef2e5dd2eabde052cce3c0683a52c
2014-03-31 16:55:39 -07:00
Jingning Han
99893f2410 Apply finer quantizer to partition search frames in non-RD flow
This commit optimizes the bit allocation for the non-RD coding flow.
It applies slightly better quantizer to the frames, where all blocks
run a non-RD partition search. Such frames typically have better
rate-distortion trade off, thus improving the reconstruction quality
for next few frames reference at reasonably low increment in rate
cost.

The coding performance for rtc set at speed -5 with error-resilient
tuned on and rate control set as cbr is improved by 19.58%. It improved
the coding speed by about 10% for a portion of local test clips.

Change-Id: I9d56696cd4359dc8136ca10aff10fff05aaa2686
2014-03-31 09:33:11 -07:00
Jingning Han
4a42047b4e Fix segment_id assignment in update_state_rt for AQ mode
Properly obtain and buffer the segment_id in non-RD mode information
update process.

Change-Id: I43230001872f6a986d12c0d94e98fdec0db3be2c
2014-03-27 12:42:04 -07:00
Marco Paniconi
2b06bf20ce Move aq_mode=2 (complexity_aq) to separate file.
Change-Id: Iffa45b9b04196c1ded6037622a8644a2500a62de
2014-03-26 18:01:59 -07:00
Jingning Han
6bdfc8cd0b Merge "Motion referenced partition search for non-RD coding flow" 2014-03-26 16:06:01 -07:00
Dmitry Kovalev
0437575848 Merge "Removing prev_mi_8x8 from MACROBLOCKD." 2014-03-26 15:45:11 -07:00
Jingning Han
abdb0650b4 Motion referenced partition search for non-RD coding flow
This commit enables the non-RD mode decision coding flow to
adaptively apply partition search in non-refresh frame, when the
collocated block in previous frame suggests there might be a motion
activity. It refactors the update_state_rt() function to support
buffer swap of mode_info struct, thereby unifying the encoding
stage across various non-RD coding modes.

It provides 5% compression performance gains in speed -6 for rtc
test set, at about 12% speed slow down.

Change-Id: Iefa374aed5a11c4b7ff9a3ed36a98ea8bd184edb
2014-03-26 13:09:04 -07:00
Dmitry Kovalev
fc25e4dc52 Encapsulating CYCLIC_REFRESH struct into .c file.
Change-Id: I32695ad703dcbbbbf5f122b403f3d3120a0be366
2014-03-26 11:00:35 -07:00
Dmitry Kovalev
63f86c149a Removing prev_mi_8x8 from MACROBLOCKD.
Change-Id: I32beb5f18c10b5771146c55933b5555487f53633
2014-03-26 10:50:34 -07:00
Yaowu Xu
2ec04d1f84 Merge "Added a speed feature "allow_skip_recode"" 2014-03-26 09:53:42 -07:00
Jingning Han
3b8d00449c Merge "Apply early termination in non-RD partition search" 2014-03-26 09:28:55 -07:00
Marco Paniconi
79ec9a26d1 Merge "Fix to cylcic refresh: use correct/chosen mode for update_segment." 2014-03-26 09:15:15 -07:00
Marco Paniconi
eeed7e2953 Fix to cylcic refresh: use correct/chosen mode for update_segment.
Fix so that vp9_update_segment_aq() will use the correct (i..e, chosen)
encoding mode (from ctx struct) in update_state.

Change-Id: Icc4b66f3935fad5ec4516a4d57e843d12c365e64
2014-03-25 16:40:48 -07:00
Jingning Han
0d78687583 Apply early termination in non-RD partition search
This commit allows the recursive non-RD partition search to early
terminate sub search tree when the cumulative rate-distortion is
already above the best available.

Change-Id: Ifdbcbb4bee229f47fde3033200829577c9f1fc1d
2014-03-25 15:51:36 -07:00
Yaowu Xu
6eb2cacf0d Added a speed feature "allow_skip_recode"
This commit added a speed feature to make the logic of calculating
skip_recode on a block level more explicit. This also enable the
feature to be enabled at speed 5 where the previous logic is too
conservative, help gain back the lost speed for --rt(-5).

Change-Id: Ieb37ca3e85c2e7bda343486edf13d5f5395f2233
2014-03-25 14:27:45 -07:00
Dmitry Kovalev
ed39c40a2e Moving above_context to VP9_COMMON.
Change-Id: I713af99d1e17e05a20eab20df51d74ebfd1a68d2
2014-03-25 10:40:08 -07:00
Jingning Han
c4e807ae2f Fix compiling errors due to git merge
There were a few conflicts between the new non-RD partition search
and recent clean-up patches, which were not caught by git control.
This commit fixed these issues.

Change-Id: Ieebefbd6c19d81d0d13e3c568877d5cce2ab7797
2014-03-25 10:25:16 -07:00
Jingning Han
17e9df1441 Merge "Always use adaptive motion search in non-RD coding mode" 2014-03-25 09:27:03 -07:00
Jingning Han
c270ce662b Merge "Enable recursive partition selection for non-RD coding mode" 2014-03-25 09:26:49 -07:00
Jingning Han
1b46f315f6 Always use adaptive motion search in non-RD coding mode
This commit takes out the if statements on using adaptive motion
search flag. This feature is automatically enabled in non-RD mode
decision flow for variable partition types search.

Change-Id: I5a25cf9109d84d07aa61b3e02c8d32dda1e90cb0
2014-03-24 22:33:00 -07:00
Alex Converse
64c766bb08 Merge "Don't subpartion inactive area in rd_use_partition." 2014-03-24 17:04:45 -07:00
Alex Converse
98fde54685 Merge "Deduplicate and rename mode info step." 2014-03-24 17:04:30 -07:00
Jingning Han
6b6d3886fc Enable recursive partition selection for non-RD coding mode
This commit enables a recursive partition type search for non-RD
mode decisions. It allows the encoder to choose variable block
sizes in a 64x64 block based on rate-distortion modeling.

It improves speed -6 coding efficiency for rtc set by 2.4%. Most
of the gains come from 32-40dB range, where many sequences gain
about 5% to 20%. Local tests suggest there is no speed change.

Change-Id: I06300016e500a21652812b7b3b081db39a783d66
2014-03-24 14:40:29 -07:00
Alex Converse
5182a35004 Don't subpartion inactive area in rd_use_partition.
Change-Id: I50db8d3c99eea39e46cc5876cb1f49513c084073
2014-03-24 12:54:30 -07:00
Alex Converse
f16f507c76 Deduplicate and rename mode info step.
Change-Id: Ie624a119ce8e0891f4ca396040d679e22ef8ce27
2014-03-24 12:54:30 -07:00
Dmitry Kovalev
6bfcb269a5 Cleaning up vp9_aq_cyclicrefresh.{c, h}.
Change-Id: I288e5ffade508fc3c803986d47ccf06df8d784dd
2014-03-24 12:03:44 -07:00
Jim Bankoski
f7188e5aea refactor reset_skip_txfm_size and elimate a lot of code
Change-Id: Id70bd0ff8836c28d9c8653e018e071ca9fb06610
2014-03-24 08:54:49 -07:00
Dmitry Kovalev
9895c9d4dd Merge "Removing redundant {above, left}_seg_context manipulation code." 2014-03-22 22:31:48 -07:00
Jingning Han
5950a69213 Merge "Reformat non-RD coding flow" 2014-03-21 21:43:02 -07:00
Jingning Han
89cc421e89 Reformat non-RD coding flow
This commit reformats non-RD coding flow layout to allow mode
decision with fixed and variable block sizes.

Change-Id: I2cdd3bb9f26c499ee4a9849004fd925cdd195d09
2014-03-21 16:41:55 -07:00
Marco Paniconi
03a9e5edb6 Rename the aq_mode files.
Change-Id: Id76a628495c822e23825b66a7589b4a3279680e2
2014-03-21 15:20:59 -07:00
Yaowu Xu
bcd102c523 Merge "Fix bad speed settings interaction." 2014-03-21 12:13:44 -07:00
Dmitry Kovalev
4cb37bff96 Removing redundant {above, left}_seg_context manipulation code.
Change-Id: Ib3c1746e61220c629cbd971b2458aa686b5c9e36
2014-03-21 12:12:55 -07:00
Dmitry Kovalev
a57de9da03 Merge "Reusing {above, left}_seg_context vars in both encoder and decoder." 2014-03-21 12:02:42 -07:00
Yaowu Xu
2d70e16595 Merge "Fix a valgrind error" 2014-03-21 11:13:43 -07:00
Yaowu Xu
e993fb5e24 Fix a valgrind error
Valgrind was complaining uninitialzed values are being used.

Change-Id: Ia9eb619f4e67d1fb7af1057d50304f15adc02aab
2014-03-21 08:36:40 -07:00
Paul Wilkins
2e05341ab4 Fix bad speed settings interaction.
The flag x->skip_recode interacts badly with
the cpi->sf.use_nonrd_pick_mode and
cpi->sf.skip_encode_sb speed settings.

Restricting the use of the skip_decode flag when
these other speed choices are in use helps quality
for speeds 3 and 4 by a large amount with only a
small impact on speed.

Average improvmentes for 2 pass speed 4:
Derf +8.8%
Yt + 10.53%
Std-Hd +6.95%
yt-hd + 22.95%

Change-Id: I8010876d8012042a11077c92e69d813c3dfa58eb
2014-03-21 10:10:50 +00:00
Yaowu Xu
0de216a995 Use local vairable in rd_auto_partition_range()
In addition to a few cleanups.

Change-Id: Ice5938ef494513921a47e7c64ba9928f2202e24e
2014-03-20 19:22:26 -07:00
Dmitry Kovalev
7ad40117f1 Reusing {above, left}_seg_context vars in both encoder and decoder.
Change-Id: Id1fa36c92cb007b73a450cc8552e810cedad38b9
2014-03-20 16:15:57 -07:00
Jingning Han
b64d58c773 Merge "Enable variable block size test in non-RD mode decision" 2014-03-19 18:54:42 -07:00
Jingning Han
60f9ebc3f1 Enable variable block size test in non-RD mode decision
This is an initial attempt to allow variable block size partition
in non-RD coding flow. It tests 8x8, 16x16 and 32x32 block size per
64x64 block, all using non-RD mode decision and the associated rate
distortion costs from modeling, then selects the best block size to
encode the entire 64x64 block. Such operations are triggered every
other 3 frames. The blocks of intermediate frames will reuse the
collocated block's partition type.

It improves the compression performance by 13.2%. Note that the gains
are not evenly distributed. For many hard clips, the compression
performance is improved by 20% to 28%. Local speed test shows that
it will also increase runtime by 50%, as compared to speed -7. It is
now enabled in speed -6 setting.

Change-Id: Ib4fb8659d21621c9075b3c369ddaa9ecb0a4b204
2014-03-19 16:10:29 -07:00
Dmitry Kovalev
c9ec26f1d8 Moving common code into vp9_update_mv_count().
Change-Id: I512482853bdf2695fbdf1c705a2ada354ccf76cf
2014-03-19 14:26:11 -07:00
Jingning Han
98fd11c567 Fix the use of uninitialized skip flag
The use of uninitialized skip flag will trigger inconsistency in
coding statistics, when alternate RD and non-RD coding modes are
enabled. This commit fixes this issue and removes unnecessary if
statements from update_state_rt.

Change-Id: I7d549dcb0e3ef48b999e5bbc78174ba84502cfcf
2014-03-18 15:03:45 -07:00
Marco Paniconi
6b83884ba9 In-frame q adjustment for cyclic background refresh.
Activated using aq_mode=3.

Change-Id: Ied628b9e7bd0e88b0c75790276bca75b19eb5c07
2014-03-18 10:59:21 -07:00
Jingning Han
5e33fd200c Merge "Add bit-stream write flag to nonrd_use_partition" 2014-03-17 14:17:58 -07:00
Dmitry Kovalev
b93deb6251 Merge "Moving defines from vp9_onyx_int.h to suitable *.c files." 2014-03-17 14:12:13 -07:00
Dmitry Kovalev
8228ead7df Moving defines from vp9_onyx_int.h to suitable *.c files.
Change-Id: I0d39bdbb8166ee44561f1008d1a2e76e70b36f30
2014-03-17 12:54:51 -07:00
Jingning Han
6affef728b Add bit-stream write flag to nonrd_use_partition
This is for the purpose to test variable partition choices for the
same 64x64 block.

Change-Id: I0fab7351a62e7d3dfccd667e908bccb996ee677e
2014-03-14 17:13:02 -07:00
Yaowu Xu
04b7f14ad5 Remove unused functions
Change-Id: Iec885af58c95e65814fcb6ab528ce4e0874eb573
2014-03-14 15:47:41 -07:00
Jingning Han
5aa56f7c48 Merge "Properly reset the block coding skip flag array in non-RD mode" 2014-03-14 14:31:25 -07:00
Yaowu Xu
e6058ea061 Merge "change to save rdmult value correctly" 2014-03-14 13:27:32 -07:00
Jingning Han
a2e711ce38 Properly reset the block coding skip flag array in non-RD mode
The block coding skip flags are assigned in the normal RD mode
decision loop. They are then used in the final encoding stage.
In the non-RD mode decision, the forward transform and quantization
stages are replaced by modeling based on SSE and variance of
prediction residues. This commit applies reset to this array in
the non-RD coding mode.

Change-Id: I66584669b035e9c8ac23e95047849ff277472742
2014-03-14 12:14:06 -07:00
Yaowu Xu
28f947359d Merge "Use of inline instead of INLINE." 2014-03-14 11:48:09 -07:00
Yaowu Xu
2a03d0d22b change to save rdmult value correctly
This commit moves the position where rdmult is saved to make sure it
is the correct value. Prior, an uninitialized value may be saved and
restored.

This addresses issue:
https://code.google.com/p/webm/issues/detail?id=733

Change-Id: I436407f289169bc63da3c5a6bf609bed16cb71b5
2014-03-14 11:18:27 -07:00
Paul Wilkins
0fa768704b Use of inline instead of INLINE.
This causes a build failure in VS 2008.

Change-Id: I03b0c0c006589b56d92a238d7b794711eb62575e
2014-03-14 11:36:06 +00:00
Jingning Han
9efe0b25c5 Remove deprecated function nonrd_use_fixed_partition
This function was subsumed by nonrd_use_partition, hence removed.

Change-Id: Id36757bc600ce6cf6ca03ad5df80268c4786d386
2014-03-13 16:15:14 -07:00
Jingning Han
73df20e97d Remove unused comment
Change-Id: I12ce22c036b12073a45b762d4dd38f6ec4960e56
2014-03-13 16:04:16 -07:00
Jingning Han
0d39429914 Refactor the non-RD partition decision process
Combine the common variables and functions used by different
speed features.

Change-Id: Ifd1fa86200edbcc9e50b3fc3b1ba8a275bc3c17f
2014-03-13 15:53:40 -07:00
Jingning Han
3d6286c73d Unify non-RD partition use cases
This commit unifies the non-RD partition use cases for both fixed
and variable block sizes. Deprecate and remove the separate function
for fixed partition type only.

Change-Id: I2b6cb945e90c1566f985adcebc4d0757480a8004
2014-03-13 15:41:15 -07:00
Deb Mukherjee
e39ecfaa98 Preliminary code for variance based paritioning
Brings back most of Jim's previous patch for choosing
partitioning based on variance while making it compatible
with the current state of the code. Also adds a
nonrd_use_partition() function to recursively encode  for any
arbitrary sb_type decisions within a 64x64 block; and
includes some refactoring.

Currently, when the VAR_BASED_PARTITIONING mode is turned on
for speed 7, there is a 10+% speed-up observed.

Experiments/improvements with this new partitioning method
will be conducted subsequently.

Change-Id: Ie6f43bfbde30583e941f450bf07c3b48828c9571
2014-03-12 15:06:20 -07:00
Dmitry Kovalev
fec0d4bc7d Merge "Removing last_mi from MACROBLOCKD struct." 2014-03-12 12:19:43 -07:00
Jim Bankoski
0ce2d6577c Merge "cut down calls to get_block_context" 2014-03-12 10:30:20 -07:00
Yaowu Xu
1a935e69ea Merge "Increase redo_frequency to 4 and cleanups" 2014-03-11 20:13:35 -07:00
Yaowu Xu
6f5a1e033f Increase redo_frequency to 4 and cleanups
Clean-ups include
a. redundant code in rt -5 speed feature settings
b. code that guarantees square block availability in
rd_auto_partition_range()

Change-Id: Ic7b04d45b6dc15c461e0edbbb4e78aec20348291
2014-03-11 17:33:24 -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
Jim Bankoski
8bdc1f25e5 cut down calls to get_block_context
Change-Id: I894977e6655630823145c60c8258551bd3c8c76b
2014-03-11 11:18:43 -07:00
Dmitry Kovalev
2b9c581393 Using MAX_REF_FRAMES constant instead of number 4.
Change-Id: I6e2fec2814fd366a1ce1321208d3b0e8aa0d98b0
2014-03-10 18:50:28 -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
29beeff11d Merge "Cleaning up select_tx_mode() function." 2014-03-10 12:29:28 -07:00
Dmitry Kovalev
d8c9288465 Cleaning up select_tx_mode() function.
Change-Id: Ib105db0f3deeedf6a8402a292db3df1d77a3d7c1
2014-03-10 11:35:40 -07:00
Dmitry Kovalev
ab1f905438 Cleaning up rd_pick_sb_modes() function.
Changing aq_mode type from int to AQ_MODE enum.

Change-Id: Ib7b5f0b70d02ded58a31dfade9c05a347f73beca
2014-03-10 10:58:32 -07:00
Dmitry Kovalev
924dc81e74 Merge "General cleanup in vp9_encodeframe.c." 2014-03-10 10:43:47 -07:00
Jim Bankoski
622f06eb59 Merge "vp9_reconinter.h static functions in header converted to global" 2014-03-10 07:36:05 -07:00
Dmitry Kovalev
51a0e9825b General cleanup in vp9_encodeframe.c.
Change-Id: I446fca8aa11a4d4fc2b23d4b32348b74d74d0202
2014-03-07 10:56:20 -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
Jingning Han
90a8dad162 Fix set_mode_info settings
Properly set intra mode information entries.

Change-Id: Ie3a8992e415dcdd9087a55993bbca06087a0107a
2014-03-05 09:13:36 -08:00
Jingning Han
2702e3c8cf Remove repeated tx_mode_select calls
The frame level transform size selection is done inside
encode_frame_internal().

Change-Id: Id7e5e417a3a3f88f875bf12b21bb8029bc6d0d82
2014-03-05 09:12:18 -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
Jim Bankoski
e5e9b05d68 vp9_reconinter.h static functions in header converted to global
Change-Id: I916944950deb22f4c2301d83a803b732bf3ecd77
2014-03-03 14:58:43 -08:00
Yaowu Xu
b12f5fc748 vp9_encodeframe.c: remove unused function params
Change-Id: I6d47618e8aee6e6c2fe1cf0b8bb4da0b2a0bab66
2014-03-01 14:58:42 -08:00
Yaowu Xu
9bcd361617 Remove unused parameters from update_state_rt()
In addition, a local variable was renamed to avoid confusion.

Change-Id: Id4c497f9cfa219e8a414aa9fee9a85af5f147249
2014-03-01 11:08:52 -08:00
Deb Mukherjee
dc8a2c07b3 Merge "Adds speed 8 to vp9 as reference" 2014-02-28 14:17:24 -08:00
Jingning Han
fa9e6e8890 Merge "Fix potential invalid partition size use" 2014-02-28 13:02:58 -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
fc179b3eda Merge "Cleaning up vp9_quantize.c." 2014-02-28 11:29:39 -08:00
Jingning Han
bf5e9221d6 Fix potential invalid partition size use
For blocks at frame boundary, the selected block size sometimes needs
to be smaller than that was first given. This commit forces such block
size change only between square blocks, so as to avoid the potential
use case containing 32x16 + 16x8 + 16x8, for 1080p sequences.

Local test suggested no visible coding speed difference. Borg test
reveals no difference in terms of compression performance.

Change-Id: Ie8de87f3c6febc3acf11b4cbfdf2077f9f6def52
2014-02-28 10:50:34 -08:00
Dmitry Kovalev
761eef0310 Merge "Replacing int_mv with MV and adding const qualifiers." 2014-02-28 10:38:42 -08:00
Dmitry Kovalev
f527c46f20 Cleaning up vp9_quantize.c.
Change-Id: I9a38af32f16f196b83dd69755eafb9543edf5691
2014-02-28 10:11:31 -08:00
Deb Mukherjee
746538c2c0 Merge "Turns variance based partitioning on in Speed 7" 2014-02-27 14:02:53 -08:00
Deb Mukherjee
ed5755445c Turns variance based partitioning on in Speed 7
Improves coding efficiency by about 1%, increases speed by
about 15-20% over exsiting speed 7.

Change-Id: Ibf5b9b5a5c8548e863ce19047c42b579aac21d19
2014-02-27 12:09:12 -08:00
Jingning Han
23a82ef5e4 Remove arguments not in use in non-RD decision
This commit removes a few arguments that are not used in the
non-RD mode decision.

Change-Id: I0d878bb5a7dba1b34fe0b64afe55bf11b1a9a2d7
2014-02-27 12:00:24 -08:00
Deb Mukherjee
01906b53f8 Merge "Refines variance based partitioning search" 2014-02-27 09:52:01 -08:00
Deb Mukherjee
90d13337da Refines variance based partitioning search
Instead of using source variance, this patch uses variance of the
frame difference between the source and the current frame to make
fixed size partition decisions. Also disables adjusting partitioning
if variance based or fixed size partitioning is used.

The latter change improves the speed substantially for speed 6, so
that speed 7 is now less than 3x the speed of speed 6. But speed
6 is 48% better in psnr on the rtc set compared to speed 7.

As compared to speed 5,
speed 6 is -37% in psnr at about 2.5x the speed,
speed 7 is -55% in psnr at about 7x the speed.

Change-Id: If61d80431d3e04ed304ac05832e773cdb2c0a578
2014-02-27 09:37:15 -08:00
Dmitry Kovalev
fc7b7a93aa Replacing int_mv with MV and adding const qualifiers.
Change-Id: I89c37b739493c79044f8c70ae2424aa074eb56c8
2014-02-26 14:13:23 -08:00
Jim Bankoski
d496cd3074 remove ioc problem with rdcost calculation
Change-Id: Idd800fae21508699e9d973134817493763a65042
2014-02-26 07:46:56 -08:00
Deb Mukherjee
276e568997 Merge "Adds variance based fixed size partitioning" 2014-02-25 13:46:21 -08:00
Deb Mukherjee
10bae82510 Adds variance based fixed size partitioning
Adds a method for determining a fixed size partition based on
variance of a 64x64 SB. This method is added to rtc speed 6.
Also fixes a bug in rtc_use_partition() and includes some
refactoring related to partitioning search, and some cosmetics.

Currently compared to speed 5, the coding efficiency of speed 6
is -19% and that of speed 7 is -55%, in cbr mode.

Change-Id: I057e04125a8b765906bb7d4bf7a36d1e575de7c6
2014-02-25 12:20:59 -08:00
Yunqing Wang
da47b3415b Merge "Disable adaptive pred filter for non-split mode" 2014-02-25 08:28:03 -08:00
Yaowu Xu
b67bd637e0 Merge changes I7e96d619,I9a7631d5
* changes:
  normalize int64_t high value to INT64_MAX
  resolve issue with arm code failing unit test
2014-02-25 08:22:49 -08:00
Jim Bankoski
ec55dd1007 normalize int64_t high value to INT64_MAX
Change-Id: I7e96d6199f882d35357f6a9a08c04ad0af5dc26e
2014-02-25 07:29:48 -08:00
Jim Bankoski
df9c8d5bd9 resolve issue with arm code failing unit test
The optimizer did something funny with the code around
line 1412.  Before the call to encode_sb split_dist was
set properly but after it was adjusted and converted to
a negative.

https://code.google.com/p/webm/issues/detail?id=714

Change-Id: I9a7631d5325ade2dc28c1030653a23eecec8721b
2014-02-24 17:34:27 -08:00
Yunqing Wang
fee045d13a Disable adaptive pred filter for non-split mode
If sf->disable_split_mask is DISABLE_ALL_SPLIT, disable
sf->adaptive_pred_interp_filter to avoid unnecessary operations.

Change-Id: Icb59174b2f4e9a3c3c16a696deb8018e5bd999eb
2014-02-24 14:05:06 -08:00
Deb Mukherjee
5f542408b4 Adds an intermediate speed level for rtc
Moves the existing speed 6 to speed 7 and adds an
intermediate level 6 which is roughly in between
speeds 6 and 7 in both speed and coding efficiency.
Also includes some minor fixes/adjustments.

Change-Id: I98befc4d82d750e79fe426c457c4a2571f6b6cc7
2014-02-24 12:15:33 -08:00
Dmitry Kovalev
092f32cf78 Merge "Combining if-else branches from different conditions." 2014-02-23 08:28:43 -08:00
Jingning Han
1fc0bde675 Refactor selected partition size coding for rtc
This commit makes a refactoring of the rtc_use_partition. It allows
the encoder to take a preferred block size for non-RD mode decision.
The boundary blocks are handled such that smaller block sizes that
fit in the boundary size will be used instread.

In rtc mode, the coding performance of speed -6 for pedestrian_1080p
goes from
158980 b/f, 38.934 dB, 22721 ms to
159008 b/f, 40.064 dB, 23721 ms.

For rtc set, the speed -6 compression performance is improved by
26%. Still about 2dB behind speed -5 at this point.

Change-Id: If0944f0880eaf1ad340bc325d97cea8d0f9dd53f
2014-02-21 14:49:57 -08:00
Jingning Han
65bcabbe8c Merge "Use MI_BLOCK_SIZE in block coding loop" 2014-02-20 14:29:30 -08:00
Jingning Han
2aac18a4a6 Merge "Rework non-RD mode decision coding flow" 2014-02-20 14:28:57 -08:00
Alex Converse
1d34991139 Merge "Only track mode_chosen_counts if CONFIG_INTERNAL_STATS." 2014-02-20 12:03:48 -08:00
Tom Finegan
595985334e vp9_encodeframe.c: Silence rdmult assignment warning with a cast.
Cast result of round() to int.

Change-Id: Ib708fddfadde4c765001ce9723fda113fd0f4bf6
2014-02-20 12:01:47 -08:00
Tom Finegan
15e95086e2 vp9_encodeframe.c: Silence totalrate assignment warning with a cast.
Cast result of round() to int.

Change-Id: I4982886ad4e7657b4c40d21bd850d31690a68c28
2014-02-20 11:53:11 -08:00
Alex Converse
657519192e Only track mode_chosen_counts if CONFIG_INTERNAL_STATS.
Change-Id: Ia9252ad0caa4d2bda529a3fe93efcb31e7eb2da0
2014-02-19 18:52:04 -08:00
Jingning Han
93ba687499 Use MI_BLOCK_SIZE in block coding loop
Change-Id: Ia70057e11c9b3d9d4bea6fbdd08839334ed02dce
2014-02-19 11:17:12 -08:00
Jingning Han
b99ed1ec5a Rework non-RD mode decision coding flow
In the first coding run of a 64x64 block, check the coding mode
for each 8x8 block. Will need a second annealing stage to decide
the partition size to be encoded.

Change-Id: Ida9417805ff3358979b0c0429d4099c023c88866
2014-02-19 11:13:05 -08:00
Adrian Grange
9b9c33a2b8 Remove comment from calls to vp9_clear_system_state.
Removed the comment "// __asm emms;" from all calls
to vp9_clear_system_state.

Change-Id: Ib4dae69c1cdf3f185b04184a870cd70c4d703f10
2014-02-18 15:43:42 -08:00
Jingning Han
e3178d0c1c Merge "Enable sub-pixel motion search for rtc mode" 2014-02-18 14:52:13 -08:00
Jingning Han
f11a85127b Merge "Initialize internal buffer pointers in rtc mode" 2014-02-18 14:51:38 -08:00
Jingning Han
6478673933 Enable sub-pixel motion search for rtc mode
Run sub-pixel motion search when NEWMV gives lower rate-distortion
cost. This improves coding performance of derf set by 8%, std-hd by
2.2%.

Change-Id: Ife50f7fda8463927784fe59a41cc439c833e941a
2014-02-18 12:07:55 -08:00
Yaowu Xu
8d646becb6 Merge "Removed the reset of mode_info from previous frame" 2014-02-13 17:03:50 -08:00
Yaowu Xu
896d79a57e Removed the reset of mode_info from previous frame
Prior to this commit, both encoder and decoder reset mode/mv info from
previous frame in error resilient mode to ensure bitstreams are able to
decode when there is loss of frame in decoder side. However, this is
not necessary. This commit changed to remove the reset, so encoder can
continue to use mode/mv/partition information from previously encoded
frame without affecting decodeablilty under loss of frame.

Change-Id: I0279f862900dc647fb471ae3389770bb1b9f454f
2014-02-13 12:48:08 -08:00
Jingning Han
95abad9169 Merge "Remove redundant set_offsets in rtc coding mode" 2014-02-13 12:10:45 -08:00
Jingning Han
cc10ee0add Initialize internal buffer pointers in rtc mode
In rtc coding mode, the encoder is running non-RD mode decision. It
does not need dual buffer swap as was the case in the RD mode. This
commit initializes the internal buffer pointers outside the block
coding loop for rtc mode.

Change-Id: Ie076705c60d6b7919217e3f1dfd49e7db5064ac2
2014-02-13 11:41:08 -08:00
Dmitry Kovalev
ea53d6c15f Combining if-else branches from different conditions.
Change-Id: Ie51cf58de4f872d2261022558b6afe780bbc470b
2014-02-13 11:29:45 -08:00
Dmitry Kovalev
df6c523fed Merge "Renaming skip_coeff to skip for consistency." 2014-02-13 11:04:34 -08:00
Jingning Han
4712877ef6 Remove redundant set_offsets in rtc coding mode
The functionalities of set_offsets() are subsumed in later
set_partitioning() and rtc_use_partition() functions, hence removed.

Change-Id: Ie514b13cb66c2379f13d0be9b1da4c12ca4581e5
2014-02-13 09:41:58 -08:00
Paul Wilkins
d84978b84f Merge changes I121fe66c,I94f57f8a
* changes:
  Remove some cases for turning off arf.
  Modified Aq1 and Aq2
2014-02-13 09:31:53 -08:00
Jim Bankoski
75ac2913de Merge "clean out static analyzer warnings vp9_encodeframe.c" 2014-02-13 06:19:26 -08:00
Jingning Han
dea1604ed2 Merge "Remove unnecessary vp9_setup_buffer_inter use" 2014-02-12 17:51:39 -08:00
Jingning Han
3818132a4b Merge "Remove inactive control parameters" 2014-02-12 17:51:30 -08:00
Jingning Han
91b5145673 Merge "Remove unused using_small_partition_info functions" 2014-02-12 17:51:18 -08:00
Jingning Han
ce79e8a114 Merge "Remove unused function in vp9_encodeframe" 2014-02-12 17:51:11 -08:00
Dmitry Kovalev
004c8c636e Renaming skip_coeff to skip for consistency.
Change-Id: I036e815ca63d00cba71202ae09ba0f6ef745dcb8
2014-02-12 17:44:12 -08:00
Jingning Han
3c3dd1d5a3 Remove unnecessary vp9_setup_buffer_inter use
This function initializes the predictor buffer pointers and
calculates reference motion vectors. It is only needed in the settings
of inter frame coding. Hence removing it from the key frame coding
branch in rtc_use_partition.

Change-Id: Ic4e16c7467a5f32be4e0bf619ef9d57afb4a7075
2014-02-12 15:10:23 -08:00
Jingning Han
0eecccc51e Remove inactive control parameters
Change-Id: Ic5692af975fe6bd2d8ec82bbae103c6f7c2fc13e
2014-02-12 12:48:15 -08:00
Jingning Han
25479e94a4 Remove unused using_small_partition_info functions
This function is deprecated after the re-design of partition search
that runs big block size, then four-way split, followed by
rectangular block sizes. This commit removes the related functions.

Change-Id: I417549c8e0fa3cf35bd29816b805dd4e7c3660c6
2014-02-12 12:24:10 -08:00
Jingning Han
2e86d2de85 Remove unused function in vp9_encodeframe
The function rd_pick_reference_frame can be deprecated. Its use was
subsumed by the adaptive motion search control.

Change-Id: Icb0c2fa335f0f06fa7b79a71f972d9fa54d750db
2014-02-12 12:23:29 -08:00
Dmitry Kovalev
0109d757ee Merge "Removing vp9_foreach_transformed_block_uv() function." 2014-02-12 12:11:14 -08:00
Jim Bankoski
df86c4497a clean out static analyzer warnings vp9_encodeframe.c
Change-Id: If14d2fc8cf4202d24f7d87ea74b8ce88a6a816d9
2014-02-12 11:54:04 -08:00
Yaowu Xu
56d0b36092 Merge "Fixed a bug where no valid partition is allowed" 2014-02-12 10:13:49 -08:00
Yaowu Xu
69a6871904 Fixed a bug where no valid partition is allowed
Change-Id: I4d2729dc5c46db2847700256941a66b0957c105d
2014-02-12 09:00:34 -08:00
Dmitry Kovalev
79dd1f8441 Removing vp9_foreach_transformed_block_uv() function.
Change-Id: I35ec77b71e6fd686865cead9281e4dd9e9bc9e86
2014-02-11 18:06:00 -08:00
Yunqing Wang
507fd5220b Enable encode_breakout in real time encoding
In real time encoding, we enable encode_breakout to make encoding
fast. A speed feature "use_encode_breakout" is defined to set
encode_breakout thresholds for different speeds.

However, currently, static_thresh is an encoder option. The encode_
breakout can be turned off if user sets static_thresh=0 specifically.

The rtc set borg test result: (need to set --static_thresh=1)
speed -5, psnr loss -3.543%;
speed -4, psnr loss -2.358%;
speed -3, psnr loss -0.771%.

Encoding speed test:
speed -5, 11% - 60% speedup;
speed -4, 5.5% - 28% speedup;
speed -3, 0.8% - 7% speedup.

Change-Id: Icde592ffbe77eac7446f872a2e9eb2051733677b
2014-02-11 15:30:54 -08:00
Dmitry Kovalev
4fff8566f8 Merge "Cleaning up compute_fast_motion_search_level()." 2014-02-11 11:12:29 -08:00
Jingning Han
220e9a932e Merge "Use more meaningful names for speed features" 2014-02-11 08:49:35 -08:00
Paul Wilkins
f30b323180 Modified Aq1 and Aq2
Aq 1 only updates segment map on kf and arf and
only uses 3 segments. With these settings AQ1 is
+ for most clips in SSIM but negative in psnr.
However, the penalty in PSNR is much less than
previously.

Old version aq1 average results for std hd
-20.899% psnr, -5.809% SSIM
New version aq1 for std hd
-3.57% psnr, +1.23% SSIM

Aq2 Now uses only 2 segments and rd.
This mode is still slightly negative for most clips on
psnr and SSIM but seems to have a much bigger visual
impact on several problem clips than aq mode 1.

Old results for std hd:
-2.578% psnr, -1.151% SSIM
New results for std hd:
-1.561% psnr, -0.85% SSIM

Change-Id: I94f57f8a73121629ce598fb921aad761c1450e1c
2014-02-11 16:27:05 +00:00
Dmitry Kovalev
4a13d53523 Merge "Cleaning up update_stats() function." 2014-02-10 17:30:29 -08:00
Dmitry Kovalev
7e7ae66f74 Merge "Making vp9_activity_masking() static." 2014-02-10 17:29:40 -08:00
Jingning Han
734938dc6b Use more meaningful names for speed features
Use frame_parameter_update to precisely describe the functionality.

Change-Id: Ia9a55ba8efef7b987e30d949dd00ac716189bdb9
2014-02-10 15:20:11 -08:00
Yaowu Xu
855070e254 Merged two similar functions to reduce duplication
Function encode_rtc_frame_internal() and encode_frame_internal() only
differed by a couple of speed features, this commit relocation those
difference into the setup of speed features and merged two functions
into one to remove duplication.

It also fixed a subtle bug super_fast_rtc was used before it was
initialized.

Change-Id: I234a5a1d11a4450930e5b4943dbab434208d5030
2014-02-10 11:36:42 -08:00
Dmitry Kovalev
1a30a8743b Making vp9_activity_masking() static.
Change-Id: Ic6a733f1fe92458da89c8459c5686ba1e08b92bf
2014-02-08 19:41:37 -08:00
Dmitry Kovalev
e1fdcbcb82 Cleaning up compute_fast_motion_search_level().
Change-Id: I151bd3de689bceb72969120095257c37656db92f
2014-02-07 16:39:40 -08:00
Dmitry Kovalev
6c17ab6384 Cleaning up update_stats() function.
Change-Id: I9139210fc6b9878de7844d74dd97784a6d289230
2014-02-07 15:21:31 -08:00
Dmitry Kovalev
9f528c5dbd Removing redundant is_inter_mode() call.
Block type was already detected by is_inter_block() call.

Change-Id: I7923ce11b6a0071ce9df8c744a78c816651a15dc
2014-02-05 11:04:53 -08:00
Dmitry Kovalev
b9fea167f9 Removing DBG_PRNT_SEGMAP.
Change-Id: I71d85e3455545960938e525ae8aa0a667e1db94c
2014-02-04 16:33:03 -08:00
Dmitry Kovalev
3ffb204360 Merge "Removing ENC_DEBUG." 2014-02-03 17:11:52 -08:00
Yongzhe Wang
513faceaed Build fix with config internal stats
Fixes a build issue when internal stats is enabled

Change-Id: I822cc60274e34b5f29ccbaa1f986fb9da6a8de4b
2014-02-03 14:35:48 -08:00
Jim Bankoski
9dec7712ab static function convert to inline or global vp9_blockd.h
Change-Id: Ifdd951f24932839f06d1c700371662511dde6ebe
2014-01-31 19:50:40 -08:00
Jim Bankoski
5ccd193219 Merge "bsize problem 360p" 2014-01-31 16:21:13 -08:00
Dmitry Kovalev
a8a2f22958 Merge "Renaming "mbskip" to "skip"." 2014-01-31 15:52:35 -08:00
Jim Bankoski
1833028681 bsize problem 360p
Fixes an assert that crashed for 360p..

Change-Id: I2faf15c93cbdb0e62a27a3b663f0d09ba62774a8
2014-01-31 15:14:02 -08:00
Yaowu Xu
538b1c6d52 Only allow interp_filter change in SWITCHABLE mode
This commit added a logic to prevent the inter_filter type from being
changed if the default interp_filter mode is not switchable. Also, it
sets the default interp_filter to BILINEAR at very and super fast rtc
encoding modes

Change-Id: Ic41e6d31de29795a4ce536ec79afb01cab6daad3
2014-01-31 15:10:08 -08:00
Yaowu Xu
6a4e2ddabc Properly merge two different real time modes
--rt --cpu-used=-5 uses the progressive rtc mode
--rt --cpu-used=-6 uses the new super fast rtc mode

Change-Id: Id6469ca996100cdf794a0e42d76430161f22f976
2014-01-31 15:07:51 -08:00
Jim Bankoski
da6b18622f remove confusing compressor_speed
use mode instead

Change-Id: I419d7a2dc4b0714ca6ff723c5e824521c150c460
2014-01-31 07:55:19 -08:00
Yaowu Xu
5ebed3e861 Replace inline with INLINE
So x86_64-win64-vs11 can build successfully.

Change-Id: If354c2ea3921fac8c9b413ed39223e70bc20c535
2014-01-30 11:48:16 -08:00
Yaowu Xu
6f81942f0e Fix a build issue for --enable-intern-stats
Change-Id: Iea7c9fa0726dbf9792eea79e6a05eb8a3c718d45
2014-01-30 08:20:08 -08:00
Yaowu Xu
96dc80da61 Merge "create super fast rtc mode" 2014-01-29 16:36:20 -08:00
Yaowu Xu
08b912b4d1 Merge "Add a strict mode for auto_min_max_partition_size feature" 2014-01-29 16:36:06 -08:00
Yaowu Xu
1ca1186529 Add a strict mode for auto_min_max_partition_size feature
In this new mode, the size range is strictly determined by the min
and max partition size in neighborhood blocks.

Niklas720 encoding time at cpu-used -5 goes from 56250ms to 50676ms,
a 10% reduction.

Change-Id: I316b0e2ac967ff3fad57b28d69c0ec80b7d8b34e
2014-01-29 14:51:51 -08:00
Dmitry Kovalev
b107f2c470 Renaming "mbskip" to "skip".
Change-Id: I27a30b43eae026a77f92958e2238d02d9cdf7832
2014-01-29 14:48:42 -08:00
Dmitry Kovalev
70cde0af3d Removing ENC_DEBUG.
Change-Id: I101017621003314f000a454725ea13fc9db43177
2014-01-29 12:58:57 -08:00
Dmitry Kovalev
b00eb5c464 Finally removing vp9_setup_interp_filters() function.
Change-Id: If446225afbb49f6033c2a4516a37c377de6f70f7
2014-01-29 11:29:34 -08:00
Jim Bankoski
ea8aaf15b5 create super fast rtc mode
This patch only works if the video is a width and height that are both
a multiple of 32..   It sets every partition to 16x16, and does INTRADC
only on the first frame and ZEROMV on every other frame.   It always does
does the largest possible transform, and loop filter level is set to 4.

Was ~20% faster than speed -5 of vp8

Now 20% slower but adds motion search ( every block ), nearest, near
and zeromv

The SVC test was changed because - while this realtime mode produces
bad quality albeit quickly, it isn't obeying all the rules it should
about which frames are available.

Change-Id: I235c0b22573957986d41497dfb84568ec1dec8c7
2014-01-29 08:39:39 -08:00
Paul Wilkins
c382136122 Trap divide by 0.
Trap divide by 0 that could occur with a 0 rate target
in aq mode COMPLEXITY_AQ.

Change-Id: I034514f512b2a0db470ae8d37ea395278bf473cf
2014-01-29 14:59:04 +00:00
Dmitry Kovalev
e5b31a1d8c Decoupling set_ref_ptrs() and vp9_setup_interp_filters().
Change-Id: I8d17867a4772554cbba2bd113cc5b4c99d50146d
2014-01-27 16:00:20 -08:00
Dmitry Kovalev
4264c93844 Renaming INTERPOLATION_TYPE to INTERP_FILTER.
Corresponding renames:
  subpel_kernel              => interp_kernel
  vp9_get_filter_kernel()    => vp9_get_interp_kernel()
  pred_filter_type           => pred_interp_filter
  adaptive_pred_filter_type  => adaptive_pred_interp_filter
  mcomp_filter_type          => interp_filter
  read_interp_filter_type()  => read_interp_filter()
  write_interp_filter_type() => write_interp_filter()
  fix_mcomp_filter_type()    => fix_interp_filter()

Change-Id: I1fa61fa1dc81ebbf043457c3ee2d8d4515bee6d3
2014-01-24 15:57:28 -08:00
Yaowu Xu
ebe160568b Prevent invaid memory access
Reading second motion vector only when it has a second ref_frame

Change-Id: Ica72c1cd955832e15ceccda5e5a17b0bfcd83044
2014-01-22 09:10:44 -08:00
Jingning Han
b461c0884e Deprecate best_mv from encoder
This commit deprecates the use of best_mv from encoding and bit-stream
writing stages. It hence removes the definition from MACROBLOCKD.

Change-Id: I8e5302775a2aa4a18900726df407bff881f2dfb1
2014-01-17 17:15:34 -08:00
Jingning Han
98b01c038f Rename pick_sb_modes to rd_pick_sb_modes
Keep naming consistency for RD and non-RD mode decision functions,
respectively.

Change-Id: I904282b675fc511a46c13cb1f8287aa5d1c8ac94
2014-01-16 18:05:42 -08:00
Jingning Han
2f52decd22 Inter-frame non-RD mode decision
This commit setups a test framework for real-time coding. It enables
a light motion search for non-RD mode decision purpose.

Change-Id: I8bec656331539e963c2b685a70e43e0ae32a6e9d
2014-01-16 12:35:04 -08:00
Jim Bankoski
73cd22f8d4 As you go mbmi->skip_coeff
Calculate the skip_coeff as part of the encode process, rather than
checking the eobs after the fact with another pass.

Change-Id: Ib41b139e96a97dee30e4b993b4cc53d86337128d
2014-01-14 17:58:25 -08:00
Dmitry Kovalev
a8bb1ffd89 Merge "Reusing get_frame_new_buffer() function." 2014-01-14 14:40:48 -08:00
Dmitry Kovalev
f3728f20ea Merge "Cleaning up vp9_encodeframe.c." 2014-01-14 14:14:49 -08:00
Dmitry Kovalev
9855b6e510 Reusing get_frame_new_buffer() function.
Change-Id: Iac5c5aeaef62a4095a60d91285d2c7ad717db0fb
2014-01-13 14:04:56 -08:00
Jingning Han
4f969ccc1b Merge "Enable skipping reference frame check in rd loop" 2014-01-10 16:00:56 -08:00
Dmitry Kovalev
3df5c54ad7 Cleaning up vp9_encodeframe.c.
Change-Id: I6d9f595249dc71752abe16c042d3b07aa2e4248d
2014-01-10 13:48:44 -08:00
Jingning Han
d66c748635 Enable skipping reference frame check in rd loop
This commit allows encoder to compare the SAD cost associated with
the best motion vector predictor, per frame. If one reference frame
has this cost more than 4 times of the best SAD cost given by other
reference frames, skip NEARESTMV, NEARMV, ZEROMV mode check of this
reference frame.

This setting is turned on in speed 2 and above. Compression quality
change in speed 2:
derf  -0.014%
yt    -0.097%
hd    -0.023%
stdhd  0.046%

It reduces the speed 2 runtime of test sequences:
pedestrian_area_1080p 4000 kbps 310763 ms -> 303595 ms
bluesky_1080p 6000 kbps         259852 ms -> 251920 ms

Change-Id: I7f59cf79503d51836d61d56d50dc5bdf0e502e22
2014-01-09 18:25:53 -08:00
Dmitry Kovalev
0ecd583d8d Cleanups around cpi->common.
Change-Id: I0c42a729038d0f4cb7bc07f587d066fcb1dfe9d9
2014-01-08 14:51:00 -08:00
Dmitry Kovalev
7b496783c2 Merge "Adding get_ref_frame_buffer() function." 2014-01-07 09:56:06 -08:00