JSVM的安装与运行

Jsvm的安装稍简单,只需要将jsvm文件夹拷贝进虚拟机,再进行make就好了。具体操作如下:

解压后找到JSVM文件夹,将文件全部复制到虚拟机

 JSVM的安装与运行

打开终端,进入jsvm->JSVM->H264Extension->build->linux,进行make

 JSVM的安装与运行

这样就安装好了

编码尝试

首先尝试单层编码模式,回到jsvm目录下,进入bin文件夹,新建文档,我命名为one_level.cfg,打开文档,复制配置信息,具体如下:

# JSVM Configuration File in AVC mode

 

#====================== GENERAL ================================================

AVCMode                 1          # must be one for AVC simulations

InputFile               input.yuv  # input file

OutputFile              stream.264 # bitstream file

ReconFile               rec.yuv    # reconstructed file

SourceWidth             352        # input  frame width

SourceHeight            288        # input  frame height

FrameRate               25.0       # frame rate [Hz]

FramesToBeEncoded       300        # number of frames

 

#====================== CODING =================================================

SymbolMode              1          # 0=CAVLC, 1=CABAC

Enable8x8Transform      1          # 8x8 luma trafo (0:diabled, 1:enabled)

ConstrainedIntraPred    0          # constrained intra prediction (0:off, 1:on)

ScalingMatricesPresent  1          # scaling matrices (0:flat, 1:default)

BiPred8x8Disable        0          # disable bi-predicted blocks smaller than 8x8

MCBlocksLT8x8Disable    0          # blocks smaller than 8x8 are disabled

BasisQP                 31         # Quantization parameters

 

#====================== STRUCTURE ==============================================

DPBSize                 16         # decoded picture buffer in frames

NumRefFrames            16         # maximum number of stored reference frames

Log2MaxFrameNum         11         # specifies max. value for frame_num (4..16)

Log2MaxPocLsb           7          # specifies coding of POC’s (4..15)

SequenceFormatString    A0L0*74{P3L0B1L1b0L2b2L2}*1{B1L1b0L2b2L2}

                                   # coding structure

DeltaLayer0Quant        0          # differential QP for layer 0

DeltaLayer1Quant        3          # differential QP for layer 1

DeltaLayer2Quant        4          # differential QP for layer 2

DeltaLayer3Quant        5          # differential QP for layer 3

DeltaLayer4Quant        6          # differential QP for layer 4

DeltaLayer5Quant        7          # differential QP for layer 5

MaxRefIdxActiveBL0      2          # active entries in ref list 0 for B slices

MaxRefIdxActiveBL1      2          # active entries in ref list 1 for B slices

MaxRefIdxActiveP        1          # active entries in ref list for P slices

 

#============================== MOTION SEARCH ==================================

SearchMode              4          # Search mode (0:BlockSearch, 4:FastSearch)

SearchFuncFullPel       3          # Search function full pel

                                   #   (0:SAD, 1:SSE, 2:HADAMARD, 3:SAD-YUV)

SearchFuncSubPel        2          # Search function sub pel

                                   #   (0:SAD, 1:SSE, 2:HADAMARD)

SearchRange             32         # Search range (Full Pel)

FastBiSearch            1          # Fast bi-directional search (0:off, 1:on)

BiPredIter              4          # Max iterations for bi-pred search

IterSearchRange         8          # Search range for iterations (0: normal)

 

#============================== LOOP FILTER ====================================

LoopFilterDisable       0          # Loop filter idc (0: on, 1: off, 2:

                                   #   on except for slice boundaries)

LoopFilterAlphaC0Offset 0          # AlphaOffset(-6..+6): valid range

LoopFilterBetaOffset    0          # BetaOffset (-6..+6): valid range

 

#============================== WEIGHTED PREDICTION ============================

WeightedPrediction      0          # Weighting IP Slice (0:disable, 1:enable)

WeightedBiprediction    0          # Weighting B  Slice (0:disable, 1:explicit,

                                                         2:implicit)

 

#=============================== HRD =====================================

EnableVclHRD            0          # Type I HRD  (default 0:Off, 1:on)

EnableNalHRD            0          # Type II HRD (default 0:Off, 1:on)

 

将样本input.yuv复制进来,

输入指令

./H264AVCEncoderLibTestStatic -pf one_level.cfg

编码开始

 JSVM的安装与运行

结束后会生成rec.yuvstream.264文件

 JSVM的安装与运行

 

 

三层编码

配置文件访问http://concert.itec.aau.at/SVCDataset/

