Commit Graph

152 Commits

Author SHA1 Message Date
Justin Ruggles 4cd22b7738 alac: fix channel pointer assignment for 24 and 32-bit
Needs to be done separately for each element.
2012-07-19 20:14:29 -04:00
Justin Ruggles eeb55f5f2f alac: cosmetics: general pretty-printing and comment clean up 2012-07-19 13:26:48 -04:00
Justin Ruggles f3e5a7844b alac: calculate buffer size outside the loop in allocate_buffers() 2012-07-19 13:26:48 -04:00
Justin Ruggles bae83f2c74 alac: change some data types to plain int 2012-07-19 13:26:48 -04:00
Justin Ruggles 2aebac6918 alac: cosmetics: rename some variables and function names 2012-07-19 13:26:48 -04:00
Andrew D'Addesio 1b3ef155d7 alac: multi-channel decoding support
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-07-19 13:26:48 -04:00
Justin Ruggles 81c9e2e6d0 alac: split element parsing into a separate function
This will make multi-channel implementation simpler.
Based partially on a patch by Andrew D'Addesio <modchipv12@gmail.com>.
2012-07-19 13:26:48 -04:00
Justin Ruggles cd632619d9 alac: support a read sample size of up to 32
Use get_bits_long() in decode_scalar().
Use unsigned int for decoded value.
2012-07-19 13:26:48 -04:00
Justin Ruggles 73dc0db486 alac: output in planar sample format
Avoids unneeded interleaving and allows for reusing the AVFrame output buffer
as the internal buffer for 24-bit and 32-bit sample size.
2012-07-19 13:26:48 -04:00
Justin Ruggles 6482bd8831 alac: add 32-bit decoding support 2012-07-19 13:26:48 -04:00
Andrew D'Addesio 6cda74c155 alac: simplify channel interleaving
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-07-19 13:26:48 -04:00
Justin Ruggles 5138ff143f alac: use AVPacket fields directly in alac_decode_frame() 2012-07-19 13:26:47 -04:00
Justin Ruggles 7a206eb32f alac: fix check for valid max_samples_per_frame 2012-07-19 13:26:47 -04:00
Justin Ruggles 1193d3fedd alac: use get_sbits() to read LPC coefficients instead of casting 2012-07-19 13:26:47 -04:00
Justin Ruggles 7a50ec6799 alac: move the current samples per frame to the ALACContext
This will simplify the multi-channel implementation.
2012-07-19 13:26:47 -04:00
Justin Ruggles 46043962ea alac: avoid using a double-negative when checking if the frame is compressed 2012-07-19 13:26:47 -04:00
Justin Ruggles 9a6c528e08 alac: factor out output_size check in predictor_decompress_fir_adapt() 2012-07-19 13:26:47 -04:00
Justin Ruggles ebd4c3add1 alac: factor out loading of next decoded sample in LPC prediction 2012-07-19 13:26:47 -04:00
Justin Ruggles a4ecd41442 alac: use index into buffer_out instead of incrementing the pointer 2012-07-19 13:26:47 -04:00
Justin Ruggles f2515cd629 alac: simplify lpc coefficient adaptation 2012-07-19 13:26:47 -04:00
Justin Ruggles abc4376b31 alac: reduce the number of local variables needed in lpc prediction 2012-07-19 13:26:47 -04:00
Justin Ruggles 01880d287b alac: simplify 1st order prediction and reading of warm-up samples 2012-07-19 13:26:46 -04:00
Justin Ruggles d0c0bf0d3e alac: cosmetics: reindent after last commit 2012-07-19 13:26:46 -04:00
Justin Ruggles 79def4c523 alac: remove unneeded conditionals in predictor_decompress_fir_adapt() 2012-07-19 13:26:46 -04:00
Justin Ruggles 4bcd637dcb alac: use sizeof() instead of hardcoded data sizes 2012-07-19 13:26:46 -04:00
Justin Ruggles 91620a04f1 alac: make block_size signed
It does not need to be unsigned.
2012-07-19 13:26:46 -04:00
Justin Ruggles 2fc24b3273 alac: remove a duplicate local variable 2012-07-19 13:26:46 -04:00
Justin Ruggles 5177413d20 alac: conditionally set sign_modifier to 1
It is already unconditionally set to 0 prior to this, so we can modify it
only when needed.
2012-07-19 13:26:46 -04:00
Justin Ruggles 7e6593e977 alac: eliminate 2 unneeded local variables in bastardized_rice_decompress()
x_modified is just unnecessary, and final_val can be removed by simplifying
the unsigned-to-signed conversion.
2012-07-19 13:26:46 -04:00
Justin Ruggles 6fd8a28b59 alac: adjust conditions for updating entropy decoder history
avoids some unnecessary arithmetic in certain situations
2012-07-19 13:26:46 -04:00
Justin Ruggles a06fdadd97 alac: cosmetics: reindent after last commit 2012-07-19 13:26:46 -04:00
Justin Ruggles d9837434a9 alac: limit the rice param before passing to decode_scalar()
reduces the number of parameters to decode_scalar() and slightly simplifies
the code
2012-07-19 13:26:45 -04:00
Justin Ruggles 6e91f62256 alac: reduce the number of parameters to bastardized_rice_decompress()
Use the ALACContext fields directly instead.
2012-07-19 13:26:45 -04:00
Justin Ruggles 836e8b9ba0 alac: cosmetics: rename some ALACContext parameters 2012-07-19 13:26:45 -04:00
Justin Ruggles 2ac1737583 alac: clean up and update comments leftover from reverse-engineering 2012-07-19 13:26:45 -04:00
Martin Storsjö 00c3b67b8a cosmetics: Align codec declarations
Also break some long lines, remove codec function placeholder comments
and add spaces in sample/pixel format lists.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-06 22:37:38 +03:00
Ronald S. Bultje c3bbd0b53b alac: convert extradata reading to bytestream2. 2012-03-25 13:35:05 -07:00
Justin Ruggles e49d21306a alacdec: implement the 2-pass prediction type.
The reference encoder does not generate any streams using this, but the
reference decoder can handle it, so we should as well.
2012-01-03 13:15:24 -05:00
Justin Ruggles e76c7b856f alacdec: fill in missing or guessed info about the extradata format.
Now that there is official documentation from Apple about this, we don't have
to guess anymore.
2012-01-03 13:15:23 -05:00
Justin Ruggles 0eea212943 Add avcodec_decode_audio4().
Deprecate avcodec_decode_audio3().
Implement audio support in avcodec_default_get_buffer().
Implement the new audio decoder API in all audio decoders.
2011-12-02 17:40:40 -05:00
Justin Ruggles 30f3e7b524 alacdec: remove unneeded NULL or zero-size packet checks.
This is already done in avcodec_decode_audio3()
2011-10-26 11:50:17 -04:00
Justin Ruggles 68f7e9cd8e alacdec: simplify buffer allocation by using FF_ALLOC_OR_GOTO() 2011-10-26 11:50:17 -04:00
Justin Ruggles b316af7a7c alacdec: ask for a sample for unsupported sample depths.
Also return AVERROR_PATCHWELCOME.
2011-10-26 11:50:17 -04:00
Justin Ruggles 63cf54df7a alacdec: cosmetics: use 'ch' instead of 'chan' to iterate channels 2011-10-26 11:50:17 -04:00
Justin Ruggles 01200f1283 alacdec: move some declarations to the top of the function 2011-10-26 11:50:17 -04:00
Justin Ruggles c3a92412c0 alacdec: always use get_sbits_long() for uncompressed samples 2011-10-26 11:50:17 -04:00
Justin Ruggles b46e58f741 alacdec: remove unneeded local variable 2011-10-26 11:50:17 -04:00
Justin Ruggles 7080533cda alacdec: remove the numchannels parameter from several functions.
They only operate on stereo content, so the extra param is not necessary and
also allows for simplifying the code.
2011-10-26 11:50:17 -04:00
Justin Ruggles cb50329fc5 alacdec: rename 2 functions.
Now they only do stereo interleaving.
2011-10-26 11:50:16 -04:00
Justin Ruggles c39bddd392 alacdec: move appending of extra_bits to a separate function.
This should also fix decoding of mono 24-bit.
2011-10-26 11:50:16 -04:00