Commit Graph

1252 Commits

Author SHA1 Message Date
Nicolas George a75b5a89d1 Introduce av_realloc_f.
av_realloc_f helps avoiding memory-leaks in typical uses of realloc.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5cd754bca2)
2011-10-01 20:48:59 +02:00
Nicolas George 651e21f584 Introduce av_size_mult.
av_size_mult helps checking for overflow when computing the size of a memory
area.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b2600509fe)
2011-10-01 20:48:53 +02:00
Laurent Aimar 5681d74aaf Add av_calloc() helper.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ccecab4a0d)
2011-10-01 20:25:28 +02:00
Michael Niedermayer ec7f0b527c Merge remote-tracking branch 'khirnov/release/0.7' into release/0.8
* khirnov/release/0.7: (64 commits)
  rv34: Check for invalid slice offsets
  rv34: Fix potential overreads
  rv34: Avoid NULL dereference on corrupted bitstream
  rv10: Reject slices that does not have the same type as the first one
  lavf: Fix context pointer in av_open_input_stream when avformat_open_input fails
  oggdec: fix out of bound write in the ogg demuxer
  Fixed size given to init_get_bits().
  smacker: fix a few off by 1 errors
  Check for invalid VLC value in smacker decoder.
  Check and propagate errors when VLC trees cannot be built in smacker decoder.
  Fixed off by one packet size allocation in the smacker demuxer.
  Check for invalid packet size in the smacker demuxer.
  ape demuxer: fix segfault on memory allocation failure.
  xan: Add some buffer checks (cherry picked from commit 0872bb23b4)
  Fixed size given to init_get_bits() in xan decoder. (cherry picked from commit 393d5031c6)
  smacker demuxer: handle possible av_realloc() failure.
  Fixed segfault with wavpack decoder on corrupted decorrelation terms sub-blocks.
  cljr: init_get_bits size in bits instead of bytes (cherry picked from commit 0c1f5b93d9)
  indeo2: fail if input buffer too small (cherry picked from commit b7ce4f1d1c)
  indeo2: init_get_bits size in bits instead of bytes (cherry picked from commit 68ca330cbd)
  ...

Conflicts:
	ffmpeg.c
	libavdevice/alsa-audio.h
	libavformat/gxf.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-22 01:10:24 +02:00
Anton Khirnov de33e8675c AVOptions: fix av_set_string3() doxy to match reality.
Fixes bug 28.
(cherry picked from commit e955a682e1)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-11 13:09:35 +02:00
Sean McGovern fe9dae6df8 cpu detection: avoid a signed overflow
1<<31 overflows because 1 is signed, so force it to unsigned.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 5938e02185)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-11 13:09:35 +02:00
Oskar Arvidsson dc3ab8ca43 pix_fmt: Fix number of bits per component in yuv444p9be
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit e59d6b4d72)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-11 12:33:25 +02:00
Ronald S. Bultje 2649439bbd eval: fix memleak.
(cherry picked from commit fe277b16f0)

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-11 12:24:55 +02:00
Michael Niedermayer 095946afa7 Merge remote-tracking branch 'qatar/release/0.7' into release/0.8
* qatar/release/0.7: (65 commits)
  riff: Add mpgv MPEG-2 fourcc
  Update Changelog
  matroskadec: fix integer underflow if header length < probe length.
  ffmpeg: fix operation with --disable-avfilter
  vf_libopencv: replace opencv/cxtypes.h #include by opencv/cxcore.h
  build: Create mlib optimization directories during out-of-tree builds.
  changelog: misc typo and wording fixes (cherry picked from commit b047941d7d)
  doc: Remove outdated comments about gcc 2.95 and gcc 3.3 support. (cherry picked from commit 5ccbf80963)
  matroskadec: matroska_read_seek after after EBML_STOP leads to failure.
  Update RELEASE file
  update Changelog
  mt: proper locking around release_buffer calls.
  vp8/mt: flush worker thread, not application thread context, on seek.
  docs: Mention the upstream bugzilla url about the dlltool vs MSVC issue
  docs: Use proper markup for a literal command line option
  docs: Don't recommend adding --enable-memalign-hack
  docs: Remove needless configure options
  oggdec: prevent heap corruption.
  oggdec: Abort Ogg header parsing when encountering a data packet.
  Add LGPL license boilerplate to files lacking it.
  ...

