1 /* 2 * opts.h - set optional parameters 3 */ 4 5 /* 6 * Copyright (c) 1995 The Regents of the University of California. 7 * All rights reserved. 8 * 9 * Permission to use, copy, modify, and distribute this software and its 10 * documentation for any purpose, without fee, and without written agreement is 11 * hereby granted, provided that the above copyright notice and the following 12 * two paragraphs appear in all copies of this software. 13 * 14 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR 15 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT 16 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF 17 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 18 * 19 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 21 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 22 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO 23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 24 */ 25 26 /* 27 * $Header$ 28 * $Log$ 29 * Revision 1.4 2004/04/02 15:12:41 rwcox 30 * Cput 31 * 32 * Revision 1.3 2003/12/23 13:50:09 rwcox 33 * Cput 34 * 35 * Revision 1.2 2003/12/03 14:46:15 rwcox 36 * Cput 37 * 38 * Revision 1.1 2001/12/17 18:25:45 rwcox 39 * Cadd 40 * 41 * Revision 1.3 1995/08/15 23:43:43 smoot 42 * *** empty log message *** 43 * 44 * Revision 1.2 1995/05/02 22:00:51 smoot 45 * added TUNEing stuff 46 * 47 * Revision 1.1 1995/04/14 23:12:53 smoot 48 * Initial revision 49 * 50 */ 51 52 #include "general.h" 53 #include "ansi.h" 54 #include "mtypes.h" 55 56 /* 57 TUNE b [limit] lower limit on how different a block must be to be DCT coded 58 TUNE c [file [color-diff]] Collect statistics on Quantization 59 TUNE d [RateScale DistortionScale] Do a DCT in the P search, not just DIFF 60 TUNE k [breakpt end [slope]] Squash small lum values 61 TUNE l Figure out Laplacian distrib and use them to dequantize and do snr calc 62 TUNE n Dont consider DC differenece in DCT searches 63 TUNE q Do MSE for distortion measure, not MAD 64 TUNE s [Max] | [LumMax ChromMax] Squash small differences in successive frames 65 TUNE u disallow skip blocks in B frames 66 TUNE w filename [c] Write I block distortion numbers to file [with bit-rates] 67 TUNE z Zaps Intra blocks in P/B frames. 68 69 [ Note k and s make -snr numbers a lie, by playing with input ] 70 [ Note d n and q are contradictory (can only use one) ] 71 [ Note c will not work on parallel encodings ] 72 */ 73 74 extern boolean tuneingOn; 75 76 /* Smash to no-change a motion block DCT with MAD less than: */ 77 /* DETAL b value */ 78 extern int block_bound; 79 80 /* Collect info on quantization */ 81 extern boolean collect_quant; 82 extern int collect_quant_detailed; 83 extern FILE *collect_quant_fp; 84 85 /* Nuke dim areas */ 86 extern int kill_dim, kill_dim_break, kill_dim_end; 87 extern float kill_dim_slope; 88 89 90 /* Stuff to control MV search comparisons */ 91 #define DEFAULT_SEARCH 0 92 #define LOCAL_DCT 1 /* Do DCT in search (SLOW!!!!) */ 93 #define NO_DC_SEARCH 2 /* Dont consider DC component in motion searches */ 94 #define DO_Mean_Squared_Distortion 3 /* Do Squared distortion, not ABS */ 95 96 /* Parameters for special searches */ 97 /* LOCAL_DCT */ 98 extern float LocalDCTRateScale, LocalDCTDistortScale; 99 100 /* Search Type Variable */ 101 extern int SearchCompareMode; 102 103 /* squash small differences */ 104 extern boolean squash_small_differences; 105 extern int SquashMaxLum, SquashMaxChr; 106 107 /* Disallows Intra blocks in P/B code */ 108 extern boolean IntraPBAllowed; 109 110 /* Write out distortion numbers */ 111 extern boolean WriteDistortionNumbers; 112 extern int collect_distortion_detailed; 113 extern FILE *distortion_fp; 114 extern FILE *fp_table_rate[31], *fp_table_dist[31]; 115 116 /* Laplacian Distrib */ 117 extern boolean DoLaplace; 118 extern double **L1, **L2, **Lambdas; 119 extern int LaplaceNum, LaplaceCnum; 120 121 /* Turn on/off skipping in B frames */ 122 extern boolean BSkipBlocks; 123 124 /* Procedures Prototypes */ 125 int GetIQScale _ANSI_ARGS_((void)); 126 int GetPQScale _ANSI_ARGS_((void)); 127 int GetBQScale _ANSI_ARGS_((void)); 128 void Tune_Init _ANSI_ARGS_((void)); 129 char *SkipSpacesTabs _ANSI_ARGS_((char *start)); 130 int CalcRLEHuffLength _ANSI_ARGS_((FlatBlock in)); 131 void ParseTuneParam _ANSI_ARGS_((char *charPtr)); 132 int mse _ANSI_ARGS_((Block blk1, Block blk2)); 133 134 135 136 137