Commit Graph

2584 Commits

Author SHA1 Message Date
Dmitry Kovalev
569ca37d09 Moving plane_block_idx from vp9_blockd.h to vp9_quantize.c.
Change-Id: Ib8af21f2e7f603c2fb407e5d15a3bba64b545b49
2013-08-19 16:44:10 -07:00
Jingning Han
3275ad701a Enable early termination in uv rd loop
This commit enables early termination in the rate-distortion
optimization search loop for chroma components. When the cumulative
rd cost is above the current best value, skip the rest per-block
transform/quantization/coeff_cost and continue to the next
prediction mode.

For bus_cif at 2000 kbps, the average run-time goes down from
168546ms -> 164678ms, (2% speed-up) at speed 0
 36197ms ->  34465ms, (4% speed-up) at speed 1

Change-Id: I9d3043864126e62bd0166250d66b3170d520b3c0
2013-08-19 16:31:19 -07:00
Dmitry Kovalev
82d4d9a008 Passing plane_bsize to foreach_transformed_block_visitor.
Updating all foreach_transformed_block_visitor functions to work with
plane block size instead of general block. Removing a lot of duplicated
code.

Change-Id: I6a9069e27528c611f5a648e1da0c5a5fd17f1bb4
2013-08-19 15:47:24 -07:00
Jingning Han
31c97c2bdf Merge "Fix potential use of uninitialized value" 2013-08-19 15:15:58 -07:00
Jingning Han
5dc0b309ab Merge "Fix the returned distortion value in rd_pick_intra" 2013-08-19 14:34:19 -07:00
Dmitry Kovalev
2e3478a593 Using plane_bsize instead of bsize.
This change set is intermediate. The next one will remove all repetitive
plane_bsize calculations, because it will be passed as argument to
foreach_transformed_block_visitor.

Change-Id: Ifc12e0b330e017c6851a28746b3a5460b9bf7f0b
2013-08-19 13:20:21 -07:00
Adrian Grange
5a1a269f67 Further correct bug in loopfilter initialization
The intent was to initialize the deltas for the
segment to the computed value, irrespective of mode
and reference frame if (mode_ref_delta_enabled == 0).

(In response to bug posted by Manjit Hota to codec-devel
and webm-discuss lists)

Change-Id: I10435cb63d0f88359bb4c14f22181878a1988e72
2013-08-19 11:58:52 -07:00
Jingning Han
b34ce04378 Fix potential use of uninitialized value
Initialize the best mode and tx_size values in the rate-distortion
optimization search loop.

Change-Id: Ibfb5c0895691f172abcd4265c23aef4cb99fa8af
2013-08-19 11:15:53 -07:00
Jingning Han
f67919ae86 Fix the returned distortion value in rd_pick_intra
Return the distortion value in vp9_rd_pick_intra_mode_sb as sum of
dist_y and dist_uv. Remove the right shift operation on dist_uv,
and make it consistent with that of vp9_rd_pick_inter_mode_sb.

Change-Id: I9d564e242d9add38e32595d33b0e0dddb1d55e5b
2013-08-16 21:23:22 -07:00
Dmitry Kovalev
26e5b5e25d Removing unused or redundant arguments from *_args structures.
Redundant dst, pre[2] from build_inter_predictors_args, unused cm from
encode_b_args.

Change-Id: I2c476cd328c5c0cca4c78ba451ca6ba2a2c37e2d
2013-08-16 12:51:20 -07:00
Dmitry Kovalev
367cb10fcf Merge "Moving from ss_txfrm_size to tx_size." 2013-08-16 12:46:45 -07:00
Dmitry Kovalev
1462433370 Merge "Renaming d27 predictor to d207." 2013-08-16 12:07:24 -07:00
Johann
d514b778c4 Merge "Reduce the instructions of idct8x8. Also add the saving and restoring of D registers." 2013-08-16 11:30:21 -07:00
Johann
65aa89af1a Merge "Reduce instructions of idct4x4." 2013-08-16 11:28:35 -07:00
Frank Galligan
bdc785e976 Merge "vp9: neon: optimise vp9_wide_mbfilter_neon" 2013-08-16 11:16:48 -07:00
hkuang
df0715204c Reduce instructions of idct4x4.
Change-Id: Ia26a2526804e7e2f656b0051618a615fca8fc79d
2013-08-16 10:54:56 -07:00
hkuang
60ecd60c9a Reduce the instructions of idct8x8. Also add the
saving and restoring of D registers.

Change-Id: Id3630c90fcb160ef939fef55411342608af5f990
2013-08-16 10:32:12 -07:00
Johann
bba68342ce Merge "vp9: neon: use aligned stores in convolve functions" 2013-08-16 10:29:59 -07:00
Adrian Grange
79f4c1b9a4 Fixed typos and formatting
Change-Id: I3814984a624bc64147c57efa74fbdda8eda47262
2013-08-16 09:15:26 -07:00
Adrian Grange
3e340880a8 Merge "Added resizing & initialization of last frame segment map" 2013-08-16 09:07:36 -07:00
Mans Rullgard
4fa93bcef4 vp9: neon: use aligned stores in convolve functions
The destination is block-aligned so it is safe to use aligned
stores.

Change-Id: I38261e4fa40bc60e6472edffece59e372908da7e
2013-08-16 14:25:08 +01:00
Dmitry Kovalev
afd9bd3e3c Moving from ss_txfrm_size to tx_size.
Updating foreach_transformed_block_visitor and corresponding functions
to accept tx_size instead of ss_txfrm_size. List of functions per file:

vp9_decodframe.c
  decode_block
  decode_block_intra

vp9_detokenize.c
  decode_block

vp9_encodemb.c
  optimize_block
  vp9_xform_quant
  vp9_encode_block_intra

vp9_rdopt.c
  dist_block
  rate_block
  block_yrd_txfm

vp9_tokenize.c
  set_entropy_context_b
  tokenize_b
  is_skippable

