::  Generic 3view GVD by ATM10.0r1/HP Dec13,2013 NICT
::  ex. ATMgvd 26 HP 25 200 hall2 3 ( QP26/26 HP 25fps 200frames Hall2 3views )
::            %1  %2 %3 %4  %5    %6 
md QP%1GVD
cd QP%1GVD
::
::  Depth's QPI/QPP & QPB value set: 26/22, 31/27, 36/32, 41/37.
set /a QPB=%1-4
::
if %3==25 (
set FULLW=1920
set FULLH=1088
set HALFW=960
set HALFH=544
) else (
set FULLW=1024
set FULLH=768
set HALFW=512
set HALFH=384
)
::
set CPF=cam_param_%5.txt
if %5==dancer set CPF=cam_param_undo_dancer.txt
if %5==fly set CPF=cam_param_gt_fly.txt
::if %5==street set CPF=cam_param_poznanstreet.txt
if %5==street set CPF=Poznan_Street_00_1920x1088_3reg.txt
if %5==hall2 set CPF=cam_param_poznanhall2.txt
::
if %5==dancer set VPOS=5.0
if %5==dancer set RPOS=1.0
if %5==fly set VPOS=5.0
if %5==fly set RPOS=9.0
if %5==newspaper set VPOS=4.0
if %5==newspaper set RPOS=2.0
if %5==balloons set VPOS=3.0
if %5==balloons set RPOS=1.0
if %5==kendo set VPOS=3.0
if %5==kendo set RPOS=1.0
if %5==shark set VPOS=5.0
if %5==shark set RPOS=1.0
if %5==street set VPOS=4.0
if %5==street set RPOS=5.0
if %5==hall2 set VPOS=6.0
if %5==hall2 set RPOS=7.0
::
::Make Depth
gvdencd ..\encd3.cfg Mode=QUARTER_ODD DepthBind=D3.yuv TotalNumberOfFrames=%4 CameraParameterFile=..\..\configs\cam_param\%CPF% > ATM100r1GVDQP%1.log
::1DummyD/1D
lencodGVD-R64 -d ..\..\configs\3dv_enc_%3Hz_texture_HP.cfg -depd ..\..\configs\3dv_enc_%3Hz_depth_HP.cfg -p FramesToBeEncoded=%4 -p FrameRate=%3.0 -p SourceWidth=%HALFW% -p SourceHeight=%HALFH% -p SourceResize=0 -p OutputWidth=%HALFW% -p OutputHeight=%HALFH% -p OriginalWidth=%HALFW% -p OriginalHeight=%HALFH% -p ProcessInput=0 -p OutputOriResPic=0 -p TraceFile="GVDDD_trace_enc.txt" -p ReconFile1="GVDDD_rec.yuv" -p OutputFile="GVDDD.264" -p StatsFile="GVDDD_stats.dat" -p ProfileIDC=118 -p QPISlice=%1 -p QPPSlice=%1 -p QPBSlice=%1 -p NumberOfViews=%6 -p 3DVCoding=1 -p 3DVConfigFile="..\..\configs\GVD\GVD_DummyD_%5.cfg" -p 3DVCodingOrder="T0D0" -p CompatibilityCategory=0 -depp SourceWidth=%HALFW% -depp SourceHeight=%HALFH% -depp SourceResize=0 -depp OutputWidth=%HALFW% -depp OutputHeight=%HALFH% -depp OriginalWidth=%HALFW% -depp OriginalHeight=%HALFH% -depp ProcessInput=0 -depp NormalizeDepth=0 -depp PostDilation=0 -depp OutputOriResPic=0 -depp TraceFile="GVDDD_trace_enc_depth.txt" -depp ReconFile1="GVDDD_depth_rec.yuv" -depp StatsFile="GVDDD_depth_stats.dat" -depp ProfileIDC=138 -depp QPISlice=%1 -depp QPPSlice=%1 -depp QPBSlice=%QPB% -depp NumberOfViews=%6 -depp InterPredictionAtAnchor=0 -depp HierarchicalCoding=0 -depp 3DVConfigFile="..\..\configs\GVD\GVD_depth_%5.cfg" >> ATM100r1GVDQP%1.log
::
::exit
::
:: Make Residual
gvdencr ..\encr3.cfg Mode=QUARTER_ODD_L DepthBind=GVDDD_depth_recV%VPOS%000.yuv TotalNumberOfFrames=%4 CameraParameterFile=..\..\configs\cam_param\%CPF% >> ATM100r1GVDQP%1.log
::
:: 1V/1R/1D
lencodGVD-R64 -d ..\..\configs\3dv_enc_%3Hz_texture_HP.cfg -depd ..\..\configs\3dv_enc_%3Hz_depth_HP.cfg -p FramesToBeEncoded=%4 -p FrameRate=%3.0 -p SourceWidth=%FULLW% -p SourceHeight=%FULLH% -p SourceResize=0 -p OutputWidth=%FULLW% -p OutputHeight=%FULLH% -p OriginalWidth=%FULLW% -p OriginalHeight=%FULLH% -p ProcessInput=0 -p OutputOriResPic=0 -p TraceFile="GVDVRD_trace_enc.txt" -p ReconFile1="GVDVRD_rec.yuv" -p OutputFile="GVDVRD.264" -p StatsFile="GVDVRD_stats.dat" -p ProfileIDC=118 -p QPISlice=%1 -p QPPSlice=%1 -p QPBSlice=%1 -p NumberOfViews=%6 -p 3DVCoding=1 -p 3DVConfigFile="..\..\configs\GVD\GVD_texture_%5.cfg" -p 3DVCodingOrder="T0D0T1" -p CompatibilityCategory=0 -p SEI_DepthViewInfo=1 -p GVD_DepthType=0 -p GVD_NumberOfResidualTextureViewsMinus1=1 -p GVD_Residual_depth_flag=0 -p GVD_z_flag=1 -p GVD_intrinsic_param_flag=1 -p GVD_rotation_flag=1 -p GVD_translation_flag=1 -depp SourceWidth=%HALFW% -depp SourceHeight=%HALFH% -depp SourceResize=0 -depp OutputWidth=%HALFW% -depp OutputHeight=%HALFH% -depp OriginalWidth=%HALFW% -depp OriginalHeight=%HALFH% -depp ProcessInput=0 -depp NormalizeDepth=0 -depp PostDilation=0 -depp OutputOriResPic=0 -depp TraceFile="GVDVRD_trace_enc_depth.txt" -depp ReconFile1="GVDVRD_depth_rec.yuv" -depp StatsFile="GVDVRD_depth_stats.dat" -depp ProfileIDC=138 -depp QPISlice=%1 -depp QPPSlice=%1 -depp QPBSlice=%QPB% -depp NumberOfViews=%6 -depp InterPredictionAtAnchor=0 -depp HierarchicalCoding=0 -depp 3DVConfigFile="..\..\configs\GVD\GVD_depth_%5.cfg" >> ATM100r1GVDQP%1.log
::
::
md dec
cd dec
::
:: ldecod80r2 GVDSEI with HP(not suport EHP) and NORESIZE compiled
ldecodGVD-R64 -f ..\..\..\configs\decoder.cfg -p InputFile="..\GVDVRD.264" -p OutputFileForTexture="VR_dec.yuv" -p OutputFileForDepth="DD_dec.yuv" -p NormalizeDepth=0 -p PostDilation=0  >> ..\ATM100r1GVDQP%1.log
::
gvddec >> ..\ATM100r1GVDQP%1.log
::
call ..\..\psnrall.bat %1
::
cd ..\..
