JMVC 编码解码过程

来源:互联网 发布:电力设备数据库 编辑:程序博客网 时间:2024/05/01 14:06

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序列。这时可以看看效果了。

0 0
原创粉丝点击