Change-Id: I351bf563eb36cf34db71c3f06b9bbc9a61b55b73
2013-08-15 17:03:03 -07:00
Jingning Han
5e80a49307 Merge "Refactor rd loop for chroma components" 2013-08-15 16:02:12 -07:00
Adrian Grange
d5bec522da Added resizing & initialization of last frame segment map
When the frame size changes the last frame segment map must
be resized to match and initialized to 0.

Change-Id: Idc10de109f55dbe9af3a6caae355a2974712243d
2013-08-15 15:35:21 -07:00
Dmitry Kovalev
9451e8d37e Merge "Converting code from using ss_txfrm_size to tx_size." 2013-08-15 15:21:09 -07:00
Dmitry Kovalev
939b1e4a8c Merge "Moving segmentation struct from MACROBLOCKD to VP9_COMMON." 2013-08-15 15:14:32 -07:00
Johann
a9aa7d07d0 Merge "vp9: neon: add vp9_convolve_avg_neon" 2013-08-15 14:55:15 -07:00
Johann
63e140eaa7 Merge "vp9: neon: add vp9_convolve_copy_neon" 2013-08-15 14:55:08 -07:00
Jingning Han
68369ca897 Refactor rd loop for chroma components
This commit makes the rate-distortion optimization search of chroma
components consistent across all block sizes. It removes redundant
codes.

Change-Id: I7e76f54d045e8efdd41d84a164c71f55b484471b
2013-08-15 14:54:48 -07:00
Jingning Han
c2ff1882ff Merge "Remove unused RDCOST_8X8 macro" 2013-08-15 13:48:25 -07:00
Jingning Han
ca983f34f7 Merge "Unify luma and chroma rd-cost estimation" 2013-08-15 13:48:15 -07:00
Dmitry Kovalev
bb3b817c1e Converting code from using ss_txfrm_size to tx_size.
Updated function signatures:
  txfrm_block_to_raster_block
  txfrm_block_to_raster_xy
  extend_for_intra
  vp9_optimize_b

Change-Id: I7213f4c4b1b9ec802f90621d5ba61d5e4dac5e0a
2013-08-15 11:44:57 -07:00
Dmitry Kovalev
6f4fa44c42 Using { 0 } for initialization instead of memset.
Change-Id: I4fad357465022d14bfc7e13b348c6da267587314
2013-08-15 11:37:56 -07:00
Dmitry Kovalev
81d7bd50f5 Renaming d27 predictor to d207.
27 degrees intra predictor is actually 207 degrees, so renaming it.

Change-Id: Ife96a910437eb80ccdc0b7a5b7a62c77542ae5be
2013-08-15 11:09:49 -07:00
Mans Rullgard
67e53716e0 vp9: neon: optimise vp9_wide_mbfilter_neon
Break up long dependency chains to improve instruction scheduling.

Change-Id: I0e0cb66943df24af920767bb4167b25c38af9630
2013-08-15 19:07:22 +01:00
James Zern
89a1fcf884 Merge "vp9_dx_iface: check for NULL/0-size input" 2013-08-15 10:59:22 -07:00
Dmitry Kovalev
b7616e387e Moving segmentation struct from MACROBLOCKD to VP9_COMMON.
VP9_COMMON is the right place to segmentatation struct because it has
global segmentation parameters, not something specific to macroblock
processing.

Change-Id: Ib9ada0c06c253996eb3b5f6cccf6a323fbbba708
2013-08-15 10:47:48 -07:00
Jingning Han
b0646f9e98 Remove unused RDCOST_8X8 macro
Change-Id: I17c7d7eaa60fe69c543403c340f7c1078bfd339f
2013-08-15 10:40:44 -07:00
Dmitry Kovalev
4d73416099 Merge "Quantization code cleanup." 2013-08-15 10:23:01 -07:00
Deb Mukherjee
24856b6abc Speed feature to skip split partition based on var
Adds a speed feature to disable split partition search based on a
given threshold on the source variance. A tighter threshold derived
from the threshold provided is used to also disable horizontal and
vertical partitions.

Results on derfraw300:
threshold = 16, psnr = -0.057%, speedup ~1% (football)
threshold = 32, psnr = -0.150%, speedup ~4-5% (football)
threshold = 64, psnr = -0.570%, speedup ~10-12% (football)

Results on stdhdraw250:
threshold = 32, psnr = -0.18%, speedup is somewhat more than derf
because of a larger number of smoother blocks at higher resolution.

Based on these results, a threshold of 32 is chosen for speed 1,
and a threshold of 64 is chosen for speeds 2 and above.

Change-Id: If08912fb6c67fd4242d12a0d094783a99f52f6c6
2013-08-15 10:01:45 -07:00
Jingning Han
ec01f52ffa Unify luma and chroma rd-cost estimation
This commit unifies the rate-distortion cost calculation process of
luma and chroma components. It allows early termination to be enabled
later in the rd search loop of chroma components, in consistent with
luma pixels.

Change-Id: I2e52a7c6496176bf2a5e3ef338d34ceb8aad9b3d
2013-08-15 09:41:33 -07:00
Paul Wilkins
1a3641d91b Merge "Renaming in MB_MODE_INFO" 2013-08-15 02:12:48 -07:00
James Zern
20395189cd vp9_dx_iface: check for NULL/0-size input
avoids a crash caused by issue #585

Change-Id: I301595ee0227699b0da6f0dad6d870dd546e94ef
2013-08-14 18:35:22 -07:00
hkuang
39f42c8713 Merge "Add neon optimize vp9_short_idct16x16_add." 2013-08-14 14:16:20 -07:00
hkuang
cf6beea661 Add neon optimize vp9_short_idct16x16_add.
Change-Id: I27134b9a5cace2bdad53534562c91d829b48838d
2013-08-14 13:52:16 -07:00
Dmitry Kovalev
bb072000e8 foreach_transformed_block_in_plane cleanup, explicit tx_size var.
Making foreach_transformed_block_in_plane more clear (it's not finished
yet). Using explicit tx_size variable consistently instead of
(ss_txfrm_size / 2) or (ss_txfrm_size >> 1) expression.

