Commit Graph
100 Commits
Author SHA1 Message Date
Justin Ruggles 2e76f34387 flacenc: use RICE2 entropy coding mode for 24-bit 2012-11-05 15:32:30 -05:00
Justin Ruggles 13e1ee6c84 flacenc: add 24-bit encoding 2012-11-05 15:32:30 -05:00
Justin Ruggles 799e232490 flacdsp: move lpc encoding from FLAC encoder to FLACDSPContext
Also, templatize the functions for 16-bit and 32-bit sample range. This will
be used for 24-bit FLAC encoding.
2012-11-05 15:32:30 -05:00
Justin Ruggles 5ff998a233 flacenc: use uint64_t for bit counts
Needed to avoid integer overflows for 24-bit encoding.
2012-11-05 15:32:30 -05:00
Justin Ruggles e783316322 flacenc: remove wasted trailing 0 bits 2012-11-05 15:32:30 -05:00
Justin Ruggles dfde8a34e5 lavu: add av_ctz() for trailing zero bit count 2012-11-05 15:32:29 -05:00
Justin Ruggles 6a744d2619 flacenc: use a separate buffer for byte-swapping for MD5 checksum on big-endian
This is much faster than calculating the MD5 one sample at a time.
2012-11-05 15:32:29 -05:00
Justin Ruggles 5459848b14 ws-snd1: set channel layout 2012-11-01 11:30:04 -04:00
Justin Ruggles f7b8506573 wmavoice: set channel layout 2012-11-01 11:30:04 -04:00
Justin Ruggles 002097a00b wmapro: use AVCodecContext.channels instead of keeping a private copy 2012-11-01 11:29:19 -04:00
Justin Ruggles 2ed40608e9 wma: do not keep private copies of some AVCodecContext fields
channels, sample_rate, bit_rate, and block_align can be used directly from
the AVCodecContext
2012-11-01 11:29:19 -04:00
Justin Ruggles 50a65e7a54 vmdaudio: set channel layout 2012-11-01 11:29:19 -04:00
Justin Ruggles b5f628e227 twinvq: validate sample rate code
A large invalid value could cause undefined behavior when left-shifted
by 8 later in the function.
2012-11-01 11:29:19 -04:00
Justin Ruggles 335826cf5f twinvq: set channel layout 2012-11-01 11:29:19 -04:00
Justin Ruggles 8cc72ce5a0 twinvq: validate that channels is not <= 0
This could occur due to integer overflow when reading the channel count from
the extradata.
2012-11-01 11:29:19 -04:00
Justin Ruggles cebea00c8a truespeech: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles 523734eb6a sipr: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles 4c53f4aed3 shorten: validate that the channel count in the header is not <= 0 2012-11-01 11:29:18 -04:00
Justin Ruggles 4e13e50432 ra288dec: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles 6159f64364 ra144dec: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles eb38d8fe92 qdm2: remove unneeded checks for channel count 2012-11-01 11:29:18 -04:00
Justin Ruggles be2ab8b75a qdm2: make sure channels is not <= 0 and set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles e3d6ab5704 qcelpdec: set channel layout 2012-11-01 11:29:18 -04:00
Justin Ruggles d26701ce2f nellymoserdec: set channels to 1 2012-11-01 11:29:17 -04:00
Justin Ruggles d40dab907a libopencore-amr: set channel layout for amr-nb or if not set by the user 2012-11-01 11:29:17 -04:00
Justin Ruggles 30f8da29bf libilbc: set channel layout 2012-11-01 11:29:17 -04:00
Justin Ruggles 0fd1ddf155 dpcm: use AVCodecContext.channels instead of keeping a private copy 2012-11-01 11:29:17 -04:00
Justin Ruggles 1c7a016153 imc: set channels to 1 instead of validating it 2012-11-01 11:29:17 -04:00
Justin Ruggles 32c7769e5c gsmdec: always set channel layout and sample rate at initialization
Only mono 8kHz is supported.
2012-11-01 11:29:17 -04:00
Justin Ruggles c5b8acad73 libgsmdec: always set channel layout and sample rate at initialization
Only mono 8kHz is supported.
2012-11-01 11:29:16 -04:00
Justin Ruggles a346aaf148 g726dec: do not validate sample rate
For decoding it does not really matter what the sample rate is.
2012-11-01 11:29:16 -04:00
Justin Ruggles e00eb03cd8 g726dec: set channel layout at initialization instead of validating it 2012-11-01 11:29:16 -04:00
Justin Ruggles 99d8686357 flacdec: do not warn on sample rate change 2012-11-01 11:29:16 -04:00
Justin Ruggles 90fcac0e95 flacdec: allow mid-stream channel layout change
Although the libFLAC decoder cannot handle such a change, it is allowed by the
spec and could potentially occur with live streams.
2012-11-01 11:29:16 -04:00
Justin Ruggles 268f8ba112 flacdec: use av_samples_* functions for sample buffer allocation
Also, return an error on allocation failure.
2012-11-01 11:29:16 -04:00
Justin Ruggles 8ac0f6767b dcadec: allow the decoder to change the channel layout mid-stream 2012-11-01 11:29:16 -04:00
Justin Ruggles 93e27f86f1 cook: use av_dlog() for debug logging instead of av_log() with AV_LOG_ERROR 2012-11-01 11:29:15 -04:00
Justin Ruggles 8f173ef019 cook: move samples_per_frame from COOKSubpacket to where it is used 2012-11-01 11:29:15 -04:00
Justin Ruggles 7efbba2e36 cook: use av_get_channel_layout_nb_channels() instead of cook_count_channels() 2012-11-01 11:29:15 -04:00
Justin Ruggles d21b2e4726 cook: reverse a condition so that the code makes more sense 2012-11-01 11:29:15 -04:00
Justin Ruggles 926e9d28f1 cook: remove unneeded COOKContext variable, sample_rate 2012-11-01 11:29:15 -04:00
Justin Ruggles 8aa5b8c5c8 cook: remove unneeded COOKContext variable, bit_rate 2012-11-01 11:29:15 -04:00
Justin Ruggles 3509eee19c cook: use AVCodecContext.channels instead of keeping a private copy 2012-11-01 11:29:14 -04:00
Justin Ruggles a3145d0335 bmvaudio: set channel layout at init() rather than validating it 2012-11-01 11:29:14 -04:00
Justin Ruggles a38eadf7ed atrac1: do not keep a copy of channel count in the private context 2012-11-01 11:29:14 -04:00
Justin Ruggles 4f56f9c48f dsicinaudio: set channels and channel layout 2012-11-01 11:29:14 -04:00
Justin Ruggles ec2694d259 g722dec: set channel layout at initialization instead of validating it 2012-11-01 11:29:14 -04:00
Justin Ruggles ee0e9678e7 amrwbdec: set channels, channel_layout, and sample_rate
Only mono 16kHz is supported.
2012-11-01 11:29:14 -04:00
Justin Ruggles b24a4449a5 amrnbdec: set channels, channel_layout, and sample_rate
Only mono 8kHz is supported.
2012-11-01 11:29:14 -04:00
Justin Ruggles a4202003b2 dca_parser: allow the parser to change the sample rate 2012-11-01 11:29:13 -04:00
Justin Ruggles 0366664ef9 lavc: check channel count after decoder init
Ensures the decoder did not set channel count to an insanely high value
during initialization, which could cause large memory usage when it tries to
get a buffer during decoding.
2012-11-01 11:29:13 -04:00
Justin Ruggles bb6941af2a lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders 2012-11-01 11:29:13 -04:00
Justin RugglesandMartin Storsjö 39ef66f530 lpc: Add a function for calculating reflection coefficients from autocorrelation coefficients
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-29 21:53:13 +02:00
Justin Ruggles c68317ebbe lavc: fix documentation for AVCodecContext.delay 2012-10-23 14:35:27 -04:00
Justin Ruggles 44d854a518 atrac3: return an error if extradata_size is not a specific known size
Also fixes 3 compiler warnings about using uninitialized variables.
2012-10-23 14:35:27 -04:00
Justin Ruggles a5ef830b12 lavc: use the correct API version guard macro for avcodec_encode_audio() 2012-10-23 14:35:27 -04:00
Justin Ruggles a1f4cd371a atrac3: replace a calculation with FFALIGN()
This allocates 4 bytes less than the previous code if avctx->block_align is
a multiple of 4, but the extra 4 bytes is not really needed.
2012-10-22 10:10:08 -04:00
Justin Ruggles 808686fc1e atrac3: remove unused ATRAC3Context field, sample_rate 2012-10-22 10:10:08 -04:00
Justin Ruggles 89a6c32bc1 atrac3: use sizeof(variable) instead of sizeof(type) 2012-10-22 10:10:08 -04:00
Justin Ruggles 327747de15 atrac3: simplify MDCT window calculation 2012-10-22 10:10:08 -04:00
Justin Ruggles 5d1007f74d atrac3: initialize static tables in AVCodec.init_static_data() 2012-10-22 10:10:08 -04:00
Justin Ruggles 78edce3f19 atrac3: separate window initialization from IMDCT initialization 2012-10-22 10:10:08 -04:00
Justin Ruggles c51311b907 atrac3: move the 'frame_factor' field from ATRAC3Context to where it is used 2012-10-22 10:10:08 -04:00
Justin Ruggles 7e76f27081 atrac3: remove unused ATRAC3Context field, bit_rate 2012-10-22 10:10:07 -04:00
Justin Ruggles a2664c91fb atrac3: move the 'samples_per_frame' field from ATRAC3Context to where it is used 2012-10-22 10:10:07 -04:00
Justin Ruggles 7c1f93afe6 atrac3: remove unused ATRAC3Context field, samples_per_channel 2012-10-22 10:10:07 -04:00
Justin Ruggles cdd0e0de81 atrac3: use AVCodecContext.block_align instead of keeping a private copy 2012-10-22 10:10:07 -04:00
Justin Ruggles 64ebbb8f89 atrac3: move the 'delay' field from ATRAC3Context to where it is used 2012-10-22 10:10:07 -04:00
Justin Ruggles 56a9d2b44e atrac3: move the 'version' field from ATRAC3Context to where it is used 2012-10-22 10:10:06 -04:00
Justin Ruggles 5ac673b553 atrac3: use AVCodecContext.channels instead of keeping a private copy 2012-10-22 10:10:06 -04:00
Justin Ruggles aefdb735c3 atrac3: simplify some loop indexing 2012-10-22 10:10:06 -04:00
Justin Ruggles e55d53905f atrac3: cosmetics: pretty-printing and renaming
also does some minor refactoring.
2012-10-22 10:10:06 -04:00
Justin Ruggles 46a86c6194 alacdec: set bits_per_raw_sample 2012-10-21 23:54:51 -04:00
Justin Ruggles abd8b9e7e0 libmp3lame: resize the output buffer if needed
The LAME API documentation for the required buffer size refers to the size for
a single encode call. However, we store multiple frames in the same output
buffer but only read 1 frame at a time out of it. As a result, the buffer size
given in lame_encode_buffer() is actually smaller than what it should be.
Since we do not know how many frames it will end up buffering, it is best to
just reallocate if needed.
2012-10-17 09:59:13 -04:00
Justin Ruggles f9d732c264 wmapro: use planar sample format 2012-10-14 16:48:23 -04:00
Justin Ruggles 2725ce7c7c wmalossless: output in planar sample format 2012-10-14 16:48:23 -04:00
Justin Ruggles 7ebfe5b44a wmadec: use float planar sample format output 2012-10-14 16:48:23 -04:00
Justin Ruggles 977eb7d567 shorten: use planar sample format 2012-10-14 16:48:22 -04:00
Justin Ruggles 8441909f49 lavc: update documentation for AVFrame.extended_data 2012-10-14 15:00:45 -04:00
Justin RugglesandLuca Barbato 10e645e9cb lavr: handle clipping in the float to s32 conversion
We cannot clip to INT_MAX because that value cannot be exactly
represented by a float value and ends up overflowing during conversion
anyway. We need to use a slightly smaller float value, which ends up
with slightly inaccurate results for samples which clip or nearly clip,
but it is close enough. Using doubles as intermediates in the conversion
would be more accurate, but it takes about twice as much time.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-13 12:34:34 +02:00
Justin Ruggles 6304f78edf avplay: support mid-stream sample rate changes
Resample to the rate that was configured in SDL.
2012-10-13 00:19:00 -04:00
Justin Ruggles f5962229bf avplay: use audio parameters from the decoded frame instead of AVCodecContext 2012-10-13 00:18:48 -04:00
Justin Ruggles 61d5313d94 dca: allocate a secondary buffer for extra channels when downmixing
The output AVFrame buffer only has data for the downmix channels.
Fixes a segfault when decoding dca with request_channels == 2.
2012-10-13 00:07:10 -04:00
Justin Ruggles cbcd497f38 adxdec: use planar sample format 2012-10-09 09:03:52 -04:00
Justin Ruggles 4ebd74cec7 adpcmdec: use planar sample format for adpcm_thp 2012-10-09 09:03:52 -04:00
Justin Ruggles 327cdb04e3 adpcmdec: use planar sample format for adpcm_ea_xas 2012-10-09 09:03:52 -04:00
Justin Ruggles da9620e8e5 adpcmdec: use planar sample format for adpcm_ea_r1/r2/r3 2012-10-09 09:03:52 -04:00
Justin Ruggles d2b6ae02aa adpcmdec: use planar sample format for adpcm_xa 2012-10-09 09:03:52 -04:00
Justin Ruggles 8b854283c3 adpcmdec: use planar sample format for adpcm_ima_ws for vqa version 3 2012-10-09 09:03:52 -04:00
Justin Ruggles 4356d66d78 adpcmdec: use planar sample format for adpcm_4xm 2012-10-09 09:03:52 -04:00
Justin Ruggles 1b9ac72908 adpcmdec: use planar sample format for adpcm_ima_wav 2012-10-09 09:03:52 -04:00
Justin Ruggles 176db0b892 adpcmdec: use planar sample format for adpcm_ima_qt 2012-10-09 09:03:52 -04:00
Justin Ruggles 7e5f045039 pcmdec: use planar sample format for pcm_lxf 2012-10-09 09:03:51 -04:00
Justin Ruggles c1a9cfd1fe mace: use planar sample format 2012-10-09 09:03:51 -04:00
Justin Ruggles 23d53c5473 atrac1: use planar sample format 2012-10-09 09:03:51 -04:00
Justin Ruggles 7b556be673 af_resample: avoid conversion of identical sample formats for 1 channel
When there is only 1 channel, the planar and interleaved formats of the same
data type should be treated as identical.
2012-10-07 16:45:50 -04:00
Justin Ruggles 37f701f1c3 avcodec: allow either planar or interleaved sample format when encoding mono
When there is only 1 channel, the planar and interleaved formats of the same
data type should be treated as identical.
2012-10-07 16:45:50 -04:00
Justin Ruggles 5364327186 adpcmenc: ensure calls to adpcm_ima_compress_sample() are in the right order
Should fix fate-acodec-adpcm-ima_wav with several compilers.
2012-10-07 16:45:50 -04:00
Justin Ruggles 31b2262dca wmaenc: use float planar sample format 2012-10-06 13:23:13 -04:00
Justin Ruggles b1540fc884 (e)ac3enc: use planar sample format 2012-10-06 13:23:13 -04:00