

fclose all; clear all; close all;

nframes = 50;

%qps = [22 27 32 37];
qps = 27;
camera = [39 41];
prob = 1-[0.02 0.03 0.05];
%prob2 = [1 6 10]; % Corresponde a porcentagem fixa de erros com rand(1) para 12 pacotes;
%prob2 = [1 3 7]; 
ilambda = 6:0.5:18; %antes desde 1.5
lambda = 2.^ilambda;
npacotesPorFrame = 3; 
ACK_frame = 4;
w_fileA='Results\weight_cam';
%w_fileA='none';
w = 1280;
h = 960;
raw_size = h*w*nframes*1.5;


    
dep_orig1 = ['Results\Nopt\depth-cam' num2str(camera(1)) '.yuv']; 
dep_orig2 = ['Results\Nopt\depth-cam' num2str(camera(2)) '.yuv']; 
cor_orig1 = ['Results\Nopt\color-cam' num2str(camera(1)) '.yuv'];
cor_orig2 = ['Results\Nopt\color-cam' num2str(camera(2)) '.yuv'];
for nqps = 1:1:length(qps)
    
       dep_nom1 = [dep_orig1(1:end-4) '_QP' num2str(qps(nqps)) '_Nopt.yuv'];
       dep_nom2 = [dep_orig2(1:end-4) '_QP' num2str(qps(nqps)) '_Nopt.yuv'];
       cor_nom1 = [cor_orig1(1:end-4) '_QP' num2str(qps(nqps)) '_Nopt.yuv'];
       cor_nom2 = [cor_orig2(1:end-4) '_QP' num2str(qps(nqps)) '_Nopt.yuv'];
      
           
       for nprob = 1:1:length(prob)
            dep_nom1Err = [dep_nom1(1:end-4) '_pckErr' num2str(nprob) '.yuv'];
            dep_nom2Err = [dep_nom2(1:end-4) '_pckErr' num2str(nprob) '.yuv'];
            cor_nom1Err = [cor_nom1(1:end-4) '_pckErr' num2str(nprob) '.yuv'];
            cor_nom2Err = [cor_nom2(1:end-4) '_pckErr' num2str(nprob) '.yuv'];
            
            syn_nomErr = ['Results\Nopt\Syth_QP' num2str(qps(nqps)) '_Nopt_pckErr' num2str(nprob) '.yuv'];
            
       %sintetizem com erro H.264 

        config_file_ViewSyn_ptm40('configfile.cfg', 'ViewSynthesizer\calibParams-pantomime.txt', cor_nom1Err, cor_nom2Err, dep_nom1Err, dep_nom2Err, nframes, syn_nomErr);
        system('ViewSynthesizer\ViewSynVC8.exe configfile.cfg');

       end
       
end



