From 65331327d00c23ddaccdddca7c8c8c4fe7a77b6b Mon Sep 17 00:00:00 2001
From: DIB Elian <elian.dib@inria.fr>
Date: Tue, 18 Jul 2017 11:00:45 +0200
Subject: [PATCH] Created HEVC (Wrapper) class

---
 .gitignore     |  2 ++
 @HEVC/HEVC.m   | 37 +++++++++++++++++++++++++++++++++++++
 @HEVC/encode.m |  8 ++++++++
 encode.m       |  4 ++--
 4 files changed, 49 insertions(+), 2 deletions(-)
 create mode 100644 @HEVC/HEVC.m
 create mode 100644 @HEVC/encode.m

diff --git a/.gitignore b/.gitignore
index c22c879..9f3689c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
 
 bin/
+
+data/
diff --git a/@HEVC/HEVC.m b/@HEVC/HEVC.m
new file mode 100644
index 0000000..97c26ab
--- /dev/null
+++ b/@HEVC/HEVC.m
@@ -0,0 +1,37 @@
+classdef HEVC
+    %HEVC Summary of this class goes here
+    %   Detailed explanation goes here
+    
+    properties
+        params
+        extraParams    
+    end
+    
+    methods
+        function obj = HEVC(varargin)
+            p = inputParser; p.KeepUnmatched = true;
+            
+            p.addParameter('ConfigFile'       ,'Intra.cfg',@ischar);
+            p.addParameter('InputFile'        ,'ref.yuv'  ,@ischar);
+            p.addParameter('BitstreamFile'    ,'str.hevc' ,@ischar);
+            p.addParameter('ReconFile'        ,'rec.yuv'  ,@ischar);
+            p.addParameter('LogFile'          ,'log.rtf'  ,@ischar);
+            p.addParameter('SourceWidth'      ,'512'      ,@ischar);
+            p.addParameter('SourceHeight'     ,'512'      ,@ischar);
+            p.addParameter('InputBitDepth'    ,'8'        ,@ischar);
+            p.addParameter('InputChromaFormat','420'      ,@ischar);
+            p.addParameter('FrameRate'        ,'60'       ,@ischar);
+            p.addParameter('FrameSkip'        ,'0'        ,@ischar);
+            p.addParameter('FramesToBeEncoded','1'        ,@ischar);
+            p.addParameter('QP'               ,'32'       ,@ischar);
+            % Add additional parameters here
+            
+            p.parse(varargin{:});
+            obj.params = p.Results;
+            obj.extraParams = p.Unmatched;
+        end
+        
+        encode(obj,varargin)
+    end
+end
+
diff --git a/@HEVC/encode.m b/@HEVC/encode.m
new file mode 100644
index 0000000..0d45b1d
--- /dev/null
+++ b/@HEVC/encode.m
@@ -0,0 +1,8 @@
+function encode(obj,varargin)
+%ENCODE Summary of this function goes here
+%   Detailed explanation goes here
+
+HEVC.encode(obj.params,obj.extraParams,varargin{:});
+
+end
+
diff --git a/encode.m b/encode.m
index 5a50401..6ea8e29 100644
--- a/encode.m
+++ b/encode.m
@@ -9,7 +9,7 @@ p = inputParser; p.KeepUnmatched = true; p.StructExpand = true;
 
 p.addParameter('ConfigFile'       ,'Intra.cfg',@ischar);
 p.addParameter('InputFile'        ,'ref.yuv'  ,@ischar);
-p.addParameter('BitstreamFile'    ,'str.hevc' ,@ischar);
+p.addParameter('BitstreamFile'    ,'bit.hevc' ,@ischar);
 p.addParameter('ReconFile'        ,'rec.yuv'  ,@ischar);
 p.addParameter('LogFile'          ,'log.rtf'  ,@ischar);
 p.addParameter('SourceWidth'      ,'512'      ,@ischar);
@@ -19,7 +19,7 @@ p.addParameter('InputChromaFormat','420'      ,@ischar);
 p.addParameter('FrameRate'        ,'60'       ,@ischar);
 p.addParameter('FrameSkip'        ,'0'        ,@ischar);
 p.addParameter('FramesToBeEncoded','1'        ,@ischar);
-p.addParameter('QP'               ,'32'       ,@ischar);
+p.addParameter('QP'               ,'30'       ,@ischar);
 % Add additional parameters here
 
 p.parse(varargin{:});
-- 
GitLab