Commit Graph

538 Commits

Author SHA1 Message Date
Yunqing Wang
f2c1aea118 Merge "Row based multi-threading of encoding stage" 2017-02-15 00:54:10 +00:00
Ranjit Kumar Tulabandu
71061e9332 Row based multi-threading of encoding stage
(Yunqing Wang)
This patch implements the row-based multi-threading within tiles in
the encoding pass, and substantially speeds up the multi-threaded
encoder in VP9.

Speed tests at speed 1 on STDHD(using 4 tiles) set show that the
average speedups of the encoding pass(second pass in the 2-pass
encoding) is 7% while using 2 threads, 16% while using 4 threads,
85% while using 8 threads, and 116% while using 16 threads.

Change-Id: I12e41dbc171951958af9e6d098efd6e2c82827de
2017-02-15 00:49:34 +00:00
clang-format
4b402746ca apply clang-format
Change-Id: I75e4a9e0b37bd4586f26c8d6c1fa27f3f6ff1bce
2017-02-14 12:45:52 -08:00
Ranjit Kumar Tulabandu
12ec948490 Changes to facilitate multi-threading of encoding stage
Modified the encoding stage to have row level entry points with relevant
initializations and to access the token information at row level

Change-Id: Ife10e55a7c1a420ee906d711caf75002688d9e39
2017-02-02 14:47:13 +05:30
Vignesh Venkatasubramanian
5deffa1175 vp9_bitstream: Encode tiles in parallel
Re-use the tile worker threads to pack the bitstream in parallel
on a per-tile basis.  Restricting this to real-time only for now
(further testing is needed to ensure this does not make 2-pass
worse in any case).

BUG=webm:1309

Change-Id: I8a80da7c5089b837d0df79a5c49d5e3022dfc8ec
2016-10-21 17:35:03 -07:00
James Zern
7f31bfeddb Revert "vp9_bitstream: Encode tiles in parallel"
This reverts commit 9e8efa5b18.

this change causes ubsan warnings, failures in
vpxenc_vp9_webm_rt_multithread_tiled

BUG=webm:1309

Change-Id: I020c7be985c771bfff4b3de1afe51cc8edb980da
2016-10-18 22:47:48 -07:00
Vignesh Venkatasubramanian
9e8efa5b18 vp9_bitstream: Encode tiles in parallel
Re-use the tile worker threads to pack the bitstream in parallel
on a per-tile basis.  Restricting this to real-time only for now
(further testing is needed to ensure this does not make 2-pass
worse in any case).

BUG=webm:1309

Change-Id: Ia2c982da56697756e12f02643f589189b3271d98
2016-10-17 10:42:03 -07:00
Vignesh Venkatasubramanian
769292017b vp9_bitstream: Parameterize interp_filter_selected
Facilitates encoding tiles in parallel.

BUG=webm:1309

Change-Id: I37aa336d47babffc8352188dc767eebdb8a99474
2016-10-12 20:22:03 -07:00
Vignesh Venkatasubramanian
d03d1c8cd3 vp9_bitstream: Parameterize max_mv_magnitude
Facilitates encoding tiles in parallel.

BUG=webm:1309

Change-Id: I614a5a492c30b6773c30e7294cd6a6f456e02ab4
2016-10-12 12:50:17 -07:00
Vignesh Venkatasubramanian
ed50e7710c write_modes: add MACROBLOCKD as a parameter
This will enable bit stream packing of each tile column in
parallel.

BUG=webm:1309

Change-Id: Ie349d8cc5825326218ffda893a50730b2e68ed34
2016-10-07 10:25:02 -07:00
Geza Lore
0dc12b4a1c Fix warning when building with GCC 5.
These caused the following warning with GCC 5:
     warning: logical not is only applied to the left hand side of
     comparison [-Wlogical-not-parentheses]
     assert(!is_compound == (cm->reference_mode == SINGLE_REFERENCE));

