Commit Graph

7386 Commits

Author SHA1 Message Date
Adrian Grange
1cfbc86e38 Merge "Add VP9 decoder control to get frame size" 2015-02-13 10:20:14 -08:00
Adrian Grange
e31516a08f Improve readability: move return statements
Change-Id: I18428d0a93084f78ec136d9019f10466326c67e5
2015-02-13 09:46:13 -08:00
Adrian Grange
cf54b88043 Add VP9 decoder control to get frame size
Adds a control function that allows the caller to get
the size of the current frame.

Change-Id: Iddfdedc0f3aa9aa46119f87d294681c82f275c9f
2015-02-13 09:09:49 -08:00
Jingning Han
e69c79e19a Merge "Fix ioc issue in block_rd_txfm" 2015-02-12 15:07:41 -08:00
Jingning Han
5041aa0fbe Fix ioc issue in block_rd_txfm
Force 64-bit precision in the intermediate steps.

Change-Id: I666113d9adcef8975da201d5aa1a13b783d09594
2015-02-12 12:51:39 -08:00
hkuang
aa5c8b757d Merge "Remove unnecessary border extension when frame size change." 2015-02-12 12:00:32 -08:00
Marco
cc7d981de1 Merge "Add skin detection." 2015-02-12 11:12:27 -08:00
Jingning Han
f4c29ae9ea Merge "Update partition rate cost in rtc speed 5" 2015-02-12 09:14:49 -08:00
Jingning Han
ee83243daa Merge "Add mode cost to sub8x8 block mode decision in rtc coding" 2015-02-12 09:14:29 -08:00
Adrian Grange
24a6dbd853 Merge "Add cast to convert double to int" 2015-02-12 07:02:54 -08:00
Marco
56435bb7b6 Add skin detection.
Simple skin detection, from vp8; works reasonable on most of the
RTC clips, but could miss sometimes.

Added debug flag to write out skin map over source input.

Change-Id: I2caea7592f1c459047aac46627eeb24a94946464
2015-02-11 17:47:17 -08:00
Yunqing Wang
238707ab4c Merge "Make vp9_print_modes_and_motion_vectors() work" 2015-02-11 16:58:52 -08:00
James Zern
d8ed558c99 Merge "vp9_thread: prefer pthread.h if available" 2015-02-11 16:50:07 -08:00
James Zern
a139f3f6fc Merge "vp9_highbd_tm_predictor_16x16: fix win64" 2015-02-11 16:49:53 -08:00
Adrian Grange
053625e4cd Add cast to convert double to int
Change-Id: I7f63c2940256a5dadf9a29a853809290dd9e98ed
2015-02-11 15:59:48 -08:00
Jingning Han
e665c8f2c9 Add mode cost to sub8x8 block mode decision in rtc coding
This commit allows the encoder to properly account for the mode
cost in sub8x8 non-RD mode decision.

Change-Id: I2951960d20e37ed08e372ee0c7044935b2b9b899
2015-02-11 14:43:02 -08:00
Jingning Han
c9725813db Merge "Account for inter prediction filter rate cost in rtc mode selection" 2015-02-11 14:42:44 -08:00
Jingning Han
532cb435f8 Merge "Add ref frame rate cost to non-RD mode decision" 2015-02-11 14:36:48 -08:00
Jingning Han
7a4e0b2265 Update partition rate cost in rtc speed 5
The block partition rate cost should be updated when recursive
partition search is needed.

Change-Id: I7bc5ad1fc2cbd3577dee7f7e8da111a2742bdeb9
2015-02-11 12:48:29 -08:00
Jingning Han
41b7f76db1 Account for inter prediction filter rate cost in rtc mode selection
Add the rate cost on inter prediction filter type to the overall
rate-distortion cost in vp9_pick_mode_inter.

Change-Id: I72c34017adf5220cadb3962694ee5404469fc673
2015-02-11 12:17:29 -08:00
Jingning Han
4ce70e8847 Add ref frame rate cost to non-RD mode decision
This commit adds a heuristic rate cost of reference frame to the
non-RD mode decision. It improves the compression performance of
speed -6 by 0.31% and speed -5 by 0.69%.

Change-Id: If7f3b45519d49b2cb640bcb7316a254efc8be446
2015-02-11 11:08:10 -08:00
James Zern
923cc0bf51 vp9_highbd_tm_predictor_16x16: fix win64
by saving xmm8; cglobal's xmm reg arg is 0-based

Change-Id: Ic8426ec9ac59ab4478716aa812452a6406794dcb
2015-02-10 19:34:12 -08:00
Yunqing Wang
f37788eaf6 Make vp9_print_modes_and_motion_vectors() work
MODE_INFO struct was modified, and vp9_print_modes_and_motion_vectors()
didn't work anymore. This patch modified vp9_debugmodes.c so that
this function works again for debug usage.

Change-Id: I293fae0295235deb2529a460a274caf7c045ac1a
2015-02-10 16:37:02 -08:00
Yaowu Xu
ee5d79995e Move computation up to frame level
This is to avoid redo the same calculation repeatly, and also allow
easier adjustments for further experiments.

This commit shall have no effect on quality/compression.

Change-Id: I4460acf5c808ff5518da18d21e002c5da58af857
2015-02-10 15:41:52 -08:00
hkuang
bf3cb25019 Remove unnecessary border extension when frame size change.
This border extension is not needed with on-demond border extension.

