changeset 5656:408c4e4d278a libavformat

Optimize h261_probe function, since it is far slower than all others. About 5 times faster.
author reimar
date Sun, 14 Feb 2010 18:59:56 +0000
parents aa15ce84d338
children 7bf8594a625a
files raw.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/raw.c	Sat Feb 13 17:57:24 2010 +0000
+++ b/raw.c	Sun Feb 14 18:59:56 2010 +0000
@@ -497,6 +497,10 @@
     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;