]> git.sesse.net Git - ffmpeg/log
ffmpeg
12 years agoMerge remote-tracking branch 'qatar/master'
Michael Niedermayer [Tue, 6 Mar 2012 02:56:25 +0000 (03:56 +0100)]
Merge remote-tracking branch 'qatar/master'

* qatar/master: (31 commits)
  cdxl demux: do not create packets with uninitialized data at EOF.
  Replace computations of remaining bits with calls to get_bits_left().
  amrnb/amrwb: Remove get_bits usage.
  cosmetics: reindent
  avformat: do not require a pixel/sample format if there is no decoder
  avformat: do not fill-in audio packet duration in compute_pkt_fields()
  lavf: Use av_get_audio_frame_duration() in get_audio_frame_size()
  dca_parser: parse the sample rate and frame durations
  libspeexdec: do not set AVCodecContext.frame_size
  libopencore-amr: do not set AVCodecContext.frame_size
  alsdec: do not set AVCodecContext.frame_size
  siff: do not set AVCodecContext.frame_size
  amr demuxer: do not set AVCodecContext.frame_size.
  aiffdec: do not set AVCodecContext.frame_size
  mov: do not set AVCodecContext.frame_size
  ape: do not set AVCodecContext.frame_size.
  rdt: remove workaround for infinite loop with aac
  avformat: do not require frame_size in avformat_find_stream_info() for CELT
  avformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3
  avformat: do not require frame_size in avformat_find_stream_info() for AAC
  ...

Conflicts:
doc/APIchanges
libavcodec/Makefile
libavcodec/avcodec.h
libavcodec/h264.c
libavcodec/h264_ps.c
libavcodec/utils.c
libavcodec/version.h
libavcodec/x86/dsputil_mmx.c
libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
12 years agocdxl demux: do not create packets with uninitialized data at EOF.
Reimar Döffinger [Sun, 26 Feb 2012 22:47:41 +0000 (22:47 +0000)]
cdxl demux: do not create packets with uninitialized data at EOF.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years agolibutvideo: Add Ut Video encoder wrapper
Derek Buitenhuis [Mon, 5 Mar 2012 20:29:23 +0000 (15:29 -0500)]
libutvideo: Add Ut Video encoder wrapper

All colorspaces are supported.

Renamed libutvideo.cpp to libutvideodec.cpp.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agolibutvideo: Move structs and includes to header
Derek Buitenhuis [Sun, 4 Mar 2012 00:53:59 +0000 (19:53 -0500)]
libutvideo: Move structs and includes to header

This is so the forthcoming encoder wrapper can share
them.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoReplace computations of remaining bits with calls to get_bits_left().
Alex Converse [Mon, 5 Mar 2012 01:53:50 +0000 (17:53 -0800)]
Replace computations of remaining bits with calls to get_bits_left().

12 years agoamrnb/amrwb: Remove get_bits usage.
Alex Converse [Mon, 5 Mar 2012 01:24:38 +0000 (17:24 -0800)]
amrnb/amrwb: Remove get_bits usage.

It is used to parse fixed sized fields out of a single octet. The code
is simpler without it.

12 years agoRemove AV_LOG_DEBUG from av_dlog() calls.
Carl Eugen Hoyos [Mon, 5 Mar 2012 13:28:29 +0000 (14:28 +0100)]
Remove AV_LOG_DEBUG from av_dlog() calls.

AV_LOG_DEBUG is forced by the av_dlog definition.

12 years agocosmetics: reindent
Justin Ruggles [Mon, 27 Feb 2012 23:16:11 +0000 (18:16 -0500)]
cosmetics: reindent

12 years agoavformat: do not require a pixel/sample format if there is no decoder
Justin Ruggles [Mon, 27 Feb 2012 23:02:10 +0000 (18:02 -0500)]
avformat: do not require a pixel/sample format if there is no decoder

Also, do not keep trying to find and open a decoder in try_decode_frame() if
we already tried and failed once.

Fixes always searching until max_analyze_duration in
avformat_find_stream_info() when demuxing codecs without a decoder.

12 years agoavformat: do not fill-in audio packet duration in compute_pkt_fields()
Justin Ruggles [Mon, 27 Feb 2012 23:07:07 +0000 (18:07 -0500)]
avformat: do not fill-in audio packet duration in compute_pkt_fields()

