Doxygen Source Code Documentation
dct.h
Go to the documentation of this file.00001 /*===========================================================================* 00002 * dct.h * 00003 * * 00004 * DCT procedures * 00005 * * 00006 *===========================================================================*/ 00007 00008 /* 00009 * Copyright (c) 1995 The Regents of the University of California. 00010 * All rights reserved. 00011 * 00012 * Permission to use, copy, modify, and distribute this software and its 00013 * documentation for any purpose, without fee, and without written agreement is 00014 * hereby granted, provided that the above copyright notice and the following 00015 * two paragraphs appear in all copies of this software. 00016 * 00017 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR 00018 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT 00019 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF 00020 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00021 * 00022 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 00023 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 00024 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS 00025 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO 00026 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 00027 */ 00028 00029 00030 #ifndef DCT_INCLUDED 00031 #define DCT_INCLUDED 00032 00033 00034 #include "ansi.h" 00035 00036 00037 00038 #define DCTSIZE 8 /* you really don't want to change this */ 00039 #define DCTSIZE_SQ 64 /* you really don't want to change this */ 00040 00041 #define DCTSIZE2 DCTSIZE*DCTSIZE 00042 typedef short DCTELEM; 00043 typedef DCTELEM DCTBLOCK[DCTSIZE2]; 00044 typedef DCTELEM DCTBLOCK_2D[DCTSIZE][DCTSIZE]; 00045 00046 00047 /* 00048 * from mfwddct.c: 00049 */ 00050 extern void mp_fwd_dct_block2 _ANSI_ARGS_((DCTBLOCK_2D src, DCTBLOCK_2D dest)); 00051 00052 /* jrevdct.c */ 00053 extern void init_pre_idct _ANSI_ARGS_((void )); 00054 extern void mpeg_jrevdct _ANSI_ARGS_((DCTBLOCK data )); 00055 00056 00057 /* We assume that right shift corresponds to signed division by 2 with 00058 * rounding towards minus infinity. This is correct for typical "arithmetic 00059 * shift" instructions that shift in copies of the sign bit. But some 00060 * C compilers implement >> with an unsigned shift. For these machines you 00061 * must define RIGHT_SHIFT_IS_UNSIGNED. 00062 * RIGHT_SHIFT provides a proper signed right shift of an int32 quantity. 00063 * It is only applied with constant shift counts. SHIFT_TEMPS must be 00064 * included in the variables of any routine using RIGHT_SHIFT. 00065 */ 00066 00067 #ifdef RIGHT_SHIFT_IS_UNSIGNED 00068 #define SHIFT_TEMPS int32 shift_temp; 00069 #define RIGHT_SHIFT(x,shft) \ 00070 ((shift_temp = (x)) < 0 ? \ 00071 (shift_temp >> (shft)) | ((~((int32) 0)) << (32-(shft))) : \ 00072 (shift_temp >> (shft))) 00073 #else 00074 #define SHIFT_TEMPS 00075 #define RIGHT_SHIFT(x,shft) ((x) >> (shft)) 00076 #endif 00077 00078 00079 #endif /* DCT_INCLUDED */