Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4711880d authored by DIB Elian's avatar DIB Elian
Browse files

Enabled structure parameter passing, added default config file

parent 0b51988f
Branches
No related tags found
No related merge requests found
function encode(ConfigFile,varargin) function encode(varargin)
%ENCODE Summary of this function goes here %ENCODE Summary of this function goes here
% Detailed explanation goes here % Detailed explanation goes here
[HEVCDir,~,~] = fileparts(mfilename('fullpath')); [HEVCDir,~,~] = fileparts(mfilename('fullpath'));
TAppEncoder = fullfile(HEVCDir,'bin','TAppEncoder.exe'); TAppEncoder = fullfile(HEVCDir,'bin','TAppEncoder.exe');
ConfigFile = fullfile(HEVCDir,'cfg',ConfigFile);
p = inputParser; p.KeepUnmatched = true; p.StructExpand = true;
p = inputParser; p.KeepUnmatched = true;
p.addParameter('ConfigFile' ,'Intra.cfg',@ischar);
p.addRequired ('ConfigFile' ,@ischar); p.addParameter('InputFile' ,'ref.yuv' ,@ischar);
p.addParameter('InputFile' ,'ref.yuv' ,@ischar); p.addParameter('BitstreamFile' ,'str.hevc' ,@ischar);
p.addParameter('BitstreamFile' ,'str.hevc',@ischar); p.addParameter('ReconFile' ,'rec.yuv' ,@ischar);
p.addParameter('ReconFile' ,'rec.yuv' ,@ischar); p.addParameter('LogFile' ,'log.rtf' ,@ischar);
p.addParameter('LogFile' ,'log.rtf' ,@ischar); p.addParameter('SourceWidth' ,'512' ,@ischar);
p.addParameter('SourceWidth' ,'512' ,@ischar); p.addParameter('SourceHeight' ,'512' ,@ischar);
p.addParameter('SourceHeight' ,'512' ,@ischar); p.addParameter('InputBitDepth' ,'8' ,@ischar);
p.addParameter('InputBitDepth' ,'8' ,@ischar); p.addParameter('InputChromaFormat','420' ,@ischar);
p.addParameter('InputChromaFormat','420' ,@ischar); p.addParameter('FrameRate' ,'60' ,@ischar);
p.addParameter('FrameRate' ,'60' ,@ischar); p.addParameter('FrameSkip' ,'0' ,@ischar);
p.addParameter('FrameSkip' ,'0' ,@ischar); p.addParameter('FramesToBeEncoded','1' ,@ischar);
p.addParameter('FramesToBeEncoded','1' ,@ischar); p.addParameter('QP' ,'32' ,@ischar);
p.addParameter('QP' ,'32' ,@ischar);
% Add additional parameters here % Add additional parameters here
p.parse(ConfigFile,varargin{:}); p.parse(varargin{:});
parameters = fieldnames (p.Results); parameters = fieldnames (p.Results);
values = struct2cell(p.Results); values = struct2cell(p.Results);
extraParameters = fieldnames (p.Unmatched); extraParameters = fieldnames (p.Unmatched);
extraValues = struct2cell(p.Unmatched); extraValues = struct2cell(p.Unmatched);
...@@ -46,6 +46,8 @@ end ...@@ -46,6 +46,8 @@ end
indLog = cellfun(@(str) strcmp(str,'LogFile'),parameters); indLog = cellfun(@(str) strcmp(str,'LogFile'),parameters);
ind = indConf|indLog; ind = indConf|indLog;
values{indConf} = fullfile(HEVCDir,'cfg',values{indConf});
argConf = strjoin(['-c',values(indConf)]); argConf = strjoin(['-c',values(indConf)]);
argLog = strjoin(['>' ,values(indLog) ]); argLog = strjoin(['>' ,values(indLog) ]);
argList = cellfun(@(param,val) ['--',param,'=',val],... argList = cellfun(@(param,val) ['--',param,'=',val],...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment