glaciall / jtt1078-video-server

基于JT/T 1078标准实现的视频转播服务器
Other
291 stars 137 forks source link

G.726 codec bug #27

Open bulletnoid opened 2 years ago

bulletnoid commented 2 years ago

g726 解码有爆音, 对比解码 pcm 文件与 ffmpeg 转码的结果不同 实测发现 g726 state 有错误

其中 https://github.com/glaciall/jtt1078-video-server/blob/6ec4b5eb8bfa2831cffef02b96bde59b91d87b4b/src/main/java/cn/org/hentai/jtt1078/codec/g726/G726.java#L242-L246

应为

if (dqsez != 0) {
    if (pks1 == 0)
        state.a[0] += 192;
    else
        state.a[0] -= 192;
}
bulletnoid commented 2 years ago

另外 g726 编码只有大端序, 设备基本是小端序的, 需要一个 bit stream 来处理小端序 IO 可以参考 https://github.com/herbix/bitstream

glaciall commented 2 years ago

我怎么看你发的那两段代码是一模一样的呢?