mirror of https://bitbucket.org/ausocean/av.git
codec/h264/h264dec: made absi faster and more readable
This commit is contained in:
parent
a7abd76113
commit
08d3f6c3d1
|
@ -9,7 +9,6 @@ package h264dec
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"math"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// binToSlice is a helper function to convert a string of binary into a
|
// binToSlice is a helper function to convert a string of binary into a
|
||||||
|
@ -57,6 +56,9 @@ func mini(a, b int) int {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
func absi(i int) int {
|
func absi(a int) int {
|
||||||
return int(math.Abs(float64(i)))
|
if a < 0 {
|
||||||
|
return -a
|
||||||
|
}
|
||||||
|
return a
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue