Commit Graph

82 Commits

Author SHA1 Message Date
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>
2012-04-06 22:37:38 +03:00
Justin Ruggles 59041fd053 g726enc: use AVCodec.encode2() 2012-03-20 18:47:23 -04:00
Justin Ruggles 0eea212943 Add avcodec_decode_audio4().
Deprecate avcodec_decode_audio3().
Implement audio support in avcodec_default_get_buffer().
Implement the new audio decoder API in all audio decoders.
2011-12-02 17:40:40 -05:00
Justin Ruggles da24963725 g726dec: add flush() function to reset state when seeking 2011-11-01 21:23:04 -04:00
Justin Ruggles 97f5dd1d84 g726: don't pass index to g726_reset()
calculate it from c->code_size instead.
2011-11-01 21:23:04 -04:00
Justin Ruggles 615b2a2cf5 g726enc: add private option for setting code size directly.
This is an easy alternative to setting bit_rate. This patch also selects the
closest bit_rate to the requested one rather than requiring an exact value.
2011-11-01 21:23:04 -04:00
Justin Ruggles 7abb73d4ba g726: wrap the decoder functions with a CONFIG_ADPCM_G726_DECODER check 2011-11-01 21:23:04 -04:00
Justin Ruggles 437c11ca16 g726: group the g726_encoder AVCodec with the other encoding functions 2011-11-01 21:23:04 -04:00
Justin Ruggles 50969c0f46 g726: return AVERROR(EINVAL) instead of -1 for invalid channel count 2011-11-01 21:23:03 -04:00
Justin Ruggles 50c466d609 g726enc: use av_assert0() for sample_rate validation
This should never happen, but the check avoids a divide-by-zero.
2011-11-01 21:23:03 -04:00
Justin Ruggles 9e78d8cfdf g726: treat sample rates other than 8kHz as unofficial. 2011-11-01 21:23:03 -04:00
Justin Ruggles 6e8d4a7afb g726dec: remove the sample_rate validation 2011-11-01 21:23:03 -04:00
Justin Ruggles 6ac34eed54 g726: use bits_per_coded_sample instead of bitrate to determine mode
This requires some workarounds in the WAV muxer and demuxer. We need to write
the correct bits_per_coded_sample and block_align in the muxer. In the
demuxer, we cannot rely on the bits_per_coded_sample value, so we use the bit
rate and sample rate to determine the value.

This avoids having the decoder rely on AVCodecContext.bit_rate, which is not
required to be set by the user for decoding according to our API.
2011-11-01 21:23:03 -04:00
Justin Ruggles d405237bae g726: split the init function for the encoder and decoder
This also allows for not having a decoder close function.
2011-11-01 21:23:03 -04:00
Justin Ruggles c8d36d254e g726: pre-calculate the number of output samples.
Allows for checking output buffer size and simplification of decoding loop.
2011-11-01 21:23:03 -04:00
Justin Ruggles e61a670b53 g726: use int16_t instead of short 2011-11-01 21:23:02 -04:00
Anton Khirnov ec6402b7c5 lavc: use designated initialisers for all codecs.
It's more readable and less prone to breakage.
2011-07-29 08:42:34 +02:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
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>
2011-01-26 16:08:45 +00:00
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
2010-11-12 11:04:40 +00:00
Justin Ruggles c7d89948a3 Set a constant frame size for encoding G.726 audio.
Originally committed as revision 25107 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-11 19:52:09 +00:00
Reimar Döffinger edac49daf5 Use "const" qualifier for pointers that point to input data of
audio encoders.
This is purely for clarity/documentation purposes.

Originally committed as revision 24481 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-24 13:59:49 +00:00
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
2010-03-30 23:30:55 +00:00
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
2009-09-06 09:15:07 +00:00
Stefano Sabatini 9106a698e7 Rename bitstream.h to get_bits.h.
Originally committed as revision 18494 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-13 16:20:26 +00:00
Stefano Sabatini b275500706 Split bitstream.h, put the bitstream writer stuff in the new file
put_bits.h.

Originally committed as revision 18461 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-12 08:35:26 +00:00
Thilo Borgmann 7a00bbad21 Implement avcodec_decode_video2(), _audio3() and _subtitle2() which takes an
AVPacket argument rather than a const uint8_t *buf + int buf_size. This allows
passing of packet-specific flags from demuxer to decoder, such as the keyframe
flag, which appears necessary to playback corePNG P-frames.