由于1080p太大,我选用较小的360p来进行测试

接下来就是配置文件,我采用的如下信息

 JSVM的安装与运行

进入后打开jsvm文件夹

 JSVM的安装与运行

在虚拟机中新建three_level_360p.cfg文件,配置信息参照图上360p中第一个文本,具体如下:(划线为自己修改部分)

# JSVM Main Configuration File for Sintel Spatial

 

OutputFile              output-360p.264   # Bitstream file

FrameRate               24.0       # Maximum frame rate [Hz]

FramesToBeEncoded      300        # Number of frames

 

BaseLayerMode 2

 

IntraPeriod            48          # Intra Period

GOPSize                 4          # GOP Size (at maximum frame rate)

 

SearchMode 4

SearchRange 32

 

FastBiSearch    1

 

 

NumLayers 3

LayerCfg layer0_snr0.cfg

LayerCfg layer0_snr1.cfg

LayerCfg layer0_snr2.cfg

 

 

 

新建三个层配置文件

 JSVM的安装与运行

具体信息如下:(划线部分为自己修改部分)

layer0_snr0.cfg

# JSVM Layer Configuration File

 

#====================== INPUT / OUTPUT =========================================

InputFile            input_360p.yuv      # Input  file

 

SourceWidth          640           # Input  frame width

SourceHeight         360           # Input  frame height

 

FrameRateIn          24            # Input  frame rate [Hz]

FrameRateOut         24            # Output frame rate [Hz]

 

IDRPeriod           48

 

#ProfileIdc           0             # 0 auto, 66 baseline, 77 main, 88 extended, 100 high, 83 scalable baseline, 86 scalable high

 

QP                  30             # Quantization parameters

MeQP0               30             # QP for mot. est. / mode decision (stage 0)

MeQP1               30             # QP for mot. est. / mode decision (stage 1)

MeQP2               30             # QP for mot. est. / mode decision (stage 2)

MeQP3               30             # QP for mot. est. / mode decision (stage 3)

MeQP4               30             # QP for mot. est. / mode decision (stage 4)

MeQP5               30             # QP for mot. est. / mode decision (stage 5)

 

layer0_snr1.cfg

# JSVM Layer Configuration File

 

#====================== INPUT / OUTPUT =========================================

InputFile            input_360p.yuv      # Input  file

 

SourceWidth          640           # Input  frame width

SourceHeight         360           # Input  frame height

 

FrameRateIn          24            # Input  frame rate [Hz]

FrameRateOut         24            # Output frame rate [Hz]

 

IDRPeriod           48

 

InterLayerPred      1              # Inter-layer Pred. (0: no, 1: yes, 2:adap.)

 

QP                  28             # Quantization parameters

MeQP0               28             # QP for mot. est. / mode decision (stage 0)

MeQP1               28             # QP for mot. est. / mode decision (stage 1)

MeQP2               28             # QP for mot. est. / mode decision (stage 2)

MeQP3               28             # QP for mot. est. / mode decision (stage 3)

MeQP4               28             # QP for mot. est. / mode decision (stage 4)

MeQP5               28             # QP for mot. est. / mode decision (stage 5)

 

layer0_snr2.cfg

# JSVM Layer Configuration File

 

#====================== INPUT / OUTPUT =========================================

InputFile            input_360p.yuv      # Input  file

 

SourceWidth          640           # Input  frame width

SourceHeight         360           # Input  frame height

 

FrameRateIn          24            # Input  frame rate [Hz]

FrameRateOut         24            # Output frame rate [Hz]

 

IDRPeriod           48

 

InterLayerPred      1              # Inter-layer Pred. (0: no, 1: yes, 2:adap.)

 

QP                  24             # Quantization parameters

MeQP0               24             # QP for mot. est. / mode decision (stage 0)

MeQP1               24             # QP for mot. est. / mode decision (stage 1)

MeQP2               24             # QP for mot. est. / mode decision (stage 2)

MeQP3               24             # QP for mot. est. / mode decision (stage 3)

MeQP4               24             # QP for mot. est. / mode decision (stage 4)

MeQP5               24             # QP for mot. est. / mode decision (stage 5)

 

 

 

 

 

 

 

运行:

首先用ffmpeg将之前的input.mp4文件提取视频像素格式

指令

./ffmpeg -i input.mp4 input_360p.yuv

然后用jsvm进行编码,

指令:./H264AVCEncoderLibTestStatic -pf three_level_360p.cfg

生成了文件output_360p.264以及rec.yuv

 JSVM的安装与运行