Change-Id: If296aabb2311ceb7d903b395c1549ef81c2cbf9b
(cherry picked from commit c6cf7a6111)
2016-10-01 12:23:15 -07:00
clang-format
e0cc52db3f vp9/encoder: apply clang-format
Change-Id: I45d9fb4013f50766b24363a86365e8063e8954c2
2016-08-02 16:47:11 -07:00
Scott LaVarnway
c969b2b02b VP9: get_pred_context_switchable_interp() -- encoder side
Change-Id: I7217c90d5cf38c51b76759a2dc4f10070f3a40ac
2016-07-21 11:47:51 -07:00
hui su
72d4890caf Add vp9 encoder API VP9E_GET_LEVEL to provide bitstream level
Change-Id: I1ef3df0192491035728fe9d5eb25cc66dc2965de
2016-06-15 12:53:28 -07:00
Alex Converse
19e0b406c9 Refactor probability savings search.
- Avoid excessive copying

- Don't both searching if no update can possibly offer savings

- Simplify the interface

- Remove the confusing vp9_cost_upd256 macro

Change-Id: Id9d9676a361fd1203b27e930cd29c23b2813ce59
2016-05-25 13:00:09 -07:00
Scott LaVarnway
5232326716 VP9: Eliminate MB_MODE_INFO
Change-Id: Ifa607dd2bb366ce09fa16dfcad3cc45a2440c185
2016-01-19 16:40:20 -08:00
Alex Converse
70eb870cfe Expand unconstrained nodes in pack_mb_tokens and loop on zeros.
Reduces Linux perf estimated cycle count for pack_mb_tokens on a
lossless encode on my desktop from 61858501855 to 48154040219 or from
26% of the overall profile to 21%.

Change-Id: I9ca3426d7e3272bc7f7030abda4f0d0cec87fb4a
2015-11-06 16:00:10 -08:00
Alex Converse
2f7f482c77 vp9: simplify extrabits encoding
Change-Id: I5a2abd35cb303d8f6354b3119ab95acf90405116
2015-10-06 16:26:08 -07:00
Ronald S. Bultje
36ffe64498 Rename display_{size,width,height} to render_*.
The name "display_*" (or "d_*") is used for non-compatible information
(that is, the cropped frame dimensions in pixels, as opposed to the
intended screen rendering surface size). Therefore, continuing to use
display_* would be confusing to end users. Instead, rename the field
to render_*, so that struct vpx_image can include it.

Change-Id: Iab8d2eae96492b71c4ea60c4bce8121cb2a1fe2d
2015-09-25 21:34:29 -04:00
Ronald S. Bultje
eeb5ef0a24 Add support for color-range.
In decoder, export (eventually) into vpx_image_t.range field. In
encoder, use oxcf->color_range to set it (same way as for
color_space).

See issue 1059.

Change-Id: Ieabbb2a785fa58cc4044bd54eee66f328f3906ce
2015-09-16 06:41:46 -04:00
Johann
c5f11912ae Include vpx_dsp_common.h when using VPXMIN/MAX
Change-Id: I2e387a06484a06301f3cd6600c4ba2f4335b61ee
2015-08-31 14:36:35 -07:00
James Zern
5e16d397bd vpx_dsp_common: add VPX prefix to MIN/MAX
prevents redeclaration warnings;
vp8 has its own define which will be resolved in a future commit

Change-Id: Ic941fef3dd4262fcdce48b73075fe6b375f11c9c
2015-08-26 20:11:32 -07:00
Alex Converse
a8a08ce57e Move vp9_systemdependent.h to vpx_ports bitops.h and system_state.h
Use system_state.h in vpx_dsp and remove unneeded includes of
vp9_systemdependent.h.

Change-Id: I92557ec6dd5aa790160b4f31fe7967db0d7ec3c4
2015-08-10 15:37:14 -07:00
Yaowu Xu
5f5091636e vpx_dsp/bitwriter_buffer.h: vp9_ -> vpx_
Change-Id: I0ac7beaa160a6c2a60a019f6b8ce85e6537bed7d
2015-07-20 18:13:06 -07:00
Yaowu Xu
817be1d214 vpx_dsp/bitwriter.h: vp9_->vpx_
changes prefix vp9_ to vpx_ for non codec specific functions and
data structures.

