http://hi.baidu.com/xiangjunzhao
1、首先運行jmvc\JMVC\H264Extension\build\windows下的H264AVCVideoEncDec的工程文件,在bin文件夾中生成以下幾個可執行文件,其中staticd是debug版本,static是release版本
bin/DownConvertStatic.exe
bin/DownConvertStaticd.exe
bin/H264AVCDecoderLibTestStatic.exe
bin/H264AVCDecoderLibTestStaticd.exe
bin/H264AVCEncoderLibTestStatic.exe
bin/H264AVCEncoderLibTestStaticd.exe
bin/MVCBitStreamAssemblerStaticd.exe
bin/MVCBitStreamAssemblerStatic.exe
bin/MVCBitStreamExtractorStaticd.exe
bin/MVCBitStreamExtractorStatic.exe
bin/PSNRStatic.exe
bin/PSNRStaticd.exe
2、編碼與合成
主要是編碼和合成過程。
2.1 編碼過程
在控制檯使用H264AVCEncoderLibTestStaticd -vf encoderMVC.cfg 0命令,其中encoderMVC.cfg是配置文件,0表示待編碼的yuv文件視角。當編碼完成後會在bin文件夾生成相對應的output_0.264和recon_0.yuv文件。
(1)配置文件encoderMVC.cfg
編碼一個很重要的配置文件。詳情見SoftManual中的介紹。這裏需要注意的主要是2個地方。一個是開頭,如下。
#============================== GENERAL ==============================
InputFile ballroom # Input file
OutputFile output # Bitstream file
SourceWidth 640 # Input frame width
SourceHeight 480 # Input frame height
ReconFile recon # Reconstructed file
MotionFile motion # motion information file
FrameRate 25 # Maximum frame rate [Hz]
MaxDelay 1200.0 # Maximum structural delay [ms]
FramesToBeEncoded 250 # Number of frames (at input frame rate)
這裏InputFile是yuv序列,寬高比必須與原序列一致。如果ballroom序列不在bin文件夾,則需要寫全路徑,OutputFile和ReconFile默認在bin文件夾,當然也可以用全路徑指定。
第二個則是最後。
#======================= MULTIVIEW CODING PARAMETERS=========================
ICMode 0 #(0: IC off, 1: IC on)
MotionSkipMode 0 #(0: Motion skip mode off, 1: Motion skip mode on)
SingleLoopDecoding 0
NumViewsMinusOne 2
ViewOrder 0-2-1 #-4-3-6-5-7
就是最後視點順序需要注意點。
2.2 合成過程
最後將多個視角的編碼文件通過bin文件夾MVCBitStreamAssemblerStaticd –vf assembler.cfg命令進行合成,assembler.cfg也是配置文件,如下。
#============================== Assembler: View Encode order ==========================
OutputFile C:\Users\yang\Desktop\NVD\jmvc\bin\ballroom.264
NumberOfViews 3
InputFile0 C:\Users\yang\Desktop\NVD\jmvc\bin\output_0.264
InputFile1 C:\Users\yang\Desktop\NVD\jmvc\bin\output_2.264
InputFile2 C:\Users\yang\Desktop\NVD\jmvc\bin\output_1.264
需要注意,最好指明全路徑,並按照視點的順序。合成僅僅是將output_0.264等一系列編碼文件合成一個文件ballroom.264而沒有其他操作。
3 解碼
解碼命令如下:
H264AVCDecoderLibTestStatic <str> <rec> <numViews>
str: bitstream file (input)
rec: reconstructed video sequence (output)
numViews: number of view in bitstream
例如對上面編碼合成好的ballroom.264文件進行解碼,命令如下:
H264AVCDecoderLibTestStaticd ballroom.264 rec 3
則最終會在bin文件夾下生成rec_0.yuv、rec_1.yuv和rec_2.yuv三個yuv序列。這時可以看看效果了。