1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

20 Commits

Author SHA1 Message Date
Rostislav Pehlivanov
8e7b13b971 opusenc: use for loops with declarations
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2018-05-18 02:38:08 +01:00
Rostislav Pehlivanov
51027d0b8b opus: merge encoder and decoder bitallocation functions into one
There's no difference apart from which entropy coding functions get called.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-12-30 17:05:23 +00:00
Rostislav Pehlivanov
ce87e630fa opus_celt: deduplicate band quantization/dequantization function
No point in having the same code twice to do exactly the same thing.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-12-04 10:51:19 +00:00
Rostislav Pehlivanov
2ad1768c7b opusenc: implement a psychoacoustic system
This commit implements a psychoacoustic system for the native Opus
encoder. Its unlike any other psychoacoustic system known since its
capable of using a lookahead to make better choices on how to treat the
current frame and how many bits to allocate for it (and future frames).

Also, whilst the main bulk of the analysis function has to run in a
single thread, the per-frame anaylsis functions does not modify the main
psychoacoustic context, so in the future it will be fairly trivial to
run those as slice threads.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-09-23 08:27:44 +01:00
Rostislav Pehlivanov
79450adfc8 opus: simplify coarse energy beta coefficients
Just put the subtraction in the table.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-18 20:52:06 +01:00
Rostislav Pehlivanov
04a8e03ef0 opusenc: remove unused variable
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-18 04:12:59 +01:00
Rostislav Pehlivanov
91b27b8393 opusenc: use float_dsp for non-transient windowing
Also fixes transient windowing

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-14 04:54:32 +01:00
Rostislav Pehlivanov
035c755b4e opusenc: use float_dsp for transient mdcts
vector_fmul_reverse requires padding the window at the front

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-13 19:53:52 +01:00
Rostislav Pehlivanov
8041b2420f opusenc: don't set avctx->cutoff
Its only use is to adjust the aac psychoacoustic/filter system which
isn't used here.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-07-10 23:49:44 +01:00
Rostislav Pehlivanov
8e7e74df93 opus_pvq: port to allow for SIMD functions
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-05-16 11:22:07 +01:00
Rostislav Pehlivanov
e6ec482b42 opusenc: initialize PVQ prng seed
Fixes valgrind warnings, didn't affect anything since it was only used
for resynthesis.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-05-16 11:22:07 +01:00
Rostislav Pehlivanov
d0a3143193 opusenc: switch between intra/inter mode for coarse energy
Saves around 5kbps.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-08 00:54:56 +01:00
Rostislav Pehlivanov
c39fba703b opusenc: do not signal digital silence
Apparently its only use is to enable comfort noise/error recovery.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-08 00:48:28 +01:00
Rostislav Pehlivanov
42ffc67208 opusenc: minor style changes
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-08 00:40:33 +01:00
Rostislav Pehlivanov
63744d8afd opusenc: remove unused header entries and simplify normalization
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-04-08 00:27:33 +01:00
Kyle Swanson
b12693facf libavcodec/opusenc: use correct format specifiers
Squelches the following compiler warnings:

libavcodec/opusenc.c:1051:16: warning: format specifies type 'long' but
the argument has type 'long long' [-Wformat]
               avctx->bit_rate/1000, clipped_rate/1000);
               ^~~~~~~~~~~~~~~~~~~~
libavcodec/opusenc.c:1051:38: warning: format specifies type 'long' but
the argument has type 'long long' [-Wformat]
               avctx->bit_rate/1000, clipped_rate/1000);
                                     ^~~~~~~~~~~~~~~~~
2017-03-27 09:35:48 +02:00
Rostislav Pehlivanov
b71f62a9c8 opusenc: initialize the emphasis coefficients on init
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-02-18 01:13:13 +00:00
Michael Niedermayer
1fa8884aeb avcodec/opusenc: Add () protecting macro arguments
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-16 13:24:11 +01:00
Rostislav Pehlivanov
3fc86f0d69 opusenc: fix coarse energy quantization with 2 bits left
Fixes CID1400584

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-02-15 22:51:37 +00:00
Rostislav Pehlivanov
5f47c85e5c opus: add a native Opus encoder
This marks the first time anyone has written an Opus encoder without
using any libopus code. The aim of the encoder is to prove how far
the format can go by writing the craziest encoder for it.

Right now the encoder's basic, it only supports CBR encoding, however
internally every single feature the CELT layer has is implemented
(except the pitch pre-filter which needs to work well with the rest of
whatever gets implemented). Psychoacoustic and rate control systems are
under development.

The encoder takes in frames of 120 samples and depending on the value of
opus_delay the plan is to use the extra buffered frames as lookahead.
Right now the encoder will pick the nearest largest legal frame size and
won't use the lookahead, but that'll change once there's a
psychoacoustic system.

Even though its a pretty basic encoder its already outperforming
any other native encoder FFmpeg has by a huge amount.

The PVQ search algorithm is faster and more accurate than libopus's
algorithm so the encoder's performance is close to that of libopus
at zero complexity (libopus has more SIMD).
The algorithm might be ported to libopus or other codecs using PVQ in
the future.

The encoder still has a few minor bugs, like desyncs at ultra low
bitrates (below 9kbps with 20ms frames).

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
2017-02-14 06:15:36 +00:00