Change-Id: I8501b37f5f756dc7e874cef4c1cfdbfa9a16112a
2015-02-10 14:55:27 -08:00
James Zern
d167a1aeee vp9_thread: prefer pthread.h if available
this avoids conflicts with recent versions of mingw-w64 (tested g++
4.8.2) and the unit tests

Change-Id: Ic41ea31eebe0e3e712ed5e657f37d8cad6712088
2015-02-10 12:47:14 -08:00
Adrian Grange
2d924161c7 Merge "Auto-adaptive encoder frame resizing logic" 2015-02-10 12:16:55 -08:00
Jingning Han
f0eea5be2a Merge "Fix block partition size in fill_mode_info_sb" 2015-02-10 10:49:03 -08:00
Adrian Grange
23ebacdb81 Auto-adaptive encoder frame resizing logic
Note: This feature is still in development.

Add an option for the encoder to decide the resolution
at which to encode each frame.

Each KF/GF/ARF goup is tested to see if it would be
better encoded at a lower resolution. At present, each
KF/GF/ARF is coded first at full-size and if the coded
size exceeds a threshold (twice target data rate) at
the maximum active Q then the entire group is encoded
at lower resolution.

This feature is enabled in vpxenc by setting:
  --resize-allowed=1

In addition, if the vpxenc command line also specifies
valid frame dimensions using:
  --resize-width=XXXX & --resize_height=YYYY
then *all* frames will be encoded at this resolution.

Change-Id: I13f341e0a82512f9e84e144e0f3b5aed8a65402b
2015-02-10 09:59:32 -08:00
Yunqing Wang
84b813aa42 Merge "Make encoder and decoder share common thread function" 2015-02-10 09:06:41 -08:00
Yunqing Wang
d3a37731c2 Merge "Rename loopfilter_thread files to thread_common files" 2015-02-10 09:06:23 -08:00
Jingning Han
ebb4c9e8e7 Fix block partition size in fill_mode_info_sb
This commit fixes the sub block partition size used in
fill_mode_info_sb. Previous implementation effectively disabled
the rectangular block sizes. This commit resolved this issue.

Change-Id: Ic1c383ab0a9a2e7d59e85b388093f1f1f94d1e7f
2015-02-10 08:39:32 -08:00
hkuang
1cdb5439e7 Merge "Set the maximum decode threads to be 8." 2015-02-09 16:25:20 -08:00
Yunqing Wang
07eb8c8da3 Merge "Fix high bit depth assembly function bugs" 2015-02-09 15:30:36 -08:00
hkuang
dd88f48296 Set the maximum decode threads to be 8.
This will fix the frame parallel decode hang on windows
due to not enough semaphores.

This will also make the frame parallel decode safer as
the number of frame buffers could only support maximum
8 threads.

Change-Id: Id9ef50692819dcbebbd74a0aabffbfb3f39a4309
2015-02-09 10:38:41 -08:00
hkuang
67b61c7ace Fix jenkins unit test failure due to "uninitialised value".
Change-Id: Ief6b526486bc729dcb787358bc0b781f278bdc66
2015-02-07 15:13:45 -08:00
Yunqing Wang
4ae092c660 Make encoder and decoder share common thread function
Moved vp9_accumulate_frame_counts to vp9_thread_common.c to
eliminate the duplicate code.

Change-Id: I9cf506d729603c8bf1494b4c86a3b7d47af1917a
2015-02-06 11:45:51 -08:00
Jingning Han
ba933b90c6 Merge "Re-arrange inter mode search order in RTC coding flow" 2015-02-06 10:11:33 -08:00
Yunqing Wang
41063137c3 Rename loopfilter_thread files to thread_common files
Renames the files to allow more common thread code to
be moved to vp9/common.

Change-Id: I7386e64e221086e3cdc087e79812f993c423413b
2015-02-06 10:03:31 -08:00
Yaowu Xu
8b5e665098 Merge "Replace repeated check with single variable" 2015-02-06 09:17:59 -08:00
Jingning Han
b2762a8853 Re-arrange inter mode search order in RTC coding flow
This commit makes the ZEROMV mode first in the search order to
ensure that the zero mv is always checked in the RTC coding mode.
It improves the average speed -6 compression performance by 0.3%
in both PSNR and SSIM at no visible speed change.

Change-Id: I465a7e59f4e20cd84fee3f02ced6f98036945949
2015-02-06 08:52:52 -08:00
James Zern
519b9141ad Merge "vp9: fix segfault w/corrupt data post frame-parallel merge" 2015-02-06 00:28:10 -08:00
hkuang
1c396f3f8e Merge "Fix a thread lost bug in frame parallel decode." 2015-02-05 14:07:35 -08:00
hkuang
65f046e29f Merge "Mute the harmless tsan error in frame parallel decode." 2015-02-05 12:44:04 -08:00
James Zern
0261fb4c4f vp9: fix segfault w/corrupt data post frame-parallel merge
cm->frame_bufs[].idx values were made consistent in:
61c5e94 Use -1 consistently as invalid buffer idx
update the initialization in swap_frame_buffers() to match.
additionally:
  - remove some shadowed variables in the former and marked them volatile

