summaryrefslogtreecommitdiff
path: root/libavcodec/opus_celt.c
Commit message (Collapse)AuthorAge
* avcodec/opus: Rename opus.c->opus_celt.c, opus_celt.c->opusdec_celt.cAndreas Rheinhardt2022-10-09
| | | | | | | | | | Since commit 4fc2531fff112836026aad2bdaf128c9d15a72e3 opus.c contains only the celt stuff shared between decoder and encoder. meanwhile, opus_celt.c is decoder-only. So the new names reflect the actual content better than the current ones. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/opus: Move defines to better placesAndreas Rheinhardt2022-10-05
| | | | | | | | | Move ROUND_MUL* macros to their only users and the Celt macros to opus_celt.h. Also improve the other headers a bit while at it. Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* opus: convert encoder and decoder to lavu/txLynne2022-09-26
| | | | | This commit changes both the encoder and decoder to use the new lavu/tx code, which has faster C transforms and more assembly optimizations.
* opusdsp: adjust and optimize C function to match assemblyLynne2019-09-11
| | | | | | | | | | | | | | | | | | | | | The C and asm versions behaved differently _outside_ of the codec. The C version returned pre-multiplied 'state' for the next execution to use right away, while the assembly version outputted non-multiplied 'state' for the next execution to multiply to save instructions. Since the initial state when initialized or seeking is always 0, and since C and asm versions were never mixed, there was no issue. However, comparing outputs directly in checkasm doesn't work without dividing the initial state by CELT_EMPH_COEFF and multiplying the returned state by CELT_EMPH_COEFF for the assembly function. Since its actually faster to do this in C as well, copy the behavior the asm versions use. As a reminder, the initial state 0 is divided by CELT_EMPH_COEFF on seek and init (just in case in the future this is changed, its technically more correct to init with CELT_EMPH_COEFF than 0, however when seeking this will result in more audiable pops, unlike with 0 where the output gets in sync over a few samples).
* opusdsp: create and move deemphasis and postfiltering from opus_celtLynne2019-04-01
|
* opus: merge encoder and decoder bitallocation functions into oneRostislav Pehlivanov2017-12-30
| | | | | | There's no difference apart from which entropy coding functions get called. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_celt: deduplicate band quantization/dequantization functionRostislav Pehlivanov2017-12-04
| | | | | | No point in having the same code twice to do exactly the same thing. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus: add an option to toggle intensity stereo phase inversionRostislav Pehlivanov2017-12-04
| | | | | | | | | Due to a somewhat high volume of complains, phase inversion has been made optional with RFC8251. This allows for better bass frequency response when partially downmixing to play on systems with an LFE speaker. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus: Add Special Hybrid Folding (per RFC8251)Andrew D'Addesio2017-12-04
| | | | | | | | | | | This decoder-side change, introduced in RFC 8251 (section 9), slightly improves the decoded quality of 16kbps speech in Hybrid Mode. Differences can be seen/heard in testvector05.bit, testvector06.bit, and testvector12.bit in the RFC 6716/8251 testvectors found here: https://people.xiph.org/~greg/opus_testvectors/ Signed-off-by: Andrew D'Addesio <modchipv12@gmail.com>
* opus_celt: Fix arithmetic overflow (per RFC8251)Andrew D'Addesio2017-12-04
| | | | | | | | As per Sec.8 of RFC8251: Cap on Band Energy NaN due to large log-energy value. Affects celt_denormalize(). Signed-off-by: Andrew D'Addesio <modchipv12@gmail.com>
* opus: simplify coarse energy beta coefficientsRostislav Pehlivanov2017-07-18
| | | | | | Just put the subtraction in the table. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_celt: normalize using mdct scaleRostislav Pehlivanov2017-07-11
| | | | | | Removes a per-sample divide in the IIR filter deemphasis filter. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* mdct15: remove redundant scale argument to imdct_halfRostislav Pehlivanov2017-07-11
| | | | | | | The only use of that argument was for Opus downmixing which is very rare and better done after the mdcts. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_celt: move postfilter taps table to the shared opustab.c fileRostislav Pehlivanov2017-07-10
| | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_celt: do not use double precision exp2Rostislav Pehlivanov2017-06-22
| | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_pvq: port to allow for SIMD functionsRostislav Pehlivanov2017-05-16
| | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_celt: fix some style issuesRostislav Pehlivanov2017-04-08
| | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_celt: rename structures to better names and reorganize themRostislav Pehlivanov2017-02-14
| | | | | | | | | | | | | | | | | | | | This is meant to be applied on top of my previous patch which split PVQ into celt_pvq.c and made opus_celt.h Essentially nothing has been changed other than renaming CeltFrame to CeltBlock (CeltFrame had absolutely nothing at all to do with a frame) and CeltContext to CeltFrame. 3 variables have been put in CeltFrame as they make more sense there rather than being passed around as arguments. The coefficients have been moved to the CeltBlock structure (why the hell were they in CeltContext and not in CeltFrame??). Now the encoder would be able to use the exact context the decoder uses (plus a couple of extra fields in there). FATE passes, no slowdowns, etc. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_celt: move quantization and band decoding to opus_pvq.cRostislav Pehlivanov2017-02-14
| | | | | | | | | | | | | | A huge amount can be reused by the encoder, as the only thing which needs to be done would be to add a 10 line celt_icwrsi, a wrapper around it (celt_alg_quant) and templating the ff_celt_decode_band to replace entropy decoding functions with entropy encoding. There is no performance loss but in fact a performance gain of around 6% which is caused by the compiler being able to optimize the decoding more efficiently. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* imdct15: rename to mdct15 and add a forward transformRostislav Pehlivanov2017-02-14
| | | | | | | Handles strides (needed for Opus transients), does pre-reindexing and folding without needing a copy. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus_rc: rename total_bits_used to total_bits and #define some constantsRostislav Pehlivanov2017-02-04
| | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus: move the entropy decoding functions to opus_rc.cRostislav Pehlivanov2016-11-08
| | | | | | | The intention is to have both encoding and decoding functions in opus_rc.c. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* opus: move all tables to a separate fileRostislav Pehlivanov2016-11-08
| | | | Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
* lavc/opus_celt: replace pow(2,x) by exp2f(x)Ganesh Ajjanagadde2016-01-22
| | | | | | | Faster methods possible; since exponent is always a multiple of 1/8. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* lavc/opus_celt: replace pow by exp2Ganesh Ajjanagadde2015-12-17
| | | | | | | | | | exp2 is faster. It may be possible to optimize further; e.g the exponents seem to be multiples of 0.25. This requires study though. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-27
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-27
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec: use av_mod_uintp2() where usefulJames Almer2015-04-21
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '9abc80f1ed673141326341e26a05c3e1f78576d0'Michael Niedermayer2015-02-21
|\| | | | | | | | | | | | | | | | | | | * commit '9abc80f1ed673141326341e26a05c3e1f78576d0': libavcodec: Make use of av_clip functions Conflicts: libavcodec/takdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * libavcodec: Make use of av_clip functionsPeter Meerwald2015-02-21
| | | | | | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '3d5d46233cd81f78138a6d7418d480af04d3f6c8'Michael Niedermayer2015-02-02
|\| | | | | | | | | | | | | | | | | | | | | * commit '3d5d46233cd81f78138a6d7418d480af04d3f6c8': opus: Factor out imdct15 into a standalone component Conflicts: configure libavcodec/opus_celt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * opus: Factor out imdct15 into a standalone componentDiego Biurrun2015-02-02
| | | | | | | | It will be reused by the AAC decoder.
* | avcodec/opus_celt: Use avpriv_float_dsp_alloc()Michael Niedermayer2014-12-01
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-15
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/opus_celt: Fix () in CELT_PVQ_V macroMichael Niedermayer2014-05-25
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Use av_restrict instead of restrict in libavcodec/opus_celt.c.Carl Eugen Hoyos2014-05-16
| |
* | Merge commit 'd3f5b94762fb803c0f3b29f9ad6c5eaa813998ba'Michael Niedermayer2014-05-15
|\| | | | | | | | | | | | | * commit 'd3f5b94762fb803c0f3b29f9ad6c5eaa813998ba': aarch64: opus NEON iMDCT and FFT Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * aarch64: opus NEON iMDCT and FFTJanne Grunau2014-05-15
| | | | | | | | | | Opus celt decoding 11% faster and the iMDCT over 2.5 times faster on Apple's A7.
* | Merge commit 'b70d7a4ac72d23f3448f3b08b770fdf5f57de222'Michael Niedermayer2014-05-15
|/ | | | | | | | | | | | | | | | | * commit 'b70d7a4ac72d23f3448f3b08b770fdf5f57de222': lavc: add a native Opus decoder. Conflicts: Changelog configure libavcodec/version.h Fate tests pass with both avresample as well as swresample based opus decoder, but are disabled (reference files are very large so i want to think a day or 2 about if theres an alternative or if they could be avoided, they also dont match the official samples) Merged-by: Michael Niedermayer <michaelni@gmx.at>
* lavc: add a native Opus decoder.Anton Khirnov2014-05-15
Initial implementation by Andrew D'Addesio <modchipv12@gmail.com> during GSoC 2012. Completion by Anton Khirnov <anton@khirnov.net>, sponsored by the Mozilla Corporation. Further contributions by: Christophe Gisquet <christophe.gisquet@gmail.com> Janne Grunau <janne-libav@jannau.net> Luca Barbato <lu_zero@gentoo.org>