Paul B Mahol
f52dd8a55a
avcodec/g723_1dec: use init_get_bits8()
6 years ago
Paul B Mahol
d283ee085f
avcodec/g723_1dec: improve stereo support
6 years ago
Paul B Mahol
7a124138a7
avcodec/g723_1dec: reindent after last commit
6 years ago
Paul B Mahol
62dbcb7ddf
avcodec/g723_1: add support for stereo files
6 years ago
Michael Niedermayer
53f241218d
avcodec/g723_1dec: Clip bits2 in both directions
...
Fixes: shift exponent 33 is too large for 32-bit type 'int'
Fixes: 6743/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G723_1_fuzzer-5823772687859712
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years ago
Michael Niedermayer
23868ad5cb
avcodec/g723_1dec: Clip after shift in estimate_sid_gain()
...
Fixes: runtime error: left shift of 706 by 22 places cannot be represented in type 'int'
See: L_shl() in the reference software
Fixes: 1609/clusterfuzz-testcase-minimized-5102163007111168
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
f2c539d350
avcodec/g723_1dec: Fix LCG type
...
Fixes: 1567/clusterfuzz-testcase-minimized-5693653555085312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
c4c0245686
avcodec/g723_1dec: Fix runtime error: left shift of negative value -1
...
Fixes: 1504/clusterfuzz-testcase-minimized-6249212138225664
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
d3088e0fd8
avcodec/g723_1dec: Fix several integer related cases of undefined behaviour
...
Fixes: 1412/clusterfuzz-testcase-minimized-6561308772139008
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Michael Niedermayer
4ace2d2219
avcodec/g723_1: Fix multiple runtime error: left shift of negative value
...
Fixes: 1367/clusterfuzz-testcase-minimized-571496882346393
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years ago
Diego Biurrun
a25dac976a
Use bitstream_init8() where appropriate
8 years ago
Alexandra Hájková
2188d53906
g72x: Convert to the new bitstream reader
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
8 years ago
Diego Biurrun
b668662939
get_bits: Move BITSTREAM_READER_LE definition before all relevant #includes
...
This avoids the danger that get_bits.h might get indirectly #included before
BITSTREAM_READER_LE is defined.
Also sort headers into canonical order where appropriate.
9 years ago
Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Vittorio Giovara
165cc6fb9d
g723_1: Move sharable functions to a separate file
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Vittorio Giovara
aac996cc01
g723_1: Rename files to better reflect their purpose
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Michael Niedermayer
b74b88f30d
g723_1: Handle values at the ends of the table in lsp2lpc()
...
Fixes out of array reads.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Ganesh Ajjanagadde
4328e1fc42
avcodec/g723_1: fix a undefined left shift of negative number
...
This fixes a -Wshift-negative-value reported with clang 3.7+, e.g
http://fate.ffmpeg.org/log.cgi?time=20150918181527&log=compile&slot=x86_64-darwin-clang-polly-vectorize-stripmine-3.7 .
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Michael Niedermayer
e36db49b7b
avcodec: Add a min size parameter to ff_alloc_packet2()
...
This parameter can be used to inform the allocation code about how much
downsizing might occur, and can be used to optimize how to allocate the
packet
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Diego Biurrun
7f9f771eac
avcodec: Don't anonymously typedef structs
10 years ago
Michael Niedermayer
d35000c2dc
avcodec/g723_1: fix writing into input frame data and warning
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
1457f3fd90
avcodec/g723_1: add assert to help static code analyzers
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Clément Bœsch
b46f19100b
cosmetics: group remaining .name and .long_name.
...
See b2bed9325
.
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Michael Niedermayer
a072acb108
avcodec: fix duplicate includes
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 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
James Zern
bcaf64b605
normalize calls to ff_alloc_packet2
...
- check ret < 0
- remove excessive error log
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
7e52fd6bca
g723.1: decode directly to the user-provided AVFrame
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
6535d81d87
g723_1dec: Fix lsp2lpc() so it can handle values at the ends of the table.
...
Fixes out of array reads
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
Diego Biurrun
5bac2d0c30
avutil: Move memcpy_backptr() to mem.c
...
The function is used elsewhere and does not belong with the LZO code.
12 years ago
Anton Khirnov
5a9567631a
g.723.1: add missing CODEC_CAP_DR1
12 years ago
Michael Niedermayer
34ccb94796
g723_1: remove unneeded cliping
...
Fixes CID703731
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
014b178f84
g723_1: fix overflow in square_root()
...
the intermediate does not fit in a signed 32bit int
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
269e6212ee
g723_1: add some const for more correctness
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Martin Storsjö
e6153f173a
avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Kostya Shishkov
04fc5c6bde
g723_1: add comfort noise generation
12 years ago
Mans Rullgard
0d230e9312
g723.1: simplify scale_vector()
...
It is impossible for bits to be 15 here so the special case is
not needed.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
a4b8fc3a8a
g723.1: simplify normalize_bits()
...
This function is always called with a non-negative argument, so
those special cases are not needed. In the places the argument
might be zero, the return value for a zero argument does not matter
since it would then be used to scale an array full of zeros.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Michael Niedermayer
603221ebd0
g723_1dec: inline normalize_bits() in scale vector and optimize it.
...
many branches and cases of scale_vector are irrelevant for the case here
and by inlining they can be reliably removed.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
20035fa241
g723_1dec: remove dead code that leaked in from libav
...
It appears someone thinks this special case can be reached
Well, it cannot, thus not only do we not need to optimize it
we dont need it at all
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
84d29df013
g723_1dec: remove unneeded cliping that leaked in from merge from libav
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
a9040a1167
g723_1dec: avoid memcpy
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Mans Rullgard
69665bd6f4
g723.1: do not pass large structs by value
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
138914dcd8
g723.1: do not bounce intermediate values via memory
...
Although a reasonable compiler will probably optimise out the
actual store and load, this operation still implies a truncation
to 16 bits which the compiler will probably not realise is not
necessary here.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
cbcf1b411f
g723.1: declare a variable in the block it is used
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Mans Rullgard
35b533e4de
g723.1: avoid saving/restoring excitation
...
Writing the scaled excitation to a scratch buffer (borrowing the
'audio' array) instead of modifying it in place avoids the need
to save and restore the unscaled values.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago