diff --git a/mythtv/.cppcheck-suppress b/mythtv/.cppcheck-suppress index dc308804357..b2fb8cf855f 100644 --- a/mythtv/.cppcheck-suppress +++ b/mythtv/.cppcheck-suppress @@ -9,7 +9,6 @@ *:*/filters/* *:*/html/* *:*/libs/libmythfreemheg/* -*:*/libs/libmythfreesurround/* *:*/libs/libmythmpeg2/* *:*/libs/libmythtv/visualisations/goom/* *:*/programs/mythbackend/serviceHosts/* diff --git a/mythtv/CMakeLists.txt b/mythtv/CMakeLists.txt index 9d5c0a22db3..e4b159a374a 100644 --- a/mythtv/CMakeLists.txt +++ b/mythtv/CMakeLists.txt @@ -246,7 +246,6 @@ set_target_properties( mythbase mythdvdnav mythfreemheg - mythfreesurround mythmetadata mythmpeg2 mythprotoserver diff --git a/mythtv/docs/doxygen-architecture-document.cpp b/mythtv/docs/doxygen-architecture-document.cpp index 27cb5a43f4c..dbe17d477d9 100644 --- a/mythtv/docs/doxygen-architecture-document.cpp +++ b/mythtv/docs/doxygen-architecture-document.cpp @@ -97,8 +97,7 @@ There are also a few simple \ref testing "testing shortcuts". and some old UI widgets are implemented by libmyth. This library depends on libav*, \ref libmythbase "libmythbase", - \ref libmythui "libmythui", \ref libmythupnp "libmythupnp" - and libmythfreesurround. + \ref libmythui "libmythui", and \ref libmythupnp "libmythupnp". Any changes to this library's ABI may trigger a %MythTV binary version change because the plugins depend on it. @@ -155,16 +154,6 @@ There are also a few simple \ref testing "testing shortcuts". This library does not depend on any of our libraries. -
libmythfreesurround -
Support for some multi-channel audio transforms. - - This library does not depend on any of our libraries. - -
libmythnvctrl -
Interface between X-windows and NVidia drivers. - - This library does not depend on any of our libraries. - The libmythmpeg2 library appears redundant with the system libsamplerate, but libmpeg2 decodes MPEG-2 more quickly than ffmpeg on some systems, and diff --git a/mythtv/libs/CMakeLists.txt b/mythtv/libs/CMakeLists.txt index ccaa184cbb8..ae88a9ae824 100644 --- a/mythtv/libs/CMakeLists.txt +++ b/mythtv/libs/CMakeLists.txt @@ -1,5 +1,4 @@ add_subdirectory(libmythbase) -add_subdirectory(libmythfreesurround) add_subdirectory(libmythservicecontracts) if(TARGET mythtv_mheg) add_subdirectory(libmythfreemheg) diff --git a/mythtv/libs/libmyth/CMakeLists.txt b/mythtv/libs/libmyth/CMakeLists.txt index 538fc348fcb..5861fdaea83 100644 --- a/mythtv/libs/libmyth/CMakeLists.txt +++ b/mythtv/libs/libmyth/CMakeLists.txt @@ -43,6 +43,8 @@ set(AUDIO_HEADERS_NOT_INSTALLED audio/audiooutputdownmix.h audio/audiooutputgraph.h audio/audiooutputnull.h + audio/freesurround.h + audio/freesurround_decoder.h audio/pink.h audio/spdifencoder.h) @@ -68,6 +70,8 @@ add_library( audio/audiooutpututil.cpp audio/audiosettings.cpp audio/eldutils.cpp + audio/freesurround.cpp + audio/freesurround_decoder.cpp audio/pink.cpp audio/spdifencoder.cpp audio/volumebase.cpp @@ -178,7 +182,6 @@ target_link_libraries( PUBLIC mythbase mythui mythupnp - mythfreesurround mythbluray PkgConfig::LIBAVCODEC PkgConfig::LIBAVFORMAT diff --git a/mythtv/libs/libmyth/audio/audiooutputbase.cpp b/mythtv/libs/libmyth/audio/audiooutputbase.cpp index 8c311f40234..8fddd9aa3d7 100644 --- a/mythtv/libs/libmyth/audio/audiooutputbase.cpp +++ b/mythtv/libs/libmyth/audio/audiooutputbase.cpp @@ -22,12 +22,12 @@ #include "libmythbase/compat.h" #include "libmythbase/mythconfig.h" #include "libmythbase/mythlogging.h" -#include "libmythfreesurround/freesurround.h" #include "audiooutputbase.h" #include "audiooutputdigitalencoder.h" #include "audiooutputdownmix.h" #include "audiooutpututil.h" +#include "freesurround.h" #include "spdifencoder.h" // AC3 encode currently disabled for Android diff --git a/mythtv/libs/libmythfreesurround/freesurround.cpp b/mythtv/libs/libmyth/audio/freesurround.cpp similarity index 97% rename from mythtv/libs/libmythfreesurround/freesurround.cpp rename to mythtv/libs/libmyth/audio/freesurround.cpp index b85cd0d0c7b..ce6b9775fb0 100644 --- a/mythtv/libs/libmythfreesurround/freesurround.cpp +++ b/mythtv/libs/libmyth/audio/freesurround.cpp @@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "freesurround.h" #include #include @@ -29,14 +30,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include -#include "libmythbase/compat.h" #include "libmythbase/mythlogging.h" -#include "freesurround.h" -#include "el_processor.h" - #include -#include + +#include "freesurround_decoder.h" // our default internal block size, in floats static const unsigned default_block_size = SURROUND_BUFSIZE; @@ -129,13 +127,6 @@ void FreeSurround::SetParams() } } -FreeSurround::fsurround_params::fsurround_params(int32_t center_width, - int32_t dimension) : - center_width(center_width), - dimension(dimension) -{ -} - FreeSurround::~FreeSurround() { LOG(VB_AUDIO, LOG_DEBUG, QString("FreeSurround::~FreeSurround")); @@ -154,10 +145,6 @@ uint FreeSurround::putFrames(void* buffer, uint numFrames, uint numChannels) auto *samples = (float *)buffer; // demultiplex - float **inputs = m_decoder->getInputBuffers(); - float *lt = &inputs[0][ic]; - float *rt = &inputs[1][ic]; - if ((m_surroundMode != SurroundModePassive) && (ic+numFrames > bs)) { numFrames = bs - ic; @@ -180,6 +167,9 @@ uint FreeSurround::putFrames(void* buffer, uint numFrames, uint numChannels) process = false; break; default: + float **inputs = m_decoder->getInputBuffers(); + float *lt = &inputs[0][ic]; + float *rt = &inputs[1][ic]; for (i=0; igetInputBuffers(); + float *lt = &inputs[0][ic]; + float *rt = &inputs[1][ic]; for (i=0; i + +using uint = unsigned int; static constexpr uint16_t SURROUND_BUFSIZE { 8192 }; -class Q_DECL_EXPORT FreeSurround +class FreeSurround { public: enum SurroundMode : std::uint8_t @@ -61,16 +63,14 @@ class Q_DECL_EXPORT FreeSurround // the changeable parameters struct fsurround_params { - int32_t center_width; // presence of the center channel - int32_t dimension; // dimension + int32_t center_width { 100 }; // presence of the center channel + int32_t dimension { 0 }; // dimension float coeff_a { 0.8165 }; // surround mixing coefficients float coeff_b { 0.5774 }; // surround mixing coefficients int32_t phasemode { 0 }; // phase shifting mode int32_t steering { 1 }; // steering mode (0=simple, 1=linear) int32_t front_sep { 100 }; // front stereo separation int32_t rear_sep { 100 }; // rear stereo separation - // (default) constructor - explicit fsurround_params(int32_t center_width=100, int32_t dimension=0); } m_params; // additional settings diff --git a/mythtv/libs/libmythfreesurround/el_processor.cpp b/mythtv/libs/libmyth/audio/freesurround_decoder.cpp similarity index 98% rename from mythtv/libs/libmythfreesurround/el_processor.cpp rename to mythtv/libs/libmyth/audio/freesurround_decoder.cpp index a2660f75e37..764853a5fd1 100644 --- a/mythtv/libs/libmythfreesurround/el_processor.cpp +++ b/mythtv/libs/libmyth/audio/freesurround_decoder.cpp @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "freesurround_decoder.h" -#include "el_processor.h" #include #include #include @@ -278,13 +278,6 @@ class fsurround_decoder::Impl { } else { // --- this is the old & simple steering mode --- - // calculate the amplitude/phase difference - float ampDiff = clamp_unit_mag((ampL+ampR < epsilon) ? 0 : (ampR-ampL) / (ampR+ampL)); - float phaseDiff = phaseL - phaseR; - if (phaseDiff < -PI) phaseDiff += 2*PI; - if (phaseDiff > PI) phaseDiff -= 2*PI; - phaseDiff = abs(phaseDiff); - // determine sound field x-position m_xFs[f] = ampDiff; diff --git a/mythtv/libs/libmythfreesurround/el_processor.h b/mythtv/libs/libmyth/audio/freesurround_decoder.h similarity index 97% rename from mythtv/libs/libmythfreesurround/el_processor.h rename to mythtv/libs/libmyth/audio/freesurround_decoder.h index 161781a8304..55506e2d8f5 100644 --- a/mythtv/libs/libmythfreesurround/el_processor.h +++ b/mythtv/libs/libmyth/audio/freesurround_decoder.h @@ -16,8 +16,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef EL_PROCESSOR_H -#define EL_PROCESSOR_H +#ifndef FREESURROUND_DECODER_H +#define FREESURROUND_DECODER_H // the Free Surround decoder class fsurround_decoder { diff --git a/mythtv/libs/libmyth/libmyth.pro b/mythtv/libs/libmyth/libmyth.pro index a84c6f0e386..20efa02c04d 100644 --- a/mythtv/libs/libmyth/libmyth.pro +++ b/mythtv/libs/libmyth/libmyth.pro @@ -36,6 +36,8 @@ HEADERS += audio/audiooutputdigitalencoder.h audio/spdifencoder.h HEADERS += audio/audiosettings.h audio/audiooutputsettings.h audio/pink.h HEADERS += audio/volumebase.h audio/eldutils.h HEADERS += audio/audiooutputgraph.h +HEADERS += audio/freesurround.h +HEADERS += audio/freesurround_decoder.h HEADERS += backendselect.h dbsettings.h HEADERS += langsettings.h HEADERS += @@ -59,6 +61,8 @@ SOURCES += audio/audioconvert.cpp SOURCES += audio/audiosettings.cpp audio/audiooutputsettings.cpp audio/pink.cpp SOURCES += audio/volumebase.cpp audio/eldutils.cpp SOURCES += audio/audiooutputgraph.cpp +SOURCES += audio/freesurround.cpp +SOURCES += audio/freesurround_decoder.cpp SOURCES += backendselect.cpp dbsettings.cpp SOURCES += langsettings.cpp SOURCES += @@ -80,7 +84,6 @@ INCLUDEPATH += $${POSTINC} LIBS += -L../libmythbase -lmythbase-$${LIBVERSION} LIBS += -L../libmythui -lmythui-$${LIBVERSION} LIBS += -L../libmythupnp -lmythupnp-$${LIBVERSION} -LIBS += -L../libmythfreesurround -lmythfreesurround-$${LIBVERSION} LIBS += -L../../external/FFmpeg/libswresample -lmythswresample LIBS += -L../../external/FFmpeg/libavutil -lmythavutil LIBS += -L../../external/FFmpeg/libavcodec -lmythavcodec @@ -97,7 +100,6 @@ LIBS += -L../libmythservicecontracts -lmythservicecontracts-$${LIBVERSIO POST_TARGETDEPS += ../../external/FFmpeg/libswresample/$$avLibName(swresample) POST_TARGETDEPS += ../../external/FFmpeg/libavutil/$$avLibName(avutil) POST_TARGETDEPS += ../../external/FFmpeg/libavcodec/$$avLibName(avcodec) - POST_TARGETDEPS += ../libmythfreesurround/libmythfreesurround-$${MYTH_LIB_EXT} } # Install headers so that plugins can compile independently diff --git a/mythtv/libs/libmythfreesurround/CMakeLists.txt b/mythtv/libs/libmythfreesurround/CMakeLists.txt deleted file mode 100644 index 116021b91f2..00000000000 --- a/mythtv/libs/libmythfreesurround/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -add_library(mythfreesurround el_processor.cpp el_processor.h freesurround.cpp - freesurround.h) - -target_compile_options(mythfreesurround PRIVATE -Wno-shadow) - -target_include_directories( - mythfreesurround - PUBLIC $ - INTERFACE $) - -target_link_libraries(mythfreesurround PUBLIC PkgConfig::LIBAVCODEC - PkgConfig::LIBAVUTIL mythbase) - -install(TARGETS mythfreesurround LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/mythtv/libs/libmythfreesurround/libmythfreesurround.pro b/mythtv/libs/libmythfreesurround/libmythfreesurround.pro deleted file mode 100644 index 048b7f4de08..00000000000 --- a/mythtv/libs/libmythfreesurround/libmythfreesurround.pro +++ /dev/null @@ -1,24 +0,0 @@ -include ( ../../settings.pro ) - -TEMPLATE = lib -TARGET = mythfreesurround-$$LIBVERSION -CONFIG += thread staticlib warn_off - -INCLUDEPATH += .. ../../external/FFmpeg - -QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2) - -# Input -HEADERS += el_processor.h -HEADERS += freesurround.h - -SOURCES += el_processor.cpp -SOURCES += freesurround.cpp - -DEPENDPATH += ../.. ../../external/FFmpeg -LIBS += -L../libavcodec -L../libavcore -L../libavutil -LIBS += -lavcodec -lavcore -lavutil - -LIBS += $$EXTRA_LIBS - -include ( ../libs-targetfix.pro ) diff --git a/mythtv/libs/libmythmetadata/CMakeLists.txt b/mythtv/libs/libmythmetadata/CMakeLists.txt index e3556666a35..6b8e87b7472 100644 --- a/mythtv/libs/libmythmetadata/CMakeLists.txt +++ b/mythtv/libs/libmythmetadata/CMakeLists.txt @@ -107,7 +107,6 @@ target_link_libraries( mythbase mythui mythservicecontracts - mythfreesurround mythtv myth) diff --git a/mythtv/libs/libmythmetadata/libmythmetadata.pro b/mythtv/libs/libmythmetadata/libmythmetadata.pro index 65520e74bc8..6d2b0fe09d2 100644 --- a/mythtv/libs/libmythmetadata/libmythmetadata.pro +++ b/mythtv/libs/libmythmetadata/libmythmetadata.pro @@ -45,7 +45,6 @@ INCLUDEPATH += $${CONFIG_TAGLIB_INCLUDES} LIBS += -L../libmythbase -lmythbase-$${LIBVERSION} LIBS += -L../libmythui -lmythui-$${LIBVERSION} LIBS += -L../libmythservicecontracts -lmythservicecontracts-$${LIBVERSION} -LIBS += -L../libmythfreesurround -lmythfreesurround-$${LIBVERSION} LIBS += -L../../external/FFmpeg/libswresample -lmythswresample LIBS += -L../../external/FFmpeg/libavutil -lmythavutil LIBS += -L../../external/FFmpeg/libavcodec -lmythavcodec diff --git a/mythtv/libs/libs.pro b/mythtv/libs/libs.pro index 272e04369e1..4c09c260eb9 100644 --- a/mythtv/libs/libs.pro +++ b/mythtv/libs/libs.pro @@ -3,7 +3,7 @@ include (../settings.pro) TEMPLATE = subdirs # Libraries without dependencies -SUBDIRS += libmythfreesurround libmythbase +SUBDIRS += libmythbase SUBDIRS += libmythservicecontracts libmythservicecontracts.depends = libmythbase @@ -16,7 +16,6 @@ SUBDIRS += libmythui libmythupnp libmyth libmythui.depends = libmythbase libmythupnp.depends = libmythbase libmythservicecontracts libmyth.depends = libmythbase libmythui libmythupnp -libmyth.depends += libmythfreesurround LIBMYTHTVDEPS = $$SUBDIRS