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

codecs/av1: restore API compatibility #163

Merged
merged 1 commit into from
Dec 21, 2024
Merged
Changes from all commits
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
23 changes: 23 additions & 0 deletions pkg/codecs/av1/leb128.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@
"fmt"
)

// LEB128Unmarshal decodes an unsigned integer from the LEB128 format.
//
// Deprecated: replaced by LEB128.Unmarshal
func LEB128Unmarshal(buf []byte) (uint, int, error) {
var v LEB128
n, err := v.Unmarshal(buf)
return uint(v), n, err

Check warning on line 13 in pkg/codecs/av1/leb128.go

View check run for this annotation

Codecov / codecov/patch

pkg/codecs/av1/leb128.go#L10-L13

Added lines #L10 - L13 were not covered by tests
}

// LEB128MarshalSize returns the marshal size of an unsigned integer in LEB128 format.
//
// Deprecated: replaced by LEB128.MarshalSize
func LEB128MarshalSize(v uint) int {
return LEB128(v).MarshalSize()

Check warning on line 20 in pkg/codecs/av1/leb128.go

View check run for this annotation

Codecov / codecov/patch

pkg/codecs/av1/leb128.go#L19-L20

Added lines #L19 - L20 were not covered by tests
}

// LEB128MarshalTo encodes an unsigned integer with the LEB128 format.
//
// Deprecated: replaced by LEB128.MarshalTo
func LEB128MarshalTo(v uint, buf []byte) int {
return LEB128(v).MarshalTo(buf)

Check warning on line 27 in pkg/codecs/av1/leb128.go

View check run for this annotation

Codecov / codecov/patch

pkg/codecs/av1/leb128.go#L26-L27

Added lines #L26 - L27 were not covered by tests
}

// LEB128 is a unsigned integer that can be decoded/encoded from/to the LEB128 format.
// Specification: https://aomediacodec.github.io/av1-spec/#leb128
type LEB128 uint32
Expand Down