Use the estimated duration only to calculate missing timestamps if needed.

12 years agolavf: Use av_get_audio_frame_duration() in get_audio_frame_size()
Justin Ruggles [Mon, 27 Feb 2012 20:54:41 +0000 (15:54 -0500)]
lavf: Use av_get_audio_frame_duration() in get_audio_frame_size()

Also, do not give AVCodecContext.frame_size priority for muxing.

Updated 2 FATE references:
dxa-feeble - adds 1 audio frame that is still within 2 seconds as specified
             by -t 2 in the FATE test
wmv8-drm-nodec - durations are not needed. previously they were estimated
                 using the packet size and average bit rate.

12 years agodca_parser: parse the sample rate and frame durations
Justin Ruggles [Mon, 27 Feb 2012 18:58:01 +0000 (13:58 -0500)]
dca_parser: parse the sample rate and frame durations

12 years agolibspeexdec: do not set AVCodecContext.frame_size
Justin Ruggles [Mon, 27 Feb 2012 16:18:33 +0000 (11:18 -0500)]
libspeexdec: do not set AVCodecContext.frame_size

It is not necessary

12 years agolibopencore-amr: do not set AVCodecContext.frame_size
Justin Ruggles [Mon, 27 Feb 2012 16:15:17 +0000 (11:15 -0500)]
libopencore-amr: do not set AVCodecContext.frame_size

It is not necessary

12 years agoalsdec: do not set AVCodecContext.frame_size
Justin Ruggles [Mon, 27 Feb 2012 16:02:33 +0000 (11:02 -0500)]
alsdec: do not set AVCodecContext.frame_size

It is not necessary

12 years agosiff: do not set AVCodecContext.frame_size
Justin Ruggles [Mon, 27 Feb 2012 04:27:21 +0000 (23:27 -0500)]
siff: do not set AVCodecContext.frame_size

also, properly set AVCodecContext.bits_per_coded_sample, AVStreasm.start_time,
and AVPacket.duration.

12 years agoamr demuxer: do not set AVCodecContext.frame_size.
Justin Ruggles [Mon, 27 Feb 2012 04:12:03 +0000 (23:12 -0500)]
amr demuxer: do not set AVCodecContext.frame_size.

it is not necessary.

12 years agoaiffdec: do not set AVCodecContext.frame_size
Justin Ruggles [Mon, 27 Feb 2012 03:55:52 +0000 (22:55 -0500)]
aiffdec: do not set AVCodecContext.frame_size

It is unnecessary. Also, for some codecs we're reading more than 1 frame per
packet. Instead we use a private context variable to calculate the bit rate,
stream duration, and packet durations.

Updated FATE seek test, which has slightly different timestamps due to a
more accurate bit rate calculation.

12 years agomov: do not set AVCodecContext.frame_size
Justin Ruggles [Mon, 27 Feb 2012 02:03:04 +0000 (21:03 -0500)]
mov: do not set AVCodecContext.frame_size

It is not necessary.

12 years agoape: do not set AVCodecContext.frame_size.
Justin Ruggles [Tue, 24 Jan 2012 23:25:47 +0000 (18:25 -0500)]
ape: do not set AVCodecContext.frame_size.

prevents lavf from setting incorrect packet durations.

12 years agordt: remove workaround for infinite loop with aac
Justin Ruggles [Mon, 27 Feb 2012 09:08:44 +0000 (04:08 -0500)]
rdt: remove workaround for infinite loop with aac

avformat_find_stream_info() no longer hangs while waiting for AAC frame_size

12 years agoavformat: do not require frame_size in avformat_find_stream_info() for CELT
Justin Ruggles [Mon, 27 Feb 2012 07:46:03 +0000 (02:46 -0500)]
avformat: do not require frame_size in avformat_find_stream_info() for CELT

In Ogg/CELT, frame_size is found in the same place as the sample_rate and
channels, so we do not need to force the frame_size to be parsed.

12 years agoavformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3
Justin Ruggles [Mon, 27 Feb 2012 07:42:22 +0000 (02:42 -0500)]
avformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3

It was only needed to avoid a bad time base (and thus non-monotone timestamps)
for stream copy to avi.