Change-Id: I1b9bba2c0a9f817fca72c88324bbe6004766fb7d
2013-08-14 11:39:31 -07:00
Dmitry Kovalev
f2c073efaa Adding const to arguments of intra prediction functions.
Adding const to above and left pointers. Cleanup.

Change-Id: I51e195fa2e2923048043fe68b4e38a47ee82cda1
2013-08-14 10:35:56 -07:00
Mans Rullgard
0f1deccf86 vp9: neon: add vp9_convolve_avg_neon
Change-Id: I33cff9ac4f2234558f6f87729f9b2e88a33fbf58
2013-08-14 16:27:55 +01:00
Mans Rullgard
635ba269be vp9: neon: add vp9_convolve_copy_neon
Change-Id: I15adbbda15d1842e9f15f21878a5ffbb75c3c0c9
2013-08-14 16:27:55 +01:00
Paul Wilkins
26fead7ecf Renaming in MB_MODE_INFO
The macro block mode info context originally contained an
entry for each 16x16 macroblock. In VP9 each entry refers
to an 8x8 region not a macro block, so the naming is misleading.

This first stage clean up changes the names of 3 entries in the
structure to remove the mb_ prefix.

TODO clean up the nomenclature more widely in respect of
mbmi and bmi.

Change-Id: Ia7305c6d0cb805dfe8cdc98dad21338f502e49c6
2013-08-14 12:47:52 +01:00
Paul Wilkins
54979b4350 Merge "Honor min_partition_size properly for non-square splits" 2013-08-14 04:45:18 -07:00
Guillaume Martres
fc50477082 Honor min_partition_size properly for non-square splits
Don't do vertical or horizontal splits if subsize < min_partition_size,
except for edge blocks where it makes sense.

Change-Id: I479aa66ba1838d227b5de8312d46be184a8d6401
2013-08-13 15:24:03 -07:00
Dmitry Kovalev
bcc8e9d9c6 Merge "Little cleanup inside decode_tile() function." 2013-08-13 14:43:10 -07:00
Guillaume Martres
ecb78b3e0c Merge "Trivial clean up." 2013-08-13 12:40:37 -07:00
Jingning Han
7e0f88b6be Use lookup table to find largest txfm size
Refactor choose_largest_txfm_size_ and make it find the largest
transform size via lookup table.

Change-Id: I685e0396d71111b599d5367ab1b9c934bd5490c8
2013-08-13 10:32:14 -07:00
Dmitry Kovalev
8105ce6dce Merge "Using is_inter_block() instead of repetitive code." 2013-08-13 10:00:01 -07:00
Jingning Han
dc70fbe42d Merge "Refactor model based tx search in super_block_yrd" 2013-08-13 08:48:49 -07:00
Paul Wilkins
5459f68d71 Trivial clean up.
Delete unused / commented out  variable references.

Change-Id: Iaf20c0c3744f89adb296d153b516b5ea41b4f3b4
2013-08-13 13:26:18 +01:00
Paul Wilkins
8e35263bed Merge "Honor min_partition_size properly" 2013-08-13 05:19:51 -07:00
Jingning Han
39fe235032 Merge "SSE2 high precision 32x32 forward DCT" 2013-08-12 23:03:47 -07:00
Dmitry Kovalev
2c7ae8c29a Little cleanup inside decode_tile() function.
Change-Id: I3ed4beb59371fe21ca3e82253aa98e0cbd5e0630
2013-08-12 18:28:13 -07:00
Johann
4417c04531 Merge "vp9: neon: optimise convolve8_vert functions" 2013-08-12 17:54:47 -07:00
Johann
4cabbca4ce Merge "vp9: neon: optimise convolve8_horiz functions" 2013-08-12 17:54:42 -07:00
Dmitry Kovalev
32006aadd8 Using is_inter_block() instead of repetitive code.
Change-Id: If0b04c476c34fb8c102c9f750d7fe5669a86a532
2013-08-12 17:42:14 -07:00
Jingning Han
78136edcdc SSE2 high precision 32x32 forward DCT
Enable SSE2 implementation of high precision 32x32 forward DCT. The
intermediate stacks are of 32-bits. The run-time goes down from
32126 cycles to 13442 cycles.

Change-Id: Ib5ccafe3176c65bd6f2dbdef790bd47bbc880e56
2013-08-12 16:52:53 -07:00
Jingning Han
14cc7b319f Refactor model based tx search in super_block_yrd
Remove unnecessary conditional branches in model-based transform
size search.

Change-Id: Ic862dc33ed6710a186f6248239dd5f09b5c19981
2013-08-12 16:34:48 -07:00
Dmitry Kovalev
b89eef8f82 Merge "Simplifying vp9_mvref_common.c." 2013-08-12 16:24:22 -07:00
Dmitry Kovalev
b214cd0dab Merge "Removing foreach_predicted_block_uv function." 2013-08-12 15:54:01 -07:00
Dmitry Kovalev
98e3d73e16 Merge "Using MV* instead of int_mv* as argument of vp9_clamp_mv_min_max." 2013-08-12 15:53:25 -07:00
Dmitry Kovalev
1a5e6ffb02 Simplifying vp9_mvref_common.c.
Change-Id: I272df2e33fa05310466acf06c179728514dd7494
2013-08-12 15:52:08 -07:00
Dmitry Kovalev
9d5885b0ab Quantization code cleanup.
Change-Id: I77b42418b852093f79260cbd880533a0bd86678f
2013-08-12 15:23:47 -07:00
Dmitry Kovalev
c66320b3e4 Merge "Entropy context related cleanups." 2013-08-12 15:18:24 -07:00
Dmitry Kovalev
bd1bc1d303 Merge "Making scaling code more clear." 2013-08-12 15:17:26 -07:00
Dmitry Kovalev
9a31d05e24 Removing unused convolve_avg_c function + cleanup.
Change-Id: Id2b126c6456627c25e4041a82e304d0151d951ba
2013-08-12 14:28:00 -07:00
Dmitry Kovalev
1aedfc992a Using MV* instead of int_mv* as argument of vp9_clamp_mv_min_max.
Change-Id: I3c45916a9059f11b41e9d798e34ffee052969a44
2013-08-12 13:56:04 -07:00
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
a72e269318 Making scaling code more clear.
Reusing existing functions, using constants instead of magic numbers.

