@geastack/targets 0.1.87 → 0.1.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/targets/esp32/app_project.cmake +18 -1
- package/targets/esp32/chip_bindings/audio/echo_cancellation.cpp +229 -0
- package/targets/esp32/chip_bindings/audio/echo_cancellation.h +13 -0
- package/targets/esp32/chip_bindings/audio/es8311.cpp +293 -45
- package/targets/esp32/chip_bindings/displays/rgb_panel.cpp +115 -12
- package/targets/esp32/chip_bindings/expanders/io_expander.h +2 -0
- package/targets/esp32/chip_bindings/expanders/tca9554.cpp +74 -0
- package/targets/esp32/chip_bindings/touch/ft3168.cpp +23 -1
- package/targets/esp32/chip_bindings/touch/ft3168_controller.h +1 -0
- package/targets/esp32/chip_bindings/touch/gt911.cpp +4 -3
- package/targets/esp32/components/gea_framework/CMakeLists.txt +8 -1
- package/targets/esp32/components/gea_juice/CMakeLists.txt +46 -0
- package/targets/esp32/components/gea_juice/README.md +20 -0
- package/targets/esp32/components/gea_juice/juice_memory.c +19 -0
- package/targets/esp32/components/gea_juice/juice_memory.h +16 -0
- package/targets/esp32/components/gea_juice/patch_threads.py +50 -0
- package/targets/esp32/components/gea_vp8_peer/CMakeLists.txt +16 -0
- package/targets/esp32/components/gea_vp8_peer/README.md +39 -0
- package/targets/esp32/components/gea_vp8_peer/gea_vp8_peer.h +21 -0
- package/targets/esp32/components/gea_vp8_peer/vp8_peer.cpp +538 -0
- package/targets/esp32/components/gea_vpx/CMakeLists.txt +235 -0
- package/targets/esp32/components/gea_vpx/README.md +133 -0
- package/targets/esp32/components/gea_vpx/i420_rgb565_s3.S +169 -0
- package/targets/esp32/components/gea_vpx/vp8_blocks_s3.c +42 -0
- package/targets/esp32/components/gea_vpx/vp8_copy_s3.S +39 -0
- package/targets/esp32/components/gea_vpx/vp8_entropy_s3.c +76 -0
- package/targets/esp32/components/gea_vpx/vp8_filter_s3.S +58 -0
- package/targets/esp32/components/gea_vpx/vp8_idct_s3.S +269 -0
- package/targets/esp32/components/gea_vpx/vp8_intrapred_s3.S +65 -0
- package/targets/esp32/components/gea_vpx/vp8_loopfilter_s3.S +333 -0
- package/targets/esp32/components/gea_vpx/vp8_loopfilter_s3.c +62 -0
- package/targets/esp32/components/gea_vpx/vp8_profile_s3.c +22 -0
- package/targets/esp32/components/gea_vpx/vp8_profile_s3.h +20 -0
- package/targets/esp32/components/gea_vpx/vp8_s3.c +120 -0
- package/targets/esp32/components/gea_vpx/vp8_s3.h +58 -0
- package/targets/esp32/components/gea_vpx/vp8_workspace_s3.c +14 -0
- package/targets/esp32/components/gea_vpx/vpx_memory.c +41 -0
- package/targets/esp32/connectivity/diagnostics_transport.cpp +18 -0
- package/targets/esp32/connectivity/wifi.cpp +30 -13
- package/targets/esp32/crypto/srtp_hmac_psa.c +118 -0
- package/targets/esp32/display.cpp +21 -0
- package/targets/esp32/gea_framework.cmake +7 -0
- package/targets/esp32/host_sources.cmake +2 -0
- package/targets/esp32/i2c_completion_order.cmake +57 -0
- package/targets/esp32/patch_streaming_dependencies.py +233 -0
- package/targets/esp32/services/device_control.cpp +209 -7
- package/targets/esp32/services/frame_scheduler.cpp +36 -1
- package/targets/esp32/services/opus_benchmark.h +82 -0
- package/targets/esp32/services/pcm_simd_check.h +73 -0
- package/targets/esp32/services/srtp_benchmark.h +106 -0
- package/targets/esp32/services/video_simd_benchmark.h +477 -0
- package/targets/esp32/services/vp8_benchmark.h +147 -0
- package/targets/esp32/streaming_dependency_patches.cmake +103 -0
- package/targets/esp32-m5stack-m5paper/main/idf_component.yml +2 -0
- package/targets/esp32-p4-m5stack-tab5/main/idf_component.yml +2 -0
- package/targets/esp32-p4-waveshare-touch-lcd-3.5/main/idf_component.yml +2 -0
- package/targets/esp32-p4-waveshare-touch-lcd-7/main/idf_component.yml +2 -0
- package/targets/esp32-s3-elecrow-rotary-2.1/main/idf_component.yml +2 -0
- package/targets/esp32-s3-epaper-1.54/main/idf_component.yml +2 -0
- package/targets/esp32-s3-lilygo-t-display-s3-long/main/idf_component.yml +2 -0
- package/targets/esp32-s3-m5stack-papers3/main/idf_component.yml +2 -0
- package/targets/esp32-s3-m5stack-sticks3/main/idf_component.yml +2 -0
- package/targets/esp32-s3-touch-amoled-1.75/main/idf_component.yml +2 -0
- package/targets/esp32-s3-touch-amoled-1.8/dependencies.lock +125 -2
- package/targets/esp32-s3-touch-amoled-1.8/main/CMakeLists.txt +29 -3
- package/targets/esp32-s3-touch-amoled-1.8/main/app_main.cpp +6 -3
- package/targets/esp32-s3-touch-amoled-1.8/main/idf_component.yml +15 -0
- package/targets/esp32-s3-touch-amoled-1.8/main/include/board.h +12 -0
- package/targets/esp32-s3-touch-amoled-1.8/sdkconfig.defaults +9 -1
- package/targets/esp32-s3-touch-amoled-2.06/CMakeLists.txt +2 -0
- package/targets/esp32-s3-touch-amoled-2.06/dependencies.lock +172 -8
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +9 -1
- package/targets/esp32-s3-touch-amoled-2.06/main/app_main.cpp +10 -3
- package/targets/esp32-s3-touch-amoled-2.06/main/idf_component.yml +21 -1
- package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +10 -0
- package/targets/esp32-s3-touch-amoled-2.06/main/touch.cpp +7 -0
- package/targets/esp32-s3-touch-amoled-2.41/dependencies.lock +57 -1
- package/targets/esp32-s3-touch-amoled-2.41/main/idf_component.yml +10 -0
- package/targets/esp32-s3-waveshare-touch-lcd-4b.json +504 -0
- package/targets.json +12 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
// Differential verification of the S3 entropy optimization against libvpx's
|
|
3
|
+
// original arithmetic-bit algorithm (libvpx 1.16.0, BSD-licensed).
|
|
4
|
+
#include "vp8_s3.h"
|
|
5
|
+
#include "vp8/decoder/dboolhuff.h"
|
|
6
|
+
#include "esp_timer.h"
|
|
7
|
+
#include <string.h>
|
|
8
|
+
|
|
9
|
+
static __attribute__((noinline)) int reference_bit(BOOL_DECODER *br, int probability) {
|
|
10
|
+
const unsigned split = 1 + (((br->range - 1) * probability) >> 8);
|
|
11
|
+
if (br->count < 0) vp8dx_bool_decoder_fill(br);
|
|
12
|
+
VP8_BD_VALUE value = br->value;
|
|
13
|
+
int count = br->count;
|
|
14
|
+
const VP8_BD_VALUE bigsplit = (VP8_BD_VALUE)split << (VP8_BD_VALUE_SIZE - 8);
|
|
15
|
+
unsigned range = split;
|
|
16
|
+
int bit = 0;
|
|
17
|
+
if (value >= bigsplit) {
|
|
18
|
+
range = br->range - split;
|
|
19
|
+
value -= bigsplit;
|
|
20
|
+
bit = 1;
|
|
21
|
+
}
|
|
22
|
+
const unsigned shift = vp8_norm[(unsigned char)range];
|
|
23
|
+
br->range = range << shift;
|
|
24
|
+
br->value = value << shift;
|
|
25
|
+
br->count = count - shift;
|
|
26
|
+
return bit;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static void decrypt(void *opaque, const unsigned char *input, unsigned char *output, int size) {
|
|
30
|
+
const unsigned char key = *(const unsigned char *)opaque;
|
|
31
|
+
for (int i = 0; i < size; ++i) output[i] = input[i] ^ key;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
int gea_vp8_entropy_check_s3(struct gea_vp8_entropy_result *result) {
|
|
35
|
+
memset(result, 0, sizeof(*result));
|
|
36
|
+
// Normalization is defined only for positive ranges. Every range reachable
|
|
37
|
+
// from either arithmetic branch is covered, including probability 0/255.
|
|
38
|
+
for (unsigned range = 1; range <= 255; ++range)
|
|
39
|
+
if (vp8_norm[range] != __builtin_clz(range) - 24) return 0;
|
|
40
|
+
uint32_t random = 0xa154f63du;
|
|
41
|
+
unsigned char data[128], probabilities[256], key = 0x53;
|
|
42
|
+
for (unsigned test = 0; test < 4096; ++test) {
|
|
43
|
+
for (unsigned i = 0; i < sizeof(probabilities); ++i) {
|
|
44
|
+
random ^= random << 13; random ^= random >> 17; random ^= random << 5;
|
|
45
|
+
probabilities[i] = (unsigned char)random;
|
|
46
|
+
if (i < sizeof(data)) data[i] = (unsigned char)(random >> 8);
|
|
47
|
+
}
|
|
48
|
+
// Includes zero-length, truncated and encrypted inputs. Compare the
|
|
49
|
+
// entire arithmetic state after every bit, not only the decoded output.
|
|
50
|
+
BOOL_DECODER scalar, native;
|
|
51
|
+
vpx_decrypt_cb callback = test & 1 ? decrypt : NULL;
|
|
52
|
+
const unsigned length = test % (sizeof(data) + 1);
|
|
53
|
+
vp8dx_start_decode(&scalar, data, length, callback, &key);
|
|
54
|
+
native = scalar;
|
|
55
|
+
for (unsigned i = 0; i < sizeof(probabilities); ++i) {
|
|
56
|
+
const int expected = reference_bit(&scalar, probabilities[i]);
|
|
57
|
+
const int actual = vp8dx_decode_bool(&native, probabilities[i]);
|
|
58
|
+
if (actual != expected || native.value != scalar.value ||
|
|
59
|
+
native.range != scalar.range || native.count != scalar.count ||
|
|
60
|
+
native.user_buffer != scalar.user_buffer ||
|
|
61
|
+
vp8dx_bool_error(&native) != vp8dx_bool_error(&scalar)) return 0;
|
|
62
|
+
}
|
|
63
|
+
++result->cases;
|
|
64
|
+
// Time batches, excluding comparison and per-bit timer overhead.
|
|
65
|
+
vp8dx_start_decode(&scalar, data, sizeof(data), NULL, NULL);
|
|
66
|
+
native = scalar;
|
|
67
|
+
int64_t started = esp_timer_get_time();
|
|
68
|
+
for (unsigned i = 0; i < sizeof(probabilities); ++i) reference_bit(&scalar, probabilities[i]);
|
|
69
|
+
result->scalar_us += esp_timer_get_time() - started;
|
|
70
|
+
started = esp_timer_get_time();
|
|
71
|
+
for (unsigned i = 0; i < sizeof(probabilities); ++i) vp8dx_decode_bool(&native, probabilities[i]);
|
|
72
|
+
result->native_us += esp_timer_get_time() - started;
|
|
73
|
+
if (native.value != scalar.value || native.count != scalar.count || native.range != scalar.range) return 0;
|
|
74
|
+
}
|
|
75
|
+
return 1;
|
|
76
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Eight parallel VP8 subpixel convolutions (bilinear or six-tap).
|
|
3
|
+
// Source has libvpx's padded border; destination is at least 4-byte aligned.
|
|
4
|
+
.section .rodata.gea_vp8_filter_constants,"a",@progbits
|
|
5
|
+
.balign 4
|
|
6
|
+
.Lfilter_constants:
|
|
7
|
+
.short 64, 255
|
|
8
|
+
.text
|
|
9
|
+
.align 4
|
|
10
|
+
.global gea_vp8_filter_rows_s3
|
|
11
|
+
.type gea_vp8_filter_rows_s3,@function
|
|
12
|
+
gea_vp8_filter_rows_s3:
|
|
13
|
+
// src, source row stride, coefficients, dst, destination row stride,
|
|
14
|
+
// packed: height<<8 | vertical<<4 | eight_lanes<<3 | taps.
|
|
15
|
+
// Constants stay in PIE registers across every row of this block.
|
|
16
|
+
entry a1, 32
|
|
17
|
+
movi a8, .Lfilter_constants
|
|
18
|
+
ee.vldbc.16.ip q6, a8, 2
|
|
19
|
+
ee.vldbc.16 q5, a8
|
|
20
|
+
srli a9, a7, 8
|
|
21
|
+
movi a14, 1
|
|
22
|
+
bbci a7, 4, .Lfilter_row
|
|
23
|
+
mov a14, a3
|
|
24
|
+
.Lfilter_row:
|
|
25
|
+
mov a11, a2
|
|
26
|
+
mov a12, a4
|
|
27
|
+
extui a10, a7, 0, 3
|
|
28
|
+
ee.mov.s16.qacc q6
|
|
29
|
+
loopnez a10, .Lfilter_tap_end
|
|
30
|
+
.Lfilter_tap:
|
|
31
|
+
mov a8, a11
|
|
32
|
+
ee.ld.128.usar.ip q1, a8, 16
|
|
33
|
+
ee.ld.128.usar.ip q2, a8, 16
|
|
34
|
+
ee.src.q.qup q0, q1, q2
|
|
35
|
+
ee.zero.q q3
|
|
36
|
+
ee.vzip.8 q0, q3
|
|
37
|
+
ee.vldbc.16.ip q7, a12, 2
|
|
38
|
+
ee.vmulas.s16.qacc q0, q7
|
|
39
|
+
add a11, a11, a14
|
|
40
|
+
.Lfilter_tap_end:
|
|
41
|
+
movi a8, 7
|
|
42
|
+
ee.srcmb.s16.qacc q0, a8, 0
|
|
43
|
+
ee.zero.q q4
|
|
44
|
+
ee.vmax.s16 q0, q0, q4
|
|
45
|
+
ee.vmin.s16 q0, q0, q5
|
|
46
|
+
ee.vunzip.8 q0, q4
|
|
47
|
+
ee.movi.32.a q0, a8, 0
|
|
48
|
+
s32i a8, a5, 0
|
|
49
|
+
bbci a7, 3, .Lfilter_next_row
|
|
50
|
+
ee.movi.32.a q0, a8, 1
|
|
51
|
+
s32i a8, a5, 4
|
|
52
|
+
.Lfilter_next_row:
|
|
53
|
+
add a2, a2, a3
|
|
54
|
+
add a5, a5, a6
|
|
55
|
+
addi a9, a9, -1
|
|
56
|
+
bnez a9, .Lfilter_row
|
|
57
|
+
retw
|
|
58
|
+
.size gea_vp8_filter_rows_s3, .-gea_vp8_filter_rows_s3
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Bit-exact VP8 4x4 inverse DCT. Four transforms run in parallel in 32-bit
|
|
3
|
+
// lanes: no intermediate saturating 16-bit additions, even for extreme inputs.
|
|
4
|
+
.section .rodata.gea_vp8_idct_constants,"a",@progbits
|
|
5
|
+
.balign 4
|
|
6
|
+
.Lidct_constants:
|
|
7
|
+
.short 20091, -30068
|
|
8
|
+
.long 4, 255
|
|
9
|
+
|
|
10
|
+
.macro sx16 reg
|
|
11
|
+
ee.vsl.32 \reg, \reg
|
|
12
|
+
ee.vsr.32 \reg, \reg
|
|
13
|
+
.endm
|
|
14
|
+
|
|
15
|
+
.macro transpose4
|
|
16
|
+
ee.vzip.32 q0, q2
|
|
17
|
+
ee.vzip.32 q1, q3
|
|
18
|
+
ee.vzip.32 q0, q1
|
|
19
|
+
ee.vzip.32 q2, q3
|
|
20
|
+
.endm
|
|
21
|
+
|
|
22
|
+
.macro idct_pass
|
|
23
|
+
// SAR=16. sin coefficient 35468 = 65536-30068, exactly, including
|
|
24
|
+
// negative rounding: (x*35468)>>16 == x + ((x*-30068)>>16).
|
|
25
|
+
ee.vadds.s32 q5, q0, q2
|
|
26
|
+
ee.vsubs.s32 q0, q0, q2
|
|
27
|
+
ee.vldbc.16 q4, a11
|
|
28
|
+
ee.vmul.s16 q6, q1, q4
|
|
29
|
+
sx16 q6
|
|
30
|
+
ee.vadds.s32 q6, q6, q1
|
|
31
|
+
ee.vldbc.16 q4, a7
|
|
32
|
+
ee.vmul.s16 q7, q3, q4
|
|
33
|
+
sx16 q7
|
|
34
|
+
ee.vadds.s32 q7, q7, q3
|
|
35
|
+
ee.vsubs.s32 q6, q6, q7
|
|
36
|
+
ee.vmul.s16 q7, q1, q4
|
|
37
|
+
sx16 q7
|
|
38
|
+
ee.vadds.s32 q1, q1, q7
|
|
39
|
+
ee.vldbc.16 q4, a11
|
|
40
|
+
ee.vmul.s16 q7, q3, q4
|
|
41
|
+
sx16 q7
|
|
42
|
+
ee.vadds.s32 q3, q3, q7
|
|
43
|
+
ee.vadds.s32 q1, q1, q3
|
|
44
|
+
ee.vsubs.s32 q2, q0, q6
|
|
45
|
+
ee.vadds.s32 q0, q0, q6
|
|
46
|
+
ee.vsubs.s32 q3, q5, q1
|
|
47
|
+
ee.vadds.s32 q1, q5, q1
|
|
48
|
+
ee.orq q4, q0, q0
|
|
49
|
+
ee.orq q0, q1, q1
|
|
50
|
+
ee.orq q1, q4, q4
|
|
51
|
+
.endm
|
|
52
|
+
|
|
53
|
+
.macro load_row reg
|
|
54
|
+
ee.vld.l.64.ip \reg, a2, 8
|
|
55
|
+
ee.zero.q q4
|
|
56
|
+
ee.vzip.16 \reg, q4
|
|
57
|
+
sx16 \reg
|
|
58
|
+
.endm
|
|
59
|
+
|
|
60
|
+
.macro output_row reg
|
|
61
|
+
// Scalar loads/stores only transfer a packed 4-pixel word. Prediction,
|
|
62
|
+
// saturation and packing are vector operations.
|
|
63
|
+
l32i a12, a3, 0
|
|
64
|
+
ee.movi.32.q q4, a12, 0
|
|
65
|
+
ee.zero.q q5
|
|
66
|
+
ee.vzip.8 q4, q5
|
|
67
|
+
ee.zero.q q5
|
|
68
|
+
ee.vzip.16 q4, q5
|
|
69
|
+
// ZIP overwrites both operands; its upper-half result is not a zero vector.
|
|
70
|
+
ee.zero.q q5
|
|
71
|
+
ee.vadds.s32 \reg, \reg, q4
|
|
72
|
+
ee.vmax.s32 \reg, \reg, q5
|
|
73
|
+
ee.vmin.s32 \reg, \reg, q6
|
|
74
|
+
ee.vunzip.16 \reg, q5
|
|
75
|
+
ee.zero.q q5
|
|
76
|
+
ee.vunzip.8 \reg, q5
|
|
77
|
+
ee.movi.32.a \reg, a12, 0
|
|
78
|
+
s32i a12, a5, 0
|
|
79
|
+
add a3, a3, a4
|
|
80
|
+
add a5, a5, a6
|
|
81
|
+
.endm
|
|
82
|
+
|
|
83
|
+
.text
|
|
84
|
+
.align 4
|
|
85
|
+
.global vp8_short_idct4x4llm_s3
|
|
86
|
+
.type vp8_short_idct4x4llm_s3,@function
|
|
87
|
+
vp8_short_idct4x4llm_s3:
|
|
88
|
+
// input 8-byte aligned; prediction/destination 4-byte aligned and strides.
|
|
89
|
+
entry a1, 32
|
|
90
|
+
movi a7, .Lidct_constants
|
|
91
|
+
addi a11, a7, 2
|
|
92
|
+
movi a8, 16
|
|
93
|
+
wsr.sar a8
|
|
94
|
+
load_row q0
|
|
95
|
+
load_row q1
|
|
96
|
+
load_row q2
|
|
97
|
+
load_row q3
|
|
98
|
+
.Lidct_loaded:
|
|
99
|
+
idct_pass
|
|
100
|
+
// Upstream stores the first pass into short[16]: wrap, do not saturate.
|
|
101
|
+
sx16 q0
|
|
102
|
+
sx16 q1
|
|
103
|
+
sx16 q2
|
|
104
|
+
sx16 q3
|
|
105
|
+
transpose4
|
|
106
|
+
idct_pass
|
|
107
|
+
addi a7, a7, 4
|
|
108
|
+
ee.vldbc.32.ip q4, a7, 4
|
|
109
|
+
ee.vadds.s32 q0, q0, q4
|
|
110
|
+
ee.vadds.s32 q1, q1, q4
|
|
111
|
+
ee.vadds.s32 q2, q2, q4
|
|
112
|
+
ee.vadds.s32 q3, q3, q4
|
|
113
|
+
movi a9, 3
|
|
114
|
+
wsr.sar a9
|
|
115
|
+
ee.vsr.32 q0, q0
|
|
116
|
+
ee.vsr.32 q1, q1
|
|
117
|
+
ee.vsr.32 q2, q2
|
|
118
|
+
ee.vsr.32 q3, q3
|
|
119
|
+
wsr.sar a8
|
|
120
|
+
sx16 q0
|
|
121
|
+
sx16 q1
|
|
122
|
+
sx16 q2
|
|
123
|
+
sx16 q3
|
|
124
|
+
transpose4
|
|
125
|
+
ee.vldbc.32 q6, a7
|
|
126
|
+
output_row q0
|
|
127
|
+
output_row q1
|
|
128
|
+
output_row q2
|
|
129
|
+
output_row q3
|
|
130
|
+
retw
|
|
131
|
+
.size vp8_short_idct4x4llm_s3, .-vp8_short_idct4x4llm_s3
|
|
132
|
+
|
|
133
|
+
.align 4
|
|
134
|
+
.global vp8_dequant_idct_add_s3
|
|
135
|
+
.type vp8_dequant_idct_add_s3,@function
|
|
136
|
+
vp8_dequant_idct_add_s3:
|
|
137
|
+
// input, quantizers, pixels, stride. Keep dequantized coefficients in
|
|
138
|
+
// PIE registers: no write/reload of an intermediate PSRAM block.
|
|
139
|
+
entry a1, 32
|
|
140
|
+
mov a10, a2
|
|
141
|
+
mov a13, a4
|
|
142
|
+
mov a14, a5
|
|
143
|
+
movi a8, 0
|
|
144
|
+
wsr.sar a8
|
|
145
|
+
ee.vld.128.ip q0, a2, 16
|
|
146
|
+
ee.vld.128.ip q1, a2, 16
|
|
147
|
+
ee.vld.128.ip q4, a3, 16
|
|
148
|
+
ee.vld.128.ip q5, a3, 16
|
|
149
|
+
ee.vmul.s16 q0, q0, q4
|
|
150
|
+
ee.vmul.s16 q1, q1, q5
|
|
151
|
+
ee.zero.q q2
|
|
152
|
+
ee.zero.q q3
|
|
153
|
+
ee.vzip.16 q0, q2
|
|
154
|
+
ee.vzip.16 q1, q3
|
|
155
|
+
ee.orq q4, q1, q1
|
|
156
|
+
ee.orq q1, q2, q2
|
|
157
|
+
ee.orq q2, q4, q4
|
|
158
|
+
movi a8, 16
|
|
159
|
+
wsr.sar a8
|
|
160
|
+
sx16 q0
|
|
161
|
+
sx16 q1
|
|
162
|
+
sx16 q2
|
|
163
|
+
sx16 q3
|
|
164
|
+
// Match upstream's coefficient clearing, with exactly two native stores.
|
|
165
|
+
ee.zero.q q5
|
|
166
|
+
ee.vst.128.ip q5, a10, 16
|
|
167
|
+
ee.vst.128.ip q5, a10, 16
|
|
168
|
+
mov a3, a13
|
|
169
|
+
mov a4, a14
|
|
170
|
+
mov a5, a13
|
|
171
|
+
mov a6, a14
|
|
172
|
+
movi a7, .Lidct_constants
|
|
173
|
+
addi a11, a7, 2
|
|
174
|
+
j .Lidct_loaded
|
|
175
|
+
.size vp8_dequant_idct_add_s3, .-vp8_dequant_idct_add_s3
|
|
176
|
+
|
|
177
|
+
.align 4
|
|
178
|
+
.global vp8_dc_only_idct_add_s3
|
|
179
|
+
.type vp8_dc_only_idct_add_s3,@function
|
|
180
|
+
vp8_dc_only_idct_add_s3:
|
|
181
|
+
entry a1, 32
|
|
182
|
+
// DC-only residual is bounded to [-4096,4096] after rounding, so eight
|
|
183
|
+
// signed 16-bit lanes suffice even with the 255-valued prediction. Full
|
|
184
|
+
// transforms still use 32-bit lanes to preserve their extreme-input ABI.
|
|
185
|
+
addi a2, a2, 4
|
|
186
|
+
srai a2, a2, 3
|
|
187
|
+
s16i a2, a1, 0
|
|
188
|
+
ee.vldbc.16 q0, a1
|
|
189
|
+
movi a7, .Lidct_constants+8
|
|
190
|
+
ee.vldbc.16 q6, a7
|
|
191
|
+
ee.zero.q q7
|
|
192
|
+
movi a9, 4
|
|
193
|
+
.Ldc_row:
|
|
194
|
+
l32i a8, a3, 0
|
|
195
|
+
ee.movi.32.q q1, a8, 0
|
|
196
|
+
ee.zero.q q2
|
|
197
|
+
ee.vzip.8 q1, q2
|
|
198
|
+
ee.vadds.s16 q1, q1, q0
|
|
199
|
+
ee.vmax.s16 q1, q1, q7
|
|
200
|
+
ee.vmin.s16 q1, q1, q6
|
|
201
|
+
ee.zero.q q2
|
|
202
|
+
ee.vunzip.8 q1, q2
|
|
203
|
+
ee.movi.32.a q1, a8, 0
|
|
204
|
+
s32i a8, a5, 0
|
|
205
|
+
add a3, a3, a4
|
|
206
|
+
add a5, a5, a6
|
|
207
|
+
addi a9, a9, -1
|
|
208
|
+
bnez a9, .Ldc_row
|
|
209
|
+
retw
|
|
210
|
+
.size vp8_dc_only_idct_add_s3, .-vp8_dc_only_idct_add_s3
|
|
211
|
+
|
|
212
|
+
.macro walsh_pass
|
|
213
|
+
ee.vadds.s32 q4, q0, q3
|
|
214
|
+
ee.vadds.s32 q5, q1, q2
|
|
215
|
+
ee.vsubs.s32 q6, q1, q2
|
|
216
|
+
ee.vsubs.s32 q7, q0, q3
|
|
217
|
+
ee.vadds.s32 q0, q4, q5
|
|
218
|
+
ee.vadds.s32 q1, q6, q7
|
|
219
|
+
ee.vsubs.s32 q2, q4, q5
|
|
220
|
+
ee.vsubs.s32 q3, q7, q6
|
|
221
|
+
.endm
|
|
222
|
+
.macro scatter_dc reg
|
|
223
|
+
ee.movi.32.a \reg, a4, 0
|
|
224
|
+
s16i a4, a3, 0
|
|
225
|
+
ee.movi.32.a \reg, a4, 1
|
|
226
|
+
s16i a4, a3, 32
|
|
227
|
+
ee.movi.32.a \reg, a4, 2
|
|
228
|
+
s16i a4, a3, 64
|
|
229
|
+
ee.movi.32.a \reg, a4, 3
|
|
230
|
+
s16i a4, a3, 96
|
|
231
|
+
addi a3, a3, 128
|
|
232
|
+
.endm
|
|
233
|
+
.align 4
|
|
234
|
+
.global vp8_short_inv_walsh4x4_s3
|
|
235
|
+
.type vp8_short_inv_walsh4x4_s3,@function
|
|
236
|
+
vp8_short_inv_walsh4x4_s3:
|
|
237
|
+
entry a1, 32
|
|
238
|
+
movi a8, 16
|
|
239
|
+
wsr.sar a8
|
|
240
|
+
load_row q0
|
|
241
|
+
load_row q1
|
|
242
|
+
load_row q2
|
|
243
|
+
load_row q3
|
|
244
|
+
walsh_pass
|
|
245
|
+
sx16 q0
|
|
246
|
+
sx16 q1
|
|
247
|
+
sx16 q2
|
|
248
|
+
sx16 q3
|
|
249
|
+
transpose4
|
|
250
|
+
walsh_pass
|
|
251
|
+
movi a4, 3
|
|
252
|
+
s32i a4, a1, 0
|
|
253
|
+
ee.vldbc.32 q4, a1
|
|
254
|
+
ee.vadds.s32 q0, q0, q4
|
|
255
|
+
ee.vadds.s32 q1, q1, q4
|
|
256
|
+
ee.vadds.s32 q2, q2, q4
|
|
257
|
+
ee.vadds.s32 q3, q3, q4
|
|
258
|
+
wsr.sar a4
|
|
259
|
+
ee.vsr.32 q0, q0
|
|
260
|
+
ee.vsr.32 q1, q1
|
|
261
|
+
ee.vsr.32 q2, q2
|
|
262
|
+
ee.vsr.32 q3, q3
|
|
263
|
+
transpose4
|
|
264
|
+
scatter_dc q0
|
|
265
|
+
scatter_dc q1
|
|
266
|
+
scatter_dc q2
|
|
267
|
+
scatter_dc q3
|
|
268
|
+
retw
|
|
269
|
+
.size vp8_short_inv_walsh4x4_s3, .-vp8_short_inv_walsh4x4_s3
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// True-motion intra prediction: clip(left[row] + above[column] - top_left).
|
|
3
|
+
// Eight columns run in signed 16-bit PIE lanes, with exact saturation to bytes.
|
|
4
|
+
.section .rodata.gea_vp8_tm,"a",@progbits
|
|
5
|
+
.balign 4
|
|
6
|
+
.Ltm_max:
|
|
7
|
+
.short 255
|
|
8
|
+
.text
|
|
9
|
+
.align 4
|
|
10
|
+
.global gea_vp8_tm_s3
|
|
11
|
+
.type gea_vp8_tm_s3,@function
|
|
12
|
+
gea_vp8_tm_s3:
|
|
13
|
+
// dst (4-byte aligned), stride, aligned above, left, block size (4/8/16).
|
|
14
|
+
entry a1, 32
|
|
15
|
+
addi a9, a4, -1
|
|
16
|
+
l8ui a8, a9, 0
|
|
17
|
+
ee.zero.q q5
|
|
18
|
+
movi a9, .Ltm_max
|
|
19
|
+
ee.vldbc.16 q6, a9
|
|
20
|
+
beqi a6, 4, .Ltm_four
|
|
21
|
+
ee.vld.l.64.ip q0, a4, 8
|
|
22
|
+
ee.vzip.8 q0, q5
|
|
23
|
+
beqi a6, 8, .Ltm_ready
|
|
24
|
+
ee.zero.q q5
|
|
25
|
+
ee.vld.l.64.ip q1, a4, 8
|
|
26
|
+
ee.vzip.8 q1, q5
|
|
27
|
+
j .Ltm_ready
|
|
28
|
+
.Ltm_four:
|
|
29
|
+
l32i a9, a4, 0
|
|
30
|
+
ee.movi.32.q q0, a9, 0
|
|
31
|
+
ee.vzip.8 q0, q5
|
|
32
|
+
.Ltm_ready:
|
|
33
|
+
mov a10, a6
|
|
34
|
+
.Ltm_row:
|
|
35
|
+
l8ui a9, a5, 0
|
|
36
|
+
addi a5, a5, 1
|
|
37
|
+
sub a9, a9, a8
|
|
38
|
+
s16i a9, a1, 0
|
|
39
|
+
ee.vldbc.16 q2, a1
|
|
40
|
+
ee.zero.q q5
|
|
41
|
+
ee.vadds.s16 q3, q0, q2
|
|
42
|
+
ee.vmax.s16 q3, q3, q5
|
|
43
|
+
ee.vmin.s16 q3, q3, q6
|
|
44
|
+
ee.vunzip.8 q3, q5
|
|
45
|
+
ee.movi.32.a q3, a9, 0
|
|
46
|
+
s32i a9, a2, 0
|
|
47
|
+
beqi a6, 4, .Ltm_next
|
|
48
|
+
ee.movi.32.a q3, a9, 1
|
|
49
|
+
s32i a9, a2, 4
|
|
50
|
+
beqi a6, 8, .Ltm_next
|
|
51
|
+
ee.zero.q q5
|
|
52
|
+
ee.vadds.s16 q3, q1, q2
|
|
53
|
+
ee.vmax.s16 q3, q3, q5
|
|
54
|
+
ee.vmin.s16 q3, q3, q6
|
|
55
|
+
ee.vunzip.8 q3, q5
|
|
56
|
+
ee.movi.32.a q3, a9, 0
|
|
57
|
+
s32i a9, a2, 8
|
|
58
|
+
ee.movi.32.a q3, a9, 1
|
|
59
|
+
s32i a9, a2, 12
|
|
60
|
+
.Ltm_next:
|
|
61
|
+
add a2, a2, a3
|
|
62
|
+
addi a10, a10, -1
|
|
63
|
+
bnez a10, .Ltm_row
|
|
64
|
+
retw
|
|
65
|
+
.size gea_vp8_tm_s3, .-gea_vp8_tm_s3
|