12 years agoavformat: do not require frame_size in avformat_find_stream_info() for AAC
Justin Ruggles [Mon, 27 Feb 2012 05:50:16 +0000 (00:50 -0500)]
avformat: do not require frame_size in avformat_find_stream_info() for AAC

We already will get the needed info because of CODEC_CAP_CHANNEL_CONF

12 years agoswfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size
Justin Ruggles [Mon, 27 Feb 2012 08:09:44 +0000 (03:09 -0500)]
swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size

This way we can do stream copy without having the demuxer wait until
frame_size has been set.

12 years agortpenc: use av_get_audio_frame_duration() for max_frames_per_packet
Justin Ruggles [Mon, 27 Feb 2012 08:01:45 +0000 (03:01 -0500)]
rtpenc: use av_get_audio_frame_duration() for max_frames_per_packet

It is more reliable than AVCodecContext.frame_size for codecs with constant
packet duration.

12 years agoriffenc: use av_get_audio_frame_duration()
Justin Ruggles [Mon, 27 Feb 2012 07:34:14 +0000 (02:34 -0500)]
riffenc: use av_get_audio_frame_duration()

For encoding, frame_size is not a reliable indicator of packet duration.
Also, we don't want to have to force the demuxer to find frame_size for
stream copy to work.

12 years agoavcodec: add av_get_audio_frame_duration() function.
Justin Ruggles [Fri, 27 Jan 2012 01:08:23 +0000 (20:08 -0500)]
avcodec: add av_get_audio_frame_duration() function.

This is a utility function for the user to get the frame duration based on
the codec id, frame size in bytes, and various AVCodecContext parameters.

12 years agoavcodec: add av_get_exact_bits_per_sample() function
Justin Ruggles [Thu, 19 Jan 2012 23:36:40 +0000 (18:36 -0500)]
avcodec: add av_get_exact_bits_per_sample() function

This only returns bits per sample when it is exactly correct. That is, the
codec contains only raw samples with no frame headers or padding. This applies
to basically all PCM codecs and a small subset of ADPCM codecs.

12 years agomatroska : Add support for reading/writing creation_time metadata.
Aaron Colwell [Mon, 5 Mar 2012 18:02:48 +0000 (19:02 +0100)]
matroska : Add support for reading/writing creation_time metadata.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agocook: fix return statements.
Michael Niedermayer [Mon, 5 Mar 2012 17:59:29 +0000 (18:59 +0100)]
cook: fix return statements.

Found-by: cbsrobot
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agowmaenc: change some asserts to av_assert0.
Michael Niedermayer [Mon, 5 Mar 2012 06:28:54 +0000 (07:28 +0100)]
wmaenc: change some asserts to av_assert0.

This ensures they are always checked

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agowmaenc: add assert to check encode_superframe() return.
Michael Niedermayer [Mon, 5 Mar 2012 06:27:42 +0000 (07:27 +0100)]
wmaenc: add assert to check encode_superframe() return.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoRevert "wmaenc: check final frame size against output packet size"
Michael Niedermayer [Mon, 5 Mar 2012 06:24:16 +0000 (07:24 +0100)]
Revert "wmaenc: check final frame size against output packet size"

This condition cannot happen, if it can it is a bug that MUST be fixed.
And i very happily volunteer to fix it if someone reports a case to
me that fails.

This reverts commit 5d652e063bd3a180f9de8915e5137aa4f938846d.

12 years agolavf: deobfuscate read_frame_internal().
Anton Khirnov [Sun, 4 Mar 2012 14:49:26 +0000 (15:49 +0100)]
lavf: deobfuscate read_frame_internal().

Split off packet parsing into a separate function. Parse full packets at
once and store them in a queue, eliminating the need for tracking
parsing state in AVStream.

The horrible unreadable loop in read_frame_internal() now isn't weirdly
ordered and doesn't contain evil gotos, so it should be much easier to
understand.

compute_pkt_fields() now invents slightly different timestamps for two
raw vc1 tests, due to has_b_frames being set a bit later. They shouldn't
be more wrong (or right) than previous ones.

12 years agolavf: make read_from_packet_buffer() more flexible.
Anton Khirnov [Sat, 3 Mar 2012 15:28:32 +0000 (16:28 +0100)]
lavf: make read_from_packet_buffer() more flexible.

