]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/fraps: Use cached bitstream reader
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 22 Sep 2020 08:12:15 +0000 (10:12 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 26 Sep 2020 19:10:45 +0000 (21:10 +0200)
This proved beneficial for performance: For the sample [1] the number
of decicycles in one decode call decreased from 155851561 to 108158037
for Clang 10 and from 168270467 to 128847479 for GCC 9.3. For x86-32
compiled with GCC 9.3 and run on an x64 Haswell the number increased
from 158405517 to 202215769, so that the cached bitstream reader is only
enabled if HAVE_FAST_64BIT is set. These values are the average of 10
runs each looping five times over the input.

[1]: samples.ffmpeg.org/ffmpeg-bugs/trac/ticket2593/fraps_flv1_decoding_errors.avi

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/fraps.c

index 00fd63ffec03e1b0fc5860c1897442024adc1cd5..8d01b44f1106389a18879936cceaa1873de40aa1 100644 (file)
@@ -31,6 +31,9 @@
  * Version 2 files support by Konstantin Shishkov
  */
 
+#include "config.h"
+
+#define CACHED_BITSTREAM_READER HAVE_FAST_64BIT
 #define UNCHECKED_BITSTREAM_READER 1
 #include "avcodec.h"
 #include "get_bits.h"