Change-Id: I91a21548e39bd24d2c7caaaa223ae47240bb78c8
2015-07-20 18:13:05 -07:00
Yaowu Xu
70ad668056 vpx_dsp/prob.h: vp9_ -> vpx_
change prefix vp9_ to vpx_ for non codec specific functions and data
structures.

Change-Id: I97c7e6422eceea99212b93f4942bc2187763a07c
2015-07-20 18:13:04 -07:00
Yaowu Xu
bf82514b54 vpx_dsp/bitreader.h: vp9_->vpx_
Replace vp9_ in names to vpx_ as they are not codec specific.

Change-Id: I2e583aa63dee769353ada4b42417aa15c4074ebb
2015-07-20 18:06:31 -07:00
Yaowu Xu
1fcef81cb0 Remove vp9_ prefix from bit writer files
Change-Id: I07647c7482b9ec498fbad3a9c9901f72b2336500
2015-07-20 11:20:03 -07:00
Yaowu Xu
c5ad31e518 Move bit writer files to vpx_dsp/
Change-Id: Id27e0007a0feac821ca66bcecbf3a723305da82d
2015-07-20 11:20:02 -07:00
Scott LaVarnway
c06d56cc7d VP9: Move ref_mvs[][] and mode_context[] from MB_MODE_INFO
to MB_MODE_INFO_EXT.  This saves 36 bytes per 8x8 area for
both the decoder and encoder. (encoder has two MODE_INFO
buffers)

Change-Id: If006abb2224acaf326df3c2be09e77e967662107
2015-06-29 12:46:47 -07:00
Scott LaVarnway
5fe0e55ca4 Merge "Eliminated frame_type check in get_partition_probs()" 2015-06-16 13:40:23 +00:00
Scott LaVarnway
b2658ec321 Eliminated frame_type check in get_partition_probs()
Moved the frame_type check to the tile level and stored
the prob ptr in MACROBLOCKD.

Change-Id: I10b5a4abd58213dc7610e3ade1a1583c01526842
2015-06-16 05:37:54 -07:00
Scott LaVarnway
cca866f578 inline vp9_get_segdata()
and change name.

Change-Id: I706645cf9d9dc04f1b3b6ac80df80edb7f101854
2015-06-11 09:52:00 -07:00
Scott LaVarnway
42c0b1b1f1 inline vp9_segfeature_active()
and changed name.

Change-Id: Ie023ca66cc2c823032f58d4faeb53fd1863c94f3
2015-06-11 04:20:55 -07:00
James Zern
f58011ada5 vpx_mem: remove vpx_memset
vestigial. replace instances with memset() which they already were being
defined to.

Change-Id: Ie030cfaaa3e890dd92cf1a995fcb1927ba175201
2015-04-28 20:00:59 -07:00
Scott LaVarnway
8b17f7f4eb Revert "Remove mi_grid_* structures."
(see I3a05cf1610679fed26e0b2eadd315a9ae91afdd6)

For the test clip used, the decoder performance improved by ~2%.
This is also an intermediate step towards adding back the
mode_info streams.

Change-Id: Idddc4a3f46e4180fbebddc156c4bbf177d5c2e0d
2015-04-21 11:16:45 -07:00
Alex Converse
b7605a9d70 Simplify skip check.
SEG_LVL_SKIP implies skip. This is enforced by skip = write_skip().

Change-Id: I61c79581c9c53deae36685c2bcf388cb4d8827d3
2015-03-23 10:53:31 -07:00
Adrian Grange
3807dd82ab Make encoder buffer allocation dynamic
Frame buffers are now allocated dynamically on-demand.

Entries in the reference frame map, cm->ref_frame_map,
may now be set to -1 (INVALID_IDX) to indicate that
there is not a valid reference buffer in that "slot".

All slots in the reference frame map are now initialized
to the empty state (-1) and each buffer is initialized
to have a reference count of 0.

