File size: 2,150 Bytes
f724cf3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// -----------------------------------------------------------------------------
// The proprietary software and information contained in this file is
// confidential and may only be used by an authorized person under a valid
// licensing agreement from Arm Limited or its affiliates.
//
// Copyright (C) 2025. Arm Limited or its affiliates. All rights reserved.
//
// This entire notice must be reproduced on all copies of this file and
// copies of this file may only be made by an authorized person under a valid
// licensing agreement from Arm Limited or its affiliates.
// -----------------------------------------------------------------------------
//
#ifndef NSS_KERNEL_LUT
#define NSS_KERNEL_LUT
#include "typedefs.h"


struct KernelTile {
    int16_t4 dy;
    int16_t4 dx;
};


// Define actual scale value based on mode
#if SCALE_MODE == SCALE_2_0X

#define CENTER_TAP 0
#define NUM_PATTERNS 4

const KernelTile kernelLUT[NUM_PATTERNS] = {
    {
        // Pattern 0:
        // Taps:  0,  2,  8, 10
        // Grid:
        //   [●  ·  ●  ·]
        //   [·  ·  ·  ·]
        //   [●  ·  ●  ·]
        //   [·  ·  ·  ·]
        int16_t4(-1, -1, +1, +1),
        int16_t4(-1, +1, -1, +1)
    },
    {
        // Pattern 1:
        // Taps:  4,  6, 12, 14
        // Grid:
        //   [·  ·  ·  ·]
        //   [●  ·  ●  ·]
        //   [·  ·  ·  ·]
        //   [●  ·  ●  ·]
        int16_t4(-1, -1, +1, +1),
        int16_t4(+0, +2, +0, +2)
    },
    {
        // Pattern 2:
        // Taps:  1,  3,  9, 11
        // Grid:
        //   [·  ●  ·  ●]
        //   [·  ·  ·  ·]
        //   [·  ●  ·  ●]
        //   [·  ·  ·  ·]
        int16_t4(+0, +0, +2, +2),
        int16_t4(-1, +1, -1, +1)
    },
    {
        // Pattern 3:
        // Taps:  5,  7, 13, 15
        // Grid:
        //   [·  ·  ·  ·]
        //   [·  ●  ·  ●]
        //   [·  ·  ·  ·]
        //   [·  ●  ·  ●]
        int16_t4( 0, +0, +2, +2), // center-aligned
        int16_t4( 0, +2, +0, +2)
    }
};

#else
    #error "Unsupported SCALE_MODE"
#endif


#endif //NSS_KERNEL_LUT