1. 27 Nov, 2015 4 commits
    • Rostislav Pehlivanov's avatar
      aacenc: make threadsafe · 3d62e7a3
      Rostislav Pehlivanov authored
      Since the ff_aac_tableinit() can be called by both the encoder and
      the decoder (in case of transcoding) this commit shares the AVOnce
      variable to prevent this.
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      3d62e7a3
    • Michael Niedermayer's avatar
      avcodec/cabac: Check initial cabac decoder state · 8000d484
      Michael Niedermayer authored
      Fixes integer overflows
      Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2340_591e9810c7b09efe501ad84638c9e9f8.264
      
      Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
      Found-by: xiedingbao (Ticket4727)
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      8000d484
    • Michael Niedermayer's avatar
      avcodec/cabac_functions: Fix "left shift of negative value -31767" · a1f6b05f
      Michael Niedermayer authored
      Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2340_591e9810c7b09efe501ad84638c9e9f8.264
      
      Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
      Found-by: xiedingbao (Ticket4727)
      Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
      a1f6b05f
    • Ganesh Ajjanagadde's avatar
      avcodec/aac_tablegen: speed up table initialization · 96786a12
      Ganesh Ajjanagadde authored
      This speeds up aac_tablegen to a ludicruous degree (~97%), i.e to the point
      where it can be argued that runtime initialization can always be done instead of
      hard-coded tables. The only cost is essentially a trivial increase in
      the stack size.
      
      Even if one does not care about this, the patch also improves accuracy
      as detailed below.
      
      Performance:
      Benchmark obtained by looping 10^4 times over ff_aac_tableinit.
      
      Sample benchmark (x86-64, Haswell, GNU/Linux):
      old:
      1295292 decicycles in ff_aac_tableinit,     512 runs,      0 skips
      1275981 decicycles in ff_aac_tableinit,    1024 runs,      0 skips
      1272932 decicycles in ff_aac_tableinit,    2048 runs,      0 skips
      1262164 decicycles in ff_aac_tableinit,    4096 runs,      0 skips
      1256720 decicycles in ff_aac_tableinit,    8192 runs,      0 skips
      
      new:
      21112 decicycles in ff_aac_tableinit,     511 runs,      1 skips
      21269 decicycles in ff_aac_tableinit,    1023 runs,      1 skips
      21352 decicycles in ff_aac_tableinit,    2043 runs,      5 skips
      21386 decicycles in ff_aac_tableinit,    4080 runs,     16 skips
      21299 decicycles in ff_aac_tableinit,    8173 runs,     19 skips
      
      Accuracy:
      The previous code was resulting in needless loss of
      accuracy due to the pow being called in succession. As an illustration
      of this:
      ff_aac_pow34sf_tab[3]
      old : 0.000000000007598092294225
      new : 0.000000000007598091426864
      real: 0.000000000007598091778545
      
      truncated to float
      old : 0.000000000007598092294225
      new : 0.000000000007598091426864
      real: 0.000000000007598091426864
      
      showing that the old value was not correctly rounded. This affects a
      large number of elements of the array.
      
      Patch tested with FATE.
      Reviewed-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
      96786a12
  2. 26 Nov, 2015 15 commits
  3. 25 Nov, 2015 16 commits
  4. 24 Nov, 2015 5 commits