summaryrefslogtreecommitdiff
path: root/vp8/encoder
AgeCommit message (Collapse)Author
2021-12-09vp[89]_initalize_enc(): protect against multiple invocationsJames Zern
this removes the burden from callers; the rtcd functions are left with a mostly redundant (outside of tests) once() as top-level functions should ensure their constraints are met Change-Id: I5bdbcfa4671c6a1492cfe9c7d886c361c26caaa9
2021-12-02clear -Wextra-semi/-Wextra-semi-stmt warningsJames Zern
Bug: chromium:1257449 Change-Id: Ia9aafccc09b611521d4a7aedfe3723393a840c62
2021-11-18Merge "replaced bsr() with get_msb() from bitops.h" into mainJohann Koenig
2021-11-18replaced bsr() with get_msb() from bitops.hIlya Kurdyukov
The modified line should now compile into two instructions instead of four. Change-Id: Ie2eb6b13ff1e29b3107cb9e76f37ff9065504316
2021-11-17faster vp8_regular_quantize_b_sse4_1Ilya Kurdyukov
Gives 10% faster VP8 encoding in simple tests. This patch requires testing on wider datasets and encoder settings to see if this speedup is achieved on most data. Change-Id: If8e04819623e78fff126c413db66c964c0b4c11a
2021-11-10Merge changes I1425f12d,I1e9e9ffa,I6d8f676b,I92013086 into mainJames Zern
* changes: mem_sse2.h: loadu_uint32 -> loadu_int32 mem_sse2.h: storeu_uint32 -> storeu_int32 vp8: fix some implicit signed -> unsigned conv warnings video_source.h,ReallocImage: quiet implicit conv warning
2021-11-08vp8: fix some implicit signed -> unsigned conv warningsJames Zern
and vice-versa mostly when dealing with bitmasks w/clang-11 -fsanitize=undefined Change-Id: I6d8f676bf87679ba1dad9cb7f55eea172103d9d3
2021-11-08vp8,calc_pframe_target_size: fix integer overflowJames Zern
this is similar to the fix for calc_iframe_target_size: 5f345a924 Avoid overflow in calc_iframe_target_size Bug: chromium:1264506 Change-Id: I2f0e161cf9da59ca0724692d581f1594c8098ebb
2021-11-08vp8_update_rate_correction_factors: fix integer overflowJames Zern
the intermediate value in the correction_factor calculation may exceed integer bounds Bug: b/189602769 Change-Id: I75726b12f3095663911d78333f3ea26eb6dee21e
2021-10-04Merge changes If2ef4400,I345970b7 into mainJerome Jiang
* changes: vpx_roi_map: add delta range info {vp8,vp9}_set_roi_map: fix validation with INT_MIN
2021-10-01{vp8,vp9}_set_roi_map: fix validation with INT_MINJames Zern
previously ranges were checked with abs() whose behavior is undefined with INT_MIN. this fixes a crash when the original value is returned and it later used as and offset into a table. Bug: webm:1742 Change-Id: I345970b75c46699587a4fbc4a059e59277f4c2c8
2021-10-01Merge "vp8: Condition decimation drop logic on drop_frames_allowed" into mainMarco Paniconi
2021-10-01vp8: Condition decimation drop logic on drop_frames_allowedMarco Paniconi
This allows user to make sure frame will be encoded when drop_frames is set off (on the fly), no matter the state of the buffer. Change-Id: Ia7b39b93fe3721dd586bdbede72c525db87b6890
2021-10-01vp8: For screen mode: clip buffer from belowMarco Paniconi
Condition already existed for screen content mode, but only when frame-dropper was off. Remove the frame drop condition. Change-Id: Ie7357041f5ca05b01e78b4bd3b40da060382591b
2021-09-23Merge "vp8 rc: support temporal layers" into mainJerome Jiang
2021-09-23vp8 rc: support temporal layersJerome Jiang
Change-Id: I2c7d5de0e17b072cb763f1659b1badce4fe0b82b
2021-09-21Cap duration to avoid overflowJerome Jiang
Bug: webm:1728 Change-Id: Id13475660fa921e8ddcc89847e978da4c8d85886
2021-09-10Add vp8 support to rc libJerome Jiang
For 1 layer CBR only. Support for temporal layers comes later. Rename the library to libvpxrc Bug: b/188853141 Change-Id: Ib7f977b64c05b1a0596870cb7f8e6768cb483850
2021-09-08vp8 rc: always update correction factorJerome Jiang
Change-Id: Id40b9cb5a85a15fb313a2a93f14f6768259f7c15
2021-07-26Fix some instances of -Wunused-but-set-variable.Peter Kasting
Bug: chromium:1203071 Change-Id: Ieb628f95d676ba3814b5caf8a02a884330928c77
2021-07-20Use round to be more accurate casting float to intJerome Jiang
Change-Id: Ifd5961917831752b176dd75d39d6b2cba6ce72fa
2021-07-01Avoid overflow in calc_iframe_target_sizeJorge E. Moreira
The changed product was observed to attempt to multiply 1800 by 2500000, which overflows unsigned 32 bits. Converting to unsigned 64 bits first and testing whether the final result fits in 32 bits solves the problem. BUG=b:179686142 Change-Id: I5d27317bf14b0311b739144c451d8e172db01945
2020-12-10Fix nullptr with offset.Jeremy Leconte
The error occurs with low resolution when LibvpxVp8Encoder::NumberOfThreads returns 1. Bug: b:175283098 Change-Id: Icc9387c75f4ac6e4f09f102b3143e83c998c5e38
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-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-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
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 postproc parametersJohann
BUG=webm:1612 Change-Id: I92937417403af2c943e903ba66799609ef6ab635
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-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-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