Change-Id: Ie3f9636c405bd822112bb56bd22d28024ae98909
2015-02-05 12:11:40 -08:00
Yunqing Wang
789ae447f8 Fix high bit depth assembly function bugs
The high bit depth build failed while building for 32bit target.
The bugs were in vp9_highbd_subpel_variance.asm and
vp9_highbd_sad4d_sse2.asm functions. This patch fixed the bugs,
and made 32bit build work.

Change-Id: Idc8e5e1b7965bb70d4afba140c6583c5d9666b75
2015-02-05 11:24:03 -08:00
Yaowu Xu
c905c42ad8 Remove unnecessary initialization
loop_filter_level is always reset in loop_filter_frame() later in
encoder.

Change-Id: I608e03d905a6b23e7d5025ca747e4784c665007e
2015-02-04 13:56:16 -08:00
Yaowu Xu
581aee001e Move tx_mode decision logic into select_tx_mode()
Change-Id: I7f8f78c33eb3f33344b029a27bda320f4d68c577
2015-02-04 13:54:49 -08:00
Yaowu Xu
19451e6d67 Replace repeated check with single variable
Change-Id: I2f6a669bf7c6d9796388ad3f3fa3fc942635c215
2015-02-04 12:59:14 -08:00
Yaowu Xu
a844a778c7 Merge "Adjust partitioning threshold based rtc speed" 2015-02-04 12:52:03 -08:00
Yaowu Xu
3bc0c6576f Merge "Move calls to avoid unnecessary operations" 2015-02-04 12:51:16 -08:00
hkuang
41e376e494 Mute the harmless tsan error in frame parallel decode.
Change-Id: I52565fd90461221f89134997a0782cb1b681df01
2015-02-04 12:39:35 -08:00
Jingning Han
1221641914 Merge "Unify luma and chroma inter predictors in choose_partitioning" 2015-02-04 12:09:21 -08:00
Jingning Han
fb2bac4001 Merge "Save an extra call for setup_pred_plane function" 2015-02-04 12:09:14 -08:00
Jingning Han
ce819d74dc Merge "Account for chroma component costs in RTC mode decision" 2015-02-04 12:09:01 -08:00
Yaowu Xu
bdfb5f986e Adjust partitioning threshold based rtc speed
On rtc set:
speed 7 quality improves about 0.5%
speed 8 quality improves about 1.0%

Encoding time for speed 7 changes from 67804ms to 65889ms
Encoding time for speed 8 changes from 58659ms to 56808ms

Change-Id: Iabcfb53012fc1b9f3326cdbc167e5758b8c7ad30
2015-02-04 11:28:39 -08:00
hkuang
b104b84058 Fix a thread lost bug in frame parallel decode.
After syncing the frame worker thread, avaiable thread count should
increase by 1 even the worker thread does not have displayable frame
to output.

Change-Id: I9eeb87720fed82dfe38555286833ff88e8a8e746
2015-02-04 11:07:02 -08:00
Jingning Han
1b9082ec6b Unify luma and chroma inter predictors in choose_partitioning
Change-Id: I8bfc80f4fffb0892e93d3326394a52d1ee3c0f37
2015-02-04 10:02:57 -08:00
Jingning Han
4ccfc7d517 Save an extra call for setup_pred_plane function
Reuse the yv12_mb array to fetch the buffer pointers/strides
corresponding to the current reference frame.

Change-Id: I5276b7494158b2cccef15213be2dc189e9036851
2015-02-04 09:47:14 -08:00
Jingning Han
0c6d3a03e1 Account for chroma component costs in RTC mode decision
This commit allows the encoder to account for additional chroma
plane costs in the mode decision process, if the current block
potentially contains significant color change. It improves the
visual quality at very low bit-rates.

The compression performance of dark720p is improved by 12.39% in
speed 6. For jimred at 150 kbps, the PSNR of V component (red)
increased by 0.2 dB, at the expense of about 5% increase in
encoding time. Note that for sequences where the chroma components
are fairly consistent, the encoding time increase is negligible.

On average the rtc set compression performance is improved by
1.172% in PSNR and 1.920% in SSIM.

Change-Id: Ia55b24ef23a25304f7ec9958fbf07fd6e658505c
2015-02-04 09:45:14 -08:00
Yunqing Wang
b3b7645a2f vp9_dthread: remove frame_parallel_decoding_mode requirement
This patch continues the work to remove frame_parallel_decoding_mode
requirement in VP9 multi-threaded tile decoder. In order to do that,
the frame counts associated to each thread need to be accumulated
together after the frame is decoded.

Change-Id: Idba1a756cedfed3c154aef52ed82c8da3bbf9e0c
2015-02-04 09:16:41 -08:00
Johann
3a5d40608e Merge "Remove unnecessary pointer check" 2015-02-03 17:12:56 -08:00
Yaowu Xu
02537ebbe4 Move calls to avoid unnecessary operations
Change-Id: I236f7f75ab9a4511d1b52a6a67299b0e844a103e
2015-02-03 17:01:37 -08:00
Yaowu Xu
cb411108a3 Merge "adjust rtc setting and threshold" 2015-02-03 15:13:52 -08:00
hkuang
70554a21f1 Merge "Remove duplicate code." 2015-02-03 13:37:48 -08:00
Jim Bankoski
d7783cae95 Merge "make low bitrates a lot less blocky" 2015-02-03 13:25:06 -08:00
Johann
ba18609502 Remove unnecessary pointer check
The original implementation had the following comment:
// Ignore mv costing if mvsadcost is NULL

