Commit Graph

21008 Commits

Author SHA1 Message Date
Michael Niedermayer 0fa26bd470 utvideoenc: fix theoretical integer overflow
The image sizes needed for this overflow to happen are currently not
supported in lavc, thus this should have no effect execpt making the
code more robust in light of future changes.

Fixes CID732245
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 18:57:57 +02:00
Michael Niedermayer d86ef54476 avcodec_align_dimensions2: add missing breaks
This should have just cosmetic effects

Fixes CID603265
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 18:50:09 +02:00
Ash Hughes 2470851f12 lavc: enable recursively using avcodec_open2/close.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 18:05:12 +02:00
Michael Niedermayer c5fd9d3c35 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  fate: Add proper dependencies in qt.mak
  fate: Add proper dependencies in lossless-video.mak
  indeo3: do not try to output more lines than we can fit
  bmv: get a new frame on every decode_frame(), so we can use direct rendering

Conflicts:
	libavcodec/bmv.c
	tests/fate/lossless-video.mak
	tests/fate/qt.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 14:15:47 +02:00
Michael Niedermayer 81ff0c24ef Merge commit '1cd432e167b1a80853760c89a33606e2b5f229c2'
* commit '1cd432e167b1a80853760c89a33606e2b5f229c2':
  configure: fix libcdio check
  rtsp: Allow setting the reordering buffer size via an AVOption
  rtsp: Vertically align a constant definition
  rtp: Update the check for distinguishing between RTP and RTCP
  aac: fix build with hardcoded tables
  fate: dependencies for screen codec tests
  riff: Move functions around to be covered by appropriate #ifdefs

Conflicts:
	configure
	tests/fate/screen.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 13:58:14 +02:00
Michael Niedermayer b0554fec04 Merge commit 'c0329748b04e1f175dad8c9c2ebf22a5e2dc5b72'
* commit 'c0329748b04e1f175dad8c9c2ebf22a5e2dc5b72':
  fate: add a dependency helper macro
  Add support for building shared libraries with MSVC
  avcodec: Rename avpriv_frame_rate_tab to ff_mpeg12_frame_rate_tab
  gxf: Add a local copy of the relevant parts of the frame rate table
  configure: Split out msvc as a separate target OS
  aviobuf: Remove a senseless ifdef in avio_seek

Conflicts:
	configure
	libavcodec/dirac.c
	libavcodec/mpeg12data.h
	libavcodec/mpeg12enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 13:29:24 +02:00
Kostya Shishkov 169514c440 indeo3: do not try to output more lines than we can fit
Internally chroma planes have multiple of four height while allocated image
planes might be smaller if CODEC_FLAG_EMU_EDGE is set. Thus we should not
output more lines of chroma than frame can accept.

Also the decoder can be safely switched to direct rendering now.
2012-10-19 07:58:51 +02:00
Kostya Shishkov 8774d58358 bmv: get a new frame on every decode_frame(), so we can use direct rendering 2012-10-19 07:58:51 +02:00
Michael Niedermayer d50aa006fb tiffenc: fix integer overflow
Fixes CID700699
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 03:36:42 +02:00
Michael Niedermayer a06f943f9d roqvideodec: replace dead code by assert
Fixes CID732195
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 03:15:06 +02:00
Michael Niedermayer c0b17ea106 roqaudioenc: Fix crash with very small roq files
Fixes CID703669
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 02:57:57 +02:00
Paul B Mahol 4ebf305951 lavc/tta: do not overwrite bits_per_coded_sample
It is supposed to be set in libavformat only.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-19 00:08:02 +00:00
Paul B Mahol 445f36d7c8 kmvc: use meaningful error codes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-19 00:08:02 +00:00
Paul B Mahol be536f084a xxan: return more meaningful error codes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-19 00:08:01 +00:00
Paul B Mahol 0bf40e0ef4 lavc/yop: remove redudant YOP in av_log() messages
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-19 00:08:01 +00:00
Paul B Mahol 4c6c6a266e jvdec: use more meaningful error code
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-19 00:08:01 +00:00
Paul B Mahol 527224830a idcinvideo: if decoding fails return error
Previously if frame decoding failed it would be
silently reported as valid frame.

The fate ref is updated because sample have
truncated last video packet.

