Remove Scaler config and use SWS_BICUBIC everywhere.
authorCarl Hetherington <cth@carlh.net>
Wed, 25 Mar 2015 00:41:05 +0000 (00:41 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 25 Mar 2015 00:41:05 +0000 (00:41 +0000)
27 files changed:
ChangeLog
src/lib/config.cc
src/lib/dcp_video.cc
src/lib/film.cc
src/lib/film.h
src/lib/image.cc
src/lib/image.h
src/lib/player.cc
src/lib/player_video.cc
src/lib/player_video.h
src/lib/scaler.cc [deleted file]
src/lib/scaler.h [deleted file]
src/lib/server.cc
src/lib/util.cc
src/lib/wscript
src/tools/dcpomatic.cc
src/tools/dcpomatic_batch.cc
src/tools/dcpomatic_cli.cc
src/tools/dcpomatic_server_cli.cc
src/tools/server_test.cc
src/wx/config_dialog.cc
src/wx/dcp_panel.cc
src/wx/dcp_panel.h
src/wx/film_viewer.cc
test/client_server_test.cc
test/image_test.cc
test/make_black_test.cc

index 3a67b0aa73e7d88946b38bc9aa61b8087f3b14fc..46ccc91226b1acd65308a3da198e7f786562f975 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-03-25  Carl Hetherington  <cth@carlh.net>
 
+       * 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.
 
index 94d8a69a289018f1b2e67d9f3a06bd76c65a9ae8..bf70f95ac48a326ad8a48239c779b7eefdbc6a23 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "config.h"
 #include "server.h"
-#include "scaler.h"
 #include "filter.h"
 #include "ratio.h"
 #include "dcp_content_type.h"
index a302c43e657e79cba5b367be962c4464707473bb..a2668c4a767f60586b9c79bfbc4fd3da4bd1f625 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
     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"
index ed7d4cb5129698abe0e23717e1063cd1e8875a3f..e5904ca1e988d3b6da451d62e1bda96154511abe 100644 (file)
@@ -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<string> (_j2k_bandwidth));
        _isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata"));
        root->add_child("VideoFrameRate")->add_child_text (raw_convert<string> (_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<int> ("J2KBandwidth");
        _video_frame_rate = f.number_child<int> ("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)
 {
index c3ab9f2ff550de1a65cd79a2924b36c13b293122..3d1c02c93a7db30b95ecd3140a7919b46aabffa6 100644 (file)
@@ -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 */
index 2085b54eeeb14a44e611bdd6d77b1cf501db697f..177219813131cb0b387eec74efdf441917fe57e8 100644 (file)
@@ -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>
-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>
-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 (
index b929f4dfcbba78f8dbec7b8ac245c1a9ff7f2a05..2e90a89e92ed9701b19c3c4a80c0e67e10687297 100644 (file)
@@ -35,7 +35,6 @@ extern "C" {
 #include <boost/function.hpp>
 #include <string>
 
-class Scaler;
 class Socket;
 
 class Image
@@ -58,10 +57,10 @@ public:
        int line_factor (int) const;
        int lines (int) const;
 
-       boost::shared_ptr<Image> scale (dcp::Size, Scaler const *, AVPixelFormat, bool aligned) const;
+       boost::shared_ptr<Image> scale (dcp::Size, AVPixelFormat, bool aligned) const;
        boost::shared_ptr<Image> crop (Crop c, bool aligned) const;
 
-       boost::shared_ptr<Image> crop_scale_window (Crop c, dcp::Size, dcp::Size, Scaler const *, AVPixelFormat, bool aligned) const;
+       boost::shared_ptr<Image> crop_scale_window (Crop c, dcp::Size, dcp::Size, AVPixelFormat, bool aligned) const;
        
        void make_black ();
        void make_transparent ();
index c9c7de4207e0fbeff8a452134ab4763175f3c9c6..e3c85ee56ef40ef6f1ae0cb370656bc96697a53d 100644 (file)
@@ -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<ImageSubtitle> 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<float> (),
                        _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 ()
index ccd52ea677acda1bbdcd754996c321b43934a2dd..f9f06f63aee7fb48743ad3fa457faca0f4ac9baa 100644 (file)
@@ -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<float> fade,
        dcp::Size inter_size,
        dcp::Size out_size,
-       Scaler const * scaler,
        Eyes eyes,
        Part part,
        optional<ColourConversion> 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<cxml::Node> node, shared_ptr<Socket> socket
 
        _inter_size = dcp::Size (node->number_child<int> ("InterWidth"), node->number_child<int> ("InterHeight"));
        _out_size = dcp::Size (node->number_child<int> ("OutWidth"), node->number_child<int> ("OutHeight"));
-       _scaler = Scaler::from_id (node->string_child ("Scaler"));
        _eyes = (Eyes) node->number_child<int> ("Eyes");
        _part = (Part) node->number_child<int> ("Part");
 
@@ -116,7 +112,7 @@ PlayerVideo::image (AVPixelFormat pixel_format, bool burn_subtitle, dcp::NoteHan
                break;
        }
                
-       shared_ptr<Image> out = im->crop_scale_window (total_crop, _inter_size, _out_size, _scaler, pixel_format, true);
+       shared_ptr<Image> 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<string> (_inter_size.height));
        node->add_child("OutWidth")->add_child_text (raw_convert<string> (_out_size.width));
        node->add_child("OutHeight")->add_child_text (raw_convert<string> (_out_size.height));
-       node->add_child("Scaler")->add_child_text (_scaler->id ());
        node->add_child("Eyes")->add_child_text (raw_convert<string> (_eyes));
        node->add_child("Part")->add_child_text (raw_convert<string> (_part));
        if (_colour_conversion) {
@@ -203,7 +198,6 @@ PlayerVideo::same (shared_ptr<const PlayerVideo> 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 ||
index 6762ea8d1b219665066964cbc941ba5ae6927397..c4537f713432907376756669fff488d813152b8f 100644 (file)
@@ -28,7 +28,6 @@ extern "C" {
 
 class Image;
 class ImageProxy;
-class Scaler;
 class Socket;
 class EncodedData;
 
@@ -46,7 +45,6 @@ public:
                boost::optional<float>,
                dcp::Size,
                dcp::Size,
-               Scaler const *,
                Eyes,
                Part,
                boost::optional<ColourConversion>
@@ -93,7 +91,6 @@ private:
        boost::optional<float> _fade;
        dcp::Size _inter_size;
        dcp::Size _out_size;
-       Scaler const * _scaler;
        Eyes _eyes;
        Part _part;
        boost::optional<ColourConversion> _colour_conversion;
diff --git a/src/lib/scaler.cc b/src/lib/scaler.cc
deleted file mode 100644 (file)
index 43c1ac8..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    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 <libswscale/swscale.h>
-}
-#include <iostream>
-#include <cassert>
-
-#include "i18n.h"
-
-using namespace std;
-
-vector<Scaler const *> 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 const *>
-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<Scaler const *>::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<Scaler*>::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 (file)
index 0f0bcb1..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
-
-    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 <boost/utility.hpp>
-#include <string>
-#include <vector>
-
-/** @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<Scaler const *> 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<Scaler const *> _scalers;
-};
-
-#endif
index 32e1e38b23f7148e0f7f1fa132fe2beaa4a8c0c4..ba8580732832a919b16b596b098f7bfc83d254fb 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "server.h"
 #include "dcpomatic_socket.h"
-#include "scaler.h"
 #include "image.h"
 #include "dcp_video.h"
 #include "config.h"
index 2b5eb69fb07c64ff5aa1340f53b71e9adadc8c56..6ebdc85d41777971492697a254393883e159ca4e 100644 (file)
@@ -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 ();
index 217c0c86d9e1546c7d6aa6fb096c1f31c2c91436..24aa7c13438461b5295f23979f440640cab86326 100644 (file)
@@ -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
index 19f2861c4efec265c65a7adf98689b58b476c5f4..d0b6faecbb476b3067026104ca0be0ed260a9cdb 100644 (file)
@@ -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 ();
index b92ca5d7100218a005e3576cd980a4aa711fd406..da8a614142ad4ad3bd5d5ca2db7e1fba9eac7ccc 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
 
     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 ();
index e187e573e2887caaa5ef877f245b4ffc38da5c82..4facdd4d1a868df0e67d9cac2e28861d3434ed21 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     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"
index 80f4a0d0c339677dd46a528a2f171cad5e23ba01..847c1fa1b4d25ff87caa74f2f9cd739b7743ea53 100644 (file)
@@ -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> log;
        if (write_log) {
                log.reset (new FileLog ("dcpomatic_server_cli.log"));
index 5cb1123b14bd9ff5c209c763f162bb0e6100abfa..f27e25fde3dab9ac53d19409a89dd0163970abfe 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     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
 #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"
index c79c21dd1f0be29bc2c25fdc74abe5cfdc2ec37c..eee2c375608278e4bdb52067b4ebe1e710e5002f 100644 (file)
@@ -33,7 +33,6 @@
 #include <dcp/signer.h>
 #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"
index e029d3cc9c8fd200a60ca50e0b7b6eaab971f443..687f4d6ff24aea5311ae0a726b9b51e7ab56fd1b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     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)
        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<Scaler const *> const sc = Scaler::all ();
-       for (vector<Scaler const *>::const_iterator i = sc.begin(); i != sc.end(); ++i) {
-               _scaler->Append (std_to_wx ((*i)->name()));
-       }
-
        vector<Ratio const *> const ratio = Ratio::all ();
        for (vector<Ratio const *>::const_iterator i = ratio.begin(); i != ratio.end(); ++i) {
                _container->Append (std_to_wx ((*i)->nickname ()));
index 655472264f25663687f29c9eb87afb08b0f34efe..c5c76f27a112bbb7264e1eb047f8a408eb60932c 100644 (file)
@@ -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;
index 21d4ae1fe1938e1da5d45de9e4b3e9a8bb0d07a7..26f135d48eed0b480e4736a6c01feda55b874132 100644 (file)
@@ -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 ();
index daa1fa20f37ba469a3f99f26eb315095a115276e..9ad36138746e54877cf697608a889d9f8ffdc16a 100644 (file)
@@ -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<float> (),
                        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<float> (),
                        dcp::Size (1998, 1080),
                        dcp::Size (1998, 1080),
-                       Scaler::from_id ("bicubic"),
                        EYES_BOTH,
                        PART_WHOLE,
                        ColourConversion ()
index 44d15a8cb2ab18427f79e0d72ab1991548b7e4ca..b622b250db50eb6f6ff9ac82d8090dc3caa82991 100644 (file)
@@ -26,7 +26,6 @@
 #include <boost/test/unit_test.hpp>
 #include <Magick++.h>
 #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<Image> 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<Image> sep_container (new Image (PIX_FMT_RGB24, out_size, true));
        sep_container->make_black ();
        sep_container->copy (sep, Position<int> ((out_size.width - inter_size.width) / 2, (out_size.height - inter_size.height) / 2));
 
        /* Convert using the all-in-one method */
-       shared_ptr<Image> all = test->crop_scale_window (crop, inter_size, out_size, Scaler::from_id ("bicubic"), PIX_FMT_RGB24, true);
+       shared_ptr<Image> 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);
index f6c3a4bb2bbc87616ffc3cfbeb84a3ffacc07704..913b6da10857ba1de2e4d2586899a5a2e7c2079c 100644 (file)
@@ -30,7 +30,6 @@ extern "C" {
 #include <libavutil/pixfmt.h>
 }
 #include "lib/image.h"
-#include "lib/scaler.h"
 
 using std::list;
 
@@ -81,7 +80,7 @@ BOOST_AUTO_TEST_CASE (make_black_test)
        for (list<AVPixelFormat>::const_iterator i = pix_fmts.begin(); i != pix_fmts.end(); ++i) {
                boost::shared_ptr<Image> foo (new Image (*i, in_size, true));
                foo->make_black ();
-               boost::shared_ptr<Image> bar = foo->scale (out_size, Scaler::from_id ("bicubic"), PIX_FMT_RGB24, true);
+               boost::shared_ptr<Image> bar = foo->scale (out_size, PIX_FMT_RGB24, true);
                
                uint8_t* p = bar->data()[0];
                for (int y = 0; y < bar->size().height; ++y) {