Andreas Rheinhardt
ad232c6833
avcodec/adxenc: Avoid copying packet data, allow user-supplied buffers
...
When the packet size is known in advance like here, one can avoid
an intermediate buffer for the packet data by using
ff_get_encode_buffer() and also set AV_CODEC_CAP_DR1 at the same time.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
4 years ago
Andreas Rheinhardt
d0f90e23b4
avcodec/adxenc: Mark encoder 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
Andreas Rheinhardt
59a9d65e0d
avcodec/adxenc: Avoid undefined left shift of negative numbers
...
Replace "((a << shift) + b) >> shift" by "a + (b >> shift)". This avoids
a left shift which also happens to trigger undefined behaviour in case "a"
is negative. This affected the FATE-tests acodec-adpcm-adx and
acodec-adpcm-adx-trellis; it also fixes ticket #8008 .
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 years ago
Paul B Mahol
cc6a1f1417
avcodec/adxenc: add EOF header
...
Fixes #8031 .
5 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
Michael Niedermayer
d74c8d3ada
avcodec/adxenc: Use av_clip_intp2()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0b5adc3520
avcodec/adxenc: fix rounding
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
6b0ab561d0
avcodec/adxenc: match prediction used in the decoder
...
The prediction used in the encoder was not correct
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
b2bed9325d
cosmetics: Group .name and .long_name together in codec/format declarations
11 years ago
Anton Khirnov
f073b1500e
lavc: remove disabled FF_API_OLD_ENCODE_AUDIO cruft
12 years ago
Justin Ruggles
bae4f47938
adxenc: alloc/free coded_frame instead of keeping it in the ADXContext
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
12 years ago
Paul B Mahol
f8ba7c4658
adxenc: fix error in merging from qatar
...
Pointed out by FATE.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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
a42fa4c649
adxenc: switch to ff_alloc_packet2()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Justin Ruggles
6aba117f12
adxenc: use AVCodec.encode2()
13 years ago
Justin Ruggles
54e6cf8a94
adxenc: Use the AVFrame in ADXContext for coded_frame
13 years ago
Paul B Mahol
7b21b0f155
adxenc: check return value of avcodec_alloc_frame()
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Justin Ruggles
754ebd1a5b
adxenc: check output buffer size before writing
13 years ago
Justin Ruggles
1fb47728cd
adxenc: use bytestream functions for header writing.
...
also add more documentation about the header structure
13 years ago
Justin Ruggles
656e606cae
adxenc: use BLOCK_SIZE and BLOCK_SAMPLES macros
13 years ago
Justin Ruggles
f1be41c63d
adxenc: use a loop to encode each channel
13 years ago
Justin Ruggles
6c117bd8e0
adxenc: remove unneeded loops
...
avctx->frame_size is 32, so that is how many samples we process per call.
13 years ago
Justin Ruggles
613668210b
adxenc: avoid stereo deinterleaving
13 years ago
Justin Ruggles
6b77f07074
adxenc: remove unnecessary setting of coded_frame->key_frame.
...
It is already set by avcodec_alloc_frame().
13 years ago
Justin Ruggles
cc40c056d0
adxenc: log an error message and return AVERROR(EINVAL) for invalid channels
13 years ago
Justin Ruggles
a85ab8ad45
adxenc: cosmetics: pretty-printing
13 years ago
Justin Ruggles
25edfc88e3
adxenc: change some data types
13 years ago
Justin Ruggles
c98c6e18d8
adxenc: remove unneeded log message
13 years ago
Justin Ruggles
e3d4f59f95
adxenc: remove unneeded comments
13 years ago
Justin Ruggles
994238536a
adx: simplify encoding by using put_sbits()
13 years ago
Justin Ruggles
b237248e29
adx: calculate correct LPC coeffs
...
Instead of using fixed coefficients, the correct way is to calculate the
coefficients using the highpass cutoff frequency from the ADX stream header
and the sample rate.
13 years ago
Justin Ruggles
954d94dd5e
adx: use 12-bit coefficients instead of 14-bit to avoid integer overflow
13 years ago
Justin Ruggles
dd1b9f7cd9
adx: rename struct PREV to ADXChannelState
13 years ago
Diego Biurrun
20566eb0f0
Replace outdated references to ffmpeg tool with avconv.
13 years ago
Anton Khirnov
ec6402b7c5
lavc: use designated initialisers for all codecs.
...
It's more readable and less prone to breakage.
13 years ago
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Diego Elio Pettenò
e7e2df27f8
Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.
...
None of these symbols should be accessed directly, so declare them as
hidden.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit d36beb3f69
)
14 years ago
Diego Elio Pettenò
d36beb3f69
Add ff_ prefix to data symbols of encoders, decoders, hwaccel, parsers, bsf.
...
None of these symbols should be accessed directly, so declare them as
hidden.
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Stefano Sabatini
5d6e4c160a
Replace deprecated symbols SAMPLE_FMT_* with AV_SAMPLE_FMT_*, and enum
...
SampleFormat with AVSampleFormat.
Originally committed as revision 25730 to svn://svn.ffmpeg.org/ffmpeg/trunk
14 years ago
Diego Biurrun
ba87f0801d
Remove explicit filename from Doxygen @file commands.
...
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.
Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Stefano Sabatini
72415b2adb
Define AVMediaType enum, and use it instead of enum CodecType, which
...
is deprecated and will be dropped at the next major bump.
Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Reimar Döffinger
b5f09d31c2
Make sample_fmts and channel_layouts compound literals const to reduce size of
...
.data section.
Originally committed as revision 19787 to svn://svn.ffmpeg.org/ffmpeg/trunk
15 years ago
Diego Biurrun
0ffbc258aa
Change a bunch of codec long_names to be more consistent and descriptive.
...
Originally committed as revision 17716 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
bad5537e2c
Use full internal pathname in doxygen @file directives.
...
Otherwise doxygen complains about ambiguous filenames when files exist
under the same name in different subdirectories.
Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
99ed41a808
Fix filenames in Doxygen comments.
...
Originally committed as revision 16811 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Diego Biurrun
6a5d31ac25
Fix build: Add intreadwrite.h and bswap.h #includes where necessary.
...
Originally committed as revision 16556 to svn://svn.ffmpeg.org/ffmpeg/trunk
16 years ago
Peter Ross
fd76c37fd9
Modify all codecs to report their supported input and output sample format(s).
...
Originally committed as revision 14482 to svn://svn.ffmpeg.org/ffmpeg/trunk
17 years ago
Stefano Sabatini
fe4bf37455
Make AVCodec long_names definition conditional depending on CONFIG_SMALL.
...
Originally committed as revision 13759 to svn://svn.ffmpeg.org/ffmpeg/trunk
17 years ago