However the current implementation does not allow for this.
If x exists then nmvsadcost must not be null.

This removes the only warning from -Wpointer-bool-conversion

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

Change-Id: I1a2cee340d7972d41e1bbbe1ec8dfbe917667085
2015-02-03 13:03:46 -08:00
Jingning Han
894f0fbd3b Merge "Assign 2nd ref frame in choose_partitioning" 2015-02-03 12:25:18 -08:00
Jingning Han
ca9c352fc3 Assign 2nd ref frame in choose_partitioning
Avoid the use of uninitialized second reference frame for fetching
reference block.

Change-Id: I9983a0daea829700b3270dc8bf2bcc6d6ea36652
2015-02-03 11:17:51 -08:00
Yunqing Wang
f5b3631621 Merge "vp9_dthread: pass frame counts to decoder functions" 2015-02-03 10:52:02 -08:00
Yaowu Xu
a6b3e01a27 Add mutex initialization in encoder
This resolves the encoder crashes on windows.

Change-Id: I159d79014cf9279751e403936ce1f84482ae82da
2015-02-03 09:53:08 -08:00
Yunqing Wang
85a9bc04d4 vp9_dthread: pass frame counts to decoder functions
The current multi-threaded tile decoder requires that the videoes
are encoded with frame_parallel_decoding_mode = 1. This requirement
is not necessary, and is better to be removed. This patch includes
the first part of the work.

Change-Id: Ic7695fb3cfe13f9022582c9f0edd2aa6e2e36d28
2015-02-03 09:39:15 -08:00
Jim Bankoski
9f1cf2c8cf make low bitrates a lot less blocky
Remove loop filter skip at speed 7+ because of bad visual artifacts and
up the postprocessing.

Change-Id: Ibdd0bac71aaee232d2bb2e14462733c51517768d
2015-02-03 06:45:56 -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
hkuang
4ed539f22e Merge "Fix a bug from merging frame parallel branch into master." 2015-02-02 17:08:42 -08:00
hkuang
94a459522e Fix a bug from merging frame parallel branch into master.
The merge did not merge the fix for issue #850.

Change-Id: I0dc1377dbfcb9497fb01a13d4f78ac65bff5eb33
2015-02-02 16:01:17 -08:00
Alex Converse
a79db92c07 Merge "Allow larger encoder configurations." 2015-02-02 12:05:56 -08:00
Yaowu Xu
80e729f601 Merge "Optimize coef update" 2015-02-01 20:08:29 -08:00
hkuang
be6aeadaf4 Try again to merge branch 'frame-parallel' into master branch.
In frame parallel decode, libvpx decoder decodes several frames on all
cpus in parallel fashion. If not being flushed, it will only return frame
when all the cpus are busy. If getting flushed, it will return all the
frames in the decoder. Compare with current serial decode mode in which
libvpx decoder is idle between decode calls, libvpx decoder is busy
between decode calls.

Current frame parallel decode will only speed up the decoding for frame
parallel encoded videos. For non frame parallel encoded videos, frame
parallel decode is slower than serial decode due to lack of loopfilter
worker thread.

There are still some known issues that need to be addressed. For example:
decode frame parallel videos with segmentation enabled is not right sometimes.

* frame-parallel:
  Add error handling for frame parallel decode and unit test for that.
  Fix a bug in frame parallel decode and add a unit test for that.
  Add two test vectors to test frame parallel decode.
  Add key frame seeking to webmdec and webm_video_source.
  Implement frame parallel decode for VP9.
  Increase the thread test range to cover 5, 6, 7, 8 threads.
  Fix a bug in adding frame parallel unit test.
  Add VP9 frame-parallel unit test.
  Manually pick "Make the api behavior conform to api spec." from master branch.
  Move vp9_dec_build_inter_predictors_* to decoder folder.
  Add segmentation map array for current and last frame segmentation.
  Include the right header for VP9 worker thread.
  Move vp9_thread.* to common.
  ctrl_get_reference does not need user_priv.
  Seperate the frame buffers from VP9 encoder/decoder structure.
  Revert "Revert "Revert "Revert 3 patches from Hangyu to get Chrome to build:"""
 Conflicts:
       test/codec_factory.h
       test/decode_test_driver.cc
       test/decode_test_driver.h
       test/invalid_file_test.cc
       test/test-data.sha1
       test/test.mk
       test/test_vectors.cc
       vp8/vp8_dx_iface.c
       vp9/common/vp9_alloccommon.c
       vp9/common/vp9_entropymode.c
       vp9/common/vp9_loopfilter_thread.c
       vp9/common/vp9_loopfilter_thread.h
       vp9/common/vp9_mvref_common.c
       vp9/common/vp9_onyxc_int.h
       vp9/common/vp9_reconinter.c
       vp9/decoder/vp9_decodeframe.c
       vp9/decoder/vp9_decodeframe.h
       vp9/decoder/vp9_decodemv.c
       vp9/decoder/vp9_decoder.c
       vp9/decoder/vp9_decoder.h
       vp9/encoder/vp9_encoder.c
       vp9/encoder/vp9_pickmode.c
       vp9/encoder/vp9_rdopt.c
       vp9/vp9_cx_iface.c
       vp9/vp9_dx_iface.c

