Ganesh Ajjanagadde
05434b0eea
lavc/cook: get rid of wasteful pow in init_pow2table
...
The table is highly structured, so pow (or exp2 for that matter) can entirely
be avoided, yielding a ~ 40x speedup with no loss of accuracy.
sample benchmark (Haswell, GNU/Linux):
new:
4449 decicycles in init_pow2table(loop 1000), 254 runs, 2 skips
4411 decicycles in init_pow2table(loop 1000), 510 runs, 2 skips
4391 decicycles in init_pow2table(loop 1000), 1022 runs, 2 skips
old:
183673 decicycles in init_pow2table(loop 1000), 256 runs, 0 skips
182142 decicycles in init_pow2table(loop 1000), 512 runs, 0 skips
182104 decicycles in init_pow2table(loop 1000), 1024 runs, 0 skips
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
9 years ago
Michael Niedermayer
7404f3bdb9
lavc: Switch bitrate to 64bit unless compatibility with avconv was requested.
9 years ago
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
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
828759ed9a
avcodec/cook: Remove unneeded #if
...
The code is already doing nothing if DEBUG is disabled
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Michael Niedermayer
114a2eb272
avcodec: Use av_clip_uintp2() where possible
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
7f9f771eac
avcodec: Don't anonymously typedef structs
10 years ago
Luca Barbato
299d8ab104
cook: Make sure there is enough extradata
...
At least 8 bytes are needed (Mono audio).
Bug-Id: CID 741418
CC: libav-stable@libav.org
10 years ago
Michael Niedermayer
10e32618ac
avcodec/cook: check that the subpacket sizes fit in block_align
...
Fixes out of array read
Fixes: asan_heap-oob_fb5c50_19_018.rmvb
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Gabriel Dume
f929ab0569
cosmetics: Write NULL pointer equality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
10 years ago
Diego Biurrun
9a9e2f1c8a
dsputil: Split audio operations off into a separate context
11 years ago
Michael Niedermayer
ea8e089ff7
avcodec/cook: use av_malloc_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Paul B Mahol
65988b9916
avcodec/cook: fix deadlock by using get_unary()
...
Fixes #3089 .
Reported-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Paul B Mahol
66518f6feb
avcodec/cook: use av_freep()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Paul B Mahol
a9b424879f
lavc & lavf: replace deprecated av_log* functions
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Diego Biurrun
6d97484d72
avcodec: av_log_ask_for_sample() ---> avpriv_request_sample()
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
c69315a5de
cook: check js_subband_start for validity
...
Fixes out of array read
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
7b78321597
cook: 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
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
Michael Niedermayer
774830050a
cook: check subbands more completely, fix out of array read.
...
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
Michael Niedermayer
c9e4554329
cook: fix use of uninitialized variable
...
Fixes CID741418
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
93e27f86f1
cook: use av_dlog() for debug logging instead of av_log() with AV_LOG_ERROR
12 years ago
Justin Ruggles
8f173ef019
cook: move samples_per_frame from COOKSubpacket to where it is used
12 years ago
Justin Ruggles
7efbba2e36
cook: use av_get_channel_layout_nb_channels() instead of cook_count_channels()
12 years ago
Justin Ruggles
d21b2e4726
cook: reverse a condition so that the code makes more sense
12 years ago
Justin Ruggles
926e9d28f1
cook: remove unneeded COOKContext variable, sample_rate
12 years ago
Justin Ruggles
8aa5b8c5c8
cook: remove unneeded COOKContext variable, bit_rate
12 years ago
Justin Ruggles
3509eee19c
cook: use AVCodecContext.channels instead of keeping a private copy
12 years ago
Diego Biurrun
707f58f515
cook: Remove some silly Doxygen comments
12 years ago
Diego Biurrun
8a61ba0e81
cook: Remove senseless maybe_reformat_buffer32() function
12 years ago
Diego Biurrun
f23b4a0682
cook: cosmetics: Better names for joint_decode() function parameters
12 years ago
Diego Biurrun
20015379a4
cook: cosmetics: Better name for ccpl COOKSubpacket member
12 years ago
Michael Niedermayer
4ce9312d76
libavcodec/cook: add {} to complex ifs
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
cbf6ee7823
cook: use planar sample format
12 years ago
Diego Biurrun
6f6b0311a3
avcodec: Drop some silly commented-out av_log() invocations
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Diego Biurrun
0177b7d23a
Improve descriptiveness of a number of codec and container long names
12 years ago
Michael Niedermayer
5a35bd92ad
cook: check subacket count
...
Fixes out of array writes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Alex Converse
b5d2bf964b
cook: Make constants passed to AV_BE2NE32C() unsigned to avoid signed overflow.
13 years ago
Diego Biurrun
a92be9b856
Replace memset(0) by zero initializations.
...
Also remove one pointless zero initialization in rangecoder.c.
13 years ago
Ronald S. Bultje
97e48b2f54
cook: error out on quant_index values outside [-63, 63] range.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Ronald S. Bultje
442c3a8cb1
cook: expand dither_tab[], and make sure indexes into it don't overflow.
...
Fixes overflows in accessing dither_tab[].
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Michael Niedermayer
f7b57add8e
cook: tighten the quant_index_table range further.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Ronald S. Bultje
37cc8600d0
cook: extend channel uncoupling tables so the full bit range is covered.
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago