This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
scalers_amd64.go
61 lines (56 loc) · 1.95 KB
/
scalers_amd64.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright 2014 Benoît Amiaux. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package rez
func hasAsm() bool { return true }
func h8scale2Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func h8scale4Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func h8scale8Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func h8scale10Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func h8scale12Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func h8scaleNAmd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func v8scale2Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func v8scale4Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func v8scale6Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func v8scale8Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func v8scale10Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func v8scale12Amd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func v8scaleNAmd64(dst, src []byte, cof, off []int16, taps, width, height, dp, sp int)
func getHorizontalScaler(taps int, asm bool) scaler {
if !asm {
return getHorizontalScalerGo(taps)
}
switch taps {
case 2:
return h8scale2Amd64
case 4:
return h8scale4Amd64
case 8:
return h8scale8Amd64
case 10:
return h8scale10Amd64
case 12:
return h8scale12Amd64
}
return h8scaleNAmd64
}
func getVerticalScaler(taps int, asm bool) scaler {
if !asm {
return getVerticalScalerGo(taps)
}
switch taps {
case 2:
return v8scale2Amd64
case 4:
return v8scale4Amd64
case 6:
return v8scale6Amd64
case 8:
return v8scale8Amd64
case 10:
return v8scale10Amd64
case 12:
return v8scale12Amd64
}
return v8scaleNAmd64
}