summaryrefslogtreecommitdiff
path: root/src/opus_multistream_encoder.c
Commit message (Collapse)AuthorAgeFilesLines
* Check channels/stream counts and mapping when creating the multistreamFelicia Lim2021-09-271-4/+5
| | | | encoder
* Properly handle a bad stream_id in OPUS_MULTISTREAM_GET_*_STATE_REQUESTJean-Marc Valin2019-01-231-1/+1
| | | | Thanks to Dmitriy for reporting this.
* Apply equal bit allocation to ambisonic channelsMarcin Gorzel2018-08-311-51/+6
| | | | | | Fixes issue #95 on GitHub. Signed-off-by: Felicia Lim <flim@google.com>
* Fixing arithmetic problems for 16-bit CPUs in ambisonics_rate_allocation()Jean-Marc Valin2018-07-281-5/+5
|
* Fix bitrate allocation for channel mapping 2Felicia Lim2018-07-281-1/+3
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Remove ambisonics experimental flagJean-Marc Valin2018-07-261-16/+0
|
* Use ambisonics families 2 and 3 instead of 254 and 253Jean-Marc Valin2018-07-251-3/+3
|
* Only call isqrt32() with a positive argumentMark Harris2018-05-281-2/+4
| | | | Fixes test_opus_projection failure under ubsan, due to clz(0).
* Fix memory issues in Projection API.Andrew Allen2017-12-071-21/+17
| | | | | | Modified by Jean-Marc Valin Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Support for Channel Mapping 253Andrew Allen2017-11-071-29/+12
| | | | | | | | | OpusProjection* classes MixingMatrix class Projection tests Change-Id: I98644466abf4ffd36e48bdecad1204d69e1539b9 Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Replace call of celt_inner_prod_c() (step 1)Linfeng Zhang2017-06-061-1/+1
| | | | | | | | | | | | Should call celt_inner_prod(). This change is bit exact as original, except for x86 floating-point. In x86 floating-point, it calls celt_inner_prod_sse() which may have different output with the change of floating-point operations' orders. Change-Id: Ia2381e2e198a84296ac28305183f15be842b3454 Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Fixes a surround bug on loud signalJean-Marc Valin2017-05-231-1/+1
| | | | | The constant was copied from the analysis code which uses +/-1 as float scaling, but surround_analysis() uses +/-32767.
* oops, fix build broken by previous patchJean-Marc Valin2017-04-281-2/+0
|
* Non-diegetic support for Ambisonics Mapping 254.Drew Allen2017-04-281-23/+90
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Remove redundant codeMark Harris2016-11-051-20/+2
| | | | | | frame_size_select() ensures that frame_size is a valid size or -1, !st->variable_duration is always false, and delay_compensation is no longer needed to choose the frame size.
* Removes OPUS_FRAMESIZE_VARIABLEJean-Marc Valin2016-11-041-26/+1
| | | | That experiment never actually worked
* Fix amount of extra bytes reserved for 100 msFelicia Lim2016-10-311-2/+2
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Multistream encoder: allocate an extra byte per stream for 100 msFelicia Lim2016-10-281-0/+6
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Support encoding 80/100/120 ms frame lengthsFelicia Lim2016-10-271-5/+7
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Consider per-channel energy bits in surround_rate_allocation()Jean-Marc Valin2016-09-191-31/+40
| | | | | This should also avoid cases where stereo streams receive fewer bits than mono streams.
* Fixes surround_analysis() for frame size > 20 msJean-Marc Valin2016-09-161-11/+24
|
* Fix ambisonics bitrate when bitrate_bps is OPUS_AUTOMichael Graczyk2016-09-081-1/+2
| | | | | | Change-Id: I16bd4cd990d8ad5888c9e30016218ac25242ecb5 Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Prevents an overflow in multi-stream encoder rate computationJean-Marc Valin2016-09-061-3/+5
| | | | Also avoids stupidly high/low rates
* Allow disabling phase inversion for multistreamMark Harris2016-09-031-0/+2
| | | | Also clarify in doc that conformance issue relates to decoder only.
* Correct multistream variable frame size strideMark Harris2016-08-271-3/+1
| | | | | | | | The multistream encoder input has st->layout.nb_channels channels. The number of channels actually encoded is st->layout.nb_streams + st->layout.nb_coupled_streams, which may be fewer, so ideally it would only analyze those when computing the optimal frame size, but there is no code to do that currently.
* Forgot to call RESTORE_STACK in 328953e1896432bc700b9b5c69ae2987c5d752f4Jean-Marc Valin2016-07-041-0/+3
|
* Making calls to opus_packet_pad() on a bad packet return OPUS_INVALID_PACKETJean-Marc Valin2016-07-041-1/+6
| | | | | | | We were previously returning OPUS_BAD_ARG because the failure was only detected in opus_repacketizer_out_range_impl() rather than in opus_repacketizer_cat(). Checking the return value from opus_repacketizer_cat() also addresses the last outstanding Coverity defect.
* Fix build error from comma at end of enumMichael Graczyk2016-06-291-2/+3
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Add static bitrate allocation and force CELT-only for ambisonics encodingMichael Graczyk2016-06-291-10/+93
| | | | Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Add experimental support for ambisonic encodingMichael Graczyk2016-06-291-16/+55
| | | | | | | The implementation currently only codes each channel independently with no special allocation rules. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* armv7(float): Optimize encode usecase using NE10 libraryViswanath Puttagunta2015-10-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Optimize opus encode (float only) usecase using ARM NE10 library. Mainly effects opus_fft and ctl_mdct_forward and related functions. This optimization can be used for ARM CPUs that have NEON VFP unit. This patch only enables optimizations for ARMv7. Official ARM NE10 library page available at http://projectne10.github.io/Ne10/ To enable this optimization, use --enable-intrinsics --with-NE10=<install_prefix> or --enable-intrinsics --with-NE10-libraries=<NE10_lib_dir> --with-NE10-includes=<NE10_includes_dir> Compile time checks made during configure process to make sure optimization option available only when compiler supports NEON instrinsics. Runtime checks made to make sure optimized functions only called on appropriate hardware. Signed-off-by: Timothy B. Terriberry <tterribe@xiph.org>
* Extra safety against NaNs in surround_analysis()Mark Harris2015-10-071-1/+1
| | | | | | | Fix out-of-bounds memory read in multichannel surround analysis with float input that contains NaNs. Found by afl-fuzz. Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Preventing NaNs from crashing surround_analysis()Jean-Marc Valin2015-10-071-0/+14
|
* Silence clang -Wcast-align warningsMark Harris2015-08-071-2/+4
|
* multistream: improve arg checkMark Harris2014-11-271-3/+11
| | | | | | | | | Avoid undefined behavior (signed arithmetic overflow) or implementation-defined behavior (malloc(0)) on out-of-range arguments, e.g. opus_multistream_encoder_create(48000, 2, 2147483647, 1, ...) or opus_multistream_surround_encoder_create(48000, 3, 0, ...). Signed-off-by: Jean-Marc Valin <jmvalin@jmvalin.ca>
* Fixes commentsJean-Marc Valin2014-09-041-2/+2
|
* Takes into account a corner case with the multistream encoderJean-Marc Valin2014-09-041-1/+1
| | | | | | Considers the case where one stream would eat up all the remaining bytes, including a 2-byte size that would then not leave enough for the even a PLC packet in the next streams.
* Lowered the smallest packet that the multi-stream encoder can encodeJean-Marc Valin2014-09-041-15/+7
| | | | | Limit now at 2*streams-1 and anything below that returns OPUS_BUFFER_TOO_SMALL rather than OPUS_BAD_ARG
* multi-stream fix when setting bitrate to AUTO, MAX, or small valuesJean-Marc Valin2014-06-211-4/+30
| | | | | | OPUS_AUTO should now work fine, while using OPUS_BITRATE_MAX would still be a bad idea for controlling CBR rate for multistream. The encoder should now throw an error early on if max_data_bytes is just too small to do anything.
* Fix surround encodingMark Harris2014-01-261-1/+1
| | | | Broken by 306d7f5a308e30ce10ba1a1dcdbeeb81de3b2872
* Optimizes encoder NaN detection and clipping by only running them when neededJean-Marc Valin2013-12-091-6/+7
| | | | | NaN detection should now be able to catch values that would create NaNs further down.
* Surround low-passing thresholds set to much lower bitratesJean-Marc Valin2013-11-241-3/+3
|
* Adds OPUS_SET_PREDICTION_DISABLED() ctl to force "independent" framesJean-Marc Valin2013-11-151-0/+2
| | | | | | Works by turning off pitch and energy prediction in CELT, while setting first_frame_after_reset in SILK to disable pitch and LSF interpolation and reduce LPC gain.
* Adds packet padding that works for all codes and fixes 40/60 ms CBR.Jean-Marc Valin2013-11-131-8/+3
| | | | Padding is now handled by the repacketizer.
* Rename preemphasis() to celt_preemphasis() to avoid amrnb symbol clashJean-Marc Valin2013-11-131-1/+1
| | | | http://lists.xiph.org/pipermail/opus/2013-November/002372.html
* Fixes more warningsJean-Marc Valin2013-11-131-1/+1
|
* Increase surround allocation offset for smaller frame sizesJean-Marc Valin2013-11-131-1/+2
|
* Fixes MSVC conversion warningsJean-Marc Valin2013-11-131-1/+1
|
* Makes surround bandwidth decision based on the number of channels (duh!)Jean-Marc Valin2013-11-081-3/+3
|
* Fixes DISABLE_FLOAT_API buildJean-Marc Valin2013-10-281-1/+5
|