1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00
FFmpeg/libavcodec
Steinar H. Gunderson 88d80cb975 avcodec/put_bits: Make bit buffers 64-bit
Change BitBuf into uint64_t on 64-bit x86. This means we need to flush the
buffer less often, which is a significant speed win. All other platforms,
including all 32-bit ones, are unchanged. Output bitstream is the same.

All API constraints are kept in place, e.g., you still cannot put_bits()
more than 31 bits at a time. This is so that codecs cannot accidentally
become 64-bit-only or similar.

Benchmarking on transcoding to various formats shows consistently
positive results:

  dnxhd                 25.60 fps ->  26.26 fps ( +2.6%)
  dvvideo               24.88 fps ->  25.17 fps ( +1.2%)
  ffv1                  14.32 fps ->  14.58 fps ( +1.8%)
  huffyuv               58.75 fps ->  63.27 fps ( +7.7%)
  jpegls                 6.22 fps ->   6.34 fps ( +1.8%)
  magicyuv              57.10 fps ->  63.29 fps (+10.8%)
  mjpeg                 48.65 fps ->  49.01 fps ( +0.7%)
  mpeg1video            76.41 fps ->  77.01 fps ( +0.8%)
  mpeg2video            75.99 fps ->  77.43 fps ( +1.9%)
  mpeg4                 80.66 fps ->  81.37 fps ( +0.9%)
  prores                12.35 fps ->  12.88 fps ( +4.3%)
  prores_ks             16.20 fps ->  16.80 fps ( +3.7%)
  rv20                  62.80 fps ->  62.99 fps ( +0.3%)
  utvideo               68.41 fps ->  76.32 fps (+11.6%)

Note that this includes video decoding and all other encoding work,
such as DCTs. If you isolate the actual bit-writing routines, it is
likely to be much more.

Benchmark details: Transcoding the first 30 seconds of Big Buck Bunny
in 1080p, Haswell 2.1 GHz, GCC 8.3, generally quantizer locked to
5.0. (Exceptions: DNxHD needs fixed bitrate, and JPEG-LS is so slow
that I only took the first 10 seconds, not 30.) All runs were done
ten times and single-threaded, top and bottom two results discarded to
get rid of outliers, arithmetic mean between the remaining six.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-19 10:59:43 +02:00
..
2020-07-03 23:28:26 +02:00
2020-06-10 12:36:44 +02:00
2020-07-04 16:27:24 +01:00
2020-07-03 23:28:26 +02:00
2020-05-21 09:31:08 +02:00
2020-07-08 23:09:29 +08:00
2020-06-05 18:14:17 +02:00
2020-06-14 18:20:37 +02:00
2020-06-15 04:22:28 +02:00
2020-05-19 20:09:25 +02:00
2020-05-26 10:52:12 +01:00
2020-05-26 10:52:12 +01:00
2020-05-26 10:52:12 +01:00
2020-07-03 23:28:26 +02:00
2020-06-14 18:20:37 +02:00
2020-06-08 20:45:56 +02:00
2020-05-30 18:02:55 +02:00
2020-07-05 19:59:49 +02:00
2020-05-22 22:23:18 +02:00
2020-07-06 18:23:50 +01:00
2020-05-23 07:07:36 +02:00