Commit 4fa0e247 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'newdev/master'

* newdev/master: (33 commits)
  Fix an infinite loop when RoQ encoded generated a frame with a size greater than the maximum valid size.
  Add kbdwin.o to AC3 decoder
  Detect byte-swapped AC-3 and support decoding it directly.
  cosmetics: indentation
  Always copy input data for AC3 decoder.
  ac3enc: make sym_quant() branch-free
  cosmetics: indentation
  Add a CPU flag for the Atom processor.
  id3v2: skip broken tags with invalid size
  id3v2: don't explicitly skip padding
  Make sure kbhit() is in conio.h
  fate: update wmv8-drm reference
  vc1: make P-frame deblock filter bit-exact.
  configure: Add the -D parameter to the dlltool command
  amr: Set the AVFMT_GENERIC_INDEX flag
  amr: Set the pkt->pos field properly to the start of the packet
  amr: Set the codec->bit_rate field based on the last packet
  rtsp: Specify unicast for TCP interleaved streams, too
  Set the correct target for mingw64 dlltool
  applehttp: Change the variable for stream position in seconds into int64_t
  ...

Conflicts:
	ffmpeg.c
	ffplay.c
	libavcodec/ac3dec.c
	libavformat/avio.h
	libavformat/id3v2.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 4952afff ee26abf2
