00001 /************************************************************************ 00002 * 00003 * vid_macros.h, part of tmn (TMN encoder) 00004 * Copyright (C) 1995, 1996 Telenor R&D, Norway 00005 * Karl Olav Lillevold <Karl.Lillevold@nta.no> 00006 * 00007 * Contacts: 00008 * Karl Olav Lillevold <Karl.Lillevold@nta.no>, or 00009 * Robert Danielsen <Robert.Danielsen@nta.no> 00010 * 00011 * Telenor Research and Development http://www.nta.no/brukere/DVC/ 00012 * P.O.Box 83 tel.: +47 63 84 84 00 00013 * N-2007 Kjeller, Norway fax.: +47 63 81 00 76 00014 * 00015 ************************************************************************/ 00016 00017 /* 00018 * Disclaimer of Warranty 00019 * 00020 * These software programs are available to the user without any 00021 * license fee or royalty on an "as is" basis. Telenor Research and 00022 * Development disclaims any and all warranties, whether express, 00023 * implied, or statuary, including any implied warranties or 00024 * merchantability or of fitness for a particular purpose. In no 00025 * event shall the copyright-holder be liable for any incidental, 00026 * punitive, or consequential damages of any kind whatsoever arising 00027 * from the use of these programs. 00028 * 00029 * This disclaimer of warranty extends to the user of these programs 00030 * and user's customers, employees, agents, transferees, successors, 00031 * and assigns. 00032 * 00033 * Telenor Research and Development does not represent or warrant that 00034 * the programs furnished hereunder are free of infringement of any 00035 * third-party patents. 00036 * 00037 * Commercial implementations of H.263, including shareware, are 00038 * subject to royalty fees to patent holders. Many of these patents 00039 * are general enough such that they are unavoidable regardless of 00040 * implementation design. 00041 * */ 00042 00043 00044 #define sign(a) ((a) < 0 ? -1 : 1) 00045 #define Int(a) ((a) < 0 ? (int)(a-0.5) : (int)(a)) 00046 #define mnint(a) ((a) < 0 ? (int)(a - 0.5) : (int)(a + 0.5)) 00047 #define mfloor(a) ((a) < 0 ? (int)(a - 0.5) : (int)(a)) 00048 #define mmax(a, b) ((a) > (b) ? (a) : (b)) 00049 #define mmin(a, b) ((a) < (b) ? (a) : (b)) 00050 #define limit(x) \ 00051 { \ 00052 if (x > 255) x = 255; \ 00053 if (x < 0) x = 0; \ 00054 } 00055 00056 00057