Make packet buffer a parameter, don't hardcode it to be
AVFormatContext.packet_buffer.

Also move the function higher in the file, since it will be called from
read_frame_internal().

12 years agolavf: factorize freeing a packet buffer.
Anton Khirnov [Sat, 3 Mar 2012 08:43:14 +0000 (09:43 +0100)]
lavf: factorize freeing a packet buffer.

12 years agoFix format string vulnerability detected by -Wformat-security.
Fabian Greffrath [Mon, 5 Mar 2012 15:06:01 +0000 (16:06 +0100)]
Fix format string vulnerability detected by -Wformat-security.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agodv: Do not redundantly initialize struct members to zero.
Diego Biurrun [Mon, 5 Mar 2012 12:57:14 +0000 (13:57 +0100)]
dv: Do not redundantly initialize struct members to zero.

12 years agoalsa: fix timefilter usage.
Nicolas George [Fri, 2 Mar 2012 10:54:45 +0000 (11:54 +0100)]
alsa: fix timefilter usage.

The period argument is supposed to be the number of samples since
the last update.

12 years agotimefilter: allow variable periods.
Nicolas George [Fri, 2 Mar 2012 10:49:27 +0000 (11:49 +0100)]
timefilter: allow variable periods.

Initially found and designed by Michael Niedermayer.

12 years agotimefilter: internally compute feedback factors.
Nicolas George [Wed, 15 Feb 2012 18:15:45 +0000 (19:15 +0100)]
timefilter: internally compute feedback factors.

The feedback factors for the timefilter are directly computed from
the expected period. This commit changes the init function to accept
the period itself and compute the feedback factors internally,
rather than having all client code duplicate the formulas.

This commit also actually fixes the formulas: the current code had
sqrt(2*o), but the correct formula, both theoretically and according
to experimental testing, is sqrt(2)*o.

Furthermore, it adds an exponential to feedback factors larger than
1 with large periods.

12 years agox86: clean up ff_dsputil_init_mmx()
Mans Rullgard [Thu, 1 Mar 2012 12:48:00 +0000 (12:48 +0000)]
x86: clean up ff_dsputil_init_mmx()

This splits ff_dsputil_init_mmx() into multiple functions, one for
each MMX/SSE level, somewhat simplifying the nested conditions.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
12 years agosmc: Fix overread.
Michael Niedermayer [Mon, 5 Mar 2012 02:43:15 +0000 (03:43 +0100)]
smc: Fix overread.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agobit_depth_template: use av_clip_uint8 over crop_tab.
Michael Niedermayer [Mon, 5 Mar 2012 02:05:21 +0000 (03:05 +0100)]
bit_depth_template: use av_clip_uint8 over crop_tab.

This fixes some global out of array reads and wrong cliping.
No speed difference meassurable under clang on i5
also all important code paths on all important platforms should
use SIMD.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoindeo3: move MV check up.
Michael Niedermayer [Mon, 5 Mar 2012 01:15:35 +0000 (02:15 +0100)]
indeo3: move MV check up.

This adds checking for modes >= 10.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agocook: check decouple values.
Michael Niedermayer [Thu, 1 Mar 2012 16:26:03 +0000 (17:26 +0100)]
cook: check decouple values.

This fixes a out of global array read in the cplscale* tables.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoMerge remote-tracking branch 'qatar/master'
Michael Niedermayer [Sun, 4 Mar 2012 23:02:58 +0000 (00:02 +0100)]
Merge remote-tracking branch 'qatar/master'

* qatar/master: (27 commits)
  cmdutils: use new avcodec_is_decoder/encoder() functions.
  lavc: make codec_is_decoder/encoder() public.
  lavc: deprecate AVCodecContext.sub_id.
  libcdio: add a forgotten AVClass to the private context.
  swscale: remove "cpu flags" from -sws_flags description.
  proresenc: give user a possibility to alter some encoding parameters
  vorbisenc: add output buffer overwrite protection
  libopencore-amrnbenc: fix end-of-stream handling
  ra144enc: fix end-of-stream handling
  nellymoserenc: zero any leftover packet bytes
  nellymoserenc: use proper MDCT overlap delay
  qpeg: Use bytestream2 functions to prevent buffer overreads.
  swscale: make %rep unconditional.
  vp8: convert simple loopfilter x86 assembly to use named arguments.
  vp8: convert idct x86 assembly to use named arguments.
  vp8: convert mc x86 assembly to use named arguments.
  vp8: convert loopfilter x86 assembly to use cpuflags().
  vp8: convert idct/mc x86 assembly to use cpuflags().
  swscale: remove now unnecessary hack.
  x86inc: don't "bake" stack_offset in named arguments.
  ...

