21 Commits
Author SHA1 Message Date
Wan-Teh Chang 428f3104fa Include "gtest/gtest.h" using the shorter path
Rely on the -I or -system compiler option to find "gtest/gtest.h". This
makes it easier to build our tests against a copy of gtest outside the
libvpx source tree.

Bug: webm:42330726
Change-Id: I3b189c6345e13b36b236d1eedc6ee091bfa71f48
2024-08-02 22:42:20 +00:00
Wan-Teh Chang f65aff7b99 Remove vpx_ports/msvc.h
The vpx_ports/msvc.h header provides snprintf() and round() for MSVC
older than Visual Studio 2015 and Visual Studio 2013, respectively.

Since configure now requires vs14 (Visual Studio 2015) or later, it is
safe to remove vpx_ports/msvc.h.

Change-Id: I2fe4c41eaa126f4cf17639c11895f1e464294c76
2024-05-02 20:01:11 +00:00
Wan-Teh Chang c0db981eaa Include <stdio.h> or <cstdio> for *printf()
Change-Id: Ifc0537fe5ae1223418fb68da5583cc72ae2c32a8
2024-05-02 02:26:16 +00:00
yuanhecai eb232b662a loongarch: Fix bugs from vp8_sixtap_predict4x4/16x16_lsx
Bug: webm:1755

