2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "ab_transcode_job.h"
22 #include "j2k_wav_encoder.h"
26 #include "ab_transcoder.h"
27 #include "film_state.h"
28 #include "encoder_factory.h"
32 using namespace boost;
34 /** @param s FilmState to compare (with filters and/or a non-bicubic scaler).
36 * @Param l A log that we can write to.
38 ABTranscodeJob::ABTranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l)
41 _fs_b.reset (new FilmState (*_fs));
42 _fs_b->scaler = Config::instance()->reference_scaler ();
43 _fs_b->filters = Config::instance()->reference_filters ();
47 ABTranscodeJob::name () const
50 s << "A/B transcode " << _fs->name;
55 ABTranscodeJob::run ()
58 /* _fs_b is the one with no filters */
59 ABTranscoder w (_fs_b, _fs, _opt, this, _log, encoder_factory (_fs, _opt, _log));
62 set_state (FINISHED_OK);
64 } catch (std::exception& e) {
66 set_state (FINISHED_ERROR);