Commit Graph

3180 Commits

Author SHA1 Message Date
clang-format
4b402746ca apply clang-format
Change-Id: I75e4a9e0b37bd4586f26c8d6c1fa27f3f6ff1bce
2017-02-14 12:45:52 -08:00
Johann
25301a84a8 vp8 onyx_if: assert divide by zero
Clears up static clang analysis warning regarding divide by zero.

Trying to explain to the compiler how it's impossible to avoid
incrementing num_blocks at least once is difficult.

Change-Id: Ibaae43be572e5cd7a689b440dcd341c17d33443b
2017-02-14 04:27:31 +00:00
Johann
8a1fb40273 Remove UNINITIALIZED_IS_SAFE
Where clang static analysis or gcc -Wmaybe-uninitialized warns of
uninitialized values, assign 0 to ints, MB_MODE_COUNT to
MB_PREDICTION_MODE, and B_MODE_COUNT to B_PREDICTION_MODE.

Assert that the modes have been changed from the invalid value by
the end of the function.

Change-Id: Ib11e1ffb08f0a6fe4b6c6729dc93b83b1c4b6350
2017-02-14 00:56:08 +00:00
Peter Boström
297dfd8696 Add decoder getters for the last quantizer.
To be used for frame stats output of vpxdec.

Change-Id: I0739a01bd3635c4b3fedd58f3e27363ce8fb1b1e
2017-01-12 16:16:22 -05:00
Jim Bankoski
318a1ff5ec vp8 : use threading mutex's for tsan only.
To avoid decode performance hit of 2% when running on hyperthreaded
cores.

This patch only uses the mutex's when we are running tsan.

This is safe because 32 bit operations like read and store are atomic
on all the platforms we care about. Tsan warns about race situations,
but in this case either situation ( read occurs before write or write
before read) the worst case is that we go around one extra time in the
loop.  So the ordering doesn't really matter.

That said a few other things have been tried :

for instance as per here:
webrtc/base/atomicops.h#52

In this patch they use:
__atomic_load_n(i, __ATOMIC_ACQUIRE);
__atomic_store_n(i, value, __ATOMIC_RELEASE);

This code works on gcc, clang ( replacing protected write and read), and
avoids tsan errors. Incurring no penalty in performance.  In C11 its
replaced by straight atomic operands.

However there is no equivalent in the visual studio's we support as
int32 on all windows platforms is already atomic.  To avoid tsan like
warnings on windows we'd need to use interlocked exchange and the
end result doesn't gain us any thing.

Change-Id: I2066e3c7f42641ebb23d53feb1f16f23f85bcf59
2016-12-16 08:50:55 -08:00
Yaowu Xu
27e1bacdb3 Change order of operation to avoid ubsan warnings
This commit change an order of operation to avoid left shifts of
negative numbers.

Change-Id: I607c7eb91658c7a5ef397fc1504721d1b10e3dd6
2016-12-14 09:37:14 -08:00
Jim Bankoski
85a541a421 Reapply 'Amend and improve VP8 multithreading implementation'
Reapply this patch:
ff0107f Amend and improve VP8 multithreading implementation

Amended the patch to add a unit test, and fix an asan error.

BUG=webm:851

Change-Id: I6572c03256169c64e80248bf5a5e99f59a2fc93c
2016-12-13 02:11:34 +00:00
Kaustubh Raste
ecc5998bcf Fix mips dspr2 build warning
Change-Id: Ia8fb3ed124f01384e7896e309c9ff22c05b40719
2016-11-22 17:49:17 +05:30
James Zern
ba016b710a Merge "*ppflags.h: remove unused *_DEBUG_* enum values" 2016-11-10 20:53:22 +00:00
James Zern
4807f1584c *ppflags.h: remove unused *_DEBUG_* enum values
usage of the vp8 versions was removed in:
3f72509 vp8: remove VP8_SET_DBG* control support

vp9 had the usage stripped even earlier.

Change-Id: I978142eb6492552cd29c9c6feb1e89acfc5f7b84
2016-11-08 21:09:16 -08:00
Johann
f5141ea45f Refine vp8_refining_search_sadx4 targeting
This uses the same sdx4df pointers as vp8_diamond_search_sadx4 and
should therefore target the same optimizations.

