GSoC 2023: Improve Waveform drawing speed

Week 5 Report: July 3rd to July 9th

  • Iterated a few times on the multithreading PR with the help of @iss. Still pending to be merged.
  • I was able to get a working proof of concept of loading only the data for the visible part of a sound strip:
    • In sequencer_draw.cc we determine the start and end position of the audio strip (values between 0.0f and 1.0f)
    • When a PreviewJobAudio is enqueued for processing, it contains the start and end positions.
    • When the job is processed, we figure out the correct start and end sample indexes by multiplying the start/end positions by the total number of samples in the audio.
    • This lets us compute how many samples AUD should read in order to draw the visible waveform segment
  • While I initially thought that using uint8_t values for the start/end would be sufficient, it didn’t work as soon as I started testing with large files. Quite often <1% of the strip was visible. By using integer markers meant I was had to load a lot more data than needed. I moved the code to use floating point numbers for now.
  • Spent time reading through the following files:
  • Unfortunately audaspace doesn’t offer the interface I need to make things work. I hacked (read copy-pasted) the AUD_readSound function to get what I needed for the PoC working. Need to figure out what is the process to get that code added to their repo.

Demos

NOTE: Both demos run a release build.

Blender Main

Changes present in Blender’s main branch (commit f2705dd9133a2594a152a6e1d48580e9c35d746e)

Partial waveform load proof of concept

Next steps

  • Fill out the GSOC 2023 midterm report
  • Get the multithreading PR merged
  • Work out how to get the needed changes made to the audaspace library
  • Prepare the PR with the changes to load only the visible part of the sound strips.
4 Likes