From: Laszlo T. <ave...@us...> - 2010-09-07 17:44:15
|
gemrb: Infinity Engine emulator The branch master has been updated via 578e7416ab35fb4d08f49cf9d8b26489332d0cf9 (commit) Summary of changes: gemrb/plugins/BIKPlayer/BIKPlayer.cpp | 19 +++ gemrb/plugins/BIKPlayer/common.h | 274 +++++++++------------------------ gemrb/plugins/BIKPlayer/dsputil.h | 5 - gemrb/plugins/BIKPlayer/rational.cpp | 1 - gemrb/plugins/BIKPlayer/rational.h | 3 - 5 files changed, 95 insertions(+), 207 deletions(-) from 8ed4b071721d2d2fe3eda2b014621cdabec370ba (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=578e7416ab35fb4d08f49cf9d8b26489332d0cf9 commit 578e7416ab35fb4d08f49cf9d8b26489332d0cf9 Author: Avenger <ave...@so...> Date: Tue Sep 7 19:43:26 2010 +0200 cleaned up the Bikplayer a bit by removing unnecessary cruft and added back author comment diff --git a/gemrb/plugins/BIKPlayer/BIKPlayer.cpp b/gemrb/plugins/BIKPlayer/BIKPlayer.cpp index ab637b9..65092ab 100644 --- a/gemrb/plugins/BIKPlayer/BIKPlayer.cpp +++ b/gemrb/plugins/BIKPlayer/BIKPlayer.cpp @@ -19,6 +19,9 @@ */ /* + * code derived from FFMPeg + * @author Michael Niedermayer <mic...@gm...> + * * code derived from Bink Audio decoder * Copyright (c) 2007-2009 Peter Ross (pr...@xv...) * Copyright (c) 2009 Daniel Verkamp (da...@dr...) @@ -610,6 +613,22 @@ const uint8_t ff_log2_tab[256]={ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 }; +static inline av_const int av_log2(unsigned int v) +{ + int n = 0; + if (v & 0xffff0000) { + v >>= 16; + n += 16; + } + if (v & 0xff00) { + v >>= 8; + n += 8; + } + n += ff_log2_tab[v]; + + return n; +} + static inline int float_to_int16_one(const float *src){ float f = *src; // clamp the values to the range of an int16. diff --git a/gemrb/plugins/BIKPlayer/common.h b/gemrb/plugins/BIKPlayer/common.h index eb4e7f4..edc732b 100644 --- a/gemrb/plugins/BIKPlayer/common.h +++ b/gemrb/plugins/BIKPlayer/common.h @@ -1,200 +1,78 @@ -#ifndef AVUTIL_COMMON_H -#define AVUTIL_COMMON_H - +/* GemRB - Infinity Engine Emulator + * Copyright (C) 2003 The GemRB Project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + * Code derived from FFMPeg/libavutil/common.h + * @author Michael Niedermayer <mic...@gm...> + */ + +#ifndef AVUTIL_COMMON_H +#define AVUTIL_COMMON_H + #include "win32def.h" #include "globals.h" - -#include <ctype.h> -#include <errno.h> -#include <limits.h> -#include <math.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#define av_const -#define av_cold -#define av_flatten -#define attribute_deprecated -#define av_unused -#define av_uninit(x) x -#define av_always_inline inline - -#define uint8_t unsigned char -#define uint16_t unsigned short -#define uint32_t unsigned int -#define uint64_t __int64 - -#define int8_t signed char -#define int16_t signed short -#define int32_t signed int -#define int64_t signed __int64 - -//#ifndef MUL64 -//# define MUL64(a,b) ((int64_t)(a) * (int64_t)(b)) -//#endif - -//rounded division & shift -#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) -/* assume b>0 */ -#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) -#define FFABS(a) ((a) >= 0 ? (a) : (-(a))) -#define FFSIGN(a) ((a) > 0 ? 1 : -1) - -#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) -#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c) -#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) -#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c) - -#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) -#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) -#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1)) - -#ifndef M_E -#define M_E 2.7182818284590452354 /* e */ -#endif -#ifndef M_LN2 -#define M_LN2 0.69314718055994530942 /* log_e 2 */ -#endif -#ifndef M_LN10 -#define M_LN10 2.30258509299404568402 /* log_e 10 */ -#endif -#ifndef M_PI -#define M_PI 3.14159265358979323846 /* pi */ -#endif -#ifndef M_SQRT1_2 -#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ -#endif -#ifndef NAN -#define NAN (0.0/0.0) -#endif -#ifndef INFINITY -#define INFINITY (1.0/0.0) -#endif - -/* misc math functions */ - - -extern const uint8_t ff_log2_tab[256]; - -static inline av_const int av_log2(unsigned int v) -{ - int n = 0; - if (v & 0xffff0000) { - v >>= 16; - n += 16; - } - if (v & 0xff00) { - v >>= 8; - n += 8; - } - n += ff_log2_tab[v]; - - return n; -} - -static inline av_const int av_log2_16bit(unsigned int v) -{ - int n = 0; - if (v & 0xff00) { - v >>= 8; - n += 8; - } - //n += ff_log2_tab[v]; - - return n; -} - - -/** - * Clips a signed integer value into the amin-amax range. - * @param a value to clip - * @param amin minimum value of the clip range - * @param amax maximum value of the clip range - * @return clipped value - */ - -static inline av_const int av_clip(int a, int amin, int amax) -{ - if (a < amin) return amin; - else if (a > amax) return amax; - else return a; -} - -/** - * Clips a signed integer value into the 0-255 range. - * @param a value to clip - * @return clipped value - */ - -inline unsigned char av_clip_uint8(int a) -{ - if (a&(~255)) return (-a)>>31; - else return a; -} - -/** - * Clips a signed integer value into the 0-65535 range. - * @param a value to clip - * @return clipped value - */ -/* -static inline av_const uint16_t av_clip_uint16(int a) -{ - if (a&(~65535)) return (-a)>>31; - else return a; -} -*/ -/** - * Clips a signed integer value into the -32768,32767 range. - * @param a value to clip - * @return clipped value - */ -/* -static inline av_const int16_t av_clip_int16(int a) -{ - if ((a+32768) & ~65535) return (a>>31) ^ 32767; - else return a; -} -*/ -/** - * Clips a float value into the amin-amax range. - * @param a value to clip - * @param amin minimum value of the clip range - * @param amax maximum value of the clip range - * @return clipped value - */ -/* -static inline av_const float av_clipf(float a, float amin, float amax) -{ - if (a < amin) return amin; - else if (a > amax) return amax; - else return a; -} -*/ -/** Computes ceil(log2(x)). - * @param x value used to compute ceil(log2(x)) - * @return computed ceiling of log2(x) - */ - -/* -static inline av_const int av_ceil_log2(int x) -{ - return av_log2((x - 1) << 1); -} -*/ - -int64_t av_const av_gcd(int64_t a, int64_t b); - -void *av_malloc(unsigned int size); -void av_freep(void **ptr); - -/** - * data needed to decode 4-bit Huffman-coded value - */ -typedef struct Tree { - int vlc_num; ///< tree number (in bink_trees[]) - uint8_t syms[16]; ///< leaf value to symbol mapping -} Tree; - -#endif /* AVUTIL_COMMON_H */ + +#include <ctype.h> +#include <errno.h> +#include <limits.h> +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#define av_const +#define av_cold +#define av_flatten +#define attribute_deprecated +#define av_unused +#define av_uninit(x) x +#define av_always_inline inline + +#define uint8_t unsigned char +#define uint16_t unsigned short +#define uint32_t unsigned int +#define uint64_t __int64 + +#define int8_t signed char +#define int16_t signed short +#define int32_t signed int +#define int64_t signed __int64 + +#define FFABS(a) ((a) >= 0 ? (a) : (-(a))) +#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) +#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) + +#ifndef M_PI +#define M_PI 3.14159265358979323846 /* pi */ +#endif + +#ifndef M_SQRT1_2 +#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ +#endif + +void *av_malloc(unsigned int size); +void av_freep(void **ptr); + +/** + * data needed to decode 4-bit Huffman-coded value + */ +typedef struct Tree { + int vlc_num; ///< tree number (in bink_trees[]) + uint8_t syms[16]; ///< leaf value to symbol mapping +} Tree; + +#endif /* AVUTIL_COMMON_H */ diff --git a/gemrb/plugins/BIKPlayer/dsputil.h b/gemrb/plugins/BIKPlayer/dsputil.h index 8f7864a..7e21dc6 100644 --- a/gemrb/plugins/BIKPlayer/dsputil.h +++ b/gemrb/plugins/BIKPlayer/dsputil.h @@ -32,7 +32,6 @@ #include "common.h" -//#define DEBUG /* dct code */ typedef short DCTELEM; typedef int DWTELEM; @@ -52,10 +51,6 @@ typedef struct ScanTable{ void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable); -void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, - int block_w, int block_h, - int src_x, int src_y, int w, int h); - /** * Empty mmx state. * this must be called between any dsp function and float/double code. diff --git a/gemrb/plugins/BIKPlayer/rational.cpp b/gemrb/plugins/BIKPlayer/rational.cpp index 71d895b..d389568 100644 --- a/gemrb/plugins/BIKPlayer/rational.cpp +++ b/gemrb/plugins/BIKPlayer/rational.cpp @@ -26,7 +26,6 @@ */ #include <assert.h> -//#include <math.h> #include <limits.h> #include "common.h" diff --git a/gemrb/plugins/BIKPlayer/rational.h b/gemrb/plugins/BIKPlayer/rational.h index bcace8d..2d38645 100644 --- a/gemrb/plugins/BIKPlayer/rational.h +++ b/gemrb/plugins/BIKPlayer/rational.h @@ -28,9 +28,6 @@ #ifndef AVUTIL_RATIONAL_H #define AVUTIL_RATIONAL_H -//#include <stdint.h> -#include "common.h" - /** * rational number numerator/denominator */ ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |