summaryrefslogtreecommitdiff
path: root/libavcodec/ac3enc.c
Commit message (Collapse)AuthorAge
* ac3enc: move extract_exponents inner loop to ac3dspMans Rullgard2011-04-04
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* 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>
* ac3enc: simplify sym_quant()Mans Rullgard2011-03-31
| | | | | | | These expressions are equivalent since levels is always odd, and overflow is impossible due to the constraints set by the assert(). Signed-off-by: Mans Rullgard <mans@mansr.com>
* ac3enc: move compute_mantissa_size() to ac3dspMans Rullgard2011-03-30
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* ac3enc: move mant*_cnt and qmant*_ptr out of AC3EncodeContextMans Rullgard2011-03-30
| | | | | | | These fields are only used in quantize_mantissas() and reset on each call, no need to store them in the main context. Signed-off-by: Mans Rullgard <mans@mansr.com>
* ac3: move ff_ac3_bit_alloc_calc_bap to ac3dspMans Rullgard2011-03-29
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* ac3enc: avoid memcpy() of exponents and baps in EXP_REUSE case by usingJustin Ruggles2011-03-28
| | | | exponent reference blocks.
* ac3enc: Add codec-specific options for writing AC-3 metadata.Justin Ruggles2011-03-27
|
* Get audio_service_type for AC-3 based on bitstream mode in the AC-3 parserJustin Ruggles2011-03-25
| | | | and decoder, and vice-versa for the AC-3 encoder.
* Add apply_window_int16() to DSPContext with x86-optimized versions and use itJustin Ruggles2011-03-22
| | | | in the ac3_fixed encoder.
* ac3enc: make sym_quant() branch-freeJustin Ruggles2011-03-22
|
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* ac3enc: add float_to_fixed24() with x86-optimized versions to AC3DSPContextJustin Ruggles2011-03-17
| | | | and use in scale_coefficients() for the floating-point AC-3 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: add some assertionsJustin Ruggles2011-03-07
|
* ac3enc: use av_assert2() instead of assert() to make debugging easier.Justin Ruggles2011-03-07
|
* ac3enc: add num_rematrixing_bands to AC3EncodeContext and use it instead of ↵Justin Ruggles2011-03-04
| | | | | | | | the hardcoded value. Currently it is always 4, but this change will allow it to be adjusted when bandwidth-related features are added such as channel coupling, enhanced channel coupling, and spectral extension.
* ac3enc: fix bug in stereo rematrixing decision.Justin Ruggles2011-02-16
| | | | | | | The rematrixing strategy reuse flags are not reset between frames, so they need to be initialized for all blocks, not just block 0. Signed-off-by: Mans Rullgard <mans@mansr.com>
* 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>
* Merge libavcore into libavutilReinhard Tartler2011-02-15
| | | | | | | | | | | | It is pretty hopeless that other considerable projects will adopt libavutil alone in other projects. Projects that need small footprint are better off with more specialized libraries such as gnulib or rather just copy the necessary parts that they need. With this in mind, nobody is helped by having libavutil and libavcore split. In order to ease maintenance inside and around FFmpeg and to reduce confusion where to put common code, avcore's functionality is merged (back) to avutil. Signed-off-by: Reinhard Tartler <siretart@tauware.de>
* Add x86-optimized versions of exponent_min().Justin Ruggles2011-02-10
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.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>
* Add ff_ prefix to ac3_common_init().Justin Ruggles2011-01-26
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* ac3enc: use dsputil functions in apply_window()Justin Ruggles2011-01-22
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* cosmetics: spacing, line wrap, and remove unneeded bracesJustin Ruggles2011-01-15
| | | | Originally committed as revision 26359 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Process all EXP_REUSE blocks at once in exponent_min().Justin Ruggles2011-01-15
| | | | | | 43% faster in function encode_exponents(). Originally committed as revision 26358 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Take advantage of per-channel exponent and exponent strategy layout toJustin Ruggles2011-01-15
| | | | | | | simplify and speed up encode_exponents(). 8% faster in function. Originally committed as revision 26357 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Simplify compute_exp_strategy() by passing a pointer to all exponents andJustin Ruggles2011-01-15
| | | | | | | exponent strategies for a single channel to compute_exp_strategy_ch(). This allows for removal of the temporary pointer arrays. Originally committed as revision 26356 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use a local variable in the inner loop of group_exponents() to simplify theJustin Ruggles2011-01-15
| | | | | | code. Originally committed as revision 26355 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: remove unneeded bracesJustin Ruggles2011-01-15
| | | | Originally committed as revision 26354 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: rename block_num to blk for variable name consistencyJustin Ruggles2011-01-15
| | | | Originally committed as revision 26353 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move exp_strategy from AC3Block to AC3EncodeContext in order to arrange byJustin Ruggles2011-01-15
| | | | | | channel first, then by block. Originally committed as revision 26352 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Rearrange exponent buffer to group all blocks for a single channel together.Justin Ruggles2011-01-15
| | | | | | This will allow for faster and simpler processing of all blocks at once. Originally committed as revision 26351 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add stereo rematrixing support to the AC-3 encoders.Justin Ruggles2011-01-08
| | | | | | | | This improves the audio quality significantly for stereo source with both the fixed-point and floating-point AC-3 encoders. Update acodec-ac3_fixed and seek-ac3_rm test references. Originally committed as revision 26271 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Convert floating-point MDCT coefficients to 24-bit fixed-point all at onceJustin Ruggles2011-01-05
| | | | | | | | instead of doing it separately in 2 different functions. This makes float AC-3 encoding approx. 3-7% faster overall. Also, the coefficient conversion can now be easily SIMD-optimized. Originally committed as revision 26232 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use local variables outside the inner loop in extract_exponents() to reduceJustin Ruggles2011-01-05
| | | | | | | accessing of structs and arrays inside the loop. Approx. 30% faster in function extract_exponents(). Originally committed as revision 26226 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: fix typo in previous commitJustin Ruggles2011-01-04
| | | | Originally committed as revision 26210 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change the AC-3 encoder to use floating-point.Justin Ruggles2011-01-04
| | | | | | | | Fixed-point AC-3 encoder renamed to ac3_fixed. Regression test acodec-ac3 renamed to acodec-ac3_fixed. Regression test lavf-rm changed to use ac3_fixed encoder. Originally committed as revision 26209 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move fixed-point parts of the AC-3 encoder to separate files.Justin Ruggles2011-01-03
| | | | Originally committed as revision 26206 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Skip the bit allocation search if previous and current SNR offsets are theJustin Ruggles2010-12-31
| | | | | | | | maximum value of 1023. This speeds up overall encoding depending on the content and bitrate. The most improvement is with high bitrates and/or low complexity content. Originally committed as revision 26181 to svn://svn.ffmpeg.org/ffmpeg/trunk
* 10l: Fix mistake in r26044. Check increment bounds using actual incrementJustin Ruggles2010-12-31
| | | | | | | instead of 64. This will change output in some cases, but it happens to not affect the AC-3 regression tests. Originally committed as revision 26180 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change planar_samples from int16_t to SampleType.Justin Ruggles2010-12-31
| | | | | | This one was missed in r26174. Originally committed as revision 26179 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add typedefs and a macro that will allow sharing of functions between theJustin Ruggles2010-12-30
| | | | | | fixed-point and floating-point AC-3 encoders. Originally committed as revision 26174 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Move the list of supported channel layouts to a separate table.Justin Ruggles2010-12-30
| | | | Originally committed as revision 26173 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Add a window field to AC3MDCTContext and use it as an input to apply_window()Justin Ruggles2010-12-30
| | | | | | instead of using the ff_ac3_window[] table directly. Originally committed as revision 26172 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: alignment, line wrap, and spacingJustin Ruggles2010-12-30
| | | | Originally committed as revision 26171 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove avctx from AC3MDCTContext and just pass it to mdct_init() instead.Justin Ruggles2010-12-30
| | | | Originally committed as revision 26170 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make exponent_group_tab[] static.Justin Ruggles2010-12-30
| | | | Originally committed as revision 26169 to svn://svn.ffmpeg.org/ffmpeg/trunk
* 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