Commit 479fb7b8 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master: (35 commits)
  fix space type in Changelog
  ZeroCodec Decoder
  RealAudio Lossless decoder
  rtpenc: Use AVFormatContext.packet_size instead of a private option
  url: Document the expected behaviour of url_read
  libavformat: Use AVFormatContext.probesize in init_input
  docs: Fix a stray reference to tags in the generic doxy on dicts
  cosmetics: Align some AVInput/OutputFormat declarations
  zmbv: check decompress result
  zmbv: correct indentation
  adpcm: convert adpcm_thp to bytestream2.
  adpcm: convert adpcm_yamaha to bytestream2.
  adpcm: convert adpcm_swf to bytestream2.
  adpcm: convert adpcm_sbpro to bytestream2.
  adpcm: convert adpcm_ct to bytestream2.
  adpcm: convert adpcm_ima_amv/smjpeg to bytestream2.
  adpcm: convert adpcm_ea_xas to bytestream2.
  adpcm: convert adpcm_ea_r1/2/3 to bytestream2.
  adpcm: convert ea_maxis_xa to bytestream2.
  adpcm: convert adpcm_ea to bytestream2.
  ...

Conflicts:
	Changelog
	libavcodec/Makefile
	libavcodec/adpcm.c
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/version.h
	libavcodec/zerocodec.c
	libavcodec/zmbv.c
	libavformat/riff.c
	libavformat/url.h
	tests/ref/fate/truemotion1-15
	tests/ref/fate/truemotion1-24
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 87c1783c 18ba94c6
......@@ -16,6 +16,7 @@ version next:
- swapuv filter
- bbox filter
- XBM encoder
- RealAudio Lossless decoder
- ZeroCodec decoder
......
......@@ -792,6 +792,7 @@ following image formats are supported:
@tab Real 28800 bit/s codec
@item RealAudio 3.0 (dnet) @tab IX @tab X
@tab Real low bitrate AC-3 codec
@item RealAudio Lossless @tab @tab X
@item RealAudio SIPR / ACELP.NET @tab @tab X
@item Shorten @tab @tab X
@item Sierra VMD audio @tab @tab X
......
......@@ -355,6 +355,7 @@ OBJS-$(CONFIG_R210_ENCODER) += r210enc.o
OBJS-$(CONFIG_RA_144_DECODER) += ra144dec.o ra144.o celp_filters.o
OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o
OBJS-$(CONFIG_RA_288_DECODER) += ra288.o celp_math.o celp_filters.o
OBJS-$(CONFIG_RALF_DECODER) += ralf.o
OBJS-$(CONFIG_RAWVIDEO_DECODER) += rawdec.o
OBJS-$(CONFIG_RAWVIDEO_ENCODER) += rawenc.o
OBJS-$(CONFIG_RL2_DECODER) += rl2.o
......
This diff is collapsed.
......@@ -305,6 +305,7 @@ void avcodec_register_all(void)
REGISTER_DECODER (QDM2, qdm2);
REGISTER_ENCDEC (RA_144, ra_144);
REGISTER_DECODER (RA_288, ra_288);
REGISTER_DECODER (RALF, ralf);
REGISTER_DECODER (SHORTEN, shorten);
REGISTER_DECODER (SIPR, sipr);
REGISTER_DECODER (SMACKAUD, smackaud);
......
......@@ -395,8 +395,9 @@ enum CodecID {
CODEC_ID_8SVX_EXP,
CODEC_ID_8SVX_FIB,
CODEC_ID_BMV_AUDIO,
CODEC_ID_RALF,
CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'),
CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'),
CODEC_ID_SONIC = MKBETAG('S','O','N','C'),
CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'),
......
This diff is collapsed.
This diff is collapsed.
......@@ -2036,7 +2036,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
case CODEC_ID_ADPCM_IMA_WAV:
return blocks * (1 + (ba - 4 * ch) / (4 * ch) * 8);
case CODEC_ID_ADPCM_IMA_DK3:
return blocks * (((ba - 16) * 8 / 3) / ch);
return blocks * (((ba - 16) * 2 / 3 * 4) / ch);
case CODEC_ID_ADPCM_IMA_DK4:
return blocks * (1 + (ba - 4 * ch) * 2 / ch);
case CODEC_ID_ADPCM_MS:
......
......@@ -21,7 +21,7 @@
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 54
#define LIBAVCODEC_VERSION_MINOR 11
#define LIBAVCODEC_VERSION_MINOR 12
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
......@@ -19,6 +19,7 @@
*/
#include <zlib.h>
#include "avcodec.h"
typedef struct {
......@@ -75,7 +76,8 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
zret = inflate(zstream, Z_SYNC_FLUSH);
if (zret != Z_OK && zret != Z_STREAM_END) {
av_log(avctx, AV_LOG_ERROR, "Inflate failed with return code: %d\n", zret);
av_log(avctx, AV_LOG_ERROR,
"Inflate failed with return code: %d\n", zret);
return AVERROR(EINVAL);
}
......@@ -94,7 +96,8 @@ static int zerocodec_decode_frame(AVCodecContext *avctx, void *data,
zret = inflate(zstream, Z_SYNC_FLUSH);
if (zret != Z_OK && zret != Z_STREAM_END) {
av_log(avctx, AV_LOG_ERROR, "Inflate failed with return code: %d\n", zret);
av_log(avctx, AV_LOG_ERROR,
"Inflate failed with return code: %d\n", zret);
return AVERROR(EINVAL);
}
......
......@@ -495,10 +495,10 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
c->decode_intra= decode_intra;
}
if (c->decode_intra == NULL) {
av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n");
return AVERROR_INVALIDDATA;
}
if (c->decode_intra == NULL) {
av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n");
return AVERROR_INVALIDDATA;
}
if (c->comp == 0) { //Uncompressed data
memcpy(c->decomp_buf, buf, len);
......@@ -509,7 +509,11 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
c->zstream.avail_in = len;
c->zstream.next_out = c->decomp_buf;
c->zstream.avail_out = c->decomp_size;
inflate(&c->zstream, Z_FINISH);
zret = inflate(&c->zstream, Z_SYNC_FLUSH);
if (zret != Z_OK && zret != Z_STREAM_END) {
av_log(avctx, AV_LOG_ERROR, "inflate error %d\n", zret);
return AVERROR_INVALIDDATA;
}
c->decomp_len = c->zstream.total_out;
}
if (c->flags & ZMBV_KEYFRAME) {
......
......@@ -42,5 +42,6 @@ const AVCodecTag ff_rm_codec_tags[] = {
{ CODEC_ID_SIPR, MKTAG('s','i','p','r') },
{ CODEC_ID_AAC, MKTAG('r','a','a','c') },
{ CODEC_ID_AAC, MKTAG('r','a','c','p') },
{ CODEC_ID_RALF, MKTAG('L','S','D',':') },
{ CODEC_ID_NONE },
};
......@@ -311,6 +311,15 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
/* ra type header */
if (rm_read_audio_stream_info(s, pb, st, rst, 0))
return -1;
} else if (v == MKBETAG('L', 'S', 'D', ':')) {
avio_seek(pb, -4, SEEK_CUR);
if ((ret = rm_read_extradata(pb, st->codec, codec_data_size)) < 0)
return ret;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_tag = AV_RL32(st->codec->extradata);
st->codec->codec_id = ff_codec_get_id(ff_rm_codec_tags,
st->codec->codec_tag);
} else {
int fps;
if (avio_rl32(pb) != MKTAG('V', 'I', 'D', 'O')) {
......
......@@ -33,7 +33,6 @@
static const AVOption options[] = {
FF_RTP_FLAG_OPTS(RTPMuxContext, flags)
{ "payload_type", "Specify RTP payload type", offsetof(RTPMuxContext, payload_type), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM },
{ "max_packet_size", "Max packet size", offsetof(RTPMuxContext, max_packet_size), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
};
......@@ -110,21 +109,21 @@ static int rtp_write_header(AVFormatContext *s1)
s->first_rtcp_ntp_time = (s1->start_time_realtime / 1000) * 1000 +
NTP_OFFSET_US;
if (s->max_packet_size) {
if (s1->packet_size) {
if (s1->pb->max_packet_size)
s->max_packet_size = FFMIN(s->max_packet_size,
s1->pb->max_packet_size);
s1->packet_size = FFMIN(s1->packet_size,
s1->pb->max_packet_size);
} else
s->max_packet_size = s1->pb->max_packet_size;
if (s->max_packet_size <= 12) {
av_log(s1, AV_LOG_ERROR, "Max packet size %d too low\n", s->max_packet_size);
s1->packet_size = s1->pb->max_packet_size;
if (s1->packet_size <= 12) {
av_log(s1, AV_LOG_ERROR, "Max packet size %d too low\n", s1->packet_size);
return AVERROR(EIO);
}
s->buf = av_malloc(s->max_packet_size);
s->buf = av_malloc(s1->packet_size);
if (s->buf == NULL) {
return AVERROR(ENOMEM);
}
s->max_payload_size = s->max_packet_size - 12;
s->max_payload_size = s1->packet_size - 12;
s->max_frames_per_packet = 0;
if (s1->max_delay) {
......
......@@ -34,7 +34,6 @@ struct RTPMuxContext {
uint32_t timestamp;
uint32_t base_timestamp;
uint32_t cur_timestamp;
int max_packet_size;
int max_payload_size;
int num_frames;
......
......@@ -1924,7 +1924,7 @@ AVInputFormat ff_sdp_demuxer = {
.read_header = sdp_read_header,
.read_packet = ff_rtsp_fetch_packet,
.read_close = sdp_read_close,
.priv_class = &sdp_demuxer_class
.priv_class = &sdp_demuxer_class,
};
#endif /* CONFIG_SDP_DEMUXER */
......@@ -2042,7 +2042,7 @@ AVInputFormat ff_rtp_demuxer = {
.read_header = rtp_read_header,
.read_packet = ff_rtsp_fetch_packet,
.read_close = sdp_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &rtp_demuxer_class
.flags = AVFMT_NOFILE,
.priv_class = &rtp_demuxer_class,
};
#endif /* CONFIG_RTP_DEMUXER */
......@@ -409,8 +409,8 @@ AVInputFormat ff_rtsp_demuxer = {
.read_packet = rtsp_read_packet,
.read_close = rtsp_read_close,
.read_seek = rtsp_read_seek,
.flags = AVFMT_NOFILE,
.read_play = rtsp_read_play,
.read_pause = rtsp_read_pause,
.priv_class = &rtsp_demuxer_class,
.flags = AVFMT_NOFILE,
.read_play = rtsp_read_play,
.read_pause = rtsp_read_pause,
.priv_class = &rtsp_demuxer_class,
};
......@@ -242,6 +242,6 @@ AVOutputFormat ff_rtsp_muxer = {
.write_header = rtsp_write_header,
.write_packet = rtsp_write_packet,
.write_trailer = rtsp_write_close,
.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
.priv_class = &rtsp_muxer_class,
.flags = AVFMT_NOFILE | AVFMT_GLOBALHEADER,
.priv_class = &rtsp_muxer_class,
};
......@@ -63,7 +63,7 @@ typedef struct URLProtocol {
/**
* Read data from the protocol.
* If data is immediately available (even less than size), EOF is
* reached or an error occurs (including EINTR), return immediately,
* reached or an error occurs (including EINTR), return immediately.
* Otherwise:
* In non-blocking mode, return AVERROR(EAGAIN) immediately.
* In blocking mode, wait for data/EOF/error with a short timeout (0.1s),
......
......@@ -532,7 +532,7 @@ static int init_input(AVFormatContext *s, const char *filename, AVDictionary **o
if (s->pb) {
s->flags |= AVFMT_FLAG_CUSTOM_IO;
if (!s->iformat)
return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, 0);
return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, s->probesize);
else if (s->iformat->flags & AVFMT_NOFILE)
av_log(s, AV_LOG_WARNING, "Custom AVIOContext makes no sense and "
"will be ignored with AVFMT_NOFILE format.\n");
......@@ -548,7 +548,7 @@ static int init_input(AVFormatContext *s, const char *filename, AVDictionary **o
return ret;
if (s->iformat)
return 0;
return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, 0);
return av_probe_input_buffer(s->pb, &s->iformat, filename, s, 0, s->probesize);
}
static AVPacket *add_to_pktbuf(AVPacketList **packet_buffer, AVPacket *pkt,
......
......@@ -99,7 +99,7 @@ av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int
* a dictionary struct is allocated and put in *pm.
* @param key entry key to add to *pm (will be av_strduped depending on flags)
* @param value entry value to add to *pm (will be av_strduped depending on flags).
* Passing a NULL value will cause an existing tag to be deleted.
* Passing a NULL value will cause an existing entry to be deleted.
* @return >= 0 on success otherwise an error code <0
*/
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
......
bb952ae86c72d461aef7583685ec0a4d
62fbe4db4a49cb044f57f92cce9993c5
This diff is collapsed.
#tb 0: 1/15
#tb 1: 1/44100
0, 0, 0, 1, 69120, 0x68beb30f
1, 0, 0, 2709, 10836, 0xedecb6a7
1, 2709, 2709, 2709, 10836, 0x8098a323
1, 0, 0, 2708, 10832, 0x1597b4c8
1, 2708, 2708, 2708, 10832, 0xf9479f8b
0, 1, 1, 1, 69120, 0x3976f5cf
1, 5418, 5418, 2709, 10836, 0xcfa1112e
1, 5416, 5416, 2708, 10832, 0x8db50e74
0, 2, 2, 1, 69120, 0xf815bc3c
1, 8127, 8127, 2709, 10836, 0xe241ede4
1, 8124, 8124, 2708, 10832, 0x2b33ecbb
0, 3, 3, 1, 69120, 0xa7cc0ae6
1, 10836, 10836, 2709, 10836, 0xddf254bb
1, 10832, 10832, 2708, 10832, 0x8d0f537b
0, 4, 4, 1, 69120, 0xd85ac282
1, 13545, 13545, 2709, 10836, 0xa16c8507
1, 13540, 13540, 2708, 10832, 0x922081c7
0, 5, 5, 1, 69120, 0xf7fd7edb
1, 16254, 16254, 2709, 10836, 0xbe211f93
1, 16248, 16248, 2708, 10832, 0x40291f19
0, 6, 6, 1, 69120, 0x433bb6f6
1, 18963, 18963, 2709, 10836, 0x26c7283d
1, 18956, 18956, 2708, 10832, 0x88f5271a
0, 7, 7, 1, 69120, 0xdbac8bee
1, 21672, 21672, 2709, 10836, 0x4d18be56
1, 21664, 21664, 2708, 10832, 0x55c6bbe5
0, 8, 8, 1, 69120, 0x88e2a799
1, 24381, 24381, 2709, 10836, 0x57b9af6f
1, 24372, 24372, 2708, 10832, 0x9b51ae82
0, 9, 9, 1, 69120, 0x49617b26
1, 27090, 27090, 2709, 10836, 0xd5864280
1, 27080, 27080, 2708, 10832, 0xcdf2409b
0, 10, 10, 1, 69120, 0xeb44ca01
1, 29799, 29799, 2709, 10836, 0xd582b451
1, 29788, 29788, 2708, 10832, 0x0933b1a4
0, 11, 11, 1, 69120, 0x6fea37e8
1, 32508, 32508, 2709, 10836, 0xec13731d
1, 35217, 35217, 2709, 10836, 0xe3d4fbb8
1, 32496, 32496, 2708, 10832, 0x24b77006
1, 35204, 35204, 2708, 10832, 0xf612fa8a
0, 12, 12, 1, 69120, 0xf55d74c7
1, 37926, 37926, 2709, 10836, 0xcbb54d18
1, 37912, 37912, 2708, 10832, 0x99884b06
0, 13, 13, 1, 69120, 0xb5082ca7
1, 40635, 40635, 2709, 10836, 0xff7e7133
1, 40620, 40620, 2708, 10832, 0x3c746fbe
0, 14, 14, 1, 69120, 0x5876d758
1, 43344, 43344, 2709, 10836, 0xcc28b1a7
1, 43328, 43328, 2708, 10832, 0x05f3b08a
0, 15, 15, 1, 69120, 0x45e7dd5c
1, 46053, 46053, 2709, 10836, 0xbf9e07a5
1, 48762, 48762, 2709, 10836, 0x16408f38
1, 51471, 51471, 2709, 10836, 0x2b000c9f
1, 54180, 54180, 2709, 10836, 0x0ccd9811
1, 56889, 56889, 2709, 10836, 0xf9575d48
1, 59598, 59598, 2709, 10836, 0x1ee68190
1, 62307, 62307, 2709, 10836, 0xde435373
1, 65016, 65016, 2709, 10836, 0xd83be17a
1, 67725, 67725, 2709, 10836, 0x9a7f0bbe
1, 70434, 70434, 2709, 10836, 0x8709e4d3
1, 73143, 73143, 2709, 10836, 0xde1879cb
1, 46036, 46036, 2708, 10832, 0xa6560483
1, 48744, 48744, 2708, 10832, 0xd98a8e19
1, 51452, 51452, 2708, 10832, 0xf98a0b2e
1, 54160, 54160, 2708, 10832, 0xb1039582
1, 56868, 56868, 2708, 10832, 0x85dd5c3f
1, 59576, 59576, 2708, 10832, 0x19fc801a
1, 62284, 62284, 2708, 10832, 0x95805089
1, 64992, 64992, 2708, 10832, 0x576fdec3
1, 67700, 67700, 2708, 10832, 0x704a0905
1, 70408, 70408, 2708, 10832, 0xf87ce1fa
1, 73116, 73116, 2708, 10832, 0xfc0076b9
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment