mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 13:00:26 -04:00 
			
		
		
		
	Benchmarking: added inf/sup decimators test
This commit is contained in:
		
							parent
							
								
									1c354dba4d
								
							
						
					
					
						commit
						c3242d618f
					
				| @ -77,7 +77,7 @@ bool NFMDemodGUI::handleMessage(const Message& message) | |||||||
| { | { | ||||||
|     if (NFMDemod::MsgReportCTCSSFreq::match(message)) |     if (NFMDemod::MsgReportCTCSSFreq::match(message)) | ||||||
|     { |     { | ||||||
|         qDebug("NFMDemodGUI::handleMessage: NFMDemod::MsgReportCTCSSFreq"); |         //qDebug("NFMDemodGUI::handleMessage: NFMDemod::MsgReportCTCSSFreq");
 | ||||||
|         NFMDemod::MsgReportCTCSSFreq& report = (NFMDemod::MsgReportCTCSSFreq&) message; |         NFMDemod::MsgReportCTCSSFreq& report = (NFMDemod::MsgReportCTCSSFreq&) message; | ||||||
|         setCtcssFreq(report.getFrequency()); |         setCtcssFreq(report.getFrequency()); | ||||||
|         //qDebug("NFMDemodGUI::handleMessage: MsgReportCTCSSFreq: %f", report.getFrequency());
 |         //qDebug("NFMDemodGUI::handleMessage: MsgReportCTCSSFreq: %f", report.getFrequency());
 | ||||||
|  | |||||||
| @ -9,7 +9,7 @@ | |||||||
| 
 | 
 | ||||||
| const PluginDescriptor NFMPlugin::m_pluginDescriptor = { | const PluginDescriptor NFMPlugin::m_pluginDescriptor = { | ||||||
| 	QString("NFM Demodulator"), | 	QString("NFM Demodulator"), | ||||||
| 	QString("3.14.5"), | 	QString("3.14.6"), | ||||||
| 	QString("(c) Edouard Griffiths, F4EXB"), | 	QString("(c) Edouard Griffiths, F4EXB"), | ||||||
| 	QString("https://github.com/f4exb/sdrangel"), | 	QString("https://github.com/f4exb/sdrangel"), | ||||||
| 	true, | 	true, | ||||||
|  | |||||||
| @ -49,6 +49,10 @@ void MainBench::run() | |||||||
| 
 | 
 | ||||||
|     if (m_parser.getTestType() == ParserBench::TestDecimatorsII) { |     if (m_parser.getTestType() == ParserBench::TestDecimatorsII) { | ||||||
|         testDecimateII(); |         testDecimateII(); | ||||||
|  |     } else if (m_parser.getTestType() == ParserBench::TestDecimatorsInfII) { | ||||||
|  |         testDecimateII(ParserBench::TestDecimatorsInfII); | ||||||
|  |     } else if (m_parser.getTestType() == ParserBench::TestDecimatorsSupII) { | ||||||
|  |         testDecimateII(ParserBench::TestDecimatorsSupII); | ||||||
|     } else if (m_parser.getTestType() == ParserBench::TestDecimatorsIF) { |     } else if (m_parser.getTestType() == ParserBench::TestDecimatorsIF) { | ||||||
|         testDecimateIF(); |         testDecimateIF(); | ||||||
|     } else if (m_parser.getTestType() == ParserBench::TestDecimatorsFI) { |     } else if (m_parser.getTestType() == ParserBench::TestDecimatorsFI) { | ||||||
| @ -62,7 +66,7 @@ void MainBench::run() | |||||||
|     emit finished(); |     emit finished(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MainBench::testDecimateII() | void MainBench::testDecimateII(ParserBench::TestType testType) | ||||||
| { | { | ||||||
|     QElapsedTimer timer; |     QElapsedTimer timer; | ||||||
|     qint64 nsecs = 0; |     qint64 nsecs = 0; | ||||||
| @ -78,9 +82,25 @@ void MainBench::testDecimateII() | |||||||
| 
 | 
 | ||||||
|     for (uint32_t i = 0; i < m_parser.getRepetition(); i++) |     for (uint32_t i = 0; i < m_parser.getRepetition(); i++) | ||||||
|     { |     { | ||||||
|         timer.start(); |         switch (testType) | ||||||
|         decimateII(buf, m_parser.getNbSamples()*2); |         { | ||||||
|         nsecs += timer.nsecsElapsed(); |         case ParserBench::TestDecimatorsInfII: | ||||||
|  |             timer.start(); | ||||||
|  |             decimateInfII(buf, m_parser.getNbSamples()*2); | ||||||
|  |             nsecs += timer.nsecsElapsed(); | ||||||
|  |             break; | ||||||
|  |         case ParserBench::TestDecimatorsSupII: | ||||||
|  |             timer.start(); | ||||||
|  |             decimateSupII(buf, m_parser.getNbSamples()*2); | ||||||
|  |             nsecs += timer.nsecsElapsed(); | ||||||
|  |             break; | ||||||
|  |         case ParserBench::TestDecimatorsII: | ||||||
|  |         default: | ||||||
|  |             timer.start(); | ||||||
|  |             decimateII(buf, m_parser.getNbSamples()*2); | ||||||
|  |             nsecs += timer.nsecsElapsed(); | ||||||
|  |             break; | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     printResults("MainBench::testDecimateII", nsecs); |     printResults("MainBench::testDecimateII", nsecs); | ||||||
| @ -202,6 +222,70 @@ void MainBench::decimateII(const qint16* buf, int len) | |||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void MainBench::decimateInfII(const qint16* buf, int len) | ||||||
|  | { | ||||||
|  |     SampleVector::iterator it = m_convertBuffer.begin(); | ||||||
|  | 
 | ||||||
|  |     switch (m_parser.getLog2Factor()) | ||||||
|  |     { | ||||||
|  |     case 0: | ||||||
|  |         m_decimatorsII.decimate1(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 1: | ||||||
|  |         m_decimatorsII.decimate2_inf(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 2: | ||||||
|  |         m_decimatorsII.decimate4_inf(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 3: | ||||||
|  |         m_decimatorsII.decimate8_inf(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 4: | ||||||
|  |         m_decimatorsII.decimate16_inf(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 5: | ||||||
|  |         m_decimatorsII.decimate32_inf(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 6: | ||||||
|  |         m_decimatorsII.decimate64_inf(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     default: | ||||||
|  |         break; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void MainBench::decimateSupII(const qint16* buf, int len) | ||||||
|  | { | ||||||
|  |     SampleVector::iterator it = m_convertBuffer.begin(); | ||||||
|  | 
 | ||||||
|  |     switch (m_parser.getLog2Factor()) | ||||||
|  |     { | ||||||
|  |     case 0: | ||||||
|  |         m_decimatorsII.decimate1(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 1: | ||||||
|  |         m_decimatorsII.decimate2_sup(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 2: | ||||||
|  |         m_decimatorsII.decimate4_sup(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 3: | ||||||
|  |         m_decimatorsII.decimate8_sup(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 4: | ||||||
|  |         m_decimatorsII.decimate16_sup(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 5: | ||||||
|  |         m_decimatorsII.decimate32_sup(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     case 6: | ||||||
|  |         m_decimatorsII.decimate64_sup(&it, buf, len); | ||||||
|  |         break; | ||||||
|  |     default: | ||||||
|  |         break; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void MainBench::decimateIF(const qint16* buf, int len) | void MainBench::decimateIF(const qint16* buf, int len) | ||||||
| { | { | ||||||
|     FSampleVector::iterator it = m_convertBufferF.begin(); |     FSampleVector::iterator it = m_convertBufferF.begin(); | ||||||
|  | |||||||
| @ -47,11 +47,13 @@ signals: | |||||||
|     void finished(); |     void finished(); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|     void testDecimateII(); |     void testDecimateII(ParserBench::TestType testType = ParserBench::TestDecimatorsII); | ||||||
|     void testDecimateIF(); |     void testDecimateIF(); | ||||||
|     void testDecimateFI(); |     void testDecimateFI(); | ||||||
|     void testDecimateFF(); |     void testDecimateFF(); | ||||||
|     void decimateII(const qint16 *buf, int len); |     void decimateII(const qint16 *buf, int len); | ||||||
|  |     void decimateInfII(const qint16 *buf, int len); | ||||||
|  |     void decimateSupII(const qint16 *buf, int len); | ||||||
|     void decimateIF(const qint16 *buf, int len); |     void decimateIF(const qint16 *buf, int len); | ||||||
|     void decimateFI(const float *buf, int len); |     void decimateFI(const float *buf, int len); | ||||||
|     void decimateFF(const float *buf, int len); |     void decimateFF(const float *buf, int len); | ||||||
|  | |||||||
| @ -118,8 +118,12 @@ ParserBench::TestType ParserBench::getTestType() const | |||||||
|         return TestDecimatorsFI; |         return TestDecimatorsFI; | ||||||
|     } else if (m_testStr == "decimateff") { |     } else if (m_testStr == "decimateff") { | ||||||
|         return TestDecimatorsFF; |         return TestDecimatorsFF; | ||||||
|     }else if (m_testStr == "decimateif") { |     } else if (m_testStr == "decimateif") { | ||||||
|         return TestDecimatorsIF; |         return TestDecimatorsIF; | ||||||
|  |     } else if (m_testStr == "decimateinfii") { | ||||||
|  |         return TestDecimatorsInfII; | ||||||
|  |     } else if (m_testStr == "decimatesupii") { | ||||||
|  |         return TestDecimatorsSupII; | ||||||
|     } else { |     } else { | ||||||
|         return TestDecimatorsII; |         return TestDecimatorsII; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -29,7 +29,9 @@ public: | |||||||
|         TestDecimatorsII, |         TestDecimatorsII, | ||||||
|         TestDecimatorsIF, |         TestDecimatorsIF, | ||||||
|         TestDecimatorsFI, |         TestDecimatorsFI, | ||||||
|         TestDecimatorsFF |         TestDecimatorsFF, | ||||||
|  |         TestDecimatorsInfII, | ||||||
|  |         TestDecimatorsSupII | ||||||
|     } TestType; |     } TestType; | ||||||
| 
 | 
 | ||||||
|     ParserBench(); |     ParserBench(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user