summaryrefslogtreecommitdiff
path: root/vp8
AgeCommit message (Collapse)Author
2020-09-14vp8: Remove sched_yield on POSIX systemsJoel Fernandes
libvpx does sched_yield() on Linux. This is highly frowned upon these days mainly because it is not needed and causes high scheduler overhead. It is not needed because the kernel will preempt the task while it is spinning which will imply a yield. On ChromeOS, not yielding has the following improvements: 1. power_VideoCall test as seen on perf profile: With yield: 9.40% [kernel] [k] __pi___clean_dcache_area_poc 7.32% [kernel] [k] _raw_spin_unlock_irq <-- kernel scheduler Without yield: 8.76% [kernel] [k] __pi___clean_dcache_area_poc 2.27% [kernel] [k] _raw_spin_unlock_irq <-- kernel scheduler As you can see, there is a 5% drop in the scheduler's CPU utilization. 2. power_VideoCall test results: There is a 3% improvement on max video FPS, from 30 to 31. This improvement is consistent. Also note that the sched_yield() manpage itself says it is intended only for RT tasks. From manpagE: "sched_yield() is intended for use with real-time scheduling policies (i.e., SCHED_FIFO or SCHED_RR) and very likely means your application design is broken." BUG=b/168205004 Change-Id: Idb84ab19e94f6d0c7f9e544e7a407c946d5ced5c Signed-off-by: Joel Fernandes <joelaf@google.com>
2020-08-19Refine MMI & MSA detection for mipsjinbo
1.Add compile check to probe the native ability of toolchain to decide whether a feature can be enabled. 2.Add runtime check to probe cpu supported features. MSA will be prefered if MSA and MMI are both supported. 3.You can configure and build as following commands: ./configure --cpu=loongson3a && make -j4 Change-Id: I057553216dbc79cfaba9c691d5f4cdab144e1123
2020-07-18vp8,vpx_dsp: [loongson] fix msa optimization bugsjinbo
Fix two bugs reported by clang when enable msa optimizatons: 1. clang dose not support uld instruction. 2. ulw instruction will result in unit cases coredump. Change-Id: I171bed11d18b58252cbc8853428c039e2549cb95
2020-07-13Merge "Cap target bitrate to raw rate internally"Jerome Jiang
2020-07-09Cap target bitrate to raw rate internallyJerome Jiang
BUG=webm:1685 Change-Id: Ida72fe854fadb19c3745724e74b67d88087eb83c
2020-07-07vp8,vpx_dsp:[loongson] fix bugs reported by clangjinbo
1. Adjust variable type to match clang compiler. Clang is more strict on the type of asm operands, float or double type variable should use constraint 'f', integer variable should use constraint 'r'. 2. Fix prob of using r-value in output operands. clang report error: 'invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions'. Change-Id: Iae9e08f55f249059066c391534013e320812463e
2020-06-29vp8,vpx_dsp:[loongson] fix specification of instruction namejinbo
1.'xor,or,and' to 'pxor,por,pand'. In the case of operating FPR, gcc supports both of them, clang only supports the second type. 2.'dsrl,srl' to 'ssrld,ssrlw'. In the case of operating FPR, gcc supports both of them, clang only supports the second type. Change-Id: I93b47348e7c6580d99f57dc11165b4645236533c
2020-06-02Add NV12 supportJerome Jiang
Change-Id: Ia2a8221a156e0882079c5a252f59bc84d8f516b1
2020-05-12Merge "Don't collect stats if they won't be used"Jerome Jiang
2020-05-11Temporarily convert to 64 bits to avoid overflowsJorge E. Moreira
In the vp8_cost_branch function a couple of unsigned int are being multiplied by integer coefficients and added to later be divided by 256. While the end result most likely fits an unsigned int, the intermediary result of multiplying and adding sometimes doesn't (I was able to reproduce it by leaving the encoder running at 60 fps for a while). To avoid the multiplication overflow (which is undefined behavior and causes a wrong result anyways) the calculation is performed using unsigned long long instead and cast to unsigned int for return. Bug: b/154172422 Test: run cuttlefish with webrtc enabled for an hour Change-Id: If7ebbda38b2450a59ed3c99ffbb59dc62431a324
2020-05-08Don't collect stats if they won't be usedJorge E. Moreira
When the encoder is run continuously for a few minutes at 60 fps, the total_target_vs_actual field overflows. Since this field is a signed integer that's considered undefined behavior in C++, which causes an abort when used in an android binary (those run with ubsan enabled) Bug: b/154172422 Test: run cuttelfish with webrtc enabled for an hour Change-Id: I8f7d9d0884311a6338bdcdec76348b8cc3ce8c69
2020-05-04vp8_dx_iface.c: make vp8_ctf_maps[] staticJames Zern
Change-Id: I6c19745a392681733c6deaaacc7e3540bc72fd4d
2020-04-13simplify x86_abi_support.asm symbol declarationJohann
Define LIBVPX_{ELF,MACHO} to simplify blocks. Create new globalsym macro and include logic for PRIVATE. BUG=webm:1679 Change-Id: I303ba1492a2813f685de51155ccef7e4831e1881
2020-04-01x86_abi_support: use correct hidden syntaxJohann
Chromium needs :function hidden and the space between the symbol and the colon removed, at least for nasm. This matches x86inc.asm. BUG=webm:1679 Change-Id: Ie47bb75d44d3130791639cbf4e2ebe019e2d686e
2020-03-21vp8/{ratectrl,onyx_if}: fix some signed integer overflowsJames Zern
in calculations involving bitrate in encode_frame_to_data_rate() and vp8_compute_frame_size_bounds() note this isn't exhaustive, it's just the result of a vpxenc run with: -w 800 -h 480 --cpu-used=8 --rt --target-bitrate=1400000000 Bug: b/151945689 Change-Id: I3a4f878046fcf80e87482761588c977c283ae917
2020-03-13fix minor spelling errorsJohann
Change-Id: I929fec66d541705fe94365b56a5bdd8cf5ee7c37
2020-02-14vp8_decode: add missing vpx_clear_system_stateJames Zern
this avoids leaving the floating point unit in an inconsistent state on error and breaking subsequent tests on x86 the test clip invalid-bug-148271109.ivf would also result in a sanitizer error prior to: vp8,GetSigned: silence unsigned int overflow warning BUG=b/148271109 Change-Id: Ia254f3892ac1eeec51db5e9d42ea071545db0cd8
2020-02-14vp8,GetSigned: silence unsigned int overflow warningJames Zern
in non-conformant fuzzed bitstreams the calculation of br->value may overflow. this is defined behavior and harmless in that the stream is already corrupt. BUG=b/148271109 Change-Id: I3668ada57e0bd68cea86b82917fb03c19ac1283d
2020-02-14move common attribute defs to compiler_attributes.hJames Zern
BUG=b/148271109 Change-Id: I620e26ff1233fcd34ebe0723cb913e82eb58271c
2020-01-22Merge "add static_assert.h"James Zern
2020-01-17add static_assert.hJames Zern
unify COMPILE_TIME_ASSERT definitions and rename to VPX_STATIC_ASSERT Change-Id: Id51150c204e0c4eaf355ee45b20915113209d524
2020-01-17Validate data used by vpx_codec_control...Brian Foley
...instead of blindly derefing NULL. Found by some additional fuzzing of the vp8/vp9 decoders to be upstreamed soon. Change-Id: I2ea08c2d15f689f3fac8cc73622056a82d94ec00
2019-12-17vp8: move error check earlierJohann
This avoids assigning variables which will not be used. A similar change was made to vpx_dsp/bitreader.c a long time ago. Change-Id: Ia5012091b8d85ca9bfefc7735a2aa69c5c2bf516
2019-12-17Merge "vp8 boolreader: ignore invalid input"Johann Koenig
2019-12-05Add missing typecast and re-enable timestamp testDebargha Mukherjee
BUG=webm:701 Change-Id: I1d8a6e263fddb9e4cc6265a313011a18d18bbf9e
2019-12-04vp8 boolreader: ignore invalid inputJohann
Do basic initialization even when the result will not be used. BUG=chromium:1026961 Change-Id: Iaa480534b49efe1ecc66484b316f8d654e8a1245
2019-12-02Avoid dividing by 0 in vp8 gf_group bits computeDebargha Mukherjee
BUG=webm:1653 Change-Id: Ic59fe5e573f08dbca678d3927d4a750ae75f903c
2019-11-08Merge "remove unused vp8_hex_search parameter"Johann Koenig
2019-11-08Merge "remove unused cpi parameters from firstpass.c"Johann Koenig
2019-11-07remove unused vp8_hex_search parameterJohann
BUG=webm:1612 Change-Id: I80765f4ed05fb5d588249e56a018bf8b9828a197
2019-11-07remove unused cpi parameters from firstpass.cJohann
BUG=webm:1612 Change-Id: I77db5f9f2cb8244cca831b76c00926112c3e0dfe
2019-11-07remove unused Pass1Encode parametersJohann
BUG=webm:1612 Change-Id: Ifbe5bbba706311057bfc5d5fa9b63e57ac56e398
2019-11-04remove unused vp8dx_receive_compressed_data parametersJohann
BUG=webm:1612 Change-Id: If2dc8a77c8f8bca86ee4b8349091dd1117b42dce
2019-11-04ensure ctx is usedJohann
Rather that (void)ing ctx, document the case where it might not be used. BUG=webm:1612 Change-Id: I1f1ba9a3d52b43a6987dbe3afec96fa17101e3bf
2019-11-04remove unused mbmi parameterJohann
BUG=webm:1612 Change-Id: I0f982d8269ec50a767efc222d958d37a55d5c77f
2019-11-04remove unused simple loopfilter parametersJohann
The simple filter only processes the Y plane. BUG=webm:1612 Change-Id: I9886ff43ea7f621d8915846cb65f609a9298566d
2019-11-04remove unused postproc parametersJohann
BUG=webm:1612 Change-Id: I92937417403af2c943e903ba66799609ef6ab635
2019-10-03vp8/decoder/decodeframe: fix int sanitizer warningsHien Ho
Unit test: VP8/InvalidFileTest implicit conversion from type 'int' of value -45844 (32-bit, signed) to type 'short' changed the value to 19692 (16-bit, signed) BUG=webm:1615 BUG=webm:1644 Change-Id: Id5d470f706d68e24f7a1e689526c9ecd3a8e8db8
2019-09-30namespace ARCH_* definesJames Zern
this prevents redefinition warnings if a toolchain sets one BUG=b/117240165 Change-Id: Ib5d8c303cd05b4dbcc8d42c71ecfcba8f6d7b90c
2019-09-10vpx_clear_system_state after drop due to overshootJerome Jiang
BUG=999780 Change-Id: I096fdc22812eab22a38a33135c0cbe60a6e64add
2019-08-27vp8/encoder/vp8_quantize: fix int sanitizer warningsHien Ho
implicit conversion from type 'int' of value 65536 (32-bit, signed) to type 'short' changed the value to 0 (16-bit, signed) BUG=webm:1615 Change-Id: I6a04e57bd3272934de9c75fab60a1620ff6c3636
2019-08-13vp8/encoder/bitstream: fix int sanitizer warningsHien Ho
implicit conversion from type 'unsigned int' of value 256 (32-bit, unsigned) to type 'unsigned char' changed the value to 0 (8-bit, unsigned) BUG=webm:1615 Change-Id: I2b630bf22cad28b5a7a8a37f6938e6ebe12bc64e
2019-06-28vp8/encoder/boolhuff: fix integer sanitizer warningsHien Ho
from sanitizer run: runtime error: implicit conversion from type 'unsigned int' of value 256 (32-bit, unsigned) to type 'unsigned char' changed the value to 0 (8-bit, unsigned) BUG=webm:1615 Change-Id: I9321bbd58a305419bc8669ecd7594adc47e8b116
2019-06-18Fix timestamp overflow issuesYue Chen
- Save the initial user-specified timestamp and rebase all further timestamps by this value. This makes libvpx internal timestamps to always start from zero, regardless of the user's timestamps. - Calculate reduced timestamp conversion ratio and use it to convert user's timestamps to libvpx internal timestamps and back. The effect of this is that integer overflow due to multiplication doesn't happen for a much longer time. BUG=webm:701 Change-Id: Ic6f5eacd9a7c21b95707d31ee2da77dc8ac7dccf
2019-06-06vp8: fix leak in vp8e_mr_alloc_memJerome Jiang
BUG=webm:1596 Change-Id: I09ba00a7b7ad331671a7a285a2ac5630d8b62199
2019-05-17vp8: Disallow copy flag behavior under forced refreshMarco Paniconi
Don't allow the setting of copy_buffer_to_arf when the application/user sets the refresh/update flags. Add new flag (ext_refresh_frame_flags_pending) to indicate user sets the flags. Change-Id: I482098c0f2552b04885132a728629ab3e207f08b
2019-05-03Merge "vp8: clamp uv mv after calculation."Jerome Jiang
2019-05-02vp8: clamp uv mv after calculation.Jerome Jiang
BUG=oss-fuzz:14478 Change-Id: Ia978a1e7829bf486681385cd715ed0b50fe3b072
2019-05-01vp8: quiet conversion warnings when packing bitsJohann
Mask the values to show that we only want to store 1 byte. Switch to lowercase ff since it's more prevalent in the file. BUG=webm:1615 Change-Id: Ia8ede79cb3a4a39c868198ae207d606e30cfb1cb
2019-04-30Merge "vp8: quiet conversion warning when packing sizes"Johann Koenig