Change-Id: Idc689ffba52c9a8b203fcf26bd67110ecb5635f9
2013-08-12 13:30:26 -07:00
Jingning Han
3984b41c87 Fix a compile failure in vp9_get_compressed_data
The lf struct is now with VP9_COMMON, instead of MACROBLOCKD.

Change-Id: Idfdd4f91f78f486078a138322d58bb61e93e1bc9
2013-08-12 11:42:17 -07:00
Dmitry Kovalev
8b0e6035a2 Entropy context related cleanups.
Adding set_skip_context() function used from both encoder and decoder.

Change-Id: Ia22cfad3211a00a63eb294f64f857b78f4aa9b85
2013-08-12 11:24:24 -07:00
Mans Rullgard
ad7021dd6c vp9: neon: optimise convolve8_vert functions
Invert loops to operate vertically in the inner loop.  This allows
removing redundant loads.

Also add preloading of data.

Change-Id: I4fa85c0ab1735bcb1dd6ea58937efac949172bdc
2013-08-12 15:37:48 +01:00
Dmitry Kovalev
097046ae28 Merge "Removing redundant code and function arguments." 2013-08-11 12:20:58 -07:00
Mans Rullgard
b84dc949c8 vp9: neon: optimise convolve8_horiz functions
Each iteration of the horizontal loop reuses 7 of the 11 source
values.  Loading only the 4 new values saves some time.

Also add preload for source data.

Overall 4% faster on Chromebook.

Change-Id: I8f69e749f2b7f79e9734620dcee51dbfcd716b44
2013-08-11 16:21:55 +01:00
Dmitry Kovalev
3c43ec206c Renaming BLOCK_SIZE_TYPES constant to BLOCK_SIZES.
There will be another change set to rename BLOCK_SIZE_TYPE enum to
BLOCK_SIZE.

Change-Id: I8d1dfc873d6186fa5e554262f5169e929978085e
2013-08-09 17:47:32 -07:00
Guillaume Martres
58b07a6f9d Honor min_partition_size properly
It represents the minimum partition size, so don't split if
bsize == min_partition_size .

Change-Id: Id77c32d6afef7d2ddec0368eaae18fb13227d30e
2013-08-09 17:28:33 -07:00
Dmitry Kovalev
67fe9d17cb Removing redundant code and function arguments.
Change-Id: Ia5cdda0f755befcd1e64397452c42cb7031ca574
2013-08-09 17:24:40 -07:00
Dmitry Kovalev
e7c5ca8983 Merge "Inlining 16 as a stride for BLOCK_OFFSET macro." 2013-08-09 17:22:46 -07:00
James Zern
ef101af8ae Merge "vp9_rd_pick_inter_mode_sb: fix uninitialized value" 2013-08-09 17:13:32 -07:00
Dmitry Kovalev
f1559bdeaf Inlining 16 as a stride for BLOCK_OFFSET macro.
Change-Id: I7f23d174eb089e5500f268a10db09648634c1b82
2013-08-09 16:40:05 -07:00
James Zern
f295774d43 vp9_rd_pick_inter_mode_sb: fix uninitialized value
'skippable' can remain unset and negatively affect later decisions

address one aspect of issue #599

Change-Id: Iffdf0ac2e49ac481c27dc27c87fa546d4167bb28
2013-08-09 16:26:22 -07:00
Dmitry Kovalev
125146034e Merge "Using MV struct instead of int[2] array." 2013-08-09 15:33:08 -07:00
Dmitry Kovalev
cd0629fe68 Merge "Removing plane_block_{width, height}_log2by4 functions." 2013-08-09 15:26:51 -07:00
Dmitry Kovalev
ff7df102d9 Merge "Moving loopfilter struct to VP9_COMMON." 2013-08-09 15:23:00 -07:00
Dmitry Kovalev
816d6c989c Moving loopfilter struct to VP9_COMMON.
Loop filter configuration doesn't belong to macroblock, so moving it from
MACROBLOCKD to VP9_COMMON. Also moving the declaration of loopfilter struct
from vp9_blockd.h to vp9_loopfilter.h.

Change-Id: I4b3e34be9623b47cda35f9b1f9951f8c5b1d5d28
2013-08-09 14:41:51 -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
Scott LaVarnway
ace93a175d Merge "Bug fix: call set_offsets before rd_auto_partition_range" 2013-08-09 12:30:52 -07:00
Dmitry Kovalev
fa0cd61087 Merge "Using buf_2d struct instead of separate buffer and stride vars." 2013-08-09 11:50:58 -07:00
Scott LaVarnway
41251ae558 Bug fix: call set_offsets before rd_auto_partition_range
The set_offsets call is necessary inorder to set the
mode_info_context ptr correctly.

Change-Id: I644910cc5bacc50ee9cd78458843274ad8ee636d
2013-08-09 14:09:49 -04:00
Adrian Grange
0eef1acbef Merge "Correct bug in loopfilter initialization" 2013-08-09 09:51:58 -07:00
Adrian Grange
12eb2d0267 Correct bug in loopfilter initialization
The memset sets 16 bytes rather than the correct size of the
final array dimension (MAX_MODE_LF_DELTAS).

(In response to bug posted by Manjit Hota to codec-devel
and webm-discuss lists)

