Commit Graph

156 Commits

Author SHA1 Message Date
Paul B Mahol dd59f0125d add some planar PCM encoders
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-11-20 17:29:00 +00:00
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>
2012-11-20 17:28:36 +00:00
Paul B Mahol 00e02366a5 pcmenc: use ENCODE macro for pcm_s8
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-11-20 13:18:56 +00:00
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>
2012-11-20 14:04:38 +01:00
Michael Niedermayer 70c0f13a9a Merge commit '7c278d2ae410a64bdd89f1777026b4b963c30a1a'
* commit '7c278d2ae410a64bdd89f1777026b4b963c30a1a':
  alacenc: support 24-bit encoding
  pcmdec: use planar sample format for pcm_s16le_planar
  vorbisdec: use float planar sample format

Conflicts:
	libavcodec/pcm.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-20 13:34:27 +01:00
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>
2012-11-20 11:36:28 +00:00
Justin Ruggles c9d0f4506f pcmdec: use planar sample format for pcm_s16le_planar 2012-11-19 23:48:37 -05:00
Paul B Mahol 0df7d95a5e pcmenc: remove dead increment
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-11-18 21:12:25 +00:00
Paul B Mahol 6557c46d91 pcm: move i into for loop to avoid { } inside switch statement
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-11-18 20:45:03 +00:00
Paul B Mahol 9ba41ae63e PCM signed 16-bit big-endian planar decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-11-17 19:30:08 +00:00
Paul B Mahol 467dfd5dfa PCM signed 24-bit/32-bit little-endian planar decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-11-17 19:09:43 +00:00
Paul B Mahol eca2eb2dfa pcm: give more descriptive name to codec
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-11-15 16:04:35 +00:00
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>
2012-11-13 21:45:53 +01:00
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>
2012-11-09 21:06:01 +01:00
Michael Niedermayer 00aa7fa786 pcm: fix handling of more than 8 channels for planar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-02 14:00:23 +01:00
Michael Niedermayer db9f426cab Merge commit '8ac0f6767bf63d3e6b308ee6648ff02598b81e03'
* commit '8ac0f6767bf63d3e6b308ee6648ff02598b81e03':
  dcadec: allow the decoder to change the channel layout mid-stream
  cook: use av_dlog() for debug logging instead of av_log() with AV_LOG_ERROR
  cook: move samples_per_frame from COOKSubpacket to where it is used
  cook: use av_get_channel_layout_nb_channels() instead of cook_count_channels()
  cook: reverse a condition so that the code makes more sense
  cook: remove unneeded COOKContext variable, sample_rate
  cook: remove unneeded COOKContext variable, bit_rate
  cook: use AVCodecContext.channels instead of keeping a private copy
  bmvaudio: set channel layout at init() rather than validating it
  atrac1: do not keep a copy of channel count in the private context
  dsicinaudio: set channels and channel layout
  g722dec: set channel layout at initialization instead of validating it
  amrwbdec: set channels, channel_layout, and sample_rate
  amrnbdec: set channels, channel_layout, and sample_rate
  dca_parser: allow the parser to change the sample rate
  lavc: check channel count after decoder init
  lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders

Conflicts:
	libavcodec/dcadec.c
	libavcodec/pcm.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-02 13:43:57 +01:00
Justin Ruggles bb6941af2a lavc: move SANE_NB_CHANNELS to internal.h and use it in the PCM decoders 2012-11-01 11:29:13 -04:00
Michael Niedermayer dcb0d1193a Merge commit '5ac673b5531d846b79a3d77e3e932e0cb1234c45'
* commit '5ac673b5531d846b79a3d77e3e932e0cb1234c45':
  atrac3: use AVCodecContext.channels instead of keeping a private copy
  atrac3: simplify some loop indexing
  atrac3: cosmetics: pretty-printing and renaming
  pcm: define AVCodec instances only for enabled codecs
  libxvid: remove useless doxy comments.
  lavc: remove stats_out from the options table.

Conflicts:
	libavcodec/atrac3.c
	libavcodec/pcm.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-23 12:36:16 +02:00
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>
2012-10-22 14:40:57 +01:00
Michael Niedermayer d6c342fdc0 Merge commit 'd5c62122a7b26704bf867a1262df358623bf5edf'
* commit 'd5c62122a7b26704bf867a1262df358623bf5edf':
  Move av_reverse table to libavcodec

