1. 18 Dec, 2015 1 commit
  2. 14 Dec, 2015 1 commit
  3. 08 Dec, 2015 1 commit
  4. 07 Dec, 2015 1 commit
    • Vittorio Giovara's avatar
      lavc: Drop exporting 2-pass encoding stats · 16216b71
      Vittorio Giovara authored
      These variables are coming from mpegvideoenc where are supposedly used
      as bit counters on various frame properties. However their use is
      unclear as they lack documentation, are available only from a very small
      subset of encoders, and they are hardly used in the wild. Also frame_bits
      in aacenc is employed in a similar way.
      
      Remove this functionality from AVCodecContex, these variable are mostly
      frame properties, and too few encoders support setting them with anything
      useful.
      Signed-off-by: 's avatarVittorio Giovara <vittorio.giovara@gmail.com>
      16216b71
  5. 06 Dec, 2015 1 commit
  6. 05 Dec, 2015 5 commits
    • Rostislav Pehlivanov's avatar
    • Rostislav Pehlivanov's avatar
      aacenc: remove the experimental flag · d9791a86
      Rostislav Pehlivanov authored
      Thiss commit removes the experimental flag from the native AAC Encoder
      and thus makes it the default.
      
      After a lot of work, done by myself and Claudio Freire, the quality of
      this encoder rivals and surpasses libfdk_aac in some situations. The
      encoder had instability issues earlier which prevented it from having
      its experimental flag removed, however the last commits done by Claudio
      removed the last known source of instability and solved a lot of
      problems which were previously observed. The issues were caused by the
      various coding tools interfering with the scalefactor indices. Thus,
      with these problems solved, it should now be possible to declare this
      encoder as the default and recommend that the users should use it
      instead of others provided by external libraries, as it is both faster
      and has a subjectively higher quality with selected tracks.
      The encoder has still yet to be fine tuned for every possible audio file
      type like music or voice, so it is hoped that with the experimental flag
      removed the users should be able to provide feedback and make the
      encoder better than the alternatives for every type of audio and at
      every bitrate.
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      d9791a86
    • Rostislav Pehlivanov's avatar
      aacenc: mark coders other than twoloop as experimental · b270ec9a
      Rostislav Pehlivanov authored
      ANMR has some interesting things coming up but is currently not in a
      shape fit for non-experimental usage. Same with "FAST".
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      b270ec9a
    • Rostislav Pehlivanov's avatar
      aacenc: mark the "faac"-like coder for removal · 3a6e0208
      Rostislav Pehlivanov authored
      This coder produces a much lower quality audio than the rest, is much
      slower and is unstable. Hasn't been updated for a very long time as
      well, hence it is more appropriate to remove it since it also depends on
      a big burden of a code (the encode_window_bands_info function which is
      just as old, just as unstable and bad and in no way modifiable or
      fixable).
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      3a6e0208
    • Luca Barbato's avatar
      aac: Provide more information on the failure message · b805482b
      Luca Barbato authored
      Bug-Id: 761
      b805482b
  7. 04 Dec, 2015 1 commit
  8. 02 Dec, 2015 1 commit
    • Claudio Freire's avatar
      AAC encoder: improve SF range utilization · ca203e99
      Claudio Freire authored
      This patch does 4 things, all of which interact and thus it
      woudln't be possible to commit them separately without causing
      either quality regressions or assertion failures.
      
      Fate comparison targets don't all reflect improvements in
      quality, yet listening tests show substantially improved quality
      and stability.
      
      1. Increase SF range utilization.
      
      The spec requires SF delta values to be constrained within the
      range -60..60. The previous code was applying that range to
      the whole SF array and not only the deltas of consecutive values,
      because doing so requires smarter code: zeroing or otherwise
      skipping a band may invalidate lots of SF choices.
      
      This patch implements that logic to allow the coders to utilize
      the full dynamic range of scalefactors, increasing quality quite
      considerably, and fixing delta-SF-related assertion failures,
      since now the limitation is enforced rather than asserted.
      
      2. PNS tweaks
      
      The previous modification makes big improvements in twoloop's
      efficiency, and every time that happens PNS logic needs to be
      tweaked accordingly to avoid it from stepping all over twoloop's
      decisions. This patch includes modifications of the sort.
      
      3. Account for lowpass cutoff during PSY analysis
      
      The closer PSY's allocation is to final allocation the better
      the quality is, and given these modifications, twoloop is now
      very efficient at avoiding holes. Thus, to compute accurate
      thresholds, PSY needs to account for the lowpass applied
      implicitly during twoloop (by zeroing high bands).
      
      This patch makes twoloop set the cutoff in psymodel's context
      the first time it runs, and makes PSY account for it during
      threshold computation, making PE and threshold computations
      closer to the final allocation and thus achieving better
      subjective quality.
      
      4. Tweaks to RC lambda tracking loop in relation to PNS
      
      Without this tweak some corner cases cause quality regressions.
      Basically, lambda needs to react faster to overall bitrate
      efficiency changes since now PNS can be quite successful in
      enforcing maximum bitrates, when PSY allocates too many bits
      to the lower bands, suppressing the signals RC logic uses to
      lower lambda in those cases and causing aggressive PNS.
      
      This tweak makes PNS much less aggressive, though it can still
      use some further tweaks.
      
      Also update MIPS specializations and adjust fuzz
      
      Also in lavc/mips/aacpsy_mips.h: remove trailing whitespace
      ca203e99
  9. 27 Nov, 2015 3 commits
  10. 26 Nov, 2015 1 commit
    • Claudio Freire's avatar
      AAC encoder: Fix application of M/S with PNS · fc36d852
      Claudio Freire authored
      When both M/S coding and PNS are enabled, scalefactors
      and coding books would be mistakenly clobbered when setting
      the M/S flag on PNS'd bands. The flag needs to be set to
      signal the generation of correlated noise, but the scalefactors,
      coefficients and the coding books need to be kept intact.
      fc36d852
  11. 17 Oct, 2015 8 commits
  12. 12 Oct, 2015 4 commits
    • Rostislav Pehlivanov's avatar
      aacenc: shorten name of ff_aac_adjust_common_prediction · 93e6b23c
      Rostislav Pehlivanov authored
      To keep it similar to the other functions which are all named *_pred.
      93e6b23c
    • Rostislav Pehlivanov's avatar
      aacenc: add support for changing options based on a profile · 0f4334df
      Rostislav Pehlivanov authored
      This commit adds the ability for a profile to set the default
      options, as well as for the user to override such options
      by simply stating them in the command line while still keeping
      the same profile, as long as those options are still permitted by
      the profile.
      
      Example: setting the profile to aac_low (the default) will turn
      PNS and IS on. They can be disabled by -aac_pns 0 and -aac_is 0,
      respectively. Turning on -aac_pred 1 will cause the profile to be
      elevated to aac_main, as long as no options forbidding aac_main
      have been entered (like AAC-LTP, which will be pushed soon).
      
      A useful feature is that by setting the profile to mpeg2_aac_low,
      all MPEG4 features will be disabled and if the user tries to enable
      them then the program will exit with an error. This profile is
      signalled with the same bitstream as aac_low (MPEG4) but some devices
      and decoders will fail if any MPEG4 features have been enabled.
      0f4334df
    • Rostislav Pehlivanov's avatar
      aacenc: add support for encoding 7.1 channel audio · b3deaece
      Rostislav Pehlivanov authored
      This commit implements support for 7.1 channel audio. There's no
      more predefined bitstream channel mappings so going beyond 8 channels
      (and 7 channels exactly) will require programmable channel elements,
      which is already underway.
      b3deaece
    • Claudio Freire's avatar
      AAC encoder: memoize quantize_band_cost · b629c67d
      Claudio Freire authored
      The bulk of calls to quantize_band_cost are replaced
      by a call to a version that memoizes, greatly improving
      performance, since during coefficient search there is
      a great deal of repeat work.
      
      Memoization cannot always be applied, so do this in a
      different function, and leave the original as-is.
      b629c67d
  13. 11 Oct, 2015 1 commit
    • Claudio Freire's avatar
      AAC encoder: Extensive improvements · 01ecb717
      Claudio Freire authored
      This finalizes merging of the work in the patches in ticket #2686.
      
      Improvements to twoloop and RC logic are extensive.
      
      The non-exhaustive list of twoloop improvments includes:
       - Tweaks to distortion limits on the RD optimization phase of twoloop
       - Deeper search in twoloop
       - PNS information marking to let twoloop decide when to use it
         (turned out having the decision made separately wasn't working)
       - Tonal band detection and priorization
       - Better band energy conservation rules
       - Strict hole avoidance
      
      For rate control:
       - Use psymodel's bit allocation to allow proper use of the bit
         reservoir. Don't work against the bit reservoir by moving lambda
         in the opposite direction when psymodel decides to allocate more/less
         bits to a frame.
       - Retry the encode if the effective rate lies outside a reasonable
         margin of psymodel's allocation or the selected ABR.
       - Log average lambda at the end. Useful info for everyone, but especially
         for tuning of the various encoder constants that relate to lambda
         feedback.
      
      Psy:
       - Do not apply lowpass with a FIR filter, instead just let the coder
         zero bands above the cutoff. The FIR filter induces group delay,
         and while zeroing bands causes ripple, it's lost in the quantization
         noise.
       - Experimental VBR bit allocation code
       - Tweak automatic lowpass filter threshold to maximize audio bandwidth
         at all bitrates while still providing acceptable, stable quality.
      
      I/S:
       - Phase decision fixes. Unrelated to #2686, but the bugs only surfaced
         when the merge was finalized. Measure I/S band energy accounting for
         phase, and prevent I/S and M/S from being applied both.
      
      PNS:
       - Avoid marking short bands with PNS when they're part of a window
         group in which there's a large variation of energy from one window
         to the next. PNS can't preserve those and the effect is extremely
         noticeable.
      
      M/S:
       - Implement BMLD protection similar to the specified in
         ISO-IEC/13818:7-2003, Appendix C Section 6.1. Since M/S decision
         doesn't conform to section 6.1, a different method had to be
         implemented, but should provide equivalent protection.
       - Move the decision logic closer to the method specified in
         ISO-IEC/13818:7-2003, Appendix C Section 6.1. Specifically,
         make sure M/S needs less bits than dual stereo.
       - Don't apply M/S in bands that are using I/S
      
      Now, this of course needed adjustments in the compare targets and
      fuzz factors of the AAC encoder's fate tests, but if wondering why
      the targets go up (more distortion), consider the previous coder
      was using too many bits on LF content (far more than required by
      psy), and thus those signals will now be more distorted, not less.
      
      The extra distortion isn't audible though, I carried extensive
      ABX testing to make sure.
      
      A very similar patch was also extensively tested by Kamendo2 in
      the context of #2686.
      01ecb717
  14. 23 Sep, 2015 1 commit
    • Claudio Freire's avatar
      AAC encoder: tweak rate-distortion logic · 7ec74ae4
      Claudio Freire authored
      This patch modifies the encode frame function to
      retry encoding the frame when the resulting bit count
      is too far off target, but only adjusting lambda
      in small, incremental step. It also makes the logic
      more conservative - otherwise it will contend with
      bit reservoir-related variations in bit allocation,
      and result in artifacts when frame have to be truncated
      (usually at high bit rates transitioning from low
      complexity to high complexity).
      7ec74ae4
  15. 08 Sep, 2015 1 commit
  16. 06 Sep, 2015 1 commit
  17. 02 Sep, 2015 1 commit
    • Rostislav Pehlivanov's avatar
      aacenc: reorder coding tools · 20dc5271
      Rostislav Pehlivanov authored
      This commit reorders the coding tools such that they're doing what
      the decoder does in reverse order. The very first thing the decoder
      does is to decode M/S stereo if that's signalled, then prediction,
      IS, and finally TNS and PNS in another function.
      adjust_frame_information()'s application of IS and M/S was taken
      out into two separate functions since prediction doesn't expect
      to get the raw coefficients but rathe the coefficients at that
      part of the encoding process.
      
      The results show a much better PSNR when any combination of
      Intensity Stereo, Mid/Side stereo and Prediction is used, which
      is a sign of an increased encoder efficiency as well as the fact
      that the decoder gets what it expects.
      
      Otherwise, with only IS, PNS or prediction there are neither
      regressions nor improvements except in the case of IS, which
      now by itself (or with PNS) is less prone to artifacts. Enabling
      M/S (using stereo_mode) as well will also reduce stereo artifacts
      induced by IS, so in the very near future M/S may be enabled
      by default.
      Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
      20dc5271
  18. 01 Sep, 2015 7 commits