Conflicts:
cmdutils.c
doc/APIchanges
libavcodec/mpeg12.c
libavcodec/options.c
libavcodec/qpeg.c
libavcodec/utils.c
libavcodec/version.h
libavdevice/libcdio.c
tests/lavf-regression.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoindeo3: Fix overreading requant_tab.
Michael Niedermayer [Sun, 4 Mar 2012 22:12:58 +0000 (23:12 +0100)]
indeo3: Fix overreading requant_tab.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoindeo3: Check motion vectors.
Michael Niedermayer [Sun, 4 Mar 2012 21:32:44 +0000 (22:32 +0100)]
indeo3: Check motion vectors.

Fixes overread of reference frame.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agocmdutils: use new avcodec_is_decoder/encoder() functions.
Anton Khirnov [Fri, 2 Mar 2012 16:05:01 +0000 (17:05 +0100)]
cmdutils: use new avcodec_is_decoder/encoder() functions.

Fixes listing encoders.

12 years agolavc: make codec_is_decoder/encoder() public.
Anton Khirnov [Fri, 2 Mar 2012 16:00:53 +0000 (17:00 +0100)]
lavc: make codec_is_decoder/encoder() public.

12 years agolavc: deprecate AVCodecContext.sub_id.
Anton Khirnov [Mon, 27 Feb 2012 17:52:13 +0000 (18:52 +0100)]
lavc: deprecate AVCodecContext.sub_id.

In most places where it's used, it's as a pointless write-only field.

Only rv10 decoder actually reads from it, but it stores some internal
version info in it. There is no reason for it to be in a public field.

12 years agolibcdio: add a forgotten AVClass to the private context.
Anton Khirnov [Sat, 3 Mar 2012 05:26:39 +0000 (06:26 +0100)]
libcdio: add a forgotten AVClass to the private context.

12 years agolibmpcodecs/vf_pp: import memleak fix from MPlayer.
Nicolas George [Sat, 3 Mar 2012 13:50:53 +0000 (14:50 +0100)]
libmpcodecs/vf_pp: import memleak fix from MPlayer.

12 years agovf_mp: uninit filter chain.
Nicolas George [Sat, 3 Mar 2012 12:17:47 +0000 (13:17 +0100)]
vf_mp: uninit filter chain.

Most of the code was taken from MPlayer's vf_uninit_filter_chain.

12 years agodsicinav: fix 10l bug introduced in 999d38f3a94eb963c073512e5dad7940456eb634
Michael Niedermayer [Sun, 4 Mar 2012 17:04:55 +0000 (18:04 +0100)]
dsicinav: fix 10l bug introduced in 999d38f3a94eb963c073512e5dad7940456eb634

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agopcm-mpeg: fix 10l condition flip
Michael Niedermayer [Sun, 4 Mar 2012 15:38:20 +0000 (16:38 +0100)]
pcm-mpeg: fix 10l condition flip

Original issue Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
10l bug Found-by: nevcairiel
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoswscale: remove "cpu flags" from -sws_flags description.
Ronald S. Bultje [Sun, 4 Mar 2012 05:38:03 +0000 (21:38 -0800)]
swscale: remove "cpu flags" from -sws_flags description.

12 years agoFix alpha overflow when converting from RGBA64 to RGBA.
Michael Niedermayer [Sun, 4 Mar 2012 12:42:16 +0000 (13:42 +0100)]
Fix alpha overflow when converting from RGBA64 to RGBA.

Fixes converting the sample from ticket #503 to 32bit RGB.

12 years agolavfi: add blackdetect filter
Stefano Sabatini [Fri, 2 Mar 2012 14:51:26 +0000 (15:51 +0100)]
lavfi: add blackdetect filter

