|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Name : SigcompValueConverter.cpp |
|
15 // Part of : SIPSigComp |
|
16 // Version : SIP/3.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #include "sigcompvalueconverter.h" |
|
23 // ----------------------------------------------------------------------------- |
|
24 // TSigcompValueConverter::ConvertDecompressionMemorySize |
|
25 // ----------------------------------------------------------------------------- |
|
26 // |
|
27 CSigComp::TMemorySize TSigcompValueConverter::ConvertDecompressionMemorySize(TUint aSize) |
|
28 { |
|
29 CSigComp::TMemorySize enumSize; |
|
30 |
|
31 switch (aSize) |
|
32 { |
|
33 case 2048: |
|
34 enumSize = CSigComp::E2048; |
|
35 break; |
|
36 case 4096: |
|
37 enumSize = CSigComp::E4096; |
|
38 break; |
|
39 case 8192: |
|
40 enumSize = CSigComp::E8192; |
|
41 break; |
|
42 case 16384: |
|
43 enumSize = CSigComp::E16384; |
|
44 break; |
|
45 case 32768: |
|
46 enumSize = CSigComp::E32768; |
|
47 break; |
|
48 case 65536: |
|
49 enumSize = CSigComp::E65536; |
|
50 break; |
|
51 case 131072: |
|
52 enumSize = CSigComp::E131072; |
|
53 break; |
|
54 default: |
|
55 enumSize = CSigComp::E8192; |
|
56 break; |
|
57 } |
|
58 return enumSize; |
|
59 } |
|
60 // ----------------------------------------------------------------------------- |
|
61 // TSigcompValueConverter::ConvertStateMemorySize |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 CSigComp::TMemorySize TSigcompValueConverter::ConvertStateMemorySize(TUint aSize) |
|
65 { |
|
66 CSigComp::TMemorySize enumSize; |
|
67 |
|
68 switch (aSize) |
|
69 { |
|
70 case 2048: |
|
71 enumSize = CSigComp::E2048; |
|
72 break; |
|
73 case 4096: |
|
74 enumSize = CSigComp::E4096; |
|
75 break; |
|
76 case 8192: |
|
77 enumSize = CSigComp::E8192; |
|
78 break; |
|
79 case 16384: |
|
80 enumSize = CSigComp::E16384; |
|
81 break; |
|
82 case 32768: |
|
83 enumSize = CSigComp::E32768; |
|
84 break; |
|
85 case 65536: |
|
86 enumSize = CSigComp::E65536; |
|
87 break; |
|
88 case 131072: |
|
89 enumSize = CSigComp::E131072; |
|
90 break; |
|
91 default: |
|
92 enumSize = CSigComp::E2048; |
|
93 break; |
|
94 } |
|
95 return enumSize; |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // TSigcompValueConverter::ConvertCyclesPerBit |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 CSigComp::TCyclesPerBit TSigcompValueConverter::ConvertCyclesPerBit(TUint aCpb) |
|
103 { |
|
104 CSigComp::TCyclesPerBit enumValue; |
|
105 |
|
106 switch (aCpb) |
|
107 { |
|
108 case 16: |
|
109 enumValue = CSigComp::E16; |
|
110 break; |
|
111 case 32: |
|
112 enumValue = CSigComp::E32; |
|
113 break; |
|
114 case 64: |
|
115 enumValue = CSigComp::E64; |
|
116 break; |
|
117 case 128: |
|
118 enumValue = CSigComp::E128; |
|
119 break; |
|
120 default: |
|
121 enumValue = CSigComp::E16; |
|
122 break; |
|
123 } |
|
124 return enumValue; |
|
125 } |