1 |
/* |
2 |
* Copyright (c) 1995 The Regents of the University of California. |
3 |
* All rights reserved. |
4 |
* |
5 |
* Permission to use, copy, modify, and distribute this software and its |
6 |
* documentation for any purpose, without fee, and without written agreement is |
7 |
* hereby granted, provided that the above copyright notice and the following |
8 |
* two paragraphs appear in all copies of this software. |
9 |
* |
10 |
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR |
11 |
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT |
12 |
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF |
13 |
* CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
14 |
* |
15 |
* THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, |
16 |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
17 |
* AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS |
18 |
* ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO |
19 |
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
20 |
*/ |
21 |
|
22 |
/* |
23 |
* $Header: /n/charlie-brown/project/mm/mpeg/mpeg_dist/mpeg_encode/RCS/qtest.c,v 1.5 1995/01/19 23:09:15 eyhung Exp $ |
24 |
* $Log: qtest.c,v $ |
25 |
* Revision 1.5 1995/01/19 23:09:15 eyhung |
26 |
* Changed copyrights |
27 |
* |
28 |
* Revision 1.4 1993/01/18 10:20:02 dwallach |
29 |
* *** empty log message *** |
30 |
* |
31 |
* Revision 1.3 1993/01/18 10:17:29 dwallach |
32 |
* RCS headers installed, code indented uniformly |
33 |
* |
34 |
* Revision 1.3 1993/01/18 10:17:29 dwallach |
35 |
* RCS headers installed, code indented uniformly |
36 |
* |
37 |
*/ |
38 |
|
39 |
#include <stdio.h> |
40 |
#include "mtypes.h" |
41 |
#include "mproto.h" |
42 |
|
43 |
main() |
44 |
{ |
45 |
Block a; |
46 |
FlatBlock b; |
47 |
BitBucket *bb; |
48 |
int i, j; |
49 |
|
50 |
bb = new_bitbucket(); |
51 |
|
52 |
for (i = 0; i < 8; i++) |
53 |
for (j = 0; j < 8; j++) |
54 |
a[i][j] = random() % 100; |
55 |
mp_quant_zig_block(a, b, 1, 1); |
56 |
for (i = 0; i < 64; i++) |
57 |
printf("%6d ", b[i]); |
58 |
printf("\n"); |
59 |
|
60 |
mp_rle_huff_block(b, bb); /* intuititve names, huh? */ |
61 |
|
62 |
printf("Huffman output is %d bits\n", bb->totalbits); |
63 |
} |