下载JM代码
搜一下JM download
,就能找到这个网站 Karsten Suehring,可以下载最新的19.0版本jm19.0.zip,也可以下载old_jm里面经典的jm8.6.zip
大致浏览JM Reference Software Manual.pdf
编码
bin目录里已经自带了配置文件和yuv文件。可以新建一个backup文件夹,把bin目录里的所有文件复制一份放进去。
双击打开tml.sln
(jm8.6)或者jm_vc11.sln
(JM19.0)
在左侧的项目文件管理器,对着 lencod
项目
右键 - 属性:
属性 - 常规 - 输出目录:$(ProjectDir)bin
(这个可以不改,这里是生成的exe文件所在地)
属性 - 调试 - 工作目录:$(ProjectDir)bin
(这个也可以不改,把下面的命令参数改成-d bin\encoder_main.cfg
,注意cfg文件里的yuv文件的位置要对)
属性 - 调试 - 命令参数:-d encoder_main.cfg
右键 - 设为启动项目
右键 - 生成(Ctrl B),等待成功以后,开始调试F5
解码
右键把ldecod
设为启动项目
配置属性 - 常规 - 输出目录:$(ProjectDir)bin
(这个可以不改,这里是生成的exe文件所在地)
配置属性 - 调试 - 工作目录:$(ProjectDir)bin
配置属性 - 调试 - 命令参数:-d decoder.cfg
其他
注意Debug和Release的配置是不同的,另外在速度上也有不同,Release更快。平台x64和Win32也不同。
JM19.0编码输出:
Setting Default Parameters...
Parsing Configfile encoder_main.cfg...............................................................................................................................................................................................................................................................................................
------------------------------- JM 19.0 (FRExt) -------------------------------
Input YUV file : foreman_part_qcif.yuv
Output H.264 bitstream : test.264
Output YUV file : test_rec.yuv
YUV Format : YUV 4:2:0
Frames to be encoded : 3
Freq. for encoded bitstream : 30.00
PicInterlace / MbInterlace : 0/0
Transform8x8Mode : 0
ME Metric for Refinement Level 0 : SAD
ME Metric for Refinement Level 1 : Hadamard SAD
ME Metric for Refinement Level 2 : Hadamard SAD
Mode Decision Metric : Hadamard SAD
Motion Estimation for components : Y
Image format : 176x144 (176x144)
Error robustness : Off
Search range : 32
Total number of references : 5
References for P slices : 5
References for B slices (L0, L1) : 5, 1
Sequence type : I-B-P-B-P (QP: I 28, P 28, B 30)
Entropy coding method : CABAC
Profile/Level IDC : (77,40)
Motion Estimation Scheme : Fast Full Search
Search range restrictions : none
RD-optimized mode decision : used
Data Partitioning Mode : 1 partition
Output File Format : H.264/AVC Annex B Byte Stream Format
-------------------------------------------------------------------------------
Frame Bit/pic QP SnrY SnrU SnrV Time(ms) MET(ms) Frm/Fld Ref
-------------------------------------------------------------------------------
00000(NVB) 168
00000(IDR) 21096 28 37.526 41.289 42.851 133 0 FRM 3
00002( P ) 8200 28 36.824 40.943 42.317 2354 2194 FRM 2
00001( B ) 2320 30 36.311 41.027 42.543 7183 7045 FRM 0
-------------------------------------------------------------------------------
Total Frames: 3
Leaky BucketRateFile does not have valid entries.
Using rate calculated from avg. rate
Number Leaky Buckets: 8
Rmin Bmin Fmin
316140 21096 21096
395160 21096 21096
474180 21096 21096
553200 21096 21096
632220 21096 21096
711240 21096 21096
790260 21096 21096
869280 21096 21096
------------------ Average data all frames -----------------------------------
Total encoding time for the seq. : 9.671 sec (0.31 fps)
Total ME time for sequence : 9.240 sec
Y { PSNR (dB), cSNR (dB), MSE } : { 36.887, 36.859, 13.40333 }
U { PSNR (dB), cSNR (dB), MSE } : { 41.087, 41.084, 5.06602 }
V { PSNR (dB), cSNR (dB), MSE } : { 42.570, 42.565, 3.60264 }
Total bits : 31784 (I 21096, P 8200, B 2320 NVB 168)
Bit rate (kbit/s) @ 30.00 Hz : 317.84
Bits to avoid Startcode Emulation : 25
Bits for parameter sets : 168
Bits for filler data : 0
-------------------------------------------------------------------------------
Exit JM 19 (FRExt) encoder ver 19.0
JM19.0解码输出:
Setting Default Parameters...
Parsing Configfile decoder.cfg
...............
----------------------------- JM 19.0 (FRExt) -----------------------------
--------------------------------------------------------------------------
Input H.264 bitstream : test.264
Output decoded YUV : test_dec.yuv
Input reference file : test_rec.yuv
--------------------------------------------------------------------------
Profile IDC : 77
Image Format : 176x144 (176x144)
Color Format : 4:2:0 (8:8:8)
--------------------------------------------------------------------------
POC must = frame# or field# for SNRs to be correct
--------------------------------------------------------------------------
Frame POC Pic# QP SnrY SnrU SnrV Y:U:V Time(ms)
--------------------------------------------------------------------------
00000(IDR) 0 0 28 0.0000 0.0000 0.0000 4:2:0 28
00002( P ) 4 1 28 0.0000 0.0000 0.0000 4:2:0 27
00001( b ) 2 2 30 0.0000 0.0000 0.0000 4:2:0 6
-------------------- Average SNR all frames ------------------------------
SNR Y(dB) : 0.00
SNR U(dB) : 0.00
SNR V(dB) : 0.00
Total decoding time : 0.062 sec (48.387 fps)[3 frm/62 ms]
--------------------------------------------------------------------------
Exit JM 19 (FRExt) decoder, ver 19.0
Output status file : log.dec
3 frames are decoded.