[FFmpeg-cvslog] avformat/avidec: optimize probe

Michael Niedermayer git at videolan.org
Tue Dec 23 18:53:48 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 23 16:32:26 2014 +0100| [0d7a14e236eb05ae0473d2df3276a26f4b6596c8] | committer: Michael Niedermayer

avformat/avidec: optimize probe

about 2x as fast

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0d7a14e236eb05ae0473d2df3276a26f4b6596c8
---

 libavformat/avidec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 03c05a7..7016d2d 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1863,8 +1863,8 @@ static int avi_probe(AVProbeData *p)
 
     /* check file header */
     for (i = 0; avi_headers[i][0]; i++)
-        if (!memcmp(p->buf,     avi_headers[i],     4) &&
-            !memcmp(p->buf + 8, avi_headers[i] + 4, 4))
+        if (AV_RL32(p->buf    ) == AV_RL32(avi_headers[i]    ) &&
+            AV_RL32(p->buf + 8) == AV_RL32(avi_headers[i] + 4))
             return AVPROBE_SCORE_MAX;
 
     return 0;



More information about the ffmpeg-cvslog mailing list