......@@ -1040,7 +1040,6 @@ HAVE_LIST="
bswap
closesocket
cmov
conio_h
dcbzl
dev_bktr_ioctl_bt848_h
dev_bktr_ioctl_meteor_h
......@@ -1070,6 +1069,7 @@ HAVE_LIST="
inet_aton
inline_asm
isatty
kbhit
ldbrx
libdc1394_1
libdc1394_2
......@@ -1118,7 +1118,6 @@ HAVE_LIST="
sys_soundcard_h
sys_videoio_h
ten_operands
termios_h
threads
truncf
vfp_args
......@@ -2423,7 +2422,7 @@ case $target_os in
LIBTARGET=i386
if enabled x86_64; then
enable malloc_aligned
LIBTARGET=x64
LIBTARGET="i386:x86-64"
elif enabled arm; then
LIBTARGET=arm
fi
......@@ -2433,7 +2432,7 @@ case $target_os in
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"; \
install -d "$(LIBDIR)"; \
......@@ -2794,6 +2793,7 @@ check_func ${malloc_prefix}posix_memalign && enable posix_memalign
check_func setrlimit
check_func strerror_r
check_func strtok_r
check_func_headers conio.h kbhit
check_func_headers io.h setmode
check_func_headers lzo/lzo1x.h lzo1x_999_compress
check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
......@@ -2801,7 +2801,6 @@ check_func_headers windows.h GetProcessTimes
check_func_headers windows.h MapViewOfFile
check_func_headers windows.h VirtualAlloc
check_header conio.h
check_header dlfcn.h
check_header dxva2api.h
check_header libcrystalhd/libcrystalhd_if.h
......@@ -2810,7 +2809,6 @@ check_header poll.h
check_header sys/mman.h
check_header sys/resource.h
check_header sys/select.h
check_header termios.h
check_header vdpau/vdpau.h
check_header vdpau/vdpau_x11.h
check_header X11/extensions/XvMClib.h
......
......@@ -69,12 +69,7 @@
#include <sys/select.h>
#endif
#if HAVE_TERMIOS_H
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <termios.h>
#elif HAVE_CONIO_H
#if HAVE_KBHIT
#include <conio.h>
#endif
#include <time.h>
......@@ -343,12 +338,6 @@ typedef struct AVInputFile {
int nb_streams; /* nb streams we are aware of */
} AVInputFile;
#if HAVE_TERMIOS_H
/* init terminal so that we can grab keys */
static struct termios oldtty;
#endif
#if CONFIG_AVFILTER
static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
......@@ -436,9 +425,6 @@ static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
static void term_exit(void)
{
av_log(NULL, AV_LOG_QUIET, "");
#if HAVE_TERMIOS_H
tcsetattr (0, TCSANOW, &oldtty);
#endif
}
static volatile int received_sigterm = 0;
......@@ -452,26 +438,6 @@ sigterm_handler(int sig)
static void term_init(void)
{
#if HAVE_TERMIOS_H
struct termios tty;
tcgetattr (0, &tty);
oldtty = tty;
atexit(term_exit);
tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP
|INLCR|IGNCR|ICRNL|IXON);
tty.c_oflag |= OPOST;
tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN);
tty.c_cflag &= ~(CSIZE|PARENB);
tty.c_cflag |= CS8;
tty.c_cc[VMIN] = 1;
tty.c_cc[VTIME] = 0;
tcsetattr (0, TCSANOW, &tty);
signal(SIGQUIT, sigterm_handler); /* Quit (POSIX). */
#endif
signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */
signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */
#ifdef SIGXCPU
......@@ -482,25 +448,7 @@ static void term_init(void)
/* read a key without blocking */
static int read_key(void)
{
#if HAVE_TERMIOS_H
int n = 1;
unsigned char ch;
struct timeval tv;
fd_set rfds;
FD_ZERO(&rfds);
FD_SET(0, &rfds);
tv.tv_sec = 0;
tv.tv_usec = 0;
n = select(1, &rfds, NULL, NULL, &tv);
if (n > 0) {
n = read(0, &ch, 1);
if (n == 1)
return ch;
return n;
}
#elif HAVE_CONIO_H
#if HAVE_KBHIT
if(kbhit())
return(getch());
#endif
......@@ -2511,7 +2459,11 @@ static int transcode(AVFormatContext **output_files,
if (!using_stdin) {
if(verbose >= 0)
#if HAVE_KBHIT
fprintf(stderr, "Press [q] to stop encoding\n");
#else
fprintf(stderr, "Press ctrl-c to stop encoding\n");
#endif
url_set_interrupt_cb(decode_interrupt_cb);
}
term_init();
......
......@@ -57,7 +57,7 @@ OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o \
psymodel.o iirfilter.o \
mpeg4audio.o kbdwin.o
OBJS-$(CONFIG_AASC_DECODER) += aasc.o msrledec.o
OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o
OBJS-$(CONFIG_AC3_DECODER) += ac3dec.o ac3dec_data.o ac3.o kbdwin.o
OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o ac3tab.o ac3.o kbdwin.o
OBJS-$(CONFIG_AC3_FIXED_ENCODER) += ac3enc_fixed.o ac3tab.o ac3.o
OBJS-$(CONFIG_ALAC_DECODER) += alac.o
......
......@@ -208,6 +208,11 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
}
s->downmixed = 1;
/* allocate context input buffer */
s->input_buffer = av_mallocz(AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
if (!s->input_buffer)
return AVERROR(ENOMEM);
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
return 0;
}
......@@ -1306,26 +1311,17 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, int *data_size,
int blk, ch, err;
const uint8_t *channel_map;
const float *output[AC3_MAX_CHANNELS];
// if it seems to be byte-swapped AC-3 (aka DNET)
int is_swapped = buf_size >= 2 && AV_RB16(buf) == 0x770B;
/* initialize the GetBitContext with the start of valid AC-3 Frame */
if (is_swapped || avctx->error_recognition >= FF_ER_CAREFUL) {
/* allocate context input buffer */
if (!s->input_buffer)
s->input_buffer = av_mallocz(AC3_FRAME_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
if (!s->input_buffer)
return AVERROR(ENOMEM);
/* copy input buffer to decoder context to avoid reading past the end
of the buffer, which can be caused by a damaged input stream. */
if (is_swapped) {
int cnt = FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE) >> 1;
s->dsp.bswap16_buf((uint16_t *)s->input_buffer, (const uint16_t *)buf, cnt);
} else
/* copy input buffer to decoder context to avoid reading past the end
of the buffer, which can be caused by a damaged input stream. */
if (buf_size >= 2 && AV_RB16(buf) == 0x770B) {
// seems to be byte-swapped AC-3
int cnt = FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE) >> 1;
s->dsp.bswap16_buf((uint16_t *)s->input_buffer, (const uint16_t *)buf, cnt);
} else
memcpy(s->input_buffer, buf, FFMIN(buf_size, AC3_FRAME_BUFFER_SIZE));
buf = s->input_buffer;
}
buf = s->input_buffer;
/* initialize the GetBitContext with the start of valid AC-3 Frame */
init_get_bits(&s->gbc, buf, buf_size * 8);
/* parse the syncinfo */
......
......@@ -1096,17 +1096,7 @@ static int compute_bit_allocation(AC3EncodeContext *s)
*/
static inline int sym_quant(int c, int e, int levels)
{
int v;
if (c >= 0) {
v = (levels * (c << e)) >> 24;
v = (v + 1) >> 1;
v = (levels >> 1) + v;
} else {
v = (levels * ((-c) << e)) >> 24;
v = (v + 1) >> 1;
v = (levels >> 1) - v;
}
int v = ((((levels * c) >> (24 - e)) + 1) >> 1) + (levels >> 1);
av_assert2(v >= 0 && v < levels);
return v;
}
......
......@@ -47,4 +47,6 @@ struct DCTContext {
int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type);
void ff_dct_end (DCTContext *s);
void ff_dct_init_mmx(DCTContext *s);
#endif
......@@ -99,7 +99,6 @@ int ff_fft_init(FFTContext *s, int nbits, int inverse);
void ff_fft_init_altivec(FFTContext *s);
void ff_fft_init_mmx(FFTContext *s);
void ff_fft_init_arm(FFTContext *s);
void ff_dct_init_mmx(DCTContext *s);
void ff_fft_end(FFTContext *s);
......
......@@ -792,7 +792,7 @@ static av_cold int init_slice_contexts(FFV1Context *f){
fs->slice_x = sxs;
fs->slice_y = sys;
fs->sample_buffer = av_malloc(6 * (fs->width+6) * sizeof(*fs->sample_buffer));
fs->sample_buffer = av_malloc(9 * (fs->width+6) * sizeof(*fs->sample_buffer));
if (!fs->sample_buffer)
return AVERROR(ENOMEM);
}
......
......@@ -898,9 +898,20 @@ static void roq_encode_video(RoqContext *enc)
for (i=0; i<enc->width*enc->height/64; i++)
gather_data_for_cel(tempData->cel_evals + i, enc, tempData);
/* Quake 3 can't handle chunks bigger than 65536 bytes */
if (tempData->mainChunkSize/8 > 65536) {
enc->lambda *= .8;
/* Quake 3 can't handle chunks bigger than 65535 bytes */
if (tempData->mainChunkSize/8 > 65535) {
av_log(enc->avctx, AV_LOG_ERROR,
"Warning, generated a frame too big (%d > 65535), "
"try using a smaller qscale value.\n",
tempData->mainChunkSize/8);
enc->lambda *= 1.5;
tempData->mainChunkSize = 0;
memset(tempData->used_option, 0, sizeof(tempData->used_option));
memset(tempData->codebooks.usedCB4, 0,
sizeof(tempData->codebooks.usedCB4));
memset(tempData->codebooks.usedCB2, 0,
sizeof(tempData->codebooks.usedCB2));
goto retry_encode;
}
......
......@@ -863,6 +863,7 @@ int vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
}
}
if(v->panscanflag) {
av_log_missing_feature(v->s.avctx, "Pan-scan", 0);
//...
}
v->rnd = get_bits1(gb);
......
......@@ -236,7 +236,7 @@ typedef struct VC1Context{
//@}
int ttfrm; ///< Transform type info present at frame level
uint8_t ttmbf; ///< Transform type flag
uint8_t ttblk4x4; ///< Value of ttblk which indicates a 4x4 transform
int *ttblk_base, *ttblk; ///< Transform type at the block level
int codingset; ///< index of current table set from 11.8 to use for luma block decoding
int codingset2; ///< index of current table set from 11.8 to use for chroma block decoding
int pqindex; ///< raw pqindex used in coding set selection
......@@ -311,6 +311,8 @@ typedef struct VC1Context{
int x8_type;
uint32_t *cbp_base, *cbp;
uint8_t *is_intra_base, *is_intra;
int16_t (*luma_mv_base)[2], (*luma_mv)[2];
uint8_t bfraction_lut_index;///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
uint8_t broken_link; ///< Broken link flag (BROKEN_LINK syntax element)
uint8_t closed_entry; ///< Closed entry point flag (CLOSED_ENTRY syntax element)
......
This diff is collapsed.
......@@ -121,6 +121,7 @@ static int amr_read_packet(AVFormatContext *s,
{
AVCodecContext *enc = s->streams[0]->codec;
int read, size = 0, toc, mode;
int64_t pos = avio_tell(s->pb);
if (url_feof(s->pb))
{
......@@ -153,8 +154,11 @@ static int amr_read_packet(AVFormatContext *s,
return AVERROR(EIO);
}
/* Both AMR formats have 50 frames per second */
s->streams[0]->codec->bit_rate = size*8*50;
pkt->stream_index = 0;
pkt->pos= avio_tell(s->pb);
pkt->pos = pos;
pkt->data[0]=toc;
pkt->duration= enc->codec_id == CODEC_ID_AMR_NB ? 160 : 320;
read = avio_read(s->pb, pkt->data+1, size-1);
......@@ -177,6 +181,7 @@ AVInputFormat ff_amr_demuxer = {
amr_read_header,
amr_read_packet,
NULL,
.flags = AVFMT_GENERIC_INDEX,
};
#endif
......
......@@ -496,7 +496,8 @@ static int applehttp_read_seek(AVFormatContext *s, int stream_index,
int64_t timestamp, int flags)
{
AppleHTTPContext *c = s->priv_data;
int pos = 0, i;
int64_t pos = 0;
int i;
struct variant *var = c->variants[0];
if ((flags & AVSEEK_FLAG_BYTE) || !c->finished)
......
......@@ -25,6 +25,7 @@
#include "libavutil/avstring.h"
#include "libavcodec/mpegaudio.h"
#include "avformat.h"
#include "avio_internal.h"
#include "riff.h"
#include "asf.h"
#include "asfcrypt.h"
......@@ -1241,7 +1242,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int
/* Try using the protocol's read_seek if available */
if(s->pb) {
int ret = av_url_read_fseek(s->pb, stream_index, pts, flags);
int ret = ffio_read_seek(s->pb, stream_index, pts, flags);
if(ret >= 0)
asf_reset_header(s);
if (ret != AVERROR(ENOSYS))
......
......@@ -415,6 +415,9 @@ attribute_deprecated void put_tag(AVIOContext *s, const char *tag);
* @}
*/
attribute_deprecated int av_url_read_fpause(AVIOContext *h, int pause);
attribute_deprecated int64_t av_url_read_fseek( AVIOContext *h, int stream_index,
int64_t timestamp, int flags);
/**
* @defgroup old_url_f_funcs Old url_f* functions
......@@ -512,10 +515,6 @@ int64_t avio_size(AVIOContext *s);
*/
int url_feof(AVIOContext *s);
int av_url_read_fpause(AVIOContext *h, int pause);
int64_t av_url_read_fseek(AVIOContext *h, int stream_index,
int64_t timestamp, int flags);
/** @warning currently size is limited */
#ifdef __GNUC__
int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
......@@ -622,9 +621,10 @@ int url_resetbuf(AVIOContext *s, int flags);
int avio_open(AVIOContext **s, const char *url, int flags);
int avio_close(AVIOContext *s);
URLContext *url_fileno(AVIOContext *s);
#if FF_API_OLD_AVIO
attribute_deprecated URLContext *url_fileno(AVIOContext *s);
/**
* @deprecated use AVIOContext.max_packet_size directly.
*/
......
......@@ -66,4 +66,9 @@ uint64_t ffio_read_varlen(AVIOContext *bc);
/** @warning must be called before any I/O */
int ffio_set_buf_size(AVIOContext *s, int buf_size);
int ffio_read_pause(AVIOContext *h, int pause);
int64_t ffio_read_seek( AVIOContext *h, int stream_index,
int64_t timestamp, int flags);
#endif // AVFORMAT_AVIO_INTERNAL_H
......@@ -406,6 +406,15 @@ void put_flush_packet(AVIOContext *s)
{
avio_flush(s);
}
int av_url_read_fpause(AVIOContext *s, int pause)
{
return ffio_read_pause(s, pause);
}
int64_t av_url_read_fseek(AVIOContext *s, int stream_index,
int64_t timestamp, int flags)
{
return ffio_read_seek(s, stream_index, timestamp, flags);
}
#endif
int avio_put_str(AVIOContext *s, const char *str)
......@@ -932,10 +941,12 @@ int avio_close(AVIOContext *s)
return url_close(h);
}
#if FF_API_OLD_AVIO
URLContext *url_fileno(AVIOContext *s)
{
return s->opaque;
}
#endif
int avio_printf(AVIOContext *s, const char *fmt, ...)
{
......@@ -978,15 +989,15 @@ int url_fget_max_packet_size(AVIOContext *s)
}
#endif
int av_url_read_fpause(AVIOContext *s, int pause)
int ffio_read_pause(AVIOContext *s, int pause)
{
if (!s->read_pause)
return AVERROR(ENOSYS);
return s->read_pause(s->opaque, pause);
}
int64_t av_url_read_fseek(AVIOContext *s, int stream_index,
int64_t timestamp, int flags)
int64_t ffio_read_seek(AVIOContext *s, int stream_index,
int64_t timestamp, int flags)
{
URLContext *h = s->opaque;
int64_t ret;
......
......@@ -28,6 +28,7 @@
#include "libavcodec/bytestream.h"
#include "libavcodec/mpeg4audio.h"
#include "avformat.h"
#include "avio_internal.h"
#include "flv.h"
typedef struct {
......@@ -461,7 +462,7 @@ leave:
static int flv_read_seek(AVFormatContext *s, int stream_index,
int64_t ts, int flags)
{
return av_url_read_fseek(s->pb, stream_index, ts, flags);
return ffio_read_seek(s->pb, stream_index, ts, flags);
}
#if 0 /* don't know enough to implement this */
......@@ -482,7 +483,7 @@ static int flv_read_seek2(AVFormatContext *s, int stream_index,
ts = av_rescale_rnd(ts, 1000, AV_TIME_BASE,
flags & AVSEEK_FLAG_BACKWARD ? AV_ROUND_DOWN : AV_ROUND_UP);
}
ret = av_url_read_fseek(s->pb, stream_index, ts, flags);
ret = ffio_read_seek(s->pb, stream_index, ts, flags);
}
if (ret == AVERROR(ENOSYS))
......
......@@ -187,9 +187,9 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
int isv34, unsync;
unsigned tlen;
char tag[5];
int64_t next;
int64_t next, end = avio_tell(s->pb) + len;
int taghdrlen;
const char *reason;
const char *reason = NULL;
AVIOContext pb;
unsigned char *buffer = NULL;
int buffer_size = 0;
......@@ -282,20 +282,15 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t
avio_seek(s->pb, next, SEEK_SET);
}
if (len > 0) {
/* Skip padding */
avio_skip(s->pb, len);
}
if (version == 4 && flags & 0x10) /* Footer preset, always 10 bytes, skip over it */
avio_skip(s->pb, 10);
av_free(buffer);
return;
end += 10;
error:
av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n", version, reason);
avio_seek(s->pb, len, SEEK_CUR);
if (reason)
av_log(s, AV_LOG_INFO, "ID3v2.%d tag skipped, cannot handle %s\n", version, reason);
avio_seek(s->pb, end, SEEK_SET);
av_free(buffer);
return;
}
void ff_id3v2_read(AVFormatContext *s, const char *magic)
......
......@@ -90,7 +90,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
return -1;
/* Check for Xing / Info tag */
avio_seek(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1], SEEK_CUR);
avio_skip(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1]);
v = avio_rb32(s->pb);
if(v == MKBETAG('X', 'i', 'n', 'g') || v == MKBETAG('I', 'n', 'f', 'o')) {
v = avio_rb32(s->pb);
......
......@@ -436,7 +436,7 @@ static int rm_write_trailer(AVFormatContext *s)
if (!url_is_streamed(s->pb)) {
/* end of file: finish to write header */
index_pos = avio_seek(pb, 0, SEEK_CUR);
index_pos = avio_tell(pb);
data_size = index_pos - rm->data_pos;
/* FIXME: write index */
......
......@@ -1157,7 +1157,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
continue;
snprintf(transport, sizeof(transport) - 1,
"%s/TCP;", trans_pref);
if (rt->server_type == RTSP_SERVER_WMS)
if (rt->transport != RTSP_TRANSPORT_RDT)
av_strlcat(transport, "unicast;", sizeof(transport));
av_strlcatf(transport, sizeof(transport),
"interleaved=%d-%d",
......
......@@ -2554,7 +2554,7 @@ int av_read_play(AVFormatContext *s)
if (s->iformat->read_play)
return s->iformat->read_play(s);
if (s->pb)
return av_url_read_fpause(s->pb, 0);
return ffio_read_pause(s->pb, 0);
return AVERROR(ENOSYS);
}
......@@ -2563,7 +2563,7 @@ int av_read_pause(AVFormatContext *s)
if (s->iformat->read_pause)
return s->iformat->read_pause(s);
if (s->pb)
return av_url_read_fpause(s->pb, 1);
return ffio_read_pause(s->pb, 1);
return AVERROR(ENOSYS);
}
......
......@@ -701,10 +701,10 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
return NULL;
if (!ff_guidcmp(formattype, format_videoinfo2)) {
int consumed = parse_videoinfoheader2(s, st);
avio_seek(pb, FFMAX(size - consumed, 0), SEEK_CUR);
avio_skip(pb, FFMAX(size - consumed, 0));
} else if (!ff_guidcmp(formattype, format_mpeg2_video)) {
int consumed = parse_videoinfoheader2(s, st);
avio_seek(pb, FFMAX(size - consumed, 0), SEEK_CUR);
avio_skip(pb, FFMAX(size - consumed, 0));
} else {
if (ff_guidcmp(formattype, format_none))
av_log(s, AV_LOG_WARNING, "unknown formattype:"PRI_GUID"\n", ARG_GUID(formattype));
......
......@@ -58,6 +58,7 @@ int main(void)
cpu_flags & AV_CPU_FLAG_SSE3 ? "SSE3 " : "",
cpu_flags & AV_CPU_FLAG_SSE3SLOW ? "SSE3(slow) " : "",
cpu_flags & AV_CPU_FLAG_SSSE3 ? "SSSE3 " : "",
cpu_flags & AV_CPU_FLAG_ATOM ? "Atom " : "",
cpu_flags & AV_CPU_FLAG_SSE4 ? "SSE4.1 " : "",
cpu_flags & AV_CPU_FLAG_SSE42 ? "SSE4.2 " : "",
cpu_flags & AV_CPU_FLAG_AVX ? "AVX " : "",
......
......@@ -34,6 +34,7 @@
#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions
#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions
#define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower
#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions
#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions
#define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
......
......@@ -135,16 +135,24 @@ int ff_get_cpu_flags_x86(void)
}
}
if (!strncmp(vendor.c, "GenuineIntel", 12) &&
family == 6 && (model == 9 || model == 13 || model == 14)) {
/* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and 6/14 (core1 "yonah")
* theoretically support sse2, but it's usually slower than mmx,
* so let's just pretend they don't. AV_CPU_FLAG_SSE2 is disabled and
* AV_CPU_FLAG_SSE2SLOW is enabled so that SSE2 is not used unless
* explicitly enabled by checking AV_CPU_FLAG_SSE2SLOW. The same
* situation applies for AV_CPU_FLAG_SSE3 and AV_CPU_FLAG_SSE3SLOW. */
if (rval & AV_CPU_FLAG_SSE2) rval ^= AV_CPU_FLAG_SSE2SLOW|AV_CPU_FLAG_SSE2;
if (rval & AV_CPU_FLAG_SSE3) rval ^= AV_CPU_FLAG_SSE3SLOW|AV_CPU_FLAG_SSE3;
if (!strncmp(vendor.c, "GenuineIntel", 12)) {
if (family == 6 && (model == 9 || model == 13 || model == 14)) {
/* 6/9 (pentium-m "banias"), 6/13 (pentium-m "dothan"), and 6/14 (core1 "yonah")
* theoretically support sse2, but it's usually slower than mmx,
* so let's just pretend they don't. AV_CPU_FLAG_SSE2 is disabled and
* AV_CPU_FLAG_SSE2SLOW is enabled so that SSE2 is not used unless
* explicitly enabled by checking AV_CPU_FLAG_SSE2SLOW. The same
* situation applies for AV_CPU_FLAG_SSE3 and AV_CPU_FLAG_SSE3SLOW. */
if (rval & AV_CPU_FLAG_SSE2) rval ^= AV_CPU_FLAG_SSE2SLOW|AV_CPU_FLAG_SSE2;
if (rval & AV_CPU_FLAG_SSE3) rval ^= AV_CPU_FLAG_SSE3SLOW|AV_CPU_FLAG_SSE3;
}
/* The Atom processor has SSSE3 support, which is useful in many cases,
* but sometimes the SSSE3 version is slower than the SSE2 equivalent
* on the Atom, but is generally faster on other processors supporting
* SSSE3. This flag allows for selectively disabling certain SSSE3
* functions on the Atom. */
if (family == 6 && model == 28)
rval |= AV_CPU_FLAG_ATOM;
}
return rval;
......
......@@ -2,14 +2,14 @@
0, 3600, 38016, 0xf4715db5
0, 7200, 38016, 0xf4715db5
0, 10800, 38016, 0xf46af0e1
0, 14400, 38016, 0x96992cf1
0, 18000, 38016, 0xbaadd874
0, 21600, 38016, 0x751f4328
0, 25200, 38016, 0x751f4328
0, 28800, 38016, 0xf7294772
0, 32400, 38016, 0xf7294772
0, 36000, 38016, 0xf1d12133
0, 39600, 38016, 0xf1d12133
0, 43200, 38016, 0xf1d12133
0, 46800, 38016, 0xf1d12133
0, 50400, 38016, 0xf1d12133
0, 14400, 38016, 0x9c1c2cf1
0, 18000, 38016, 0xff12d87f
0, 21600, 38016, 0x7408432b
0, 25200, 38016, 0x7408432b
0, 28800, 38016, 0x8d11479a
0, 32400, 38016, 0x8d11479a
0, 36000, 38016, 0xc4a121ab
0, 39600, 38016, 0xc4a121ab
0, 43200, 38016, 0xc4a121ab
0, 46800, 38016, 0xc4a121ab
0, 50400, 38016, 0xc4a121ab
......@@ -34,129 +34,129 @@
0, 123750, 84480, 0xabf7c25d
0, 127500, 84480, 0x912600ee
0, 131250, 84480, 0x7ee7c70b
0, 135000, 84480, 0xe212b0d1
0, 138750, 84480, 0xd4fa6c16
0, 142500, 84480, 0xd10fa126
0, 146250, 84480, 0xda91d3aa
0, 150000, 84480, 0xd90be940
0, 153750, 84480, 0x908a009b
0, 157500, 84480, 0xdd26d6e9
0, 161250, 84480, 0xfeda8de9
0, 165000, 84480, 0x96d66505
0, 168750, 84480, 0xf43b4b1b
0, 172500, 84480, 0xd44122c2
0, 176250, 84480, 0xc65da7a9
0, 180000, 84480, 0xbf4178f2
0, 183750, 84480, 0x96be846a
0, 187500, 84480, 0x73e6459e
0, 191250, 84480, 0x70086917
0, 195000, 84480, 0x9b12571d
0, 198750, 84480, 0xe4ce7bce
0, 202500, 84480, 0x845672e5
0, 206250, 84480, 0x1c17e189
0, 210000, 84480, 0x12a877d0
0, 213750, 84480, 0xca62e8ed
0, 217500, 84480, 0x87beb28f
0, 221250, 84480, 0x1ba915a4
0, 225000, 84480, 0x159fc9c4
0, 228750, 84480, 0xcec3e3ef
0, 232500, 84480, 0x96a42f48
0, 236250, 84480, 0xcd17decf
0, 240000, 84480, 0x4cf95d6c
0, 243750, 84480, 0xa258400e
0, 247500, 84480, 0xb9c566d8
0, 251250, 84480, 0xc39f6dab
0, 255000, 84480, 0xd08a0880
0, 258750, 84480, 0x41e3a70f
0, 262500, 84480, 0x0ded83d9
0, 266250, 84480, 0x74a915ea
0, 270000, 84480, 0x00c2c849
0, 273750, 84480, 0x709a9b07
0, 277500, 84480, 0xfb276daa
0, 281250, 84480, 0x89ca744b
0, 285000, 84480, 0x457ba569
0, 288750, 84480, 0xc37c8d57
0, 292500, 84480, 0x1890a97e
0, 296250, 84480, 0xe455b8d0
0, 300000, 84480, 0x1f6bdbce
0, 303750, 84480, 0x9df90ed1
0, 307500, 84480, 0xff80328c
0, 311250, 84480, 0x0e115940
0, 315000, 84480, 0x09ddc11d
0, 318750, 84480, 0xeef241e9
0, 322500, 84480, 0xbe3578b4
0, 326250, 84480, 0x2a83f0f3
0, 330000, 84480, 0xb41d01c2
0, 333750, 84480, 0x630efd97
0, 337500, 84480, 0xd592140d
0, 341250, 84480, 0x7110f627
0, 345000, 84480, 0x2dbaa590
0, 348750, 84480, 0x13d80be5
0, 352500, 84480, 0xb8f3740d
0, 356250, 84480, 0xd9a6fcef
0, 360000, 84480, 0x56bfa4e3
0, 363750, 84480, 0x49364550
0, 367500, 84480, 0x0a2f1690
0, 371250, 84480, 0xb87fccbf
0, 375000, 84480, 0xb2aa69f7
0, 378750, 84480, 0x176bf378
0, 382500, 84480, 0xe7a6de45
0, 386250, 84480, 0x8e3900a6
0, 390000, 84480, 0x24a72099
0, 393750, 84480, 0x5394df95
0, 397500, 84480, 0xd648c92e
0, 401250, 84480, 0xab95fb62
0, 405000, 84480, 0xe3239cb0
0, 408750, 84480, 0xb4f93467
0, 412500, 84480, 0x94d0d01d
0, 416250, 84480, 0x6316a25e
0, 420000, 84480, 0x6316a25e
0, 423750, 84480, 0x6316a25e
0, 427500, 84480, 0x6316a25e
0, 431250, 84480, 0x6316a25e
0, 435000, 84480, 0x6316a25e
0, 438750, 84480, 0x6316a25e
0, 135000, 84480, 0x09c5b0d1
0, 138750, 84480, 0x6dbe6c0c
0, 142500, 84480, 0x0fe0a120
0, 146250, 84480, 0x2352d3a2
0, 150000, 84480, 0xb22ce92e
0, 153750, 84480, 0x31db0099
0, 157500, 84480, 0xad2dd73a
0, 161250, 84480, 0xb9af8e20
0, 165000, 84480, 0x7b956549
0, 168750, 84480, 0x3f774b87
0, 172500, 84480, 0x824a23a3
0, 176250, 84480, 0x4469a8d8
0, 180000, 84480, 0xc80c7a0a
0, 183750, 84480, 0xcf958549
0, 187500, 84480, 0x449746e3
0, 191250, 84480, 0xbac66a82
0, 195000, 84480, 0x99e85855
0, 198750, 84480, 0xa4a17d17
0, 202500, 84480, 0xe29c7587
0, 206250, 84480, 0x551de592
0, 210000, 84480, 0xe0877bce
0, 213750, 84480, 0x9660eb35
0, 217500, 84480, 0x0a34b644
0, 221250, 84480, 0x352919f0
0, 225000, 84480, 0xef56ce27
0, 228750, 84480, 0x030fe862
0, 232500, 84480, 0x2eba33e2
0, 236250, 84480, 0x242de401
0, 240000, 84480, 0xbadd61ca
0, 243750, 84480, 0x2060465b
0, 247500, 84480, 0x256e6965
0, 251250, 84480, 0x243b7084
0, 255000, 84480, 0x8b3c0b47
0, 258750, 84480, 0xc174a9af
0, 262500, 84480, 0xb6d48686
0, 266250, 84480, 0xa3dd1871
0, 270000, 84480, 0x04cdcaf7
0, 273750, 84480, 0x55f89c94
0, 277500, 84480, 0xda657032
0, 281250, 84480, 0x38ba7698
0, 285000, 84480, 0x4d03a7f2
0, 288750, 84480, 0x115d9035
0, 292500, 84480, 0x24c6acc6
0, 296250, 84480, 0xdd2bbcae
0, 300000, 84480, 0xb4fee0b9
0, 303750, 84480, 0xc51c14e0
0, 307500, 84480, 0xfb7737de
0, 311250, 84480, 0x38675fb0
0, 315000, 84480, 0x4752c710
0, 318750, 84480, 0xfeb7491b
0, 322500, 84480, 0xaa248122
0, 326250, 84480, 0x9a4af87c
0, 330000, 84480, 0xedcf09df
0, 333750, 84480, 0x563a05df
0, 337500, 84480, 0x0dde1e03
0, 341250, 84480, 0xd8f0ff65
0, 345000, 84480, 0xbeb9ae1a
0, 348750, 84480, 0x416d1468
0, 352500, 84480, 0x66c87d4c
0, 356250, 84480, 0xa67c0774
0, 360000, 84480, 0xd8f8aec1
0, 363750, 84480, 0xadfa502b
0, 367500, 84480, 0x50bf20e4
0, 371250, 84480, 0xbcb3d8cc
0, 375000, 84480, 0xa54677d7
0, 378750, 84480, 0x3566042d
0, 382500, 84480, 0x4c9eed57
0, 386250, 84480, 0xc3b90e58
0, 390000, 84480, 0x3c042bfa
0, 393750, 84480, 0x19f8e890
0, 397500, 84480, 0xd3dacfb9
0, 401250, 84480, 0x2365fc6f
0, 405000, 84480, 0xa2c19d00
0, 408750, 84480, 0xce94336f
0, 412500, 84480, 0xfa9bcf14
0, 416250, 84480, 0x24d6a243
0, 420000, 84480, 0x24d6a243
0, 423750, 84480, 0x24d6a243
0, 427500, 84480, 0x24d6a243
0, 431250, 84480, 0x24d6a243
0, 435000, 84480, 0x24d6a243
0, 438750, 84480, 0x24d6a243
0, 442500, 84480, 0xae1c8854
0, 446250, 84480, 0x30fe68bf
0, 450000, 84480, 0xfd1435c8
0, 453750, 84480, 0xddf57fab
0, 457500, 84480, 0xc3553a51
0, 461250, 84480, 0xd9ce7ae8
0, 465000, 84480, 0x671765cb
0, 468750, 84480, 0x78336eab
0, 472500, 84480, 0xb66b659c
0, 476250, 84480, 0x0e1f68bb
0, 480000, 84480, 0x8f4669dc
0, 483750, 84480, 0x60c47360
0, 487500, 84480, 0x93037246
0, 491250, 84480, 0xdebe620d
0, 495000, 84480, 0x7555161e
0, 498750, 84480, 0xcbaf4311
0, 502500, 84480, 0x8e3783a0
0, 506250, 84480, 0x3888008f
0, 510000, 84480, 0x8a4fa114
0, 513750, 84480, 0xac0bf10b
0, 517500, 84480, 0xb485ff7f
0, 521250, 84480, 0xeaec2133
0, 525000, 84480, 0x105827cd
0, 528750, 84480, 0x55ff4b2d
0, 532500, 84480, 0x78c64a49
0, 536250, 84480, 0x3897731d
0, 540000, 84480, 0x9ca891aa
0, 543750, 84480, 0x24a6ab0a
0, 547500, 84480, 0x88fdc6fb
0, 551250, 84480, 0x05afea61
0, 555000, 84480, 0xe703e2cf
0, 558750, 84480, 0x9eb0e64a
0, 562500, 84480, 0x92a7f0ab
0, 566250, 84480, 0xec2bfbfb
0, 570000, 84480, 0x7db600ad
0, 573750, 84480, 0x4abd6393
0, 577500, 84480, 0x54ce06b5
0, 581250, 84480, 0x7cb6f150
0, 585000, 84480, 0x099d4aeb
0, 588750, 84480, 0x0bcfdc31
0, 592500, 84480, 0xe4e72d1f
0, 596250, 84480, 0xbce22331
0, 600000, 84480, 0x020545d7
0, 603750, 84480, 0x71869e48
0, 446250, 84480, 0xbb8968bf
0, 450000, 84480, 0x6f923623
0, 453750, 84480, 0x22e98029
0, 457500, 84480, 0x8ac33af3
0, 461250, 84480, 0x05947b6e
0, 465000, 84480, 0xfc35661a
0, 468750, 84480, 0x0e6b6e47
0, 472500, 84480, 0x82c764bb
0, 476250, 84480, 0x57a36833
0, 480000, 84480, 0xc8dd690a
0, 483750, 84480, 0x02c47232
0, 487500, 84480, 0x6645715d
0, 491250, 84480, 0xc64860f7
0, 495000, 84480, 0x4f5614b3
0, 498750, 84480, 0xa70842ca
0, 502500, 84480, 0x379d8458
0, 506250, 84480, 0xa14701cf
0, 510000, 84480, 0xad1aa2b2
0, 513750, 84480, 0xee28f320
0, 517500, 84480, 0x505801e9
0, 521250, 84480, 0x7947233b
0, 525000, 84480, 0x3ce72a9d
0, 528750, 84480, 0xa6834e64
0, 532500, 84480, 0xfebf4d70
0, 536250, 84480, 0x4a0775e2
0, 540000, 84480, 0x9d7e945b
0, 543750, 84480, 0xaa9eadd9
0, 547500, 84480, 0xaa85c9b1
0, 551250, 84480, 0xa005edaf
0, 555000, 84480, 0x7fc4e5cc
0, 558750, 84480, 0xb0f6e8d1
0, 562500, 84480, 0x9ef9f330
0, 566250, 84480, 0xbe14ff1f
0, 570000, 84480, 0xd494048c
0, 573750, 84480, 0x046166a7
0, 577500, 84480, 0x052a09b2
0, 581250, 84480, 0x71fff4ab
0, 585000, 84480, 0xb9684e41
0, 588750, 84480, 0x1ddce068
0, 592500, 84480, 0xb9de300e
0, 596250, 84480, 0x13962590
0, 600000, 84480, 0xde79482f
0, 603750, 84480, 0x7d1ca064
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