-
Notifications
You must be signed in to change notification settings - Fork 211
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
GOP-FUSION #57
GOP-FUSION #57
Conversation
var | ||
i, | ||
currentObj, | ||
sum = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man, we need to start switching to let
in the project, pronto.
One other thing to think about: what happens with |
868e44d
to
95a22a9
Compare
i, | ||
currentFrame, | ||
dataOffset = 0, | ||
data = new Uint8Array(sumByteLengths(frames, 'data')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still slightly concerned that we're doing byte-wise iteration over and over again. Is there any way we could test the performance impact of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We aren't doing byte-wise iteration at all. Instead simply iterating over each frame to sum the lengths. It's exactly the same work as before just in it's own function. Also this is audio which is an order of magnitude less data (at least) than the video side.
290927c
to
ed23e90
Compare
/** | ||
* Compare two arrays (event typed) for same-ness | ||
*/ | ||
compareArrays = function(a, b) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function name is a bit vague. What about arrayEquals()?
|
||
// create the default sample | ||
// see ISO/IEC 14496-12:2012, section 8.6.4.3 | ||
this.createDefaultSample_ = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a little easier to understand as an object prototype/class that you can new
.
9cc7250
to
5064f06
Compare
currentFrame = aacFrames[0]; | ||
sample = { | ||
size: currentFrame.data.byteLength, | ||
duration: 1024 // FIXME calculate for realz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda sad to see this delightful comment go...
* Clean up a lot and made both flush functions much more readable and extensible * Added the ability for VideoSegment to hold onto the last GOP in a segment and prepend it to the next segment if certain conditions are met
* We are now much more strict about filtering everything before the first AUD * We also are more consistent and use DTS values only for calculating the compositionTimeOffset - PTS is used everywhere else * Rules for guessing sample duration changed slightly
* Supports minor backtracking by the fetcher which is seen in certain scenarios * Tightened the GOP selection code to be more strict * Doesn't select a GOP if the SPS or PPS different (ie. on a rendition switch)
…instead of trying to do gop-fusion
…out it's contents
… subject to change/removal
…rame as the first frame
The first iteration of holding onto the last-segment's-GOP and attempting to prepend that GOP to the next segment.
The
flush
functions are much nicer - far fewer variables; limited global mutations; fit on one screen! The bulk of the work has been moved to functions that perform limited parts of what the giantwhile
loop used to do. The functions are written so that they do not mutate their parameters for sanity reasons.While this might be slightly less performant, it is still O(n) and is much easier to reason about the steps that are happening on a flush.
The last GOP in a segment is held onto and prepended onto the next segment providing the next segment is greater than the GOP in time AND the next segment is within 10 seconds of the GOP.