Skip to content

Commit

Permalink
codecs/av1: restore API compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Dec 21, 2024
1 parent 30ac4d4 commit 5224c7c
Showing 1 changed file with 23 additions and 0 deletions.
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 @@ import (
"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

0 comments on commit 5224c7c

Please sign in to comment.