-
Notifications
You must be signed in to change notification settings - Fork 307
Time Remapping & Audio Resampling Improvements #905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Refactor AudioLocation into own header - AudioResampler now supports variable channels - Adding cache back to Clips - to prevent the cost of multiple calls for the same GetFrame() frame, used in time-remapping - Large refactor of Clip::GetFrame, to prevent multiple code paths, and much improved time-remapping - Clip's time keyframe now supports Bezier and sub-frame precision - to you can curve audio speed using any curve shape - Fixing # of audio samples on Clip frame's, based on timeline position (to predictably divide samples per frame) - New Clip unit tests for time remapping and resampling audio, and reversing audio - New Frame::GetAudioSamples arg, to allow for reversing the direction of audio samples - Fix bug in Frame::AddAudioSilence() to correctly cache the # of audio samples - FrameMapper clean up resample context (when changing frame rate) - FrameMapper refactor to optimize # of calls to Reader()::GetFrame(), since calls to Clip::GetFrame are quite expensive - Removing RepeatingFraction functionality from Keyframe object (since it was a bad implementation detail from our previous time remapping) - Making Keyframe GetDelta method a float, and no longer an int - to allow for more precision on time remapping - Large amount of white space fixing (to make things consistent)
Member
Author
…used lots of clicks / seams between frames... Also, added a new overload to GetInterleavedAudioSamples, to reverse the samples before returning the float* array. Essentially, the FrameMapper is now aware of it's parent clip, and especially the 'time' keyframe, if the audio is in the forward or reverse direction. Also fixed a memory leak in time remapping.
… used for time remapping. - Added new Frame::ReverseAudio() helper method - for time keyframe support playing backwards audio - Fixed math rounding error on time keyframe Resampler, to use the rounded source samples value - Removed some unused args and Frame audio methods - Reset FrameMapper resample context when non-adjacent frames are requested - Correctly reverse Frame audio if a time keyframe is present, and reversing audio - Rewrite Keyframe::IsIncreasing() function, to give accurate direction of time keyframes at any index (special logic to support first and last indexes) - Fixed Keyframe unit tests - since logic has changed a bit - Improved time mapping unit tests - Replace many c-style casts with static_cast - Added new sine.wav test file
Codecov Report
@@ Coverage Diff @@
## develop #905 +/- ##
===========================================
+ Coverage 52.70% 54.04% +1.34%
===========================================
Files 190 191 +1
Lines 16771 16842 +71
===========================================
+ Hits 8839 9103 +264
+ Misses 7932 7739 -193
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…), and removing version logic around swresample/avresample logic - since GitHub versions are completely different than expected (for example: avformat version: 3.100 vs avformat version: 58.45.100)
…the EXTRA_INPUT_SAMPLES, to prevent the resampler from becoming input limited. - Fixed some unit tests - Added new convenience methods for SampleRange, to extend either side, or shift it left or right - Added new SampleRange unit tests - No more audio pops at the beginning of clips which are being resampled!!! - Time remapping now works perfectly smoothly, no more pops or crashes!!!
Member
Author
…ce to the time-mapping resampler, to prevent some strange waveform issues at the beginning of a time-mapped clip
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Large refactor of
Clip::GetFrame()and time-remapping of audio samples. This also addresses a common crash, often reported while speeding up or slowing down a clip using thetimekeyframe. This PR also includes quite a few optimizations and performance improvements, especially betweenFrameMapper::GetFrame()andClip::GetFrame().Frame::ReverseAudio()function which safely reverses audio for a frame - only 1 timeExtend(),Shrink(), andShift()methods