While here return meaningful error codes.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-19 00:08:01 +00:00
Paul B Mahol aadb7b3ac4 lavc/c93: use meaningful error codes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-19 00:08:01 +00:00
Michael Niedermayer 05b0337025 motionpixels/mp_decode_frame_helper: assert that the first pixel doesnt reuse the last.
reusing the last would use uninitialized data, this should be
impossible currently, but better to check by assert.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 01:20:27 +02:00
Michael Niedermayer df727d408c mlp_parser: print error when ff_combine_frame() fails to add the current buffer
Fixes part of CID602338
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-19 00:05:03 +02:00
Clément Bœsch e807a2b648 lavc: add raw text subtitles decoder. 2012-10-18 22:51:44 +02:00
Michael Niedermayer c753b56b4d ff_convert_matrix: fix integer overflow
Fixes CID608053
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-18 21:51:04 +02:00
Michael Niedermayer 5537c92f84 mpegvideoenc: check return value of ff_MPV_frame_start()
Fixes CID703622
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-18 21:42:31 +02:00
Michael Niedermayer 2472f3facb lzwenc: change assert to av_assert
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-18 21:42:04 +02:00
Michael Niedermayer 97d1cb5cd4 bmv: remove unreachable default case
Fixes CID732191
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-18 21:13:28 +02:00
Mans Rullgard 7a12d97eb1 aac: fix build with hardcoded tables
aac_tablegen.h includes aac.h for the POW_SF2_ZERO definition, but
this also pulls in a raft of other headers, some of which are not
safe to use in code built with the host compiler.

Moving POW_SF2_ZERO to aac_tablegen_decl.h, where the declaration
of the array it relates to already resides, fixes the problems.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-18 19:59:43 +01:00
Michael Niedermayer 23b203014f indeo4: prevent printing uninitialized variable
Fixes CID703822
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-18 20:41:51 +02:00
Michael Niedermayer 2b1a2466c7 dv: change assert(a2 < 4) to av_assert()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-18 20:29:03 +02:00
Martin Storsjö d66c52c2b3 Add support for building shared libraries with MSVC
This requires the makedef perl script by Derek, from the
c89-to-c99 repo. That scripts produces a .def file, listing
the symbols to be exported, based on the gcc version scripts
and the built object files.

To properly load non-function symbols from DLL files, the
data symbol declarations need to have the attribute
__declspec(dllimport) when building the calling code. (On mingw,
the linker can fix this up automatically, which is why it has not
been an issue so far. If this attribute is omitted, linking
actually succeeds, but reads from the table will not produce the
desired results at runtime.)

MSVC seems to manage to link DLLs (and run properly) even if
this attribute is present while building the library itself
(which normally isn't recommended) - other object files in the
same library manage to link to the symbol (with a small warning
at link time, like "warning LNK4049: locally defined symbol
_avpriv_mpa_bitrate_tab imported" - it doesn't seem to be possible
to squelch this warning), and the definition of the tables
themselves produce a warning that can be squelched ("warning C4273:
'avpriv_mpa_bitrate_tab' : inconsistent dll linkage, see previous
definition of 'avpriv_mpa_bitrate_tab').

In this setup, mingw isn't able to link object files that refer to
data symbols with __declspec(dllimport) without those symbols
actually being linked via a DLL (linking avcodec.dll ends up with
errors like "undefined reference to `__imp__avpriv_mpa_freq_tab'").
The dllimport declspec isn't needed at all in mingw, so we simply
choose not to declare it for other compilers than MSVC that requires
it. (If ICL support later requires it, the condition can be extended
later to include both of them.)

This also implies that code that is built to link to a certain
library as a DLL can't link to the same library as a static library.
Therefore, we only allow building either static or shared but not
both at the same time. (That is, static libraries as such can be,
and actually are, built - this is used for linking the test tools to
internal symbols in the libraries - but e.g. libavformat built to
link to libavcodec as a DLL cannot link statically to libavcodec.)

Also, linking to DLLs is slightly different from linking to shared
libraries on other platforms. DLLs use a thing called import
libraries, which is basically a stub library allowing the linker
to know which symbols exist in the DLL and what name the DLL will
have at runtime.

In mingw/gcc, the import library is usually named libfoo.dll.a,
which goes next to a static library named libfoo.a. This allows
gcc to pick the dynamic one, if available, from the normal -lfoo
switches, just as it does for libfoo.a vs libfoo.so on Unix. On
MSVC however, you need to literally specify the name of the import
library instead of the static library.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 14:26:15 +03:00
Martin Storsjö eaa9b2e66c avcodec: Rename avpriv_frame_rate_tab to ff_mpeg12_frame_rate_tab
This table doesn't need to be shared with libavformat any longer.
Add mpeg12 to the name to make it less ambiguous, while renaming it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-18 14:26:14 +03:00
Michael Niedermayer 3777e6b3bf Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mips64: mark hi/lo registers clobbered in MAC64/MLS64 macros
  fate: list lavfi tests in a makefile

Conflicts:
	configure
	tests/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-18 12:16:08 +02:00
Michael Niedermayer 17e4b0644b Merge commit '292d1e78743855404c7d07e3e7cb3f9c9ae6275b'
* commit '292d1e78743855404c7d07e3e7cb3f9c9ae6275b':
  fate: dependencies for acodec tests
  fate: dependencies for vsynth tests
  fate: add macros useful for conditionally enabling things
  libmp3lame: resize the output buffer if needed

Conflicts:
	tests/fate/acodec.mak
	tests/fate/vcodec.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-18 10:48:00 +02:00
Mans Rullgard b93e934aee mips64: mark hi/lo registers clobbered in MAC64/MLS64 macros
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-17 22:37:12 +01:00
Michael Niedermayer d185c8a79b tiff: run strlen() after setting the pointer
Fixes CID733803
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 20:58:08 +02:00
Paul B Mahol 9b762e2cba idcinvideo: remove redundant " id CIN Video: " from av_log()
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-17 14:09:47 +00:00
Justin Ruggles abd8b9e7e0 libmp3lame: resize the output buffer if needed
The LAME API documentation for the required buffer size refers to the size for
a single encode call. However, we store multiple frames in the same output
buffer but only read 1 frame at a time out of it. As a result, the buffer size
given in lame_encode_buffer() is actually smaller than what it should be.
Since we do not know how many frames it will end up buffering, it is best to
just reallocate if needed.
2012-10-17 09:59:13 -04:00
Michael Niedermayer d6e87190fd Merge commit 'a25d912dca9cd553440167e0476c47581359c0fc'
* commit 'a25d912dca9cd553440167e0476c47581359c0fc':
  avcodec_encode_audio(): fix invalid free
  pcm-mpeg: correct bitrate calculation
  ffv1: K&R formatting cosmetics
  fate: Add rangecoder test
  network: #include stdint.h in network.h
  nut: export codec_tag provided by rawvideo
  avserver: move avserver-specific code from ffmdec.c to avserver.c

Conflicts:
	ffserver.c
	libavcodec/ffv1.c
	libavformat/ffmdec.c
	libavformat/nutenc.c
	tests/ref/lavfi/crop
	tests/ref/lavfi/crop_scale
	tests/ref/lavfi/crop_scale_vflip
	tests/ref/lavfi/crop_vflip
	tests/ref/lavfi/null
	tests/ref/lavfi/pixdesc
	tests/ref/lavfi/pixfmts_copy
	tests/ref/lavfi/pixfmts_crop
	tests/ref/lavfi/pixfmts_hflip
	tests/ref/lavfi/pixfmts_null
	tests/ref/lavfi/pixfmts_pad
	tests/ref/lavfi/pixfmts_scale
	tests/ref/lavfi/pixfmts_vflip
	tests/ref/lavfi/scale200
	tests/ref/lavfi/scale500
	tests/ref/lavfi/vflip
	tests/ref/lavfi/vflip_crop
	tests/ref/lavfi/vflip_vflip

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 14:17:55 +02:00
Paul B Mahol 1ade37ae9c lavc/tta: use meaningful error codes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2012-10-17 12:11:34 +00:00
Michael Niedermayer 4e2e3d943e ffv1: fix packed rgb with 1.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-17 03:19:11 +02:00
Rafaël Carré a25d912dca avcodec_encode_audio(): fix invalid free
Since 2bc0de385, AVFrame needs to be initialized
before calling avcodec_get_frame_defaults().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2012-10-16 18:49:31 +02:00
Christian Schmidt 4a7429203a pcm-mpeg: correct bitrate calculation
Bitrate calculation is off since the bluray spec always specifies
an even number of coded channels. This was honored in the decoder,
but not for bitrate calculation.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-10-16 16:03:03 +02:00
Luca Barbato 9a978b334b ffv1: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-10-16 15:45:55 +02:00
Michael Niedermayer 83962004f7 Merge commit '3dc06b6972cf389269e9c36ff0a4373f80f7149b'
* commit '3dc06b6972cf389269e9c36ff0a4373f80f7149b':
  tiny_psnr: check for specified sample size less than 1
  fate: improve md5sum utility selection
  rangecoder-test: Drop timer output that clutters stderr

Conflicts:
	tests/tiny_psnr.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16 14:04:14 +02:00
Michael Niedermayer 5717562c78 Merge commit 'c1fcfdec75468009dc7de29a5d1c6adf3b2ef77d'
* commit 'c1fcfdec75468009dc7de29a5d1c6adf3b2ef77d':
  rangecoder-test: Return in case of an error
  build: simplify enabling of compat objects

Conflicts:
	configure
	libavutil/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16 13:57:10 +02:00
Michael Niedermayer 9c669672c7 x86/motion_est: widen before multiply.
This fixes CID700558, CID700557, CID700556
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16 03:09:28 +02:00
Michael Niedermayer 1fe45903b8 msvideo1enc: fix interframe encoding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-16 02:22:27 +02:00
Michael Niedermayer f5581266f7 ra288: assert order to be withinn supported range in do_hybrid_window()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-15 23:55:54 +02:00
Michael Niedermayer db3a0aae9f msvideo1enc: fix initial keyframe value
keyframe was never set to anything but 1

Fixes CID733730
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-15 23:52:08 +02:00
Diego Biurrun f1be514540 rangecoder-test: Drop timer output that clutters stderr 2012-10-15 21:16:36 +02:00
Diego Biurrun c1fcfdec75 rangecoder-test: Return in case of an error 2012-10-15 21:15:17 +02:00