See e4ddf9db6a

Change-Id: Ic298e9b25c34bbe6b7a0799509355b0addb56675
2016-11-08 15:22:44 -08:00
Marco
9fdae93858 vp8: Apply gf target-size boost only when refresh_golden_frame = 1.
Change only affects 1 pass cbr, error resilience off.

Change-Id: I68b896b09d722995a71c44331233e97bd862bcfc
2016-10-20 11:32:29 -07:00
Marco
9624964832 vp8: Adjust threshold to set the gf_noboost flag.
Change only affects 1 pass cbr, with error_resilient off.

Change-Id: Ibf254d8772fa2a8f188c9932d37b2f42362d8003
2016-10-19 12:55:37 -07:00
Marco
ff38b8dfae vp8: Add control for gf boost for 1 pass cbr.
Control already exists for vp9, adding it to vp8.
Usage is only when error_resilient is off.
Added a datarate unittest for non-zero boost.

Change-Id: I4296055ebe2f4f048e8210f344531f6486ac9e35
2016-10-19 09:43:53 -07:00
Jim Bankoski
3e21d703ce Drop empty frames.
Change-Id: I2d45a6eb3aaca97eb61e8e7ef9e5114221091244
2016-10-14 06:28:14 -07:00
Kaustubh Raste
56b1be1889 Merge "Optimize vp8 loopfilter msa functions" 2016-10-12 05:44:11 +00:00
Marco Paniconi
294a734a5f Merge "vp8: Change default gf behavior for 1 pass cbr." 2016-10-10 23:06:31 +00:00
Marco
df66f8e830 vp8: Change default gf behavior for 1 pass cbr.
In 1 pass CBR, with error_resilience off, allow for
special logic to change the default gf behaviour.
In this CL: boost is turned off and the gf period
is set to a multiple of cyclic refresh period.

Change only affect 1 pass CBR mode, i.e, when the flag
gf_update_onepass_cbr is set.

Including the previous change (3ec8e11: to allow cyclic refresh
for error_resilience off), comparing metrics on RTC set for
error_resilience off vs on: avgPSNR/SSIM up by ~6%.

Change-Id: Id5b3fb62a4f04de5a805bd1b418f2b349574e0bc
2016-10-07 11:13:06 -07:00
Kaustubh Raste
06a6b28d75 Optimize vp8 loopfilter msa functions
Updated code to process in 8bit as saturation/clipping takes care of overflow

Change-Id: I35fb2c0e702fd91309cc391c5a7745a3b619a64c
2016-10-07 15:48:31 +05:30
Linfeng Zhang
7aa27bd62f [vpx highbd lpf NEON 1/6] horizontal 4
BUG=webm:1300

Change-Id: Idf441806e6bf397ff5ecd8776146b3f781f50c40
2016-10-06 14:03:04 -07:00
Kaustubh Raste
f875267ad0 Merge "Modify vp8 idct msa functions store method" 2016-10-06 02:25:42 +00:00
Marco Paniconi
efb56ec3ff Revert "Revert "vp8/encoder/onyx_if.c: apply clang-format""
This reverts commit a7456144ce.

Change-Id: I400987fb26a09e9b9ea42c91f48ea12f7bc37356
2016-10-05 17:59:55 +00:00
Marco Paniconi
a7456144ce Revert "vp8/encoder/onyx_if.c: apply clang-format"
This reverts commit 891a87dccd.

Change-Id: I067b3b6a3cfb5bc760166999948b8087d4c5cb80
2016-10-05 15:45:48 +00:00
Kaustubh Raste
68f6f6c4cc Modify vp8 idct msa functions store method
vp8_short_inv_walsh4x4_msa - Optimized to process in short vector type
Updated below functions to store exact number of bytes in output rather than complete vector
idct4x4_addblk_msa
idct4x4_addconst_msa
dequant_idct4x4_addblk_msa
dequant_idct4x4_addblk_2x_msa
dequant_idct_addconst_2x_msa

