Fix relative include paths
[libvpx.git] / vp8 / encoder / parms.cpp
blob2a39b2ca32f13e4e62dd96e32aac9dcce00acd68
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
12 #if 0
14 #include <map>
15 #include <string>
16 #include <fstream>
17 extern "C"
19 #include "vp8/common/onyx.h"
23 using namespace std;
25 typedef map<string,int> Parms;
27 #define ALLPARMS(O,DOTHIS) \
28 DOTHIS(O, interquantizer )\
29 DOTHIS(O, auto_gold )\
30 DOTHIS(O, auto_adjust_gold_quantizer )\
31 DOTHIS(O, goldquantizer )\
32 DOTHIS(O, goldfreq )\
33 DOTHIS(O, auto_key )\
34 DOTHIS(O, auto_adjust_key_quantizer )\
35 DOTHIS(O, keyquantizer )\
36 DOTHIS(O, keyfreq )\
37 DOTHIS(O, pass )\
38 DOTHIS(O, fixed_q )\
39 DOTHIS(O, target_bandwidth )\
40 DOTHIS(O, auto_worst_q )\
41 DOTHIS(O, worst_quality )\
42 DOTHIS(O, best_allowed_q )\
43 DOTHIS(O, end_usage )\
44 DOTHIS(O, starting_buffer_level )\
45 DOTHIS(O, optimal_buffer_level )\
46 DOTHIS(O, maximum_buffer_size )\
47 DOTHIS(O, under_shoot_pct )\
48 DOTHIS(O, allow_df )\
49 DOTHIS(O, drop_frames_water_mark )\
50 DOTHIS(O, max_allowed_datarate )\
51 DOTHIS(O, two_pass_vbrbias )\
52 DOTHIS(O, two_pass_vbrmin_section )\
53 DOTHIS(O, two_pass_vbrmax_section )\
54 DOTHIS(O, filter_type )\
55 DOTHIS(O, compressor_speed )\
56 DOTHIS(O, mbpitch_feature )\
57 DOTHIS(O, allow_spatial_resampling )\
58 DOTHIS(O, resample_down_water_mark )\
59 DOTHIS(O, resample_up_water_mark )\
60 DOTHIS(O, noise_sensitivity )\
61 DOTHIS(O, horiz_scale )\
62 DOTHIS(O, vert_scale )
65 #define GET(O,V) O->V = x[#V];
66 #define PUT(O,V) x[#V] = O->V;
69 extern "C" void get_parms(VP8_CONFIG *ocf,char *filename)
72 Parms x;
73 int value;
74 string variable;
75 string equal;
77 ifstream config_file(filename);
79 ALLPARMS(ocf, PUT);
81 // store all the parms in a map (really simple parsing)
82 while(!config_file.eof() && config_file.is_open())
84 config_file >> variable;
85 config_file >> equal;
87 if(equal != "=")
88 continue;
90 config_file >> value;
92 x[variable] = value;
95 ALLPARMS(ocf, GET);
99 #define PRINT(O,V) debug_file<<#V <<" = " << O->V <<"\n";
100 extern "C" void print_parms(VP8_CONFIG *ocf,char *filename)
102 ofstream debug_file(filename,ios_base::app);
103 ALLPARMS(ocf, PRINT);
104 debug_file << "=============================================="<<"\n";
107 #endif