ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/src/mpeg_encode/src/opts.h
Revision: 22
Committed: Mon Jul 7 22:16:37 2008 UTC (11 years, 5 months ago) by wdelano
File size: 4225 byte(s)
Log Message:
initial checkin of mpeg_encode source
Line File contents
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: /n/picasso/project/mpeg/mpeg_dist/mpeg_encode/headers/RCS/opts.h,v 1.3 1995/08/15 23:43:43 smoot Exp $
28 * $Log: opts.h,v $
29 * Revision 1.3 1995/08/15 23:43:43 smoot
30 * *** empty log message ***
31 *
32 * Revision 1.2 1995/05/02 22:00:51 smoot
33 * added TUNEing stuff
34 *
35 * Revision 1.1 1995/04/14 23:12:53 smoot
36 * Initial revision
37 *
38 */
39
40 #include "general.h"
41 #include "ansi.h"
42 #include "mtypes.h"
43
44 /*
45 TUNE b [limit] lower limit on how different a block must be to be DCT coded
46 TUNE c [file [color-diff]] Collect statistics on Quantization
47 TUNE d [RateScale DistortionScale] Do a DCT in the P search, not just DIFF
48 TUNE k [breakpt end [slope]] Squash small lum values
49 TUNE l Figure out Laplacian distrib and use them to dequantize and do snr calc
50 TUNE n Dont consider DC differenece in DCT searches
51 TUNE q Do MSE for distortion measure, not MAD
52 TUNE s [Max] | [LumMax ChromMax] Squash small differences in successive frames
53 TUNE u disallow skip blocks in B frames
54 TUNE w filename [c] Write I block distortion numbers to file [with bit-rates]
55 TUNE z Zaps Intra blocks in P/B frames.
56
57 [ Note k and s make -snr numbers a lie, by playing with input ]
58 [ Note d n and q are contradictory (can only use one) ]
59 [ Note c will not work on parallel encodings ]
60 */
61
62 extern boolean tuneingOn;
63
64 /* Smash to no-change a motion block DCT with MAD less than: */
65 /* DETAL b value */
66 extern int block_bound;
67
68 /* Collect info on quantization */
69 extern boolean collect_quant;
70 extern int collect_quant_detailed;
71 extern FILE *collect_quant_fp;
72
73 /* Nuke dim areas */
74 extern int kill_dim, kill_dim_break, kill_dim_end;
75 extern float kill_dim_slope;
76
77
78 /* Stuff to control MV search comparisons */
79 #define DEFAULT_SEARCH 0
80 #define LOCAL_DCT 1 /* Do DCT in search (SLOW!!!!) */
81 #define NO_DC_SEARCH 2 /* Dont consider DC component in motion searches */
82 #define DO_Mean_Squared_Distortion 3 /* Do Squared distortion, not ABS */
83
84 /* Parameters for special searches */
85 /* LOCAL_DCT */
86 extern float LocalDCTRateScale, LocalDCTDistortScale;
87
88 /* Search Type Variable */
89 extern int SearchCompareMode;
90
91 /* squash small differences */
92 extern boolean squash_small_differences;
93 extern int SquashMaxLum, SquashMaxChr;
94
95 /* Disallows Intra blocks in P/B code */
96 extern boolean IntraPBAllowed;
97
98 /* Write out distortion numbers */
99 extern boolean WriteDistortionNumbers;
100 extern int collect_distortion_detailed;
101 extern FILE *distortion_fp;
102 extern FILE *fp_table_rate[31], *fp_table_dist[31];
103
104 /* Laplacian Distrib */
105 extern boolean DoLaplace;
106 extern double **L1, **L2, **Lambdas;
107 extern int LaplaceNum, LaplaceCnum;
108
109 /* Turn on/off skipping in B frames */
110 extern boolean BSkipBlocks;
111
112 /* Procedures Prototypes */
113 int GetIQScale _ANSI_ARGS_((void));
114 int GetPQScale _ANSI_ARGS_((void));
115 int GetBQScale _ANSI_ARGS_((void));
116 void Tune_Init _ANSI_ARGS_((void));
117 char *SkipSpacesTabs _ANSI_ARGS_((char *start));
118 int CalcRLEHuffLength _ANSI_ARGS_((FlatBlock in));
119 void ParseTuneParam _ANSI_ARGS_((char *charPtr));
120 int mse _ANSI_ARGS_((Block blk1, Block blk2));