@@ -11,6 +11,7 @@
#include <set>
#include <cctype>
+#include <iostream>
namespace boost { namespace program_options {
@@ -204,8 +205,7 @@ namespace boost { namespace program_options {
void check_first_occurrence(const boost::any& value)
{
if (!value.empty())
- boost::throw_exception(
- multiple_occurrences());
+ cerr<<"Warning: multiple values submitted for command line option: "<<endl;
}
}
@@ -9,11 +9,11 @@ else()
endif()
configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/git-describe.h.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/git-describe.h.in
${CMAKE_CURRENT_SOURCE_DIR}/git-describe.h)
include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
"${CMAKE_CURRENT_SOURCE_DIR}/..")
if (USE_SYSTEM_BOOST)
@@ -93,30 +93,30 @@ set(SEI_HEADERS
sei/user_data_unregistered.h)
add_library(turing
- Cabac.cpp
- encode.cpp
- psnr.cpp
- TaskEncodeInput.cpp
+ Cabac.cpp
+ encode.cpp
+ psnr.cpp
+ TaskEncodeInput.cpp
decode.cpp
- Encoder.cpp
- Rdoq.cpp
- TaskEncodeOutput.cpp
- DecodeCtu.cpp
- InputQueue.cpp
- Reconstruct.cpp
- TaskEncodeSubstream.cpp
- DecodeRbsp.cpp
- ThreadPool.cpp
+ Encoder.cpp
+ Rdoq.cpp
+ TaskEncodeOutput.cpp
+ DecodeCtu.cpp
+ InputQueue.cpp
+ Reconstruct.cpp
+ TaskEncodeSubstream.cpp
+ DecodeRbsp.cpp
+ ThreadPool.cpp
md5.c
- ScalingMatrices.cpp
- Picture.cpp
- Search.cpp
- sao.cpp
+ ScalingMatrices.cpp
+ Picture.cpp
+ Search.cpp
+ sao.cpp
signature.cpp
- ProgressReporter.cpp
- TaskDeblock.cpp
- testdecode.cpp
- TaskSao.cpp
+ ProgressReporter.cpp
+ TaskDeblock.cpp
+ testdecode.cpp
+ TaskSao.cpp
Aps.h
Binarization.h
BitField.h
@@ -133,7 +133,7 @@ add_library(turing
DecodedPicture.h
Dsp.h
Encoder.h
- EncSao.h
+ EncSao.h
EstimateRate.h
EstimateIntraComplexity.h
FixedPoint.h
@@ -191,7 +191,7 @@ add_library(turing
SyntaxRbsp.hpp
SyntaxSei.h
TaskDeblock.h
- TaskSao.h
+ TaskSao.h
TaskEncodeInput.h
TaskEncodeOutput.h
TaskEncodeSubstream.h
@@ -210,6 +210,13 @@ add_executable (turing-exe main.cpp)
set_target_properties(turing-exe PROPERTIES OUTPUT_NAME turing)
target_link_libraries (turing-exe LINK_PUBLIC turing ${LINK_LIBRARIES})
+if(UNIX)
+ include(FindPkgConfig QUIET)
+ if(PKG_CONFIG_FOUND)
+ configure_file("libturing.pc.in" "libturing.pc" @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libturing.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
+ endif()
+endif()
install(TARGETS turing LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
install(FILES turing.h DESTINATION include)
@@ -102,6 +102,7 @@ function(git_describe _var)
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
#endif()
+ set(ARGN --always)
#message(STATUS "Arguments to execute_process: ${ARGN}")
execute_process(COMMAND
@@ -35,6 +35,7 @@ For more information, contact us at info @ turingcodec.org.
#include <fstream>
#include <memory>
#include <cstring>
+#include <map>
#pragma optimize ("", off)
@@ -241,6 +242,62 @@ const char *gitDescribe()
return (s[0] >= '0' && s[0] <= '9') ? s : "<unknown>";
}
+int turing_check_binary_option(const char *option)
+{
+ map<string, bool> supportedBinaryOptions; // option name and default value
+
+ supportedBinaryOptions["aq"] = false;
+ supportedBinaryOptions["shot-change"] = false;
+ supportedBinaryOptions["field-coding"] = false;
+ supportedBinaryOptions["wpp"] = true;
+ supportedBinaryOptions["repeat-headers"] = true;
+ supportedBinaryOptions["deblock"] = true;
+ supportedBinaryOptions["sao"] = false;
+ supportedBinaryOptions["strong-intra-smoothing"] = true;
+ supportedBinaryOptions["rqt"] = true;
+ supportedBinaryOptions["amp"] = true;
+ supportedBinaryOptions["smp"] = false;
+ supportedBinaryOptions["rdoq"] = true;
+ supportedBinaryOptions["sdh"] = true;
+ supportedBinaryOptions["tskip"] = true;
+ supportedBinaryOptions["fdm"] = true;
+ supportedBinaryOptions["fdam"] = true;
+ supportedBinaryOptions["ecu"] = true;
+ supportedBinaryOptions["esd"] = true;
+ supportedBinaryOptions["cfm"] = true;
+ supportedBinaryOptions["met"] = true;
+ supportedBinaryOptions["aps"] = true;
+ supportedBinaryOptions["rcudepth"] = true;
+ supportedBinaryOptions["sao-slow-mode"] = false;
+ supportedBinaryOptions["no-parallel-processing"] = true;
+
+ string currentOption(option);
+ int isBinaryOption = 0;
+
+ if(currentOption == "no-parallel-processing")
+ {
+ isBinaryOption = 1;
+ }
+ else
+ {
+ // Strip out any no- prefix for disabling-like options
+ const int idx = currentOption.find("no-", 0);
+ if(idx != string::npos)
+ {
+ const int length = currentOption.length() - 3;
+ currentOption = currentOption.substr(idx+3, length);
+ }
+
+ auto optionPresent = supportedBinaryOptions.find(currentOption);
+ if(optionPresent != supportedBinaryOptions.end())
+ {
+ isBinaryOption = 1;
+ }
+ }
+
+ return isBinaryOption;
+}
+
// Review - no need for Encoder and turing_encoder - merge these two?
struct turing_encoder
@@ -442,7 +499,7 @@ struct turing_encoder
const char *turing_version()
{
- return "1.01";
+ return "1.1";
}
new file mode 100644
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: @CMAKE_PROJECT_NAME@
+Description: Turing codec library
+Version: @GIT_DESCRIBE@
+Libs: -L${libdir} -lturing -lhavoc
+Libs.private: -lstdc++ -L@PROJECT_BINARY_DIR@/boost/libs/program_options/src -L@PROJECT_BINARY_DIR@/boost/libs/chrono/src -L@PROJECT_BINARY_DIR@/boost/libs/timer/src -L@PROJECT_BINARY_DIR@/boost/libs/system/src -L@PROJECT_BINARY_DIR@/boost/libs/filesystem/src -lboost_program_options -lboost_timer -lboost_system -lboost_filesystem -lboost_chrono
+Cflags: -I${includedir}
@@ -82,6 +82,8 @@ turing_encoder_output const* turing_encode_picture(turing_encoder *encoder, turi
void turing_destroy_encoder(turing_encoder *encoder);
+int turing_check_binary_option(const char *option);
+
#ifdef __cplusplus
}