Change-Id: I8980f5aa71ddc9d7ef57c5b4700bc28ddf8651c7
2013-08-09 09:21:15 -07:00
Yaowu Xu
6ec2b85bad Added lpf level picking using partial frame
Change-Id: I599ab1bd22b5f3f10d5962c609952abdef8ff67a
2013-08-09 07:37:08 -07:00
Yaowu Xu
6a7a4ba753 renamed vp8_yv12_copy_y to vpx_yv12_copy_y
Becuase the routine is used by both vp8 and vp9

Change-Id: I2d35b287b5bc2394865d931a27da61f4ce7edeeb
2013-08-09 07:37:08 -07:00
Yaowu Xu
c7c9901845 added a speed feature on lpf level picking
Change-Id: Id578f8afdeab3702fc8386969f2d832d8f1b5420
2013-08-09 07:36:32 -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
6a8ec3eac2 General code cleanup.
Removing redundant parenthesis and curly braces. Combining declarations
with initializations. Adding useful intermediate variables instead of
recalculating expressions every time.

Change-Id: I00106f404afd60bfc189905b0fded881684f941a
2013-08-08 21:12:34 -07:00
Dmitry Kovalev
ee40e1a637 Merge "Cleanup inside vp9_reconinter.c." 2013-08-08 14:59:38 -07:00
Deb Mukherjee
2158909fc3 Merge "Adds a new subpel motion function" 2013-08-08 12:26:55 -07:00
Dmitry Kovalev
9e3bcdd135 Merge "Removing unneeded intermediate entropy_nodes_adapt var." 2013-08-08 12:16:57 -07:00
Dmitry Kovalev
47fad4c2d7 Using MV struct instead of int[2] array.
Change-Id: Iab951c555037e36b154f319f351c5e67f9abb931
2013-08-08 12:01:56 -07:00
Dmitry Kovalev
ac008f0030 Removing unneeded intermediate entropy_nodes_adapt var.
Change-Id: I541a178d997b4541e0e2d4d5b854e2ed6b113c3a
2013-08-08 11:52:02 -07:00
Deb Mukherjee
1ba91a84ad Adds a new subpel motion function
Adds a new subpel motion estimation function that uses a 2-level
tree-structured decision tree to eliminate redundant computations.
It searches fewer points than iterative search (which can search
the same point multiple times) but has the same quality roughly.

This is made the default setting at speeds 0 and 1, while at
speed 2 and above only a 1-level search is used.

Also includes various cleanups for consistency and redundancy removal.

Results:
derf: +0.012% psnr
stdhd: +0.09% psnr
Speedup of about 2-3%

Change-Id: Iedde4866f5475586dea0f0ba4cb7428fba24eee9
2013-08-08 11:41:49 -07:00
Adrian Grange
83ee80c045 Moved fast motion search level decision to function
Moving this block of code into a function makes the
code easier to read and change.

Change-Id: If4ede570cce1eab1982b188c4d3e4fd3d4db236e
2013-08-08 11:01:44 -07:00
Adrian Grange
aae6a4c895 Simplify & fix potential bug in rd_pick_partition
Different partitionings were not being evaluated against
best_rd and there were unnecessary calls to RDCOST. This
could have resulted in a non-optimal partioning being
selected.

I simplified the variables used to track the rate,
distortion and RD values throughout the function.

Change-Id: Ifa7085ee80d824e86791432a5bc6d8fea5a3e313
2013-08-08 09:55:45 -07:00
Jingning Han
6bfcce8c7a Merge "Use low precision 32x32fdct for encodemb in speed1" 2013-08-07 19:05:14 -07:00
Dmitry Kovalev
61c33d0ad5 Removing plane_block_{width, height}_log2by4 functions.
Change-Id: I040b82b8e32aee272d10cbb021c7ba1c76343d7a
2013-08-07 17:06:33 -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
82d7c6fb3c Merge "Using only one scale function in scale_factors struct." 2013-08-07 16:32:09 -07:00
Dmitry Kovalev
1492698ed3 Merge "Adding ss_size_lookup table." 2013-08-07 16:08:24 -07:00
Jingning Han
debb9c68c8 Use low precision 32x32fdct for encodemb in speed1
The low precision 32x32 fdct has all the intermediate steps within
16-bit depth, hence allowing faster SSE2 implementation, at the
expense of larger round-trip error. It was used in the rate-distortion
optimization search loop only.

Using the low precision version, in replace of the high precision one,
affects the compression performance by about 0.7% (derf, stdhd) at
speed 0. For speed 1, it makes derf set down by only 0.017%.

Change-Id: I4e7d18fac5bea5317b91c8e7dabae143bc6b5c8b
2013-08-07 15:34:12 -07:00
Dmitry Kovalev
8db2675b97 Adding ss_size_lookup table.
Removing the old one bsize_from_dim_lookup. Now we have a way to determine
block size for plane using its subsampling values (ss_size_lookup). And
then we can find the number of pixels in the block (num_pels_log2_lookup).

Change-Id: I6fc981da2ae093de81741d3d78eaefed11015db9
2013-08-07 15:33:17 -07:00
Dmitry Kovalev
ea2348ca29 Merge "Removing NMS_STATS defines." 2013-08-07 15:28:30 -07:00
Christian Duvivier
78182538d6 Neon version of vp9_short_idct4x4_add.
Change-Id: Idec4cae0cb9b3a29835fd2750d354c1393d47aa4
2013-08-06 18:41:27 -07:00
Deb Mukherjee
296931c817 Merge "Clean ups of the subpel search functions" 2013-08-06 17:28:48 -07:00
Deb Mukherjee
71b43b0ff0 Clean ups of the subpel search functions
Removes some unused code and speed features, and organizes the
interfaces for fractional mv step functions for use in new speed
features to come.

In the process a new speed feature - number of iterations per
step during the subpel search - is exposed.

No change when this parameter is set as the original value of 3.

Results:
subpel_iters_per_step = 3: baseline
subpel_iters_per_step = 2: psnr -0.067%, 1% speedup
subpel_iters_per_step = 1: psnr -0.331%, 3-4% speedup

Change-Id: I2eba8a21f6461be8caf56af04a5337257a5693a8
2013-08-06 17:23:50 -07:00
Dmitry Kovalev
63ec0587c1 Merge "Motion vector code cleanup." 2013-08-06 16:00:01 -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
Jingning Han
2c091f9768 Merge "Place holder for high-precision 32x32 fdct" 2013-08-06 14:47:30 -07:00
Jim Bankoski
5b307886fb variance x86inc guards
also fixed bug in sad calcs

Change-Id: I6571fcbe37556c16ae32be66dc0fd879852aac1d
2013-08-06 14:17:13 -07:00
Jim Bankoski
6eb1254b88 sse3 intrapred x86inc protected
Change-Id: I4a3c83119cdf8a205920034c8019d855d5504605
2013-08-06 14:17:13 -07:00
Deb Mukherjee
fac7c8c9f9 Merge "Flexible support for various pattern searches" 2013-08-06 14:03:27 -07:00
Jim Bankoski
c9126e0b30 sad + miscellaneous updates
Enable use_x86inc as a commandline option.  Fix Bug with sse2 when
x86inc is disabled. Adds Sad asm protection to x86inc protection

Change-Id: Iee0f9dd235ea10e8ace512eb362ba9bebe8c9df6
2013-08-06 12:16:04 -07:00
Dmitry Kovalev
8725ca2ed2 Merge "Inlining vp9_get_pred_probs_switchable_interp function." 2013-08-06 11:57:45 -07:00
Deb Mukherjee
15b5a6a2c7 Flexible support for various pattern searches
Adds a few pattern searches to achieve various tradeoffs
between motion estimation complexity and performance.
The search framework is unified across these searches so that a
common pattern search function is used for all. Besides it will
be easier to experiment with various patterns or combinations
thereof at different scales in the future.

The new pattern search is multi-scale and is capable of using
different patterns at different scales.

The new hex search uses 8 points at the smallest scale
and 6 points at other scales.
Two other pattern searches - big-diamond and square are
also added. Big diamond uses 4 points at the smallest scale and
8 points in diamond shape at the larger scales.
Square is very similar conceptually to the default n-step search
but is somewhat faster since it keeps only one survivor across
all scales.

Psnr/speed-up results on derf300:

hex: -1.6% psnr%, 6-8% speed-up
big-diamond: -0.96% psnr, 4-5% speedup
square: -0.93% psnr, 4-5% speedup

Change-Id: I02a7ef5193f762601e0994e2c99399a3535a43d2
2013-08-06 11:56:39 -07:00
Jingning Han
28566a6cd5 Place holder for high-precision 32x32 fdct
Resolve compile warnings on re-define FDCT32x32_2D template.

Change-Id: Idb3a54ef8d2710ce7245b726379a0e5c875f5cad
2013-08-06 11:44:08 -07:00
Dmitry Kovalev
0c80065694 Inlining vp9_get_pred_probs_switchable_interp function.
There was no benefit having this function. For example, inside
read_switchable_filter_type switchable filter context was calculated twice.

Change-Id: I79cd5bf95cbc0f6d8bf91a2e32289e01b18dcff1
2013-08-06 11:04:31 -07:00
Jingning Han
7d61f8fe53 Merge "Move fdct32x32 SSE2 implementation in separate file." 2013-08-06 10:46:41 -07:00
Jim Bankoski
efc94102f0 Merge "intrapred x86inc guards" 2013-08-06 10:39:19 -07:00
Dmitry Kovalev
a39abe2627 Motion vector code cleanup.
Converting arguments of two functions (clamp_mv_ref, lower_mv_precision)
from int_mv* to MV*. Rewriting is_inside function to make it much shorter.

Change-Id: Ie4c4cf3eccd46707c7df099ec21fb1b61c72fc7a
2013-08-06 10:31:11 -07:00
Dmitry Kovalev
3e51acafec Merge "Finally removing all old block size constants." 2013-08-06 10:30:37 -07:00
Dmitry Kovalev
4a692e4168 Merge "Changing the order switchable filter enum constants." 2013-08-06 10:30:26 -07:00
Dmitry Kovalev
25b7dc08cd Merge "Removing unused functions." 2013-08-06 10:29:57 -07:00
Deb Mukherjee
33afddadb9 Merge "Add variance based mode/skipping" 2013-08-06 10:19:15 -07:00
Christian Duvivier
3d98205fce Move fdct32x32 SSE2 implementation in separate file.
This is in preparation for the SSE2 version of the high-precision
32x32 forward DCT which will share a lot of code with the existing
low precision version used for rate-distortion search.

Change-Id: I7084b6bdfb480b1fabb8493fb14e3f7fcc7888c0
2013-08-06 10:17:11 -07:00
Jim Bankoski
25ec1375c9 intrapred x86inc guards
Change-Id: If0399d8e11f4ebe75a5c91abb8d6a52a7709065b
2013-08-06 09:39:30 -07:00
Jim Bankoski
62c6aa884d block error / x86inc mods
Change-Id: Icb607745634e10b9bac5019d06661ece09fcdb40
2013-08-06 06:23:38 -07:00
Jim Bankoski
a93b115cd6 reworked config for use_x86_inc
Support enabling it or disabling it.  Moved read out to configure.sh
so that its done once instead of in make and in config.

Change-Id: I73a9190cf31de9f03e8a577f478fa522f8c01c8b
2013-08-05 17:35:25 -07:00
James Zern
d115cd8b12 Merge changes I082959ab,Ib6932640
* changes:
  vp9/decoder: threaded row-based loop filter
  vp9/decoder: add thread worker