Conflicts:
	libavcodec/asvenc.c
	libavcodec/vble.c
	libavutil/common.h
	libavutil/mathematics.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-13 14:35:42 +02:00
Diego Biurrun d5c62122a7 Move av_reverse table to libavcodec
It is only used in that library.
2012-10-12 20:39:18 +02:00
Michael Niedermayer eadba3e94d Merge commit 'cbcd497f384f0f8ef3f76f85b29b644b900d6b9f'
* commit 'cbcd497f384f0f8ef3f76f85b29b644b900d6b9f':
  adxdec: use planar sample format
  adpcmdec: use planar sample format for adpcm_thp
  adpcmdec: use planar sample format for adpcm_ea_xas
  adpcmdec: use planar sample format for adpcm_ea_r1/r2/r3
  adpcmdec: use planar sample format for adpcm_xa
  adpcmdec: use planar sample format for adpcm_ima_ws for vqa version 3
  adpcmdec: use planar sample format for adpcm_4xm
  adpcmdec: use planar sample format for adpcm_ima_wav
  adpcmdec: use planar sample format for adpcm_ima_qt
  pcmdec: use planar sample format for pcm_lxf
  mace: use planar sample format
  atrac1: use planar sample format
  build: non-x86: Only compile mpegvideo optimizations when necessary
  rtpdec_mpeg4: au_headers is a single array, simple av_free is enough
  avcodec: free extended_data instead address of it
  fate: Add tests of the ff_make_absolute_url function
  url: Handle relative urls starting with two slashes
  url: Handle relative urls being just a new query string
  url: Don't treat slashes in query parameters as directory separators

Conflicts:
	libavcodec/adxdec.c
	libavcodec/mips/Makefile
	libavcodec/pcm.c
	libavcodec/utils.c
	libavformat/Makefile
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-10 13:01:27 +02:00
Justin Ruggles 7e5f045039 pcmdec: use planar sample format for pcm_lxf 2012-10-09 09:03:51 -04:00
Michael Niedermayer 7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov 36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
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.
2012-06-23 00:42:51 +02:00
Michael Niedermayer de2cfb744a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  pcmenc: set correct bitrate value
  avprobe: don't print format entry name when only one was requested

Conflicts:
	ffprobe.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-05-17 23:45:00 +02:00
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>
2012-05-17 02:34:57 +01:00
Michael Niedermayer 4480edcf31 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  w32threads: Make pthread_cond_wait follow POSIX
  cosmetics: Consistently place static, inline and av_cold attributes/keywords.
  sbrdsp: Use standard multiple inclusion guards.
  pcm: K&R formatting cosmetics
  rawdec: Support fourccs YV16 and YV24
  rtmp: implement bandwidth notification
  rtmp: update supported audio codecs value

Conflicts:
	libavcodec/pcm.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-04 21:17:52 +02:00
Aneesh Dogra 6d21f49879 pcm: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-04-04 14:14:28 +02:00
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>
2012-03-23 03:09:07 +01:00
Michael Niedermayer 11e8f3e7a2 pcm: switch to ff_alloc_packet2().
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-22 19:03:21 +01:00
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>
2012-03-17 05:31:26 +01:00
Justin Ruggles a8bdf2405c check for coded_frame allocation failure in several audio encoders 2012-02-25 11:49:41 -05:00
Justin Ruggles 255ad8881d audio encoders: do not set coded_frame->key_frame.
it is already set in avcodec_alloc_frame()
2012-02-25 11:49:41 -05:00
Stefano Sabatini d21b82fd3a lavc: provide aliases to the PCM A-law/mu-law codecs
They are also known as G.711 codecs.
2012-02-07 15:48:33 +01:00
Michael Niedermayer d77294c5e4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libx264: fix indentation.
  vorbis: fix overflows in floor1[] vector and inverse db table index.
  win64: add a XMM clobber test configure option.
  movdec: Parse the dvc1 atom
  ARM: ac3: fix ac3_bit_alloc_calc_bap_armv6
  swscale: K&R formatting cosmetics for Blackfin code
  frwu: lowercase the FRWU codec name
  movdec: fix dts generation in fragmented files
  fate: make acodec-ac3_fixed test output raw AC3
  APIchanges: add missing commit hashes
  swscale: implement MMX, SSE2 and AVX functions for RGB32 input.
  ra144enc: drop pointless "encoder" from .long_name
  bethsoftvideo: fix palette reading.
  mpc7: use av_fast_padded_malloc()
  mpc7: simplify handling of packet sizes that are not a multiple of 4 bytes
  doc: decoding Forward Uncompressed is supported
  Fix a typo in the x86 asm version of ff_vector_clip_int32()
  pcmenc: Do not set avpkt->size.
  ff_alloc_packet: modify the size of the packet to match the requested size

