Commit Graph

2183 Commits

Author SHA1 Message Date
Jingning Han
38fa487164 Shortcut 8x8/16x16 inverse 2D-DCT
This commit brought back the shortcut implementation of 8x8/16x16
inverse 2D-DCT. When the eob <= 10, it skips the inverse transform
operations on row 4:7/4:15 in the first round. For bus_cif at 1000
kbps, this provides about 2% speed-up at speed 0.

Change-Id: I453e2d72956467d75be4ad8c04b4482ab889d572
2013-07-26 17:19:14 -07:00
Jingning Han
325e0aa650 Special handle on DC only inverse 8x8 2D-DCT
This commit enables a special handle for the 8x8 inverse 2D-DCT,
where only DC coefficient is quantized to be non-zero. For bus_cif
at 2000 kbps, it provides about 1% speed-up at speed 0.

Change-Id: I2523222359eec26b144cf8fd4c63a4ad63b1b011
2013-07-26 14:16:51 -07:00
Yunqing Wang
52256cdbca Modify static threshold calculation
Used 3 * standard_deviation in internal threshold calculation
instead of fit curve. This actually approached the algorithm
better.
For comparison, similar tests were done:
The overall psnr loss is less than before.
1. derf set:
when static-thresh = 1, psnr loss is 0.329%;
when static-thresh = 500, psnr loss is 0.970%;
2. stdhd set:
when static-thresh = 1, psnr loss is 0.922%;
when static-thresh = 500, psnr loss is 1.307%;

Similar speedup is achieved. For example,
clip            bitrate  static-thresh psnr    time
akiyo(cif)       500        0          48.952  5.077s(50f)
akiyo            500        500        48.866  4.169s(50f)

parkjoy(1080p)   4000       0          30.388  78.20s(30f)
parkjoy          4000       500        30.367  70.85s(30f)

sunflower(1080p) 4000       0          44.402  74.55s(30f)
sunflower        4000       500        44.414  68.69s(30f)

Change-Id: Ic78833642ce1911dbbd1cb6c899a2d7e2dfcc1f3
2013-07-25 19:59:33 -07:00
Johann
67b07c520d Merge "Add const to vp9_accum_mv_refs parameter" 2013-07-25 15:10:52 -07:00
Yunqing Wang
845fd5011c Merge "Add encoding option --static-thresh" 2013-07-25 14:58:00 -07:00
Yunqing Wang
d36852b702 Add encoding option --static-thresh
This option exists in VP8, and it was rewritten in VP9 to support
skipping on different partition levels. After prediction is done,
we can check if the residuals in the partition block will be all
quantized to 0. If this is true, the skip flag is set, and only
prediction data are needed in reconstruction. Based on DCT's energy
conservation property, the skipping check can be estimated in
spatial domain.

The prediction error is calculated and compared to a threshold.
The threshold is determined by the dequant values, and also
adjusted by partition sizes. To be precise, the DC and AC parts
for Y, U, and V planes are checked to decide skipping or not.

Test showed that
1. derf set:
when static-thresh = 1, psnr loss is 0.666%;
when static-thresh = 500, psnr loss is 1.162%;
2. stdhd set:
when static-thresh = 1, psnr loss is 1.249%;
when static-thresh = 500, psnr loss is 1.668%;

For different clips, encoding speedup range is between several
percentage and 20+% when static-thresh <= 500. For example,
clip            bitrate  static-thresh psnr    time
akiyo(cif)       500        0          48.923  5.635s(50f)
akiyo            500        500        48.863  4.402s(50f)

parkjoy(1080p)   4000       0          30.380  77.54s(30f)
parkjoy          4000       500        30.384  69.59s(30f)

sunflower(1080p) 4000       0          44.461  85.2s(30f)
sunflower        4000       500        44.418  78.1s(30f)

Higher static-thresh values give larger speedup with larger
quality loss.