Change-Id: Ic1b3752e2421dc7d70a082dcdaab9d140d7e5d9c
2016-10-05 10:12:12 +05:30
clang-format
891a87dccd vp8/encoder/onyx_if.c: apply clang-format
after:
955b3b6 vp8: Allow for cyclic refresh even if error_resilience it off.

Change-Id: Iba189b18c84be8f5140754280c6801cfc387cfcd
2016-10-04 21:12:06 -07:00
Marco
955b3b66bd vp8: Allow for cyclic refresh even if error_resilience it off.
cyclic_refresh was tied to error_resilience mode.
Allow it to be on also for 1 pass CBR mode even if
error_resilience is off.

Other option to use new control for this, but prefer to avoid
that for now.

Change-Id: I3625b292ee059a890e31338b514e211bf0ab5c3e
2016-10-04 14:19:49 -07:00
Sarah Parker
8978704970 Merge "Remove rate deviation metric from vp8" 2016-10-04 18:56:14 +00:00
Sarah Parker
d556d435f3 Remove rate deviation metric from vp8
BUG=b/31780679

Change-Id: I2b2a43b154eeacb4f51a11f6362cc535cfe318da
2016-10-04 11:20:55 -07:00
James Zern
3c00132181 Merge "vp8,frame_buffers: remove unused use_frame_threads" 2016-10-01 01:35:55 +00:00
James Zern
1396d12103 *idct*_neon.c: add missing rtcd include
+ correct declarations as necessary

BUG=webm:1294

Change-Id: I719602df9a56e79188a78e7f8b31257c6d3cc11d
2016-09-30 11:41:26 -07:00
James Zern
f38616e1a2 vp8,frame_buffers: remove unused use_frame_threads
this was never fully implemented

Change-Id: I4640cf84c40ea2cc9c6c12acf116d39df4b04578
2016-09-29 20:24:15 -07:00
Johann
721354fe7f vp8: remove mmx functions
When they have sse2 equivalents.

Change-Id: I158f631a3bcecba57b36093ac10114b1904767a7
2016-09-29 15:25:27 -07:00
Johann
2663b092ae Rename _xmm functions to _sse2
Avoid the extra level of indirection/confusion.

Change-Id: I0555f639d67835df9fb7dac0c75085e9954805f1
2016-09-29 15:23:11 -07:00
Johann
1364cb58b4 Remove vp8_clear_system_state
Use vpx_clear_system_state instead.

Change-Id: Ia3e9122f69a2c690ddd7c7bc54f92ccb9ec18b3e
2016-09-29 13:22:49 -07:00
Johann
c7f9d0719d vp8: clean up rtcd
Remove lines which specify the same name for a function.

Change-Id: I956bd8ce2b81a2a8feab5621d28bd2499c2b4c2d
2016-09-29 12:10:01 -07:00
Johann Koenig
bb27be0dfe Merge "Hook up vp8_diamond_search_sad_sse3" 2016-09-28 20:54:25 +00:00
Johann
e4ddf9db6a Hook up vp8_diamond_search_sad_sse3
The original commit never set any 'specialize' line:
61311e6103

It appears the sadx4 version of function uses sdx4df calls to speed up
the search. There are no sse3 versions of the sdx4df functions, but
there are sse2 and msa versions.

There is a neon version of vpx_sad16x16x4d but not any of the smaller
versions. Perhaps if they existed this function could be expanded to use
them.

Change-Id: I936d7d6b1a3ff6dcd5a4d2322272708c47cdec13
2016-09-27 15:31:49 -07:00
Johann
02fa245d15 mips: clean up wextra warnings
Remove unused zbin variable:
warning: unused parameter ‘zbin’

Use int for loop variables to avoid unsigned conversion:
warning: comparison between signed and unsigned integer expressions

Change-Id: Icea74b870c0ee68a8bf687e796a69392af25a8ad
2016-09-27 13:19:18 -07:00
Johann Koenig
b165451ad5 Merge "Un-Revert "Restore vp8_sixtap_predict4x4_neon"" 2016-09-26 19:11:00 +00:00
Johann
ab0e7a237a Use shifted value for sinpi8sqrt2
The value 35468 changes sign when stored in int16_t:
implicit conversion from 'int' to 'int16_t' (aka 'short')
changes value from 35468 to -30068

