Commit Graph

32932 Commits

Author SHA1 Message Date
Justin Ruggles
0efa4073bf alsdec: do not set AVCodecContext.frame_size
It is not necessary
2012-03-05 13:08:17 -05:00
Justin Ruggles
f1e73100d9 siff: do not set AVCodecContext.frame_size
also, properly set AVCodecContext.bits_per_coded_sample, AVStreasm.start_time,
and AVPacket.duration.
2012-03-05 13:08:17 -05:00
Justin Ruggles
ec2e767bf3 amr demuxer: do not set AVCodecContext.frame_size.
it is not necessary.
2012-03-05 13:08:17 -05:00
Justin Ruggles
8d1a20aa7c 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.
2012-03-05 13:08:17 -05:00
Justin Ruggles
237a855caf mov: do not set AVCodecContext.frame_size
It is not necessary.
2012-03-05 13:08:17 -05:00
Justin Ruggles
9727264220 ape: do not set AVCodecContext.frame_size.
prevents lavf from setting incorrect packet durations.
2012-03-05 13:08:17 -05:00
Justin Ruggles
2dd18d4435 rdt: remove workaround for infinite loop with aac
avformat_find_stream_info() no longer hangs while waiting for AAC frame_size
2012-03-05 13:08:16 -05:00
Justin Ruggles
9c365fe8ae 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.
2012-03-05 13:08:16 -05:00
Justin Ruggles
fbc8c59679 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.
2012-03-05 13:08:16 -05:00
Justin Ruggles
84b6ae0808 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
2012-03-05 13:08:16 -05:00
Justin Ruggles
620b88a302 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.
2012-03-05 13:08:16 -05:00
Justin Ruggles
14aecc50fa 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.
2012-03-05 13:08:16 -05:00
Justin Ruggles
c019070fda 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.
2012-03-05 13:08:15 -05:00
Justin Ruggles
9524cf79df 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.
2012-03-05 13:08:15 -05:00
Justin Ruggles
6699d07480 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.
2012-03-05 13:08:15 -05:00
Anton Khirnov
27c7ca9c12 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.
2012-03-05 18:47:05 +01:00
Anton Khirnov
dcee811505 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().
2012-03-05 18:44:45 +01:00
Anton Khirnov
52b0943f10 lavf: factorize freeing a packet buffer. 2012-03-05 18:44:30 +01:00
Fabian Greffrath
c9dbac36ad Fix format string vulnerability detected by -Wformat-security.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2012-03-05 17:03:00 +01:00
Diego Biurrun
0a41f47dc1 dv: Do not redundantly initialize struct members to zero. 2012-03-05 17:02:59 +01:00
Mans Rullgard
356ee8d7de 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>
2012-03-05 14:40:03 +01:00
Anton Khirnov
3faa141d15 cmdutils: use new avcodec_is_decoder/encoder() functions.
Fixes listing encoders.
2012-03-04 21:09:35 +01:00
Anton Khirnov
44fe77b350 lavc: make codec_is_decoder/encoder() public. 2012-03-04 21:08:52 +01:00
Anton Khirnov
02beb9826b 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.
2012-03-04 21:02:45 +01:00
Anton Khirnov
87392b1fd5 libcdio: add a forgotten AVClass to the private context. 2012-03-04 21:01:41 +01:00
Ronald S. Bultje
1c97b5c4a3 swscale: remove "cpu flags" from -sws_flags description. 2012-03-04 06:52:06 -08:00
Kostya Shishkov
4db4b53dc8 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.
2012-03-04 07:35:00 +01:00
Justin Ruggles
1ba08c94f5 vorbisenc: add output buffer overwrite protection 2012-03-04 01:16:54 -05:00
Justin Ruggles
fe78470a8b 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.
2012-03-04 01:14:53 -05:00
Justin Ruggles
b0350c1c30 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.
2012-03-04 01:14:53 -05:00
Justin Ruggles
29e2c85310 nellymoserenc: zero any leftover packet bytes
fixes writing of uninitialized packet data
2012-03-04 01:14:52 -05:00
Justin Ruggles
6c7a01621c nellymoserenc: use proper MDCT overlap delay 2012-03-04 01:14:52 -05:00
Aneesh Dogra
3e9cd8b4b0 qpeg: Use bytestream2 functions to prevent buffer overreads.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-03 20:40:00 -08:00
Ronald S. Bultje
dccb2cd3f9 swscale: make %rep unconditional.
Fixes pre-processing with latest versions of nasm.
2012-03-03 20:40:00 -08:00
Ronald S. Bultje
b4188f0d46 vp8: convert simple loopfilter x86 assembly to use named arguments. 2012-03-03 20:40:00 -08:00
Ronald S. Bultje
8476ca3b4e vp8: convert idct x86 assembly to use named arguments. 2012-03-03 20:40:00 -08:00
Ronald S. Bultje
21ffc78fd7 vp8: convert mc x86 assembly to use named arguments. 2012-03-03 20:40:00 -08:00
Ronald S. Bultje
28170f1a39 vp8: convert loopfilter x86 assembly to use cpuflags(). 2012-03-03 20:40:00 -08:00
Ronald S. Bultje
e25be47154 vp8: convert idct/mc x86 assembly to use cpuflags(). 2012-03-03 20:39:59 -08:00
Ronald S. Bultje
8249a23fc1 swscale: remove now unnecessary hack. 2012-03-03 20:39:59 -08:00
Loren Merritt
0f53d0cf4b x86inc: don't "bake" stack_offset in named arguments.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2012-03-03 20:39:59 -08:00
Derek Buitenhuis
6aa6e3e814 fate: Add sunrast regression test
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
2012-03-03 20:57:03 -05:00
Justin Ruggles
51ddf35c90 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
2012-03-03 18:20:10 -05:00
Justin Ruggles
8ed7488ea3 wmaenc: return s->block_align instead of recalculating it 2012-03-03 18:20:10 -05:00
Justin Ruggles
5d652e063b 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.
2012-03-03 18:20:10 -05:00
Justin Ruggles
dfc4fdedf8 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
2012-03-03 18:20:10 -05:00
Justin Ruggles
1ec075cfec 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
2012-03-03 18:20:10 -05:00
Justin Ruggles
c2b8dea182 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
2012-03-03 18:20:09 -05:00
Justin Ruggles
b7beabab4b tiertexseq: set correct block_align for audio 2012-03-03 17:03:27 -05:00
Justin Ruggles
f9cf91d822 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.
2012-03-03 17:03:27 -05:00