Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Paul B Mahol
93f4277714
WavPack encoder
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
ff0bdf9375
lavc: copy AVCodecContext for threads
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
b94f045b18
wavpack: add missing .\n to entropy error message
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
9684d7f1a2
wavpack: frame multi-threading support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
a44d39ae42
wavpack: remove redundant error log message
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Anton Khirnov
89806691b1
wavpack: check that all the channels were coded.
12 years ago
Anton Khirnov
eae1b8451a
wavpack: check that there aren't too many blocks per packet
12 years ago
Anton Khirnov
7d039e70a5
wavpack: extract channel information from the bitstream
...
This way we don't require the caller to parse the block header. It also
allows the channel configuration to change mid-stream.
12 years ago
Anton Khirnov
78f75b6fa4
wavpack: extract sample rate from the bitstream
...
This way we don't require the caller to parse the block header. It also
allows the sample rate to change mid-stream.
12 years ago
Michael Niedermayer
107e9e4432
wavpack: Properly check channel index, dont write out of arrays
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
9b6f47c448
matroskadec: export full wavpack blocks.
...
This allows us to get rid of demuxer-specific hacks in the decoder and
will allow streamcopy from matroska once we have a wavpack muxer.
12 years ago
Anton Khirnov
5074f4545c
wavpack demuxer: export full wavpack blocks.
...
Currently the demuxer shaves the blocks and exports only the
information that is useful to the decoder.
Exporting the blocks just as they are stored is simpler to understand
and will make remuxing wavpack easier.
12 years ago
Anton Khirnov
72dee5f40b
wavpack: don't set sample format in init.
...
We don't know whether it will be float until we look at the data.
12 years ago
Anton Khirnov
35596bd4f4
wavpack: remove a useless parameter from wavpack_decode_block().
...
The decoder always returns output if an error does not occur.
12 years ago
Anton Khirnov
d1bec4be22
wavpack: return an error on 0-sized blocks
...
Such blocks are not valid.
12 years ago
Anton Khirnov
1d177200ce
wavpack: remove a useless check.
...
Number of samples in the first block is checked to be strictly positive
earlier in wavpack_decode_frame() and number of samples in all the other
blocks is checked to be equal to the first one.
12 years ago
Anton Khirnov
0f3a0b24dd
wavpack: add an error message to a failure.
12 years ago
Anton Khirnov
474fb0c9d9
wavpack: return 0 instead of samples count from decoding functions
...
The caller never cares about the number of decoded samples, so this only
confuses the reader.
12 years ago
Anton Khirnov
528daa3990
wavpack: switch to planar output
...
This simplifies the code and makes it faster.
12 years ago
Anton Khirnov
a7ec3a9a4e
wavpack: drop redundant if/else blocks
12 years ago
Anton Khirnov
7b44c99180
wavpack: remove the subframes codec cap
...
The decoder always consumes full packets.
12 years ago
Michael Niedermayer
ac2c52174f
avcodec/wavpack: remove ;;
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Luca Barbato
fd06291239
wavpack: check packet size early
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Luca Barbato
3f0b6d7a62
wavpack: use bytestream2 in wavpack_decode_block
...
Prevent most out of buffer reads.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Luca Barbato
ed50673066
wavpack: validate samples size parsed in wavpack_decode_block
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Luca Barbato
8c34558131
wavpack: return meaningful errors
...
And forward those that were already meaningful.
12 years ago
Luca Barbato
0f689a3d97
wavpack: K&R formatting cosmetics
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years ago
Michael Niedermayer
c6831e2a70
wavpack: check K, fix assertion failure
...
Instead of this it would be possible to change the code to support
larger K but that would make the code slower and probably still need
checks on K.
This variant is choosen as there are no known valid files that need
larger K
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
1ec94b0f06
lavc: factorize ff_{thread_,re,}get_buffer error messages.
...
Coccinelle profile used:
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_get_buffer(ctx, f, flags)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str;
@@
-if ((r = ff_reget_buffer(ctx, f)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_reget_buffer(ctx, f)) < 0)
+ return r;
@@
expression r, ctx, f, loglevel, str, flags;
@@
-if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0) {
- av_log(ctx, loglevel, str);
- return r;
-}
+if ((r = ff_thread_get_buffer(ctx, f, flags)) < 0)
+ return r;
...along with some manual patches for the remaining ones.
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Justin Ruggles
9873d71f31
wavpack: decode directly to the user-provided AVFrame
12 years ago
Michael Niedermayer
8d06be6b8c
wavpack: check pointer to avoid overreading input buffer
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
594d4d5df3
lavc: add a wrapper for AVCodecContext.get_buffer().
...
It will be useful in the upcoming transition to refcounted AVFrames.
12 years ago
Michael Niedermayer
d8a1eb11b7
wavpack: check the blocks sample count, fix out of array accesses
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
580021cfc4
wavpack: check ch_offset
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
be818df547
wavpack: fix out of array access
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
a903f8f087
Include libavutil/channel_layout.h instead of libavutil/audioconvert.h
...
Also reorder some other #include when applicable.
12 years ago
Paul B Mahol
4744f67d4f
wavpack: check if number of samples is not too big
...
Wavpack format documentation mentions that 131072 is
max number of samples.
This fixes huge memory allocations in sample from ticket #1889 .
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
0fe8c9f458
wavpack: use more meaningful error codes
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Hendrik Leppkes
37c6ad2345
wavpack: set bits_per_raw_sample for S32 samples to properly identify 24-bit
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
13 years ago
Hendrik Leppkes
07d49437d5
wavpack: set bits_per_raw_sample for S32 samples to properly identify 24-bit
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Derek Buitenhuis
f604eab30a
wavpack: Fix an integer overflow
...
Integer Overflow Checker detected an integer
overflow while FATE was running.
See: http://fate.libav.org/x86_64-linux-ioc/
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
13 years ago
Derek Buitenhuis
83c418e68e
wavpack: Fix an integer overflow
...
Integer Overflow Checker detected an integer
overflow while FATE was running.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
32e74395a8
Revert "Improve decoding quality for lossy wavpack."
...
This has been implemented more correctly.
This reverts commit a915618a29
.
13 years ago
Derek Buitenhuis
480b133e6f
wavpack: Don't shift minclip/maxclip
...
Since we are clipping before we shift the values to
16 or 32 bits, we should not shift the min/max clip
values to compensate.
Fixes 8 and 24 bit lossy decoding.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Justin Ruggles
9d7cee50aa
wavpack: add needed braces for 2 statements inside an if block
13 years ago
Paul B Mahol
c388558d31
wavpack: allow user to disable CRC checking
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
13 years ago
Carl Eugen Hoyos
a915618a29
Improve decoding quality for lossy wavpack.
...
This reverts e6e7bfc1
and 365e1ec2
.
The code may be incorrect both before and after the revert, but we
do not have any samples that were fixed by the original commits.
Fixes ticket #871 .
13 years ago