1. 16 Aug, 2017 1 commit
    • paulwilkins's avatar
      Fix for encoder slowdown (for speeds >= 3) · e15be302
      paulwilkins authored
      Some clips in nightly unit test exhibiting significant encoder slowdown which
      appears to bisect to Change-Id: I692311a709ccdb6003e705103de9d05b59bf840a.
      
      The above change allowed for emergency iterations of the recode loop and
      adjustment of the Q range if there is a large rate miss.
      
      This patch disables the above adaptation for cases of cpu_speed >= 3 or more
      specifically where cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF.
      
      For speeds >= 3 the code does not currently run a dummy bit pack operation
      inside the recode loop. Without this dummy pack operation there is no up to
      date estimate of the current frame's size to use as a basis for assessing the
      requirement for a recode. In practice it was using the previous frames size (or 0
      for the first frame) which could cause odd behavior.
      
      If we require the emergency rate correction added in  Change-Id: I6923.. for
      the higher speed settings it will be necessary to enable the dummy pack
      which will in turn hurt encode speed.
      
      BUG=webm:1454
      
      Change-Id: I4fb3c6062ca9508325a6f31582f8e80f1a9b126f
      e15be302
  2. 02 Aug, 2017 1 commit
    • Yunqing Wang's avatar
      Force the bit exactness in the first pass · bfd0f41f
      Yunqing Wang authored
      Originally, for the purpose of keeping a fast first pass, the first-pass
      stats between row_mt_mode = 0 and row_mt_mode = 1 are not bit exact, but
      that difference is very small that doesn't cause a mismatch between the
      final bitstreams. However, if the encoder changes, this minor difference
      may cause a mismatch. Thus, this patch always forces the first pass to
      be bit exact.
      
      BUG=webm:1453
      
      Change-Id: I2b67cf529dee81f660f9d9e7fe9a60ea3c7b12b8
      bfd0f41f
  3. 18 Jul, 2017 1 commit
  4. 11 Jul, 2017 3 commits
  5. 10 Jul, 2017 2 commits
    • Johann's avatar
      remove vp9_full_sad_search · 109faffe
      Johann authored
      This code is unused in vp9. Only vp8 still contains references to
      vpx_sad_NxMx[3|8] and only for sizes 16x16, 16x8, 8x16, 8x8 and 4x4.
      
      Remove the remaining sizes and all the highbitdepth versions.
      
      BUG=webm:1425
      
      Change-Id: If6a253977c8e0c04599e25cbeb45f71a94f563e8
      109faffe
    • Jerome Jiang's avatar
      vp9: Remove alt-ref from denoiser. · 2ac7c549
      Jerome Jiang authored
      Denoiser is used in real-time mode which does not use alt-ref.
      Reduce memory usage when denoiser is enabled.
      
      Change-Id: I54ba3bcaeeb1818bbdf718ef90e97d4897ff793d
      2ac7c549
  6. 07 Jul, 2017 1 commit
  7. 05 Jul, 2017 1 commit
    • paulwilkins's avatar
      Respond more rapidly to excessive local overshoot. · 5b44ef0c
      paulwilkins authored
      This patch attempts to address a bug reported for 4K video.
      https://b.corp.google.com/issues/62215394
      
      In this instance a perfect storm of a moderate complexity section
      followed by a much easier section where a CGI overlay helped to
      suppress film grain noise, followed by a much harder and very grainy
      section at the end, cause a massive local rate spike that pushed a chunk
      over the upper allowed rate limit.
      
      This patch detects cases where the rate for a frame is much higher than
      expected and allows, in this special case, for rapid adjustment of the active
      Q range.
      
      For the example chunk in the bug report the target rate was 18Mb/s and the
      observed rate was over 37 Mb/s with a surge for the last few frames to over
      100Mb/s. This patch brings the overall chunk rate right back down to ~18.2 Mbit/s
      and  almost completely eliminates the rate spike at the end. (See graphs appended
      to bug report)
      
      Also see  I108da7ca42f3bc95c5825dd33c9d84583227dac1 which fixes a bug
      unearthed during testing of this patch and also has a bearing on high rate
      encodes such as 4K.
      
      This patch does have a negative impact on some metrics. Most notably there are
      clips in our standard test set where it hurts global psnr (though in many cases it
      conversely helps SSIM, FAST SSIM and PSNR-HVS). It is also worth noting that
      the clips (and data rates) where there is a big metric impact, are almost all cases
      where there is currently a significant overshoot vs the target rate and overall rate
      accuracy is greatly improved.
      
      Change-Id: I692311a709ccdb6003e705103de9d05b59bf840a
      5b44ef0c
  8. 29 Jun, 2017 2 commits
  9. 27 Jun, 2017 1 commit
  10. 23 Jun, 2017 1 commit
    • Marco's avatar
      vp9: Use scene detection for CBR mode. · 18805eee
      Marco authored
      Use the scene detection for CBR mode, and use it to reset the
      rate control if large source sad is detected and rate
      correctioni fact/QP is at minimum state.
      
      Avoids large frame sizes after big content change following
      low content period.
      
      Only affects CBR mode for 1 pass at speeds 5, 6, 7.
      Change-Id: I56dd853478cd5849b32db776e9221e258998d874
      18805eee
  11. 10 Jun, 2017 1 commit
  12. 08 Jun, 2017 1 commit
  13. 01 Jun, 2017 1 commit
  14. 26 May, 2017 2 commits
    • Jerome Jiang's avatar
      Fix vp8 race when build --enable-vp9-highbitdepth. · 0afa2dad
      Jerome Jiang authored
      Split vp8/vp9 implementations on yv12_copy_frame_c.
      Remove high-bitdepth codes from vp8_yv12_extend_frame_borders_c.
      Clean up vp8 codes usage in vp9.
      
      BUG=webm:1435
      
      Change-Id: Ic68e79e9d71e1b20ddfc451fb8dcf2447861236d
      0afa2dad
    • Marco's avatar
      vp9: SVC: Fix to condiiton on using source_sad. · 146005a9
      Marco authored
      Fix the condition on usage of source_sad for temporal layers.
      FIx allows it to be used for the case of 1 temporal layer.
      
      Change-Id: I02b1b0ade67a7889d1b93cee66d27c0951131fc3
      146005a9
  15. 25 May, 2017 1 commit
  16. 12 May, 2017 1 commit
  17. 11 May, 2017 1 commit
    • Cheng Chen's avatar
      Speed up encoding by skipping altref recode · 76567d84
      Cheng Chen authored
      Speed up for speed 0.
      Reduce 10+% of encoding time for hdres in speed 0,
      with less than 0.1% PSNR loss.
      Compute total difference of previous and current frame context probability
      model. If the diff is less than the threshold, skip recoding the frame.
      
      Borg test (positive number means performance loss):
      		lowres    midres    hdres
      PSNR:		0.030     0.032     0.065
      
      Local speed test: bitrate set at 1200
      		blue_sky  pedestrian  rush_hour
      Encoding time:	 -10.0%     -16.5%      -16.5%
      
      Change-Id: I4e2d200ea3115d48b2c3e890143596b31b8ef9e9
      76567d84
  18. 10 May, 2017 1 commit
    • Marco's avatar
      vp9: SVC: Add option to set downsampling filter type. · 4e23998f
      Marco authored
      Add option in SVC to set the filter type and phase for
      the frame level downsampling filters.
      
      For 3 spatial layers: set downsampling filter type to bilinear
      and set phase to 8, for lowest spatial layer.
      
      Change-Id: Id81f4b1ba93db19c1cd37b6a46d1281a2c61bc43
      4e23998f
  19. 26 Apr, 2017 1 commit
  20. 25 Apr, 2017 1 commit
  21. 24 Apr, 2017 1 commit
    • Yunqing Wang's avatar
      Make the row based multi-threaded encoder deterministic · 10a497bd
      Yunqing Wang authored
      This patch followed allow_exhaustive_searches feature modification and
      continued to modify the encoder to achieve the determinism in the row
      based multi-threaded encoding. While row-mt = 1 and using multiple
      threads, the adaptive feature in encoder was disabled, which gave
      BDRate gain(at speed 1, -0.6% ~ -0.7%; at speed 2, -0.46% ~ -0.59%),
      but some encoder speed losses(7% ~ 10% at speed 1 and 3% ~ 6% at
      speed 2). These speed losses were acceptable considering the speed
      gains obtained from row-mt.
      
      Change-Id: I60d87a25346ebc487a864b57d559f560b7e398bb
      10a497bd
  22. 20 Apr, 2017 2 commits
  23. 19 Apr, 2017 1 commit
    • Linfeng Zhang's avatar
      Clean CONVERT_TO_BYTEPTR/SHORTPTR in convolve · bf8a49ab
      Linfeng Zhang authored
      Replace by CAST_TO_BYTEPTR/SHORTPTR.
      The rule is: if a short ptr is casted to a byte ptr, any offset
      operation on the byte ptr must be doubled. We do this by casting to
      short ptr first, adding offset, then casting back to byte ptr.
      
      BUG=webm:1388
      
      Change-Id: I9e18a73ba45ddae58fc9dae470c0ff34951fe248
      bf8a49ab
  24. 18 Apr, 2017 1 commit
    • Marco's avatar
      vp9: Add phase to get averaging filter for 1:2 downsampling. · 348bdc01
      Marco authored
      The scaling filter with zero shift will give sub-sampling for
      2x downsampling. Allow for a phase shift to get an averaging filter.
      
      Usage is for source scaling in 1 pass SVC mode for 1:2 downscale.
      Reduces aliasing in downsampled image.
      
      Keep the phase to 0/off for now.
      
      Change-Id: Ic547ea0748d151b675f877527e656407fcf4d51e
      348bdc01
  25. 17 Apr, 2017 2 commits
    • Marco's avatar
      vp9: Add key_frame condition to is_reference check for loopfilter. · ad2e3598
      Marco authored
      This condiiton is not needed as key_frame should set the refresh
      of the reference frames, but good to have for clarity in condition.
      
      Change-Id: Icf9838e7e4f0ff5cf0a9562ae3b5d6c7e6f78702
      ad2e3598
    • Marco Paniconi's avatar
      Revert "Revert "vp9: Avoid encoder loopfilter for non-reference frames."" · 9aa429a6
      Marco Paniconi authored
      This reverts commit e9b7f98c.
      
      Reason for revert:
      Commit d578bdad fixes the issue (encoder/decoder mismatch
      in 3TL datarate test) that causes the original revert.
      
      Original change's description:
      > Revert "vp9: Avoid encoder loopfilter for non-reference frames."
      >
      > This reverts commit 863f860b.
      >
      > This causes encoder / decoder mismatches in various
      > VP9/DatarateTestVP9Large.BasicRateTargeting3TemporalLayers tests
      >
      > BUG=webm:1408
      >
      > Change-Id: Ic200c39d7ed9c0b0247ef562f5d6f7b2625f7e14
      >
      
      TBR=jzern@google.com,marpan@google.com,builds@webmproject.org,jianj@google.com
      BUG=webm:1408
      
      Change-Id: Ifeb81460856d1d56482d4e0477a70ee98f8bfaa6
      9aa429a6
  26. 14 Apr, 2017 1 commit
  27. 13 Apr, 2017 1 commit
    • Marco's avatar
      vp9: Avoid encoder loopfilter for non-reference frames. · 863f860b
      Marco authored
      Useful for SVC, where the top layer enhancement frames may
      not update any reference buffers, as is the case for the
      patterns in the 1 pass CBR SVC when #temporal_layers > 1.
      
      ~3% encoder speedup for SVC patterns with temporal layers
      in 1 pass CBR mode.
      
      Updated the SVC datarate tests for the mismatch frames.
      Set the frame-dropper off in some tests with #temporal_layers > 1
      so we can correctly set #mismatch frames. Adjusted rate target
      threshold for tests where frame-dropper was turned off.
      
      Change-Id: Ia0c142f02100be0fed61cd2049691be9c59d6793
      863f860b
  28. 05 Apr, 2017 1 commit
  29. 04 Apr, 2017 1 commit
  30. 03 Apr, 2017 1 commit
    • Marco's avatar
      vp9: 1 pass CBR: cleanup to cyclic refresh. · 6b3f4bc7
      Marco authored
      Code cleanup: merged two functions that were doing postencode
      update for cylic refresh, remove some unused code and fix comments.
      
      No change in behavior.
      
      Change-Id: I9be0d7e346d34dec29bf4e5bb380a7bf81c8480a
      6b3f4bc7
  31. 29 Mar, 2017 1 commit
  32. 27 Mar, 2017 1 commit
    • Marco's avatar
      vp9: 1 pass: Move source sad computation into encodeframe loop. · 66c6b4d6
      Marco authored
      Refactor to split the 1 passs source sad computation into scene
      detection (currently used for VBR and screen-content mode), and
      superblock based source sad computation (used in non-rd CBR mode).
      
      This allows the source sad computation for CBR mode to be
      multi-threaded.
      
      No change in compression.
      
      Change-Id: I112f2918613ccbd37c1771d852606d3af18c1388
      66c6b4d6
  33. 24 Mar, 2017 1 commit