From 5224c7c8d05181b6780874aa06c90f7d22772687 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sat, 21 Dec 2024 20:20:13 +0100 Subject: [PATCH] codecs/av1: restore API compatibility --- pkg/codecs/av1/leb128.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pkg/codecs/av1/leb128.go b/pkg/codecs/av1/leb128.go index 3992010..1973581 100644 --- a/pkg/codecs/av1/leb128.go +++ b/pkg/codecs/av1/leb128.go @@ -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 +} + +// 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() +} + +// 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) +} + // 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