Change-Id: I857031ceb466ff314ab580ac5ec5d18542203c53
2013-07-25 14:28:05 -07:00
Johann
6c8ef8d957 Add const to vp9_accum_mv_refs parameter
Change-Id: I0625d8ffddf590dfecd1bb8b8d6f57ef64b8bf18
2013-07-25 14:25:33 -07:00
Dmitry Kovalev
d53fc9ee4e Merge "Adding lookup table for size group." 2013-07-25 13:57:28 -07:00
Dmitry Kovalev
08fd41ccd7 Adding lookup table for size group.
Change-Id: Ia6144d77ebed66e0739b62e4d673e26a95aa9550
2013-07-25 12:58:54 -07:00
Adrian Grange
e862c6f9eb Merge "Simplify handling of sub-partition motion vectors" 2013-07-25 12:58:38 -07:00
Adrian Grange
6f0f0e4907 Merge "Use local variables rather than structure members" 2013-07-25 12:57:52 -07:00
Dmitry Kovalev
be00d3970d Merge "Removing duplicated code for merging two probabilities." 2013-07-25 12:52:26 -07:00
Dmitry Kovalev
d604914f09 Merge "Removing vp9_adapt_mode_context function." 2013-07-25 12:46:31 -07:00
Jingning Han
d571af76d3 Merge "Make coeff_optimize initialized per-plane" 2013-07-25 12:46:14 -07:00
Dmitry Kovalev
f7ece83141 Merge "Inlining inc_mv_component_count function." 2013-07-25 12:45:23 -07:00
Dmitry Kovalev
9f8335d091 Merge "Removing duplicated PREDICTION_PROBS constant." 2013-07-25 12:45:03 -07:00
Yaowu Xu
51a8458822 Merge "fix a bug where flags are not reset" 2013-07-25 12:18:51 -07:00
Adrian Grange
be700e140a Simplify handling of sub-partition motion vectors
Simplified the code that extracts and uses the motion
vectors for the 4 sub-partitions in rd_pick_partition.

Change-Id: Iaf698ef7ee3aef9edd59015e1ae065dd359b17d9
2013-07-25 11:51:51 -07:00
Jingning Han
2f58faffa4 Make coeff_optimize initialized per-plane
This commit makes the initialization of trellis coeff optimization
a per-plane operation, thereby eliminating the redundant steps in
encode_sby and encode_sbuv. It makes the encoder at speed 0 slightly
faster.

Change-Id: Iffe9faca6a109dafc0dd69dc7273cbdec19b17cd
2013-07-25 11:44:29 -07:00
Dmitry Kovalev
778989a097 Removing duplicated PREDICTION_PROBS constant.
Already defined in vp9_seg_common.h.

Change-Id: I5a0e3fa15966b1ebeb77ccd506b55fc231c22342
2013-07-25 11:08:21 -07:00
Dmitry Kovalev
47d61f008f Removing vp9_adapt_mode_context function.
Moving code from vp9_adapt_mode_context to vp9_adapt_mode_probs.

Change-Id: I60829c30b28968cd813551ef3a206dfb98d323c9
2013-07-25 10:48:45 -07:00
Yaowu Xu
3e386aefc2 fix a bug where flags are not reset
The feature that uses small partition results as a measure to skip
mode evaluation at larger partition requires the flags to be reset.
The reset was missing in the code path that calls rd_use_partition().

Change-Id: Ia0a3a0aee1a862b6e2333d596808db7c48033d50
2013-07-25 10:28:38 -07:00
Jingning Han
242157c756 Merge "SSE2 inverse 4x4 2D-DCT with DC only" 2013-07-25 08:49:37 -07:00
Scott LaVarnway
a0e8b45fee Merge "pack_inter_mode_mvs cleanup" 2013-07-25 04:47:56 -07:00
Jingning Han
384e37e32b SSE2 inverse 4x4 2D-DCT with DC only
Add SSE2 implementation to handle the special case of inverse 2D-DCT
where only DC coefficient is non-zero.

Change-Id: I2c6a59e21e5e77b8cf39a4af5eecf4d5ade32e2f
2013-07-24 23:19:56 -07:00
Jingning Han
91fa12429c Merge "Merge vp9_dc_only_idct_add and vp9_short_idct4x4_1" 2013-07-24 23:18:24 -07:00
Dmitry Kovalev
40358dc406 Removing duplicated code for merging two probabilities.
Adding common merge_probs and merge_probs2 functions. Changing ints to
usigned ints in some places.

Change-Id: Icf088ffdea7cf5b95284a128916409bdd53506b0
2013-07-24 17:44:04 -07:00
Dmitry Kovalev
4450fa4cd9 Inlining vp9_init_mode_contexts function.
Change-Id: I21ee76bcae101cc9f6ef1d867622e50b7ae565fc
2013-07-24 17:03:03 -07:00
Jingning Han
d2de1ca37b Merge vp9_dc_only_idct_add and vp9_short_idct4x4_1
They share the same functionality, so merging together.