Conflicts:
	doc/APIchanges
	libavcodec/libx264.c
	libavcodec/mpc7.c
	libavformat/isom.h
	libswscale/Makefile
	libswscale/bfin/yuv2rgb_bfin.c
	tests/ref/fate/bethsoft-vid
	tests/ref/seek/ac3_ac3

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-03 03:51:32 +01:00
Justin Ruggles 3c432631e9 pcmenc: Do not set avpkt->size.
It is already the correct size as set by ff_alloc_packet().
2012-02-01 16:33:27 -05:00
Paul B Mahol 1fa24d08b2 pcm: remove redundant assignment
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-28 22:08:20 +01:00
Paul B Mahol ae8dc203b2 pcm: check return value of avcodec_alloc_frame()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-28 22:08:20 +01:00
Michael Niedermayer 67f5650a78 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  rv34: add NEON rv34_idct_add
  rv34: 1-pass inter MB reconstruction
  add SMJPEG muxer
  avformat: split out common SMJPEG code
  pictordec: Use bytestream2 functions
  avconv: use avcodec_encode_audio2()
  pcmenc: use AVCodec.encode2()
  avcodec: bump minor version and add APIChanges for the new audio encoding API
  avcodec: Add avcodec_encode_audio2() as replacement for avcodec_encode_audio()
  avcodec: add a public function, avcodec_fill_audio_frame().
  rv34: Intra 16x16 handling
  rv34: Inter/intra MB code split

Conflicts:
	Changelog
	libavcodec/avcodec.h
	libavcodec/pictordec.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/x86/rv34dsp.asm
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-17 02:37:30 +01:00
Justin Ruggles 05f95443ca pcmenc: use AVCodec.encode2() 2012-01-15 21:24:18 -05:00
Justin Ruggles b2c75b6e63 avcodec: Add avcodec_encode_audio2() as replacement for avcodec_encode_audio()
This allows audio encoders to optionally take an AVFrame as input and write
encoded output to an AVPacket.

This also adds AVCodec.encode2() which will also be usable by video and
subtitle encoders once support is implemented in the public functions.
2012-01-15 21:24:17 -05:00
Michael Niedermayer 794006f8fe Merge remote-tracking branch 'qatar/master'
* qatar/master:
  fft: init functions with INIT_XMM/YMM.
  pcmenc: set frame_size to 0.
  gsm demuxer: use generic seeking instead of a gsm-specific function.
  gsm demuxer: return packets with only 1 gsm block at a time.
  avcodec: add GSM parser
  doc: Replace ffmpeg references in avserver config file by avconv.
  doc: Fix names of av_log color environment variables.
  Fix a bunch of platform name and other typos.
  Add some missing changelog entries and release 0.8_beta2
  No longer build libpostproc by default
  wtv: fix memleaks during normal operation
  threads: add CODEC_CAP_AUTO_THREADS for libvpx and xavs

Conflicts:
	Changelog
	RELEASE
	cmdutils.c
	configure
	doc/ffserver.conf
	doc/platform.texi
	ffplay.c
	libavcodec/Makefile
	libavcodec/version.h
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-12 01:10:32 +01:00
Justin Ruggles 56f22b7e16 pcmenc: set frame_size to 0.
This indicates that the actual frame size is based on the buf_size passed to
avcodec_encode_audio().
2012-01-11 09:09:56 -05:00
Michael Niedermayer e4de71677f Merge remote-tracking branch 'qatar/master'
* qatar/master:
  aac_latm: reconfigure decoder on audio specific config changes
  latmdec: fix audio specific config parsing
  Add avcodec_decode_audio4().
  avcodec: change number of plane pointers from 4 to 8 at next major bump.
  Update developers documentation with coding conventions.
  svq1dec: avoid undefined get_bits(0) call
  ARM: h264dsp_neon cosmetics
  ARM: make some NEON macros reusable
  Do not memcpy raw video frames when using null muxer
  fate: update asf seektest
  vp8: flush buffers on size changes.
  doc: improve general documentation for MacOSX
  asf: use packet dts as approximation of pts
  asf: do not call av_read_frame
  rtsp: Initialize the media_type_mask in the rtp guessing demuxer
  Cleaned up alacenc.c