Address trac ticket #901.

12 years agommvideo: fix overreads of the input buffer.
Michael Niedermayer [Sun, 4 Mar 2012 07:14:07 +0000 (08:14 +0100)]
mmvideo: fix overreads of the input buffer.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agodsicinvideo: validate buffer offset before copying pixels.
Ronald S. Bultje [Wed, 29 Feb 2012 23:07:09 +0000 (15:07 -0800)]
dsicinvideo: validate buffer offset before copying pixels.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable-LOOeJiBropLYtjvyW6yDsg@public.gmane.org
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoproresenc: give user a possibility to alter some encoding parameters
Kostya Shishkov [Sat, 3 Mar 2012 18:14:35 +0000 (19:14 +0100)]
proresenc: give user a possibility to alter some encoding parameters

This allows user to select quantisation matrix from different profile,
stamp frames with custom vendor string and change target bitrate.

12 years agovorbisenc: add output buffer overwrite protection
Justin Ruggles [Wed, 29 Feb 2012 07:56:01 +0000 (02:56 -0500)]
vorbisenc: add output buffer overwrite protection

12 years agolibopencore-amrnbenc: fix end-of-stream handling
Justin Ruggles [Sun, 4 Mar 2012 05:25:45 +0000 (00:25 -0500)]
libopencore-amrnbenc: fix end-of-stream handling

Use CODEC_CAP_DELAY and CODEC_CAP_SMALL_LAST_FRAME to properly pad and flush
the encoder at the end of encoding. This is needed in order to have all input
samples decoded.

12 years agora144enc: fix end-of-stream handling
Justin Ruggles [Tue, 28 Feb 2012 06:02:28 +0000 (01:02 -0500)]
ra144enc: fix end-of-stream handling

Use CODEC_CAP_DELAY and CODEC_CAP_SMALL_LAST_FRAME to properly pad and flush
the encoder at the end of encoding. This is needed in order to have all input
samples decoded.

12 years agonellymoserenc: zero any leftover packet bytes
Justin Ruggles [Tue, 28 Feb 2012 04:39:50 +0000 (23:39 -0500)]
nellymoserenc: zero any leftover packet bytes

fixes writing of uninitialized packet data

12 years agonellymoserenc: use proper MDCT overlap delay
Justin Ruggles [Tue, 28 Feb 2012 04:32:23 +0000 (23:32 -0500)]
nellymoserenc: use proper MDCT overlap delay

12 years agotruemotion2: check motion vectors for validity
Michael Niedermayer [Sun, 4 Mar 2012 06:09:00 +0000 (07:09 +0100)]
truemotion2: check motion vectors for validity

Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agopngdec: validate length.
Michael Niedermayer [Sun, 4 Mar 2012 05:25:06 +0000 (06:25 +0100)]
pngdec: validate length.

Fixes out of array reading.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoqpeg: Use bytestream2 functions to prevent buffer overreads.
Aneesh Dogra [Sun, 4 Mar 2012 04:29:43 +0000 (09:59 +0530)]
qpeg: Use bytestream2 functions to prevent buffer overreads.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
12 years agoswscale: make %rep unconditional.
Ronald S. Bultje [Sat, 3 Mar 2012 22:15:32 +0000 (14:15 -0800)]
swscale: make %rep unconditional.

Fixes pre-processing with latest versions of nasm.

12 years agovp8: convert simple loopfilter x86 assembly to use named arguments.
Ronald S. Bultje [Sat, 3 Mar 2012 20:55:34 +0000 (12:55 -0800)]
vp8: convert simple loopfilter x86 assembly to use named arguments.

12 years agovp8: convert idct x86 assembly to use named arguments.
Ronald S. Bultje [Sat, 3 Mar 2012 16:04:40 +0000 (08:04 -0800)]
vp8: convert idct x86 assembly to use named arguments.

12 years agovp8: convert mc x86 assembly to use named arguments.
Ronald S. Bultje [Sat, 3 Mar 2012 14:46:29 +0000 (06:46 -0800)]
vp8: convert mc x86 assembly to use named arguments.

12 years agovp8: convert loopfilter x86 assembly to use cpuflags().
Ronald S. Bultje [Sat, 3 Mar 2012 04:38:02 +0000 (20:38 -0800)]
vp8: convert loopfilter x86 assembly to use cpuflags().

12 years agovp8: convert idct/mc x86 assembly to use cpuflags().
Ronald S. Bultje [Fri, 2 Mar 2012 05:35:22 +0000 (21:35 -0800)]
vp8: convert idct/mc x86 assembly to use cpuflags().

12 years agoswscale: remove now unnecessary hack.
Ronald S. Bultje [Fri, 2 Mar 2012 04:24:58 +0000 (20:24 -0800)]
swscale: remove now unnecessary hack.

12 years agox86inc: don't "bake" stack_offset in named arguments.
Loren Merritt [Sun, 26 Feb 2012 17:05:29 +0000 (09:05 -0800)]
x86inc: don't "bake" stack_offset in named arguments.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
12 years agolavf: Do not compute the packet duration based on the bitrate if the frame_size can...
Michael Niedermayer [Sun, 4 Mar 2012 03:06:49 +0000 (04:06 +0100)]
lavf: Do not compute the packet duration based on the bitrate if the frame_size can be determined.

This fixes issues when the bitrate is variable or inaccurate but the
frame size has not been determined yet.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agolavf: factor out determinable_frame_size()
Michael Niedermayer [Sun, 4 Mar 2012 03:06:15 +0000 (04:06 +0100)]
lavf: factor out determinable_frame_size()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agoMerge remote-tracking branch 'qatar/master'
Michael Niedermayer [Sun, 4 Mar 2012 01:03:25 +0000 (02:03 +0100)]
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  tiertexseq: set correct block_align for audio
  tiertexseq: set audio stream start time to 0
  voc/avs: Do not change the sample rate mid-stream.
  segafilm: use the sample rate as the time base for audio streams
  ea: fix audio pts
  psx-str: fix audio pts
  vqf: set packet duration
  tta demuxer: set packet duration
  mpegaudio_parser: do not ignore information from the first parsed frame
  mpegaudio_parser: be less picky about the start position
  thp: set audio packet durations
  avcodec: add a Vorbis parser to get packet duration
  vorbisdec: read the previous window flag for long windows
  lavc: free the output packet when encoding failed or produced no output.
  lavc: preserve avpkt->destruct in ff_alloc_packet().
  lavc: clarify the meaning of AVCodecContext.frame_number.
  mpegts: Pad the packet buffer in handle_packet().
  mpegts: Do not call read_sl_header() when no bytes remain in the buffer.

Conflicts:
libavcodec/mpegaudio_parser.c
libavcodec/version.h
libavformat/mpegts.c
tests/ref/fate/pva-demux

Merged-by: Michael Niedermayer <michaelni@gmx.at>
12 years agofate: Add sunrast regression test
Derek Buitenhuis [Fri, 2 Mar 2012 00:48:26 +0000 (19:48 -0500)]
fate: Add sunrast regression test

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
12 years agoSupport RGBA64 as input colour space.
Carl Eugen Hoyos [Sat, 3 Mar 2012 23:43:18 +0000 (00:43 +0100)]
Support RGBA64 as input colour space.

Mostly fixes ticket #503,
opaque still overflows for RGBA64 -> RGBA conversion.

12 years agowmaenc: fix m/s stereo encoding for the first frame
Justin Ruggles [Fri, 2 Mar 2012 22:11:25 +0000 (17:11 -0500)]
wmaenc: fix m/s stereo encoding for the first frame

We need to set ms_stereo in encode_init() in order to avoid incorrectly
encoding the first frame as non-m/s while flagging it as m/s. Fixes an
uncomfortable pop in the left channel at the start of playback.

CC:libav-stable@libav.org

12 years agoffm options should also set discard automatically.
Rick van der Zwet [Sat, 3 Mar 2012 19:45:45 +0000 (20:45 +0100)]
ffm options should also set discard automatically.

commit 13f6917ca91dfdc0fd785235b2dae891a9604859 handles discards automatically,
but the ffm discard options are not fully parsed. Causing the input streams not
to be used, so no stream towards the ffserver after the initial probing.

