1. 17 Jul, 2013 - 5 commits
    • Ronald S. Bultje's avatar
      Do a skip-block check for sub8x8 partitions also. · 83c7e13a
      Ronald S. Bultje authored
      +0.2% SSIM and glbPSNR on derfraw300.
      
      Change-Id: I9cba0bca55e606a22f557c7732b064f738efe84d
      83c7e13a
    • Yunqing Wang's avatar
      Speed up motion estimation using small partitions' result(experiment) · df90d58f
      Yunqing Wang authored
      Current partition checking starts from small sizes, and then goes up
      to large sizes. This experiment uses the small partitions' motion
      estimation result, which is already available, to speed up the
      large partition's motion estimation. We can decide to skip some
      patition checkings if they are unlikely choices. We could use the
      motion vector(MV) result as current partition's prediction MV, limit
      the search range and reference frame.
      
      Current result at speed 1:
      psnr loss: 1.19% for stdhd, 0.287% for derf.
      speed gain: 14% for sunflower(hd), 11% for akiyo.
      
      Further improvement will be done later.
      
      Change-Id: I5abfd070e9cace2e91e2a0247d1325df313887ab
      df90d58f
    • Paul Wilkins's avatar
      Move uv intra mode selection in rd loop. · 2ee338ce
      Paul Wilkins authored
      Use an estimate based on DC_PRED for intra uv cost
      within the rd loop then only do a full uv mode analysis
      if an intra mode is chosen.
      
      Significant speed gains in some cases. Currently only
      enabled for speed 2 pending speed/quality tests.
      
      Change-Id: Ie851a12400d5483bce47ec0e3ccb8516041e91c0
      2ee338ce
    • Paul Wilkins's avatar
      Limit transform sizes searched for uv intra. · 6c667f0f
      Paul Wilkins authored
      Apply limit if search_method == USE_LARGESTALL
      to the range of UV tx sizes searched.
      
      Change-Id: I6db29f0dd237285ffc50d75a37e8b68151ad821c
      6c667f0f
    • Jingning Han's avatar
      Skip redundant motion search in 4x4 level rd loop · a142d6fc
      Jingning Han authored
      This commit makes the encoder to perform motion search only once
      per reference frame type for each 4x4/4x8/8x4 block. For bus_cif
      at 2000 kbps, the runtime goes from 253812ms -> 217817ms
      (14% speed-up) for speed 0.
      
      Change-Id: I5f17599ccc8cfaf93ccb4f98fcb6008af6d79e92
      a142d6fc
  2. 16 Jul, 2013 - 2 commits
  3. 15 Jul, 2013 - 1 commit
    • Jingning Han's avatar
      Skip duplicate block encoding in the rd loop · faff6ed0
      Jingning Han authored
      This speed feature allows the encoder to largely remove the spatial
      dependency between blocks inside a 64x64 superblock, thereby removing
      the need to repeatedly encode superblocks per partition type in the
      rate-distortion optimization loop.
      
      A major challenge lies in the intra modes tested in the rate-distortion
      optimization loop. The subsequent blocks do not have access to the
      reconstructed boundary pixels without the intermediate coding steps.
      This was resolved by using the original pixels for intra prediction
      in the rd loop, followed by an appropriately designed distortion
      modeling on the quantization parameters. Experiments also suggested
      that the performance impact is more discernible at lower bit-rate/psnr
      settings. Hence a quantizer dependent threshold is applied to deactivate
      skip of block coding.
      
      For bus_cif at 2000 kbps,
      speed 0: runtime 269854ms -> 237774ms (12% speed-up) at 0.05dB
               performance loss.
      
      speed 1: runtime 65312ms  -> 61536ms, (7...
      faff6ed0
  4. 12 Jul, 2013 - 3 commits
    • Yaowu Xu's avatar
      Fix a build issue · fb754b18
      Yaowu Xu authored
      Change-Id: I23a75c495ed7ea917d7f312bef0990e20a6b53d9
      fb754b18
    • Deb Mukherjee's avatar
      Some minor cleanups for efficiency · 94c481f9
      Deb Mukherjee authored
      Implements some of the helper functions more efficiently with
      lookups rathers than branches. Modeling function is consolidated
      to reduce some computations.
      
      Also merged the two enums BLOCK_SIZE_TYPES and BlockSize into
      one because there is no need to keep them separate (even though
      the semantics are a little different).
      
      No bitstream or output change.
      
      About 0.5% speedup
      
      Change-Id: I7d71a66e8031ddb340744dc493f22976052b8f9f
      94c481f9
    • Ronald S. Bultje's avatar
      Remove unused function block_error(). · ee09dd99
      Ronald S. Bultje authored
      Change-Id: I78a79fc51c2d7cc3c261f35b569155397f3dc0c4
      ee09dd99
  5. 11 Jul, 2013 - 2 commits
  6. 10 Jul, 2013 - 7 commits
    • Jingning Han's avatar
      Fix tx_type bug in intra4x4 rd loop · 18803f9c
      Jingning Han authored
      This commit fixed the mis-use of the tx_type for inverse transform
      in intra4x4 rate-distortion optimization loop. It improves the
      overall coding performance.
      
      Change-Id: I7fe9953175b74890357dbcee33c138573766e980
      18803f9c
    • Jim Bankoski's avatar
      remove warnings when NDEBUG is set · 6591cf2f
      Jim Bankoski authored
      Change-Id: Ie0cb732fdcb98616a422c4463bff80642248d136
      6591cf2f
    • Deb Mukherjee's avatar
      Prunes out full-rd computation based on modeled rd · 53ff43ad
      Deb Mukherjee authored
      Adds a speed feature to eliminate full-rd computation if the modeled
      rd or rd based on a different parameter in the same mode is already
      a lot larger than the best rd yet.
      
      Specifically, only search the sharp and smooth filters if the modeled
      rd cost based on the  regular filter is within a certain factor of the
      best rd cost so far. Also, skip full-rd computation of non splitmv
      inter modes if the modeled rd cost based on pred error is within the
      same factor of the best rd cost so far.
      
      Also adds some enhancements in the rd search for splitmv mode to
      speed things up by early breakouts. Negligible impact on performance.
      
      Resuts on derfraw300:
      psnr:    -0.013% with the splitmv enhancements, -0.24% with the rd
               breakout feature on.
      speedup: 6% with splitmv enhancements, 20% with also residual breakout
               (tested on football sequence at 600 Kbps)
      
      Change-Id: I37abc308ea9f110c1679ce649b6a7e73ab1ad5fc
      53ff43ad
    • Ronald S. Bultje's avatar
      Remove memcpy() in handle_inter_mode() filter selection. · b1df674a
      Ronald S. Bultje authored
      Encode time of first 50 frames of bus (speed 0) @ 1500kbps goes from
      2min4.9 to 2min3.1, i.e. a 1.4% speedup overall.
      
      Change-Id: I9b25e87974430cb942caa276410bb2eda815bd83
      b1df674a
    • Yaowu Xu's avatar
      Add a feature to reduce chrome intra mode search · bed27a96
      Yaowu Xu authored
      Change-Id: I721ebdeef2b53ce3e5c3eba3f7462ae2103c95a8
      bed27a96
    • Jim Bankoski's avatar
      removing case statements around prediction entropy coding · fb027a76
      Jim Bankoski authored
      Removes SEG_ID
      Removes MBSKIP
      Removes SWITCHABLE_INTERP
      Removes INTRA_INTER
      Removes COMP_INTER_INTER
      Removes COMP_REF_P
      Removes SINGLE_REF_P1
      Removes SINGLE_REF_P2
      Removes TX_SIZE
      
      Change-Id: Ie4520ae1f65c8cac312432c0616cc80dea5bf34b
      fb027a76
    • Yaowu Xu's avatar
      Revert "Remove memcpy() in handle_inter_mode() filter selection." · 205efbc1
      Yaowu Xu authored
      This reverts commit fcf7998a.
      
      Change-Id: Ic6532223faec9f1483b78adb2e37b79c7b1a0efb
      205efbc1
  7. 09 Jul, 2013 - 1 commit
  8. 08 Jul, 2013 - 4 commits
    • Ronald S. Bultje's avatar
      Don't recalculate mv_ref costs for each block/partition. · 8fde07a3
      Ronald S. Bultje authored
      Changes cost_mv_ref() into doing a LUT into pre-calculated cost
      arrays instead. Encode time of first 50 frames of bus (speed 0)
      @ 1500kbps goes from 2min11.6 to 2min10.9, i.e. 0.5% faster overall.
      
      Change-Id: If186e92c34c201b29cbbc058785a15c9c09e433a
      8fde07a3
    • Ronald S. Bultje's avatar
      Remove memcpy() in handle_inter_mode() filter selection. · fcf7998a
      Ronald S. Bultje authored
      Encode time of first 50 frames of bus (speed 0) @ 1500kbps goes from
      2min4.9 to 2min3.1, i.e. a 1.4% speedup overall.
      
      Change-Id: Ibe8b08d159797504c5d0c5122de1b6da3b6595e0
      fcf7998a
    • Ronald S. Bultje's avatar
      Make frame-wide filter-type decision fully RD-based. · ed995afb
      Ronald S. Bultje authored
      Overall, on all test sets, this gains about +0.2% on all metrics.
      City is a clip where this really hurts (-1.0% on all metrics), I'm
      not quite sure why yet. Maybe interesting to look into in the future.
      
      Change-Id: I6f0eecb20e72f0194633270d30bf00d76d9eae78
      ed995afb
    • Deb Mukherjee's avatar
      Implements several heuristics to prune mode search · d9b62160
      Deb Mukherjee authored
      Skips mode searches for intra and compound inter modes depending
      on the best mode so far and the reference frames. The various
      heuristics to be used are selected by bits from a flag. The
      previous direction based intra mode search pruning is also absorbed
      in this framework.
      
      Specifically the flags and their impact are:
      
      1) FLAG_SKIP_INTRA_BESTINTER (skip intra mode search for oblique
      directional modes and TM_PRED if the best so far is
      an inter mode)
      derfraw300: -0.15%, 10% speedup
      
      2) FLAG_SKIP_INTRA_DIRMISMATCH (skip D27, D63, D117 and D153
      mode search if the best so far is not one of the closest
      hor/vert/diagonal directions.
      derfraw300: -0.05%, about 9% speedup
      
      3) FLAG_SKIP_COMP_BESTINTRA (skip compound prediction mode
      search if the best so far is an intra mode)
      derfraw300: -0.06%, about 7-8% speedup
      
      4) FLAG_SKIP_COMP_REFMISMATCH (skip compound prediction search
      if the best single ref inter mode does not have the same ref
      as one of the two references being tested in the compound mode)
      derfraw300: -0.56%, about 10% speedup
      
      Change-Id: I1a736cd29b36325489e7af9f32698d6394b2c495
      d9b62160
  9. 04 Jul, 2013 - 1 commit
  10. 03 Jul, 2013 - 3 commits
    • Jingning Han's avatar
      Enable early termination in rd search · 2bd6fe08
      Jingning Han authored
      This commit allows encoder to detect the cumulative rate-distortion
      cost per transformed block inside a partition. If the cumulative
      rd cost is already above the best rd value, it terminates the rest
      operations and continue to next prediction mode test.
      
      It reduces the runtime of bus at target bit-rate 2000 from 308 second
      to 266 second, i.e., about 13% speed-up at no performance penalty.
      
      Change-Id: I5f15a3d8955d97031d5653006027866a00654e7a
      2bd6fe08
    • Paul Wilkins's avatar
      Fix to comp_inter_joint_search_thresh feature. · f58b44ad
      Paul Wilkins authored
      When this is 0 (BLOCK_SIZE_AB4X4) we want to do
      the inter joint search for all sizes.
      
      Change-Id: Id40cd6fe7790e7e1165352b9cef5e12fa8c0bc88
      f58b44ad
    • Paul Wilkins's avatar
      Added two new skip experiments. · 72c5778e
      Paul Wilkins authored
      sf->unused_mode_skip_lvl. Tests modes as normal for all
      sizes at or below the given level. At larger sizes it skips
      all modes that were not chosen at any smaller size.
      Hence setting BLOCK_SIZE_SB64X64 is in effect off.
      Setting BLOCK_SIZE_AB4X4 will only consider modes that
      were chosen for one or more 4x4 blocks at larger sizes.
      
      sf->reference_masking.
      Do a test encode of the NONE partition at one size and create
      a reference frame mask based on the best rd choice. In the
      full search only allow this reference frame.
      Currently it is testing 64x64 and repeats this in the full search.
      This does not work well with Jim's Partition code just now and
      is disabled by default.
      
      Change-Id: I8f8c52d2ef4a0c08100150b0ea4155d1aaab93dd
      72c5778e
  11. 02 Jul, 2013 - 5 commits
    • Dmitry Kovalev's avatar
      Removing redundant struct from union b_mode_info. · be77f6bb
      Dmitry Kovalev authored
      Change-Id: I08fc6e474ff2c12cfa065bae4989c724276e2c83
      be77f6bb
    • Deb Mukherjee's avatar
      Speed feature to binary search dir intramodes · 37501d68
      Deb Mukherjee authored
      This speed feature will skip searching the directional intra prediction
      modes D63, D117, D27, D153 if the best intra mode so far is not one of
      the diagonal, horizontal or vertical directions closest to the respective
      directions being tested. In other words, this implements a sort of
      binary search in the angular domain.
      
      Speedup: about 9-10%
      Results: -0.05% only on derfraw300.
      
      Change-Id: I413584c41f2a3e8dabfbdeb40718c8fc4b1d63a2
      37501d68
    • Deb Mukherjee's avatar
      Tx size selection enhancements · 8d3d2b76
      Deb Mukherjee authored
      (1) Refines the modeling function and uses that to add some speed
      features. Specifically, intead of using a flag use_largest_txfm as
      a speed feature, an enum tx_size_search_method is used, of which
      two of the types are USE_FULL_RD and USE_LARGESTALL. Two other
      new types are added:
      USE_LARGESTINTRA (use largest only for intra)
      USE_LARGESTINTRA_MODELINTER (use largest for intra, and model for
      inter)
      
      (2) Another change is that the framework for deciding transform type
      is simplified to use a heuristic count based method rather than
      an rd based method using txfm_cache. In practice the new method
      is found to work just as well - with derf only -0.01 down.
      The new method is more compatible with the new framework where
      certain rd costs are based on full rd and certain others are
      based on modeled rd or are not computed. In this patch the existing
      rd based method is still kept for use in the USE_FULL_RD mode.
      In the other modes, the count based method is used.
      However the recommendation is to remove it eventually since the
      benefit is limited, and will remove a lot of complications in
      the code
      
      (3) Finally a bug is fixed with the existing use_largest_txfm speed feature
      that causes mismatches when the lossless mode and 4x4 WH transform is
      forced.
      
      Results on derf:
      USE_FULL_RD: +0.03% (due to change in the tables), 0% encode time reduction
      USE_LARGESTINTRA: -0.21%, 15% encode time reduction (this one is a
      pretty good compromise)
      USE_LARGESTINTRA_MODELINTER: -0.98%, 22% encode time reduction
      (currently the benefit of modeling is limited for txfm size selection,
      but keeping this enum as a placeholder) .
      USE_LARGESTALL: -1.05%, 27% encode-time reduction (same as existing
      use_largest_txfm speed feature).
      
      Change-Id: I4d60a5f9ce78fbc90cddf2f97ed91d8bc0d4f936
      8d3d2b76
    • Jingning Han's avatar
      Calculate rd cost per transformed block · b91a1586
      Jingning Han authored
      Compute the rate-distortion cost per transformed block, and cumulate
      the cost through all blocks inside a partition. This allows encoder
      to detect if the cumulative rd cost is already above the best rd cost,
      thereby enabling early termination in the rate-distortion optimization
      search.
      
      Change-Id: I0a856367a9a7b6dd0b466e7b767f54d5018d09ac
      b91a1586
    • Paul Wilkins's avatar
      Revert "New motion threshold factor - speed feature." · b7cd01ed
      Paul Wilkins authored
      This reverts commit 13772781.
      Also fixes a spelling mistake.
      
      Change-Id: I5be8aa4d8d3c0323d4a6f41968a7b2c048949c3f
      b7cd01ed
  12. 01 Jul, 2013 - 3 commits
    • Ronald S. Bultje's avatar
      Make get_coef_context() branchless. · 26b6318d
      Ronald S. Bultje authored
      This should significantly speedup cost_coeffs(). Basically what the
      patch does is to make the neighbour arrays padded by one item to
      prevent an eob check in get_coef_context(), then it populates each
      col/row scan and left/top edge coefficient with two times the same
      neighbour - this prevents a single/double context branch in
      get_coef_context(). Lastly, it populates neighbour arrays in pixel
      order (rather than scan order), so we don't have to dereference the
      scantable to get the correct neighbours.
      
      Total encoding time of first 50 frames of bus (speed 0) at 1500kbps
      goes from 2min10.1 to 2min5.3, i.e. a 2.6% overall speed increase.
      
      Change-Id: I42bcd2210fd7bec03767ef0e2945a665b851df56
      26b6318d
    • Ronald S. Bultje's avatar
      Quantize (64-bit only, for now) SSSE3 SIMD. · 7353ceab
      Ronald S. Bultje authored
      Total encoding time for first 50 frames of bus (speed 0) @ 1500kbps
      goes 2min34.8 to 2min14.4, i.e. a 10.4% overall speedup. The code is
      x86-64 only, it needs some minor modifications to be 32bit compatible,
      because it uses 15 xmm registers, whereas 32bit only has 8.
      
      Change-Id: I2df53770c2e850813ffa713e1a91b45b0082b904
      7353ceab
    • Paul Wilkins's avatar
      New motion threshold factor - speed feature. · 13772781
      Paul Wilkins authored
      Added a speed feature that focuses only on thresholds
      for new motion modes.
      
      Moved sf->comp_inter_joint_search_thresh into speed
      1.  This has ~+0.4% impact on quality at speed 0 as
      our quality reference baseline.
      
      Slight adjustment to baseline thresholds.
      
      Change-Id: I7ebf104f1fe29af77ed4837b2e84be065621bbe5
      13772781
  13. 29 Jun, 2013 - 1 commit
  14. 28 Jun, 2013 - 2 commits