This reverts commit a18da9760a.

Change-Id: I361442ffec1586d036ea2e0ee97ce4f077585f02
2015-01-30 21:00:13 -08:00
James Zern
f6c2a6c5d6 vp9: rename 'near' parameters
+ nearest for consistency

near is a reserved word in windows builds so using it as a parameter
name may cause build failures with some configurations

Change-Id: Iddf1d4ecdb39843f14e95dbfd9dca55f07f81403
2015-01-30 15:52:24 -08:00
Jingning Han
f1ab5c1021 Merge "Format fixes in vp9_rd_pick_inter_mode_sb/sub8x8" 2015-01-30 15:49:14 -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
Yunqing Wang
3b3e299650 Merge "Fix issues in 32bit PIC enabled build" 2015-01-29 16:41:25 -08:00
Alex Converse
797a2556eb Allow larger encoder configurations.
Allow changing colorspace in the encoder and increasing frame size.

Change-Id: I8e7c3b891af29ce420a15beb4f6f9c250245b2bb
2015-01-29 15:07:40 -08:00
Paul Wilkins
68340a3470 Merge "Change to update of rate control factors." 2015-01-29 13:50:52 -08:00
Marco
a80dd52b6e Merge "Fix to vp9 denoiser." 2015-01-29 09:10:30 -08:00
Paul Wilkins
f752da8ce2 Change to update of rate control factors.
Remove damping parameter and use the damping
formula introduced by Yaowu Xu in all cases.

Change-Id: I18db7e0d0f262d5140102f259ab07821d374d285
2015-01-28 15:44:53 -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
Marco
c0923d4d3a Fix to vp9 denoiser.
Prevent from using wrong mv for denoiser motion compensation.

