@geastack/targets 0.1.86 → 0.1.88
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 +213 -0
- package/targets/esp32/chip_bindings/audio/echo_cancellation.h +12 -0
- package/targets/esp32/chip_bindings/audio/es8311.cpp +280 -41
- 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 +26 -13
- package/targets/esp32/crypto/srtp_hmac_psa.c +118 -0
- package/targets/esp32/display.cpp +13 -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 +141 -5
- package/targets/esp32/services/frame_scheduler.cpp +29 -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 +110 -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 +11 -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 +171 -8
- package/targets/esp32-s3-touch-amoled-2.06/main/CMakeLists.txt +9 -2
- 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 +16 -1
- package/targets/esp32-s3-touch-amoled-2.06/main/include/board.h +3 -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-touch-lcd-3.5b/dependencies.lock +12 -1
- package/targets/esp32-s3-touch-lcd-3.5b/main/CMakeLists.txt +5 -1
- package/targets/esp32-s3-touch-lcd-3.5b/main/idf_component.yml +2 -1
- package/targets/esp32-s3-touch-lcd-3.5b/main/include/board.h +3 -0
- package/targets/esp32-s3-touch-lcd-3.5b/main/platform_stubs.cpp +1 -18
- package/targets/esp32-s3-touch-lcd-3.5b/main/speaker_power.cpp +27 -0
- package/targets/esp32-s3-waveshare-touch-lcd-4b.json +504 -0
- package/targets.json +12 -1
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Decoder-only libvpx, shared by native Gea WebRTC clients. No encoder, VP9,
|
|
2
|
+
# postprocessing, worker pool, or desktop assembly is built for the S3.
|
|
3
|
+
cmake_minimum_required(VERSION 3.24)
|
|
4
|
+
|
|
5
|
+
if(COMMAND idf_component_register)
|
|
6
|
+
idf_component_register(SRCS "vpx_memory.c" REQUIRES heap)
|
|
7
|
+
if(CMAKE_SCRIPT_MODE_FILE)
|
|
8
|
+
return()
|
|
9
|
+
endif()
|
|
10
|
+
set(_gea_vpx_target ${COMPONENT_LIB})
|
|
11
|
+
else()
|
|
12
|
+
project(gea_vpx C)
|
|
13
|
+
add_library(gea_vpx STATIC)
|
|
14
|
+
set(_gea_vpx_target gea_vpx)
|
|
15
|
+
endif()
|
|
16
|
+
|
|
17
|
+
include(FetchContent)
|
|
18
|
+
FetchContent_Declare(gea_vpx_source
|
|
19
|
+
URL https://github.com/webmproject/libvpx/archive/refs/tags/v1.16.0.tar.gz
|
|
20
|
+
URL_HASH SHA256=7a479a3c66b9f5d5542a4c6a1b7d3768a983b1e5c14c60a9396edc9b649e015c
|
|
21
|
+
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
|
|
22
|
+
)
|
|
23
|
+
# Upstream is a make project; CMake owns compilation with the actual IDF flags.
|
|
24
|
+
FetchContent_MakeAvailable(gea_vpx_source)
|
|
25
|
+
find_program(GEA_VPX_MAKE NAMES gmake make REQUIRED)
|
|
26
|
+
execute_process(
|
|
27
|
+
COMMAND "${CMAKE_COMMAND}" -E env "TMPDIR=${gea_vpx_source_BINARY_DIR}"
|
|
28
|
+
sh "${gea_vpx_source_SOURCE_DIR}/configure"
|
|
29
|
+
--target=generic-gnu --enable-external-build
|
|
30
|
+
--disable-vp9 --disable-vp8-encoder --enable-vp8-decoder
|
|
31
|
+
--disable-multithread --disable-runtime-cpu-detect --disable-postproc
|
|
32
|
+
--disable-examples --disable-tools --disable-docs --disable-unit-tests
|
|
33
|
+
--disable-webm-io --disable-libyuv
|
|
34
|
+
WORKING_DIRECTORY "${gea_vpx_source_BINARY_DIR}"
|
|
35
|
+
RESULT_VARIABLE _gea_vpx_configure_result
|
|
36
|
+
OUTPUT_VARIABLE _gea_vpx_configure_output
|
|
37
|
+
ERROR_VARIABLE _gea_vpx_configure_error
|
|
38
|
+
)
|
|
39
|
+
if(NOT _gea_vpx_configure_result EQUAL 0)
|
|
40
|
+
message(FATAL_ERROR "libvpx configure failed: ${_gea_vpx_configure_output}\n${_gea_vpx_configure_error}")
|
|
41
|
+
endif()
|
|
42
|
+
execute_process(
|
|
43
|
+
COMMAND "${GEA_VPX_MAKE}" libvpx_srcs.txt vp8_rtcd.h vpx_scale_rtcd.h vpx_dsp_rtcd.h
|
|
44
|
+
WORKING_DIRECTORY "${gea_vpx_source_BINARY_DIR}"
|
|
45
|
+
RESULT_VARIABLE _gea_vpx_generate_result
|
|
46
|
+
OUTPUT_VARIABLE _gea_vpx_generate_output
|
|
47
|
+
ERROR_VARIABLE _gea_vpx_generate_error
|
|
48
|
+
)
|
|
49
|
+
if(NOT _gea_vpx_generate_result EQUAL 0)
|
|
50
|
+
message(FATAL_ERROR "libvpx source generation failed: ${_gea_vpx_generate_output}\n${_gea_vpx_generate_error}")
|
|
51
|
+
endif()
|
|
52
|
+
|
|
53
|
+
file(STRINGS "${gea_vpx_source_BINARY_DIR}/libvpx_srcs.txt" _gea_vpx_sources)
|
|
54
|
+
foreach(_gea_vpx_source IN LISTS _gea_vpx_sources)
|
|
55
|
+
if(_gea_vpx_source MATCHES "\\.c$" AND NOT _gea_vpx_source STREQUAL "vpx_mem/vpx_mem.c")
|
|
56
|
+
if(EXISTS "${gea_vpx_source_SOURCE_DIR}/${_gea_vpx_source}")
|
|
57
|
+
target_sources(${_gea_vpx_target} PRIVATE "${gea_vpx_source_SOURCE_DIR}/${_gea_vpx_source}")
|
|
58
|
+
elseif(EXISTS "${gea_vpx_source_BINARY_DIR}/${_gea_vpx_source}")
|
|
59
|
+
target_sources(${_gea_vpx_target} PRIVATE "${gea_vpx_source_BINARY_DIR}/${_gea_vpx_source}")
|
|
60
|
+
else()
|
|
61
|
+
message(FATAL_ERROR "Missing libvpx source: ${_gea_vpx_source}")
|
|
62
|
+
endif()
|
|
63
|
+
endif()
|
|
64
|
+
endforeach()
|
|
65
|
+
if(NOT COMMAND idf_component_register)
|
|
66
|
+
target_sources(${_gea_vpx_target} PRIVATE vpx_memory.c)
|
|
67
|
+
endif()
|
|
68
|
+
target_include_directories(${_gea_vpx_target} PUBLIC "${gea_vpx_source_SOURCE_DIR}"
|
|
69
|
+
PRIVATE "${gea_vpx_source_BINARY_DIR}")
|
|
70
|
+
target_compile_options(${_gea_vpx_target} PRIVATE -O2 -ffunction-sections -fdata-sections)
|
|
71
|
+
if(IDF_TARGET STREQUAL "esp32s3")
|
|
72
|
+
# Boolean arithmetic decoding is serial, not a SIMD lane operation. The
|
|
73
|
+
# generic -O2 build leaves one out-of-line call per entropy bit. Inline it
|
|
74
|
+
# explicitly and use Xtensa NSAU instead of a normalization-table load.
|
|
75
|
+
# Patches are checked against the pinned upstream spelling and idempotent.
|
|
76
|
+
set(_gea_bool_header "${gea_vpx_source_SOURCE_DIR}/vp8/decoder/dboolhuff.h")
|
|
77
|
+
file(READ "${_gea_bool_header}" _gea_bool_source)
|
|
78
|
+
set(_gea_bool_before "${_gea_bool_source}")
|
|
79
|
+
string(REPLACE "static VPX_NO_UNSIGNED_SHIFT_CHECK int vp8dx_decode_bool"
|
|
80
|
+
"static inline __attribute__((always_inline)) VPX_NO_UNSIGNED_SHIFT_CHECK int vp8dx_decode_bool"
|
|
81
|
+
_gea_bool_source "${_gea_bool_source}")
|
|
82
|
+
string(REPLACE "const unsigned char shift = vp8_norm[(unsigned char)range];"
|
|
83
|
+
"const unsigned char shift = (unsigned char)(__builtin_clz(range) - 24);"
|
|
84
|
+
_gea_bool_source "${_gea_bool_source}")
|
|
85
|
+
if(NOT _gea_bool_source MATCHES "always_inline.*VPX_NO_UNSIGNED_SHIFT_CHECK int vp8dx_decode_bool"
|
|
86
|
+
OR NOT _gea_bool_source MATCHES "__builtin_clz\\(range\\) - 24")
|
|
87
|
+
message(FATAL_ERROR "libvpx boolean decoder patch did not match pinned source")
|
|
88
|
+
endif()
|
|
89
|
+
if(NOT _gea_bool_before STREQUAL _gea_bool_source)
|
|
90
|
+
file(WRITE "${_gea_bool_header}" "${_gea_bool_source}")
|
|
91
|
+
endif()
|
|
92
|
+
set(_gea_tokens_source "${gea_vpx_source_SOURCE_DIR}/vp8/decoder/detokenize.c")
|
|
93
|
+
file(READ "${_gea_tokens_source}" _gea_tokens)
|
|
94
|
+
set(_gea_tokens_before "${_gea_tokens}")
|
|
95
|
+
string(REPLACE "BOOL_DECODER local_bc = *x->current_bc;"
|
|
96
|
+
"BOOL_DECODER *state_bc = x->current_bc;\n BOOL_DECODER local_bc = *state_bc;"
|
|
97
|
+
_gea_tokens "${_gea_tokens}")
|
|
98
|
+
string(REPLACE "BOOL_DECODER *bc = x->current_bc;"
|
|
99
|
+
"BOOL_DECODER *state_bc = x->current_bc;\n BOOL_DECODER local_bc = *state_bc;\n BOOL_DECODER *bc = &local_bc;"
|
|
100
|
+
_gea_tokens "${_gea_tokens}")
|
|
101
|
+
string(REPLACE "*x->current_bc = local_bc;" "*state_bc = local_bc;"
|
|
102
|
+
_gea_tokens "${_gea_tokens}")
|
|
103
|
+
if(NOT _gea_tokens MATCHES "\\*state_bc = local_bc;")
|
|
104
|
+
string(REPLACE " return eobtotal;"
|
|
105
|
+
" *state_bc = local_bc;\n return eobtotal;"
|
|
106
|
+
_gea_tokens "${_gea_tokens}")
|
|
107
|
+
endif()
|
|
108
|
+
if(NOT _gea_tokens MATCHES "BOOL_DECODER local_bc = \\*state_bc;"
|
|
109
|
+
OR NOT _gea_tokens MATCHES "\\*state_bc = local_bc;")
|
|
110
|
+
message(FATAL_ERROR "libvpx token decoder state patch did not match pinned source")
|
|
111
|
+
endif()
|
|
112
|
+
# Bounded stage clocks run only when a native diagnostic explicitly binds
|
|
113
|
+
# counters. No profiling task, interrupt, frame copy or codec setting change.
|
|
114
|
+
if(NOT _gea_tokens MATCHES "gea_vp8_profile_clock_s3")
|
|
115
|
+
string(REPLACE "#include \"detokenize.h\""
|
|
116
|
+
"#include \"detokenize.h\"\n#include \"vp8_profile_s3.h\"" _gea_tokens "${_gea_tokens}")
|
|
117
|
+
string(REPLACE "int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x) {"
|
|
118
|
+
"int vp8_decode_mb_tokens(VP8D_COMP *dx, MACROBLOCKD *x) {\n const uint64_t gea_tokens_started = gea_vp8_profile_clock_s3();"
|
|
119
|
+
_gea_tokens "${_gea_tokens}")
|
|
120
|
+
string(REPLACE " return eobtotal;"
|
|
121
|
+
" gea_vp8_profile_add_s3(GEA_VP8_PROFILE_TOKENS, gea_tokens_started);\n return eobtotal;"
|
|
122
|
+
_gea_tokens "${_gea_tokens}")
|
|
123
|
+
endif()
|
|
124
|
+
if(NOT _gea_tokens MATCHES "gea_tokens_started = gea_vp8_profile_clock_s3"
|
|
125
|
+
OR NOT _gea_tokens MATCHES "GEA_VP8_PROFILE_TOKENS, gea_tokens_started")
|
|
126
|
+
message(FATAL_ERROR "libvpx token profile patch did not match pinned source")
|
|
127
|
+
endif()
|
|
128
|
+
if(NOT _gea_tokens_before STREQUAL _gea_tokens)
|
|
129
|
+
file(WRITE "${_gea_tokens_source}" "${_gea_tokens}")
|
|
130
|
+
endif()
|
|
131
|
+
set(_gea_frame_source "${gea_vpx_source_SOURCE_DIR}/vp8/decoder/decodeframe.c")
|
|
132
|
+
file(READ "${_gea_frame_source}" _gea_frame)
|
|
133
|
+
set(_gea_frame_before "${_gea_frame}")
|
|
134
|
+
if(NOT _gea_frame MATCHES "gea_vp8_profile_clock_s3")
|
|
135
|
+
string(REPLACE "#include \"vpx_config.h\""
|
|
136
|
+
"#include \"vpx_config.h\"\n#include \"vp8_profile_s3.h\"" _gea_frame "${_gea_frame}")
|
|
137
|
+
string(REPLACE " decode_macroblock(pbi, xd, mb_idx);"
|
|
138
|
+
" {\n const uint64_t gea_mb_started = gea_vp8_profile_clock_s3();\n decode_macroblock(pbi, xd, mb_idx);\n gea_vp8_profile_add_s3(GEA_VP8_PROFILE_MACROBLOCK, gea_mb_started);\n }"
|
|
139
|
+
_gea_frame "${_gea_frame}")
|
|
140
|
+
string(REGEX MATCHALL "vp8_loop_filter_row_(normal|simple)\\([^;]+\\)" _gea_filter_calls "${_gea_frame}")
|
|
141
|
+
list(LENGTH _gea_filter_calls _gea_filter_call_count)
|
|
142
|
+
if(NOT _gea_filter_call_count EQUAL 4)
|
|
143
|
+
message(FATAL_ERROR "libvpx filter profile expected four pinned call sites")
|
|
144
|
+
endif()
|
|
145
|
+
string(REGEX REPLACE "(vp8_loop_filter_row_(normal|simple)\\([^;]+\\);)"
|
|
146
|
+
"{ const uint64_t gea_filter_started = gea_vp8_profile_clock_s3();\n\\1\ngea_vp8_profile_add_s3(GEA_VP8_PROFILE_LOOPFILTER, gea_filter_started); }"
|
|
147
|
+
_gea_frame "${_gea_frame}")
|
|
148
|
+
endif()
|
|
149
|
+
if(NOT _gea_frame MATCHES "GEA_VP8_PROFILE_MACROBLOCK, gea_mb_started"
|
|
150
|
+
OR NOT _gea_frame MATCHES "GEA_VP8_PROFILE_LOOPFILTER, gea_filter_started")
|
|
151
|
+
message(FATAL_ERROR "libvpx frame profile patch did not match pinned source")
|
|
152
|
+
endif()
|
|
153
|
+
if(NOT _gea_frame_before STREQUAL _gea_frame)
|
|
154
|
+
file(WRITE "${_gea_frame_source}" "${_gea_frame}")
|
|
155
|
+
endif()
|
|
156
|
+
target_sources(${_gea_vpx_target} PRIVATE i420_rgb565_s3.S vp8_filter_s3.S vp8_idct_s3.S
|
|
157
|
+
vp8_loopfilter_s3.S vp8_loopfilter_s3.c vp8_s3.c vp8_intrapred_s3.S vp8_entropy_s3.c
|
|
158
|
+
vp8_workspace_s3.c vp8_profile_s3.c vp8_copy_s3.S vp8_blocks_s3.c)
|
|
159
|
+
target_compile_definitions(${_gea_vpx_target} PUBLIC GEA_VIDEO_SIMD_ESP32S3=1)
|
|
160
|
+
target_include_directories(${_gea_vpx_target} PUBLIC "${CMAKE_CURRENT_LIST_DIR}")
|
|
161
|
+
# Keep upstream scalar symbols for on-device differential tests. Select our
|
|
162
|
+
# kernels at libvpx's normal dispatch boundary, not by patching call sites.
|
|
163
|
+
set(_gea_vp8_rtcd "${gea_vpx_source_BINARY_DIR}/vp8_rtcd.h")
|
|
164
|
+
file(READ "${_gea_vp8_rtcd}" _gea_vp8_dispatch)
|
|
165
|
+
set(_gea_vp8_dispatch_before "${_gea_vp8_dispatch}")
|
|
166
|
+
foreach(_size 16x16 8x8 8x4)
|
|
167
|
+
set(_name "vp8_copy_mem${_size}")
|
|
168
|
+
string(REPLACE "#define ${_name} ${_name}_c" "#define ${_name} ${_name}_s3"
|
|
169
|
+
_gea_vp8_dispatch "${_gea_vp8_dispatch}")
|
|
170
|
+
if(NOT _gea_vp8_dispatch MATCHES "#define ${_name} ${_name}_s3")
|
|
171
|
+
message(FATAL_ERROR "libvpx copy dispatch missing: ${_name}")
|
|
172
|
+
endif()
|
|
173
|
+
endforeach()
|
|
174
|
+
foreach(_kind sixtap bilinear)
|
|
175
|
+
foreach(_size 4x4 8x4 8x8 16x16)
|
|
176
|
+
set(_name "vp8_${_kind}_predict${_size}")
|
|
177
|
+
string(REPLACE "#define ${_name} ${_name}_c" "#define ${_name} ${_name}_s3"
|
|
178
|
+
_gea_vp8_dispatch "${_gea_vp8_dispatch}")
|
|
179
|
+
if(NOT _gea_vp8_dispatch MATCHES "#define ${_name} ${_name}_s3")
|
|
180
|
+
message(FATAL_ERROR "libvpx dispatch entry missing: ${_name}")
|
|
181
|
+
endif()
|
|
182
|
+
endforeach()
|
|
183
|
+
endforeach()
|
|
184
|
+
foreach(_edge bh bv mbh mbv)
|
|
185
|
+
set(_name "vp8_loop_filter_${_edge}")
|
|
186
|
+
string(REPLACE "#define ${_name} ${_name}_c" "#define ${_name} ${_name}_s3"
|
|
187
|
+
_gea_vp8_dispatch "${_gea_vp8_dispatch}")
|
|
188
|
+
if(NOT _gea_vp8_dispatch MATCHES "#define ${_name} ${_name}_s3")
|
|
189
|
+
message(FATAL_ERROR "libvpx dispatch entry missing: ${_name}")
|
|
190
|
+
endif()
|
|
191
|
+
endforeach()
|
|
192
|
+
set(_simple_c_names bhs bvs simple_horizontal_edge simple_vertical_edge)
|
|
193
|
+
set(_simple_s3_names bh bv mbh mbv)
|
|
194
|
+
foreach(_index RANGE 0 3)
|
|
195
|
+
list(GET _simple_c_names ${_index} _c_name)
|
|
196
|
+
list(GET _simple_s3_names ${_index} _s3_name)
|
|
197
|
+
string(REPLACE "#define vp8_loop_filter_simple_${_s3_name} vp8_loop_filter_${_c_name}_c"
|
|
198
|
+
"#define vp8_loop_filter_simple_${_s3_name} vp8_loop_filter_simple_${_s3_name}_s3"
|
|
199
|
+
_gea_vp8_dispatch "${_gea_vp8_dispatch}")
|
|
200
|
+
if(NOT _gea_vp8_dispatch MATCHES "#define vp8_loop_filter_simple_${_s3_name} vp8_loop_filter_simple_${_s3_name}_s3")
|
|
201
|
+
message(FATAL_ERROR "libvpx simple filter dispatch entry missing: ${_s3_name}")
|
|
202
|
+
endif()
|
|
203
|
+
endforeach()
|
|
204
|
+
foreach(_name vp8_short_idct4x4llm vp8_dequant_idct_add vp8_dc_only_idct_add vp8_short_inv_walsh4x4
|
|
205
|
+
vp8_dequant_idct_add_y_block vp8_dequant_idct_add_uv_block)
|
|
206
|
+
string(REPLACE "#define ${_name} ${_name}_c" "#define ${_name} ${_name}_s3"
|
|
207
|
+
_gea_vp8_dispatch "${_gea_vp8_dispatch}")
|
|
208
|
+
if(NOT _gea_vp8_dispatch MATCHES "#define ${_name} ${_name}_s3")
|
|
209
|
+
message(FATAL_ERROR "libvpx transform dispatch entry missing: ${_name}")
|
|
210
|
+
endif()
|
|
211
|
+
endforeach()
|
|
212
|
+
if(NOT _gea_vp8_dispatch MATCHES "#include \"vp8_s3.h\"")
|
|
213
|
+
string(APPEND _gea_vp8_dispatch "\n#include \"vp8_s3.h\"\n")
|
|
214
|
+
endif()
|
|
215
|
+
if(NOT _gea_vp8_dispatch STREQUAL _gea_vp8_dispatch_before)
|
|
216
|
+
file(WRITE "${_gea_vp8_rtcd}" "${_gea_vp8_dispatch}")
|
|
217
|
+
endif()
|
|
218
|
+
set(_gea_dsp_rtcd "${gea_vpx_source_BINARY_DIR}/vpx_dsp_rtcd.h")
|
|
219
|
+
file(READ "${_gea_dsp_rtcd}" _gea_dsp_dispatch)
|
|
220
|
+
set(_gea_dsp_before "${_gea_dsp_dispatch}")
|
|
221
|
+
foreach(_size 4 8 16)
|
|
222
|
+
set(_name "vpx_tm_predictor_${_size}x${_size}")
|
|
223
|
+
string(REPLACE "#define ${_name} ${_name}_c" "#define ${_name} ${_name}_s3"
|
|
224
|
+
_gea_dsp_dispatch "${_gea_dsp_dispatch}")
|
|
225
|
+
if(NOT _gea_dsp_dispatch MATCHES "#define ${_name} ${_name}_s3")
|
|
226
|
+
message(FATAL_ERROR "libvpx intra predictor dispatch missing: ${_name}")
|
|
227
|
+
endif()
|
|
228
|
+
endforeach()
|
|
229
|
+
if(NOT _gea_dsp_dispatch MATCHES "#include \"vp8_s3.h\"")
|
|
230
|
+
string(APPEND _gea_dsp_dispatch "\n#include \"vp8_s3.h\"\n")
|
|
231
|
+
endif()
|
|
232
|
+
if(NOT _gea_dsp_dispatch STREQUAL _gea_dsp_before)
|
|
233
|
+
file(WRITE "${_gea_dsp_rtcd}" "${_gea_dsp_dispatch}")
|
|
234
|
+
endif()
|
|
235
|
+
endif()
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# ESP32-S3 VP8 kernels
|
|
2
|
+
|
|
3
|
+
This component builds pinned upstream libvpx 1.16.0 with VP8 decoding only.
|
|
4
|
+
On ESP32-S3 it selects Gea's native PIE assembly at libvpx's generated dispatch
|
|
5
|
+
boundary. It does not require an application setting or fork the bitstream parser.
|
|
6
|
+
Other CPUs retain upstream C implementations.
|
|
7
|
+
|
|
8
|
+
Native kernels:
|
|
9
|
+
|
|
10
|
+
- I420 to RGB565: eight pixels, exact limited-range BT.601 coefficients,
|
|
11
|
+
40-bit accumulators, clipping and packing; no intermediate RGB888 image.
|
|
12
|
+
- Bilinear and six-tap prediction: eight pixels, separate rounding/clipping
|
|
13
|
+
for horizontal and vertical passes, including 4-pixel blocks. Integer-pixel
|
|
14
|
+
axes skip their identity pass and intermediate buffer entirely.
|
|
15
|
+
Odd six-tap phases omit the two zero outer coefficients, reducing both SIMD
|
|
16
|
+
loads/multiplies and the vertical intermediate extent without changing pixels.
|
|
17
|
+
The assembly call covers a complete column group across all block rows,
|
|
18
|
+
retaining constants in PIE registers and using a hardware tap loop.
|
|
19
|
+
- Integer-motion block copies: complete 16×16, 8×8, 8×4 and 4×4 blocks with
|
|
20
|
+
arbitrary padded source alignment and exact destination stores. Odd destination
|
|
21
|
+
alignment retains the scalar path.
|
|
22
|
+
- True-motion intra prediction: 4×4, 8×8 and 16×16 blocks; eight signed lanes
|
|
23
|
+
compute and clip the left/top predictor. Unaligned top edges are copied into
|
|
24
|
+
a small aligned stack buffer; no plane or frame copy is needed.
|
|
25
|
+
- Full 4×4 IDCT and inverse Walsh transform: four parallel 32-bit lanes.
|
|
26
|
+
First-pass short truncation and signed rounding match upstream. DC-only
|
|
27
|
+
reconstruction uses bounded signed 16-bit lanes.
|
|
28
|
+
- Dequantization: eight signed 16-bit products, preserving short wraparound,
|
|
29
|
+
fused into IDCT without writing/reloading an intermediate coefficient block.
|
|
30
|
+
The whole Y/UV block wrappers explicitly call these native leaf kernels;
|
|
31
|
+
upstream's scalar block functions bypass generated leaf dispatch. Zero DC
|
|
32
|
+
residuals skip pixel arithmetic while preserving coefficient clearing.
|
|
33
|
+
- Normal, macroblock and simple deblocking: eight lanes, with native edge
|
|
34
|
+
transpose, widening and packing. Zero corrections skip both pixel-update
|
|
35
|
+
arithmetic and the scatter back into reference planes.
|
|
36
|
+
Horizontal stores write only the affected rows (four normal, six macroblock,
|
|
37
|
+
two simple), avoiding dirty/writeback traffic on unchanged reference rows.
|
|
38
|
+
- RGB565 panel byte order: fused into the I420 SIMD conversion before the
|
|
39
|
+
single output write; eight pixels per instruction group. The independent
|
|
40
|
+
in-place SIMD swap remains available for other RGB565 sources.
|
|
41
|
+
AMOLED rendering retains the decoder buffer rather than expanding to RGB888
|
|
42
|
+
and allocating another full-frame image.
|
|
43
|
+
VP8 reserves a bounded three-buffer pixel pool, recycling storage only after
|
|
44
|
+
all frame readers release it. Frame identities and weak-reference expiration
|
|
45
|
+
remain independent of recycled storage; a slow sink cannot force pool growth.
|
|
46
|
+
Paired luma rows reuse their widened, centered chroma registers. SIMD byte
|
|
47
|
+
deinterleave/reinterleave packs panel endian output directly, replacing two
|
|
48
|
+
mask loads and the per-vector shift/mask sequence. Scalar BT.601 comparisons
|
|
49
|
+
cover both byte orders independently, including odd final rows and guards.
|
|
50
|
+
|
|
51
|
+
Entropy decoding is serial native C: S3 builds inline the arithmetic-bit loop,
|
|
52
|
+
use NSAU for normalization instead of a table lookup, and retain arithmetic
|
|
53
|
+
state locally per macroblock. Checked, idempotent patches apply to the pinned
|
|
54
|
+
upstream implementation at configure time. Parsing, control flow and directional
|
|
55
|
+
intra prediction remain upstream C. This is not a claim that every instruction
|
|
56
|
+
in VP8 is SIMD.
|
|
57
|
+
|
|
58
|
+
The codec kernels use libvpx's padded frame borders and aligned coefficient
|
|
59
|
+
blocks. The I420 kernel reads exactly its requested span: its C++ dispatcher
|
|
60
|
+
checks source/output alignment and handles odd dimensions and short tails.
|
|
61
|
+
Video allocations use 16-byte alignment so the native path is deterministic.
|
|
62
|
+
Opaque framebuffer painting also uses Gea's native PIE span-copy helper. It
|
|
63
|
+
handles the cropped 396-to-368-pixel rows without requiring matching source and
|
|
64
|
+
destination alignment, keeps vector loads within the requested span, and
|
|
65
|
+
preserves panel byte order. The on-board check covers 25,408 offset/length cases
|
|
66
|
+
with guards; a warm cropped-row microbenchmark measured 1.76× versus memcpy.
|
|
67
|
+
This is a row-copy speedup, not a claim about complete live FPS.
|
|
68
|
+
Assembly routines use caller-saved PIE state; ESP-IDF saves this state across
|
|
69
|
+
task switches. No interrupt masking or global kernel lock is used.
|
|
70
|
+
|
|
71
|
+
The decoder scopes a task-local 672-byte internal-RAM workspace around decode.
|
|
72
|
+
Interpolation and deblocking reuse it sequentially; reference planes, output
|
|
73
|
+
images and worker stacks remain in PSRAM. Nested bindings restore the previous
|
|
74
|
+
workspace. If the bounded internal allocation cannot be made, the unchanged
|
|
75
|
+
aligned stack path remains available; live startup reports the actual allocation.
|
|
76
|
+
|
|
77
|
+
## Verification
|
|
78
|
+
|
|
79
|
+
`GEADEV SIMDBENCH` runs on a joined PSRAM worker, with no microphone, speaker,
|
|
80
|
+
network session or cloud credits. It compares the actual S3 instructions with
|
|
81
|
+
the preserved upstream C functions:
|
|
82
|
+
|
|
83
|
+
- Every one of the 16,777,216 Y/U/V combinations, plus distinct chroma lanes.
|
|
84
|
+
- 4,096 entropy streams with full state comparisons after every bit, including
|
|
85
|
+
all normalization ranges, probability extremes, truncated and encrypted input.
|
|
86
|
+
- All subpixel offsets and source alignments for all eight prediction kernels.
|
|
87
|
+
- 4,096 integer-motion block copies with every source/destination offset,
|
|
88
|
+
odd and aligned strides, and complete destination guards.
|
|
89
|
+
- 1,536 true-motion cases covering all three block sizes, unaligned top edges,
|
|
90
|
+
clipping and untouched destination borders.
|
|
91
|
+
- Every RGB565 value for the byte-order conversion, with surrounding guards.
|
|
92
|
+
- 4,096 fused-color cases comparing canonical and panel byte order, including
|
|
93
|
+
multi-iteration vectors, mixed chroma, scalar tails and odd padded strides.
|
|
94
|
+
- 4,096 IDCT, dequantization, Walsh and DC cases, including extreme coefficients.
|
|
95
|
+
- 1,024 whole Y/UV macroblocks with mixed EOB values, extreme coefficients,
|
|
96
|
+
zero DC and short-wrap-to-zero products, comparing all pixels and coefficients.
|
|
97
|
+
- 6,144 deblocking cases covering smooth edges, noise, constant planes at every
|
|
98
|
+
byte value, all orientations, chroma planes, unaligned addresses and untouched
|
|
99
|
+
surrounding pixels. Internal-workspace guards are also checked.
|
|
100
|
+
|
|
101
|
+
Only an `END` following every `exact=1` is a pass. Timing excludes the comparison
|
|
102
|
+
itself. `GEADEV VP8BENCH /storage/gea-vp8-benchmark.ivf` measures complete decoding
|
|
103
|
+
of a saved clip; its conversion time includes the separately reported buffer
|
|
104
|
+
allocation/initialization time. Neither diagnostic establishes live A/V quality.
|
|
105
|
+
|
|
106
|
+
`GEADEV VP8PROFILE ON` enables task-local stage clocks; `OFF` disables them.
|
|
107
|
+
They default off on boot and add no tasks, timers or interrupts. The saved-clip
|
|
108
|
+
and live tools accept `--profile-video` and disable profiling during cleanup.
|
|
109
|
+
Stage durations are wall time (including preemption). Token time is nested in
|
|
110
|
+
macroblock time; reports subtract it before labeling reconstruction time.
|
|
111
|
+
|
|
112
|
+
`GEADEV VP8CAPTURE START` optionally retains the first accepted keyframe and its
|
|
113
|
+
reference prefix by moving encoded buffers, capped at 12 frames / 128 KiB. It
|
|
114
|
+
defaults off and makes no live flash writes. After the decoder worker joins,
|
|
115
|
+
`GEADEV VP8CAPTURE SAVE` writes `/storage/gea-vp8-live-benchmark.ivf` and reports
|
|
116
|
+
each frame's live wall and CPU durations. `CANCEL` releases retained buffers.
|
|
117
|
+
Starting/saving while a video worker is running is rejected. Replay this file
|
|
118
|
+
with `VP8BENCH` to compare the same content and dimensions under live and offline
|
|
119
|
+
loads. Offline frame reports include `cpu_us`; CPU counters exclude preemption,
|
|
120
|
+
while wall durations include it. The app diagnostic tools handle capture cleanup.
|
|
121
|
+
|
|
122
|
+
`GEADEV SIMDBENCH kernels` omits the unchanged exhaustive color sweep and runs
|
|
123
|
+
the codec differential checks in a few seconds. `GEADEV SIMDBENCH swap` checks
|
|
124
|
+
only byte order. On the AMOLED 1.8, the kernel check measured filtering at
|
|
125
|
+
104,887 µs versus 215,804 µs scalar; true-motion at 3,529 versus 11,288 µs;
|
|
126
|
+
IDCT at 7,590 versus 13,832 µs; and deblocking at 58,491 versus 104,750 µs.
|
|
127
|
+
All comparisons were exact. These are isolated kernel timings, not live FPS.
|
|
128
|
+
|
|
129
|
+
The zero-correction/workspace build on AMOLED 1.8 measured 6,144 deblocking cases
|
|
130
|
+
at 65,458 µs versus 157,102 µs scalar (2.4×), and 8,064 interpolation cases at
|
|
131
|
+
92,977 µs versus 214,627 µs scalar (2.3×). The same saved 60-frame clip completed
|
|
132
|
+
in 3.333 seconds (18.0 decoded frames/s). A subsequent live check still failed
|
|
133
|
+
with UI watchdog stalls; none of these isolated timings establish live FPS.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// ESP32-S3 PIE: eight I420 pixels per iteration, exact limited-range BT.601.
|
|
3
|
+
// No intermediate image, floating point, or reduced-precision coefficients.
|
|
4
|
+
// Inputs: Y 8-byte aligned, U/V 4-byte aligned, output 8-byte aligned;
|
|
5
|
+
// count is a positive multiple of eight. Reads exactly the requested pixels.
|
|
6
|
+
// Q registers/QACC/SAR are caller-saved and preserved by the IDF task switch.
|
|
7
|
+
.section .rodata.gea_i420_constants,"a",@progbits
|
|
8
|
+
.balign 16
|
|
9
|
+
.Li420_coefficients:
|
|
10
|
+
.short 298, 409, -100, -208, 516, 0, 0, 0
|
|
11
|
+
.Li420_offsets:
|
|
12
|
+
.short 16, 128, 31, 63
|
|
13
|
+
|
|
14
|
+
.text
|
|
15
|
+
// Separate entry points specialize the byte order at assembly time; no
|
|
16
|
+
// per-pixel branch and no second PSRAM read/write pass for panel output.
|
|
17
|
+
.macro GEA_I420_ROW name, panel, pair=0
|
|
18
|
+
.align 4
|
|
19
|
+
.global \name
|
|
20
|
+
.type \name,@function
|
|
21
|
+
\name:
|
|
22
|
+
// a2 Y; a3 U; a4 V; a5 RGB565; a6 count.
|
|
23
|
+
entry a1, 32
|
|
24
|
+
.if \pair
|
|
25
|
+
// Sixth argument points to { second_Y, second_output }; S3 pointers are
|
|
26
|
+
// 32-bit. Keep both advancing row pointers in registers for the block.
|
|
27
|
+
l32i a12, a7, 0
|
|
28
|
+
l32i a13, a7, 4
|
|
29
|
+
.endif
|
|
30
|
+
movi a7, .Li420_coefficients
|
|
31
|
+
ee.vld.128.ip q7, a7, 16
|
|
32
|
+
movi a8, 11
|
|
33
|
+
movi a9, 10
|
|
34
|
+
movi a10, 5
|
|
35
|
+
.Li420_loop_\@:
|
|
36
|
+
ee.vld.l.64.ip q0, a2, 8
|
|
37
|
+
ee.zero.q q3
|
|
38
|
+
ee.vzip.8 q0, q3
|
|
39
|
+
|
|
40
|
+
l32i a11, a3, 0
|
|
41
|
+
addi a3, a3, 4
|
|
42
|
+
ee.movi.32.q q1, a11, 0
|
|
43
|
+
ee.zero.q q3
|
|
44
|
+
ee.vzip.8 q1, q3
|
|
45
|
+
ee.orq q3, q1, q1
|
|
46
|
+
ee.vzip.16 q1, q3
|
|
47
|
+
|
|
48
|
+
l32i a11, a4, 0
|
|
49
|
+
addi a4, a4, 4
|
|
50
|
+
ee.movi.32.q q2, a11, 0
|
|
51
|
+
ee.zero.q q3
|
|
52
|
+
ee.vzip.8 q2, q3
|
|
53
|
+
ee.orq q3, q2, q2
|
|
54
|
+
ee.vzip.16 q2, q3
|
|
55
|
+
|
|
56
|
+
ee.vldbc.16.ip q3, a7, 2
|
|
57
|
+
ee.vsubs.s16 q0, q0, q3
|
|
58
|
+
ee.vldbc.16.ip q3, a7, 2
|
|
59
|
+
ee.vsubs.s16 q1, q1, q3
|
|
60
|
+
ee.vsubs.s16 q2, q2, q3
|
|
61
|
+
.if \pair
|
|
62
|
+
movi a14, 1
|
|
63
|
+
.endif
|
|
64
|
+
|
|
65
|
+
.Li420_color_\@:
|
|
66
|
+
// QACC starts at the rounding bias, 128. Shift directly to 5/6 bits;
|
|
67
|
+
// this is identical to clamping RGB888 and then truncating to RGB565.
|
|
68
|
+
ee.mov.s16.qacc q3
|
|
69
|
+
ee.vsmulas.s16.qacc q0, q7, 0
|
|
70
|
+
ee.vsmulas.s16.qacc q2, q7, 1
|
|
71
|
+
ee.srcmb.s16.qacc q4, a8, 0
|
|
72
|
+
ee.mov.s16.qacc q3
|
|
73
|
+
ee.vsmulas.s16.qacc q0, q7, 0
|
|
74
|
+
ee.vsmulas.s16.qacc q1, q7, 2
|
|
75
|
+
ee.vsmulas.s16.qacc q2, q7, 3
|
|
76
|
+
ee.srcmb.s16.qacc q5, a9, 0
|
|
77
|
+
ee.mov.s16.qacc q3
|
|
78
|
+
ee.vsmulas.s16.qacc q0, q7, 0
|
|
79
|
+
ee.vsmulas.s16.qacc q1, q7, 4
|
|
80
|
+
ee.srcmb.s16.qacc q6, a8, 0
|
|
81
|
+
|
|
82
|
+
ee.zero.q q3
|
|
83
|
+
ee.vmax.s16 q4, q4, q3
|
|
84
|
+
ee.vmax.s16 q5, q5, q3
|
|
85
|
+
ee.vmax.s16 q6, q6, q3
|
|
86
|
+
ee.vldbc.16.ip q3, a7, 2
|
|
87
|
+
ee.vmin.s16 q4, q4, q3
|
|
88
|
+
ee.vmin.s16 q6, q6, q3
|
|
89
|
+
ee.vldbc.16 q3, a7
|
|
90
|
+
addi a7, a7, -6
|
|
91
|
+
ee.vmin.s16 q5, q5, q3
|
|
92
|
+
wsr.sar a8
|
|
93
|
+
ee.vsl.32 q4, q4
|
|
94
|
+
wsr.sar a10
|
|
95
|
+
ee.vsl.32 q5, q5
|
|
96
|
+
ee.orq q4, q4, q5
|
|
97
|
+
ee.orq q4, q4, q6
|
|
98
|
+
.if \panel
|
|
99
|
+
// Deinterleave low/high bytes, then interleave in reversed order. This
|
|
100
|
+
// packs the panel byte order in three register operations instead of
|
|
101
|
+
// loading two masks and shifting/masking every eight pixels.
|
|
102
|
+
ee.zero.q q0
|
|
103
|
+
ee.vunzip.8 q4, q0
|
|
104
|
+
ee.vzip.8 q0, q4
|
|
105
|
+
ee.vst.l.64.ip q0, a5, 8
|
|
106
|
+
ee.vst.h.64.ip q0, a5, 8
|
|
107
|
+
.else
|
|
108
|
+
ee.vst.l.64.ip q4, a5, 8
|
|
109
|
+
ee.vst.h.64.ip q4, a5, 8
|
|
110
|
+
.endif
|
|
111
|
+
.if \pair
|
|
112
|
+
// Both luma rows share these chroma lanes. Reuse the widened, centered
|
|
113
|
+
// U/V registers instead of reloading and duplicating them for row two.
|
|
114
|
+
mov a11, a5
|
|
115
|
+
mov a5, a13
|
|
116
|
+
mov a13, a11
|
|
117
|
+
beqz a14, .Li420_pair_done_\@
|
|
118
|
+
movi a14, 0
|
|
119
|
+
ee.vld.l.64.ip q0, a12, 8
|
|
120
|
+
ee.zero.q q3
|
|
121
|
+
ee.vzip.8 q0, q3
|
|
122
|
+
ee.vldbc.16.ip q3, a7, 2
|
|
123
|
+
ee.vsubs.s16 q0, q0, q3
|
|
124
|
+
ee.vldbc.16.ip q3, a7, 2
|
|
125
|
+
j .Li420_color_\@
|
|
126
|
+
.Li420_pair_done_\@:
|
|
127
|
+
.endif
|
|
128
|
+
addi a6, a6, -8
|
|
129
|
+
bnez a6, .Li420_loop_\@
|
|
130
|
+
retw
|
|
131
|
+
.size \name, .-\name
|
|
132
|
+
.endm
|
|
133
|
+
GEA_I420_ROW gea_i420_rgb565_row_s3, 0
|
|
134
|
+
GEA_I420_ROW gea_i420_rgb565_row_be_s3, 1
|
|
135
|
+
GEA_I420_ROW gea_i420_rgb565_rows_s3, 0, 1
|
|
136
|
+
GEA_I420_ROW gea_i420_rgb565_rows_be_s3, 1, 1
|
|
137
|
+
|
|
138
|
+
// Eight RGB565 pixels per iteration. Mask after arithmetic right shift so
|
|
139
|
+
// the sign bit cannot contaminate the adjacent pixel's high byte.
|
|
140
|
+
.section .rodata.gea_rgb565_swap,"a",@progbits
|
|
141
|
+
.balign 16
|
|
142
|
+
.Lswap_low:
|
|
143
|
+
.long 0x00ff00ff, 0x00ff00ff, 0x00ff00ff, 0x00ff00ff
|
|
144
|
+
.Lswap_high:
|
|
145
|
+
.long 0xff00ff00, 0xff00ff00, 0xff00ff00, 0xff00ff00
|
|
146
|
+
.text
|
|
147
|
+
.align 4
|
|
148
|
+
.global gea_rgb565_swap_s3
|
|
149
|
+
.type gea_rgb565_swap_s3,@function
|
|
150
|
+
gea_rgb565_swap_s3:
|
|
151
|
+
entry a1, 32
|
|
152
|
+
movi a4, .Lswap_low
|
|
153
|
+
ee.vld.128.ip q2, a4, 16
|
|
154
|
+
ee.vld.128.ip q3, a4, 16
|
|
155
|
+
movi a5, 8
|
|
156
|
+
wsr.sar a5
|
|
157
|
+
.Lswap_loop:
|
|
158
|
+
ee.vld.128.ip q0, a2, 0
|
|
159
|
+
ee.orq q1, q0, q0
|
|
160
|
+
ee.vsr.32 q1, q1
|
|
161
|
+
ee.andq q1, q1, q2
|
|
162
|
+
ee.vsl.32 q0, q0
|
|
163
|
+
ee.andq q0, q0, q3
|
|
164
|
+
ee.orq q0, q0, q1
|
|
165
|
+
ee.vst.128.ip q0, a2, 16
|
|
166
|
+
addi a3, a3, -8
|
|
167
|
+
bnez a3, .Lswap_loop
|
|
168
|
+
retw
|
|
169
|
+
.size gea_rgb565_swap_s3, .-gea_rgb565_swap_s3
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
// Whole-macroblock reconstruction follows libvpx 1.16.0 idct_blk.c
|
|
3
|
+
// (Copyright (c) 2010 The WebM project authors). Upstream's C block functions
|
|
4
|
+
// call scalar leaf symbols directly, bypassing generated SIMD dispatch.
|
|
5
|
+
#include "vp8_s3.h"
|
|
6
|
+
|
|
7
|
+
static inline void add_block(short* q, short* dq, unsigned char* dst,
|
|
8
|
+
int stride, char eob) {
|
|
9
|
+
if (eob > 1) {
|
|
10
|
+
vp8_dequant_idct_add_s3(q, dq, dst, stride);
|
|
11
|
+
} else {
|
|
12
|
+
const short dc = (short)(q[0] * dq[0]);
|
|
13
|
+
// A zero DC residual leaves all 16 predicted pixels untouched.
|
|
14
|
+
if (dc) vp8_dc_only_idct_add_s3(dc, dst, stride, dst, stride);
|
|
15
|
+
q[0] = q[1] = 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
void vp8_dequant_idct_add_y_block_s3(short* q, short* dq, unsigned char* dst,
|
|
20
|
+
int stride, char* eobs) {
|
|
21
|
+
for (int row = 0; row < 4; ++row) {
|
|
22
|
+
for (int column = 0; column < 4; ++column) {
|
|
23
|
+
add_block(q, dq, dst + column*4, stride, *eobs++);
|
|
24
|
+
q += 16;
|
|
25
|
+
}
|
|
26
|
+
dst += 4*stride;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
void vp8_dequant_idct_add_uv_block_s3(short* q, short* dq, unsigned char* dst_u,
|
|
31
|
+
unsigned char* dst_v, int stride, char* eobs) {
|
|
32
|
+
for (int plane = 0; plane < 2; ++plane) {
|
|
33
|
+
unsigned char* dst = plane ? dst_v : dst_u;
|
|
34
|
+
for (int row = 0; row < 2; ++row) {
|
|
35
|
+
for (int column = 0; column < 2; ++column) {
|
|
36
|
+
add_block(q, dq, dst + column*4, stride, *eobs++);
|
|
37
|
+
q += 16;
|
|
38
|
+
}
|
|
39
|
+
dst += 4*stride;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Integer-motion copy for libvpx's padded reference planes. One window entry
|
|
3
|
+
// per complete block, arbitrary source alignment, 4-byte aligned destination.
|
|
4
|
+
.text
|
|
5
|
+
.align 4
|
|
6
|
+
.global gea_vp8_copy_rect_s3
|
|
7
|
+
.type gea_vp8_copy_rect_s3,@function
|
|
8
|
+
gea_vp8_copy_rect_s3:
|
|
9
|
+
// src, src stride, dst, dst stride, width (4/8/16), height
|
|
10
|
+
entry a1, 32
|
|
11
|
+
.Lcopy_row:
|
|
12
|
+
mov a8, a2
|
|
13
|
+
ee.ld.128.usar.ip q0, a8, 16
|
|
14
|
+
ee.ld.128.usar.ip q1, a8, 16
|
|
15
|
+
ee.src.q.qup q2, q0, q1
|
|
16
|
+
bnei a6, 16, .Lcopy_words
|
|
17
|
+
extui a8, a4, 0, 4
|
|
18
|
+
bnez a8, .Lcopy_words
|
|
19
|
+
mov a8, a4
|
|
20
|
+
ee.vst.128.ip q2, a8, 16
|
|
21
|
+
j .Lcopy_next
|
|
22
|
+
.Lcopy_words:
|
|
23
|
+
ee.movi.32.a q2, a8, 0
|
|
24
|
+
s32i a8, a4, 0
|
|
25
|
+
beqi a6, 4, .Lcopy_next
|
|
26
|
+
ee.movi.32.a q2, a8, 1
|
|
27
|
+
s32i a8, a4, 4
|
|
28
|
+
beqi a6, 8, .Lcopy_next
|
|
29
|
+
ee.movi.32.a q2, a8, 2
|
|
30
|
+
s32i a8, a4, 8
|
|
31
|
+
ee.movi.32.a q2, a8, 3
|
|
32
|
+
s32i a8, a4, 12
|
|
33
|
+
.Lcopy_next:
|
|
34
|
+
add a2, a2, a3
|
|
35
|
+
add a4, a4, a5
|
|
36
|
+
addi a7, a7, -1
|
|
37
|
+
bnez a7, .Lcopy_row
|
|
38
|
+
retw
|
|
39
|
+
.size gea_vp8_copy_rect_s3, .-gea_vp8_copy_rect_s3
|