Signed-off-by: Rick van der Zwet <info@rickvanderzwet.nl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agowmaenc: return s->block_align instead of recalculating it
Justin Ruggles [Fri, 2 Mar 2012 21:55:45 +0000 (16:55 -0500)]
wmaenc: return s->block_align instead of recalculating it

12 years agowmaenc: check final frame size against output packet size
Justin Ruggles [Fri, 2 Mar 2012 21:42:21 +0000 (16:42 -0500)]
wmaenc: check final frame size against output packet size

Currently we have an assert() that prevents the frame from being too large,
but it is more user-friendly to give an error message instead of aborting on
assert(). This condition is quite unlikely due to the minimum bit rate check
in encode_init(), but it is still worth having.

12 years agowmaenc: require a large enough output buffer to prevent overwrites
Justin Ruggles [Fri, 2 Mar 2012 21:33:33 +0000 (16:33 -0500)]
wmaenc: require a large enough output buffer to prevent overwrites

The maximum theoretical frame size is around 17000 bytes. Although in
practice it will generally be much smaller, we require a larger buffer
just to be safe.

CC: libav-stable@libav.org
12 years agowmaenc: limit allowed sample rate to 48kHz
Justin Ruggles [Fri, 2 Mar 2012 21:27:57 +0000 (16:27 -0500)]
wmaenc: limit allowed sample rate to 48kHz

ff_wma_init() allows up to 50kHz, but this generates an exponent band
size table that requires 65 bands. The code assumes 25 bands in many
places, and using sample rates higher than 48kHz will lead to buffer
overwrites.

CC:libav-stable@libav.org

12 years agowmaenc: limit block_align to MAX_CODED_SUPERFRAME_SIZE
Justin Ruggles [Fri, 2 Mar 2012 21:10:00 +0000 (16:10 -0500)]
wmaenc: limit block_align to MAX_CODED_SUPERFRAME_SIZE

This is near the theoretical limit for wma frame size and is the most that
our decoder can handle. Allowing higher bit rates will just end up padding
each frame with empty bytes.

Fixes invalid writes for avconv when using very high bit rates.

CC:libav-stable@libav.org

12 years agowc4: fix out of chroma LUT reads
Michael Niedermayer [Sat, 3 Mar 2012 23:13:52 +0000 (00:13 +0100)]
wc4: fix out of chroma LUT reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agopcm-mpeg: Check for valid bps.
Michael Niedermayer [Sat, 3 Mar 2012 22:55:16 +0000 (23:55 +0100)]
pcm-mpeg: Check for valid bps.

The code only supports 16 and 24 bps currently, 20bps causes
out of array reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years agotiertexseq: set correct block_align for audio
Justin Ruggles [Fri, 20 Jan 2012 04:03:08 +0000 (23:03 -0500)]
tiertexseq: set correct block_align for audio

12 years agotiertexseq: set audio stream start time to 0
Justin Ruggles [Fri, 20 Jan 2012 04:01:53 +0000 (23:01 -0500)]
tiertexseq: set audio stream start time to 0

Update FATE test to reflect delayed video due to the file having audio-only
frames prior to the first frame with video.

12 years agovoc/avs: Do not change the sample rate mid-stream.
Justin Ruggles [Thu, 12 Jan 2012 02:10:35 +0000 (21:10 -0500)]
voc/avs: Do not change the sample rate mid-stream.

Also, set the time base based on the sample rate.
lavf-voc seek test updated to reflect slightly different seek points.

12 years agosegafilm: use the sample rate as the time base for audio streams
Justin Ruggles [Wed, 11 Jan 2012 16:07:40 +0000 (11:07 -0500)]
segafilm: use the sample rate as the time base for audio streams

12 years agoea: fix audio pts
Justin Ruggles [Wed, 11 Jan 2012 15:22:47 +0000 (10:22 -0500)]
ea: fix audio pts

The time base is 1 / sample_rate, not 90000.
Several more codecs encode the sample count in the first 4 bytes of the
chunk, so we set the durations accordingly. Also, we can set start_time and
packet duration instead of keeping track of the sample count in the demuxer.

12 years agopsx-str: fix audio pts
Justin Ruggles [Wed, 11 Jan 2012 14:41:06 +0000 (09:41 -0500)]
psx-str: fix audio pts

Each packet has 18 sectors with 224/channels samples in each sector.