add snr calculations for CXD1981 frontend
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Mon, 5 Jul 2010 14:12:08 +0000 (16:12 +0200)
committerghost <andreas.monzner@multimedia-labs.de>
Wed, 6 Oct 2010 20:32:35 +0000 (22:32 +0200)
lib/dvb/frontend.cpp

index a1ba8fe59f34cad7ff3e20734c55a7c675a0121e..abbb8d294ab6f2e89d25fda3e8f8e796120a206b 100644 (file)
@@ -906,6 +906,19 @@ int eDVBFrontend::readFrontendData(int type)
                        }
                        else if (strstr(m_description, "BCM4506") || strstr(m_description, "BCM4505"))
                                ret = (snr * 100) >> 8;
+                       else if (!strcmp(m_description, "CXD1981"))
+                       {
+                               int mse = (~snr) & 0xFF;
+                               switch (parm_u_qam_modulation) {
+                                       case QAM_16:
+                                       case QAM_64:
+                                       case QAM_256: ret = (int)(-950 * log(((double)mse) / 760)); break;
+                                       case QAM_32:
+                                       case QAM_128: ret = (int)(-875 * log(((double)mse) / 650)); break;
+
+                                       default: break;
+                               }
+                       }
 
                        if (type == signalQuality)
                        {