Change-Id: Id1afe98de98db4ae8b2dfefed7889c3b28c68582
2015-03-04 07:58:32 -08:00
Yaowu Xu
65a1a3e85d adjust rtc setting and threshold
1. Adjusted the threshold for coef update computation based on counts
of tx used, avoid coef update computation when count is low (<20)
2. Move sf->lpf_pick = LPF_PICK_MINIMAL_LPF to speed 8.

Change-Id: I02b44309e40fcdbf135c7934ae067a3f42502d30
2015-02-02 17:43:46 -08:00
Yaowu Xu
45971abd1d Optimize coef update
1. move the check of search method of USE_TX_8X8 up one level to
avoid operations of build_tree_distributions()
2. count tx used and avoid computaton for coef udpate when one size
is not used at all.

Change-Id: Ia3e54a2588aa531c41377a1bfaa64385d04a592c
2015-01-30 10:16:40 -08:00
Yaowu Xu
ff99a3c750 Simplify update_coef_probs()
1. reduce the size of temporaray arrays on stack
2. avoid build_tree_distribution for tx size that is not used at all.

Change-Id: I0f8d7124e16a3789d3c15ad24cf02c1c12789e2c
2015-01-28 15:12:42 -08:00
Yaowu Xu
e94b415c34 Add encoder control for setting color space
This commit adds encoder side control for vp9 to set color space info
in the output compressed bitstream.

It also amends the "vp9_encoder_params_get_to_decoder" test to verify
the correct color space information is passed from the encoder end to
decoder end.

Change-Id: Ibf5fba2edcb2a8dc37557f6fae5c7816efa52650
2015-01-14 10:17:14 -08:00
Deb Mukherjee
e7570493b8 Moves inter mode count updates to update_stats
This makes the inter_mode counts update consistent with other symbols.
Also, forward updates should work corerctly now.

Change-Id: Id98be26fd08875162e644bb8f1de6f0918f85396
2015-01-06 16:40:45 -08:00
Jim Bankoski
fc954c7c03 Merge "remove static initializers for partition tree" 2014-12-22 13:49:57 -08:00
Jim Bankoski
fd96deb06c remove static initializers for partition tree
Could have problem with 2 encoders.

Change-Id: I92d326933c00fee688f77b54acf467ca5a8516bc
see: https://code.google.com/p/webm/issues/detail?id=900&thanks=900&ts=1418843841
2014-12-17 11:41:06 -08:00
James Zern
72ece1308b vp9: move encoder-only member from common
allow_comp_inter_inter VP9_COMMON -> VP9_COMP

Change-Id: I6d9dc25d1cdd7e2ab62f5be69cd9fa883d21dbb6
2014-12-12 11:17:44 -08:00
hkuang
382f86f945 Improve the performance by caching the left_mi and right_mi in macroblockd.
This improve the deocde performance by ~2% on Nexus 7 2013.

Change-Id: Ie9c4ba0371a149eb7fddc687a6a291c17298d6c3
2014-12-05 16:25:42 -08:00
Jingning Han
a8d8c0f633 Remove unused ONE_LOOP entry from speed feature
Change-Id: I56ead0ebc2491144c4e79e5859b05e126176702c
2014-12-03 09:17:08 -08:00
Jingning Han
8fe50191c6 Rework coeff probability model update for rtc coding
This commit reworks the ONE_LOOP_REDUCED coefficient probability
model update process. It allows model update for every coefficient
across the spectrum at a coarser resolution, instead of performing
precise update only for certain subset of probability models.

The overall runtime remains nearly same (<1% change) for speed -6.
The compression performance is improved by 7.5% in PSNR for speed
-5 and 4.57% for speed -6, respectively.

Change-Id: Ifb17136382ee7e39a9f34ff4a4f09a753125c8d1
2014-12-03 09:15:25 -08:00
Yunqing Wang
0993bef7e9 vp9_ethread: calculate and save the tok starting address for tiles
Each tile's tok starting address is calculated before the encoding
process. These addresses are stored so that the same calculation
won't be done again in packing bit stream.

Change-Id: I0a3be0301f002260c19a850303f2f73ebc47aa50
2014-11-25 17:19:35 -08:00