Change-Id: Ifa0f9daabdbdab0900d3c17304059fe0d15de914
2015-01-28 12:07:27 -08:00
hkuang
e8c42fb0bd Remove duplicate code.
(issue #934).

Change-Id: Ic8adaaff87aae0b33d9b508f160b48e0ccdaaf4c
2015-01-28 12:00:34 -08:00
Frank Galligan
d1e6b8231a Merge "Add vp9_sad32x32x4d_neon Neon intrinsic function." 2015-01-28 10:35:50 -08:00
Frank Galligan
eb12d880ab Merge "Add vp9_sad16x16x4d_neon Neon intrinsic function." 2015-01-27 23:01:44 -08:00
Frank Galligan
80a3a07929 Merge "Add vp9_sad64x64x4d_neon Neon intrinsic function." 2015-01-27 23:01:15 -08:00
Yunqing Wang
10d5e09c87 Fix issues in 32bit PIC enabled build
This patch was to fix issue 924:
https://code.google.com/p/webm/issues/detail?id=924

The SECTION_RODATA macro was modified to support macho32 format.
The sub-pixel functions were modified to pass in 2 more parameters
to handle the global offsets for PIC build.

Change-Id: I3bfcd336bcae945edf300bca4ab40376a2628cd4
2015-01-27 22:20:21 -08:00
Yaowu Xu
fe2439703d Merge "move clear_system_state() call before using double" 2015-01-27 12:42:13 -08:00
Frank Galligan
e3167f7fbf Add vp9_sad32x32x4d_neon Neon intrinsic function.
On Nexus 7 speed -6 saw ~18% increase in perf.

Tested on Nexus 7, built with ndk r10d, gcc 4.9.

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

Change-Id: I70ccdea0326750552ed946fb004507d6efe02d5c
2015-01-27 08:54:00 -08:00
Frank Galligan
9f574d0316 Add vp9_sad16x16x4d_neon Neon intrinsic function.
On Nexus 7 speed -6 saw ~15% increase in perf.

Tested on Nexus 7, built with ndk r10d, gcc 4.9.

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

Change-Id: I4b2006b644c488f42bf06d8a22ef0e6120a96bf9
2015-01-27 08:42:17 -08:00
Frank Galligan
54fa956715 Add vp9_sad64x64x4d_neon Neon intrinsic function.
On Nexus 7 speed -6 saw ~30% increase in perf.

Tested on Nexus 7, built with ndk r10d, gcc 4.9.

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

Change-Id: Id12af7d1883243c23e6692e898aea82299633d58
2015-01-27 08:33:40 -08:00
Marco
1c4a84c6e9 Merge "aq-mode=3: Update to allow for refresh on modes other than zero-mv." 2015-01-26 19:47:13 -08:00
Yaowu Xu
645b7cdf03 move clear_system_state() call before using double
Floating point is used in vp9_convert_qindex_to_q(), so sometime unit
test ActiveMapTest would cause run time error without properly call
to clear_system_state to reset register status.

Change-Id: I181e9395148c44a6ca8b97d6e109bd4a152143c6
2015-01-26 18:41:50 -08:00
Paul Wilkins
d231ce4fde Merge "Adjust active maxq for GF groups." 2015-01-26 18:19:09 -08:00
Yaowu Xu
d987dc4fdb Merge "Fix MSVC warnings on conversion from int64 to int" 2015-01-26 16:52:30 -08:00
Marco
3f1af6e85e aq-mode=3: Update to allow for refresh on modes other than zero-mv.
Add distortion threshold condition to refresh state of a coding block,
and allow for qp adjustment also for some intra modes and non-zero motion modes.

Also some code cleanup (remove unused variables/code).

Change-Id: I735fa2b28bc64f60e0323976b82510577b074203
2015-01-26 16:44:25 -08:00
Paul Wilkins
fd070220ff Adjust active maxq for GF groups.
Currently disabled by default: enabled using
#define GROUP_ADAPTIVE_MAXQ

In this patch the active max Q is adjusted for each GF
group based on the vbr bit allocation and raw first pass
group error.

This will tend to give a lower q for easy sections
and a higher value for very hard sections. As such it is
expected to improve quality in some of the easier
sections where quality issues have been reported.

This change tends to hurt overall psnr but help
average psnr. SSIM also shows a small gain.

Average results for derf, yt, std-hd and yt-hd test sets were
as follows (%change for average psnr, overal psnr and ssim):-

derf +0.291, - 0.252, -0.021
yt +6.466, -1.436, +0.552
std-hd +0.490, +0.014, +0.380
yt-hd +5.565, - 1.573, +0.099

Change-Id: Icc015499cebbf2a45054a05e8e31f3dfb43f944a
2015-01-26 14:55:36 -08:00
Yaowu Xu
6d16f6c14c Fix MSVC warnings on conversion from int64 to int
Change-Id: I7e96509ffa36899fcd2935749927a1e8aac8d025
2015-01-26 10:54:06 -08:00
Frank Galligan
9f6eba419a Add Neon intrinsic vp9_fdct8x8_quant_neon
On Nexus 7 speed -5 got ~2%, -6 got ~15%, -7 and -8 got ~30%
increase in perf.

Tested on Nexus 7, built with ndk r10d, gcc 4.9.

Change-Id: I83246d63b96674d170098a572fa4fe28a05aaf51
2015-01-24 22:49:50 -08:00
Yaowu Xu
643c75d90b Merge "Replace divide with look-up" 2015-01-23 21:12:18 -08:00
Jingning Han
9bdc0ae2b2 Format fixes in vp9_rd_pick_inter_mode_sb/sub8x8
Add parentheses to bit operations.

Change-Id: I095d601f0631d055adc4b3a8fde70c9cbae9e749
2015-01-23 11:48:58 -08:00
JackyChen
65f60f8e8c Merge "SSE2 code for the filter in MFQE." 2015-01-23 11:08:16 -08:00
Adrian Grange
0e2e2c2652 Merge "Remove elevate_newmv_thresh from SPEED_FEATURES (unused)" 2015-01-23 09:57:03 -08:00
Yaowu Xu
eda179764f Replace divide with look-up
This commit replaces an integer divide with a table-lookup. It is
to improve decoding speed, and at the same time, to reduce possible
complications with a bug in AMD Family 12h processors:

"665 Integer Divide Instruction May Cause Unpredictable Behavior"

Change-Id: I678b707a538798a923850bac467e66e847e6def7
2015-01-23 09:02:07 -08:00
Johann
a18da9760a Revert "Merge branch 'frame-parallel' to enable frame parallel decode in master branch."
This reverts commit bde04ce503

Change-Id: I053dae04c761b04a36dc239558503905a14d2470
2015-01-23 08:42:02 -08:00
hkuang
bde04ce503 Merge branch 'frame-parallel' to enable frame parallel decode in master branch.
In frame parallel decode, libvpx decoder decodes several frames on all
cpus in parallel fashion. If not being flushed, it will only return frame
when all the cpus are busy. If getting flushed, it will return all the
frames in the decoder. Compare with current serial decode mode in which
libvpx decoder is idle between decode calls, libvpx decoder is busy
between decode calls. VP9 frame parallel decode is >30% faster than serial
decode with tile parallel threading which will makes devices play 1080P
VP9 videos more easily.

* frame-parallel:
  Add error handling for frame parallel decode and unit test for that.
  Fix a bug in frame parallel decode and add a unit test for that.
  Add two test vectors to test frame parallel decode.
  Add key frame seeking to webmdec and webm_video_source.
  Implement frame parallel decode for VP9.
  Increase the thread test range to cover 5, 6, 7, 8 threads.
  Fix a bug in adding frame parallel unit test.
  Add VP9 frame-parallel unit test.
  Manually pick "Make the api behavior conform to api spec." from master branch.
  Move vp9_dec_build_inter_predictors_* to decoder folder.
  Add segmentation map array for current and last frame segmentation.
  Include the right header for VP9 worker thread.
  Move vp9_thread.* to common.
  ctrl_get_reference does not need user_priv.
  Seperate the frame buffers from VP9 encoder/decoder structure.
  Revert "Revert "Revert "Revert 3 patches from Hangyu to get Chrome to build:"""

 Conflicts:
       test/codec_factory.h
       test/decode_test_driver.cc
       test/decode_test_driver.h
       test/invalid_file_test.cc
       test/test-data.sha1
       test/test.mk
       test/test_vectors.cc
       vp8/vp8_dx_iface.c
       vp9/common/vp9_alloccommon.c
       vp9/common/vp9_entropymode.c
       vp9/common/vp9_loopfilter_thread.c
       vp9/common/vp9_loopfilter_thread.h
       vp9/common/vp9_mvref_common.c
       vp9/common/vp9_onyxc_int.h
       vp9/common/vp9_reconinter.c
       vp9/decoder/vp9_decodeframe.c
       vp9/decoder/vp9_decodeframe.h
       vp9/decoder/vp9_decodemv.c
       vp9/decoder/vp9_decoder.c
       vp9/decoder/vp9_decoder.h
       vp9/encoder/vp9_encoder.c
       vp9/encoder/vp9_pickmode.c
       vp9/encoder/vp9_rdopt.c
       vp9/vp9_cx_iface.c
       vp9/vp9_dx_iface.c

Change-Id: Ib92eb35851c172d0624970e312ed515054e5ca64
2015-01-22 18:18:53 -08:00
Adrian Grange
527e073163 Remove elevate_newmv_thresh from SPEED_FEATURES (unused)
Change-Id: I78ef7f89586a329787f6bc4c58ec83af210989a3
2015-01-22 16:12:50 -08:00
Marco
0dccb6277c Modify variance partition selection for low resolutions.
For low spatial resolutions: bias partittion selection to smaller block sizes,
and base the variance computation on 4x4 down-sampling.

Also move the threshold computations into the choose_partitioning,
so they are computed once for each sb block.

On low-res clips (RTC_derf) PSNR/SSIMetrics increase by about 4-5%.
No change for resolutions above CIF.

Change-Id: I93f8ff742c8044786977bb6e31dcf8efda6dd1b0
2015-01-22 15:16:55 -08:00
Paul Wilkins
cf3202132f Merge "Bug when last group before forced key frame is short." 2015-01-22 08:28:19 -08:00
Paul Wilkins
0bff1efc2b Bug when last group before forced key frame is short.
Just before a forced key frame we often get a foreshortened
arf/gf group. In such a case, we do not want to update
rc->last_boosted_qindex, which is used to define the Q range
for the forced key frame itself.

This gives a small average metrics gain for the YT and YT-HD sets
(eg. YT SSIM +0.141%).

Change-Id: Ie06698bc4f249e87183b8f8fb27ff8f3fde216d9
2015-01-21 15:25:57 -08:00
JackyChen
cd0830f452 Merge "Fix compile error in Chromium building." 2015-01-21 14:52:32 -08:00
JackyChen
25a19b48ff Fix compile error in Chromium building.
The comparison of address in the condition is not necessary, since
they will constantly be non-null.

Change-Id: Id0b0075283f5af65215d5761a8160a4cb2a15c9b
2015-01-21 12:59:25 -08:00
Alex Converse
910ca857df Allow external resize via vpx_codec_enc_config_set
Change-Id: I3d324e2baa4de2d266c5f7ca7b635b62372e90a7
2015-01-21 11:33:06 -08:00
Yaowu Xu
c97d435243 Merge "Replace "colorspace" with "color_space"" 2015-01-21 08:58:09 -08:00
Frank Galligan
469ff48d7b Merge "Add Neon intrinsics for vp9_avg_8x8_neon" 2015-01-20 14:38:39 -08:00
Yunqing Wang
6d7b7abf52 Add non420 code in multi-threaded loopfilter
Added non420 part back to make it consistent with single
thread code in vp9_loopfilter.c.

Change-Id: I8ca255d73bffebae294d2627d6655eafe535cb90
2015-01-20 09:31:47 -08:00
Yunqing Wang
7b232717af Merge "vp9_ethread: add parallel loopfilter" 2015-01-20 09:27:08 -08:00
JackyChen
09673deba9 SSE2 code for the filter in MFQE.
The SSE2 code is from VP8 MFQE, reuse it in VP9. No change on VP8
side. In our testing, we achieve 2X speed by adopting this change.

Change-Id: Ib2b14144ae57c892005c1c4b84e3379d02e56716
2015-01-18 16:07:59 -08:00
Frank Galligan
cc2da09d42 Fix variance Neon intrinsics > 32x32
The 16 bit sum vector was overflowing.

Change-Id: I0fdf38e832ee99457ec8680a92691a6175ff8c3f
2015-01-17 10:31:48 -08:00
Yunqing Wang
e76eaf05b1 vp9_ethread: add parallel loopfilter
1. Added row-based loopfilter in encoder;
2. Moved common multi-threaded loopfilter functions from decoder
   to common;
3. Merged multi-threaded loopfilter code, and made encoder/
   decoder call same function to reduce code duplication.

Encoder tests showed that 1% - 2% speedup was seen for good-quality
2-pass mode(at speed 3); 1% - 3% speedup using 2 threads and 4% - 6%
speedup using 4 threads were seen for real-time mode(at speed 7).

Change-Id: I8a4ac51c2ad9bab9fa7b864e90743931c53ec1c4
2015-01-16 17:19:27 -08:00
Jingning Han
0220255fa0 Merge "Fix frame buffer swap in denoiser" 2015-01-16 16:58:37 -08:00
Jingning Han
dfda5cebc7 Fix frame buffer swap in denoiser
This commit fixes a bug in denoiser reference frame buffer swap,
which disables frame buffer update.

Change-Id: I39a9427180fd18f9692602064ad821f7af4714c0
2015-01-16 12:29:58 -08:00
Yaowu Xu
bc5d3fae5c Replace "colorspace" with "color_space"
This is to make the usage of the variable name consistent across
the code base.

Change-Id: I698739e55841c59358d1c6e5cc97c96088772943
2015-01-15 17:58:47 -08:00
Minghai Shang
220bc3a013 [two pass temporal svc]Fix crash issue in transcoder app caused by last fix.
Change-Id: I78ecc8ec3fa3ba5f69bb23813e68a5255d0534e1
2015-01-15 16:59:54 -08:00
Frank Galligan
6e7e1cf32f Add Neon intrinsics for vp9_avg_8x8_neon
On Nexus 7 speed -5, -6, -7, and -8 saw about a 1% increase
in perf for 480p. Speeds -5, -6, -7, and -8 saw about a 1.5%
increase in perf for 720p.

Tested on Nexus 7, built with ndk r10d, gcc 4.9.

Change-Id: Ibf17ebfd952a6aec941719bd8306df8ec4574bee
2015-01-15 15:32:40 -08:00
Yunqing Wang
99b99831e4 Align thread data in vp9_ethread
On some platforms, such as 32bit Windows and 32bit Mac, the allocated
memory isn't aligned automatically. The thread data is aligned to
ensure the correct access in SIMD code.

Change-Id: I1108c145fe982ddbd3d9324952758297120e4806
2015-01-14 15:51:56 -08:00
Yaowu Xu
829a01dbb7 Merge "Add encoder control for setting color space" 2015-01-14 14:14:34 -08:00
Frank Galligan
c7d6c0c5a8 Merge "Switch remaining Neon variance functions to shifts" 2015-01-14 12:17:42 -08:00
Frank Galligan
68224a6e87 Merge "Add 64x64 sub_pel_variance Neon function" 2015-01-14 12:17:20 -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
Yaowu Xu
afae733eed Merge "Enable decoder to pass through color space info" 2015-01-14 10:04:15 -08:00
Frank Galligan
ec1d8387e1 Add 64x64 sub_pel_variance Neon function
On Nexus 7 speed -5, -6, -7, and -8 saw about a 15% increase
in perf for 480p. Speeds -5, -6, -7, and -8 saw about a 10%
increase in perf for 720p.

Tested on Nexus 7, built with ndk r10d, gcc 4.9.

Change-Id: I2fa5315845e3021c9a6e2ea47e52e68b398d8334
2015-01-14 08:36:24 -08:00
Frank Galligan
588f74f8a6 Switch remaining Neon variance functions to shifts
Saves 5 instructions on 8x8 and 16x16 and 8 instructions
on 32x32, when compiled with 4.9.

Change-Id: Id3da613a36a9d27d8c5169c59ba45d247c920c6c
2015-01-14 07:22:49 -08:00
Frank Galligan
bd3dbc588c Merge "Add 64x variance Neon functions" 2015-01-13 22:38:58 -08:00
Minghai Shang
a14415d171 [twopass temporal svc] Fix decoding error on seek.
Don't put small empty frame in front of a key frame. We will
put key frame flag in webm container if there's a visible key
frame. But there will be decoding error when we seek to here
if we put the small empty frame, which will be inter frame,
in front of it.

Change-Id: Id50c2c1fd31da0405ff6faa7375cc2f49c55402d
2015-01-13 15:44:22 -08:00
Yaowu Xu
6b223fcb58 Enable decoder to pass through color space info
This commit added a field to vpx_image_t for indicating color space,
the field is also added to YUV_BUFFER_CONFIG. This allows the color
space information pass through the decoder from input stream to the
output buffer.

The commit also updated compare_img() function with added verification
of matching color space to ensure the color space information to be
correctly passed from encode to decoder in compressed vp9 streams.

Change-Id: I412776ec83defd8a09d76759aeb057b8fa690371
2015-01-13 15:13:19 -08:00
Frank Galligan
74d40cd507 Add 64x variance Neon functions
Add optimized Neon functions of:
vp9_variance32x64
vp9_variance64x32
vp9_variance64x64

On Nexus 7 speed -5 and -6 saw about a 4% increase in perf.
Speeds -7 and -8 saw about a 6% increase in perf.
Tested on Nexus 7, built with ndk r10d, gcc 4.9.

Change-Id: I5a81f13c9897eb927fa39662530f5524a0f768fa
2015-01-13 15:08:13 -08:00
Yaowu Xu
6f6fbf9175 Merge "Added plumbing for setting color space" 2015-01-13 09:20:13 -08:00
Yaowu Xu
fe3f21099f Merge "Fix comments and color format" 2015-01-11 14:01:36 -08:00
Yaowu Xu
ce52b0f8d3 Added plumbing for setting color space
Change-Id: If64052cc6e404abc8a64a889f42930d14fad21d3
2015-01-09 10:54:25 -08:00
Yaowu Xu
ecbca31a1d Fix comments and color format
Replaced "color space" with "color format" in comments where color
sampling format is concerned, so to differentiate from the concept
defined in COLOR_SPACE.

Change-Id: I8c935034c166b24307a99352dab1686531276bb8
2015-01-09 10:36:43 -08:00
Paul Wilkins
ccffe318ff Merge "Use 64 bit to accumulate frame sse." 2015-01-09 06:05:11 -08:00
Jingning Han
ae537c151b Merge "Refactor mc reference block fetch in denoiser" 2015-01-08 17:56:53 -08:00