videolan x265 源代码下载、编译、测试【二】 【2015-8-11更新 修改Release版本】

来源:互联网 发布:nginx 新手配置 编辑:程序博客网 时间:2024/06/01 11:01

在上一篇博客中 已经完成源代码下、编译环境配置、MSVC工程文件生成、VS2012打开工程

本博客就是运行、测试


1、VS2012 编译、生成 x265 的静态库、动态库、可执行程序

在vs2012 下,生成全部工程,当前选择是debug模式,会在build\vc11-x86\Debug目录下生成 libx265.lib 、 libx265.dll 、x265.exe

运行命令:x265 -V 

返回版本号、使用的汇编指令集

x265 [info]: HEVC encoder version 1.4+113-346fccbba4de
x265 [info]: build info [Windows][MSVC 1700][32 bit] 8bpp
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX


G:\x265-videolan\x265\x265\build\vc11-x86\Debug>dir 驱动器 G 中的卷是 linux 卷的序列号是 000A-0243 G:\x265-videolan\x265\x265\build\vc11-x86\Debug 的目录2014/11/22  16:55    <DIR>          .2014/11/22  16:55    <DIR>          ..2014/11/22  16:55         2,834,944 libx265.dll2014/11/22  16:55             3,478 libx265.exp2014/11/22  16:55         1,585,264 libx265.ilk2014/11/22  16:55             6,216 libx265.lib2014/11/22  16:55         2,673,664 libx265.pdb2014/11/22  16:55         7,251,476 x265-static.lib2014/11/22  16:55         2,950,656 x265.exe2014/11/22  16:55         2,125,112 x265.ilk2014/11/22  16:55         3,116,032 x265.pdb               9 个文件     22,546,842 字节               2 个目录 10,091,151,360 可用字节G:\x265-videolan\x265\x265\build\vc11-x86\Debug>x265.exe -Vx265 [info]: HEVC encoder version 1.4+113-346fccbba4dex265 [info]: build info [Windows][MSVC 1700][32 bit] 8bppx265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVXG:\x265-videolan\x265\x265\build\vc11-x86\Debug>

2、测试

运行命令: x265 --help >help.txt
得到x265 的help文件,仔细阅读

输入:
x265支持 YUV 、 Y4M 两种输入
Syntax: x265 [options] infile [-o] outfile
    infile can be YUV or Y4M
输出:
x265 支持H.265 裸码流输出
    outfile is raw HEVC bitstream


3、生成Release版本

直接生成Release会出错,需要修改:x265-static.vcxproj工程文件
错误的原因是 使用汇编器YASM对.asm源代码文件进行汇编后生成的obj文件名 与 链接时使用的文件名不对应:pixel-a.asm文件生成的文件名不是 pixel-a.asm.obj,而是pixel-a.obj
这个错误折腾我好久,终于在阅读编译文件是发现:x265-static.vcxproj工程文件中调用yasm生成obj的命令行 ,指明输出的是pixel-32.asm.obj

"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\yasm.exe" -f win32 -DPREFIX -DARCH_X86_64=0 -DHAVE_ALIGNED_STACK=0 -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8 -DX265_NS=x265 G:/x265-videolan/2015-811/x265/source/common/x86/pixel-32.asm -o pixel-32.asm.obj

但是实际上:输出的是pixel-32.obj,所以在生成库的时候 一直说找不到pixel-32.asm.obj。。。。。。 我就是醉了  大哭

    <Object Include="pixel-a.asm.obj" />    <Object Include="const-a.asm.obj" />    <Object Include="cpu-a.asm.obj" />    <Object Include="ssd-a.asm.obj" />    <Object Include="mc-a.asm.obj" />    <Object Include="mc-a2.asm.obj" />    <Object Include="pixel-util8.asm.obj" />    <Object Include="blockcopy8.asm.obj" />    <Object Include="pixeladd8.asm.obj" />    <Object Include="dct8.asm.obj" />    <Object Include="sad-a.asm.obj" />    <Object Include="intrapred8.asm.obj" />    <Object Include="ipfilter8.asm.obj" />    <Object Include="loopfilter.asm.obj" />    <Object Include="pixel-32.asm.obj" />


我就只只好暴力的 修改:让obj文件强制 指向完整的obj路径,然后就ok安静
    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\pixel-a.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\const-a.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\cpu-a.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\ssd-a.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\mc-a.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\mc-a2.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\pixel-util8.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\blockcopy8.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\pixeladd8.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\dct8.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\sad-a.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\intrapred8.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\intrapred8_allangs.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\ipfilter8.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\loopfilter.obj" />    <Object Include="G:\x265-videolan\2015-811\x265\build\vc11-x86\pixel-32.obj" />


0 0