Michael Niedermayer
bacc4b6e81
avcodec/wmalosslessdec: Use unsigned operations for overflowing cases
...
Fixes undefined behavior in fate-lossless-wma24-2
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Christophe Gisquet
7d453aaf65
wmalossless: allow calling madd_int16
...
This is done by actually handling the "prev_values" in the cascaded LMS data
as if it were int16_t, thus requiring switching at various locations the
computations.
9 years ago
Michael Niedermayer
3187277ebb
avcodec/wmalosslessdec: Fix memset sizeof
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Christophe Gisquet
532e937083
avcodec/wmalosslessdec: silence a sample request
...
16bits samples with CDLMS orders of 8 are currently unsupported, but have never
been encountered before.
However, 8 seems to be the most frequent, if not the only order used for 24bits.
In that case, the dsp functions are fine with handling order that are multiples
of 8, so silence the warning.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
8f4358888f
avcodec/wmalosslessdec: fix type for coeffs and lms_updates in cdlms struct
...
They should really be int16_t.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
a67816bcce
avcodec/wmalosslessdec: fix decoding of raw pcm tiles
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
56759f69a6
avcodec/wmalosslessdec: improve 24bit support
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Paul B Mahol
5ac71e9db8
avcodec/wmalosslessdec: improve >2 channel support
...
Before it worked for stereo files only.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Jakub Stachowski
60b75186b2
avcodec/wmalosslessdec: do not discard last frame
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 years ago
Andreas Cadhalpun
fa66237b69
lavc: Use get_bitsz where needed
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
9 years ago
Andreas Cadhalpun
43ff4aed26
lavc: use get_bitsz to simplify the code
...
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
9 years ago
Vittorio Giovara
65b96aba28
wmalossless: Warn when decoding 24 bit depth
...
See ticket #4134
9 years ago
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Andreas Cadhalpun
42e7a5b3c7
wmalosslessdec: reset frame->nb_samples on packet loss
...
Otherwise a frame with non-zero nb_samples but without any data can be
returned.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
10 years ago
Andreas Cadhalpun
f9020d514e
wmalosslessdec: avoid reading 0 bits with get_bits
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
10 years ago
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Michael Niedermayer
f144e4ddff
avcodec/wmalosslessdec: use sizeof() instead of a literal number
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
dfc2a3982f
avcodec/wmalosslessdec: Add () to protect the arguments of WMASIGN()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
7f9f771eac
avcodec: Don't anonymously typedef structs
10 years ago
zhaoxiu.zeng
9e6198f0a4
avcodec/wmalosslessdec: simplify
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
zhaoxiu.zeng
80f1378005
avcodec/wmalosslessdec: optimize sign operation
...
Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
zhaoxiu.zeng
bc0a440e88
avcodec/wmalosslessdec: change type of acfilter_coeffs from int64_t to int16_t
...
Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
46e2afa4dc
wmalossless: reset lms_update
...
It may contain garbage at the end, and zeroing allows using DSP
with longer loops.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ce6141259b
avcodec/wmalosslessdec: support 24bit lossless
...
Not checked if its actually lossless
Fixes Ticket1847
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
849b9d34c7
wmalosslessdec: fix mclms_coeffs* array size
...
Fixes corruption of context
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Bug-Id: CVE-2014-2098
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Michael Niedermayer
49bf712a89
libavcodec/wmalosslessdec: add missing emms
...
prevent failure with mmx2
should fix fate failure on freebsd mmx2 client
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Christophe Gisquet
adf4ee40e7
wma lossless: reuse scalarproduct_and_madd_int16
...
This is done by padding the coefficient buffer with 0s, because the order
may be only a multiple of 4, and the DSP function requires batches of 8.
However, no sample with such a case was found, so request one if it uses
that kind of order.
Approximate relative speedup depending on instruction set:
plain C: -6%
mmxext: 51%
sse2: 54%
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
cc8163e1a3
avcodec: more correct printf specifiers
11 years ago
Michael Niedermayer
ec9578d54d
avcodec/wmalosslessdec: fix mclms_coeffs* array size
...
Fixes corruption of context
Fixes: 8835659dde6a4f7dcdf341de6a45c6c8-signal_sigsegv_1dce67b_4564_cov_2504444599_classical_22_16_1_14000_v3c_0_extend_0_29.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
2a03eb4c99
avcodec/wmalosslessdec: use sizeof() instead of literal number
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6b18a6839b
avcodec/wmalosslessdec: shrink output on error so no uninitialized data is returned
...
Fixes use of uninitialized memory
partly fixes: msan_uninit-mem_7f7834b6a530_6473_luckynight-partial.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ae3856dcaf
avcodec/wmalosslessdec: deallocate uninitialized frame on decode_tilehdr() failure
...
Fixes use of uninitialized memory
partly fixes: msan_uninit-mem_7f7834b6a530_6473_luckynight-partial.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
03fff09b32
avcodec/wmalosslessdec: Pass on error code from decode_tilehdr()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e2742d6ad6
avcodec/wmalosslessdec: completely initialize contains_subframe
...
Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f60c46325d7_6415_luckynight.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4fb14f8492
avcodec/wmalosslessdec: fix data flushing at the end
...
Fixes ffplay -autoexit
Fixes Ticket3000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Michael Niedermayer
286beebdc3
avcodec/wmalosslessdec: check block_align
...
Code copied from wmaprodec
Fixes null pointer dereference
Fixes Ticket3002
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
851a6e2f1a
avcodec/wmalosslessdec: Fix return code for invalid buffer sizes
...
Fixes infinite loop
Fixes Ticket2979
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Hendrik Leppkes
3ca5df36a5
wmall: use AVFrame API properly
...
This fixes a bug with non-refcounted callers resulting in invalid memory access.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Paul B Mahol
4511973901
wmalosslessdec: do not set avctx->coded_frame
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Diego Biurrun
12e25ed284
avcodec: av_log_missing_feature(1) ---> avpriv_request_sample()
12 years ago
Diego Biurrun
6d97484d72
avcodec: av_log_ask_for_sample() ---> avpriv_request_sample()
12 years ago
Diego Biurrun
63d744e2be
av_log_missing_feature() ---> avpriv_report_missing_feature()
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
Michael Niedermayer
6471f63da2
wmalosslessdec: make arrays indexed by ch large enough for maximum number of channels
...
Fixes out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
f3298f1299
Return proper error code after av_log_ask_for_sample()
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