Change-Id: I98a0386fcee052cb854f9ff90c283c1b844bcb79
2013-07-24 16:51:15 -07:00
Dmitry Kovalev
fcc34796d2 Removing CONFIG_BALANCED_COEFTREE experiment.
Change-Id: I61a8b0101eac3ee2e0621d56151b90c269fd4db4
2013-07-24 15:53:42 -07:00
Dmitry Kovalev
1787b00214 Merge "Adding condition inside get_tx_type_{4x4, 8x8, 16x16}." 2013-07-24 15:23:22 -07:00
Dmitry Kovalev
0064958c71 Inlining inc_mv_component_count function.
Change-Id: Ic99d07a56b1752ec49fc5074b1dd6804b17609a0
2013-07-24 15:03:00 -07:00
Dmitry Kovalev
9139ee0908 Adding condition inside get_tx_type_{4x4, 8x8, 16x16}.
Adding plane type check condition because it was always used outside of
get_tx_type_{4x4, 8x8, 16x16}.

Change-Id: I02f0bbfee8063474865bd903eb25b54d26e07230
2013-07-24 12:55:45 -07:00
James Zern
9e29b4cd54 Merge "vp9_find_mv_refs_idx: remove unused split_count" 2013-07-24 12:49:15 -07:00
James Zern
e6c0387edd vp9_find_mv_refs_idx: remove unused split_count
variable was write only

Change-Id: I04b002178f66961836ee08fb60a05b91b54e91d8
2013-07-24 11:51:37 -07:00
Adrian Grange
4cfd36d8fd Use local variables rather than structure members
Although local copies of the mode member variables
(mode, ref_frame) were made, they were not used in
all places. Also, made a local copy of the
second_ref_frame member.

Change-Id: I84d8c822e5cb3d8a02fc3de8a4037ca3fea8bfad
2013-07-24 11:17:44 -07:00
Adrian Grange
a183f17d33 Merge "Correct spelling mistakes" 2013-07-24 09:48:57 -07:00
Adrian Grange
bc8b0529db Correct spelling mistakes
Change-Id: Id4138293efeac4503b2e01ce7a6c150a5abeef77
2013-07-24 07:58:26 -07:00
Ronald S. Bultje
47336afd8d Merge "More optimizations for cost_coeffs()." 2013-07-23 21:36:12 -07:00
Jingning Han
666c266623 Merge "Unify the use of encode_b_args/optimize_block_args" 2013-07-23 18:08:50 -07:00
Dmitry Kovalev
1099a436d3 Moving counts from FRAME_CONTEXT to new struct FRAME_COUNTS.
Counts are separate from frame context. We have several frame contexts but
need only one copy of all counts.

Change-Id: I5279b0321cb450bbea7049adaa9275306a7cef7d
2013-07-23 17:02:08 -07:00
Jingning Han
ab77828b36 Unify the use of encode_b_args/optimize_block_args
The struct optimize_block_args is defined same as encode_b_args.
Remove this redundant definition, and use encode_b_args consistently.

Change-Id: I1703aeeb3bacf92e98a34f4355202712110173d9
2013-07-23 16:04:02 -07:00
Dmitry Kovalev
8d13b0d1df Removing LOW_PRECISION_MV_UPDATE define.
Change-Id: I78d16ee758e1fae0200b746f00031f6d9c6d6ce7
2013-07-23 15:41:45 -07:00
Dmitry Kovalev
a9bbabd94b Merge "Removing vp9_is_interpolating_filter array." 2013-07-23 15:01:19 -07:00
Adrian Grange
719cd35f3a Merge "Rolled-up several for loops into one" 2013-07-23 15:00:06 -07:00
Adrian Grange
646edbc1b2 Rolled-up several for loops into one
Several consecutive for loops executed over the same
index range, so I rolled them into one.

Change-Id: I5cfcc8c38c738478965768409cca9d09adf224e1
2013-07-23 14:32:21 -07:00
Dmitry Kovalev
db7f5d28b9 Removing vp9_is_interpolating_filter array.
All filters are interpolating now, so we don't need this array, all
values from this array are evaluated to true.

Change-Id: I9af6d8219ae0eb984063cd15e4e2296374ae4961
2013-07-23 14:24:39 -07:00
Dmitry Kovalev
2855d8aea1 Merge "Adding update_tx_counts function." 2013-07-23 13:57:59 -07:00
Dmitry Kovalev
0d59d6efcd Merge "Removing MODE_COUNT_TESTING from vp9_entropymode.c." 2013-07-23 13:57:05 -07:00
Jingning Han
825f676ceb Merge "Make xform_quant operations tx_type independent" 2013-07-23 13:40:27 -07:00