2013-08-05 16:07:09 -07:00
Dmitry Kovalev
b9c7d04e95 Finally removing all old block size constants.
Change-Id: I3aae21e88b876d53ecc955260479980ffe04ad8d
2013-08-05 15:23:49 -07:00
Jim Bankoski
f4837579d1 fixed script problem with config_force_x86_inc
Change-Id: I226e5094d216b09dc47fa5511a66e2d314608000
2013-08-05 14:48:20 -07:00
Jim Bankoski
a5a7322459 Merge "Begin to restrict x86inc.asm usage" 2013-08-05 14:17:49 -07:00
Deb Mukherjee
8b3faccb9e Add variance based mode/skipping
Adds a speed feature to skip all intra modes other than
DC_PRED if the source variance is small. This feature is
made part of speed 1 and up.

Results on derf300: psnr -0.07%, speedup about 1-2%

Also uses the source variance to fine-tune the early
termination criteria when FLAG_EARLY_TERMINATE is on.
This feature is made part of speed 2 and up.

Results on derf300: psnr -0.52%, speedup about 5-7%

Change-Id: I59e38aa836557cfa5405ae706fc64815cbfe4232
2013-08-05 14:14:01 -07:00
Jim Bankoski
9f988a2edf Merge "cleanups after bw bh code" 2013-08-05 14:02:02 -07:00
James Zern
a0ffa2794b vp9/decoder: threaded row-based loop filter
Currently the only threaded option for vp9 decode. Enabled when the
decoder config thread count is > 1.

Change-Id: I082959abac9e31aa4a38ed9fd68b94680e57f4df
2013-08-05 13:22:04 -07:00
James Zern
183b77d5ab vp9/decoder: add thread worker
vp9/decoder/vp9_thread.[hc]
Original source:
 http://git.chromium.org/webm/libwebp.git
 100644 blob b1615d0fb8d311666b2fa4561076c62d72c2e3ff  src/utils/thread.c
 100644 blob 13a61a4c84194c3374080cbf03d881d3cd6af40d  src/utils/thread.h

Local modifications:
 - s/WebP/VP9/g
 - camelcase functions -> lower with _'s

Change-Id: Ib6932640ee34f8b4782c6fbd15864a59d5d4c5fe
2013-08-05 13:21:13 -07:00
Dmitry Kovalev
3f611555d7 Changing the order switchable filter enum constants.
This changeset allows to remove vp9_switchable_interp and
vp9_switchable_interp_map arrays and make code much clear. Actually we
still have to use these mapping but only inside read_interp_filter_type and
write_interp_filter_type functions.

Change-Id: I4026c6f8c4acefba6c81421b7bacbaa52cc45f50
2013-08-05 12:26:15 -07:00
Jim Bankoski
5d2cb7ead0 cleanups after bw bh code
Cons bw/bh parms that should have been const. Additional formatting.

Change-Id: Icd36a5c9dc17dadd7284315ac0d6fef1a565ca16
2013-08-05 12:15:52 -07:00
Jim Bankoski
c3809f3de5 Begin to restrict x86inc.asm usage
Chromium does not support 32bit builds for Mac which use x86inc.asm.
Make the files which include it work if 64bit or not PIC enabled
starting with vp9_copy_sse2.asm

Consolidate these targets in vp9_rtcd_defs.sh

Change-Id: If18f0b957a611efd085a3ee7d245cf1eb91e8248
2013-08-05 12:07:30 -07:00
Dmitry Kovalev
d007446b3f Replacing long block size enum values with shorter ones (2).
Change-Id: I428c4d42212b757112e3acfe5b81314cfbb5fd6b
2013-08-05 10:51:02 -07:00
Dmitry Kovalev
319867d71c Merge "Cleaning up vp9_build_inter_predictor function." 2013-08-05 01:52:11 -07:00
Dmitry Kovalev
78671e2eff Merge "Replacing "txfm" with "tx" in identifiers." 2013-08-04 02:52:22 -07:00
Jim Bankoski
f703f98757 reworked find_mv_ref
This is an attempt at rewriting vp9_find_mv_refs_idx.   I believe that it gains
about 1-2% decode speed

Change-Id: Ia5359c94ce9bb43b32652890e605e9a385485c1b
2013-08-03 20:25:55 -07:00
Dmitry Kovalev
fe2a201eb1 Replacing "txfm" with "tx" in identifiers.
Consistent names with TX_SIZE, TX_MODE, and TX_MODE.

Change-Id: I79592218bf5a40ace89197a34a06ee7de581ed8d
2013-08-02 17:28:23 -07:00
Dmitry Kovalev
5edc65d00d Removing NMS_STATS defines.
Change-Id: Iabab0e59042a33456df1d449c0d0f01debc00c7c
2013-08-02 17:10:15 -07:00
Dmitry Kovalev
7b50333e8f Merge "Adding is_inter_block function." 2013-08-02 16:54:32 -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
fec4ec4edd Removing unused functions.
Removed functions:
  model_rd_for_sb_y,
  block_error_sby,
  get_sb_variance

Change-Id: Iec458df180caf6f8eac3605773841a4121dd3a8f
2013-08-02 16:41:09 -07:00
Dmitry Kovalev
603931e291 Merge "Changing function arg type from int_mv* to MV*." 2013-08-02 16:30:06 -07:00
Dmitry Kovalev
a6adc82e78 Merge "Cleanups around allow_high_precision_mv flag." 2013-08-02 16:27:05 -07:00
Dmitry Kovalev
680ec32d18 Adding is_inter_block function.
Using it instead of long unclear verbose check
"mbmi->ref_frame[0] != INTRA_FRAME".

