Skip to content
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

Stream: delta impl #21

Merged
merged 4 commits into from
Sep 6, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
comment
  • Loading branch information
thempatel committed Sep 6, 2021
commit 401a69804c362c265f66673346d8d833d9fa322b
16 changes: 16 additions & 0 deletions pkg/stream/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ func ReadAll(count int, stream []byte, out []uint32) {
}
}

// ReadAllDelta will read the entire input stream into out according to the
// Stream VByte format. It will select the best implementation depending
// on the presence of special hardware instructions. It will reconstruct the
// original non differentially encoded values.
//
// Note: It is your responsibility to ensure that the incoming slices are
// appropriately sized as well as tracking the count of integers in the
// stream.
func ReadAllDelta(count int, stream []byte, out []uint32, prev uint32) {
if decode.GetMode() == shared.Fast {
ReadAllDeltaFast(count, stream, out, prev)
} else {
ReadAllDeltaScalar(count, stream, out, prev)
}
}

// ReadAllScalar will read the entire input stream into out according to the
// Stream VByte format.
//
Expand Down