当前位置:   article > 正文

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

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

解压后,打开下面的文件

删除repdump项目

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

右击lencod,设置为启动项目

修改输出目录

点击编辑——》宏

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

重新生成

道bin目录下生成了EXE文件

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

                 

修改输入文件:

然后运行程序:

  1. Parsing Configfile encoder.cfg...........................................................................................
  2. -------------------------------------------------------------------------------
  3. Input YUV file : foreman_part_qcif.yuv
  4. Output H.264 bitstream : test.264
  5. Output YUV file : test_rec.yuv
  6. Output log file : log.dat
  7. Output statistics file : stat.dat
  8. -------------------------------------------------------------------------------
  9. Frame Bit/pic WP QP SnrY SnrU SnrV Time(ms) MET(ms) Frm/Fld I D
  10. -------------------------------------------------------------------------------
  11. 0000(NVB) 168
  12. 0000(IDR) 21960 0 28 37.387 41.260 42.850 274 0 FRM 99
  13. 0001(I) 21696 0 28 37.363 41.333 43.079 278 0 FRM 99
  14. 0002(I) 22240 0 28 37.399 41.280 42.818 285 0 FRM 99
  15. --------------------------------------------------------------------------
  16. Total Frames: 3 (3)
  17. Leaky BucketRateFile does not have valid entries;
  18. using rate calculated from avg. rate
  19. Number Leaky Buckets: 8
  20. Rmin Bmin Fmin
  21. 658950 22240 21966
  22. 823680 22240 21960
  23. 988410 22240 21960
  24. 1153140 22240 21960
  25. 1317870 22240 21960
  26. 1482600 22240 21960
  27. 1647330 22240 21960
  28. 1812060 22240 21960
  29. -------------------------------------------------------------------------------
  30. Freq. for encoded bitstream : 30
  31. Hadamard transform : Used
  32. Image format : 176x144
  33. Error robustness : Off
  34. Search range : 16
  35. No of ref. frames used in P pred : 10
  36. Total encoding time for the seq. : 0.837 sec
  37. Total ME time for sequence : 0.000 sec
  38. Sequence type : IPPP (QP: I 28, P 28)
  39. Entropy coding method : CAVLC
  40. Profile/Level IDC : (66,30)
  41. Search range restrictions : none
  42. RD-optimized mode decision : used
  43. Data Partitioning Mode : 1 partition
  44. Output File Format : H.264 Bit Stream File Format
  45. ------------------ Average data all frames -----------------------------------
  46. SNR Y(dB) : 37.38
  47. SNR U(dB) : 41.29
  48. SNR V(dB) : 42.92
  49. Total bits : 66064 (I 21960, P 43936, NVB 168)
  50. Bit rate (kbit/s) @ 30.00 Hz : 660.64
  51. Bits to avoid Startcode Emulation : 0
  52. Bits for parameter sets : 168
  53. -------------------------------------------------------------------------------
  54. Exit JM 8 encoder ver 8.6
  55. 请按任意键继续. . .

 

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

设置ldecod为启动项目

重新生成项目

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

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

文件内容为

  1. test.264 ........H.264 coded bitstream
  2. test_dec.yuv ........Output file, YUV 4:2:0 format
  3. test_rec.yuv ........Ref sequence (for SNR)
  4. 10 ........Decoded Picture Buffer size
  5. 0 ........NAL mode (0=Annex B, 1: RTP packets)
  6. 0 ........SNR computation offset
  7. 1 ........Poc Scale (1 or 2)
  8. 500000 ........Rate_Decoder
  9. 104000 ........B_decoder
  10. 73000 ........F_decoder
  11. leakybucketparam.cfg ........LeakyBucket Params
  12. This is a file containing input parameters to the JVT H.264/AVC decoder.
  13. The text line following each parameter is discarded by the decoder.

 

设置命令参数

运行结果:

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/735657
推荐阅读
相关标签
  

闽ICP备14008679号