Patch by Thilo Borgmann thilo.borgmann googlemail com, see also the thread
"Google Summer of Code participation" on the mailinglist.

Originally committed as revision 18351 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-04-07 15:59:50 +00:00
Diego Biurrun 406792e7b0 cosmetics: Remove pointless period after copyright statement non-sentences.
Originally committed as revision 16684 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-19 15:46:40 +00:00
Aurelien Jacobs b250f9c66d Change semantic of CONFIG_*, HAVE_* and ARCH_*.
They are now always defined to either 0 or 1.

Originally committed as revision 16590 to svn://svn.ffmpeg.org/ffmpeg/trunk
2009-01-13 23:44:16 +00:00
Diego Biurrun f544a5fc84 Replace generic CONFIG_ENCODERS preprocessor conditionals by more specific
CONFIG_FOO_ENCODER conditionals where appropriate.

Originally committed as revision 15174 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-09-03 12:33:21 +00:00
Laurent Aimar bd10f6e149 Prevent a division by 0 in the g726 decoder when the configured samplerate is 0.
patch by Laurent Aimar, fenrir via.ecp fr

Originally committed as revision 15160 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-09-02 23:09:14 +00:00
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
2008-07-31 10:47:31 +00:00
Michael Niedermayer 74d9441715 Do not shift F[I] twice, it is also clearer and smaller now.
Originally committed as revision 13818 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-19 11:04:31 +00:00
Michael Niedermayer 50c52d2250 Factorize c->ap += (-c->ap) >> 4 out
Originally committed as revision 13817 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-19 11:00:17 +00:00
Michael Niedermayer 0e0d6cfd48 Get rid of G726Tables.bits.
Originally committed as revision 13816 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-19 10:52:47 +00:00
Michael Niedermayer 05c9f3516c Copy 4 pointers to avid dozends of ptr dereferences.
Originally committed as revision 13815 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-19 10:49:30 +00:00
Michael Niedermayer fc234250b4 Does not need to be int16.
Originally committed as revision 13814 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-19 10:38:20 +00:00
Michael Niedermayer cb26c9d664 Factorize I >> (c->tbls->bits - 1) out.
Originally committed as revision 13812 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-19 10:29:36 +00:00
Michael Niedermayer 73ff4f8344 1 abs() less
Originally committed as revision 13810 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-19 10:02:39 +00:00
Michael Niedermayer 4714776b6a simplify
Originally committed as revision 13807 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-18 21:09:36 +00:00
Michael Niedermayer 673a64b89b useless ()
Originally committed as revision 13806 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-18 21:05:07 +00:00
Michael Niedermayer 428c82cbac remove unneeded tr == 0
Originally committed as revision 13805 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-18 21:00:44 +00:00
Michael Niedermayer e079a1c94f simplify
Originally committed as revision 13804 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-18 20:54:21 +00:00
Michael Niedermayer c79c1a01a7 Get rid of the redundant AVG726Context.
Originally committed as revision 13803 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-18 20:51:12 +00:00
Michael Niedermayer ef4c5c6dba Remove the truncated bitstream handling from our g726 decoder.
The stuff belongs in a parser.

Originally committed as revision 13802 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-18 19:18:32 +00:00
Michael Niedermayer a0e5830ac5 Change iquant tables to int16.
Originally committed as revision 13798 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-17 14:03:00 +00:00
Michael Niedermayer 6aa37bcf19 simplify
Originally committed as revision 13797 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-17 13:46:59 +00:00
Michael Niedermayer cf409a6fec Get rid of useless wrapper function.
Originally committed as revision 13796 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-17 13:40:40 +00:00
Michael Niedermayer 170efe1f9d Do not inline g726_iterate() the function is big so its inlining will
not help speedwise IMHO.
.o size changes from 70k -> 49k

Originally committed as revision 13793 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-17 00:09:42 +00:00
Michael Niedermayer aeaa7c3d00 Replace i2f(0) by the actual thing done, gcc is not an optimizing compiler.
a little over 1kb smaller .o

Originally committed as revision 13792 to svn://svn.ffmpeg.org/ffmpeg/trunk
2008-06-16 23:57:12 +00:00