Vittorio Giovara
2ffb0598db
mlpdec: check for negative index
...
CC: libav-stable@libav.org
Bug-Id: CID 970924
10 years ago
James Almer
0de1d6287e
x86/mlpdec: add ff_mlp_rematrix_channel_{sse4,avx2}
...
2x to 2.5x faster than the C version.
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
James Almer
ddb813b0ef
mlpdec: move rematrix_channels code to output_data()
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Hendrik Leppkes
36bf549b27
mlpdec: support TrueHD streams with an Atmos substream
...
The fourth substream is being discarded, since its not raw audio data,
but an encoded Atmos stream which needs a specialized decoder.
Fixes decoding of the true hd stream from Transformers\ -\ Age\ of\ Extinction\ 2014\ 1080P-003.mkv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Hendrik Leppkes
ff34b2d6d3
mlpdec: support major sync headers with optional extension blocks
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
fa160af08b
avcodec/mlpdec: fix () in MSB_MASK() macro
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Ben Avison
b01a2562ae
truehd: break out part of output_data into platform-specific callback.
...
Verified with profiling that this doesn't have a measurable effect upon
overall performance.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Ben Avison
3f4e73afe9
truehd: break out part of rematrix_channels into platform-specific callback.
...
Verified with profiling that this doesn't have a measurable effect upon
overall performance.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Ben Avison
b9eb03416d
truehd: break out part of output_data into platform-specific callback.
...
Verified with profiling that this doesn't have a measurable effect upon
overall performance.
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Ben Avison
fcf5fc4445
truehd: tune VLC decoding for ARM.
...
Profiling on a Raspberry Pi revealed the best performance to correspond
with VLC_BITS = 5. Results for overall audio decode and the get_vlc2 function
in particular are as follows:
Before After
Mean StdDev Mean StdDev Confidence Change
6:2 total 348.8 20.1 339.6 15.1 88.8% +2.7% (insignificant)
6:2 function 38.1 8.1 26.4 4.1 100.0% +44.5%
8:2 total 339.1 15.4 324.5 15.5 99.4% +4.5%
8:2 function 33.8 7.0 27.3 5.6 99.7% +23.6%
6:6 total 604.6 20.8 572.8 20.6 100.0% +5.6%
6:6 function 95.8 8.4 68.9 8.2 100.0% +39.1%
8:8 total 766.4 17.6 741.5 21.2 100.0% +3.4%
8:8 function 106.0 11.4 86.1 9.9 100.0% +23.1%
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Ben Avison
4e5aa080bb
truehd: break out part of rematrix_channels into platform-specific callback.
...
Verified with profiling that this doesn't have a measurable effect upon
overall performance.
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Ben Avison
e555e1bc39
truehd: tune VLC decoding for ARM.
...
Profiling on a Raspberry Pi revealed the best performance to correspond
with VLC_BITS = 5. Results for overall audio decode and the get_vlc2 function
in particular are as follows:
Before After
Mean StdDev Mean StdDev Confidence Change
6:2 total 348.8 20.1 339.6 15.1 88.8% +2.7% (insignificant)
6:2 function 38.1 8.1 26.4 4.1 100.0% +44.5%
8:2 total 339.1 15.4 324.5 15.5 99.4% +4.5%
8:2 function 33.8 7.0 27.3 5.6 99.7% +23.6%
6:6 total 604.6 20.8 572.8 20.6 100.0% +5.6%
6:6 function 95.8 8.4 68.9 8.2 100.0% +39.1%
8:8 total 766.4 17.6 741.5 21.2 100.0% +3.4%
8:8 function 106.0 11.4 86.1 9.9 100.0% +23.1%
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
f90a4bfc43
mlpdec: fix request_channel_layout behavior.
...
When request_channel_layout is 0,
all substreams should be decoded.
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
11 years ago
Michael Niedermayer
1a8050ad61
avcodec/mlpdec: fix mulichannel output
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Tim Walker
c0c45188e5
mlp: improve request_channel_layout behavior.
...
Don't decode further substreams if request_channel_layout
is a subset of the current substream's channel_layout.
Before, we would only discard further substreams if
request_channel_layout matched the substream's
channel_layout extactly, thus decoding additional
channels which the caller would probably end up downmixing.
11 years ago
Tim Walker
e92123093d
mlpdec: set AV_FRAME_DATA_MATRIXENCODING side data.
11 years ago
Tim Walker
4b7f1a7ced
mlp: Parse TrueHD decoder channel modifiers and set the AVMatrixEncoding for each substream.
11 years ago
Michael Niedermayer
a8d702859b
avcodec/mlpdec: check that streamtype matches the codec
...
Fixes use of uninitialized memory
Fixes msan_uninit-mem_7f126c8ed1ac_5945_issue1731_nonpublic.mpg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
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
f7bea731d9
avcodec/mlpdec: Fail if the input is too small
...
This fixes a infinite loop
Fixes Ticket2986
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
1607a98545
avcodec/mlp: Fix bugs in libavs warning fixes
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
7950e519bb
Disable deprecation warnings for cases where a replacement is available
12 years ago
Luca Barbato
e9d394f3fa
mlpdec: Do not set invalid context in read_restart_header
...
The faulty values rippled further down the codepath causing a
hard-to-track segfault in the assembly code.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Michael Niedermayer
e234daa518
mlpdec: Fix reading state with 0 bit elements.
...
This fixes an assertion failure
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
Anton Khirnov
0dff40bfb9
mlpdec: do not try to allocate a zero-sized output buffer.
...
CC:libav-stable@libav.org
12 years ago
Justin Ruggles
dc33fbbfd0
mlp/truehd: decode directly to the user-provided AVFrame
12 years ago
Michael Niedermayer
8491ac3ad2
mlpdec: check ch_assign more completely
...
Fixes CID970924
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
8071288601
mlpdec: move ch_assign setup code down to after ch layout is set.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6747b0be9b
mlp: fix channel order.
...
This fixes a regression introduced with todays merge
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
0ff21c3165
mlpdec: remove disabled code, leftover from merge
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Tim Walker
ed1b01131e
mlp: implement support for AVCodecContext.request_channel_layout.
...
Also wrap usage of AVCodecContext.request_channels in FF_API_REQUEST_CHANNELS directives.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years ago
Tim Walker
1fd2deedcc
mlpdec: set the channel layout.
...
Fixes bug 401.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
CC:libav-stable@libav.org
12 years ago
Tim Walker
3ffcccb4fb
mlpdec: TrueHD: use Libav channel order.
...
Fixes bug 208.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
CC:libav-stable@libav.org
12 years ago
Tim Walker
99ccd2ba10
mlp: store the channel layout for each substream.
...
Also stop storing the channel arrangement in the header info, as it's unused outside of ff_mlp_read_major_sync.
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
CC:libav-stable@libav.org
12 years ago
Michael Niedermayer
4aed4f5846
mlpdec: dont leave a invalid huff_lsb in the context.
...
Fix assertion failure
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Nicolas George
e6701d51e1
lavc/mlpdec: reset layout when channels change.
...
Triggered by the sample for trac ticket #1726 .
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
Luca Barbato
2d6caade22
dsputil: split out mlp dsp function
12 years ago
Michael Niedermayer
c5e2347373
mlpdec: supress layout mismatch warnings for 2 ch upmixed mono
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
eda5db6bd1
mlpdec: discard a 2nd substream if the stream is mono
...
This fixes the rest of Ticket1726
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Piotr Bandurski
53241b5dc7
lavc: add missing new line to some messages
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Michael Niedermayer
60f3291086
mlpdec: switch to av_assert
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
137e80817d
lavc: build some codecs only if they are actually enabled
...
Saves few bytes if only some of them in same file are enabled.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
13 years ago
Michael Niedermayer
a9cd12ee2a
mlpdec: set channel variables after checking them
...
This fixes out of array reads
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Martin Storsjö
00c3b67b8a
cosmetics: Align codec declarations
...
Also break some long lines, remove codec function placeholder comments
and add spaces in sample/pixel format lists.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Paul B Mahol
ca085e667b
mlpdec: use av_log_ask_for_sample()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
13 years ago