Conflicts:
	Changelog
	configure
	doc/developer.texi
	libavcodec/libvpxenc.c
	libavcodec/rawdec.c
	libavfilter/x86/gradfun.c
	libavformat/Makefile
	libavformat/isom.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-07-26 00:14:04 +02:00
Reinhard Tartler f95e5225fe doxygen: Drop array size declarations from Doxygen parameter names.
Adding [] to a Doxygen parameter name clashes with Doxygen syntax.
(cherry picked from commit ff993cd7fc)
2011-07-03 19:58:33 +02:00
Reinhard Tartler 093f0f13e6 doxygen: fix usage of @file directive in libavutil/{dict,file}.h
(cherry picked from commit 134557f3a4)
2011-07-03 19:58:29 +02:00
Reinhard Tartler 2fe47b21c8 doxygen: Prefer member groups over grouping into modules
Before this, almost all module groups have been used for grouping functions
and fields in structures semantically. This causes them to not appear
properly in the file documentation and needlessly clutters up the "Modules"
index.

Additionally, this commit streamlines some spelling and appearances.
(cherry picked from commit 21a19b7912)
2011-07-03 19:49:53 +02:00
Martin Matuska d052370c1e pict_type: add a value for unknown/none.
In commit bebe72f4a0, the enum AV_PICTURE_TYPE_* was introduced. There are still places in the code where pict_type is used as an integer and there is a case where "pict_type = 0" with the explanation "let ffmpeg decide what to do". The new enum does not know a value of 0 and C++ will fail if compiling such programs anyway as it is refered as an int (and you cannot patch them properly).
(cherry picked from commit 5129336714)
2011-06-28 13:42:02 +02:00
Clément Bœsch 4a34e54b0e Fix zero-length gnu_printf format string warning.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-21 21:41:28 +02:00
Michael Niedermayer 940a55ccf4 eval: Fix 32bit unsigned parsing
Fixes ticket264

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-20 01:58:18 +02:00
Stefano Sabatini 141f03541b opt: do not crash in av_set_options_string() if opts == NULL
Add missing NULL check, and update documentation accordingly.
2011-06-19 19:13:05 +02:00
Michael Niedermayer 2905e3ff64 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavc: add opt_find to AVCodecContext class.
  h264: Complexify frame num gap shortening code
  intreadwrite.h: fix AV_RL32/AV_RB32 signedness.
  Fix decoding of mpegts streams with h264 video that does *NOT* have b frames
  Add minor bumps and APIChanges entries for lavf private options.
  ffmpeg: deprecate -vc and -tvstd
  ffmpeg: use new avformat_open_* API.
  ffserver: use new avformat_open_* API.
  ffprobe: use new avformat_open_* API.
  ffplay: use new avformat_open_* API.
  cmdutils: add opt_default2().
  dict: add AV_DICT_APPEND flag.
  lavf: add avformat_write_header() as a replacement for av_write_header().
  Deprecate av_open_input_* and remove their uses.
  lavf: add avformat_open_input() as a replacement for av_open_input_*
  AVOptions: add av_opt_find() as a replacement for av_find_opt.
  AVOptions: add av_opt_set_dict() mapping a dictionary struct to a context.
  ffmpeg: don't abuse a global for passing frame size from input to output
  ffmpeg: don't abuse a global for passing pixel format from input to output
  ffmpeg: initialise encoders earlier.

Conflicts:
	cmdutils.c
	doc/APIchanges
	ffmpeg.c
	ffplay.c
	ffprobe.c
	libavcodec/h264.c
	libavformat/avformat.h
	libavformat/utils.c
	libavformat/version.h
	libavutil/avutil.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-18 05:10:38 +02:00
Uoti Urpala c98b928fa7 intreadwrite.h: fix AV_RL32/AV_RB32 signedness.
The output type of the AV_RL32/AV_RB32 macros was signed int. The
resulting overflow broke at least some ASF streams with large
timestamps. Fix by adding a cast to uint32_t.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-06-16 20:49:19 +02:00
Anton Khirnov 7c44d716e7 Add minor bumps and APIChanges entries for lavf private options. 2011-06-16 20:24:58 +02:00
Anton Khirnov 1b9b37b8a4 dict: add AV_DICT_APPEND flag. 2011-06-16 20:24:56 +02:00
Anton Khirnov dc59ec5e79 AVOptions: add av_opt_find() as a replacement for av_find_opt. 2011-06-16 20:24:56 +02:00
Anton Khirnov 7e83e1c511 AVOptions: add av_opt_set_dict() mapping a dictionary struct to a context.
This way the caller can pass all the options in one nice package.
2011-06-16 20:24:56 +02:00
Michael Niedermayer 45fb647495 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  bitstream: Properly promote av_reverse values before shifting.
  libavutil/swscale: YUV444P10/YUV444P9 support.
  H.264: Fix high bit depth explicit biweight
  h264: Fix 10-bit H.264 x86 chroma v loopfilter asm.
  Replace DEBUG_SEEK/DEBUG_SI + av_log combinations by av_dlog.
  Update copyright year for ac3enc_opts_template.c.
  adts: Adjust frame size mask to follow the specification.
  movenc: Add RTP muxer/hinter options
  movenc: Pass the RTP AVFormatContext to the SDP generation
  rtspenc: Add RTP muxer options
  rtspenc: Add an AVClass for setting muxer specific options
  rtpenc_chain: Pass the rtpflags options through to the chained muxer
  rtpenc: Declare the rtp flags private AVOptions in rtpenc.h
  sdp: Reindent after the previous commit
  rtpenc: MP4A-LATM payload support
  avoptions: Add an av_opt_flag_is_set function for inspecting flag fields
  sdp: Allow passing an AVFormatContext to the SDP generation
  mov: Fix wrong timestamp generation for fragmented movies that have time offset caused by the first edit list entry.
  mpeg12: more advanced ffmpeg mpeg2 aspect guessing code.
  swscale: split YUYV output out of yuv2packed[12X]_c().

Conflicts:
	doc/APIchanges
	libavcodec/Makefile
	libavcodec/h264dsp_template.c
	libavcodec/mpeg12.c
	libavformat/aacdec.c
	libavformat/avidec.c
	libavformat/internal.h
	libavformat/movenc.c
	libavformat/rtpenc.c
	libavformat/rtpenc_latm.c
	libavformat/sdp.c
	libavformat/version.h
	libavutil/avutil.h
	libavutil/pixfmt.h
	libswscale/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-11 03:51:36 +02:00
Michael Niedermayer 0fd82fedc9 pixfmt: Replace 9/10bit deprecation by a technical explanation.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-10 21:46:51 +02:00
Ronald S. Bultje 103278f7b0 libavutil/swscale: YUV444P10/YUV444P9 support.
Also add missing glue code for recently added YUV422P10 formats
to swscale.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-06-10 15:12:24 -04:00
Martin Storsjö cb7c11cc9e avoptions: Add an av_opt_flag_is_set function for inspecting flag fields
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-06-10 10:47:42 +03:00
Michael Niedermayer 6a137dde3e dict: This code was developed in ffmpeg and not libav, nor by libav developers.
Correct copyright notices.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-10 00:19:25 +02:00
Michael Niedermayer f9ecb849ef Merge remote-tracking branch 'qatar/master'
* qatar/master:
  crypto: Use av_freep instead of av_free
  lavf: don't try to free private options if priv_data is NULL.
  swscale: fix types of assembly arguments.
  swscale: move two macros that are only used once into caller.
  swscale: remove unused function.
  options: Add missing braces around struct initializer.
  mov: Remove leftover crufty debug statement with references to a local file.
  dvbsubdec: Fix compilation of debug code.
  Remove all uses of now deprecated metadata functions.
  Move metadata API from lavf to lavu.

Conflicts:
	doc/APIchanges
	libavformat/aiffdec.c
	libavformat/asfdec.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/cafdec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/mp3enc.c
	libavformat/wtv.c
	libavutil/avutil.h
	libavutil/internal.h
	libswscale/swscale.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-09 04:47:19 +02:00
Anton Khirnov d9f80ea2a7 Move metadata API from lavf to lavu.
Rename it to AVDictionary, since it will be used as such.  Tags
documentation and metadata conversion API is lavf-specific, so remains
there.
2011-06-08 07:43:45 +02:00
Michael Niedermayer d552f616a2 Merge remote-tracking branch 'qatar/master'
* qatar/master: (28 commits)
  Remove some non-compiling debug messages.
  ffplay: Fix non-compiling debug printf and replace it by av_dlog.
  H264: x86 predict init cosmetics.
  ac3enc: Fix linking of AC-3 encoder without the E-AC-3 encoder.
  Move E-AC-3 encoder functions to a separate eac3enc.c file.
  ac3enc: remove convenience macro, #define DEBUG
  ac3enc: remove unused #define
  vc1: re-initialize tables after width/height change.
  APIchanges: fill-in git commit hash for av_get_bytes_per_sample() addition
  samplefmt: add av_get_bytes_per_sample()
  iirfilter: fix biquad filter coefficients.
  swscale: remove duplicate conversion routine in swScale().
  swscale: add yuv2planar/packed function typedefs.
  swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers.
  swscale: reindent x86 init code.
  swscale: extract SWS_FULL_CHR_H_INT conditional into init code.
  swscale: cosmetics.
  swscale: remove alp/chr/lumSrcOffset.
  swscale: un-special-case yuv2yuvX16_c().
  shorten: Remove stray DEBUG #define and corresponding av_dlog statement.
  ...

Conflicts:
	doc/APIchanges
	libavcodec/ac3enc.c
	libavutil/avutil.h
	libavutil/samplefmt.c
	libswscale/swscale.c
	libswscale/swscale_internal.h
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-08 05:25:28 +02:00
Stefano Sabatini a6703faa15 samplefmt: add av_get_bytes_per_sample()
Deprecate av_get_bits_per_sample_fmt(), which was a misnamed function.

For the moment we don't have sample formats with a non-integer number
of bytes, in that case we may need to create a new
av_get_bits_per_sample() function. In the meanwhile we prefer to adopt
this variant, since avoids divisions by 8 all over the place.
2011-06-07 13:06:41 -04:00
Diego Biurrun e01bb264e7 inverse.c: Replace unnecessary intmath.h header by necessary stdint.h. 2011-06-07 10:31:26 +02:00
Diego Biurrun dc25d79f49 Drop unnecessary directory prefixes from #include directives. 2011-06-07 10:31:26 +02:00
Michael Niedermayer a39bd458a0 mem: Trying to workaround posix_memalign() bug on OSX
This patch is based on a patch by John Stebbins

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-07 03:17:42 +02:00
Stefano Sabatini d58ed64a89 eval: add support for pow() function
It is a more search-friendly alternative to the ^ operator.
2011-06-07 00:37:00 +02:00
Stefano Sabatini 263f57c6d7 pixdesc: remove duplicated header inclusion 2011-06-06 11:34:45 +02:00
Stefano Sabatini 0bc2cca12f samplefmt: switch nb_channels/nb_samples params order in av_samples_alloc()
This is consistent with the order of parameters in
av_samples_fill_arrays().
2011-06-06 10:12:46 +02:00
Stefano Sabatini e1c7414812 samplefmt: change layout for arrays created by av_samples_alloc() and _fill_arrays()
The new layout is consistent with that of the av_image_() API, and
simplifies understanding and copy operations, it also preserves
alignment information which was lost with the previous layout.

This breaks API/ABI, but since the function was never referenced in
the code (and it isn't unlikely already used by someone) then this
should not be a problem.
2011-06-06 10:11:48 +02:00
Michael Niedermayer f9569249c2 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Remove some unused scripts from tools/.
  Add x86 assembly for some 10-bit H.264 intra predict functions.
  v4l2: do not force NTSC as standard
  Skip tableprint.h during 'make checkheaders'.
  Remove unnecessary LIBAVFORMAT_BUILD #ifdef.
  Drop explicit filenames from @file Doxygen tags.
  Skip generated table headers during 'make checkheaders'.
  lavf,lavc: free avoptions in a generic way.
  AVOptions: add av_opt_free convenience function.
  tableprint: Restore mistakenly deleted common.h #include for FF_ARRAY_ELEMS.
  tiff: print log in case of unknown / unsupported tag.
  tiff: fix linesize for mono-white/black formats.
  Fix build of eval-test program
  configure: Document --enable-vaapi
  ac3enc: extract all exponents for the frame at once

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-06 03:33:58 +02:00
Diego Biurrun fb8648ad4b Remove unnecessary LIBAVFORMAT_BUILD #ifdef. 2011-06-05 16:01:01 +02:00
Anton Khirnov b39b06233d AVOptions: add av_opt_free convenience function. 2011-06-05 15:01:36 +02:00
Mans Rullgard 5a4a71257c Fix build of eval-test program
eval.c has moved to libavutil, move the TESTPROGS entry too.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-05 11:47:14 +01:00
Mans Rullgard d0989bed22 Fix error check in av_file_map()
On failure, mmap() returns MAP_FAILED, which may or may not be -1.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-06-04 17:03:25 +01:00
Michael Niedermayer 5ad38d93e8 cpudetect: add av_force_cpu_flags()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-06-02 21:03:54 +02:00
Michael Niedermayer 40c29d42cf Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swscale: Remove unused variable.
  ARM: simplify inline asm with 64-bit operands

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-31 02:08:20 +02:00
Mans Rullgard 6bb70dfd74 ARM: simplify inline asm with 64-bit operands
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-30 21:19:57 +01:00
Michael Niedermayer 2c10ee2358 error.c: fix compile flags
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-30 03:11:54 +02:00
Michael Niedermayer b8a43bc1b5 Merge remote-tracking branch 'qatar/master' into master
* qatar/master: (27 commits)
  ac3enc: fix LOCAL_ALIGNED usage in count_mantissa_bits()
  ac3dsp: do not use the ff_* prefix when referencing ff_ac3_bap_bits.
  ac3dsp: fix loop condition in ac3_update_bap_counts_c()
  ARM: unbreak build
  ac3enc: modify mantissa bit counting to keep bap counts for all values of bap instead of just 0 to 4.
  ac3enc: split mantissa bit counting into a separate function.
  ac3enc: store per-block/channel bap pointers by reference block in a 2D array rather than in the AC3Block struct.
  get_bits: add av_unused tag to cache variable
  sws: replace all long with int.
  ARM: aacdec: fix constraints on inline asm
  ARM: remove unnecessary volatile from inline asm
  ARM: add "cc" clobbers to inline asm where needed
  ARM: improve FASTDIV asm
  ac3enc: use LOCAL_ALIGNED macro
  APIchanges: fill in git hash for av_get_pix_fmt_name (0420bd7).
  lavu: add av_get_pix_fmt_name() convenience function
  cmdutils: remove OPT_FUNC2
  swscale: fix crash in bilinear scaling.
  vpxenc: add VP8E_SET_STATIC_THRESHOLD mapping
  webm: support stereo videos in matroska/webm muxer
  ...

Conflicts:
	Changelog
	cmdutils.c
	cmdutils.h
	doc/APIchanges
	doc/muxers.texi
	ffmpeg.c
	ffplay.c
	libavcodec/ac3enc.c
	libavcodec/ac3enc_float.c
	libavcodec/avcodec.h
	libavcodec/get_bits.h
	libavcodec/libvpxenc.c
	libavcodec/version.h
	libavdevice/libdc1394.c
	libavformat/matroskaenc.c
	libavutil/avutil.h
	libswscale/rgb2rgb.c
	libswscale/swscale.c
	libswscale/swscale_template.c
	libswscale/x86/swscale_template.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-29 03:34:35 +02:00
Stefano Sabatini e71f26086a lavu: add av_get_pix_fmt_name() convenience function
Also deprecate avcodec_get_pix_fmt_name() in its favor.
2011-05-28 18:25:40 +02:00
Mans Rullgard a84f82560e ARM: improve FASTDIV asm
This uses one register less.  Also add missing "cc" clobber.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-28 15:00:17 +01:00