feat(统一输入): 统一流式输入及接口命名
build.yaml / build (push) Successful in 43s

This commit is contained in:
xiaoqidun committed 2026-10-19 08:43:50 +08:00
1 parent 151ddb0a20
commit d97c6f4e6f
60 files changed
+570 -262

No files matched your search

+3 -3
View File
@@ -211,11 +211,11 @@ func (s *u3dLineState) accumulateCorners(mesh *U3DMesh, shadingIndex uint32, cor
}
// value 按指定上下文和位宽读取点集或线集字段
// 入参: context 压缩上下文, small 是否为8位字段
// 入参: ctx 压缩上下文, small 是否为8位字段
// 返回: uint32 字段值
func (r *u3dLineReader) value(context int, small bool) uint32 {
func (r *u3dLineReader) value(ctx int, small bool) uint32 {
if r.bits != nil {
return r.bits.dynamicValue(&r.hist[context], small)
return r.bits.dynamicValue(&r.hist[ctx], small)
}
if small {
return uint32(r.values.u8())
+4 -4
View File
@@ -167,15 +167,15 @@ func (r *u3dResourceReader) motionFrame(frame *U3DKeyFrame, previous U3DKeyFrame
}
// motionDifference 用共享幅值上下文恢复一至三个差分分量
// 入参: previous 前一帧分量, scale 逆量化系数, context 符号上下文,下一项为幅值上下文
// 入参: previous 前一帧分量, scale 逆量化系数, ctx 符号上下文,下一项为幅值上下文
// 返回: [3]float32 重建分量, error 符号、数值或读取错误
func (r *u3dResourceReader) motionDifference(previous []float32, scale float32, context int) (values [3]float32, err error) {
signs := r.value(context, true)
func (r *u3dResourceReader) motionDifference(previous []float32, scale float32, ctx int) (values [3]float32, err error) {
signs := r.value(ctx, true)
if signs >= 1<<len(previous) {
return values, fmt.Errorf("invalid U3D motion difference signs")
}
for index, prior := range previous {
difference := float64(r.value(context+1, false)) * float64(scale)
difference := float64(r.value(ctx+1, false)) * float64(scale)
if signs&(1<<index) != 0 {
difference = -difference
}
+3 -3
View File
@@ -30,9 +30,9 @@ type u3dResourceReader struct {
}
// value 读取指定上下文的压缩字段,首次使用时初始化算术区间
// 入参: context 压缩上下文, small 是否为8位字段
// 入参: ctx 压缩上下文, small 是否为8位字段
// 返回: uint32 字段值
func (r *u3dResourceReader) value(context int, small bool) uint32 {
func (r *u3dResourceReader) value(ctx int, small bool) uint32 {
if r.err() != nil {
return 0
}
@@ -52,7 +52,7 @@ func (r *u3dResourceReader) value(context int, small bool) uint32 {
return nil
}
}
return r.bits.dynamicValue(&r.hist[context], small)
return r.bits.dynamicValue(&r.hist[ctx], small)
}
// u32 读取普通32位字段,压缩开始后沿用当前算术区间