uavs3 / uavs3e Goto Github PK
View Code? Open in Web Editor NEWAVS3 encoder which supports AVS3-P2 baseline profile.
License: Other
AVS3 encoder which supports AVS3-P2 baseline profile.
License: Other
希望提供现成可用执行文件,促进自主标准推广试用评价等。不然像是闭门造车。
如标题,在实测中,Random Access 单线程配置下,uAVS3e-RealTime与x265编码器性能相差很大。采用ClassA~ClassF,另外增加4个额外的4K视频序列,uavs3e-RealTime对比x265编码性能相差50%左右。这个与智媒之音(https://mp.weixin.qq.com/s/cXMHveOYegzuKi2rN7Ftgg)的评测结论相差很大。
uavs3e采用RealTime分支的最快档次,配置参数如下:
uAVS3 -f /bin/encoder_ra.cfg -p InputFile= Beauty_3840x2160_50_600.yuv -p OutputFile=Beauty_3840x2160_50_600_Anchor_qp32.bin -p SourceWidth= 3840 -p SourceHeight= 2160 -p FramesToBeEncoded= 600 -p FrameRate=30 -p SpeedLevel=6 -p IntraPeriod=100 -p RateControl=0 -p QP= 32
x265采用veryfast,具体配置参数如下:
x265 --input Beauty_3840x2160_50_600.yuv --preset veryfast -t psnr --psnr -o Beauty_3840x2160_50_600_Anchor_qp27.bin --input-res 3840x2160 --fps 30 --keyint 100 --qp 27 --no-wpp -F 1 --bframes 3
不知道是不是我参数哪了没设对,这个编码器的编码速度每一帧都要花好几秒?我能想到的和编码速度有关的参数就这些了。
//#========== speed/quality trade-off ==============
cfg->speed_level = 4;
//#========== parallel configuration ===============
cfg->wpp_threads = 4;
cfg->frm_threads = 4;
问题现象:
使用RealTime分支编码器uAVS3_gop进行多次编码,会偶现每次跑码流不一致问题。
(同一命令,60次跑其中有1次与其他59次码流存在微小差异)
问题命令:
./uAVS3_gop -f ../bin/encoder_ra.cfg -p InputFile=./7680X4320_10bit.yuv -p threads-frm=9 -p threads-wpp=16 -p threads-gop=1 -p RateControl=3 -p TargetBitRate=35000 -p QP=32 -p SpeedLevel=7 -p FrameRate=100 -p FramesToBeEncoded=50 -p OutputFile=./out.avs3
环境:
CPU:ARM64
OS:openEuler release 22.03 LTS
GCC:10.3.1
目前每次编码都会在当前路径下追加写psnr.txt,写入编码的psnr ssim和fps。
希望能在编码选项中添加类似--export
--report
--csv
的选项,实现该文件位置的自定义
test\utest.c 中的<IO.H>应小写,不然在Linux交叉编译出错。
when encode some stream, assert fail at src/me.c:42: com_mv_mvr_check: Assertion `0' failed.
[New Thread 0x7ffff54eb700 (LWP 9663)]
[New Thread 0x7fffe5a09700 (LWP 9664)]
When frm_threads are set (e.g. —frm_threads 3), assertion in find_free_pictures will be triggered after about 500 frames.
/Users/ibobby/GitHub/avs/uavs3e/src/uavs3e.c:1336:5: error: implicit declaration of function 'uavs3e_funs_init_sse' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
uavs3e_funs_init_sse();
^
/Users/ibobby/GitHub/avs/uavs3e/src/uavs3e.c:1336:5: note: did you mean 'uavs3e_funs_init_c'?
/Users/ibobby/GitHub/avs/uavs3e/src/../inc/com_util.h:367:6: note: 'uavs3e_funs_init_c' declared here
void uavs3e_funs_init_c();
^
/Users/ibobby/GitHub/avs/uavs3e/src/uavs3e.c:1337:9: error: implicit declaration of function 'uavs3e_simd_avx_level' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (uavs3e_simd_avx_level(NULL) >= 2) {
^
/Users/ibobby/GitHub/avs/uavs3e/src/uavs3e.c:1338:9: error: implicit declaration of function 'uavs3e_funs_init_avx2' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
uavs3e_funs_init_avx2();
^
3 warnings and 3 errors generated.
make[2]: *** [src/CMakeFiles/uavs3e.dir/uavs3e.c.o] Error 1
make[1]: *** [src/CMakeFiles/uavs3e.dir/all] Error 2
make: *** [all] Error 2
以下是我运行的命令
git clone https://github.com/uavs3/uavs3e.git
cd uavs3e
mkdir build/macos
cd build/macOS
cmake ../..
make
Could it support reading from pipe (e.g. stdin) like SVT-AV1 does?
uavs3e --verbose
的说明为:
-v, --verbose [INTEGER] (optional)
: verbose level
0: no message
1: frame-level messages (default)
2: all messages
但是个人感觉1和2并没有差异……都包含逐帧的信息(Linux, Ubuntu 18.04.2 LTS, uavs3e version: 1.2.208_release,也可能是操作系统上版本的问题)
参考x265的--log-level
说明
--log-level <integer|string>
Controls the level of information displayed on the console. Debug level enables per-frame QP, metric, and bitrate logging. Full level enables hash and weight logging. -1 disables all logging, except certain fatal errors, and can be specified by the string “none”.
0. error
1. warning
2. info (default)
3. debug
4. full
希望编码得到的基本信息为最开头的 视频、参数设置信息 和 最后面的视频编码数据,省略中间逐帧的信息,而不是现在default的 frame-level messages
另外,如果可以,基本信息可以再精简一些,输出的log可以更贴近自然语言一些
eg. x265的编码log
yuv [info]: 1280x720 fps 60000/1000 i420p8 frames 0 - 599 of 600
raw [info]: output file: /home/yxj/yangxijie/playground/g/E/FourPeople_1280x720_60/x265_medium/qp27/coding.hevc
x265 [info]: HEVC encoder version 3.5+1-f0c1022b6
x265 [info]: build info [Linux][GCC 7.5.0][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [warning]: --ssim used with AQ off: results will be invalid!
x265 [warning]: --tune ssim should be used if attempting to benchmark ssim!
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool 0 using 16 threads on numa nodes 0,1
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 4 / wpp(12 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias : 6 / 60 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0
x265 [info]: References / ref-limit cu / depth : 3 / off / on
x265 [info]: Rate Control : CQP-27
x265 [info]: tools: rd=3 early-skip rskip mode=1 signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing lslices=4 deblock sao
x265 [info]: frame I: 10, Avg QP:24.00 kb/s: 26655.79 PSNR Mean: Y:42.892 U:46.108 V:47.181 SSIM Mean: 0.976873 (16.359dB)
x265 [info]: frame P: 114, Avg QP:27.00 kb/s: 2908.29 PSNR Mean: Y:40.956 U:45.219 V:46.447 SSIM Mean: 0.970450 (15.294dB)
x265 [info]: frame B: 476, Avg QP:28.74 kb/s: 514.69 PSNR Mean: Y:40.853 U:45.285 V:46.517 SSIM Mean: 0.970223 (15.261dB)
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 0.8% 0.0% 0.0% 12.9% 86.3%
encoded 600 frames in 7.42s (80.85 fps), 1405.16 kb/s, Avg QP:28.33, Global PSNR: 42.155, SSIM Mean Y: 0.9703773 (15.284 dB)
generally the sh
command is not available in the Windows command prompt and neither are many of the commands used in the shell script.
The preconditions for building in a Windows environment should be described in the Readme
这个编码器以及对应的解码前,是否支持8k视频得编解码
原因是使用了固定目录, 即/usr/include/与/usr/lib:
install(TARGETS uavs3e LIBRARY DESTINATION /usr/lib ARCHIVE DESTINATION /usr/lib)
install(FILES ../inc/uavs3e.h DESTINATION /usr/include/uavs3e/)
install(FILES ../inc/com_api.h DESTINATION /usr/include/uavs3e/)
而应为:
install(TARGETS uavs3e LIBRARY DESTINATION ${CMAKE_INSTALL_LIB_DIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIB_DIR})
install(FILES ../inc/uavs3e.h DESTINATION ${INSTALL_INCLUDE_DIR}/uavs3e/)
install(FILES ../inc/com_api.h DESTINATION ${INSTALL_INCLUDE_DIR}/uavs3e/)
若CMAKE_INSTALL_PREFIX为空, 才设为缺省值/usr.
操作系统: linux
编译命令:
export C_FLAGS="-fsanitize=leak -fno-stack-protector -no-omit-frame-pointer -saditize=address -fsanitize-recover=address"
mkdir build && cd build
cmake .. -DCOMPILE_10BIT=1
make -j
基本编码命令:
./uAVS3_gop -f ../bin/encoder_ra.cfg -p InputFile=in.yuv -p OutputFile=out.avs3 -p SourceWidth=7680 -p SourceHeight=4320 -p SampleBitDepth=10 -p CodingBitDepth=10
问题描述:使用asan地址消毒器对RealTime分支进行测试,当存在以下输入场景时,产生段错误,asan地址消毒器接收到SEGV信号
版本信息:Linux, Ubuntu 18.04.2 LTS, uavs3e version: 1.2.208_release
编码使用脚本:
import os
import time
uavs3_v1_2_208 = "/home/yxj/yangxijie/software/git/uavs3e/build/linux/uavs3enc"
yuv_video = "/mnt/video/E/FourPeople_1280x720_60.yuv"
yuv_width = '1280'
yuv_height = '720'
yuv_fps = '60'
set_qp = '45'
set_speed_level = '3'
coding_video = ' ./uavs3e.avs3'
begin_time = time.time()
cmd = uavs3_v1_2_208 + ' --speed_level ' + set_speed_level + ' --width ' + yuv_width + ' --height ' + yuv_height + ' --fps_num ' + yuv_fps + ' --fps_den 1 ' + ' --i_period ' + yuv_fps + ' --rc_type 0 ' + ' --input_bit_depth 8 ' + ' --qp ' + set_qp + ' --wpp_threads 40 ' + ' --frm_threads 40 ' + ' --input ' + yuv_video + ' --output ' + coding_video + ' --verbose 2 '
os.system(cmd)
end_time = time.time()
print('END' + str(end_time - begin_time) + 's')
使用python3 a.py
得到输出:
xj@coolc:~/yangxijie/playground/j$ python3 a.py
Version: 1.2.208_release, SHA-1: cd295084706a307f887dea18b53d4716795974d4
-----------------------------------------------------------------------------------------------------------------------------------
< Sequence's Info >
resolution input : 1280 x 720
resolution coding : 1280 x 720
bitdepth input : 8
bitdepth coding : 8
frame rate : 60 / 1
intra picture period : 60
close_gop : 0
max b frames : 15
signature : 0
< LookAhead Info >
lookahead : 40
scenecut : 0
schistogram : 0
adaptive_gop : 0
< Parallel Info >
WPP threads : 6
frame threads : 40
< RC Info >
RC type : 0 (0: CQP, 1: CRF, 2: ABR, 3: CBR)
qp : 45
qp_offset_cb : 0
qp_offset_cr : 0
< CU split CFG >
ctu_size: 128
min_cu_size: 4
max_part_ratio: 8
max_split_times: 6
min_qt_size: 8
max_bt_size: 64
max_eqt_size: 32
max_dt_size: 16
< Tool CFG >
Loop Filter: deblock: 1, sao: 1, alf: 1, cross_patch: 1,
Inter: AMVR(1) HMVP_NUM(8) AFFINE(1) SMVD(1) UMVE(1) EMVR(1)
Intra: TSCPM(1) IPF(1) DT(1)
Transform: PBT(1) SECTrans(1)
Quant: WeightedQuant: 0
ENC-Side Tools: chroma_qp(1) AQ(0)
Speed_level: 3
-----------------------------------------------------------------------------------------------------------------------------------
Input YUV file : /mnt/video/E/FourPeople_1280x720_60.yuv
Output bitstream : ./uavs3e.avs3
-----------------------------------------------------------------------------------------------------------------------------------
POC | QP | PSNR-Y PSNR-U PSNR-V| SSIM-Y SSIM-U SSIM-V| Bits | Time | Ref. List | Ext_info
************************************************************
0(I)|41.0| 37.1648 42.2469 43.7415| 0.9491 0.9618 0.9743| 149888| 5838|L0 |L1 |[]
************************************************************
16(B)|46.0| 36.3726 42.1169 43.4899| 0.9432 0.9609 0.9732| 13904| 1473|L0 0 |L1 0 |[]
***************************************************************************************
(省略)
===============================================================================
PSNR Y(dB) : 35.8344
PSNR U(dB) : 41.9294
PSNR V(dB) : 43.3710
SSIM Y(dB) : 0.9391
SSIM U(dB) : 0.9603
SSIM V(dB) : 0.9724
Total bits(bits) : 2870696
bitrate(kbps) : 287.0696
===============================================================================
Encoded frame count = 600
Total encoding time = 450612.000 msec, 450.612 sec
Average encoding time for a frame = 751.020 msec
Average encoding speed = 1.33152 frames/sec
===============================================================================
END80.22815370559692s
可以看到输出log的后面Total encoding time
为450s,但是用python脚本提供的时间计算发现实际编码时间为80.2s。这也导致fps计算错误。(也可能是我对log中Total
的理解有差。
if (h->cfg.scenecut) {
if (h->img_rlist[0].sc_ratio > sc_threshold) {
while (cur_ip_idx) {
double sc_ratio = loka_get_sc_ratio(&h->pinter, h->img_rlist[cur_ip_idx].img, h->img_lastIP, bit_depth);
if (sc_ratio <= sc_threshold) {
for (int i = 0; i <= cur_ip_idx; i++) {
h->img_rlist[i].sc_ratio = 0;
}
break;
}
cur_ip_idx--;
}
if (cur_ip_idx == 0) {
add_input_node(h, h->img_rlist[cur_ip_idx].img, 1, FRM_DEPTH_0, SLICE_I);
//
update_last_ip(h, h->img_rlist[cur_ip_idx].img, SLICE_I);
//
shift_reorder_list(h, cur_ip_idx);
return;
}
}
}
update_last_ip(h, h->img_rlist[cur_ip_idx].img, SLICE_I); should be added there after an I frame asserted in the node, or it might cause h->img_lastIP not updated and results in a series of errors.
版本信息:Linux, Ubuntu 18.04.2 LTS, uavs3e version: 1.2.208_release
编码使用脚本:
import os
import time
uavs3_v1_2_208 = "/home/yxj/yangxijie/software/git/uavs3e/build/linux/uavs3enc"
yuv_video = "/mnt/video/E/FourPeople_1280x720_60.yuv"
yuv_width = '1280'
yuv_height = '720'
yuv_fps = '60'
set_qp = '45'
set_speed_level = '3'
coding_video = ' ./uavs3e.avs3'
begin_time = time.time()
cmd = uavs3_v1_2_208 + ' --speed_level ' + set_speed_level + ' --width ' + yuv_width + ' --height ' + yuv_height + ' --fps_num ' + yuv_fps + ' --fps_den 1 ' + ' --i_period ' + yuv_fps + ' --rc_type 0 ' + ' --input_bit_depth 8 ' + ' --qp ' + set_qp + ' --wpp_threads 40 ' + ' --frm_threads 40 ' + ' --input ' + yuv_video + ' --output ' + coding_video + ' --verbose 0 '
os.system(cmd)
end_time = time.time()
print('END' + str(end_time - begin_time) + 's')
发现将log参数调整为0:None
还是会在控制台输出长串的星号
使用python3 a.py
得到输出:
Version: 1.2.208_release, SHA-1: cd295084706a307f887dea18b53d4716795974d4
-----------------------------------------------------------------------------------------------------------------------------------
< Sequence's Info >
resolution input : 1280 x 720
resolution coding : 1280 x 720
bitdepth input : 8
bitdepth coding : 8
frame rate : 60 / 1
intra picture period : 60
close_gop : 0
max b frames : 15
signature : 0
< LookAhead Info >
lookahead : 40
scenecut : 0
schistogram : 0
adaptive_gop : 0
< Parallel Info >
WPP threads : 6
frame threads : 40
< RC Info >
RC type : 0 (0: CQP, 1: CRF, 2: ABR, 3: CBR)
qp : 45
qp_offset_cb : 0
qp_offset_cr : 0
< CU split CFG >
ctu_size: 128
min_cu_size: 4
max_part_ratio: 8
max_split_times: 6
min_qt_size: 8
max_bt_size: 64
max_eqt_size: 32
max_dt_size: 16
< Tool CFG >
Loop Filter: deblock: 1, sao: 1, alf: 1, cross_patch: 1,
Inter: AMVR(1) HMVP_NUM(8) AFFINE(1) SMVD(1) UMVE(1) EMVR(1)
Intra: TSCPM(1) IPF(1) DT(1)
Transform: PBT(1) SECTrans(1)
Quant: WeightedQuant: 0
ENC-Side Tools: chroma_qp(1) AQ(0)
Speed_level: 3
************************************************************
************************************************************
****************************************************************************************
***********************************************************************************************************************************
(省略星号)
如题,com_if_filter_hor_8_arm64、com_if_filter_ver_8_arm64、com_if_filter_ver_8_ext_arm64等10bit汇编函数不接受BitDepth=8的参数,接口设计可兼容,且arm与x86在10bit版本编码8bit码流存在差异,建议进行兼容。
目前版本库**有master, Realtime, aq, cudetheqt, sobel_ql五个分支
在任何README.md中都没有关于这几个分支差异的说明,希望能在主分支的README中添加关于分支的说明
如果分支与master分支相差较大,希望能在该分支下添加README说明(如Realtime分支
如果分支无用,希望可以删减以精简项目
〇 希望能够在编码器的参数中添加-h, --help
的单参数:而不是每次都用./uavs3enc
来调出
input[-i] is mandatory!
Configuration error, please refer to the usage.
< Usage >
--config [STRING] (optional)
: file name of configuration
-i, --input [STRING]
……
从而调出usage界面
〇 希望能够有专门的一个网页对Command Line Options进行解释(命令行--help
只调出简版的),类似x265 cli
〇 添加-V, --version
的单参数
〇 添加 --speed_level [INTEGER] (optional) : Level of coding speed
的可选范围,1至3应该可以选,再往上选会发生什么呢……
现象描述:
使用RealTime分支Demo进行8k片源编码时,所有帧编码结束后,程序无法正常退出。
该问题为偶现问题。
无法退出时堆栈如下:
avs3_threadpool_wait
avs3_lib_free
avs3gop_lib_free
main
命令:
./uAVS3_gop -f ../encoder_ra.cfg -p InputFile=7680x4320_10bit.yuv -p OutputFile=./xx.avs3
环境:
CPU:ARM64
OS:openEuler release 22.03 LTS
GCC:10.3.1
uavs3e-RealTime在Linux下编译时/usr/include/time.h:113:5: error: unknown type name 'locale_t",这是什么原因呢?
I'm getting the following build error:
[100%] Linking C executable uavs3enc
/usr/bin/ld: src/libuavs3e.so: undefined reference to `min'
/usr/bin/ld: src/libuavs3e.so: undefined reference to `max'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/uavs3enc.dir/build.make:104: uavs3enc] Error 1
make[2]: Leaving directory '/build/uavs3e-git/src/uavs3e/build/linux'
make[1]: *** [CMakeFiles/Makefile2:115: CMakeFiles/uavs3enc.dir/all] Error 2
make[1]: Leaving directory '/build/uavs3e-git/src/uavs3e/build/linux'
make: *** [Makefile:149: all] Error 2
make: Leaving directory '/build/uavs3e-git/src/uavs3e/build/linux'
A git bisect shows that is caused by commit 218528c.
I can confirm that it was building fine until commit 457b5c9.
System information:
OS: Arch Linux x86_64
Compiler: gcc 10.2.0
CMake: 3.19.2
glibc: 2.32
操作系统: linux
编译命令:
export C_FLAGS="-fsanitize=leak -fno-stack-protector -no-omit-frame-pointer -saditize=address -fsanitize-recover=address"
mkdir build && cd build
cmake .. -DCOMPILE_10BIT=1
make -j
编码命令:
./uAVS3_gop -f ../bin/encoder_ra.cfg -p InputFile=in.yuv -p OutputFile=out.avs3 -p threads-gop=2
编码过程中发现
存在以下内存泄露问题:
编码命令: uavs3e.exe -i D:\Material\meiguo_1024_576_420_8.yuv -w 1024 -h 576 -d 8 -f 200 --fps_num 25 --fps_den 1 -q 60 -o meiguo_LD.bin -r meiguo_LD_rec.yuv
原因是使用了固定目录, 即/usr/include/与/usr/lib:
install(TARGETS uavs3e LIBRARY DESTINATION /usr/lib ARCHIVE DESTINATION /usr/lib)
install(FILES ../inc/uavs3e.h DESTINATION /usr/include/uavs3e/)
install(FILES ../inc/com_api.h DESTINATION /usr/include/uavs3e/)
而应为:
install(TARGETS uavs3e LIBRARY DESTINATION ${CMAKE_INSTALL_LIB_DIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIB_DIR})
install(FILES ../inc/uavs3e.h DESTINATION ${INSTALL_INCLUDE_DIR}/uavs3e/)
install(FILES ../inc/com_api.h DESTINATION ${INSTALL_INCLUDE_DIR}/uavs3e/)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.