From patchwork Thu Dec 1 11:54:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matteo Naccari X-Patchwork-Id: 1627 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp885527vsa; Thu, 1 Dec 2016 03:53:01 -0800 (PST) X-Received: by 10.28.138.135 with SMTP id m129mr31281294wmd.36.1480593181376; Thu, 01 Dec 2016 03:53:01 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o76si371759wmi.60.2016.12.01.03.53.00; Thu, 01 Dec 2016 03:53:01 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B8437689DED; Thu, 1 Dec 2016 13:52:50 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from gateh.kw.bbc.co.uk (gateh.kw.bbc.co.uk [132.185.132.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6617C6891FC for ; Thu, 1 Dec 2016 13:52:44 +0200 (EET) Received: from mailhub1.rd.bbc.co.uk ([172.29.120.129]) by gateh.kw.bbc.co.uk (8.14.5+Sun/8.13.6) with ESMTP id uB1Bqo3t026799; Thu, 1 Dec 2016 11:52:50 GMT Received: from rd000024.rd.bbc.co.uk ([172.29.145.86]:42394) by mailhub1.rd.bbc.co.uk with esmtp (Exim 4.84_2) (envelope-from ) id 1cCPv0-00031l-Fe; Thu, 01 Dec 2016 11:52:50 +0000 From: Matteo Naccari To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 Dec 2016 11:54:58 +0000 Message-Id: <1480593298-26493-1-git-send-email-matteo.naccari@bbc.co.uk> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1480439929-14276-1> References: <1480439929-14276-1> Subject: [FFmpeg-devel] [PATCH] Fixes for ffmpeg and editorial typos X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Matteo Naccari MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" - The libturing.pc file is added in CMAKE_INSTALL_PREFIX/lib/pkgconfig and contains some CMAKE variables which get expanded during installation - Fixed some editorial typos and trailing space - Fixed version numbering in the std output - Added function to check for binary option as passed when calling the codec from FFmpeg - Modified boost program options so that an option can be repeated multiple times and only the last value is used --- boost/libs/program_options/src/value_semantic.cpp | 4 +- turing/CMakeLists.txt | 57 ++++++++++++---------- turing/GetGitRevisionDescription.cmake | 1 + turing/encode.cpp | 59 ++++++++++++++++++++++- turing/libturing.pc.in | 11 +++++ turing/turing.h | 2 + 6 files changed, 106 insertions(+), 28 deletions(-) create mode 100644 turing/libturing.pc.in diff --git a/boost/libs/program_options/src/value_semantic.cpp b/boost/libs/program_options/src/value_semantic.cpp index d35d17d..fe129c2 100644 --- a/boost/libs/program_options/src/value_semantic.cpp +++ b/boost/libs/program_options/src/value_semantic.cpp @@ -11,6 +11,7 @@ #include #include +#include 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: "< #include #include +#include #pragma optimize ("", off) @@ -241,6 +242,62 @@ const char *gitDescribe() return (s[0] >= '0' && s[0] <= '9') ? s : ""; } +int turing_check_binary_option(const char *option) +{ + map 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"; } diff --git a/turing/libturing.pc.in b/turing/libturing.pc.in new file mode 100644 index 0000000..83d6de7 --- /dev/null +++ b/turing/libturing.pc.in @@ -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} diff --git a/turing/turing.h b/turing/turing.h index 13c4e6b..e839412 100644 --- a/turing/turing.h +++ b/turing/turing.h @@ -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 }