diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-02-14 18:59:56 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2010-02-14 18:59:56 +0000 |
commit | 3adcfbbeb51e3e941b0fa8288d202400789eda53 (patch) | |
tree | 27a9ff9f1fb16800f09301ee2e59783f45775929 | |
parent | a59b9ee33d2442ab89a5a367eac3bc08c6b581da (diff) | |
download | ffmpeg-3adcfbbeb51e3e941b0fa8288d202400789eda53.tar.gz |
Optimize h261_probe function, since it is far slower than all others.
About 5 times faster.
Originally committed as revision 21823 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/raw.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/raw.c b/libavformat/raw.c index f4d7bb16c3..df3b01754d 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -497,6 +497,10 @@ static int h261_probe(AVProbeData *p) init_get_bits(&gb, p->buf, p->buf_size*8); for(i=0; i<p->buf_size*8; i++){ + if ((code & 0x01ff0000) || !(code & 0xff00)) { + code = (code<<8) + get_bits(&gb, 8); + i += 7; + } else code = (code<<1) + get_bits1(&gb); if ((code & 0xffff0000) == 0x10000) { int gn= (code>>12)&0xf; |