From 527deef6f18c46badb396e4520d802333997add2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 25 Mar 2015 00:41:05 +0000 Subject: [PATCH] Remove Scaler config and use SWS_BICUBIC everywhere. --- ChangeLog | 2 + src/lib/config.cc | 1 - src/lib/dcp_video.cc | 3 +- src/lib/film.cc | 12 --- src/lib/film.h | 9 --- src/lib/image.cc | 11 +-- src/lib/image.h | 5 +- src/lib/player.cc | 6 +- src/lib/player_video.cc | 8 +- src/lib/player_video.h | 3 - src/lib/scaler.cc | 118 ------------------------------ src/lib/scaler.h | 73 ------------------ src/lib/server.cc | 1 - src/lib/util.cc | 2 - src/lib/wscript | 1 - src/tools/dcpomatic.cc | 4 +- src/tools/dcpomatic_batch.cc | 6 +- src/tools/dcpomatic_cli.cc | 3 +- src/tools/dcpomatic_server_cli.cc | 2 - src/tools/server_test.cc | 4 +- src/wx/config_dialog.cc | 1 - src/wx/dcp_panel.cc | 33 +-------- src/wx/dcp_panel.h | 2 - src/wx/film_viewer.cc | 3 +- test/client_server_test.cc | 3 - test/image_test.cc | 7 +- test/make_black_test.cc | 3 +- 27 files changed, 24 insertions(+), 302 deletions(-) delete mode 100644 src/lib/scaler.cc delete mode 100644 src/lib/scaler.h diff --git a/ChangeLog b/ChangeLog index 3a67b0aa7..46ccc9122 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2015-03-25 Carl Hetherington + * Remove scaler settings and just uses SWS_BICUBIC all round. + * Hand-apply ec3e6abf817b84d589f0782b01f5059dd3bf0953; only allow even DCP audio channel counts between 2 and 16 inclusive. diff --git a/src/lib/config.cc b/src/lib/config.cc index 94d8a69a2..bf70f95ac 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -19,7 +19,6 @@ #include "config.h" #include "server.h" -#include "scaler.h" #include "filter.h" #include "ratio.h" #include "dcp_content_type.h" diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index a302c43e6..a2668c4a7 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington Taken from code Copyright (C) 2010-2011 Terrence Meiczinger This program is free software; you can redistribute it and/or modify @@ -33,7 +33,6 @@ #include "exceptions.h" #include "server.h" #include "dcpomatic_socket.h" -#include "scaler.h" #include "image.h" #include "log.h" #include "cross.h" diff --git a/src/lib/film.cc b/src/lib/film.cc index ed7d4cb51..e5904ca1e 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -31,7 +31,6 @@ #include "log.h" #include "exceptions.h" #include "examine_content_job.h" -#include "scaler.h" #include "config.h" #include "ui_signaller.h" #include "playlist.h" @@ -120,7 +119,6 @@ Film::Film (boost::filesystem::path dir, bool log) , _dcp_content_type (Config::instance()->default_dcp_content_type ()) , _container (Config::instance()->default_container ()) , _resolution (RESOLUTION_2K) - , _scaler (Scaler::from_id ("bicubic")) , _signed (true) , _encrypted (false) , _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ()) @@ -186,7 +184,6 @@ Film::video_identifier () const << "_" << resolution_to_string (_resolution) << "_" << _playlist->video_identifier() << "_" << _video_frame_rate - << "_" << scaler()->id() << "_" << j2k_bandwidth(); if (encrypted ()) { @@ -359,7 +356,6 @@ Film::metadata () const } root->add_child("Resolution")->add_child_text (resolution_to_string (_resolution)); - root->add_child("Scaler")->add_child_text (_scaler->id ()); root->add_child("J2KBandwidth")->add_child_text (raw_convert (_j2k_bandwidth)); _isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata")); root->add_child("VideoFrameRate")->add_child_text (raw_convert (_video_frame_rate)); @@ -431,7 +427,6 @@ Film::read_metadata () } _resolution = string_to_resolution (f.string_child ("Resolution")); - _scaler = Scaler::from_id (f.string_child ("Scaler")); _j2k_bandwidth = f.number_child ("J2KBandwidth"); _video_frame_rate = f.number_child ("VideoFrameRate"); _signed = f.optional_bool_child("Signed").get_value_or (true); @@ -735,13 +730,6 @@ Film::set_resolution (Resolution r) signal_changed (RESOLUTION); } -void -Film::set_scaler (Scaler const * s) -{ - _scaler = s; - signal_changed (SCALER); -} - void Film::set_j2k_bandwidth (int b) { diff --git a/src/lib/film.h b/src/lib/film.h index c3ab9f2ff..3d1c02c93 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -45,7 +45,6 @@ class Content; class Player; class Playlist; class AudioContent; -class Scaler; class Screen; struct isdcf_name_test; @@ -159,7 +158,6 @@ public: DCP_CONTENT_TYPE, CONTAINER, RESOLUTION, - SCALER, SIGNED, ENCRYPTED, J2K_BANDWIDTH, @@ -201,10 +199,6 @@ public: return _resolution; } - Scaler const * scaler () const { - return _scaler; - } - /* signed is a reserved word */ bool is_signed () const { return _signed; @@ -262,7 +256,6 @@ public: void set_dcp_content_type (DCPContentType const *); void set_container (Ratio const *); void set_resolution (Resolution); - void set_scaler (Scaler const *); void set_signed (bool); void set_encrypted (bool); void set_j2k_bandwidth (int); @@ -314,8 +307,6 @@ private: Ratio const * _container; /** DCP resolution (2K or 4K) */ Resolution _resolution; - /** Scaler algorithm to use */ - Scaler const * _scaler; bool _signed; bool _encrypted; /** bandwidth for J2K files in bits per second */ diff --git a/src/lib/image.cc b/src/lib/image.cc index 2085b54ee..177219813 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -23,7 +23,6 @@ #include "image.h" #include "exceptions.h" -#include "scaler.h" #include "timer.h" #include "rect.h" #include "util.h" @@ -88,9 +87,8 @@ Image::components () const /** Crop this image, scale it to `inter_size' and then place it in a black frame of `out_size' */ shared_ptr -Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_format, bool out_aligned) const +Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, AVPixelFormat out_format, bool out_aligned) const { - DCPOMATIC_ASSERT (scaler); /* Empirical testing suggests that sws_scale() will crash if the input image is not aligned. */ @@ -110,7 +108,7 @@ Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, S struct SwsContext* scale_context = sws_getContext ( cropped_size.width, cropped_size.height, pixel_format(), inter_size.width, inter_size.height, out_format, - scaler->ffmpeg_id (), 0, 0, 0 + SWS_BICUBIC, 0, 0, 0 ); if (!scale_context) { @@ -144,9 +142,8 @@ Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, S } shared_ptr -Image::scale (dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_format, bool out_aligned) const +Image::scale (dcp::Size out_size, AVPixelFormat out_format, bool out_aligned) const { - DCPOMATIC_ASSERT (scaler); /* Empirical testing suggests that sws_scale() will crash if the input image is not aligned. */ @@ -157,7 +154,7 @@ Image::scale (dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_forma struct SwsContext* scale_context = sws_getContext ( size().width, size().height, pixel_format(), out_size.width, out_size.height, out_format, - scaler->ffmpeg_id (), 0, 0, 0 + SWS_BICUBIC, 0, 0, 0 ); sws_scale ( diff --git a/src/lib/image.h b/src/lib/image.h index b929f4dfc..2e90a89e9 100644 --- a/src/lib/image.h +++ b/src/lib/image.h @@ -35,7 +35,6 @@ extern "C" { #include #include -class Scaler; class Socket; class Image @@ -58,10 +57,10 @@ public: int line_factor (int) const; int lines (int) const; - boost::shared_ptr scale (dcp::Size, Scaler const *, AVPixelFormat, bool aligned) const; + boost::shared_ptr scale (dcp::Size, AVPixelFormat, bool aligned) const; boost::shared_ptr crop (Crop c, bool aligned) const; - boost::shared_ptr crop_scale_window (Crop c, dcp::Size, dcp::Size, Scaler const *, AVPixelFormat, bool aligned) const; + boost::shared_ptr crop_scale_window (Crop c, dcp::Size, dcp::Size, AVPixelFormat, bool aligned) const; void make_black (); void make_transparent (); diff --git a/src/lib/player.cc b/src/lib/player.cc index c9c7de420..e3c85ee56 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -36,7 +36,6 @@ #include "raw_image_proxy.h" #include "ratio.h" #include "log.h" -#include "scaler.h" #include "render_subtitles.h" #include "config.h" #include "content_video.h" @@ -247,7 +246,7 @@ Player::film_changed (Film::Property p) last time we were run. */ - if (p == Film::SCALER || p == Film::CONTAINER || p == Film::VIDEO_FRAME_RATE) { + if (p == Film::CONTAINER || p == Film::VIDEO_FRAME_RATE) { Changed (false); } } @@ -281,7 +280,6 @@ Player::transform_image_subtitles (list subs) const PositionImage ( i->image->scale ( scaled_size, - Scaler::from_id ("bicubic"), i->image->pixel_format (), true ), @@ -313,7 +311,6 @@ Player::black_player_video_frame (DCPTime time) const optional (), _video_container_size, _video_container_size, - Scaler::from_id ("bicubic"), EYES_BOTH, PART_WHOLE, Config::instance()->colour_conversions().front().conversion @@ -366,7 +363,6 @@ Player::get_video (DCPTime time, bool accurate) content->fade (i->frame), image_size, _video_container_size, - _film->scaler(), i->eyes, i->part, content->colour_conversion () diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index ccd52ea67..f9f06f63a 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -22,7 +22,6 @@ #include "image.h" #include "image_proxy.h" #include "j2k_image_proxy.h" -#include "scaler.h" #include "film.h" using std::string; @@ -39,7 +38,6 @@ PlayerVideo::PlayerVideo ( boost::optional fade, dcp::Size inter_size, dcp::Size out_size, - Scaler const * scaler, Eyes eyes, Part part, optional colour_conversion @@ -50,7 +48,6 @@ PlayerVideo::PlayerVideo ( , _fade (fade) , _inter_size (inter_size) , _out_size (out_size) - , _scaler (scaler) , _eyes (eyes) , _part (part) , _colour_conversion (colour_conversion) @@ -66,7 +63,6 @@ PlayerVideo::PlayerVideo (shared_ptr node, shared_ptr socket _inter_size = dcp::Size (node->number_child ("InterWidth"), node->number_child ("InterHeight")); _out_size = dcp::Size (node->number_child ("OutWidth"), node->number_child ("OutHeight")); - _scaler = Scaler::from_id (node->string_child ("Scaler")); _eyes = (Eyes) node->number_child ("Eyes"); _part = (Part) node->number_child ("Part"); @@ -116,7 +112,7 @@ PlayerVideo::image (AVPixelFormat pixel_format, bool burn_subtitle, dcp::NoteHan break; } - shared_ptr out = im->crop_scale_window (total_crop, _inter_size, _out_size, _scaler, pixel_format, true); + shared_ptr out = im->crop_scale_window (total_crop, _inter_size, _out_size, pixel_format, true); if (burn_subtitle && _subtitle.image) { out->alpha_blend (_subtitle.image, _subtitle.position); @@ -142,7 +138,6 @@ PlayerVideo::add_metadata (xmlpp::Node* node, bool send_subtitles) const node->add_child("InterHeight")->add_child_text (raw_convert (_inter_size.height)); node->add_child("OutWidth")->add_child_text (raw_convert (_out_size.width)); node->add_child("OutHeight")->add_child_text (raw_convert (_out_size.height)); - node->add_child("Scaler")->add_child_text (_scaler->id ()); node->add_child("Eyes")->add_child_text (raw_convert (_eyes)); node->add_child("Part")->add_child_text (raw_convert (_part)); if (_colour_conversion) { @@ -203,7 +198,6 @@ PlayerVideo::same (shared_ptr other) const _fade.get_value_or(0) != other->_fade.get_value_or(0) || _inter_size != other->_inter_size || _out_size != other->_out_size || - _scaler != other->_scaler || _eyes != other->_eyes || _part != other->_part || _colour_conversion != other->_colour_conversion || diff --git a/src/lib/player_video.h b/src/lib/player_video.h index 6762ea8d1..c4537f713 100644 --- a/src/lib/player_video.h +++ b/src/lib/player_video.h @@ -28,7 +28,6 @@ extern "C" { class Image; class ImageProxy; -class Scaler; class Socket; class EncodedData; @@ -46,7 +45,6 @@ public: boost::optional, dcp::Size, dcp::Size, - Scaler const *, Eyes, Part, boost::optional @@ -93,7 +91,6 @@ private: boost::optional _fade; dcp::Size _inter_size; dcp::Size _out_size; - Scaler const * _scaler; Eyes _eyes; Part _part; boost::optional _colour_conversion; diff --git a/src/lib/scaler.cc b/src/lib/scaler.cc deleted file mode 100644 index 43c1ac81c..000000000 --- a/src/lib/scaler.cc +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - 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., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -/** @file src/scaler.cc - * @brief A class to describe one of FFmpeg's software scalers. - */ - -#include "dcpomatic_assert.h" -#include "scaler.h" -extern "C" { -#include -} -#include -#include - -#include "i18n.h" - -using namespace std; - -vector Scaler::_scalers; - -/** @param f FFmpeg id. - * @param i Our id. - * @param n User-visible name. - */ -Scaler::Scaler (int f, string i, string n) - : _ffmpeg_id (f) - , _id (i) - , _name (n) -{ - -} - -/** @return All available scalers */ -vector -Scaler::all () -{ - return _scalers; -} - -/** Set up the static _scalers vector; must be called before from_* - * methods are used. - */ -void -Scaler::setup_scalers () -{ - _scalers.push_back (new Scaler (SWS_BICUBIC, N_("bicubic"), _("Bicubic"))); - _scalers.push_back (new Scaler (SWS_X, N_("x"), _("X"))); - _scalers.push_back (new Scaler (SWS_AREA, N_("area"), _("Area"))); - _scalers.push_back (new Scaler (SWS_GAUSS, N_("gauss"), _("Gaussian"))); - _scalers.push_back (new Scaler (SWS_LANCZOS, N_("lanczos"), _("Lanczos"))); - _scalers.push_back (new Scaler (SWS_SINC, N_("sinc"), _("Sinc"))); - _scalers.push_back (new Scaler (SWS_SPLINE, N_("spline"), _("Spline"))); - _scalers.push_back (new Scaler (SWS_BILINEAR, N_("bilinear"), _("Bilinear"))); - _scalers.push_back (new Scaler (SWS_FAST_BILINEAR, N_("fastbilinear"), _("Fast Bilinear"))); -} - -/** @param id One of our ids. - * @return Corresponding scaler, or 0. - */ -Scaler const * -Scaler::from_id (string id) -{ - vector::iterator i = _scalers.begin (); - while (i != _scalers.end() && (*i)->id() != id) { - ++i; - } - - if (i == _scalers.end ()) { - return 0; - } - - return *i; -} - -/** @param s A scaler from our static list. - * @return Index of the scaler with the list, or -1. - */ -int -Scaler::as_index (Scaler const * s) -{ - vector::size_type i = 0; - while (i < _scalers.size() && _scalers[i] != s) { - ++i; - } - - if (i == _scalers.size ()) { - return -1; - } - - return i; -} - -/** @param i An index returned from as_index(). - * @return Corresponding scaler. - */ -Scaler const * -Scaler::from_index (int i) -{ - DCPOMATIC_ASSERT (i <= int(_scalers.size ())); - return _scalers[i]; -} diff --git a/src/lib/scaler.h b/src/lib/scaler.h deleted file mode 100644 index 0f0bcb1aa..000000000 --- a/src/lib/scaler.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - Copyright (C) 2012 Carl Hetherington - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - 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., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -/** @file src/scaler.h - * @brief A class to describe one of FFmpeg's software scalers. - */ - -#ifndef DCPOMATIC_SCALER_H -#define DCPOMATIC_SCALER_H - -#include -#include -#include - -/** @class Scaler - * @brief Class to describe one of FFmpeg's software scalers - */ -class Scaler : public boost::noncopyable -{ -public: - Scaler (int f, std::string i, std::string n); - - /** @return id used for calls to FFmpeg's sws_getContext */ - int ffmpeg_id () const { - return _ffmpeg_id; - } - - /** @return id for our use */ - std::string id () const { - return _id; - } - - /** @return user-visible name for this scaler */ - std::string name () const { - return _name; - } - - static std::vector all (); - static void setup_scalers (); - static Scaler const * from_id (std::string id); - static Scaler const * from_index (int); - static int as_index (Scaler const *); - -private: - - /** id used for calls to FFmpeg's pp_postprocess */ - int _ffmpeg_id; - /** id for our use */ - std::string _id; - /** user-visible name for this scaler */ - std::string _name; - - /** all available scalers */ - static std::vector _scalers; -}; - -#endif diff --git a/src/lib/server.cc b/src/lib/server.cc index 32e1e38b2..ba8580732 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -24,7 +24,6 @@ #include "server.h" #include "dcpomatic_socket.h" -#include "scaler.h" #include "image.h" #include "dcp_video.h" #include "config.h" diff --git a/src/lib/util.cc b/src/lib/util.cc index 2b5eb69fb..6ebdc85d4 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -23,7 +23,6 @@ #include "util.h" #include "exceptions.h" -#include "scaler.h" #include "dcp_content_type.h" #include "filter.h" #include "cinema_sound_processor.h" @@ -327,7 +326,6 @@ dcpomatic_setup () Ratio::setup_ratios (); VideoContentScale::setup_scales (); DCPContentType::setup_dcp_content_types (); - Scaler::setup_scalers (); Filter::setup_filters (); CinemaSoundProcessor::setup_cinema_sound_processors (); AudioProcessor::setup_audio_processors (); diff --git a/src/lib/wscript b/src/lib/wscript index 217c0c86d..24aa7c134 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -74,7 +74,6 @@ sources = """ resampler.cc safe_stringstream.cc scp_dcp_job.cc - scaler.cc scoped_temporary.cc send_kdm_email_job.cc send_problem_report_job.cc diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 19f2861c4..d0b6faecb 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -787,12 +787,12 @@ private: /* Enable i18n; this will create a Config object to look for a force-configured language. This Config object will be wrong, however, because dcpomatic_setup - hasn't yet been called and there aren't any scalers, filters etc. + hasn't yet been called and there aren't any filters etc. set up yet. */ dcpomatic_setup_i18n (); - /* Set things up, including scalers / filters etc. + /* Set things up, including filters etc. which will now be internationalised correctly. */ dcpomatic_setup (); diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index b92ca5d71..da8a61414 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2014 Carl Hetherington + Copyright (C) 2013-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -205,12 +205,12 @@ class App : public wxApp /* Enable i18n; this will create a Config object to look for a force-configured language. This Config object will be wrong, however, because dcpomatic_setup - hasn't yet been called and there aren't any scalers, filters etc. + hasn't yet been called and there aren't any filters etc. set up yet. */ dcpomatic_setup_i18n (); - /* Set things up, including scalers / filters etc. + /* Set things up, including filters etc. which will now be internationalised correctly. */ dcpomatic_setup (); diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index e187e573e..4facdd4d1 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,7 +26,6 @@ #include "lib/transcode_job.h" #include "lib/job_manager.h" #include "lib/util.h" -#include "lib/scaler.h" #include "lib/version.h" #include "lib/cross.h" #include "lib/config.h" diff --git a/src/tools/dcpomatic_server_cli.cc b/src/tools/dcpomatic_server_cli.cc index 80f4a0d0c..847c1fa1b 100644 --- a/src/tools/dcpomatic_server_cli.cc +++ b/src/tools/dcpomatic_server_cli.cc @@ -36,7 +36,6 @@ #include "lib/exceptions.h" #include "lib/util.h" #include "lib/config.h" -#include "lib/scaler.h" #include "lib/image.h" #include "lib/log.h" #include "lib/version.h" @@ -100,7 +99,6 @@ main (int argc, char* argv[]) } } - Scaler::setup_scalers (); shared_ptr log; if (write_log) { log.reset (new FileLog ("dcpomatic_server_cli.log")); diff --git a/src/tools/server_test.cc b/src/tools/server_test.cc index 5cb1123b1..f27e25fde 100644 --- a/src/tools/server_test.cc +++ b/src/tools/server_test.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,12 +25,10 @@ #include "lib/film.h" #include "lib/filter.h" #include "lib/util.h" -#include "lib/scaler.h" #include "lib/server.h" #include "lib/dcp_video.h" #include "lib/decoder.h" #include "lib/exceptions.h" -#include "lib/scaler.h" #include "lib/log.h" #include "lib/video_decoder.h" #include "lib/player.h" diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index c79c21dd1..eee2c3756 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -33,7 +33,6 @@ #include #include "lib/config.h" #include "lib/ratio.h" -#include "lib/scaler.h" #include "lib/filter.h" #include "lib/dcp_content_type.h" #include "lib/colour_conversion.h" diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index e029d3cc9..687f4d6ff 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,7 +21,6 @@ #include "wx_util.h" #include "isdcf_metadata_dialog.h" #include "lib/ratio.h" -#include "lib/scaler.h" #include "lib/config.h" #include "lib/dcp_content_type.h" #include "lib/util.h" @@ -248,9 +247,6 @@ DCPPanel::film_changed (int p) checked_set (_dcp_content_type, DCPContentType::as_index (_film->dcp_content_type ())); setup_dcp_name (); break; - case Film::SCALER: - checked_set (_scaler, Scaler::as_index (_film->scaler ())); - break; case Film::BURN_SUBTITLES: checked_set (_burn_subtitles, _film->burn_subtitles ()); break; @@ -391,7 +387,6 @@ DCPPanel::set_film (shared_ptr film) film_changed (Film::DCP_CONTENT_TYPE); film_changed (Film::CONTAINER); film_changed (Film::RESOLUTION); - film_changed (Film::SCALER); film_changed (Film::SIGNED); film_changed (Film::BURN_SUBTITLES); film_changed (Film::ENCRYPTED); @@ -428,25 +423,10 @@ DCPPanel::set_general_sensitivity (bool s) _container->Enable (s); _best_frame_rate->Enable (s && _film && _film->best_video_frame_rate () != _film->video_frame_rate ()); _resolution->Enable (s); - _scaler->Enable (s); _three_d->Enable (s); _standard->Enable (s); } -/** Called when the scaler widget has been changed */ -void -DCPPanel::scaler_changed () -{ - if (!_film) { - return; - } - - int const n = _scaler->GetSelection (); - if (n >= 0) { - _film->set_scaler (Scaler::from_index (n)); - } -} - void DCPPanel::use_isdcf_name_toggled () { @@ -576,13 +556,7 @@ DCPPanel::make_video_panel () } ++r; - add_label_to_grid_bag_sizer (grid, panel, _("Scaler"), true, wxGBPosition (r, 0)); - _scaler = new wxChoice (panel, wxID_ANY); - grid->Add (_scaler, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); - ++r; - _container->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::container_changed, this)); - _scaler->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::scaler_changed, this)); _frame_rate_choice->Bind(wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::frame_rate_choice_changed, this)); _frame_rate_spin->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&DCPPanel::frame_rate_spin_changed, this)); _best_frame_rate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::best_frame_rate_clicked, this)); @@ -591,11 +565,6 @@ DCPPanel::make_video_panel () _resolution->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::resolution_changed, this)); _three_d->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::three_d_changed, this)); - vector const sc = Scaler::all (); - for (vector::const_iterator i = sc.begin(); i != sc.end(); ++i) { - _scaler->Append (std_to_wx ((*i)->name())); - } - vector const ratio = Ratio::all (); for (vector::const_iterator i = ratio.begin(); i != ratio.end(); ++i) { _container->Append (std_to_wx ((*i)->nickname ())); diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h index 655472264..c5c76f27a 100644 --- a/src/wx/dcp_panel.h +++ b/src/wx/dcp_panel.h @@ -55,7 +55,6 @@ private: void copy_isdcf_name_button_clicked (); void container_changed (); void dcp_content_type_changed (); - void scaler_changed (); void j2k_bandwidth_changed (); void frame_rate_choice_changed (); void frame_rate_spin_changed (); @@ -89,7 +88,6 @@ private: wxChoice* _container; wxButton* _edit_isdcf_button; wxButton* _copy_isdcf_name_button; - wxChoice* _scaler; wxSpinCtrl* _j2k_bandwidth; wxChoice* _dcp_content_type; wxChoice* _frame_rate_choice; diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index 21d4ae1fe..26f135d48 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -26,7 +26,6 @@ #include "lib/util.h" #include "lib/job_manager.h" #include "lib/image.h" -#include "lib/scaler.h" #include "lib/exceptions.h" #include "lib/examine_content_job.h" #include "lib/filter.h" @@ -181,7 +180,7 @@ FilmViewer::get (DCPTime p, bool accurate) if (!pvf.empty ()) { try { _frame = pvf.front()->image (PIX_FMT_RGB24, true, boost::bind (&Log::dcp_log, _film->log().get(), _1, _2)); - _frame = _frame->scale (_frame->size(), Scaler::from_id ("fastbilinear"), PIX_FMT_RGB24, false); + _frame = _frame->scale (_frame->size(), PIX_FMT_RGB24, false); _position = pvf.front()->time (); _inter_position = pvf.front()->inter_position (); _inter_size = pvf.front()->inter_size (); diff --git a/test/client_server_test.cc b/test/client_server_test.cc index daa1fa20f..9ad361387 100644 --- a/test/client_server_test.cc +++ b/test/client_server_test.cc @@ -31,7 +31,6 @@ #include "lib/image.h" #include "lib/cross.h" #include "lib/dcp_video.h" -#include "lib/scaler.h" #include "lib/player_video.h" #include "lib/raw_image_proxy.h" #include "lib/encoded_data.h" @@ -90,7 +89,6 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb) optional (), dcp::Size (1998, 1080), dcp::Size (1998, 1080), - Scaler::from_id ("bicubic"), EYES_BOTH, PART_WHOLE, ColourConversion () @@ -174,7 +172,6 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv) optional (), dcp::Size (1998, 1080), dcp::Size (1998, 1080), - Scaler::from_id ("bicubic"), EYES_BOTH, PART_WHOLE, ColourConversion () diff --git a/test/image_test.cc b/test/image_test.cc index 44d15a8cb..b622b250d 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -26,7 +26,6 @@ #include #include #include "lib/image.h" -#include "lib/scaler.h" using std::string; using std::list; @@ -157,7 +156,7 @@ BOOST_AUTO_TEST_CASE (crop_image_test2) image = image->crop (crop, true); /* Convert it back to RGB to make comparison to black easier */ - image = image->scale (image->size(), Scaler::from_id ("bicubic"), PIX_FMT_RGB24, true); + image = image->scale (image->size(), PIX_FMT_RGB24, true); /* Check that its still black after the crop */ uint8_t* p = image->data()[0]; @@ -251,13 +250,13 @@ crop_scale_window_single (AVPixelFormat in_format, dcp::Size in_size, Crop crop, /* Convert using separate methods */ boost::shared_ptr sep = test->crop (crop, true); - sep = sep->scale (inter_size, Scaler::from_id ("bicubic"), PIX_FMT_RGB24, true); + sep = sep->scale (inter_size, PIX_FMT_RGB24, true); boost::shared_ptr sep_container (new Image (PIX_FMT_RGB24, out_size, true)); sep_container->make_black (); sep_container->copy (sep, Position ((out_size.width - inter_size.width) / 2, (out_size.height - inter_size.height) / 2)); /* Convert using the all-in-one method */ - shared_ptr all = test->crop_scale_window (crop, inter_size, out_size, Scaler::from_id ("bicubic"), PIX_FMT_RGB24, true); + shared_ptr all = test->crop_scale_window (crop, inter_size, out_size, PIX_FMT_RGB24, true); /* Compare */ BOOST_CHECK_EQUAL (sep_container->size().width, all->size().width); diff --git a/test/make_black_test.cc b/test/make_black_test.cc index f6c3a4bb2..913b6da10 100644 --- a/test/make_black_test.cc +++ b/test/make_black_test.cc @@ -30,7 +30,6 @@ extern "C" { #include } #include "lib/image.h" -#include "lib/scaler.h" using std::list; @@ -81,7 +80,7 @@ BOOST_AUTO_TEST_CASE (make_black_test) for (list::const_iterator i = pix_fmts.begin(); i != pix_fmts.end(); ++i) { boost::shared_ptr foo (new Image (*i, in_size, true)); foo->make_black (); - boost::shared_ptr bar = foo->scale (out_size, Scaler::from_id ("bicubic"), PIX_FMT_RGB24, true); + boost::shared_ptr bar = foo->scale (out_size, PIX_FMT_RGB24, true); uint8_t* p = bar->data()[0]; for (int y = 0; y < bar->size().height; ++y) { -- 2.30.2