Change-Id: I7295e0f9a1551b8a418d5b65a2b7351df1fdc063
2023-09-13 10:06:23 +08:00
James Zern 84e6b7ab02 test/*.cc: prefer 'override' to 'virtual'
created with clang-tidy --fix --checks=-*,modernize-use-override

Change-Id: I71e1b4423c143b3e47fe90929ee110b307cdb565
2023-07-24 18:09:31 -07:00
James Zern e4f0df53ec vp8_sixtap_predict16x16_neon: fix overread
Shift the final read from the source by 3 to avoid breaking the
assumption that the 6-tap filter needs only 5 pixels outside of the
macroblock; this matches the sse2 and ssse3 implementations.

It's possible this restriction could be removed if the source buffers
are assumed to be padded.

Bug: webm:1795
Change-Id: I4c791e3a214898a503c78f4cedca154c75cdbaef
Fixed: webm:1795
2023-03-20 16:51:51 -07:00
James Zern 5fae248f2a disable vp8_sixtap_predict16x16_neon
This causes various buffer overflows in the tests:

[ RUN      ] NEON/SixtapPredictTest.TestWithPresetData/0
=================================================================
==22346==ERROR: AddressSanitizer: global-buffer-overflow on address
0x0000012b4a5b at pc 0x000000df0f60 bp 0xffffcf6e64b0 sp 0xffffcf6e64a8
READ of size 8 at 0x0000012b4a5b thread T0
    #0 0xdf0f5c in vp8_sixtap_predict16x16_neon
       vp8/common/arm/neon/sixtappredict_neon.c:1507:13
    #1 0x8819e4 in (anonymous
        namespace)::SixtapPredictTest_TestWithPresetData_Test::TestBody()
       test/predict_test.cc:293:3
    ...

0x0000012b4a5b is located 2 bytes to the right of global variable
'kTestData' defined in '../test/predict_test.cc:237:24' (0x12b48a0) of
size 441

[ RUN      ] NEON/SixtapPredictTest.TestWithRandomData/0
=================================================================
==22338==ERROR: AddressSanitizer: heap-buffer-overflow on address
0xffff8b5321fb at pc 0x000000df0f60 bp 0xfffff7e0cf30 sp 0xfffff7e0cf28
READ of size 8 at 0xffff8b5321fb thread T0
    #0 0xdf0f5c in vp8_sixtap_predict16x16_neon
       vp8/common/arm/neon/sixtappredict_neon.c:1507:13
    #1 0x87d4c0 in (anonymous
       namespace)::PredictTestBase::TestWithRandomData(void (*)(unsigned
       char*, int, int, int, unsigned char*, int))
       test/predict_test.cc:170:9
    ...

0xffff8b5321fb is located 2 bytes to the right of 441-byte region
[0xffff8b532040,0xffff8b5321f9)
allocated by thread T0 here:
    #0 0x5fd4f0 in operator new[](unsigned long) (test_libvpx+0x5fd4f0)
    #1 0x87c2e0 in (anonymous namespace)::PredictTestBase::SetUp()
       test/predict_test.cc:47:12
    #2 0x87d074 in non-virtual thunk to (anonymous
       namespace)::PredictTestBase::SetUp() test/predict_test.cc
    ...

Bug: webm:1795
Change-Id: I32213a381eef91547d00f88acf90f1cf2ec2ea75
2023-03-03 15:33:16 -08:00
Jerome Jiang b358f9076f NULL -> nullptr in CPP files
This should clean up clangtidy warnings

Change-Id: Ifb5a986121b2d0bd71b9ad39a79dd46c63bdb998
2020-07-27 11:51:04 -07:00
James Zern 83769e3d25 update googletest to v1.10.0
this moves the framework to c++11 and changes *_TEST_CASE* to
_TEST_SUITE

BUG=webm:1695

Change-Id: I07f2c20850312a9c7e381b38353d2f9f45889cb1
2020-06-18 10:56:39 -07:00
James Zern 8f03f719af test/*: use std::*tuple
since:
77fa51003 Replace deprecated scoped_ptr with unique_ptr

c++11 has been required so <tuple> is safe to use

Change-Id: I873cb953104b361a8503b5839a3372ce2b99e73c
2018-12-07 17:55:21 -08:00
Johann 76d7b379a9 fix snprintf error on windows
Include vpx_ports/msvc.h to handle snprintf on older
versions of Visual Studio

Change-Id: I06cd99b32bbae82b3df079d41ff20a9a07f6fe1c
2018-11-02 07:34:12 -07:00
Johann 5caec339be vp8 bilinear: rewrite 4x4
~20% faster than the MMX. Removes the last usage of
vp8_bilinear_filters_x86_[48].

Change-Id: Iee976fab9655d0020440f26c4403ce50103af913
2018-10-25 15:05:28 -07:00
Johann 6f35ac956b vp8 bilinear: rewrite in intrinsics
8x8 is 15% faster than the assembly. 8x4 is 200% faster than MMX.

Remove MMX version.

Change-Id: I55642ebd276db265911f2c79616177a3a9a7e04f
2018-10-24 16:01:39 -07:00
Johann 08e6fd2fbb clang-format v6.0.1
Change-Id: I83c7e64fe70f7c49aa2492ed2d640c6756b7ebaa
2018-09-24 18:31:35 -07:00
James Zern db49a22cfa test: use testing::*tuple instead of std::tr1
googletest imports tuple into testing to allow for compatibility across
c++ versions where tuple may be in std::tr1 or std. fixes deprecation
warnings under visual studio 2017

Change-Id: Id78b372d5478b12d8c8f63fd3f2166fec25aa8be
2018-03-28 12:45:35 -07:00
Shiyou Yin 0095213790 vp8: [loongson] optimize sixtap predict with mmi
1. vp8_sixtap_predict16x16_mmi
2. vp8_sixtap_predict8x8_mmi
3. vp8_sixtap_predict8x4_mmi
4. vp8_sixtap_predict4x4_mmi

Change-Id: I186669d1a1d998a0f3ba3a548e25eee8b52c251b
2017-09-02 19:08:20 +00:00
Johann 721354fe7f vp8: remove mmx functions
When they have sse2 equivalents.

Change-Id: I158f631a3bcecba57b36093ac10114b1904767a7
2016-09-29 15:25:27 -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
Johann 35ebc1cddf predict_test: align dst buffer to 16
On 32 bit machines 'new' does not always appear to allocate sufficiently
aligned buffers, causing intermittent test failures.

Change-Id: I0db4fc73782012e4eef71dc0fb540e74fdbfcebe
2016-09-21 13:35:47 -07: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
Johann caf9a7841e Add vp8_bilinear_filter test
Build out the sixtap_predict test because the filters are
interchangeable. Add verbose failures and border checking.

Change-Id: I962f50041750dca6f8d0cd35a943424cf82ddcb1
2016-09-15 23:16:19 -07:00