MC3302_SDK_V1.1.9_202507281.../media/sample/system/slt/slt.lua
2025-11-11 12:08:31 +08:00

397 lines
11 KiB
Lua
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- enum type here
-- PAYLOAD_TYPE_E
PT_JPEG = 26
PT_H264 = 96
PT_H265 = 265
PT_MJPEG = 1002
--VIDEO_MODE_E
VIDEO_MODE_STREAM = 0 -- 流模式发送(不支持)
VIDEO_MODE_FRAME = 1 -- 帧模式发送
-- VO_INTF_SYNC_E
VO_OUTPUT_1080P25 = 9
VO_OUTPUT_1080P30 = 10
VO_OUTPUT_1080P50 = 11
VO_OUTPUT_1080P60 = 12
-- FH_VENC_TYPE
FH_JPEG = (1 << 0)
FH_MJPEG = (1 << 1)
FH_NORMAL_H264 = (1 << 2)
FH_SMART_H264 = (1 << 3)
FH_NORMAL_H265 = (1 << 4)
FH_SMART_H265 = (1 << 5)
-- FH_H264_PROFILE
H264_PROFILE_BASELINE = 66
H264_PROFILE_MAIN = 77
H264_PROFILE_HIGH = 100
-- FH_H265_PROFILE
H265_PROFILE_MAIN = 1
-- FH_VENC_RC_MODE
FH_RC_H264_VBR = 3
FH_RC_H264_CBR = 4
FH_RC_H264_FIXQP = 5
FH_RC_H264_AVBR = 6
FH_RC_H265_VBR = 7
FH_RC_H265_CBR = 8
FH_RC_H265_FIXQP = 9
FH_RC_H265_AVBR = 10
FH_RC_H264_CVBR = 11
FH_RC_H265_CVBR = 12
FH_RC_H264_QVBR = 13
FH_RC_H265_QVBR = 14
-- TDE2_COLOR_FMT_E
TDE2_COLOR_FMT_ARGB1555 = 12
TDE2_COLOR_FMT_ARGB8888 = 20
--
VPU_VOMODE_BLK = 0 -- 宏块格式 | [ ]
VPU_VOMODE_SCAN = 1 -- 光栅格式(NV12) | [ ]
VPU_VOMODE_TILE192 = 2 -- Tile压缩192Byte | [ ]
VPU_VOMODE_TILE224 = 3 -- Tile压缩224Byte | [ ]
VPU_VOMODE_TILE256 = 4 -- Tile压缩256Byte | [ ]
VPU_VOMODE_RGB888 = 5 -- RGB888 | [ ]
VPU_VOMODE_ARGB888 = 5 -- ARGB888 | [ ]
VPU_VOMODE_YUYV = 6 -- YUYV(YUV2) | [ ]
VPU_VOMODE_RRGGBB = 7 -- RRGGBB | [ ]
VPU_VOMODE_NV16 = 10 -- NV16 | [ ]
VPU_VOMODE_Y = 11 -- Y | [ ]
VPU_VOMODE_UYVY = 12 -- UYVY | [ ]
VPU_VOMODE_YU12 = 13 -- YU12 | [ ]
VPU_VOMODE_RGB = 14 -- RGB | [ ]
VPU_VOMODE_BAYER_RAW = 15 -- BAYER_RAW | [ ]
VPU_VOMODE_10BIT_NV12 = 16 -- yuv420 10bit for 2dlut | [ ]
VPU_MODE_ISP_ONLINE = 0
VPU_MODE_DDR_OFFLINE = 1
VPU_MODE_2DLUT_OFFLINE = 2
VPU_MODE_2DLUT_ONLINE = 3
VPU_MODE_MAX_NUM = 4
VPU_MODE_DISABLE = 0xFFFF
-- ISP_OFFLINE_MODE
ISP_OFFLINE_MODE_DISABLE = 0
ISP_OFFLINE_MODE_LINEAR = 1
ISP_OFFLINE_MODE_WDR = 2
-- ISP_OUT_MODE_E
ISP_OUT_TO_VPU = (1 << 0)
ISP_OUT_TO_DDR = (1 << 1)
-- ISP_OUT_FORMAT_E
ISP_OUT_TO_DDR_YUV420_8BIT = 0
ISP_OUT_TO_DDR_YUV422_8BIT = 1
ISP_OUT_TO_DDR_YUV420_10BIT = 2
ISP_OUT_TO_DDR_YUV422_10BIT = 3
-- LUT2D_WORK_MODE_E
ISP_LUT2D_BYPASS = 0
ISP_LUT2D_ONLINE = 1
ISP_LUT2D_OFFLINE = 2
-- isp format
FORMAT_1080P25 = 0x0203
FORMAT_1080P30 = 0x0204
FORMAT_400WP25 = 0x0603
FORMAT_400WP30 = 0x0604
FORMAT_800WP15 = 0x0801
FORMAT_800WP25 = 0x0802
FORMAT_800WP30 = 0x0803
FORMAT_WDR_1080P25 = 0x10203
FORMAT_WDR_1080P30 = 0x10204
FORMAT_WDR_800WP15 = 0x10801
FORMAT_WDR_800WP25 = 0x10802
FORMAT_WDR_800WP30 = 0x10803
-- FH_VICAP_WORK_MODE_E
VICAP_WORK_MODE_ONLINE = 0
VICAP_WORK_MODE_OFFLINE = 1
-- FH_VICAP_BAYER_TYPE_E
VICAP_BAYER_RGGB = 0x0
VICAP_BAYER_GRBG = 0x1
VICAP_BAYER_BGGR = 0x2
VICAP_BAYER_GBRG = 0x3
-- FH_VICAP_INPUT_DATA_TYPE_E
VICAP_DATA_IN_RAW12 = 0 --输入的数据格式为RAW12
VICAP_DATA_IN_RAW16 = 1 --输入的数据格式为RAW16
VICAP_DATA_IN_YUV16 = 2 --输入的数据格式为YUV16
----------------------------------------------------------------------------------------
-- test param
slt = {
vbconf = {
{size = 1920 * 1080 * 2 + 4096, count = 8},
{size = 720 * 576 * 2 + 4096, count = 8},
},
preview = {
vicap = {
[0] = {
csi = 1,
dev_attr = {
bUsingVb = 0,
Width = 1920,
Height = 1080,
WorkMode = VICAP_WORK_MODE_OFFLINE,
DataTypeIn = VICAP_DATA_IN_RAW12,
},
vi_attr = {
BayerType = VICAP_BAYER_RGGB,
WorkMode = VICAP_WORK_MODE_OFFLINE,
WdrMode = 1,
Width = 1920,
Height = 1080,
Priority = 0,
crop = {
en = 0,
x = 0,
y = 0,
width = 0,
height = 0,
}
}
},
test_file_lf = "out/vicap_%02d_%dx%d_lf.raw",
test_file_sf = "out/vicap_%02d_%dx%d_sf.raw",
},
isp = {
[0] = {
mem_init = {
offline_mode = ISP_OFFLINE_MODE_WDR,
out_mode = ISP_OUT_TO_VPU,
out_format = ISP_OUT_TO_DDR_YUV422_8BIT,
lut2d_mode = ISP_LUT2D_BYPASS,
u32Width = 1920,
u32Height = 1080,
},
sensor_name = "ovos02k_mipi",
sensor_format = FORMAT_WDR_1080P25,
sensor_init = {
csi = 1,
cci = 1,
},
init_cmd = "echo offline_sf_0_0x%x_0x00600000_1 > /proc/driver/isp;echo offline_lf_0_0x%x_0x00600000_1 > /proc/driver/isp;echo offline_fps_30 > /proc/driver/isp;echo offline_start > /proc/driver/isp",
test_cmd = "out/isp_%d.yuv",
},
test_file = "out/isp_%d.yuv",
},
vpu = {
groups = {
[0] = { -- group0
group = {
vi_max_size = {
u32Width = 1920,
u32Height = 1080,
},
vimode = VPU_MODE_ISP_ONLINE,
},
channels = {
[0] = {
info = {
chn_max_size = {
u32Width = 1920,
u32Height = 1080,
},
out_mode = VPU_VOMODE_SCAN,
support_mode = 1<<VPU_VOMODE_SCAN,
bufnum = 2,
},
config = {
vpu_chn_size = {
u32Width = 1920,
u32Height = 1080,
},
},
vomode = VPU_VOMODE_SCAN,
},
},
},
}, -- grous end
test_file = "out/vpu_%d_%d_%dx%d_%d.yuv",
},
vgs2 = {
colorfmt = VPU_VOMODE_SCAN,
mode = 0,
prior = 0,
test_file = "out/vgs2_%d_%d.yuv",
},
},
playback = {
vdec = {
[0] = {
attr = {
enType = PT_H264,
u32BufSize = 3840 * 2160 * 1 / 5,
u32Priority = 0,
u32PicWidth = 3840,
u32PicHeight = 2160,
},
stream_file = "rsc/vdec_3840x2160_5.264",
test_file = "out/vdec_%02d_%dx%d.yuv",
}
},
vppu = {
[0] = {
u32PicWidth = 1920,
u32PicHeight = 1080,
},
test_file = "out/vppu_%02d_%dx%d.yuv",
},
vo = {
intf = VO_OUTPUT_1080P60,
},
max_frame = 2, -- loop to playback frames
max_count = 6, -- total check
},
venc = {
veu = {
[0] = {
cap = {
type = FH_NORMAL_H264,
max_size = {
u32Width = 1920,
u32Height = 1088,
}
},
config = {
type = FH_NORMAL_H264,
attr = {
profile = H264_PROFILE_MAIN,
i_frame_intterval = 10,
u32Width = 704,
u32Height = 576,
},
rc = {
rc_type = FH_RC_H264_FIXQP,
frame_count = 250,
frame_time = 10,
iqp = 30,
pqp = 30,
}
},
stream_file = {
name = "rsc/venc_704x576_nv12x10.yuv",
u32Width = 704,
u32Height = 576,
},
test_file = "out/venc_%02d_%dx%d.h264",
max_count = 10, -- 最多测试帧率0一直测试
},
[1] = {
cap = {
type = FH_NORMAL_H265,
max_size = {
u32Width = 1920,
u32Height = 1088,
}
},
config = {
type = FH_NORMAL_H265,
attr = {
profile = H265_PROFILE_MAIN,
i_frame_intterval = 10,
u32Width = 704,
u32Height = 576,
},
rc = {
rc_type = FH_RC_H265_FIXQP,
frame_count = 250,
frame_time = 10,
iqp = 30,
qp = 30,
}
},
stream_file = {
name = "rsc/venc_704x576_nv12x10.yuv",
u32Width = 704,
u32Height = 576,
},
test_file = "out/venc_%02d_%dx%d.h265",
max_count = 10, -- 最多测试帧率0一直测试
},
}
},
jpege = {
[0] = {
attr = {
u32Width = 720,
u32Height = 576,
},
stream_file = {
name = "rsc/jpege_720x576_nv12.yuv",
u32Width = 720,
u32Height = 576,
},
test_file = "out/jpege_%02d_%dx%d.jpg",
}
},
g2d = {
src = {
file = "rsc/g2d_background_720p.bits",
formar = TDE2_COLOR_FMT_ARGB1555;
u32Width = 1280,
u32Height = 720,
},
dst = {
u32Width = 1920,
u32Height = 1080,
},
test_file = "out/tde_%dx%d.bits",
},
vdsp = {
sramfile = "rsc/sram-sgbm-400x400-0x8f80-v1005.bin",
leftfile = "rsc/left_400x400_gray.bin",
rightfile = "rsc/right_400x400_gray.bin",
test_file = "rsc/out_golden_400x400_int16.bin",
max_width = 1280,
max_height = 720,
max_count = 10,
},
ioe = {
picWidSrc = 1024,
picHgtSrc = 540,
picWidDst = 240,
picHgtDst = 272,
threshold = 1,
yOnly = 1,
pitchWidSrc = 1024,
pitchHgtSrc = 544,
infile = "rsc/ioe_1024x544_nv12_2_made.yuv",
test_file = "out/ioe_%d(%d)x%d_%dx%d-%d-%d.yuv",
},
npu = {
model_file = "rsc/net_combine.bin",
pic_file = 'rsc/iss_in0_3x288x512',
test_file = 'out/npu_golden.bin',
}
}
local function adjust_slt_data()
end
-- 校正slt中的数据
adjust_slt_data()
debug = 1 -- turn on config file debug, default to 0
mode = 1 -- 1: generate the test golden data, default to 0: test mode
log_level = 4 -- log level