![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef APPLICATIONS_SESSION_SERVER_VIDEOTELEPHONY_HPP 00029 #define APPLICATIONS_SESSION_SERVER_VIDEOTELEPHONY_HPP 00030 00031 #include <APPLICATIONS/session/server/Session.hpp> 00032 00033 namespace applications { namespace session { namespace server { 00034 00035 /* VideoTelephonyStates are used to see the voice Sessionphase */ 00036 enum VideoTelephonyState 00037 { 00038 active = 1, 00039 inactive = 2 00040 }; 00041 00042 class VideoTelephony : 00043 public applications::session::server::Session 00044 00045 { 00046 public: 00047 VideoTelephony(const wns::pyconfig::View& _pyco); 00048 ~VideoTelephony(); 00049 00050 void 00051 logNormalProjectedFarima(std::deque<double> _x, std::deque<double> _phiold, double _y, 00052 double _phi, double _theta, double _m, double _sqrValue, 00053 double _variance, int _k, double _logMean, double _logStd); 00054 00055 void 00056 onData(const wns::osi::PDUPtr& _pdu); 00057 00058 void 00059 onTimeout(const Timeout& _t); 00060 00061 void 00062 calculateSLRangeDependency(); 00063 00064 private: 00065 int i; 00066 int j; 00067 int limit; 00068 int idx; 00069 00070 /***** I Frame Generating *****/ 00071 double fracI; 00072 double hurstI; 00073 int kI; 00074 std::deque<double> autocorrI; 00075 std::deque<double> phiInew; 00076 std::deque<double> phiIold; 00077 double pI; 00078 double nI; 00079 double dI; 00080 /* According to "IEEE 802.16m Evaluation Methodology Document(2009), Page 118, 00081 section 10.5", the I-frame packetsize is Weibull distributed. */ 00082 wns::distribution::Distribution* logNormDisI; 00083 double logNormValueI; 00084 double logMeanI; 00085 double logStdI; 00086 double meanI; 00087 double varianceI; 00088 std::deque<double> xI; 00089 double yI; 00090 double phiI; 00091 double thetaI; 00092 double mI; 00093 double sqrValueI; 00094 00095 /***** B Frame Generating*****/ 00096 double fracB; 00097 double hurstB; 00098 int kB; 00099 std::deque<double> autocorrB; 00100 std::deque<double> phiBnew; 00101 std::deque<double> phiBold; 00102 double pB; 00103 double nB; 00104 double dB; 00105 /* According to "IEEE 802.16m Evaluation Methodology Document(2009), Page 118, 00106 section 10.5", the B-frame packetsize is Lognormal distributed. */ 00107 wns::distribution::Distribution* logNormDisB; 00108 double logNormValueB; 00109 double logMeanB; 00110 double logStdB; 00111 double meanB; 00112 double varianceB; 00113 std::deque<double> xB; 00114 double yB; 00115 double phiB; 00116 double thetaB; 00117 double mB; 00118 double sqrValueB; 00119 00120 /***** P Frame Generating*****/ 00121 double fracP; 00122 double hurstP; 00123 int kP; 00124 std::deque<double> autocorrP; 00125 std::deque<double> phiPnew; 00126 std::deque<double> phiPold; 00127 double pP; 00128 double nP; 00129 double dP; 00130 /* According to "IEEE 802.16m Evaluation Methodology Document(2009), Page 118, 00131 section 10.5", the P-frame packetsize is Lognormal distributed. */ 00132 wns::distribution::Distribution* logNormDisP; 00133 double logNormValueP; 00134 double logMeanP; 00135 double logStdP; 00136 double meanP; 00137 double varianceP; 00138 std::deque<double> xP; 00139 double yP; 00140 double phiP; 00141 double thetaP; 00142 double mP; 00143 double sqrValueP; 00144 00145 /* Used in logNormalProjectedFarima() */ 00146 double mean; 00147 int n; 00148 wns::distribution::Distribution* distribution; 00149 double distributionValue; 00150 double normMean; 00151 double variance; 00152 00153 /* Voice parameters */ 00154 bool comfortNoise; 00155 Bit voicePacketSize; 00156 Bit comfortNoisePacketSize; 00157 00158 wns::simulator::Time voicePacketIat; 00159 00160 wns::simulator::Time videoPacketIat; 00161 int videoFrameRate; 00162 00163 private: 00164 bool byteFlag; 00165 00166 /* According to "IMT-Adv. ITU-R M.2135" every 20ms it is decided if a state transition takes place. */ 00167 wns::distribution::Distribution* stateTransitionDistribution; 00168 int cnCounter; 00169 00170 applications::session::server::VideoTelephonyState voiceState; 00171 00172 int bFrameCounter; 00173 int gopCounter; 00174 bool newGOP; 00175 00176 }; 00177 } // namespace server 00178 } // namespace session 00179 } // namespsce applications 00180 00181 #endif //APPLICATIONS_SESSION_SERVER_VIDEOTELEPHONY_HPP
1.5.5