summaryrefslogtreecommitdiffstats
path: root/src/MuxElements.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-04-15 10:57:47 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-04-15 10:57:47 +0200
commit1aeaeb05aadf196636ea5b6a0613c38111821436 (patch)
treef2d38aa2440089eac599e7f455cf4c301dca08d0 /src/MuxElements.cpp
parent97cbd6234058ce1514b5696609ee7bd1f8e6a761 (diff)
downloaddabmux-1aeaeb05aadf196636ea5b6a0613c38111821436.tar.gz
dabmux-1aeaeb05aadf196636ea5b6a0613c38111821436.tar.bz2
dabmux-1aeaeb05aadf196636ea5b6a0613c38111821436.zip
Make getSizeCu a dabSubchannel member function
Diffstat (limited to 'src/MuxElements.cpp')
-rw-r--r--src/MuxElements.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp
index a4102b8..9892acd 100644
--- a/src/MuxElements.cpp
+++ b/src/MuxElements.cpp
@@ -515,29 +515,26 @@ const string dabEnsemble::get_parameter(const string& parameter) const
return ss.str();
}
-unsigned short getSizeCu(dabSubchannel* subchannel)
+unsigned short dabSubchannel::getSizeCu() const
{
- if (subchannel->protection.form == UEP) {
- return Sub_Channel_SizeTable[subchannel->
- protection.uep.tableIndex];
- }
- else if (subchannel->protection.form == EEP) {
- dabProtectionEEP* protection =
- &subchannel->protection.eep;
- switch (protection->profile) {
+ if (protection.form == UEP) {
+ return Sub_Channel_SizeTable[protection.uep.tableIndex];
+ }
+ else if (protection.form == EEP) {
+ switch (protection.eep.profile) {
case EEP_A:
- switch (subchannel->protection.level) {
+ switch (protection.level) {
case 0:
- return (subchannel->bitrate * 12) >> 3;
+ return (bitrate * 12) >> 3;
break;
case 1:
- return subchannel->bitrate;
+ return bitrate;
break;
case 2:
- return (subchannel->bitrate * 6) >> 3;
+ return (bitrate * 6) >> 3;
break;
case 3:
- return (subchannel->bitrate >> 1);
+ return (bitrate >> 1);
break;
default: // Should not happens
etiLog.log(error, "Bad protection level on "
@@ -546,18 +543,18 @@ unsigned short getSizeCu(dabSubchannel* subchannel)
}
break;
case EEP_B:
- switch (subchannel->protection.level) {
+ switch (protection.level) {
case 0:
- return (subchannel->bitrate * 27) >> 5;
+ return (bitrate * 27) >> 5;
break;
case 1:
- return (subchannel->bitrate * 21) >> 5;
+ return (bitrate * 21) >> 5;
break;
case 2:
- return (subchannel->bitrate * 18) >> 5;
+ return (bitrate * 18) >> 5;
break;
case 3:
- return (subchannel->bitrate * 15) >> 5;
+ return (bitrate * 15) >> 5;
break;
default: // Should not happens
etiLog.log(error,