RTP Audio System  2.0.0
resourceutilizationpoint.h
Go to the documentation of this file.
00001 // ##########################################################################
00002 // ####                                                                  ####
00003 // ####                   Master Thesis Implementation                   ####
00004 // ####  Management of Layered Variable Bitrate Multimedia Streams over  ####
00005 // ####                 DiffServ with A Priori Knowledge                 ####
00006 // ####                                                                  ####
00007 // #### ================================================================ ####
00008 // ####                                                                  ####
00009 // ####                                                                  ####
00010 // #### Resource Utilization Point                                       ####
00011 // ####                                                                  ####
00012 // ####           Copyright (C) 1999-2012 by Thomas Dreibholz            ####
00013 // ####                                                                  ####
00014 // #### Contact:                                                         ####
00015 // ####    EMail: dreibh@iem.uni-due.de                                  ####
00016 // ####    WWW:   https://www.nntb.no/~dreibh/rtpaudio                ####
00017 // ####                                                                  ####
00018 // #### ---------------------------------------------------------------- ####
00019 // ####                                                                  ####
00020 // #### This program is free software: you can redistribute it and/or    ####
00021 // #### modify it under the terms of the GNU General Public License as   ####
00022 // #### published by the Free Software Foundation, either version 3 of   ####
00023 // #### the License, or (at your option) any later version.              ####
00024 // ####                                                                  ####
00025 // #### This program is distributed in the hope that it will be useful,  ####
00026 // #### but WITHOUT ANY WARRANTY; without even the implied warranty of   ####
00027 // #### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    ####
00028 // #### GNU General Public License for more details.                     ####
00029 // ####                                                                  ####
00030 // #### You should have received a copy of the GNU General Public        ####
00031 // #### License along with this program.  If not, see                    ####
00032 // #### <http://www.gnu.org/licenses/>.                                  ####
00033 // ####                                                                  ####
00034 // ##########################################################################
00035 // $Id: resourceutilizationpoint.h 1308 2011-12-22 07:43:26Z dreibh $
00036 
00037 
00038 #ifndef RESOURCEUTILIZATIONPOINT_H
00039 #define RESOURCEUTILIZATIONPOINT_H
00040 
00041 
00042 #include "tdsystem.h"
00043 #include "rtppacket.h"
00044 #include "bandwidthinfo.h"
00045 #include "trafficclassvalues.h"
00046 
00047 
00048 class StreamDescription;
00049 
00050 
00058 struct LayerClassMappingPossibility
00059 {
00063    cardinal Class;
00064 
00068    cardinal BufferDelay;
00069 
00073    double Cost;
00074 
00078    card64 Bandwidth;
00079 };
00080 
00081 
00089 struct LayerClassMapping
00090 {
00094    cardinal Possibilities;
00095 
00099    LayerClassMappingPossibility Possibility[TrafficClassValues::MaxValues];
00100 };
00101 
00102 
00111 class ResourceUtilizationPoint
00112 {
00113    // ====== Public data ====================================================
00114    public:
00118    card64 Bandwidth;
00119 
00123    double BandwidthCost;
00124 
00128    double Utilization;
00129 
00133    double FrameRate;
00134 
00138    cardinal Layers;
00139 
00140 
00144    BandwidthInfo LayerBandwidthInfo[RTPConstants::RTPMaxQualityLayers];
00145 
00149    LayerClassMapping Mapping[RTPConstants::RTPMaxQualityLayers];
00150 
00151 
00152    // ====== Operations =====================================================
00156    void reset();
00157 
00167    static cardinal mergeResourceUtilizationLists(
00168                       ResourceUtilizationPoint*  destination,
00169                       ResourceUtilizationPoint** listArray,
00170                       const cardinal*            listSizeArray,
00171                       const cardinal             listCount);
00172 
00180    static void sortResourceUtilizationList(
00181                   ResourceUtilizationPoint* rup,
00182                   const integer            start,
00183                   const integer            end);
00184 
00194    static cardinal optimizeResourceUtilizationList(
00195                       ResourceUtilizationPoint* rup,
00196                       const cardinal            count);
00197 
00206    static cardinal grahamScanResourceUtilizationList(ResourceUtilizationPoint* rup,
00207                                                      const cardinal            count);
00208 
00209 
00210    // ====== Comparision operators ==========================================
00214    inline int operator==(const ResourceUtilizationPoint& rup) const;
00215 
00219    inline int operator!=(const ResourceUtilizationPoint& rup) const;
00220 
00221 
00222    // ====== Private data ===================================================
00223    private:
00224    static inline void swapResourceUtilizationPoints(ResourceUtilizationPoint& a,
00225                                                     ResourceUtilizationPoint& b);
00226    static inline integer ccw(const ResourceUtilizationPoint& p0,
00227                              const ResourceUtilizationPoint& p1,
00228                              const ResourceUtilizationPoint& p2);
00229 };
00230 
00231 
00235 std::ostream& operator<<(std::ostream& os, const ResourceUtilizationPoint& rup);
00236 
00237 
00238 #include "resourceutilizationpoint.icc"
00239 
00240 
00241 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines