Andreas Rheinhardt
30a5b66a7c
avcodec/g729dec: Mark decoders as init-threadsafe
...
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
Andreas Rheinhardt
a247ac640d
avcodec: Constify AVCodecs
...
Given that the AVCodec.next pointer has now been removed, most of the
AVCodecs are not modified at all any more and can therefore be made
const (as this patch does); the only exceptions are the very few codecs
for external libraries that have a init_static_data callback.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years ago
Michael Niedermayer
0ddef00457
avcodec/g729dec: Avoid one multiply by using init_get_bits8()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
336f9461df
avcodec/g729dec: Avoid using buf_size
...
buf_size is not updated as buf is advanced so it is wrong after the first
iteration
Fixes: Timeout (160sec -> 27sec)
Fixes: 18658/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G729_fuzzer-5729784269373440
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
576746b4e3
avcodec/g729dec: Factor block_size out
...
This will be used in the next commit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
f64be9da4c
avcodec/g729dec: require buf_size to be non 0
...
The 0 case was added with the support for multiple packets. It
appears unintended and causes extra complexity and out of array
accesses (though within padding)
No testcase
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
d468da8d79
avcodec/g729dec: Check for KELVIN && 6k4
...
This combination would assume different block sizes throughout the code so its
better to error out.
Fixes: signed integer overflow: -1082385168 * 2 cannot be represented in type 'int'
Fixes: 19110/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-5643993950191616
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
bf9c4a1275
avcodec/g729dec: Use 64bit and clip in scalar product
...
The G729 reference decoder clips after each individual operation and keeps track if overflow
occurred (in the fixed point implementation), this here is
simpler and faster but not 1:1 the same what the reference does.
Non fuzzed samples which trigger any such overflow are welcome, so
the need and impact of different clipping solutions can be evaluated.
Fixes: signed integer overflow: 1271483721 + 1073676289 cannot be represented in type 'int'
Fixes: 18617/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-5137705679978496
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Michael Niedermayer
2c78a76cb0
avcodec/g729dec: Avoid computing invalid temporary pointers for ff_acelp_weighted_vector_sum()
...
Fixes: Ticket8176
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Carl Eugen Hoyos
551fcbbccb
lavc/g729dec: Support decoding Sipro ACELP.KELVIN.
...
Fixes ticket #4799 .
Analyzed-by: Aleksandr Ustinov
5 years ago
Carl Eugen Hoyos
011c9112a0
lavc/g729dec: Cosmetics, fix indentation after last commit.
6 years ago
Carl Eugen Hoyos
641d52152f
lavc/g729dec: Support stereo streams.
...
Fixes ticket #4553 .
6 years ago
James Almer
28d5a3a74a
lavu: rename and move ff_parity to av_parity
...
av_popcount is not defined in intmath.h.
Reviewed-by: ubitux
Signed-off-by: James Almer <jamrial@gmail.com>
9 years ago
Clément Bœsch
a1136ca973
lavc/g729dec: use ff_parity()
9 years ago
James Almer
ba625dd8a1
avcodec: use av_mod_uintp2() where useful
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Paul B Mahol
daf73d5d17
avcodec/g729dec: support decoding packets with multiple frames
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
10 years ago
Clément Bœsch
b46f19100b
cosmetics: group remaining .name and .long_name.
...
See b2bed9325
.
11 years ago
Michael Niedermayer
8251c05320
g729dec: switch to buffer refs style
...
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
Michael Niedermayer
a974adc3c7
g729dec: check pitch_delay_int.
...
Fix out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Peter Ross
bdba96e93c
use correct doxygen parameter direction syntax
...
Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Peter Ross
9ccc349f77
ensure comment blocks that contain doxygen commands start with double asterix
...
Reveiwed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Lou Logan
6851130fd6
cosmetics: minor libavcodec spelling errors
...
Also update some common misspelled words in patcheck
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
8ce0c7d264
g729dec: align codec declarations
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Michael Niedermayer
c963189bc2
g729dec: initialize pitch_delay_int_prev to the minimum valid value.
...
This prevents an out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
9ff43569d2
g729dec: fix scalarproduct_int16 after API change
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Lou Logan
2d38081b4f
cosmetics: fix some typos
...
Patch attached.
From 2d4094fc0dcb4ccd0735eb7e1719e228ebb56bb9 Mon Sep 17 00:00:00 2001
From: Lou Logan <lou@lrcd.com>
Date: Mon, 12 Mar 2012 14:13:44 -0800
Subject: [PATCH] cosmetics: fix some typos
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
22b125f912
g729dec: fix 'warning: assignment from incompatible pointer type'
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
934abf6ff8
g729dec: fix use of deprecated functions.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
ba10207bbe
Use more designated initializers.
...
Also remove some pointless NULL/0 assigments.
C++ code must be left as it is because named struct
initializers are not supported by C++ standard.
13 years ago
Michael Niedermayer
7db5ff7996
g729dec: update to the new API
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Vitor Sessak
edf1a8e361
g729dec: initialize bit reader with the correct buffer size
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
c329972687
g729: dont force all cpu optims to off but override just the one that doesnt work.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Mohamed Naufal Basheer
bcc67dffa0
Add a shift parameter to celp_lp_synthesis_filter for reuse by the G.723.1 decoder
13 years ago
Vitor Sessak
02aabd820f
g729dec: avoid unnecessary struct copying
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Vitor Sessak
22dd24fc7d
g729dec: remove useless headers
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Vitor Sessak
1c4712db81
g729dec: Add ff_ prefix to g729_postfilter() and g729_adaptive_gain_control()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
43e05685f2
g729dec: disable all cpu acceleration, the code does not provide any alignment.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
91c5f81b74
g729dec: set sample format.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Vladimir Voroshilov
5d5b3e527a
Disable MMX
13 years ago
Vladimir Voroshilov
8db3b85616
Fix comments about implemented codecs
13 years ago
Vladimir Voroshilov
682337672c
Adaptive gain control
13 years ago
Vladimir Voroshilov
aca516cd67
G.729 postfilter
13 years ago
Vladimir Voroshilov
16bbb8dfea
Replace pitch_delay_int with array
13 years ago
Michael Niedermayer
ce7c954800
g729dec: Make 2 functions static that are not used outside g729dec.c
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Vladimir Voroshilov
c458bff934
High-pass filter
13 years ago
Vladimir Voroshilov
e610c5f383
Add G.729D decoder
13 years ago
Vladimir Voroshilov
b7c7fc3359
Synthesis filter
13 years ago
Vladimir Voroshilov
4920a1a913
Indentation fix after gain codes decoding2
13 years ago
Vladimir Voroshilov
0b42463aec
Gain pitch and gain code for G729D
13 years ago