content/media/webspeech/recognition/energy_endpointer_params.cc

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
michael@0 2 //
michael@0 3 // Redistribution and use in source and binary forms, with or without
michael@0 4 // modification, are permitted provided that the following conditions are
michael@0 5 // met:
michael@0 6 //
michael@0 7 // * Redistributions of source code must retain the above copyright
michael@0 8 // notice, this list of conditions and the following disclaimer.
michael@0 9 // * Redistributions in binary form must reproduce the above
michael@0 10 // copyright notice, this list of conditions and the following disclaimer
michael@0 11 // in the documentation and/or other materials provided with the
michael@0 12 // distribution.
michael@0 13 // * Neither the name of Google Inc. nor the names of its
michael@0 14 // contributors may be used to endorse or promote products derived from
michael@0 15 // this software without specific prior written permission.
michael@0 16 //
michael@0 17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
michael@0 18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
michael@0 19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
michael@0 20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
michael@0 21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@0 22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@0 23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
michael@0 24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
michael@0 25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
michael@0 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
michael@0 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
michael@0 28
michael@0 29 #include "energy_endpointer_params.h"
michael@0 30
michael@0 31 namespace mozilla {
michael@0 32
michael@0 33 EnergyEndpointerParams::EnergyEndpointerParams() {
michael@0 34 SetDefaults();
michael@0 35 }
michael@0 36
michael@0 37 void EnergyEndpointerParams::SetDefaults() {
michael@0 38 frame_period_ = 0.01f;
michael@0 39 frame_duration_ = 0.01f;
michael@0 40 endpoint_margin_ = 0.2f;
michael@0 41 onset_window_ = 0.15f;
michael@0 42 speech_on_window_ = 0.4f;
michael@0 43 offset_window_ = 0.15f;
michael@0 44 onset_detect_dur_ = 0.09f;
michael@0 45 onset_confirm_dur_ = 0.075f;
michael@0 46 on_maintain_dur_ = 0.10f;
michael@0 47 offset_confirm_dur_ = 0.12f;
michael@0 48 decision_threshold_ = 150.0f;
michael@0 49 min_decision_threshold_ = 50.0f;
michael@0 50 fast_update_dur_ = 0.2f;
michael@0 51 sample_rate_ = 8000.0f;
michael@0 52 min_fundamental_frequency_ = 57.143f;
michael@0 53 max_fundamental_frequency_ = 400.0f;
michael@0 54 contamination_rejection_period_ = 0.25f;
michael@0 55 }
michael@0 56
michael@0 57 void EnergyEndpointerParams::operator=(const EnergyEndpointerParams& source) {
michael@0 58 frame_period_ = source.frame_period();
michael@0 59 frame_duration_ = source.frame_duration();
michael@0 60 endpoint_margin_ = source.endpoint_margin();
michael@0 61 onset_window_ = source.onset_window();
michael@0 62 speech_on_window_ = source.speech_on_window();
michael@0 63 offset_window_ = source.offset_window();
michael@0 64 onset_detect_dur_ = source.onset_detect_dur();
michael@0 65 onset_confirm_dur_ = source.onset_confirm_dur();
michael@0 66 on_maintain_dur_ = source.on_maintain_dur();
michael@0 67 offset_confirm_dur_ = source.offset_confirm_dur();
michael@0 68 decision_threshold_ = source.decision_threshold();
michael@0 69 min_decision_threshold_ = source.min_decision_threshold();
michael@0 70 fast_update_dur_ = source.fast_update_dur();
michael@0 71 sample_rate_ = source.sample_rate();
michael@0 72 min_fundamental_frequency_ = source.min_fundamental_frequency();
michael@0 73 max_fundamental_frequency_ = source.max_fundamental_frequency();
michael@0 74 contamination_rejection_period_ = source.contamination_rejection_period();
michael@0 75 }
michael@0 76
michael@0 77 } // namespace mozilla

mercurial