summaryrefslogtreecommitdiff
path: root/tests/ref/lavf/rm
Commit message (Collapse)AuthorAge
* ac3enc_fixed: convert to 32-bit sample formatLynne2021-01-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The AC3 encoder used to be a separate library called "Aften", which got merged into libavcodec (literally, SVN commits and all). The merge preserved as much features from the library as possible. The code had two versions - a fixed point version and a floating point version. FFmpeg had floating point DSP code used by other codecs, the AC3 decoder including, so the floating-point DSP was simply replaced with FFmpeg's own functions. However, FFmpeg had no fixed-point audio code at that point. So the encoder brought along its own fixed-point DSP functions, including a fixed-point MDCT. The fixed-point MDCT itself is trivially just a float MDCT with a different type and each multiply being a fixed-point multiply. So over time, it got refactored, and the FFT used for all other codecs was templated. Due to design decisions at the time, the fixed-point version of the encoder operates at 16-bits of precision. Although convenient, this, even at the time, was inadequate and inefficient. The encoder is noisy, does not produce output comparable to the float encoder, and even rings at higher frequencies due to the badly approximated winow function. Enter MIPS (owned by Imagination Technologies at the time). They wanted quick fixed-point decoding on their FPUless cores. So they contributed patches to template the AC3 decoder so it had both a fixed-point and a floating-point version. They also did the same for the AAC decoder. They however, used 32-bit samples. Not 16-bits. And we did not have 32-bit fixed-point DSP functions, including an MDCT. But instead of templating our MDCT to output 3 versions (float, 32-bit fixed and 16-bit fixed), they simply copy-pasted their own MDCT into ours, and completely ifdeffed our own MDCT code out if a 32-bit fixed point MDCT was selected. This is also the status quo nowadays - 2 separate MDCTs, one which produces floating point and 16-bit fixed point versions, and one sort-of integrated which produces 32-bit MDCT. MIPS weren't all that interested in encoding, so they left the encoder as-is, and they didn't care much about the ifdeffery, mess or quality - it's not their problem. So the MDCT/FFT code has always been a thorn in anyone looking to clean up code's eye. Backstory over. Internally AC3 operates on 25-bit fixed-point coefficients. So for the floating point version, the encoder simply runs the float MDCT, and converts the resulting coefficients to 25-bit fixed-point, as AC3 is inherently a fixed-point codec. For the fixed-point version, the input is 16-bit samples, so to maximize precision the frame samples are analyzed and the highest set bit is detected via ac3_max_msb_abs_int16(), and the coefficients are then scaled up via ac3_lshift_int16(), so the input for the FFT is always at least 14 bits, computed in normalize_samples(). After FFT, the coefficients are scaled up to 25 bits. This patch simply changes the encoder to accept 32-bit samples, reusing the already well-optimized 32-bit MDCT code, allowing us to clean up and drop a large part of a very messy code of ours, as well as prepare for the future lavu/tx conversion. The coefficients are simply scaled down to 25 bits during windowing, skipping 2 separate scalings, as the hacks to extend precision are simply no longer necessary. There's no point in running the MDCT always at 32 bits when you're going to drop 6 bits off anyway, the headroom is plenty, and the MDCT rounds properly. This also makes the encoder even slightly more accurate over the float version, as there's no coefficient conversion step necessary. SIZE SAVINGS: ARM32: HARDCODED TABLES: BASE - 10709590 DROP DSP - 10702872 - diff: -6.56KiB DROP MDCT - 10667932 - diff: -34.12KiB - both: -40.68KiB DROP FFT - 10336652 - diff: -323.52KiB - all: -364.20KiB SOFTCODED TABLES: BASE - 9685096 DROP DSP - 9678378 - diff: -6.56KiB DROP MDCT - 9643466 - diff: -34.09KiB - both: -40.65KiB DROP FFT - 9573918 - diff: -67.92KiB - all: -108.57KiB ARM64: HARDCODED TABLES: BASE - 14641112 DROP DSP - 14633806 - diff: -7.13KiB DROP MDCT - 14604812 - diff: -28.31KiB - both: -35.45KiB DROP FFT - 14286826 - diff: -310.53KiB - all: -345.98KiB SOFTCODED TABLES: BASE - 13636238 DROP DSP - 13628932 - diff: -7.13KiB DROP MDCT - 13599866 - diff: -28.38KiB - both: -35.52KiB DROP FFT - 13542080 - diff: -56.43KiB - all: -91.95KiB x86: HARDCODED TABLES: BASE - 12367336 DROP DSP - 12354698 - diff: -12.34KiB DROP MDCT - 12331024 - diff: -23.12KiB - both: -35.46KiB DROP FFT - 12029788 - diff: -294.18KiB - all: -329.64KiB SOFTCODED TABLES: BASE - 11358094 DROP DSP - 11345456 - diff: -12.34KiB DROP MDCT - 11321742 - diff: -23.16KiB - both: -35.50KiB DROP FFT - 11276946 - diff: -43.75KiB - all: -79.25KiB PERFORMANCE (10min random s32le): ARM32 - before - 39.9x - 0m15.046s ARM32 - after - 28.2x - 0m21.525s Speed: -30% ARM64 - before - 36.1x - 0m16.637s ARM64 - after - 36.0x - 0m16.727s Speed: -0.5% x86 - before - 184x - 0m3.277s x86 - after - 190x - 0m3.187s Speed: +3%
* Merge commit '618d02c1fa9e74d490cace64a7d15762656b521c'James Almer2019-03-14
|\ | | | | | | | | | | | | * commit '618d02c1fa9e74d490cace64a7d15762656b521c': tests: Convert lavf container tests to non-legacy test scripts Merged-by: James Almer <jamrial@gmail.com>
| * tests: Convert lavf container tests to non-legacy test scriptsDiego Biurrun2019-02-16
| | | | | | | | Rename some tests in the process for consistency and simplicity.
| * avconv: make -t insert trim/atrim filters.Anton Khirnov2013-04-30
| | | | | | | | | | | | | | | | | | This makes -t sample-accurate for audio and will allow further simplication in the future. Most of the FATE changes are due to audio now being sample accurate. In some cases a video frame was incorrectly passed with the old code, while its was over the limit.
* | ffmpeg: remove obsolete workaround in trim insertion.Nicolas George2013-08-07
| | | | | | | | | | | | | | | | The bug it was working seems to have been fixed. This change causes ffmpeg to use the trim filter to implement the -t option. FATE tests are updated due to the more accurate handling of the last packets.
* | rmenc: write correct bytes per minutePiotr Bandurski2012-12-23
| | | | | | | | | | | | improves playback of ac3 in RealPlayer Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | mpegvideo_enc: reduce QMAT_SHIFT to avoid overflow in dnxhdMichael Niedermayer2012-09-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | ffmpeg: add support for audio filters.Anton Khirnov2012-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the FATE changes are due to off-by-one different rounding being used (lrintf vs av_rescale_q). Some fate changes are due to 1 audio frame less being encoded (the new variant seems matching what qatar does and according to ffprobe its closer to the requested duration) the mapchan feature sadly is lost in this commit because it depends on resampling being done in ffmpeg.c which is now moved completely into the av filter layer -async is broken after this commit, this will be fixed in subsequent commits the new filter reconfiguration system is flawed and will drop a frame on each parameter change which is why the nelly moser checksums need updating. Conflicts: ffmpeg.c tests/ref/fate/smjpeg
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-03-22
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: (26 commits) adxenc: use AVCodec.encode2() adxenc: Use the AVFrame in ADXContext for coded_frame indeo4: fix out-of-bounds function call. configure: Restructure help output. configure: Internal-only components should not be command-line selectable. vorbisenc: use AVCodec.encode2() libvorbis: use AVCodec.encode2() libopencore-amrnbenc: use AVCodec.encode2() ra144enc: use AVCodec.encode2() nellymoserenc: use AVCodec.encode2() roqaudioenc: use AVCodec.encode2() libspeex: use AVCodec.encode2() libvo_amrwbenc: use AVCodec.encode2() libvo_aacenc: use AVCodec.encode2() wmaenc: use AVCodec.encode2() mpegaudioenc: use AVCodec.encode2() libmp3lame: use AVCodec.encode2() libgsmenc: use AVCodec.encode2() libfaac: use AVCodec.encode2() g726enc: use AVCodec.encode2() ... Conflicts: configure libavcodec/Makefile libavcodec/ac3enc.c libavcodec/adxenc.c libavcodec/libgsm.c libavcodec/libvorbis.c libavcodec/vorbisenc.c libavcodec/wmaenc.c tests/ref/acodec/g722 tests/ref/lavf/asf tests/ref/lavf/ffm tests/ref/lavf/mkv tests/ref/lavf/mpg tests/ref/lavf/rm tests/ref/lavf/ts tests/ref/seek/lavf_asf tests/ref/seek/lavf_ffm tests/ref/seek/lavf_mkv tests/ref/seek/lavf_mpg tests/ref/seek/lavf_rm tests/ref/seek/lavf_ts Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * ac3enc: update to AVCodec.encode2()Justin Ruggles2012-03-20
| | | | | | | | Update FATE references due to encoder delay.
| * avconv: rework -t handling for encoding.Anton Khirnov2012-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | Current code compares the desired recording time with InputStream.pts, which has a very unclear meaning. Change the code to use actual timestamps of the frames passed to the encoder. In several tests, one less frame is encoded, which is more correct. In the idroq test one more frame is encoded, which is again more correct. Behavior with stream copy should be unchanged.
* | lavf-regression: minimal metadata test.Reimar Döffinger2011-12-12
|/ | | | | | This tests writing the global "title" metadata. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* ac3enc: correct the flipped sign in the ac3_fixed encoderJustin Ruggles2011-04-26
|
* ac3enc: select bandwidth based on bit rate, sample rate, and number ofJustin Ruggles2011-04-03
| | | | | | | full-bandwidth channels. This reduces high-frequency artifacts and improves the quality of the lower frequency audio at low bit rates.
* ac3enc: use generic fixed-point mdctMans Rullgard2011-04-03
| | | | | | | | This makes the AC3 encoder use the shared fixed-point MDCT rather than its own implementation. The checksum changes are due to different rounding in the MDCT. Signed-off-by: Mans Rullgard <mans@mansr.com>
* Add apply_window_int16() to DSPContext with x86-optimized versions and use itJustin Ruggles2011-03-22
| | | | in the ac3_fixed encoder.
* ac3enc: do not right-shift fixed-point coefficients in the final MDCT stage.Justin2011-03-14
| | | | | | | | | This increases the accuracy of coefficients, leading to improved quality. Rescaling of the coefficients to full 25-bit accuracy is done rather than offsetting the exponent values. This requires coefficient scaling to be done before determining the rematrixing strategy. Also, the rematrixing strategy calculation must use 64-bit math to prevent overflow due to the higher precision coefficients.
* ac3enc: change default floor code to 7.Justin Ruggles2011-02-15
| | | | | | | This is to match the value in every (E-)AC-3 file from commercial sources. It has a negligible effect on audio quality. Signed-off-by: Mans Rullgard <mans@mansr.com>
* ac3enc: Change EXP_DIFF_THRESHOLD to 500.Justin Ruggles2011-02-02
| | | | | | | | | This patch changes the exponent difference threshold in the exponent strategy decision function of the AC-3 encoder. I tested lowering in increments of 100. From 1000 down to 500 generally increased in quality with each step, but 400 was generally much worse. Signed-off-by: Mans Rullgard <mans@mansr.com>
* Change the default dB-per-bit code from 2 to 3.Justin Ruggles2010-12-29
| | | | | | | | | | | | This gives slightly better quality in PEAQ tests. Code 3 gives a dBpb value of 2816 = -132dB (128 psd units = -6dB), which corresponds to 22 bits. Since the exponents have an offset applied, the 16-bit source looks like 24-bit source to the bit allocation routine. So using dBpb code=3 is a closer match to the exponent range. Regression test refs updated for acodec-ac3, lavf-rm, and seek-ac3_rm. Originally committed as revision 26144 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change FIX15() back to clipping to -32767..32767.Justin Ruggles2010-12-21
| | | | | | | | This avoids a 16-bit overflow in mdct512() due to a -32768 value in costab. References updated for acodec-ac3, lavf-rm, and seek-ac3_rm tests. Thanks to Måns Rullgård for finding the bug. Originally committed as revision 26071 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Update the test references for lavf-rm and seek-ac3_rm.Justin Ruggles2010-12-14
| | | | | | The references changed due to r25956. Originally committed as revision 26004 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Place regression test output files in subdirs per familyMåns Rullgård2010-03-02
| | | | Originally committed as revision 22155 to svn://svn.ffmpeg.org/ffmpeg/trunk
* regtest: split reference files allowing tests to run individuallyMåns Rullgård2010-01-16
With this change, the output is checked immediately after each test has run. This means commands like "make regtest-mpeg2" can now be used to run a single test and get meaningful results. By default, make will abort if any test fails. To run all tests regardless, use make -k. Originally committed as revision 21254 to svn://svn.ffmpeg.org/ffmpeg/trunk