ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

mem.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "common/scummsys.h"
00024 
00025 /* Common memory code used by the Indeo decoder
00026  *
00027  * Original copyright note: * Intel Indeo 4 (IV41, IV42, etc.) video decoder for ffmpeg
00028  * written, produced, and directed by Alan Smithee
00029  */
00030 
00031 #ifndef IMAGE_CODECS_INDEO_MEM_H
00032 #define IMAGE_CODECS_INDEO_MEM_H
00033 
00034 namespace Image {
00035 namespace Indeo {
00036 
00037 #define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
00038 #define FFALIGN(x, a) (((x) + (a)-1) & ~((a)-1))
00039 #define FFSIGN(a) ((a) > 0 ? 1 : -1)
00040 #define MAX_INTEGER 0x7ffffff
00041 
00049 extern void avFreeP(void *arg);
00050 
00051 
00067 extern void *avReallocF(void *ptr, size_t nelem, size_t elsize);
00068 
00073 extern uint16 invertBits(uint16 val, int nbits);
00074 
00078 extern uint32 bitswap32(uint32 x);
00079 
00085 inline uint8 avClipUint8(int a) {
00086     if (a & (~0xFF))
00087         return (-a) >> 31;
00088     else
00089         return a;
00090 }
00091 
00098 inline unsigned avClipUintp2(int a, int p) {
00099     if (a & ~((1 << p) - 1))
00100         return -a >> 31 & ((1 << p) - 1);
00101     else
00102         return  a;
00103 }
00104 
00105 extern const uint8 ffZigZagDirect[64];
00106 
00107 } // End of namespace Indeo
00108 } // End of namespace Image
00109 
00110 #endif


Generated on Sat May 18 2019 05:01:09 for ResidualVM by doxygen 1.7.1
curved edge   curved edge