1. 25 Oct, 2010 1 commit
    • 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
  2. 22 Oct, 2010 2 commits
    • Timothy B. Terriberry's avatar
      Improve handling of invalid frames. · 09bcc1f7
      Timothy B. Terriberry authored
      The code was not checking for frame sizes smaller than 3 bytes, and the
       partition size checks might have failed if the input buffer was within
       16MB of the top of the heap.
      In addition, the reference count on the current frame buffer was not
       being decremented on error, so after a small number of errors, no new
       frame buffer could be found and it would run off the list of them.
      
      Change-Id: I0c60dba6adb1e2a29df39754f72a56ab6c776b46
      09bcc1f7
    • Timothy B. Terriberry's avatar
      Convert [4][4] matrices to [16] arrays. · 8f75ea6b
      Timothy B. Terriberry authored
      Most of the code that actually uses these matrices indexes them as
       if they were a single contiguous array, and coverity produces
       reports about the resulting accesses that overflow the static
       bounds of the first row.
      This is perfectly legal in C, but converting them to actual [16]
       arrays should eliminate the report, and removes a good deal of
       extraneous indexing and address operators from the code.
      
      Change-Id: Ibda479e2232b3e51f9edf3b355b8640520fdbf23
      8f75ea6b
  3. 04 Oct, 2010 2 commits
    • Jan Kratochvil's avatar
      nasm: address labels 'rel label' vice 'wrt rip' · 5cdc3a4c
      Jan Kratochvil authored
      nasm does not support `label wrt rip', it requires `rel label'. It is
      still fully compatible with yasm.
      
      Provide nasm compatibility. No binary change by this patch with yasm on
      {x86_64,i686}-fedora13-linux-gnu. Few longer opcodes with nasm on
      {x86_64,i686}-fedora13-linux-gnu have been checked as safe.
      
      Change-Id: I488773a4e930a56e43b0cc72d867ee5291215f50
      5cdc3a4c
    • Jan Kratochvil's avatar
      nasm: match instruction length (movd/movq) to parameters · e114f699
      Jan Kratochvil authored
      nasm requires the instruction length (movd/movq) to match to its
      parameters. I find it more clear to really use 64bit instructions when
      we use 64bit registers in the assembly.
      
      Provide nasm compatibility. No binary change by this patch with yasm on
      {x86_64,i686}-fedora13-linux-gnu. Few longer opcodes with nasm on
      {x86_64,i686}-fedora13-linux-gnu have been checked as safe.
      
      Change-Id: Id9b1a5cdfb1bc05697e523c317a296df43d42a91
      e114f699
  4. 27 Sep, 2010 1 commit
  5. 24 Sep, 2010 1 commit
    • John Koleszar's avatar
      move reconintra_mt to decoder (for now) · 48e76ff4
      John Koleszar authored
      reconintra_mt.c is only required for building the decoder right now.
      It could definitely be used for the encoder in the future, but it
      currently depends on decoder only data structures. (onyxd_int.h,
      VP8D_COMP, etc). Move it from common/ to decoder/ until the
      necessary changes to the common multithread code are complete.
      
      This patch is needed to build with --disable-vp8-decoder.
      
      Change-Id: I568c52221a2b309234d269675cba97131ce35c86
      48e76ff4
  6. 23 Sep, 2010 1 commit
  7. 21 Sep, 2010 2 commits
    • John Koleszar's avatar
      unset execute bit on c source · cdd20666
      John Koleszar authored
      Change-Id: I6625ee41f8872908cb015ce0729e1c7a105b5217
      cdd20666
    • John Koleszar's avatar
      Don't reset mb clamping state during splitmv decoding · 4d391e8e
      John Koleszar authored
      The MV decoding changes in c5fb0eb8 introduced a bug where the
      macroblock clamping state was reset for each partition, so if an
      earlier partition needed clamping but a subsequent one didn't,
      the MB wouldn't receive clamping. Instead, the state is only
      set during splitmv decoding, never cleared.
      
      Change-Id: I224fe258493405ee0f6a04596acdb622c475e845
      4d391e8e
  8. 17 Sep, 2010 2 commits
    • Johann's avatar
      reorder data to use wider instructions · 022323bf
      Johann authored
      the previous commit laid the groundwork by doing two sets of idcts
      together. this moved that further by grouping the interesting data
      (q[0], q+16[0]) together to allow using wider instructions. also
      managed to drop a few instructions by recognizing that the constant
      for sinpi8sqrt2 could be downshifted all the time which avoided a
      dowshift as well as workarounds for a function which only accepted
      signed data
      
      looks like a modest gain for performance: at qcif, went from ~180
      fps to ~183
      Change-Id: I842673f3080b8239e026cc9b50346dbccbab4adf
      022323bf
    • Yunqing Wang's avatar
      Restructure multi-threaded decoder · f857a850
      Yunqing Wang authored
      On each MB, loopfiltering is done right after MB decoding. This
      combines two loops in multi-threaded code into one, which reduces
      number of synchronizations to half.
      
      The above-row/left-col data are saved in temp buffers for
      next-row/next MB decoding.
      
      Tests on 4-core gLucid machine showed 10% decoder performance
      gain with threads=4 (tulip clip). Testing on other platforms
      isn't done yet.
      
      Change-Id: Id18ea7c1e84965dabea65d4c01ca5bc056ddeac9
      f857a850
  9. 16 Sep, 2010 1 commit
    • John Koleszar's avatar
      cleanup: remove unused xprintf · 9100073e
      John Koleszar authored
      These files aren't currently used, and we can get them back if we
      need them.
      
      Change-Id: I62aa3bff828e491a80c80eeb84a7c44903df29b5
      9100073e
  10. 09 Sep, 2010 3 commits
    • Scott LaVarnway's avatar
      Improved subset block search · c5fb0eb8
      Scott LaVarnway authored
      Improved the subset block search and fill.  (about 3% improvement for
      32 bit)  Modified/merged the code in order to create
      vp8_read_mb_modes_mv which can decode the modes/mvs on a macroblock
      level. This will allow the decode loop (in the future) to decode
      modes/mvs on a frame, row, or mb level.
      
      Change-Id: If637d994b508792f846d39b5d44a7bf9aa5cddf3
      c5fb0eb8
    • Johann's avatar
      Update NEON wide idcts · 14ba7642
      Johann authored
      Expand 93c32a55 which used SSE2 instructions to do two
      idct/dequant/recons at a time to NEON. Initial working
      commit. More work needs to be put into rearranging and
      interlacing the data to take advantage of quadword
      operations, which is when we'll hopefully see a much
      better boost
      
      Change-Id: I86d59d96f15e0d0f9710253e2c098ac2ff2865d1
      14ba7642
    • 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
  11. 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
  12. 02 Sep, 2010 1 commit
    • Frank Galligan's avatar
      Fix rare deadlock before loop filter · d45e5501
      Frank Galligan authored
      There was an extremely rare deadlock that happened when one thread
      was waiting to start the loop filter on frame n while the other
      threads were starting to work on frame n+1.
      
      Change-Id: Icc94f728b3b6663405435640d9a2996735ba19ef
      d45e5501
  13. 01 Sep, 2010 1 commit
  14. 31 Aug, 2010 2 commits
    • Johann's avatar
      followup arm patch · 0b94f5d6
      Johann authored
      make the arm asm detokenizer work with the new structures
      
      Change-Id: I7cd92c2a018ec24032bb1cfd1bb9739bc84b444a
      0b94f5d6
    • Scott LaVarnway's avatar
      Changed above and left context data layout · e85e6315
      Scott LaVarnway authored
      The main reason for the change was to reduce cycles in the token
      decoder. (~1.5% gain for 32 bit)  This layout should be more
      cache friendly.
      
      As a result of this change, the encoder had to be updated.
      
      Change-Id: Id5e804169d8889da0378b3a519ac04dabd28c837
      Note: dixie uses a similar layout
      e85e6315
  15. 24 Aug, 2010 1 commit
    • Johann's avatar
      clean up compiler warnings · 5c244398
      Johann authored
      did a test compile with clang and got rid of some warnings that have
      been annoying me for a while:
      vp8/decoder/detokenize.c: In function 'vp8_init_detokenizer':
      vp8/decoder/detokenize.c:121: warning: assignment discards qualifiers from pointer target type
      vp8/decoder/detokenize.c:122: warning: assignment discards qualifiers from pointer target type
      vp8/decoder/detokenize.c:123: warning: assignment from incompatible pointer type
      vp8/decoder/detokenize.c:124: warning: assignment discards qualifiers from pointer target type
      vp8/decoder/detokenize.c:125: warning: assignment discards qualifiers from pointer target type
      vp8/decoder/detokenize.c:128: warning: assignment discards qualifiers from pointer target type
      vp8/decoder/detokenize.c:129: warning: assignment discards qualifiers from pointer target type
      vp8/decoder/detokenize.c:130: warning: assignment discards qualifiers from pointer target type
      vp8/decoder/detokenize.c:131: warning: assignment discards qualifiers from pointer target type
      
      Change-Id: I78ddab176fe47cbeed30379709dc7bab01c0c2e4
      5c244398
  16. 23 Aug, 2010 2 commits
    • Johann's avatar
      update structures · d73217ab
      Johann authored
      mbmi and eob moved in previous commits
      
      Change-Id: I30a2eba36addf89ee50b406ad4afdd059a832711
      d73217ab
    • Fritz Koenig's avatar
      Rework idct calling structure. · 93c32a55
      Fritz Koenig authored
      Moving the eob structure allows for a non-struct based
      function to handle decoding an entire mb of
      idct/dequant/recon data.  This allows for SIMD functions
      to idct/dequant/recon multiple blocks at once.
      
      SSE2 implementation gives 3% gain on Atom.
      
      Change-Id: I8a8f3efd546ea4e0535f517d94f347cfb737c9c2
      93c32a55
  17. 12 Aug, 2010 2 commits
    • Johann's avatar
      framework for assembly version of the detokenizer · 9602799c
      Johann authored
      adds a compile time option: --enable-arm-asm-detok which pulls in
      vp8/decoder/arm/detokenize.asm
      
      currently about break even speed wise, but changes are pending to
      the fill code (branch and load 3 bytes versus conditionally always
      load one) and the error handling. Currently it doesn't handle zero
      runs or overrunning the buffer.
      
      this is really just so i don't have to rebase my changes all the
      time to run benchmarks - now just need to replace one file!
      
      Change-Id: I56d0e2354dc0ca3811bffd0e88fe1f952fa6c797
      9602799c
    • Scott LaVarnway's avatar
      Removed unnecessary MB_MODE_INFO copies · 9c7a0090
      Scott LaVarnway authored
      These copies occurred for each macroblock in the encoder and decoder.
      Thetemp MB_MODE_INFO mbmi was removed from MACROBLOCKD.  As a result,
      a large number compile errors had to be fixed.
      
      Change-Id: I4cf0ffae3ce244f6db04a4c217d52dd256382cf3
      9c7a0090
  18. 11 Aug, 2010 1 commit
  19. 10 Aug, 2010 1 commit
    • Yunqing Wang's avatar
      First modification of multi-thread decoder · ba2e107d
      Yunqing Wang authored
      This is the first modification of VP8 multi-thread decoder, which uses
      same threads to decode macroblocks and then do loopfiltering for each
      frame.
      
      Inspired by Rob Clark, synchronization was done on every 8 macroblocks
      instead of every macroblock to reduce lock contention.
      
      Comparing with the original code, this implementation gave about 15%-
      20% performance gain while decoding my test clips on a Core2 Quad
      platform (Linux).
      
      The work is not done yet.
      
      Test on other platforms are needed.
      
      Change-Id: Ice9ddb0b511af1359b9f71e65066143c04fef3b5
      ba2e107d
  20. 02 Aug, 2010 1 commit
  21. 29 Jul, 2010 1 commit
  22. 27 Jul, 2010 1 commit
    • Johann's avatar
      Fix build w/o RTCD · b9a038a5
      Johann authored
      So many places to update ...
      
      Change-Id: Ide957b40cc833f99c2d1849acade6850fbf7585d
      b9a038a5
  23. 26 Jul, 2010 1 commit
    • Johann's avatar
      update arm idct functions · 56f5a9a0
      Johann authored
      Jeff Muizelaar posted some changes to the idct/reconstruction c code.
      This is the equivalent update for the arm assembly.
      
      This shows a good boost on v6, and a minor boost on neon.
      Here are some numbers for highway in qcif, 2641 frames:
      HEAD neon: ~161 fps
      new neon:  ~162 fps
      HEAD v6:   ~102 fps
      new v6:    ~106 fps
      
      The following functions have been updated for armv6 and neon:
      vp8_dc_only_idct_add
      vp8_dequant_idct_add
      vp8_dequant_dc_idct_add
      
      Conflicts:
      
      	vp8/decoder/arm/armv6/dequantdcidct_v6.asm
      	vp8/decoder/arm/armv6/dequantidct_v6.asm
      
      Resolved by removing these files. When I rewrote the functions, I also
      moved the files to dequant_dc_idct_v6.asm/dequant_idct_v6.asm
      
      Change-Id: Ie3300df824d52474eca1a5134cf22d8b7809a5d4
      56f5a9a0
  24. 23 Jul, 2010 3 commits
    • Jeff Muizelaar's avatar
      Change the x86 idct functions to do reconstruction at the same time · 98fcccfe
      Jeff Muizelaar authored
      Change-Id: I896fe6f9664e6849c7cee2cc6bb4e045eb42540f
      98fcccfe
    • Jeff Muizelaar's avatar
      Combine idct and reconstruction steps · b2fa74ac
      Jeff Muizelaar authored
      This moves the prediction step before the idct and combines the idct and
      reconstruction steps into a single step. Combining them seems to give an
      overall decoder performance improvement of about 1%.
      
      Change-Id: I90d8b167ec70d79c7ba2ee484106a78b3d16e318
      b2fa74ac
    • Fritz Koenig's avatar
      Swap alt/gold/new/last frame buffer ptrs instead of copying. · 0ce39012
      Fritz Koenig authored
      At the end of the decode, frame buffers were being copied.
      The frames are not updated after the copy, they are just
      for reference on later frames.  This change allows multiple
      references to the same frame buffer instead of copying it.
      
      Changes needed to be made to the encoder to handle this.  The
      encoder is still doing frame buffer copies in similar places
      where pointer reference could be done.
      
      Change-Id: I7c38be4d23979cc49b5f17241ca3a78703803e66
      0ce39012
  25. 22 Jul, 2010 1 commit
    • Fritz Koenig's avatar
      Remove CONFIG_NEW_TOKENS files. · 08eed049
      Fritz Koenig authored
      These files were out of date and no longer maintained.
      Token decoding has implemented the no-crash code which
      is incompatible with this arm assembly code.
      
      Change-Id: Ibf729886c56fca48181af60b44bda896c30023fc
      08eed049
  26. 12 Jul, 2010 1 commit
  27. 30 Jun, 2010 2 commits
  28. 18 Jun, 2010 1 commit
    • John Koleszar's avatar
      cosmetics: trim trailing whitespace · 94c52e4d
      John Koleszar authored
      When the license headers were updated, they accidentally contained
      trailing whitespace, so unfortunately we have to touch all the files
      again.
      
      Change-Id: I236c05fade06589e417179c0444cb39b09e4200d
      94c52e4d