Paul B Mahol
95fb9e0205
avcodec: add pcm_f16le and pcm_f24le decoder
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years ago
Paul B Mahol
fc600eff63
avcodec: add 64-bit signed pcm codec
8 years ago
Michael Niedermayer
2de8bfd2ef
avcodec/pcm: Fix overflow in bitrate computation
...
Fixes: 129ca3e28d73af7b1e24a9d4118e7a2d/signal_sigabrt_7ffff6ae7cc9_836_762b310fc3ef6087bd7771e5d8e90b9b.asf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
4302a92835
avcodec/pcm: Better min_size for ff_alloc_packet2()
...
33318 -> 30601 decicycles
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
Vittorio Giovara
d6604b29ef
Gather all coded_frame allocations and free functions to a single place
...
Allocating coded_frame is what most encoders do anyway, so it makes
sense to always allocate and free it in a single place. Moreover a lot
of encoders freed the frame with av_freep() instead of the correct API
av_frame_free().
This bring uniformity to encoder behaviour and prevents applications
from erroneusly accessing this field when not allocated. Additionally
this helps isolating encoders that export information with coded_frame,
and heavily simplifies its deprecation.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
9 years ago
Paul B Mahol
5a79bf0284
PCM signed 16-bit big-endian planar decoder
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
10 years ago
Diego Biurrun
6af2930222
pcm: Drop av_unused attribute from variable that is always used
10 years ago
Diego Biurrun
14d2006ca6
pcm: Drop unused variable from DECODE_PLANAR macro
10 years ago
Anton Khirnov
5b9c3b4505
Replace all instances of avcodec_alloc_frame() with av_frame_alloc().
11 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Paul B Mahol
7e52080cb1
pcm: support 24-bit/32-bit little-endian planar
...
Used by LXF.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years ago
Christian Schmidt
a42e3a6700
pcm_dvd: consolidate pieces from pcm.c and mpeg.c
...
Remove the header decoding for PCM audio from mpeg.c and the
20/24bit parts from pcm.c and merge them into a new decoder in
pcm-dvd.c.
The decoder has added support for samples that span multiple
packets and modified 20/24bit group decoding. Both is needed to
decode samples that have been generated with DVD-Lab Pro 2. The
decoding of 16bit PCM and two channel 24bit is identical to
before. No other samples are known to verify the correctness of
the encoding this software does.
The complete list of tested formats is
48kHz/16bit/2-8 channels
48kHz/24bit/2-5 channels
96kHz/16bit/2-4 channels
96kHz/24bit/2 channels
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years ago
Luca Barbato
c82da343e6
pcm: always use codec->id instead of codec_id
...
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
12 years ago
Paul B Mahol
5285a7549f
pcmenc: don't allocate unused avctx->coded_frame
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
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
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
a6bb39add2
pcm: 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
f0695b09dd
pcmdec: check codec_id
...
Fixes out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
dd59f0125d
add some planar PCM encoders
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
f17f759544
pcmdec: use memcpy() when possible for planar decoders
...
This is faster (at least with clang).
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Justin Ruggles
00dd9a6d6a
pcm: fix decoding of pcm_s16le_planar on big-endian
...
The sample count is decremented by the DECODE() macro and needs to be reset
in each loop iteration. Also, DECODE() increments the src pointer so that does
not need to be done separately.
12 years ago
Paul B Mahol
00e02366a5
pcmenc: use ENCODE macro for pcm_s8
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
2d232f8b88
pcm: revert from libavs planar code to durandals.
...
The libav code does not work on big endian.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Paul B Mahol
da8242e2d6
8svx: move pcm_s8_planar decoder to pcm.c
...
Removes limitation of max 2 channels for pcm_s8_planar decoder by moving
it to more natural place.
AV_CODEC_ID_8SVX_RAW is not used by anything anymore and is going to be
removed.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Justin Ruggles
c9d0f4506f
pcmdec: use planar sample format for pcm_s16le_planar
12 years ago
Paul B Mahol
0df7d95a5e
pcmenc: remove dead increment
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
6557c46d91
pcm: move i into for loop to avoid { } inside switch statement
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
9ba41ae63e
PCM signed 16-bit big-endian planar decoder
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
467dfd5dfa
PCM signed 24-bit/32-bit little-endian planar decoder
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Paul B Mahol
eca2eb2dfa
pcm: give more descriptive name to codec
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
12 years ago
Michael Niedermayer
7373b3ad04
pcmdec: consistently use codec_id, fixes out of array reads
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
b8551f8ea7
pcmdec: check that channels is valid.
...
Prevents a division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
00aa7fa786
pcm: fix handling of more than 8 channels for planar
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Justin Ruggles
bb6941af2a
lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders
12 years ago
Mans Rullgard
abdee95224
pcm: define AVCodec instances only for enabled codecs
...
This defines an AVCodec only if the corresponding CONFIG option is
enabled instead of using the broad CONFIG_ENCODERS/DECODERS.
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Diego Biurrun
d5c62122a7
Move av_reverse table to libavcodec
...
It is only used in that library.
12 years ago
Justin Ruggles
7e5f045039
pcmdec: use planar sample format for pcm_lxf
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Stefano Sabatini
201b409da0
lavc/pcm: clarify error message from pcm_decode_frame()
...
Extend/clarify an error message in case of invalid packet size, and
return a proper error message instead of -1.
Improve debuggability.
13 years ago
Mans Rullgard
7d7b40f48a
pcmenc: set correct bitrate value
...
This fixes a bogus bitrate value in the header of WAV files with
alaw/ulaw audio.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Aneesh Dogra
6d21f49879
pcm: K&R formatting cosmetics
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
13 years ago
Paul B Mahol
ae2c33b0c2
cosmetics: remove superfluous curly brackets
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
11e8f3e7a2
pcm: switch to ff_alloc_packet2().
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Paul B Mahol
32a5775a91
pcm: leave sample format conversion to libswresample
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Justin Ruggles
a8bdf2405c
check for coded_frame allocation failure in several audio encoders
13 years ago
Justin Ruggles
255ad8881d
audio encoders: do not set coded_frame->key_frame.
...
it is already set in avcodec_alloc_frame()
13 years ago