This negation requires adding back the original value to compensate.
Shifting the value keeps the value positive and saves a post-vqdmulh
shift.

This technique is used in webp and idct_dequant_full_2x_neon

BUG=b/28027557

Change-Id: I0c5ce09bea170fe08061856c2af6f841a557e0c3
2016-09-23 17:04:18 -07:00
Johann
1d14e42df7 Un-Revert "Restore vp8_sixtap_predict4x4_neon"
This restores d9dce2f48e

Switched to using signed shift-and-narrow. Instead of saturating
negative results to 0, it was saturating them to 255.

BUG=webm:817
BUG=webm:1273

Change-Id: I571095336aa4182e3288b17924fcaaece42b0a49
2016-09-23 14:58:57 -07:00
James Zern
fcf281b6a1 Merge "vp8: remove VP8_SET_DBG* control support" 2016-09-22 00:43:35 +00:00
Johann
2bed8b6acd Keep vp8 sixtap read within bounds
When filtering it needs 6 pixels: 2 prior to the source, the source, and
3 after the source.

When filtering 16 wide, that means 21. To accomplish this the SSE2 reads
[-2] to [5], [6] to [13], and [14] to [21], a total of 24 bytes (reading
in groups of 8 is easy)

The filter then shifts this last set to the top half of the register and
uses 'or' to combine it with the previous set.

Valgrind detected an issue reading pixels [19], [20] and [21]:
Address 0x7f581c2 is 434 bytes inside a block of size 441 alloc'd

Note: we only need pixels [16], [17], and [18] as context for [15].

To fix this, it now reads 8 bytes starting at [11], which re-loads [11]
through [13], but stops at [18] and does not over-read any values.

This is shifted by 5 and 'or'd with xmm1. Although the lower bits are
not cleared, they overlap directly with [11] through [13], so 'or'
produces the correct results.

Change-Id: I0c89c03afa660fc9b0108ac055d7bd403e493320
2016-09-21 16:17:07 -07:00
James Zern
3f72509587 vp8: remove VP8_SET_DBG* control support
the --enable-postproc-visualizer configure option remains as a no-op as
do the control names and values for compatibility
+ remove the corresponding debug flags from vpxdec: --pp-*

Change-Id: I4a001cd9962b59560d7d6bda6272d4ff32b8d37c
2016-09-20 20:19:36 -07:00
James Zern
b6e686b1ea Merge changes from topic 'Wshorten'
* changes:
  vp8: convert some uses of unsigned long to size_t
  vp8/encoder: quiet some -Wshorten-64-to-32 warnings
2016-09-20 23:17:20 +00:00
Johann Koenig
8478f97105 Merge "Enable ssse3 bilinear tests" 2016-09-20 21:46:50 +00:00
James Zern
8281da74b9 vp8: convert some uses of unsigned long to size_t
similar to changes that were done in vp9 for encoded frame size
reporting. has the side-effect of quieting a -Wshorten-64-to-32 warning.

Change-Id: I89f74cb617fc29334ee351dc8dfaa3b8cfd4e5af
2016-09-19 18:35:59 -07:00
James Zern
0ce98b423b vp8/encoder: quiet some -Wshorten-64-to-32 warnings
this code is similar to other existing uses and/or vp9

Change-Id: I56e646931379759d9f7332ea6d746060007c75ee
2016-09-19 18:35:59 -07:00
James Zern
7a9e476072 Merge changes from topic 'clang-format'
* changes:
  apply clang-format
  .clang-format: update to 3.8.1
2016-09-16 07:11:33 +00:00
Johann
e813c2b416 Enable ssse3 bilinear tests
The code only has issues when xoffset == 0 and yoffset == 0 which
represents a simple copy. Presumably this case does not need to be
handled because the issue has existed since 2010.

BUG=webm:1287

Change-Id: Ic47e2653f3b729e99b40e53d8d2d8d1501edaaa9
2016-09-15 23:16:26 -07:00