Change-Id: I9c7b4b3797942fa962bf3ba7460fff3084beabe9
2013-08-02 16:25:33 -07:00
Dmitry Kovalev
d4e020c4b1 Merge "Cleaning up set_contexts_on_border function." 2013-08-02 16:22:50 -07:00
Yunqing Wang
d340c114fb Merge "Add more checking to using_small_partition_info" 2013-08-02 15:55:09 -07:00
Dmitry Kovalev
769bcab3f5 Cleaning up set_contexts_on_border function.
Change-Id: I8f21c18b29f54b277fb1c167f278f109d9f3b996
2013-08-02 15:52:26 -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
5d86f3886d Moving struct loop_filter_info from *.h to *.c file.
Change-Id: I3fe90eb40088a5b07bdc7d66d93ffe6ef99943d5
2013-08-02 11:53:49 -07:00
Adrian Grange
60ff123536 Merge "Fixed typos and added a few explanatory comments" 2013-08-02 11:37:47 -07:00
Adrian Grange
075b11f004 Merge "Changed name of rd_pick_intra4x4mby_modes" 2013-08-02 11:36:46 -07:00
Johann
8ff58093f0 Merge "vp9: neon: convolve: replace some insns with simpler equivalents" 2013-08-02 11:28:31 -07:00
Johann
8bebfbf7c5 Merge "vp9: neon: convolve: simplify branching to C fallbacks" 2013-08-02 11:28:25 -07:00
Johann
7d14ce8ba5 Merge "vp9: neon: optimise loads in horiz convolve functions" 2013-08-02 11:28:04 -07:00
Johann
319b7dc283 Merge "vp9: neon: add vp9_mb_lpf_* functions" 2013-08-02 11:27:52 -07:00
Dmitry Kovalev
86053d3ae2 Cleanups around allow_high_precision_mv flag.
Change-Id: Ic07f5f8ffeaedd5b7513b464871f83afc82dcd5c
2013-08-02 11:21:16 -07:00
Dmitry Kovalev
b47153deed Replacing long block size enum values with shorter ones.
Change-Id: I0e9329490828684a4fd46f540d89114cc68e8407
2013-08-02 10:48:27 -07:00
Yunqing Wang
0d68080445 Merge "Comment out 2 unused speed features" 2013-08-02 09:58:46 -07:00
Mans Rullgard
355cb14dc7 vp9: neon: convolve: replace some insns with simpler equivalents
Change-Id: I5d6906772e6e6adf68d7f0fd5b8b5207a64a3a37
2013-08-02 08:11:28 -07:00
Mans Rullgard
2003468df8 vp9: neon: convolve: simplify branching to C fallbacks
Change-Id: Ic7cacd02d6dc9243ad8fc85082c5618a9d1e66dc
2013-08-02 08:11:25 -07:00
Mans Rullgard
5e2e78d024 vp9: neon: optimise loads in horiz convolve functions
Loading to single lanes in multiple registers is expensive since
it requires a read and write of each register which saturates
the register file access.  Loading to single registers followed
by a separate transpose reduces this pressure.

Change-Id: I4cc35887ddbca80e5e635b50d2b1d158de9668ee
2013-08-02 08:11:08 -07:00
Mans Rullgard
d85ae87183 vp9: neon: add vp9_mb_lpf_* functions
Change-Id: I13e0880df234f15abc4cc7c57fe84488d5d46a75
2013-08-02 08:10:50 -07:00
Dmitry Kovalev
d91e9f4e36 Merge "Cleanup: replacing xd->seg with seg, and xd->lf with lf." 2013-08-01 23:17:17 -07:00
Dmitry Kovalev
4144fee9e9 Merge "Cleanup: reusing clamp_mv function." 2013-08-01 23:16:56 -07:00
Jingning Han
555bbd68c7 Merge "Remove unused vp9_short_idct10_32x32_add" 2013-08-01 15:41:35 -07:00
Dmitry Kovalev
741537f3ce Cleanup: replacing xd->seg with seg, and xd->lf with lf.
Change-Id: I73b59d7699a8e7e7acd3bf8041cb6c98ce9ba4bf
2013-08-01 15:38:16 -07:00
Dmitry Kovalev
9f4f001ba5 Merge "Cleanup: removing unused function arguments." 2013-08-01 15:07:12 -07:00
Dmitry Kovalev
422d38bca1 Cleanup: reusing clamp_mv function.
Change-Id: I8715f08a3554bdb557c5f935f1dfbd671f18e766
2013-08-01 15:06:34 -07:00
Dmitry Kovalev
ddf02e323a Merge "Nice looking motion vector clamping functions." 2013-08-01 14:50:14 -07:00
Deb Mukherjee
19d42de3ca Merge "Adds a source variance computation function" 2013-08-01 14:18:43 -07:00
Dmitry Kovalev
0497b8d7cd Merge "vp9_get_pred_context_intra_inter cleanup." 2013-08-01 14:15:53 -07:00
Dmitry Kovalev
ce8dedc353 Cleanup: removing unused function arguments.
Change-Id: I27471768980fc631916069f24bc7c482a5c9ca17
2013-08-01 13:41:38 -07:00
Dmitry Kovalev
b621e2d72e Nice looking motion vector clamping functions.
Removing assign_and_clamp_mv function, making implementation of clamp_mv
and clamp_mv2 more clear and consistent.

Change-Id: Iecd08e1c1bf0379f8314ebe01811f8253f4ade58
2013-08-01 13:40:26 -07:00
Deb Mukherjee
dbea726daf Adds a source variance computation function
Adds a function to compute source variance for various
sb_types to be used for pruning mode and partition searches.
[The existing activity measure function is currently specialized
for only 16x16 MBs and needs to be updated].

Change-Id: I22a41e6f1430184201487326fdbebb9b47e6fc24
2013-08-01 13:01:54 -07:00
Jingning Han
67719abde1 Remove unused vp9_short_idct10_32x32_add
The inverse 32x32 transform detects all zero entries and skips the
computations accordingly per 8 rows in the first 1-D operation. The
function vp9_short_idct10_32x32_add performs differently and is not
used anywhere, hence removed.

Change-Id: Ic4fad422debbde7b6b6ffed47c69fbd4268a906c
2013-08-01 12:45:16 -07:00
Jingning Han
56df76bf1b Merge "Optimize 32x32 2D inverse DCT for speed-up" 2013-08-01 11:53:39 -07:00