华为云计算 云知识 Opus是什么
Opus是什么

简介

Opus是一个完全开放的、免费的、多功能的音频编解码器。 它在交互式的语音和音乐在互联网中的传输方面有着无与伦比的优势,但是同样致力于存储和流媒体应用程序。它是由互联网工程任务组(IETF)制定的标准,标准格式为RFC 6716,由Skype的SILK编解码器和Xiph.Org的CELT编解码器合并发展而来。

编译和测试方式

1.选择操作环境

本文选用华为鲲鹏云服务ECS KC1实例做测试

2.编译源代码

本文以“Opus1.3.1”版本为例,下载源码,并编译安装。

1)下载Opus源代码。

wget https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz

2)安装Opus软件依赖包。

yum install gcc-c++ bzip2 autoconf automake flex texinfo -y

3)升级gcc。

a.查看当前gcc版本,可以看到当前gcc版本为“4.8.5”。

gcc -v

结果如下:

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-redhat-linux/4.8.5/lto-wrapper

Target: aarch64-redhat-linux

Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.r

edhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --e

nable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-styl

e=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,lto --enable-plugin --enable-initfini-array --disable-libgcj --w

ith-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-aarch64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-

4.8.5-20150702/obj-aarch64-redhat-linux/cloog-install --enable-gnu-indirect-function --build=aarch64-redhat-linux

Thread model: posix

gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)

b.下载7.3.0版本的gcc。

wget http://mirrors.concertpass.com/gcc/releases/gcc-7.3.0/gcc-7.3.0.tar.gz

c.解压和编译7.3.0版本gcc,过程大概需要1小时~2小时。

tar -xvf gcc-7.3.0.tar.gz

cd gcc-7.3.0

./contrib/download_prerequisites

mkdir gcc-build-7.3.0 && cd gcc-build-7.3.0

../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib

make && make install

d.查看gcc版本。

gcc -v

如果查询后得到的版本号为旧版本,请退出操作系统后重新登录并查询,即可查询到升级后的gcc版本。

结果如下:

Using built-in specs.

COLLECT_GCC=gcc

COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/aarch64-unknown-linux-gnu/7.3.0/lto-wrapper

Target: aarch64-unknown-linux-gnu

Configured with: ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib

Thread model: posix

gcc version 7.3.0 (GCC)

4)解压并安装Opus。

cd /root/

tar -xvf /root/opus-1.3.1.tar.gz

cd /root/opus-1.3.1

./configure && make && make install

3.测试已完成编译的软件

由于Opus是一个供应用程序调用的库,因此编译生产的也是一个库,可以通过查看是否有opus.pc产升验证Opus是否编译成功。

cat /usr/local/lib/pkgconfig/opus.pc

回显如下表示opus编译成功。

# Opus codec reference implementation pkg-config file

prefix=/usr/local

exec_prefix=${prefix}

libdir=${exec_prefix}/lib

includedir=${prefix}/include

Name: Opus

Description: Opus IETF audio codec (floating-point build)

URL: https://opus-codec.org/

Version: 1.3.1

Requires:

Conflicts:

Libs: -L${libdir} -lopus

Libs.private: -lm

Cflags: -I${includedir}/opus

已知问题汇总

问题描述:

在编译过程中,提示类型的兼容问题,如下所示:

SUMM = vmlaq_lane_f32(SUMM, YY[0], vget_low_f32(XX[0]), 0);

             ^
celt/arm/celt_neon_intr.c:139:14: error: incompatible types when initializing type ‘float32x4_t’ using type ‘float32

x2_t’

       SUMM = vmlaq_lane_f32(SUMM, YEXT[0], vget_low_f32(XX[0]), 1);

             ^
celt/arm/celt_neon_intr.c:141:14: error: incompatible types when initializing type ‘float32x4_t’ using type ‘float32

x2_t’
       SUMM = vmlaq_lane_f32(SUMM, YEXT[1], vget_high_f32(XX[0]), 0);

             ^
celt/arm/celt_neon_intr.c:143:14: error: incompatible types when initializing type ‘float32x4_t’ using type ‘float32

x2_t’

       SUMM = vmlaq_lane_f32(SUMM, YEXT[2], vget_high_f32(XX[0]), 1);

             ^
celt/arm/celt_neon_intr.c:145:14: error: incompatible types when initializing type ‘float32x4_t’ using type ‘float32

x2_t’

       SUMM = vmlaq_lane_f32(SUMM, YY[1], vget_low_f32(XX[1]), 0);

             ^
celt/arm/celt_neon_intr.c:147:14: error: incompatible types when initializing type ‘float32x4_t’ using type ‘float32

x2_t’

解决方法:查看当前gcc版本,如果版本为“4.x.x”版本,请升级到“gcc 7.3.0”或者更高版本,升级方法参见上述步骤。

上一篇:Solr是什么 下一篇:华为云数据库MySQL的高可靠性