0
点赞
收藏
分享

微信扫一扫

H.264官方软件JM源代码分析

JM源码地址:

​​http://iphome.hhi.de/suehring/tml/download/​​

参考:

​​H.264官方软件JM源代码简单分析-编码器lencod​​

​​H.264官方软件JM源代码简单分析-解码器ldecod​​

​​HEVC官方软件HM源代码简单分析-编码器TAppEncoder​​

​​HEVC官方软件HM源代码简单分析-解码器TAppDecoder​​

我下载的经典版JM8.6

解压后,打开下面的文件

H.264官方软件JM源代码分析_sed

删除repdump项目

H.264官方软件JM源代码分析_sed_02

编码————————————————————————————

右击lencod,设置为启动项目

修改输出目录

H.264官方软件JM源代码分析_配置文件_03

点击编辑——》宏

H.264官方软件JM源代码分析_编码器_04

设置调试的工作目录为刚才的目录

H.264官方软件JM源代码分析_编码器_05

重新生成

H.264官方软件JM源代码分析_编码器_06

道bin目录下生成了EXE文件

H.264官方软件JM源代码分析_sed_07

复制下面的文件,改名为encoder.cfg

H.264官方软件JM源代码分析_配置文件_08                 H.264官方软件JM源代码分析_编码器_09

修改输入文件:

H.264官方软件JM源代码分析_配置文件_10

然后运行程序:

Parsing Configfile encoder.cfg...........................................................................................

-------------------------------------------------------------------------------
Input YUV file : foreman_part_qcif.yuv
Output H.264 bitstream : test.264
Output YUV file : test_rec.yuv
Output log file : log.dat
Output statistics file : stat.dat
-------------------------------------------------------------------------------
Frame Bit/pic WP QP SnrY SnrU SnrV Time(ms) MET(ms) Frm/Fld I D
-------------------------------------------------------------------------------
0000(NVB) 168
0000(IDR) 21960 0 28 37.387 41.260 42.850 274 0 FRM 99
0001(I) 21696 0 28 37.363 41.333 43.079 278 0 FRM 99
0002(I) 22240 0 28 37.399 41.280 42.818 285 0 FRM 99
--------------------------------------------------------------------------
Total Frames: 3 (3)
Leaky BucketRateFile does not have valid entries;
using rate calculated from avg. rate
Number Leaky Buckets: 8
Rmin Bmin Fmin
658950 22240 21966
823680 22240 21960
988410 22240 21960
1153140 22240 21960
1317870 22240 21960
1482600 22240 21960
1647330 22240 21960
1812060 22240 21960
-------------------------------------------------------------------------------
Freq. for encoded bitstream : 30
Hadamard transform : Used
Image format : 176x144
Error robustness : Off
Search range : 16
No of ref. frames used in P pred : 10
Total encoding time for the seq. : 0.837 sec
Total ME time for sequence : 0.000 sec
Sequence type : IPPP (QP: I 28, P 28)
Entropy coding method : CAVLC
Profile/Level IDC : (66,30)
Search range restrictions : none
RD-optimized mode decision : used
Data Partitioning Mode : 1 partition
Output File Format : H.264 Bit Stream File Format
------------------ Average data all frames -----------------------------------
SNR Y(dB) : 37.38
SNR U(dB) : 41.29
SNR V(dB) : 42.92
Total bits : 66064 (I 21960, P 43936, NVB 168)
Bit rate (kbit/s) @ 30.00 Hz : 660.64
Bits to avoid Startcode Emulation : 0
Bits for parameter sets : 168
-------------------------------------------------------------------------------
Exit JM 8 encoder ver 8.6
请按任意键继续. . .

 

解码————————————————————————————

设置ldecod为启动项目

重新生成项目

H.264官方软件JM源代码分析_sed_11

如上修改工作目录和输出目录为  $(ProjectDir)bin

下面的配置文件decoder.cfg就可以用于解码

H.264官方软件JM源代码分析_sed_12

文件内容为

test.264                 ........H.264 coded bitstream
test_dec.yuv ........Output file, YUV 4:2:0 format
test_rec.yuv ........Ref sequence (for SNR)
10 ........Decoded Picture Buffer size
0 ........NAL mode (0=Annex B, 1: RTP packets)
0 ........SNR computation offset
1 ........Poc Scale (1 or 2)
500000 ........Rate_Decoder
104000 ........B_decoder
73000 ........F_decoder
leakybucketparam.cfg ........LeakyBucket Params

This is a file containing input parameters to the JVT H.264/AVC decoder.
The text line following each parameter is discarded by the decoder.

 

设置命令参数

H.264官方软件JM源代码分析_配置文件_13

运行结果:

--------------------------------------------------------------------------
Decoder config file : decoder.cfg
--------------------------------------------------------------------------
Input H.264 bitstream : test.264
Output decoded YUV 4:2:0 : test_dec.yuv
Output status file : log.dec
Input reference file : test_rec.yuv
--------------------------------------------------------------------------
POC must = frame# or field# for SNRs to be correct
Frame POC QP SnrY SnrU SnrV Time(ms)
0(I) 0 28 0.0000 0.0000 0.0000 27
1(I) 2 28 0.0000 0.0000 0.0000 25
2(I) 4 28 0.0000 0.0000 0.0000 22
-------------------- Average SNR all frames ------------------------------
SNR Y(dB) : 0.00
SNR U(dB) : 0.00
SNR V(dB) : 0.00
Total decoding time : 0.074 sec
--------------------------------------------------------------------------
Exit JM 8 decoder, ver 8.6
请按任意键继续. . .

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


举报

相关推荐

0 条评论