1. 14 Dec, 2010 1 commit
    • Yunqing Wang's avatar
      Fix a bug in motion search code · 7fb0f868
      Yunqing Wang authored
      The MV's range is 256. Since the new motion search uses a different
      starting MV than the center ref MV, a MV range checking needs to
      be done to avoid corruption.
      
      Change-Id: I8ae0721d1bd203639e13891e2e54a2e87276f306
      7fb0f868
  2. 13 Dec, 2010 1 commit
    • John Koleszar's avatar
      remove unused temporal preproc code · b1aa54ab
      John Koleszar authored
      This code is unused, as the current preproc implementation uses the
      same spatial filter that postproc uses.
      
      Change-Id: Ia06d5664917d67283f279e2480016bebed602ea7
      b1aa54ab
  3. 09 Dec, 2010 1 commit
    • Paul Wilkins's avatar
      Correct q_low and q_high limits for the recode loop · c63fc881
      Paul Wilkins authored
      Corrected the initial Q range limits for the recode loop
      to reflect the current allowed range for the frame.
      
      In experimental work on constrained quality this bug was
      causing unnecessary recodes.
      
      Change-Id: I7e256fbfa681293b0223fe21ec329933d76c229f
      c63fc881
  4. 07 Dec, 2010 1 commit
    • Jim Bankoski's avatar
      vp8e - static threshold play · 718c1971
      Jim Bankoski authored
      Realized no need for new assembly code sum is already
      calculated.
      
      Change-Id: Ie2d94feb4b7c1f77c5359bca29b66228e41638c9
      718c1971
  5. 06 Dec, 2010 1 commit
    • Yunqing Wang's avatar
      Fix a memory leak problem in encoder · 9520f4b3
      Yunqing Wang authored
      Deallocating the buffers before re-allocating them.
      
      The fix passed James Berry's test program for memory
      leak check.
      
      Change-Id: I18c3cf665412c0e313a523e3d435106c03ca438d
      9520f4b3
  6. 04 Dec, 2010 1 commit
    • Paul Wilkins's avatar
      Change to inter_minq table. · cec6a596
      Paul Wilkins authored
      The inter_minq table controls the range of quantizers available
      for a particular frame in two pass relative to a max Q value.
      
      The changes reduces the range somewhat. The effect of this
      was a small increase (0.3% average) in psnr for the test set
      but it should also help encode speed somewhat for higher
      quality modes as it will reduce the number of iterations in the
      recode loop.
      
      The change damps the range of quantizers available locally
      within a section of a clip and should therefore help keep quality
      more uniform. If there is systematic overshoot or undershoot the
      range can shift gradually to accommodate. However, there is
      some increased risk of overshoot or undershoot against the target
      bit rate in VBR mode and this risk will be more pronounced for short
      clips.
      
      The change damps the range of quantizers available locally
      within a section of a clip and should therefore help keep quality
      more uniform. If there is systematic overshoot or undershoot the
      range can shift gradually to accommodate. However, there is
      some increased risk of overshoot or undershoot against the
      target bit rate in VBR mode and this risk will be more
      pronounced for short clips.
      
      Change-Id: I84465567d49ae767c6c73ff2a2aac30c895adb52
      cec6a596
  7. 03 Dec, 2010 1 commit
    • Yunqing Wang's avatar
      Improve MV prediction accuracy to achieve performance gain · c3bbb291
      Yunqing Wang authored
      Add vp8_mv_pred() to better predict starting MV for NEWMV
      mode in vp8_rd_pick_inter_mode(). Set different search
      ranges according to MV prediction accuracy, which improves
      encoder performance without hurting the quality. Also,
      as Yaowu suggested, using diamond search result as full
      search starting point and therefore adjusting(reducing)
      full search range helps the performance.
      
      Change-Id: Ie4a3c8df87e697c1f4f6e2ddb693766bba1b77b6
      c3bbb291
  8. 01 Dec, 2010 1 commit
    • Fritz Koenig's avatar
      Set refresh_alt_ref_frame on keyframe encode. · 9c8ad79f
      Fritz Koenig authored
      On a keyframe alt ref and golden are refreshed.  The flag was
      not being set and so on the frame after a keyframe, motion
      search would occur on the alt ref frame.  This is not necessary
      because the alt ref frame identical to the last frame in this
      scenario.
      
      Handle corner case where a forward alt-ref frame is put
      directly after a keyframe.
      
      Change-Id: I9be4cf290d694f8cf2f9a31852014b5ccf1504d3
      9c8ad79f
  9. 18 Nov, 2010 1 commit
    • Pascal Massimino's avatar
      remove warning · ed5ab7fa
      Pascal Massimino authored
      was having: "vp8/encoder/onyx_if.c:5365: warning: comparison of unsigned expression >= 0 is always true"
      ed5ab7fa
  10. 17 Nov, 2010 1 commit
    • Paul Wilkins's avatar
      Replaced recode loop test with a function call · f874391e
      Paul Wilkins authored
      Replaced existing code to decide if a frame recode is required
      with a function call. This is to simplify addition of extra clauses
      that may be needed for the planned constrained quality mode.
      
      Also fixed a bug where by alt ref not considered in the test.
      
      Change-Id: I3d40bb21abe3e19f8456761e6849deb171738b60
      f874391e
  11. 11 Nov, 2010 1 commit
    • John Koleszar's avatar
      quantizer: fix assertion in fast quantizer path · 0a49747b
      John Koleszar authored
      The fast quantizer assembly code has not been updated to match the new
      exact quantizer, which was made the default in commit 6adbe090.
      Specifically, they are not aware of the potential for the coefficient
      to be scaled, which results in the quantized result exceeding the range
      of the DCT. This patch restores the previous behavior of using the
      non-shifted coefficients when in the fast quantizer code path, but
      unfortunately requires rebuilding the tables when switching between the
      two.
      
      Change-Id: I0a33f5b3850335011a06906f49fafed54dda9546
      0a49747b
  12. 10 Nov, 2010 2 commits
    • Fritz Koenig's avatar
      postproc : Re-work posproc calling to allow more flags. · 647df00f
      Fritz Koenig authored
      Debugging in postproc needs more flags to allow for specific
      block types to be turned on or off in the visualizations.
      
      Must be enabled with --enable-postproc-visualizer during
      configuration time.
      
      Change-Id: Ia74f357ddc3ad4fb8082afd3a64f62384e4fcb2d
      647df00f
    • Paul Wilkins's avatar
      Tuning for the more exact quantizer. · 6adbe090
      Paul Wilkins authored
      Small changes to the default zero bin and rounding tables.
      Though the tables are currently the same for the Y1 and Y2 cases
      I have left them as separate tables in case we want to tune this later.
      
      There is now some adjustment of the zbin based on the prediction mode.
      Previously this was restricted to an adjustment for gf/arf 0,0 MV.
      
      The exact quantizer now marginal outperforms and is the default.
      
      The overall average gain is about 0.5%
      
      Change-Id: I5e4353f3d5326dde4e86823684b236a1e9ea7f47
      6adbe090
  13. 05 Nov, 2010 1 commit
    • John Koleszar's avatar
      improve average framerate calculation · f7e187d3
      John Koleszar authored
      Change Ice204e86 identified a problem with bitrate undershoot due to
      low precision in the timestamps passed to the library. This patch
      takes a different approach by calculating the duration of this frame
      and passing it to the library, rather than using a fixed duration
      and letting the library average it out with higher precision
      timestamps. This part of the fix only applies to vpxenc.
      
      This patch also attempts to fix the problem for generic applications
      that may have made the same mistake vpxenc did. Instead of
      calculating this frame's duration by the difference of this frame's
      and the last frame's start time, we use the end times instead. This
      allows the framerate calculation to scavenge "unclaimed" time from
      the last frame. For instance:
      
        start |  end  | calculated duration
        ======+=======+====================
          0ms    33ms   33ms
         33ms    66ms   33ms
         66ms    99ms   33ms
        100ms   133ms   34ms
      
      Change-Id: I92be4b3518e0bd530e97f90e69e75330a4c413fc
      f7e187d3
  14. 27 Oct, 2010 2 commits
    • Yunqing Wang's avatar
      Full search SAD function optimization in SSE4.1 · 71ecb5d7
      Yunqing Wang authored
      Use mpsadbw, and calculate 8 sad at once. Function list:
      vp8_sad16x16x8_sse4
      vp8_sad16x8x8_sse4
      vp8_sad8x16x8_sse4
      vp8_sad8x8x8_sse4
      vp8_sad4x4x8_sse4
      
      (test clip: tulip)
      For best quality mode, this gave encoder a 5% performance boost.
      For good quality mode with speed=1, this gave encoder a 3%
      performance boost.
      
      Change-Id: I083b5a39d39144f88dcbccbef95da6498e490134
      71ecb5d7
    • John Koleszar's avatar
      Add half-pixel variance RTCD functions · 209d82ad
      John Koleszar authored
      NEON has optimized 16x16 half-pixel variance functions, but they
      were not part of the RTCD framework. Add these functions to RTCD,
      so that other platforms can make use of this optimization in the
      future and special-case ARM code can be removed.
      
      A number of functions were taking two variance functions as
      parameters. These functions were changed to take a single
      parameter, a pointer to a struct containing all the variance
      functions for that block size. This provides additional flexibility
      for calling additional variance functions (the half-pixel special
      case, for example) and by initializing the table for all block sizes,
      we don't have to construct this function pointer table for each
      macroblock.
      
      Change-Id: I78289ff36b2715f9a7aa04d5f6fbe3d23acdc29c
      209d82ad
  15. 25 Oct, 2010 3 commits
    • Martin Ettl's avatar
      Fix leaked file descriptor with ENTROPY_STATS · c3fd2c4e
      Martin Ettl authored
      cppcheck found a leaked file descriptor in the debugging code
      enabled by defining ENTROPY_STATS. Fixes issue #60.
      
      Change-Id: I0c1d0669cb94d44fed77860f97b82763be06b7cb
      c3fd2c4e
    • Timothy B. Terriberry's avatar
      Add runtime CPU detection support for ARM. · b71962fd
      Timothy B. Terriberry authored
      The primary goal is to allow a binary to be built which supports
       NEON, but can fall back to non-NEON routines, since some Android
       devices do not have NEON, even if they are otherwise ARMv7 (e.g.,
       Tegra).
      The configure-generated flags HAVE_ARMV7, etc., are used to decide
       which versions of each function to build, and when
       CONFIG_RUNTIME_CPU_DETECT is enabled, the correct version is chosen
       at run time.
      In order for this to work, the CFLAGS must be set to something
       appropriate (e.g., without -mfpu=neon for ARMv7, and with
       appropriate -march and -mcpu for even earlier configurations), or
       the native C code will not be able to run.
      The ASFLAGS must remain set for the most advanced instruction set
       required at build time, since the ARM assembler will refuse to emit
       them otherwise.
      I have not attempted to make any changes to configure to do this
       automatically.
      Doing so will probably require the addition of new configure options.
      
      Many of the hooks for RTCD on ARM were already there, but a lot of
       the code had bit-rotted, and a good deal of the ARM-specific code
       is not integrated into the RTCD structs at all.
      I did not try to resolve the latter, merely to add the minimal amount
       of protection around them to allow RTCD to work.
      Those functions that were called based on an ifdef at the calling
       site were expanded to check the RTCD flags at that site, but they
       should be added to an RTCD struct somewhere in the future.
      The functions invoked with global function pointers still are, but
       these should be moved into an RTCD struct for thread safety (I
       believe every platform currently supported has atomic pointer
       stores, but this is not guaranteed).
      
      The encoder's boolhuff functions did not even have _c and armv7
       suffixes, and the correct version was resolved at link time.
      The token packing functions did have appropriate suffixes, but the
       version was selected with a define, with no associated RTCD struct.
      However, for both of these, the only armv7 instruction they actually
       used was rbit, and this was completely superfluous, so I reworked
       them to avoid it.
      The only non-ARMv4 instruction remaining in them is clz, which is
       ARMv5 (not even ARMv5TE is required).
      Considering that there are no ARM-specific configs which are not at
       least ARMv5TE, I did not try to detect these at runtime, and simply
       enable them for ARMv5 and above.
      
      Finally, the NEON register saving code was completely non-reentrant,
       since it saved the registers to a global, static variable.
      I moved the storage for this onto the stack.
      A single binary built with this code was tested on an ARM11 (ARMv6)
       and a Cortex A8 (ARMv7 w/NEON), for both the encoder and decoder,
       and produced identical output, while using the correct accelerated
       functions on each.
      I did not test on any earlier processors.
      
      Change-Id: I45cbd63a614f4554c3b325c45d46c0806f009eaa
      b71962fd
    • Johann's avatar
      isolate new temporal filtering code · e81e30c2
      Johann authored
      onyx_if is getting pretty big. split out the temporal code to make it
      easier to look at.
      
      Change-Id: I207c3a94c90e91b32e3ea5e1836a53b7a990fabd
      e81e30c2
  16. 21 Oct, 2010 1 commit
    • John Koleszar's avatar
      Move firstpass motion map to stats packet · bb7dd5b1
      John Koleszar authored
      The first implementation of the firstpass motion map for motion
      compensated temporal filtering created a file, fpmotionmap.stt,
      in the current working directory. This was not safe for multiple
      encoder instances. This patch merges this data into the first pass
      stats packet interface, so that it is handled like the other
      (numerical) firstpass stats.
      
      The new stats packet is defined as follows:
          Numerical Stats (16 doubles) -- 128 bytes
          Motion Map                   -- 1 byte / Macroblock
          Padding                      -- to align packet to 8 bytes
      
      The fpmotionmap.stt file can still be generated for debugging
      purposes in the same way that the textual version of the stats
      are available (defining OUTPUT_FPF in firstpass.c)
      
      Change-Id: I083ffbfd95e7d6a42bb4039ba0e81f678c8183ca
      bb7dd5b1
  17. 15 Oct, 2010 1 commit
    • Yaowu Xu's avatar
      change to make use of more trellis quantization · 2e53e9e5
      Yaowu Xu authored
      when a subsequent frame is encoded as an alt reference frame, it is
      unlikely that any mb in current frame will be used as reference for
      future frames, so we can enable quantization optimization even when
      the RD constant is slightly rate-biased. The change has an overall
      benefit between 0.1% to 0.2% bit savings on the test sets based on
      vpxssim scores.
      
      Change-Id: I9aa7bc5cd573ea84e3ee655d2834c18c4460ceea
      2e53e9e5
  18. 14 Oct, 2010 1 commit
  19. 12 Oct, 2010 1 commit
    • Timothy B. Terriberry's avatar
      Add simple version of activity masking. · 8d0f7a01
      Timothy B. Terriberry authored
      This uses MB variance to change the RDO weight for mode decision
       and quantization.
      Activity is normalized against the average for the frame, which is
       currently tracked using feed-forward statistics.
      This could also be used to adjust the quantizer for the entire
       frame, but that requires more extensive rate control changes.
      This does not yet attempt to adapt the quantizer within the frame,
       but the signaling cost means that will likely only be useful at
       very high rates.
      
      Change-Id: I26cd7c755cac3ff33cfe0688b1da50b2b87b9c93
      8d0f7a01
  20. 11 Oct, 2010 1 commit
    • Timothy B. Terriberry's avatar
      Remove INTRARDOPT #define and intra_rd_opt option. · dd08db93
      Timothy B. Terriberry authored
      This is just eliminating some cruft.
      Although a number of variables are declared only when INTRARDOPT
       is defined, they are used elsewhere without that protection, and
       no longer just for intra RDO.
      The intra_rd_opt flag was hard-coded to 1 and never checked.
      
      Change-Id: I83a81554ecee8053e7b4ccd8aa04e18fa60f8e4f
      dd08db93
  21. 02 Oct, 2010 1 commit
    • Paul Wilkins's avatar
      Tune effect of motion on KF/GF boost in two pass; · 788c0eb5
      Paul Wilkins authored
      This code adjust the impact of the amount and speed of motion
      on GF and KF boost.
      
      Sections with lots of slow motion will tend to have a
      somewhat bigger boost and sections with fast motion may
      have less.
      
      There is a knock on effect to the selection of the active
      quantizer range.
      
      This will likely require further tuning but helps with a couple
      of particularly bad edge cases.
      
      Change-Id: Ic2449cda7305672b69acf42fc0a845b77ac98d40
      788c0eb5
  22. 01 Oct, 2010 1 commit
  23. 29 Sep, 2010 4 commits
    • John Koleszar's avatar
      Rename mode_ref_lf_test_function · 7e5e3151
      John Koleszar authored
      This function graduated from being a test func to something that's on
      by default. Rename it and remove some spurious comments that confuse
      its status.
      
      Change-Id: I689695a3ad29c35e9a72a43ec93766733ac6c20b
      7e5e3151
    • John Koleszar's avatar
      Fix loopfilter delta zero transitions · b9be7a46
      John Koleszar authored
      Loopfilter deltas are initialized to zero on keyframes in the decoder.
      The values then persist from the previous frame unless an update bit
      is set in the bitstream. This data is not included in the entropy
      data saved by the 'refresh entropy' bit in the bitstream, so it is
      effectively an additional contextual element beyond the 3 ref-frames
      and the entropy data.
      
      The encoder was treating this delta update bit as update-if-nonzero,
      meaning that the value would be refreshed even if it hadn't changed,
      and more significantly, if the correct value for the delta changed
      to zero, the update wouldn't be sent, and the decoder would preserve
      the last (presumably non-zero) value.
      
      This patch updates the encoder to send an update only if the value
      has changed from the previously transmitted value. It also forces the
      value to be transmitted in error resilient mode, to account for lost
      context in the event of lost frames.
      
      Change-Id: I56671d5b42965d0166ac226765dbfce3e5301868
      b9be7a46
    • Paul Wilkins's avatar
      Change to coefficient optimization rules. · 7288cdf7
      Paul Wilkins authored
      Allow coefficient optimization for good quality speed 0.
      
      Change-Id: Id0cb363df6823c6798671584fbba097916a7df2c
      7288cdf7
    • Paul Wilkins's avatar
      Control of active min quantizer for two pass. · ff3068d6
      Paul Wilkins authored
      Create  look up tables for controlling the active quantizer range.
      Some initial tuning to improve quality circa 0.5% on test set.
      Clean up of some stats output code
      
      Change-Id: Ia698a8525f8b8129a503cadace3ee73fe888f543
      ff3068d6
  24. 28 Sep, 2010 1 commit
  25. 27 Sep, 2010 1 commit
  26. 24 Sep, 2010 1 commit
    • John Koleszar's avatar
      disable compilation of debugging code · 8ca779ab
      John Koleszar authored
      This patch avoids compiling some debugging code in onyx_if.c. The most
      significant fix is to avoid generating code for vp8_write_yuv_frame,
      which is never called. Some other code was removed by the dead code
      elimination performed by the compiler, and this patch does it with the
      preprocessor instead. There are advantages both ways.
      
      Change-Id: I044fd43179d2e947553f0d6f2cad5b40907ac458
      8ca779ab
  27. 09 Sep, 2010 2 commits
    • John Koleszar's avatar
      Fix GF interval for non-lagged ARFs · edcbb1c1
      John Koleszar authored
      When ARFs are enabled in non-lagged compress modes, the GF interval
      was being reset to zero. Non-lagged ARF updates were enabled in commit
      63ccfbd5, but this incorrect GF interval caused a quality regression.
      
      Change-Id: I615c3b493f4ce2127044f4e68d0bcb07d6b730c3
      edcbb1c1
    • John Koleszar's avatar
      Use WebM in copyright notice for consistency · c2140b8a
      John Koleszar authored
      Changes 'The VP8 project' to 'The WebM project', for consistency
      with other webmproject.org repositories.
      
      Fixes issue #97.
      
      Change-Id: I37c13ed5fbdb9d334ceef71c6350e9febed9bbba
      c2140b8a
  28. 08 Sep, 2010 2 commits
    • Jim Bankoski's avatar
      Skip unnecessary search of identical frames · 69ae8f47
      Jim Bankoski authored
      vp8_get_compressed_data() was defeating logic in
      encode_frame_to_datarate() that determined the reference buffers to
      search and forcing all frames to be eligible to search. In cases
      where buffers have identical contents, this is unnecessary extra
      work.
      
      Change-Id: I9e667ac39128ae32dc455a3db4c62e3efce6f114
      69ae8f47
    • Jim Bankoski's avatar
      Enable ARFs for non-lagged compress · 63ccfbd5
      Jim Bankoski authored
      ARFs were explicitly disabled except in lagged compress mode. New
      ARF logic allows for the ARF buffer to hold an older golden frame,
      which does not require lagged compress.
      
      Change-Id: I1dff82b6f53e8311f1e0514b1794ae05919d5f79
      63ccfbd5
  29. 03 Sep, 2010 1 commit
    • Scott LaVarnway's avatar
      Reduced the size of MB_MODE_INFO · 0de458f6
      Scott LaVarnway authored
      Moved partition_bmi and partition_count out of MB_MODE_INFO and
      placed into MACROBLOCK.  Also reduced the size of other members
      of the MB_MODE_INFO struct.  For 1080p, the memory was reduced
      by 1,209,516 bytes.  The decoder performance appeared to improve
      by 3% for the clip used.
      Note:  The main goal for this change is to improve the decoder
      performance.  The encoder will be revisited at a later date for
      further structure cleanup.
      
      Change-Id: I4733621292ee9cc3fffa4046cb3fd4d99bd14613
      0de458f6
  30. 31 Aug, 2010 1 commit
    • Paul Wilkins's avatar
      Improved Force Key Frame Behaviour · c239a1b6
      Paul Wilkins authored
      These changes improve the behaviour of the code with
      forced key frames sent in by a calling application.
      
      The sizing of the frames is still suboptimal for two pass in
      particular but the behaviour is much better than it was.
      
      Change-Id: I35fae610c67688ccc69d11f385e87dfc884e65a1
      c239a1b6
  31. 20 Aug, 2010 1 commit
    • John Koleszar's avatar
      increase rate control buffer level precision · 8e7ebacb
      John Koleszar authored
      The external API exposes the RC initial/optimal/full buffer level in
      milliseconds, but this value was truncated internally to seconds. This
      patch allows the use of the full precision during the conversion from
      time to bits.
      
      Change-Id: If8dd2a87614c05747f81432cbe75dd9e6ed2f04e
      8e7ebacb