1. 21 Jan, 2016 1 commit
  2. 17 Jan, 2016 2 commits
  3. 08 Dec, 2015 1 commit
  4. 06 Dec, 2015 1 commit
    • Rostislav Pehlivanov's avatar
      aacenc_tns: tune and reduce artifacts · d55f83de
      Rostislav Pehlivanov authored
      There are a couple of major changes here:
      
      1. Start using TNS coefficient compression.
      2. Start using 3 bits per coefficient maximum for short windows.
      The bits we save from these 2 changes seem to make a nice impact on the
      rest of the file/windows.
      
      3. Remove special case gain checking for short windows.
      4. Modify the coefficient loop to support up to 3 windows.
      The additional restrictions on TNS were something that was no in the
      specifications and furthermore restricting TNS to only low energy short
      windows was done to compensate for bugs elsewhere in the code.
      
      Overall, the improvements here reduce crackling artifacts heard in very
      noisy tracks.
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      d55f83de
  5. 05 Dec, 2015 1 commit
  6. 17 Oct, 2015 4 commits
    • Rostislav Pehlivanov's avatar
      aacenc_tns: rework TNS descision logic · fa4d900c
      Rostislav Pehlivanov authored
      Changes:
       - strongly prefer dual filters to a single filter
       - less strict about using 2 filters w.r.t. energy
       - scrap the usage of threshold and spread, useless
       - use odd-shaped windows to set the filter direction
       - use 4 bits instead of 3 bits for short windows
       - simplify and reduce the main loop to a single level
       - add stricter regulations for short windows
      
      All of this now makes the TNS implementation operate
      as good as it can and it definitely shows. The frequency
      thresholds are now even better defined by looking at
      the spectrals and the overall sound has been improved at
      the price of just a few bits that are well worth it.
      fa4d900c
    • Rostislav Pehlivanov's avatar
      aacenc_tns: simplify encoding function · bf39beca
      Rostislav Pehlivanov authored
      It's simpler and has 2 less levels than the previous which
      was practically lifted from the decoder with put_bits() instead
      of get_bits().
      bf39beca
    • Rostislav Pehlivanov's avatar
      aacenc_tns: disable coefficient compression by default · f3ad901a
      Rostislav Pehlivanov authored
      Too much effort and work has been spent on such a simple function.
      It simply refuses to work as the specifications say, the
      transformation is NOT lossless and creates some crackling and
      distortions.
      Therefore disable it by default and add a couple of warnings to
      scare people away from touching it or wasting their time the
      way I did.
      f3ad901a
    • Rostislav Pehlivanov's avatar
      aacenc_tns: add moving average filter for LTP · 8d18d289
      Rostislav Pehlivanov authored
      The decoder does this so I guess we better do that as well.
      There's barely any difference between the autoregressive and
      the moving average filters looking at spectrals though.
      8d18d289
  7. 16 Sep, 2015 1 commit
  8. 12 Sep, 2015 2 commits
    • Rostislav Pehlivanov's avatar
      aacenc_tns: encode coefficients directly and reenable compression · 7b786638
      Rostislav Pehlivanov authored
      This commit was made possible with the earlier commits since the
      new quantization method basically means we're working always with
      unsigned values. The specifications mention to use compression when
      the first 2 bits are identical but they didn't mention if this should
      happen before or after the conversion to signed values. Actually
      they said nothing about conversion to signed values.
      
      With this commit, coefficient compression usually always happens
      which saves a lot of space, especially at extremely low bitrates
      and doesn't change the quality at all.
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      7b786638
    • Rostislav Pehlivanov's avatar
      aacenc_tns: redo coefficient quantization and decision making · a83a8d70
      Rostislav Pehlivanov authored
      This finally (and again) gets rid of basically everything the
      specifications say about how TNS should be done. The main
      problem used to be that a single filter was used for all
      coefficients which despite being explicitly recommended by
      the specifications usually sounds wrong, therefore it's
      a corner case in the current TNS implementation.
      
      This commit also changes the coefficient bit size, as apparently
      it's better to use lower precision in case the windows are eight
      short. This is apparently what fdk_aac uses, looking at the bit
      stream and makes sense. Also the order when 8 SHORT windows happen
      is important as 7 was too much and according to PSNR was worse
      while 5 is just about correct.
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      a83a8d70
  9. 05 Sep, 2015 1 commit
    • Rostislav Pehlivanov's avatar
      aacenc_tns: adjust coefficient calculation, add double filter support · e3faad81
      Rostislav Pehlivanov authored
      This commit improves the TNS implementation to the point where it's
      actually usable and very rarely results in nastyness (in all bitrates
      except extremely low bitrates it's increasing the quality and prevents
      some distortions from the coder being audiable).
      
      Also adds a double filter support which is only used if the energy
      difference between the top and bottom of the SFBs is above the
      thresholds defined in the header file. Looking at the bitstream
      that fdk_aac generates it sometimes used a double filter despite
      the specs stating that a single filter should be enough for almost
      all cases and purposes.
      
      Unlike FAAC or fdk_aac we sometimes use a reverse filter in case
      the energy difference isn't enought to use a double filter. This
      actually works better.
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      e3faad81
  10. 01 Sep, 2015 1 commit
    • Rostislav Pehlivanov's avatar
      aacenc_tns: rework coefficient quantization and filter application · f3f6c6b9
      Rostislav Pehlivanov authored
      This commit reworks the TNS implementation to a hybrid between what
      the specifications say, what the decoder does and what's the best
      thing to do.
      
      The filter application function was copied from the decoder and
      modified such that it applies the inverse AR filter to the
      coefficients. The LPC coefficients themselves are fed into the
      same quantization expression that the specifications say should
      be used however further processing is not done, instead they're
      converted to the form that the decoder expects them to be in
      and are sent off to the compute_lpc_coeffs function exactly the
      way the decoder does. This function does all conversions and will
      return the exact coefficients that the decoder will generate, which
      are then applied to the coefficients.
      Having the exact same coefficients on both the encoder and decoder
      is a must since otherwise the entire sfb's over which the filter
      is applied will be attenuated.
      
      Despite this major rework, TNS might not work fine on some audio
      types at very low bitrates (e.g. sub 90kbps) as it can attenuate
      some coefficients too much. Users are advised to experiment with
      TNS at higher bitrates if they wish to use this tool or simply
      wait for the implementation to be improved.
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      f3f6c6b9
  11. 29 Aug, 2015 7 commits
  12. 22 Aug, 2015 2 commits
  13. 21 Aug, 2015 4 commits