systems out there.
Originally committed as revision 2480 to svn://svn.ffmpeg.org/ffmpeg/trunk
echo "#define WORDS_BIGENDIAN 1" >> $TMPH
fi
if test "$emu_fast_int" = "yes" ; then
-#note, we dont try to emulate fast64
- echo "typedef signed char int_fast8_t;" >> $TMPH
- echo "typedef signed int int_fast16_t;" >> $TMPH
- echo "typedef signed int int_fast32_t;" >> $TMPH
- echo "typedef unsigned char uint_fast8_t;" >> $TMPH
- echo "typedef unsigned int uint_fast16_t;" >> $TMPH
- echo "typedef unsigned int uint_fast32_t;" >> $TMPH
+ echo "#define EMULATE_FAST_INT 1" >> $TMPH
fi
if test "$mmx" = "yes" ; then
echo "TARGET_MMX=yes" >> config.mak
# define always_inline inline
#endif
+#ifdef EMULATE_FAST_INT
+/* note that we don't emulate 64bit ints */
+typedef signed char int_fast8_t;
+typedef signed int int_fast16_t;
+typedef signed int int_fast32_t;
+typedef unsigned char uint_fast8_t;
+typedef unsigned int uint_fast16_t;
+typedef unsigned int uint_fast32_t;
+#endif
+
+#if defined(CONFIG_OS2) || defined(CONFIG_SUNOS)
+static inline float floorf(float f) {
+ return floor(f);
+}
+#endif
+
#ifdef CONFIG_WIN32
/* windows */
}
#endif
-#if defined(CONFIG_OS2) || defined(CONFIG_SUNOS)
-static inline float floorf(float f) {
- return floor(f);
-}
-#endif
-
#endif
if (st->codec.extradata_size && (st->codec.bits_per_sample <= 8)) {
st->codec.palctrl = av_mallocz(sizeof(AVPaletteControl));
#ifdef WORDS_BIGENDIAN
- for (i = 0; i < FFMIN(st->codec.extradata_size / 4, 256); i++)
- st->codec.palctrl->palette[i] = bswap_32(st->codec.extradata)[i * 4]);
+ for (i = 0; i < FFMIN(st->codec.extradata_size, AVPALETTE_SIZE)/4; i++)
+ st->codec.palctrl->palette[i] = bswap_32(((uint32_t*)st->codec.extradata)[i]);
#else
memcpy(st->codec.palctrl->palette, st->codec.extradata,
FFMIN(st->codec.extradata_size, AVPALETTE_SIZE));
if (st->codec.extradata_size && (st->codec.bits_per_sample <= 8)) {
st->codec.palctrl = av_mallocz(sizeof(AVPaletteControl));
#ifdef WORDS_BIGENDIAN
- for (i = 0; i < FFMIN(st->codec.extradata_size / 4, 256); i++)
- st->codec.palctrl->palette[i] = bswap_32(st->codec.extradata)[i * 4]);
+ for (i = 0; i < FFMIN(st->codec.extradata_size, AVPALETTE_SIZE)/4; i++)
+ st->codec.palctrl->palette[i] = bswap_32(((uint32_t*)st->codec.extradata)[i]);
#else
memcpy(st->codec.palctrl->palette, st->codec.extradata,
FFMIN(st->codec.extradata_size, AVPALETTE_SIZE));