Conflicts:
	doc/APIchanges
	doc/developer.texi
	libavcodec/8svx.c
	libavcodec/aacdec.c
	libavcodec/ac3dec.c
	libavcodec/avcodec.h
	libavcodec/nellymoserdec.c
	libavcodec/tta.c
	libavcodec/utils.c
	libavcodec/version.h
	libavcodec/wmadec.c
	libavformat/asfdec.c
	tests/ref/seek/lavf_asf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-12-03 03:00:30 +01: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
Michael Niedermayer 8e576d5830 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libavutil: add utility functions to simplify allocation of audio buffers.
  libavutil: add planar sample formats and av_sample_fmt_is_planar()
  avconv: fix segfault at EOF with delayed pictures
  pcmdec: remove unneeded resetting of samples pointer
  avconv: remove a now unused parameter from output_packet().
  avconv: formatting fixes in output_packet()
  avconv: declare some variables in blocks where they are used
  avconv: use the same behavior when decoding audio/video/subs
  bethsoftvideo: return proper consumed size for palette packets.
  cdg: skip packets that don't contain a cdg command.
  crcenc: add flags
  avconv: use vsync 0 for AVFMT_NOTIMESTAMPS formats.
  tiffenc: add a private option for selecting compression algorithm
  md5enc: add flags
  ARM: remove needless .text/.align directives

Conflicts:
	doc/APIchanges
	libavcodec/tiffenc.c
	libavutil/avutil.h
	libavutil/samplefmt.c
	libavutil/samplefmt.h
	tests/ref/fate/bethsoft-vid
	tests/ref/fate/cdgraphics
	tests/ref/fate/film-cvid-pcm-stereo-8bit
	tests/ref/fate/mpeg2-field-enc
	tests/ref/fate/nuv
	tests/ref/fate/tiertex-seq
	tests/ref/fate/tscc-32bit
	tests/ref/fate/vmnc-32bit

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-11-24 03:32:24 +01:00
Justin Ruggles c1848c4b26 pcmdec: remove unneeded resetting of samples pointer 2011-11-23 16:26:15 -05:00
Michael Niedermayer 173715d291 Merge remote-tracking branch 'qatar/master'
* qatar/master: (35 commits)
  libopencore-amr: check output buffer size before decoding
  libopencore-amr: remove unneeded buf_size==0 check.
  libopencore-amr: remove unneeded frame_count field.
  aac_latm: remove unneeded check for zero-size packet.
  pcmdec: fix output buffer size check by calculating the actual output size prior to decoding.
  pcmdec: move codec-specific variable declarations to the corresponding codec blocks.
  pcmdec: return buf_size instead of src-buf.
  avcodec: remove the Zork PCM encoder.
  pcm_zork: use AV_SAMPLE_FMT_U8 instead of shifting all samples by 8.
  pcmenc: remove unneeded sample_fmt check.
  pcmdec: move number of channels check to pcm_decode_init()
  pcmdec: remove unnecessary check for sample_fmt change
  pcmdec: move DVD PCM bits_per_coded_sample check near to the code that sets the sample size.
  pcmdec: do not needlessly set *data_size to 0
  alacdec: remove unneeded NULL or zero-size packet checks.
  alacdec: simplify buffer allocation by using FF_ALLOC_OR_GOTO()
  alacdec: ask for a sample for unsupported sample depths.
  alacdec: cosmetics: use 'ch' instead of 'chan' to iterate channels
  alacdec: move some declarations to the top of the function
  alacdec: always use get_sbits_long() for uncompressed samples
  ...

Conflicts:
	libavcodec/pcm.c
	tests/ref/acodec/pcm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-27 01:39:04 +02:00