summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2005-07-19 20:30:38 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2005-07-19 20:30:38 +0000
commitfcc9a6282dd3c541055636ac49882d1639da251b (patch)
tree588b324e232caccf8085c85c7119d8d29ee2b6e8
parent6bfc655ee19aa82cce3277e6f9c861661cca5fb4 (diff)
downloadxine-lib-fcc9a6282dd3c541055636ac49882d1639da251b.tar.gz
xine-lib-fcc9a6282dd3c541055636ac49882d1639da251b.tar.bz2
here is cvs update people requested - somebody please check for gcc4 compatibility
CVS patchset: 7668 CVS date: 2005/07/19 20:30:38
-rw-r--r--src/libffmpeg/libavcodec/8bps.c2
-rw-r--r--src/libffmpeg/libavcodec/Makefile.am2
-rw-r--r--src/libffmpeg/libavcodec/adpcm.c90
-rw-r--r--src/libffmpeg/libavcodec/alac.c2
-rw-r--r--src/libffmpeg/libavcodec/alpha/asm.h32
-rw-r--r--src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c39
-rw-r--r--src/libffmpeg/libavcodec/armv4l/dsputil_arm.c2
-rw-r--r--src/libffmpeg/libavcodec/avcodec.h133
-rw-r--r--src/libffmpeg/libavcodec/bitstream.h12
-rw-r--r--src/libffmpeg/libavcodec/cabac.h2
-rw-r--r--src/libffmpeg/libavcodec/cinepak.c3
-rw-r--r--src/libffmpeg/libavcodec/common.h2
-rw-r--r--src/libffmpeg/libavcodec/dsputil.c34
-rw-r--r--src/libffmpeg/libavcodec/dsputil.h8
-rw-r--r--src/libffmpeg/libavcodec/h261.c4
-rw-r--r--src/libffmpeg/libavcodec/h263.c6
-rw-r--r--src/libffmpeg/libavcodec/h263data.h2
-rw-r--r--src/libffmpeg/libavcodec/h263dec.c12
-rw-r--r--src/libffmpeg/libavcodec/h264.c699
-rw-r--r--src/libffmpeg/libavcodec/h264data.h139
-rwxr-xr-xsrc/libffmpeg/libavcodec/h264idct.c71
-rw-r--r--src/libffmpeg/libavcodec/i386/Makefile.am1
-rw-r--r--src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c4
-rw-r--r--src/libffmpeg/libavcodec/i386/dsputil_mmx.c802
-rw-r--r--src/libffmpeg/libavcodec/i386/h264dsp_mmx.c912
-rw-r--r--src/libffmpeg/libavcodec/i386/idct_mmx.c1
-rw-r--r--src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c2
-rw-r--r--src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c6
-rw-r--r--src/libffmpeg/libavcodec/imgconvert.c2
-rw-r--r--src/libffmpeg/libavcodec/indeo2.c4
-rw-r--r--src/libffmpeg/libavcodec/libpostproc/postprocess_template.c4
-rw-r--r--src/libffmpeg/libavcodec/mjpeg.c16
-rw-r--r--src/libffmpeg/libavcodec/motion_est.c2
-rw-r--r--src/libffmpeg/libavcodec/mpeg12.c16
-rw-r--r--src/libffmpeg/libavcodec/mpeg12data.h10
-rw-r--r--src/libffmpeg/libavcodec/mpeg4data.h4
-rw-r--r--src/libffmpeg/libavcodec/mpegaudiodec.c2
-rw-r--r--src/libffmpeg/libavcodec/mpegaudiodectab.h4
-rw-r--r--src/libffmpeg/libavcodec/mpegaudiotab.h2
-rw-r--r--src/libffmpeg/libavcodec/mpegvideo.c37
-rw-r--r--src/libffmpeg/libavcodec/mpegvideo.h26
-rw-r--r--src/libffmpeg/libavcodec/msmpeg4data.h8
-rw-r--r--src/libffmpeg/libavcodec/parser.c68
-rw-r--r--src/libffmpeg/libavcodec/ppc/dsputil_ppc.c3
-rw-r--r--src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c3
-rw-r--r--src/libffmpeg/libavcodec/sp5x.h12
-rw-r--r--src/libffmpeg/libavcodec/svq1.c4
-rw-r--r--src/libffmpeg/libavcodec/svq3.c4
-rw-r--r--src/libffmpeg/libavcodec/truemotion1.c8
-rw-r--r--src/libffmpeg/libavcodec/truemotion1data.h38
-rwxr-xr-xsrc/libffmpeg/libavcodec/ulti.c4
-rwxr-xr-xsrc/libffmpeg/libavcodec/ulti_cb.h2
-rw-r--r--src/libffmpeg/libavcodec/utils.c43
-rw-r--r--src/libffmpeg/libavcodec/vorbis.c1471
-rw-r--r--src/libffmpeg/libavcodec/vorbis.h2228
-rw-r--r--src/libffmpeg/libavcodec/wmadec.c2
56 files changed, 5987 insertions, 1064 deletions
diff --git a/src/libffmpeg/libavcodec/8bps.c b/src/libffmpeg/libavcodec/8bps.c
index 3898ac5dd..4d5a64e5d 100644
--- a/src/libffmpeg/libavcodec/8bps.c
+++ b/src/libffmpeg/libavcodec/8bps.c
@@ -100,11 +100,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
dlen = be2me_16(*(unsigned short *)(lp+row*2));
/* Decode a row of this plane */
while(dlen > 0) {
+ if(dp + 1 >= buf+buf_size) return -1;
if ((count = *dp++) <= 127) {
count++;
dlen -= count + 1;
if (pixptr + count * px_inc > pixptr_end)
break;
+ if(dp + count > buf+buf_size) return -1;
while(count--) {
*pixptr = *dp++;
pixptr += px_inc;
diff --git a/src/libffmpeg/libavcodec/Makefile.am b/src/libffmpeg/libavcodec/Makefile.am
index 6edc54a4d..3095cb76c 100644
--- a/src/libffmpeg/libavcodec/Makefile.am
+++ b/src/libffmpeg/libavcodec/Makefile.am
@@ -88,6 +88,7 @@ libavcodec_la_SOURCES = \
utils.c \
vcr1.c \
vmdav.c \
+ vorbis.c \
vp3.c \
vp3dsp.c \
vqavideo.c \
@@ -140,5 +141,6 @@ noinst_HEADERS = \
svq1_vlc.h \
truemotion1data.h \
ulti_cb.h \
+ vorbis.h \
vp3data.h \
wmadata.h
diff --git a/src/libffmpeg/libavcodec/adpcm.c b/src/libffmpeg/libavcodec/adpcm.c
index 043c4d4b2..3c67242f4 100644
--- a/src/libffmpeg/libavcodec/adpcm.c
+++ b/src/libffmpeg/libavcodec/adpcm.c
@@ -99,24 +99,34 @@ static const int xa_adpcm_table[5][2] = {
{ 122, -60 }
};
-static int ea_adpcm_table[] = {
+static const int ea_adpcm_table[] = {
0, 240, 460, 392, 0, 0, -208, -220, 0, 1,
3, 4, 7, 8, 10, 11, 0, -1, -3, -4
};
-static int ct_adpcm_table[8] = {
+static const int ct_adpcm_table[8] = {
0x00E6, 0x00E6, 0x00E6, 0x00E6,
0x0133, 0x0199, 0x0200, 0x0266
};
// padded to zero where table size is less then 16
-static int swf_index_tables[4][16] = {
+static const int swf_index_tables[4][16] = {
/*2*/ { -1, 2 },
/*3*/ { -1, -1, 2, 4 },
/*4*/ { -1, -1, -1, -1, 2, 4, 6, 8 },
/*5*/ { -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16 }
};
+static const int yamaha_indexscale[] = {
+ 230, 230, 230, 230, 307, 409, 512, 614,
+ 230, 230, 230, 230, 307, 409, 512, 614
+};
+
+static const int yamaha_difflookup[] = {
+ 1, 3, 5, 7, 9, 11, 13, 15,
+ -1, -3, -5, -7, -9, -11, -13, -15
+};
+
/* end of tables */
typedef struct ADPCMChannelStatus {
@@ -168,6 +178,10 @@ static int adpcm_encode_init(AVCodecContext *avctx)
/* and we have 7 bytes per channel overhead */
avctx->block_align = BLKSIZE;
break;
+ case CODEC_ID_ADPCM_YAMAHA:
+ avctx->frame_size = BLKSIZE * avctx->channels;
+ avctx->block_align = BLKSIZE;
+ break;
default:
return -1;
break;
@@ -260,6 +274,31 @@ static inline unsigned char adpcm_ms_compress_sample(ADPCMChannelStatus *c, shor
return nibble;
}
+static inline unsigned char adpcm_yamaha_compress_sample(ADPCMChannelStatus *c, short sample)
+{
+ int i1 = 0, j1;
+
+ if(!c->step) {
+ c->predictor = 0;
+ c->step = 127;
+ }
+ j1 = sample - c->predictor;
+
+ j1 = (j1 * 8) / c->step;
+ i1 = abs(j1) / 2;
+ if (i1 > 7)
+ i1 = 7;
+ if (j1 < 0)
+ i1 += 8;
+
+ c->predictor = c->predictor + ((c->step * yamaha_difflookup[i1]) / 8);
+ CLAMP_TO_SHORT(c->predictor);
+ c->step = (c->step * yamaha_indexscale[i1]) >> 8;
+ c->step = clip(c->step, 127, 24567);
+
+ return i1;
+}
+
static int adpcm_encode_frame(AVCodecContext *avctx,
unsigned char *frame, int buf_size, void *data)
{
@@ -362,6 +401,18 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
*dst++ = nibble;
}
break;
+ case CODEC_ID_ADPCM_YAMAHA:
+ n = avctx->frame_size / 2;
+ for (; n>0; n--) {
+ for(i = 0; i < avctx->channels; i++) {
+ int nibble;
+ nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]);
+ nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]) << 4;
+ *dst++ = nibble;
+ }
+ samples += 2 * avctx->channels;
+ }
+ break;
default:
return -1;
}
@@ -463,6 +514,20 @@ static inline short adpcm_ct_expand_nibble(ADPCMChannelStatus *c, char nibble)
return (short)predictor;
}
+static inline short adpcm_yamaha_expand_nibble(ADPCMChannelStatus *c, unsigned char nibble)
+{
+ if(!c->step) {
+ c->predictor = 0;
+ c->step = 127;
+ }
+
+ c->predictor += (c->step * yamaha_difflookup[nibble]) / 8;
+ CLAMP_TO_SHORT(c->predictor);
+ c->step = (c->step * yamaha_indexscale[nibble]) >> 8;
+ c->step = clip(c->step, 127, 24567);
+ return c->predictor;
+}
+
static void xa_decode(short *out, const unsigned char *in,
ADPCMChannelStatus *left, ADPCMChannelStatus *right, int inc)
{
@@ -911,7 +976,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
case CODEC_ID_ADPCM_SWF:
{
GetBitContext gb;
- int *table;
+ const int *table;
int k0, signmask;
int size = buf_size*8;
@@ -978,6 +1043,22 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
break;
}
+ case CODEC_ID_ADPCM_YAMAHA:
+ while (src < buf + buf_size) {
+ if (st) {
+ *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
+ src[0] & 0x0F);
+ *samples++ = adpcm_yamaha_expand_nibble(&c->status[1],
+ (src[0] >> 4) & 0x0F);
+ } else {
+ *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
+ src[0] & 0x0F);
+ *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
+ (src[0] >> 4) & 0x0F);
+ }
+ src++;
+ }
+ break;
default:
return -1;
}
@@ -1035,5 +1116,6 @@ ADPCM_CODEC(CODEC_ID_ADPCM_ADX, adpcm_adx);
ADPCM_CODEC(CODEC_ID_ADPCM_EA, adpcm_ea);
ADPCM_CODEC(CODEC_ID_ADPCM_CT, adpcm_ct);
ADPCM_CODEC(CODEC_ID_ADPCM_SWF, adpcm_swf);
+ADPCM_CODEC(CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha);
#undef ADPCM_CODEC
diff --git a/src/libffmpeg/libavcodec/alac.c b/src/libffmpeg/libavcodec/alac.c
index 5ae2e00f4..2943b4dc5 100644
--- a/src/libffmpeg/libavcodec/alac.c
+++ b/src/libffmpeg/libavcodec/alac.c
@@ -586,7 +586,7 @@ static int alac_decode_frame(AVCodecContext *avctx,
int i;
for (i = 0; i < outputsamples; i++) {
int16_t sample = alac->outputsamples_buffer_a[i];
- be2me_16(sample);
+ sample = be2me_16(sample);
((int16_t*)outbuffer)[i * alac->numchannels] = sample;
}
break;
diff --git a/src/libffmpeg/libavcodec/alpha/asm.h b/src/libffmpeg/libavcodec/alpha/asm.h
index 21a737d3f..6dc997b37 100644
--- a/src/libffmpeg/libavcodec/alpha/asm.h
+++ b/src/libffmpeg/libavcodec/alpha/asm.h
@@ -56,13 +56,33 @@ static inline uint64_t WORD_VEC(uint64_t x)
return x;
}
-#define ldq(p) (*(const uint64_t *) (p))
-#define ldl(p) (*(const int32_t *) (p))
-#define stl(l, p) do { *(uint32_t *) (p) = (l); } while (0)
-#define stq(l, p) do { *(uint64_t *) (p) = (l); } while (0)
#define sextw(x) ((int16_t) (x))
#ifdef __GNUC__
+#define ldq(p) \
+ (((union { \
+ uint64_t __l; \
+ __typeof__(*(p)) __s[sizeof (uint64_t) / sizeof *(p)]; \
+ } *) (p))->__l)
+#define ldl(p) \
+ (((union { \
+ int32_t __l; \
+ __typeof__(*(p)) __s[sizeof (int32_t) / sizeof *(p)]; \
+ } *) (p))->__l)
+#define stq(l, p) \
+ do { \
+ (((union { \
+ uint64_t __l; \
+ __typeof__(*(p)) __s[sizeof (uint64_t) / sizeof *(p)]; \
+ } *) (p))->__l) = l; \
+ } while (0)
+#define stl(l, p) \
+ do { \
+ (((union { \
+ int32_t __l; \
+ __typeof__(*(p)) __s[sizeof (int32_t) / sizeof *(p)]; \
+ } *) (p))->__l) = l; \
+ } while (0)
struct unaligned_long { uint64_t l; } __attribute__((packed));
#define ldq_u(p) (*(const uint64_t *) (((uint64_t) (p)) & ~7ul))
#define uldq(a) (((const struct unaligned_long *) (a))->l)
@@ -132,6 +152,10 @@ struct unaligned_long { uint64_t l; } __attribute__((packed));
#elif defined(__DECC) /* Digital/Compaq/hp "ccc" compiler */
#include <c_asm.h>
+#define ldq(p) (*(const uint64_t *) (p))
+#define ldl(p) (*(const int32_t *) (p))
+#define stq(l, p) do { *(uint64_t *) (p) = (l); } while (0)
+#define stl(l, p) do { *(int32_t *) (p) = (l); } while (0)
#define ldq_u(a) asm ("ldq_u %v0,0(%a0)", a)
#define uldq(a) (*(const __unaligned uint64_t *) (a))
#define cmpbge(a, b) asm ("cmpbge %a0,%a1,%v0", a, b)
diff --git a/src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c b/src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c
index 889fd2ae1..293a2f970 100644
--- a/src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c
+++ b/src/libffmpeg/libavcodec/alpha/simple_idct_alpha.c
@@ -235,25 +235,22 @@ static inline void idct_col2(DCTELEM *col)
{
int i;
uint64_t l, r;
- uint64_t *lcol = (uint64_t *) col;
for (i = 0; i < 8; ++i) {
- int_fast32_t a0 = col[0] + (1 << (COL_SHIFT - 1)) / W4;
+ int_fast32_t a0 = col[i] + (1 << (COL_SHIFT - 1)) / W4;
a0 *= W4;
- col[0] = a0 >> COL_SHIFT;
- ++col;
+ col[i] = a0 >> COL_SHIFT;
}
- l = lcol[0];
- r = lcol[1];
- lcol[ 2] = l; lcol[ 3] = r;
- lcol[ 4] = l; lcol[ 5] = r;
- lcol[ 6] = l; lcol[ 7] = r;
- lcol[ 8] = l; lcol[ 9] = r;
- lcol[10] = l; lcol[11] = r;
- lcol[12] = l; lcol[13] = r;
- lcol[14] = l; lcol[15] = r;
+ l = ldq(col + 0 * 4); r = ldq(col + 1 * 4);
+ stq(l, col + 2 * 4); stq(r, col + 3 * 4);
+ stq(l, col + 4 * 4); stq(r, col + 5 * 4);
+ stq(l, col + 6 * 4); stq(r, col + 7 * 4);
+ stq(l, col + 8 * 4); stq(r, col + 9 * 4);
+ stq(l, col + 10 * 4); stq(r, col + 11 * 4);
+ stq(l, col + 12 * 4); stq(r, col + 13 * 4);
+ stq(l, col + 14 * 4); stq(r, col + 15 * 4);
}
void simple_idct_axp(DCTELEM *block)
@@ -275,22 +272,20 @@ void simple_idct_axp(DCTELEM *block)
if (rowsZero) {
idct_col2(block);
} else if (rowsConstant) {
- uint64_t *lblock = (uint64_t *) block;
-
idct_col(block);
for (i = 0; i < 8; i += 2) {
- uint64_t v = (uint16_t) block[i * 8];
- uint64_t w = (uint16_t) block[i * 8 + 8];
+ uint64_t v = (uint16_t) block[0];
+ uint64_t w = (uint16_t) block[8];
v |= v << 16;
w |= w << 16;
v |= v << 32;
w |= w << 32;
- lblock[0] = v;
- lblock[1] = v;
- lblock[2] = w;
- lblock[3] = w;
- lblock += 4;
+ stq(v, block + 0 * 4);
+ stq(v, block + 1 * 4);
+ stq(w, block + 2 * 4);
+ stq(w, block + 3 * 4);
+ block += 4 * 4;
}
} else {
for (i = 0; i < 8; i++)
diff --git a/src/libffmpeg/libavcodec/armv4l/dsputil_arm.c b/src/libffmpeg/libavcodec/armv4l/dsputil_arm.c
index 4ba628096..0195c3ca6 100644
--- a/src/libffmpeg/libavcodec/armv4l/dsputil_arm.c
+++ b/src/libffmpeg/libavcodec/armv4l/dsputil_arm.c
@@ -240,9 +240,7 @@ void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx)
c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; //OK
/* c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;//NG */
-#if 1
#ifdef HAVE_IWMMXT
dsputil_init_iwmmxt(c, avctx);
#endif
-#endif
}
diff --git a/src/libffmpeg/libavcodec/avcodec.h b/src/libffmpeg/libavcodec/avcodec.h
index bbceb2329..c14867d34 100644
--- a/src/libffmpeg/libavcodec/avcodec.h
+++ b/src/libffmpeg/libavcodec/avcodec.h
@@ -16,8 +16,9 @@ extern "C" {
#include <sys/types.h> /* size_t */
#define FFMPEG_VERSION_INT 0x000409
-#define FFMPEG_VERSION "0.4.9-pre1"
-#define LIBAVCODEC_BUILD 4755
+#define FFMPEG_VERSION "CVS"
+#define LIBAVCODEC_BUILD 4758
+
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION
@@ -143,6 +144,7 @@ enum CodecID {
CODEC_ID_ADPCM_G726,
CODEC_ID_ADPCM_CT,
CODEC_ID_ADPCM_SWF,
+ CODEC_ID_ADPCM_YAMAHA,
/* AMR */
CODEC_ID_AMR_NB= 0x12000,
@@ -182,6 +184,10 @@ enum CodecID {
CODEC_ID_GSM,
CODEC_ID_OGGTHEORA= 0x16000,
+
+ /* subtitle codecs */
+ CODEC_ID_DVD_SUBTITLE= 0x17000,
+ CODEC_ID_DVB_SUBTITLE,
CODEC_ID_MPEG2TS= 0x20000, /* _FAKE_ codec to indicate a raw MPEG2 transport
stream (only used by libavformat) */
@@ -195,6 +201,7 @@ enum CodecType {
CODEC_TYPE_VIDEO,
CODEC_TYPE_AUDIO,
CODEC_TYPE_DATA,
+ CODEC_TYPE_SUBTITLE,
};
/**
@@ -286,6 +293,16 @@ enum AVRounding {
AV_ROUND_NEAR_INF = 5, ///< round to nearest and halfway cases away from zero
};
+enum AVDiscard{
+//we leave some space between them for extensions (drop some keyframes for intra only or drop just some bidir frames)
+ AVDISCARD_NONE =-16, ///< discard nothing
+ AVDISCARD_DEFAULT= 0, ///< discard useless packets like 0 size packets in avi
+ AVDISCARD_NONREF = 8, ///< discard all non reference
+ AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames
+ AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes
+ AVDISCARD_ALL = 48, ///< discard all
+};
+
typedef struct RcOverride{
int start_frame;
int end_frame;
@@ -300,7 +317,7 @@ extern int motion_estimation_method;
/* encoding support
these flags can be passed in AVCodecContext.flags before initing
- Note: note not everything is supported yet
+ Note: not everything is supported yet.
*/
#define CODEC_FLAG_QSCALE 0x0002 ///< use fixed qscale
@@ -316,7 +333,7 @@ extern int motion_estimation_method;
#define CODEC_FLAG_PASS2 0x0400 ///< use internal 2pass ratecontrol in second pass mode
#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< use external huffman table (for mjpeg)
#define CODEC_FLAG_GRAY 0x2000 ///< only decode/encode grayscale
-#define CODEC_FLAG_EMU_EDGE 0x4000///< dont draw edges
+#define CODEC_FLAG_EMU_EDGE 0x4000///< don't draw edges
#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding
#define CODEC_FLAG_TRUNCATED 0x00010000 /** input bitstream might be truncated at a random location instead
of only at frame boundaries */
@@ -343,6 +360,7 @@ extern int motion_estimation_method;
#define CODEC_FLAG2_FAST 0x00000001 ///< allow non spec compliant speedup tricks
#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< strictly enforce GOP size
#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< skip bitstream encoding
+#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< place global headers at every keyframe instead of in extradata
/* Unsupported options :
* Syntax Arithmetic coding (SAC)
@@ -369,7 +387,7 @@ extern int motion_estimation_method;
*/
#define CODEC_CAP_DELAY 0x0020
-//the following defines might change, so dont expect compatibility if u use them
+//the following defines may change, don't expect compatibility if you use them
#define MB_TYPE_INTRA4x4 0x0001
#define MB_TYPE_INTRA16x16 0x0002 //FIXME h264 specific
#define MB_TYPE_INTRA_PCM 0x0004 //FIXME h264 specific
@@ -432,7 +450,7 @@ typedef struct AVPanScan{
int linesize[4];\
/**\
* pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer\
- * this isnt used by lavc unless the default get/release_buffer() is used\
+ * this isn't used by lavc unless the default get/release_buffer() is used\
* - encoding: \
* - decoding: \
*/\
@@ -634,8 +652,8 @@ typedef struct AVPanScan{
#define FF_BUFFER_TYPE_INTERNAL 1
#define FF_BUFFER_TYPE_USER 2 ///< Direct rendering buffers (image is (de)allocated by user)
-#define FF_BUFFER_TYPE_SHARED 4 ///< buffer from somewher else, dont dealloc image (data/base), all other tables are not shared
-#define FF_BUFFER_TYPE_COPY 8 ///< just a (modified) copy of some other buffer, dont dealloc anything
+#define FF_BUFFER_TYPE_SHARED 4 ///< buffer from somewhere else, don't dealloc image (data/base), all other tables are not shared
+#define FF_BUFFER_TYPE_COPY 8 ///< just a (modified) copy of some other buffer, don't dealloc anything
#define FF_I_TYPE 1 // Intra
@@ -798,7 +816,10 @@ typedef struct AVCodecContext {
enum SampleFormat sample_fmt; ///< sample format, currenly unused
/* the following data should not be initialized */
- int frame_size; ///< in samples, initialized when calling 'init'
+ /**
+ * samples per packet. initialized when calling 'init'
+ */
+ int frame_size;
int frame_number; ///< audio or video frame number
int real_pict_num; ///< returns the real picture number of previous encoded frame
@@ -856,6 +877,7 @@ typedef struct AVCodecContext {
/**
* hurry up amount.
+ * deprecated in favor of skip_idct and skip_frame
* - encoding: unused
* - decoding: set by user. 1-> skip b frames, 2-> skip idct/dequant too, 5-> skip everything except header
*/
@@ -868,7 +890,7 @@ typedef struct AVCodecContext {
/* unused, FIXME remove*/
int rtp_mode;
- int rtp_payload_size; /* The size of the RTP payload, the coder will */
+ int rtp_payload_size; /* The size of the RTP payload: the coder will */
/* do it's best to deliver a chunk with size */
/* below rtp_payload_size, the chunk will start */
/* with a start code on some codecs like H.263 */
@@ -876,12 +898,12 @@ typedef struct AVCodecContext {
/* headers inside the transmited RTP payload */
- /* The RTP callcack: This function is called */
- /* every time the encoder as a packet to send */
- /* Depends on the encoder if the data starts */
- /* with a Start Code (it should) H.263 does. */
- /* mb_nb contains the number of macroblocks */
- /* encoded in the RTP payload */
+ /* The RTP callback: This function is called */
+ /* every time the encoder has a packet to send */
+ /* Depends on the encoder if the data starts */
+ /* with a Start Code (it should) H.263 does. */
+ /* mb_nb contains the number of macroblocks */
+ /* encoded in the RTP payload */
void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
/* statistics, used for 2-pass encoding */
@@ -1015,8 +1037,12 @@ typedef struct AVCodecContext {
* - decoding: set by lavc
*/
int has_b_frames;
-
- int block_align; ///< used by some WAV based audio codecs
+
+ /**
+ * number of bytes per packet if constant and known or 0
+ * used by some WAV based audio codecs
+ */
+ int block_align;
int parse_only; /* - decoding only: if true, only parsing is done
(function avcodec_parse_frame()). The frame
@@ -1187,7 +1213,7 @@ typedef struct AVCodecContext {
#define FF_IDCT_SIMPLEARM 10
#define FF_IDCT_H264 11
#define FF_IDCT_VP3 12
-#define FP_IDCT_IPP 13
+#define FF_IDCT_IPP 13
/**
* slice count.
@@ -1230,6 +1256,9 @@ typedef struct AVCodecContext {
#define FF_MM_SSE2 0x0010 /* PIV SSE2 functions */
#define FF_MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
#endif /* HAVE_MMX */
+#ifdef HAVE_IWMMXT
+#define FF_MM_IWMMXT 0x0100 /* XScale IWMMXT */
+#endif /* HAVE_IWMMXT */
/**
* bits per sample/pixel from the demuxer (needed for huffyuv).
@@ -1460,13 +1489,13 @@ typedef struct AVCodecContext {
/**
* internal_buffer count.
- * Dont touch, used by lavc default_get_buffer()
+ * Don't touch, used by lavc default_get_buffer()
*/
int internal_buffer_count;
/**
* internal_buffers.
- * Dont touch, used by lavc default_get_buffer()
+ * Don't touch, used by lavc default_get_buffer()
*/
void *internal_buffer;
@@ -1798,6 +1827,27 @@ typedef struct AVCodecContext {
* - decoding: unused
*/
int me_penalty_compensation;
+
+ /**
+ *
+ * - encoding: unused
+ * - decoding: set by user.
+ */
+ enum AVDiscard skip_loop_filter;
+
+ /**
+ *
+ * - encoding: unused
+ * - decoding: set by user.
+ */
+ enum AVDiscard skip_idct;
+
+ /**
+ *
+ * - encoding: unused
+ * - decoding: set by user.
+ */
+ enum AVDiscard skip_frame;
} AVCodecContext;
@@ -1887,6 +1937,25 @@ typedef struct AVPaletteControl {
} AVPaletteControl;
+typedef struct AVSubtitleRect {
+ uint16_t x;
+ uint16_t y;
+ uint16_t w;
+ uint16_t h;
+ uint16_t nb_colors;
+ int linesize;
+ uint32_t *rgba_palette;
+ uint8_t *bitmap;
+} AVSubtitleRect;
+
+typedef struct AVSubtitle {
+ uint16_t format; /* 0 = graphics */
+ uint32_t start_display_time; /* relative to packet pts, in ms */
+ uint32_t end_display_time; /* relative to packet pts, in ms */
+ uint32_t num_rects;
+ AVSubtitleRect *rects;
+} AVSubtitle;
+
extern AVCodec ac3_encoder;
extern AVCodec mp2_encoder;
extern AVCodec mp3lame_encoder;
@@ -2063,6 +2132,7 @@ PCM_CODEC(CODEC_ID_ADPCM_EA, adpcm_ea);
PCM_CODEC(CODEC_ID_ADPCM_G726, adpcm_g726);
PCM_CODEC(CODEC_ID_ADPCM_CT, adpcm_ct);
PCM_CODEC(CODEC_ID_ADPCM_SWF, adpcm_swf);
+PCM_CODEC(CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha);
#undef PCM_CODEC
@@ -2074,6 +2144,11 @@ extern AVCodec rawvideo_decoder;
extern AVCodec ac3_decoder;
extern AVCodec dts_decoder;
+/* subtitles */
+extern AVCodec dvdsub_decoder;
+extern AVCodec dvbsub_encoder;
+extern AVCodec dvbsub_decoder;
+
/* resample.c */
struct ReSampleContext;
@@ -2211,6 +2286,9 @@ int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
int *got_picture_ptr,
uint8_t *buf, int buf_size);
+int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
+ int *got_sub_ptr,
+ const uint8_t *buf, int buf_size);
int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,
int *data_size_ptr,
uint8_t *buf, int buf_size);
@@ -2218,6 +2296,8 @@ int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const short *samples);
int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
const AVFrame *pict);
+int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+ const AVSubtitle *sub);
int avcodec_close(AVCodecContext *avctx);
@@ -2244,13 +2324,13 @@ int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max)
/**
* rescale a 64bit integer with rounding to nearest.
- * a simple a*b/c isnt possible as it can overflow
+ * a simple a*b/c isn't possible as it can overflow
*/
int64_t av_rescale(int64_t a, int64_t b, int64_t c);
/**
* rescale a 64bit integer with specified rounding.
- * a simple a*b/c isnt possible as it can overflow
+ * a simple a*b/c isn't possible as it can overflow
*/
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding);
@@ -2294,6 +2374,7 @@ typedef struct AVCodecParser {
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size);
void (*parser_close)(AVCodecParserContext *s);
+ int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
struct AVCodecParser *next;
} AVCodecParser;
@@ -2306,6 +2387,10 @@ int av_parser_parse(AVCodecParserContext *s,
uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size,
int64_t pts, int64_t dts);
+int av_parser_change(AVCodecParserContext *s,
+ AVCodecContext *avctx,
+ uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size, int keyframe);
void av_parser_close(AVCodecParserContext *s);
extern AVCodecParser mpegvideo_parser;
@@ -2317,6 +2402,8 @@ extern AVCodecParser mjpeg_parser;
extern AVCodecParser pnm_parser;
extern AVCodecParser mpegaudio_parser;
extern AVCodecParser ac3_parser;
+extern AVCodecParser dvdsub_parser;
+extern AVCodecParser dvbsub_parser;
/* memory */
void *av_malloc(unsigned int size);
diff --git a/src/libffmpeg/libavcodec/bitstream.h b/src/libffmpeg/libavcodec/bitstream.h
index ce664cee1..0e60ea1d4 100644
--- a/src/libffmpeg/libavcodec/bitstream.h
+++ b/src/libffmpeg/libavcodec/bitstream.h
@@ -334,14 +334,14 @@ GET_CACHE(name, gb)
will output the contents of the internal cache, next bit is MSB of 32 or 64 bit (FIXME 64bit)
SHOW_UBITS(name, gb, num)
- will return the nest num bits
+ will return the next num bits
SHOW_SBITS(name, gb, num)
- will return the nest num bits and do sign extension
+ will return the next num bits and do sign extension
SKIP_BITS(name, gb, num)
will skip over the next num bits
- note, this is equinvalent to SKIP_CACHE; SKIP_COUNTER
+ note, this is equivalent to SKIP_CACHE; SKIP_COUNTER
SKIP_CACHE(name, gb, num)
will remove the next num bits from the cache (note SKIP_COUNTER MUST be called before UPDATE_CACHE / CLOSE_READER)
@@ -353,7 +353,7 @@ LAST_SKIP_CACHE(name, gb, num)
will remove the next num bits from the cache if it is needed for UPDATE_CACHE otherwise it will do nothing
LAST_SKIP_BITS(name, gb, num)
- is equinvalent to SKIP_LAST_CACHE; SKIP_COUNTER
+ is equivalent to SKIP_LAST_CACHE; SKIP_COUNTER
for examples see get_bits, show_bits, skip_bits, get_vlc
*/
@@ -598,7 +598,7 @@ static inline int get_sbits(GetBitContext *s, int n){
/**
* reads 0-17 bits.
- * Note, the alt bitstream reader can read upto 25 bits, but the libmpeg2 reader cant
+ * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
*/
static inline unsigned int get_bits(GetBitContext *s, int n){
register int tmp;
@@ -614,7 +614,7 @@ unsigned int get_bits_long(GetBitContext *s, int n);
/**
* shows 0-17 bits.
- * Note, the alt bitstream reader can read upto 25 bits, but the libmpeg2 reader cant
+ * Note, the alt bitstream reader can read up to 25 bits, but the libmpeg2 reader can't
*/
static inline unsigned int show_bits(GetBitContext *s, int n){
register int tmp;
diff --git a/src/libffmpeg/libavcodec/cabac.h b/src/libffmpeg/libavcodec/cabac.h
index cc03eba96..15ec88d92 100644
--- a/src/libffmpeg/libavcodec/cabac.h
+++ b/src/libffmpeg/libavcodec/cabac.h
@@ -254,7 +254,7 @@ static inline void put_cabac_ueg(CABACContext *c, uint8_t * state, int v, int ma
}
static void refill(CABACContext *c){
- if(c->bytestream < c->bytestream_end)
+ if(c->bytestream <= c->bytestream_end)
#if CABAC_BITS == 16
c->low+= ((c->bytestream[0]<<9) + (c->bytestream[1])<<1);
#else
diff --git a/src/libffmpeg/libavcodec/cinepak.c b/src/libffmpeg/libavcodec/cinepak.c
index 3c560fdc5..3b00a1605 100644
--- a/src/libffmpeg/libavcodec/cinepak.c
+++ b/src/libffmpeg/libavcodec/cinepak.c
@@ -274,6 +274,9 @@ static int cinepak_decode_strip (CinepakContext *s,
while ((data + 4) <= eod) {
chunk_id = BE_16 (&data[0]);
chunk_size = BE_16 (&data[2]) - 4;
+ if(chunk_size < 0)
+ return -1;
+
data += 4;
chunk_size = ((data + chunk_size) > eod) ? (eod - data) : chunk_size;
diff --git a/src/libffmpeg/libavcodec/common.h b/src/libffmpeg/libavcodec/common.h
index a54ab233d..3f7ae5081 100644
--- a/src/libffmpeg/libavcodec/common.h
+++ b/src/libffmpeg/libavcodec/common.h
@@ -130,13 +130,13 @@
#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;
+typedef uint64_t uint_fast64_t;
#endif
#ifndef INT_BIT
diff --git a/src/libffmpeg/libavcodec/dsputil.c b/src/libffmpeg/libavcodec/dsputil.c
index 69731b070..698b906ea 100644
--- a/src/libffmpeg/libavcodec/dsputil.c
+++ b/src/libffmpeg/libavcodec/dsputil.c
@@ -561,6 +561,37 @@ static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels
block += 8;
}
}
+
+static void add_pixels8_c(uint8_t *restrict pixels, DCTELEM *block, int line_size)
+{
+ int i;
+ for(i=0;i<8;i++) {
+ pixels[0] += block[0];
+ pixels[1] += block[1];
+ pixels[2] += block[2];
+ pixels[3] += block[3];
+ pixels[4] += block[4];
+ pixels[5] += block[5];
+ pixels[6] += block[6];
+ pixels[7] += block[7];
+ pixels += line_size;
+ block += 8;
+ }
+}
+
+static void add_pixels4_c(uint8_t *restrict pixels, DCTELEM *block, int line_size)
+{
+ int i;
+ for(i=0;i<4;i++) {
+ pixels[0] += block[0];
+ pixels[1] += block[1];
+ pixels[2] += block[2];
+ pixels[3] += block[3];
+ pixels += line_size;
+ block += 4;
+ }
+}
+
#if 0
#define PIXOP2(OPNAME, OP) \
@@ -3687,12 +3718,15 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx)
}
c->h264_idct_add= ff_h264_idct_add_c;
+ c->h264_idct8_add= ff_h264_idct8_add_c;
c->get_pixels = get_pixels_c;
c->diff_pixels = diff_pixels_c;
c->put_pixels_clamped = put_pixels_clamped_c;
c->put_signed_pixels_clamped = put_signed_pixels_clamped_c;
c->add_pixels_clamped = add_pixels_clamped_c;
+ c->add_pixels8 = add_pixels8_c;
+ c->add_pixels4 = add_pixels4_c;
c->gmc1 = gmc1_c;
c->gmc = gmc_c;
c->clear_blocks = clear_blocks_c;
diff --git a/src/libffmpeg/libavcodec/dsputil.h b/src/libffmpeg/libavcodec/dsputil.h
index 341d350b5..a3fbb1f6f 100644
--- a/src/libffmpeg/libavcodec/dsputil.h
+++ b/src/libffmpeg/libavcodec/dsputil.h
@@ -53,6 +53,7 @@ void ff_fdct_mmx(DCTELEM *block);
void ff_fdct_mmx2(DCTELEM *block);
void ff_fdct_sse2(DCTELEM *block);
+void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride);
void ff_h264_idct_add_c(uint8_t *dst, DCTELEM *block, int stride);
void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block);
void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block);
@@ -143,6 +144,8 @@ typedef struct DSPContext {
void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*put_signed_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
+ void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size);
+ void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size);
/**
* translational global motion compensation.
*/
@@ -328,6 +331,7 @@ typedef struct DSPContext {
#define RECON_SHIFT 6
void (*h264_idct_add)(uint8_t *dst, DCTELEM *block, int stride);
+ void (*h264_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
} DSPContext;
void dsputil_static_init(void);
@@ -431,6 +435,10 @@ void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
#define __align8 __attribute__ ((aligned (4)))
#define STRIDE_ALIGN 4
+#define MM_IWMMXT 0x0100 /* XScale IWMMXT */
+
+extern int mm_flags;
+
void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx);
#elif defined(HAVE_MLIB)
diff --git a/src/libffmpeg/libavcodec/h261.c b/src/libffmpeg/libavcodec/h261.c
index f9e148455..a823cc39b 100644
--- a/src/libffmpeg/libavcodec/h261.c
+++ b/src/libffmpeg/libavcodec/h261.c
@@ -970,6 +970,10 @@ retry:
/* skip everything if we are in a hurry>=5 */
if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
+ if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
+ ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
+ || avctx->skip_frame >= AVDISCARD_ALL)
+ return get_consumed_bytes(s, buf_size);
if(MPV_frame_start(s, avctx) < 0)
return -1;
diff --git a/src/libffmpeg/libavcodec/h263.c b/src/libffmpeg/libavcodec/h263.c
index 08306011b..415369ee0 100644
--- a/src/libffmpeg/libavcodec/h263.c
+++ b/src/libffmpeg/libavcodec/h263.c
@@ -238,10 +238,10 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number)
/* By now UMV IS DISABLED ON H.263v1, since the restrictions
of H.263v1 UMV implies to check the predicted MV after
calculation of the current MB to see if we're on the limits */
- put_bits(&s->pb, 1, 0); /* unrestricted motion vector: off */
+ put_bits(&s->pb, 1, 0); /* Unrestricted Motion Vector: off */
put_bits(&s->pb, 1, 0); /* SAC: off */
- put_bits(&s->pb, 1, s->obmc); /* advanced prediction mode */
- put_bits(&s->pb, 1, 0); /* not PB frame */
+ put_bits(&s->pb, 1, s->obmc); /* Advanced Prediction */
+ put_bits(&s->pb, 1, 0); /* only I/P frames, no PB frame */
put_bits(&s->pb, 5, s->qscale);
put_bits(&s->pb, 1, 0); /* Continuous Presence Multipoint mode: off */
} else {
diff --git a/src/libffmpeg/libavcodec/h263data.h b/src/libffmpeg/libavcodec/h263data.h
index 4da105ffc..f38037840 100644
--- a/src/libffmpeg/libavcodec/h263data.h
+++ b/src/libffmpeg/libavcodec/h263data.h
@@ -251,7 +251,7 @@ static const uint16_t h263_format[8][2] = {
{ 1408, 1152 },
};
-uint8_t ff_aic_dc_scale_table[32]={
+const uint8_t ff_aic_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 2, 4, 6, 8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
};
diff --git a/src/libffmpeg/libavcodec/h263dec.c b/src/libffmpeg/libavcodec/h263dec.c
index 04c1e2726..b51ce5f0c 100644
--- a/src/libffmpeg/libavcodec/h263dec.c
+++ b/src/libffmpeg/libavcodec/h263dec.c
@@ -122,7 +122,7 @@ int ff_h263_decode_end(AVCodecContext *avctx)
}
/**
- * retunrs the number of bytes consumed for building the current frame
+ * returns the number of bytes consumed for building the current frame
*/
static int get_consumed_bytes(MpegEncContext *s, int buf_size){
int pos= (get_bits_count(&s->gb)+7)>>3;
@@ -279,7 +279,7 @@ static int decode_slice(MpegEncContext *s){
s->workaround_bugs &= ~FF_BUG_NO_PADDING;
}
- // handle formats which dont have unique end markers
+ // handle formats which don't have unique end markers
if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly
int left= s->gb.size_in_bits - get_bits_count(&s->gb);
int max_extra=7;
@@ -669,10 +669,14 @@ retry:
s->current_picture.pict_type= s->pict_type;
s->current_picture.key_frame= s->pict_type == I_TYPE;
- /* skip b frames if we dont have reference frames */
+ /* skip B-frames if we don't have reference frames */
if(s->last_picture_ptr==NULL && (s->pict_type==B_TYPE || s->dropable)) return get_consumed_bytes(s, buf_size);
/* skip b frames if we are in a hurry */
if(avctx->hurry_up && s->pict_type==B_TYPE) return get_consumed_bytes(s, buf_size);
+ if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
+ || (avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
+ || avctx->skip_frame >= AVDISCARD_ALL)
+ return get_consumed_bytes(s, buf_size);
/* skip everything if we are in a hurry>=5 */
if(avctx->hurry_up>=5) return get_consumed_bytes(s, buf_size);
@@ -772,7 +776,7 @@ assert(s->current_picture.pict_type == s->pict_type);
/* we substract 1 because it is added on utils.c */
avctx->frame_number = s->picture_number - 1;
- /* dont output the last pic after seeking */
+ /* don't output the last pic after seeking */
if(s->last_picture_ptr || s->low_delay)
*data_size = sizeof(AVFrame);
#ifdef PRINT_FRAME_TIME
diff --git a/src/libffmpeg/libavcodec/h264.c b/src/libffmpeg/libavcodec/h264.c
index d8dbc3fa0..10baf2709 100644
--- a/src/libffmpeg/libavcodec/h264.c
+++ b/src/libffmpeg/libavcodec/h264.c
@@ -61,6 +61,7 @@ typedef struct SPS{
int profile_idc;
int level_idc;
+ int transform_bypass; ///< qpprime_y_zero_transform_bypass_flag
int log2_max_frame_num; ///< log2_max_frame_num_minus4 + 4
int poc_type; ///< pic_order_cnt_type
int log2_max_poc_lsb; ///< log2_max_pic_order_cnt_lsb_minus4
@@ -109,6 +110,7 @@ typedef struct PPS{
int deblocking_filter_parameters_present; ///< deblocking_filter_parameters_present_flag
int constrained_intra_pred; ///< constrained_intra_pred_flag
int redundant_pic_cnt_present; ///< redundant_pic_cnt_present_flag
+ int transform_8x8_mode; ///< transform_8x8_mode_flag
}PPS;
/**
@@ -174,6 +176,7 @@ typedef struct H264Context{
int8_t intra4x4_pred_mode_cache[5*8];
int8_t (*intra4x4_pred_mode)[8];
void (*pred4x4 [9+3])(uint8_t *src, uint8_t *topright, int stride);//FIXME move to dsp?
+ void (*pred8x8l [9+3])(uint8_t *src, int topleft, int topright, int stride);
void (*pred8x8 [4+3])(uint8_t *src, int stride);
void (*pred16x16[4+3])(uint8_t *src, int stride);
unsigned int topleft_samples_available;
@@ -204,6 +207,11 @@ typedef struct H264Context{
int mv_cache_clean[2];
/**
+ * number of neighbors (top and/or left) that used 8x8 dct
+ */
+ int neighbor_transform_size;
+
+ /**
* block_offset[ 0..23] for frame macroblocks
* block_offset[24..47] for field macroblocks
*/
@@ -229,6 +237,9 @@ typedef struct H264Context{
*/
PPS pps; //FIXME move to Picture perhaps? (->no) do we need that?
+ uint16_t (*dequant4_coeff)[16]; // FIXME quant matrices should be per SPS or PPS
+ uint16_t (*dequant8_coeff)[64];
+
int slice_num;
uint8_t *slice_table_base;
uint8_t *slice_table; ///< slice_table_base + mb_stride + 1
@@ -318,7 +329,7 @@ typedef struct H264Context{
* Cabac
*/
CABACContext cabac;
- uint8_t cabac_state[399];
+ uint8_t cabac_state[460];
int cabac_init_idc;
/* 0x100 -> non null luma_dc, 0x80/0x40 -> non null chroma_dc (cb/cr), 0x?0 -> chroma_cbp(0,1,2), 0x0? luma_cbp */
@@ -333,6 +344,10 @@ typedef struct H264Context{
uint8_t *direct_table;
uint8_t direct_cache[5*8];
+ uint8_t zigzag_scan[16];
+ uint8_t field_scan[16];
+ const uint8_t *zigzag_scan_q0;
+ const uint8_t *field_scan_q0;
}H264Context;
static VLC coeff_token_vlc[4];
@@ -839,6 +854,8 @@ static inline void fill_caches(H264Context *h, int mb_type, int for_deblock){
}
}
#endif
+
+ h->neighbor_transform_size= !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[0]);
}
static inline void write_back_intra_pred_mode(H264Context *h){
@@ -2183,11 +2200,7 @@ static void pred8x8_horizontal_c(uint8_t *src, int stride){
static void pred8x8_128_dc_c(uint8_t *src, int stride){
int i;
- for(i=0; i<4; i++){
- ((uint32_t*)(src+i*stride))[0]=
- ((uint32_t*)(src+i*stride))[1]= 0x01010101U*128U;
- }
- for(i=4; i<8; i++){
+ for(i=0; i<8; i++){
((uint32_t*)(src+i*stride))[0]=
((uint32_t*)(src+i*stride))[1]= 0x01010101U*128U;
}
@@ -2296,6 +2309,248 @@ static void pred8x8_plane_c(uint8_t *src, int stride){
}
}
+#define SRC(x,y) src[(x)+(y)*stride]
+#define PL(y) \
+ const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
+#define PREDICT_8x8_LOAD_LEFT \
+ const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \
+ + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \
+ PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \
+ const int l7 = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2
+
+#define PT(x) \
+ const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
+#define PREDICT_8x8_LOAD_TOP \
+ const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \
+ + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \
+ PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \
+ const int t7 = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \
+ + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2
+
+#define PTR(x) \
+ t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
+#define PREDICT_8x8_LOAD_TOPRIGHT \
+ int t8, t9, t10, t11, t12, t13, t14, t15; \
+ if(has_topright) { \
+ PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \
+ t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \
+ } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1);
+
+#define PREDICT_8x8_LOAD_TOPLEFT \
+ const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2
+
+#define PREDICT_8x8_DC(v) \
+ int y; \
+ for( y = 0; y < 8; y++ ) { \
+ ((uint32_t*)src)[0] = \
+ ((uint32_t*)src)[1] = v; \
+ src += stride; \
+ }
+
+static void pred8x8l_128_dc_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_DC(0x80808080);
+}
+static void pred8x8l_left_dc_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_LEFT;
+ const uint32_t dc = ((l0+l1+l2+l3+l4+l5+l6+l7+4) >> 3) * 0x01010101;
+ PREDICT_8x8_DC(dc);
+}
+static void pred8x8l_top_dc_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_TOP;
+ const uint32_t dc = ((t0+t1+t2+t3+t4+t5+t6+t7+4) >> 3) * 0x01010101;
+ PREDICT_8x8_DC(dc);
+}
+static void pred8x8l_dc_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_LEFT;
+ PREDICT_8x8_LOAD_TOP;
+ const uint32_t dc = ((l0+l1+l2+l3+l4+l5+l6+l7
+ +t0+t1+t2+t3+t4+t5+t6+t7+8) >> 4) * 0x01010101;
+ PREDICT_8x8_DC(dc);
+}
+static void pred8x8l_horizontal_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_LEFT;
+#define ROW(y) ((uint32_t*)(src+y*stride))[0] =\
+ ((uint32_t*)(src+y*stride))[1] = 0x01010101 * l##y
+ ROW(0); ROW(1); ROW(2); ROW(3); ROW(4); ROW(5); ROW(6); ROW(7);
+#undef ROW
+}
+static void pred8x8l_vertical_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ int y;
+ PREDICT_8x8_LOAD_TOP;
+ src[0] = t0;
+ src[1] = t1;
+ src[2] = t2;
+ src[3] = t3;
+ src[4] = t4;
+ src[5] = t5;
+ src[6] = t6;
+ src[7] = t7;
+ for( y = 1; y < 8; y++ )
+ *(uint64_t*)(src+y*stride) = *(uint64_t*)src;
+}
+static void pred8x8l_down_left_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_TOP;
+ PREDICT_8x8_LOAD_TOPRIGHT;
+ SRC(0,0)= (t0 + 2*t1 + t2 + 2) >> 2;
+ SRC(0,1)=SRC(1,0)= (t1 + 2*t2 + t3 + 2) >> 2;
+ SRC(0,2)=SRC(1,1)=SRC(2,0)= (t2 + 2*t3 + t4 + 2) >> 2;
+ SRC(0,3)=SRC(1,2)=SRC(2,1)=SRC(3,0)= (t3 + 2*t4 + t5 + 2) >> 2;
+ SRC(0,4)=SRC(1,3)=SRC(2,2)=SRC(3,1)=SRC(4,0)= (t4 + 2*t5 + t6 + 2) >> 2;
+ SRC(0,5)=SRC(1,4)=SRC(2,3)=SRC(3,2)=SRC(4,1)=SRC(5,0)= (t5 + 2*t6 + t7 + 2) >> 2;
+ SRC(0,6)=SRC(1,5)=SRC(2,4)=SRC(3,3)=SRC(4,2)=SRC(5,1)=SRC(6,0)= (t6 + 2*t7 + t8 + 2) >> 2;
+ SRC(0,7)=SRC(1,6)=SRC(2,5)=SRC(3,4)=SRC(4,3)=SRC(5,2)=SRC(6,1)=SRC(7,0)= (t7 + 2*t8 + t9 + 2) >> 2;
+ SRC(1,7)=SRC(2,6)=SRC(3,5)=SRC(4,4)=SRC(5,3)=SRC(6,2)=SRC(7,1)= (t8 + 2*t9 + t10 + 2) >> 2;
+ SRC(2,7)=SRC(3,6)=SRC(4,5)=SRC(5,4)=SRC(6,3)=SRC(7,2)= (t9 + 2*t10 + t11 + 2) >> 2;
+ SRC(3,7)=SRC(4,6)=SRC(5,5)=SRC(6,4)=SRC(7,3)= (t10 + 2*t11 + t12 + 2) >> 2;
+ SRC(4,7)=SRC(5,6)=SRC(6,5)=SRC(7,4)= (t11 + 2*t12 + t13 + 2) >> 2;
+ SRC(5,7)=SRC(6,6)=SRC(7,5)= (t12 + 2*t13 + t14 + 2) >> 2;
+ SRC(6,7)=SRC(7,6)= (t13 + 2*t14 + t15 + 2) >> 2;
+ SRC(7,7)= (t14 + 3*t15 + 2) >> 2;
+}
+static void pred8x8l_down_right_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_TOP;
+ PREDICT_8x8_LOAD_LEFT;
+ PREDICT_8x8_LOAD_TOPLEFT;
+ SRC(0,7)= (l7 + 2*l6 + l5 + 2) >> 2;
+ SRC(0,6)=SRC(1,7)= (l6 + 2*l5 + l4 + 2) >> 2;
+ SRC(0,5)=SRC(1,6)=SRC(2,7)= (l5 + 2*l4 + l3 + 2) >> 2;
+ SRC(0,4)=SRC(1,5)=SRC(2,6)=SRC(3,7)= (l4 + 2*l3 + l2 + 2) >> 2;
+ SRC(0,3)=SRC(1,4)=SRC(2,5)=SRC(3,6)=SRC(4,7)= (l3 + 2*l2 + l1 + 2) >> 2;
+ SRC(0,2)=SRC(1,3)=SRC(2,4)=SRC(3,5)=SRC(4,6)=SRC(5,7)= (l2 + 2*l1 + l0 + 2) >> 2;
+ SRC(0,1)=SRC(1,2)=SRC(2,3)=SRC(3,4)=SRC(4,5)=SRC(5,6)=SRC(6,7)= (l1 + 2*l0 + lt + 2) >> 2;
+ SRC(0,0)=SRC(1,1)=SRC(2,2)=SRC(3,3)=SRC(4,4)=SRC(5,5)=SRC(6,6)=SRC(7,7)= (l0 + 2*lt + t0 + 2) >> 2;
+ SRC(1,0)=SRC(2,1)=SRC(3,2)=SRC(4,3)=SRC(5,4)=SRC(6,5)=SRC(7,6)= (lt + 2*t0 + t1 + 2) >> 2;
+ SRC(2,0)=SRC(3,1)=SRC(4,2)=SRC(5,3)=SRC(6,4)=SRC(7,5)= (t0 + 2*t1 + t2 + 2) >> 2;
+ SRC(3,0)=SRC(4,1)=SRC(5,2)=SRC(6,3)=SRC(7,4)= (t1 + 2*t2 + t3 + 2) >> 2;
+ SRC(4,0)=SRC(5,1)=SRC(6,2)=SRC(7,3)= (t2 + 2*t3 + t4 + 2) >> 2;
+ SRC(5,0)=SRC(6,1)=SRC(7,2)= (t3 + 2*t4 + t5 + 2) >> 2;
+ SRC(6,0)=SRC(7,1)= (t4 + 2*t5 + t6 + 2) >> 2;
+ SRC(7,0)= (t5 + 2*t6 + t7 + 2) >> 2;
+
+}
+static void pred8x8l_vertical_right_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_TOP;
+ PREDICT_8x8_LOAD_LEFT;
+ PREDICT_8x8_LOAD_TOPLEFT;
+ SRC(0,6)= (l5 + 2*l4 + l3 + 2) >> 2;
+ SRC(0,7)= (l6 + 2*l5 + l4 + 2) >> 2;
+ SRC(0,4)=SRC(1,6)= (l3 + 2*l2 + l1 + 2) >> 2;
+ SRC(0,5)=SRC(1,7)= (l4 + 2*l3 + l2 + 2) >> 2;
+ SRC(0,2)=SRC(1,4)=SRC(2,6)= (l1 + 2*l0 + lt + 2) >> 2;
+ SRC(0,3)=SRC(1,5)=SRC(2,7)= (l2 + 2*l1 + l0 + 2) >> 2;
+ SRC(0,1)=SRC(1,3)=SRC(2,5)=SRC(3,7)= (l0 + 2*lt + t0 + 2) >> 2;
+ SRC(0,0)=SRC(1,2)=SRC(2,4)=SRC(3,6)= (lt + t0 + 1) >> 1;
+ SRC(1,1)=SRC(2,3)=SRC(3,5)=SRC(4,7)= (lt + 2*t0 + t1 + 2) >> 2;
+ SRC(1,0)=SRC(2,2)=SRC(3,4)=SRC(4,6)= (t0 + t1 + 1) >> 1;
+ SRC(2,1)=SRC(3,3)=SRC(4,5)=SRC(5,7)= (t0 + 2*t1 + t2 + 2) >> 2;
+ SRC(2,0)=SRC(3,2)=SRC(4,4)=SRC(5,6)= (t1 + t2 + 1) >> 1;
+ SRC(3,1)=SRC(4,3)=SRC(5,5)=SRC(6,7)= (t1 + 2*t2 + t3 + 2) >> 2;
+ SRC(3,0)=SRC(4,2)=SRC(5,4)=SRC(6,6)= (t2 + t3 + 1) >> 1;
+ SRC(4,1)=SRC(5,3)=SRC(6,5)=SRC(7,7)= (t2 + 2*t3 + t4 + 2) >> 2;
+ SRC(4,0)=SRC(5,2)=SRC(6,4)=SRC(7,6)= (t3 + t4 + 1) >> 1;
+ SRC(5,1)=SRC(6,3)=SRC(7,5)= (t3 + 2*t4 + t5 + 2) >> 2;
+ SRC(5,0)=SRC(6,2)=SRC(7,4)= (t4 + t5 + 1) >> 1;
+ SRC(6,1)=SRC(7,3)= (t4 + 2*t5 + t6 + 2) >> 2;
+ SRC(6,0)=SRC(7,2)= (t5 + t6 + 1) >> 1;
+ SRC(7,1)= (t5 + 2*t6 + t7 + 2) >> 2;
+ SRC(7,0)= (t6 + t7 + 1) >> 1;
+}
+static void pred8x8l_horizontal_down_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_TOP;
+ PREDICT_8x8_LOAD_LEFT;
+ PREDICT_8x8_LOAD_TOPLEFT;
+ SRC(0,7)= (l6 + l7 + 1) >> 1;
+ SRC(1,7)= (l5 + 2*l6 + l7 + 2) >> 2;
+ SRC(0,6)=SRC(2,7)= (l5 + l6 + 1) >> 1;
+ SRC(1,6)=SRC(3,7)= (l4 + 2*l5 + l6 + 2) >> 2;
+ SRC(0,5)=SRC(2,6)=SRC(4,7)= (l4 + l5 + 1) >> 1;
+ SRC(1,5)=SRC(3,6)=SRC(5,7)= (l3 + 2*l4 + l5 + 2) >> 2;
+ SRC(0,4)=SRC(2,5)=SRC(4,6)=SRC(6,7)= (l3 + l4 + 1) >> 1;
+ SRC(1,4)=SRC(3,5)=SRC(5,6)=SRC(7,7)= (l2 + 2*l3 + l4 + 2) >> 2;
+ SRC(0,3)=SRC(2,4)=SRC(4,5)=SRC(6,6)= (l2 + l3 + 1) >> 1;
+ SRC(1,3)=SRC(3,4)=SRC(5,5)=SRC(7,6)= (l1 + 2*l2 + l3 + 2) >> 2;
+ SRC(0,2)=SRC(2,3)=SRC(4,4)=SRC(6,5)= (l1 + l2 + 1) >> 1;
+ SRC(1,2)=SRC(3,3)=SRC(5,4)=SRC(7,5)= (l0 + 2*l1 + l2 + 2) >> 2;
+ SRC(0,1)=SRC(2,2)=SRC(4,3)=SRC(6,4)= (l0 + l1 + 1) >> 1;
+ SRC(1,1)=SRC(3,2)=SRC(5,3)=SRC(7,4)= (lt + 2*l0 + l1 + 2) >> 2;
+ SRC(0,0)=SRC(2,1)=SRC(4,2)=SRC(6,3)= (lt + l0 + 1) >> 1;
+ SRC(1,0)=SRC(3,1)=SRC(5,2)=SRC(7,3)= (l0 + 2*lt + t0 + 2) >> 2;
+ SRC(2,0)=SRC(4,1)=SRC(6,2)= (t1 + 2*t0 + lt + 2) >> 2;
+ SRC(3,0)=SRC(5,1)=SRC(7,2)= (t2 + 2*t1 + t0 + 2) >> 2;
+ SRC(4,0)=SRC(6,1)= (t3 + 2*t2 + t1 + 2) >> 2;
+ SRC(5,0)=SRC(7,1)= (t4 + 2*t3 + t2 + 2) >> 2;
+ SRC(6,0)= (t5 + 2*t4 + t3 + 2) >> 2;
+ SRC(7,0)= (t6 + 2*t5 + t4 + 2) >> 2;
+}
+static void pred8x8l_vertical_left_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_TOP;
+ PREDICT_8x8_LOAD_TOPRIGHT;
+ SRC(0,0)= (t0 + t1 + 1) >> 1;
+ SRC(0,1)= (t0 + 2*t1 + t2 + 2) >> 2;
+ SRC(0,2)=SRC(1,0)= (t1 + t2 + 1) >> 1;
+ SRC(0,3)=SRC(1,1)= (t1 + 2*t2 + t3 + 2) >> 2;
+ SRC(0,4)=SRC(1,2)=SRC(2,0)= (t2 + t3 + 1) >> 1;
+ SRC(0,5)=SRC(1,3)=SRC(2,1)= (t2 + 2*t3 + t4 + 2) >> 2;
+ SRC(0,6)=SRC(1,4)=SRC(2,2)=SRC(3,0)= (t3 + t4 + 1) >> 1;
+ SRC(0,7)=SRC(1,5)=SRC(2,3)=SRC(3,1)= (t3 + 2*t4 + t5 + 2) >> 2;
+ SRC(1,6)=SRC(2,4)=SRC(3,2)=SRC(4,0)= (t4 + t5 + 1) >> 1;
+ SRC(1,7)=SRC(2,5)=SRC(3,3)=SRC(4,1)= (t4 + 2*t5 + t6 + 2) >> 2;
+ SRC(2,6)=SRC(3,4)=SRC(4,2)=SRC(5,0)= (t5 + t6 + 1) >> 1;
+ SRC(2,7)=SRC(3,5)=SRC(4,3)=SRC(5,1)= (t5 + 2*t6 + t7 + 2) >> 2;
+ SRC(3,6)=SRC(4,4)=SRC(5,2)=SRC(6,0)= (t6 + t7 + 1) >> 1;
+ SRC(3,7)=SRC(4,5)=SRC(5,3)=SRC(6,1)= (t6 + 2*t7 + t8 + 2) >> 2;
+ SRC(4,6)=SRC(5,4)=SRC(6,2)=SRC(7,0)= (t7 + t8 + 1) >> 1;
+ SRC(4,7)=SRC(5,5)=SRC(6,3)=SRC(7,1)= (t7 + 2*t8 + t9 + 2) >> 2;
+ SRC(5,6)=SRC(6,4)=SRC(7,2)= (t8 + t9 + 1) >> 1;
+ SRC(5,7)=SRC(6,5)=SRC(7,3)= (t8 + 2*t9 + t10 + 2) >> 2;
+ SRC(6,6)=SRC(7,4)= (t9 + t10 + 1) >> 1;
+ SRC(6,7)=SRC(7,5)= (t9 + 2*t10 + t11 + 2) >> 2;
+ SRC(7,6)= (t10 + t11 + 1) >> 1;
+ SRC(7,7)= (t10 + 2*t11 + t12 + 2) >> 2;
+}
+static void pred8x8l_horizontal_up_c(uint8_t *src, int has_topleft, int has_topright, int stride)
+{
+ PREDICT_8x8_LOAD_LEFT;
+ SRC(0,0)= (l0 + l1 + 1) >> 1;
+ SRC(1,0)= (l0 + 2*l1 + l2 + 2) >> 2;
+ SRC(0,1)=SRC(2,0)= (l1 + l2 + 1) >> 1;
+ SRC(1,1)=SRC(3,0)= (l1 + 2*l2 + l3 + 2) >> 2;
+ SRC(0,2)=SRC(2,1)=SRC(4,0)= (l2 + l3 + 1) >> 1;
+ SRC(1,2)=SRC(3,1)=SRC(5,0)= (l2 + 2*l3 + l4 + 2) >> 2;
+ SRC(0,3)=SRC(2,2)=SRC(4,1)=SRC(6,0)= (l3 + l4 + 1) >> 1;
+ SRC(1,3)=SRC(3,2)=SRC(5,1)=SRC(7,0)= (l3 + 2*l4 + l5 + 2) >> 2;
+ SRC(0,4)=SRC(2,3)=SRC(4,2)=SRC(6,1)= (l4 + l5 + 1) >> 1;
+ SRC(1,4)=SRC(3,3)=SRC(5,2)=SRC(7,1)= (l4 + 2*l5 + l6 + 2) >> 2;
+ SRC(0,5)=SRC(2,4)=SRC(4,3)=SRC(6,2)= (l5 + l6 + 1) >> 1;
+ SRC(1,5)=SRC(3,4)=SRC(5,3)=SRC(7,2)= (l5 + 2*l6 + l7 + 2) >> 2;
+ SRC(0,6)=SRC(2,5)=SRC(4,4)=SRC(6,3)= (l6 + l7 + 1) >> 1;
+ SRC(1,6)=SRC(3,5)=SRC(5,4)=SRC(7,3)= (l6 + 3*l7 + 2) >> 2;
+ SRC(0,7)=SRC(1,7)=SRC(2,6)=SRC(2,7)=SRC(3,6)=
+ SRC(3,7)=SRC(4,5)=SRC(4,6)=SRC(4,7)=SRC(5,5)=
+ SRC(5,6)=SRC(5,7)=SRC(6,4)=SRC(6,5)=SRC(6,6)=
+ SRC(6,7)=SRC(7,4)=SRC(7,5)=SRC(7,6)=SRC(7,7)= l7;
+}
+#undef PREDICT_8x8_LOAD_LEFT
+#undef PREDICT_8x8_LOAD_TOP
+#undef PREDICT_8x8_LOAD_TOPLEFT
+#undef PREDICT_8x8_LOAD_TOPRIGHT
+#undef PREDICT_8x8_DC
+#undef PTR
+#undef PT
+#undef PL
+#undef SRC
+
static inline void mc_dir_part(H264Context *h, Picture *pic, int n, int square, int chroma_height, int delta, int list,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
int src_x_offset, int src_y_offset,
@@ -2607,6 +2862,19 @@ static void init_pred_ptrs(H264Context *h){
h->pred4x4[TOP_DC_PRED ]= pred4x4_top_dc_c;
h->pred4x4[DC_128_PRED ]= pred4x4_128_dc_c;
+ h->pred8x8l[VERT_PRED ]= pred8x8l_vertical_c;
+ h->pred8x8l[HOR_PRED ]= pred8x8l_horizontal_c;
+ h->pred8x8l[DC_PRED ]= pred8x8l_dc_c;
+ h->pred8x8l[DIAG_DOWN_LEFT_PRED ]= pred8x8l_down_left_c;
+ h->pred8x8l[DIAG_DOWN_RIGHT_PRED]= pred8x8l_down_right_c;
+ h->pred8x8l[VERT_RIGHT_PRED ]= pred8x8l_vertical_right_c;
+ h->pred8x8l[HOR_DOWN_PRED ]= pred8x8l_horizontal_down_c;
+ h->pred8x8l[VERT_LEFT_PRED ]= pred8x8l_vertical_left_c;
+ h->pred8x8l[HOR_UP_PRED ]= pred8x8l_horizontal_up_c;
+ h->pred8x8l[LEFT_DC_PRED ]= pred8x8l_left_dc_c;
+ h->pred8x8l[TOP_DC_PRED ]= pred8x8l_top_dc_c;
+ h->pred8x8l[DC_128_PRED ]= pred8x8l_128_dc_c;
+
h->pred8x8[DC_PRED8x8 ]= pred8x8_dc_c;
h->pred8x8[VERT_PRED8x8 ]= pred8x8_vertical_c;
h->pred8x8[HOR_PRED8x8 ]= pred8x8_horizontal_c;
@@ -2640,6 +2908,9 @@ static void free_tables(H264Context *h){
av_freep(&h->mb2b_xy);
av_freep(&h->mb2b8_xy);
+ av_freep(&h->dequant4_coeff);
+ av_freep(&h->dequant8_coeff);
+
av_freep(&h->s.obmc_scratchpad);
}
@@ -2650,7 +2921,7 @@ static void free_tables(H264Context *h){
static int alloc_tables(H264Context *h){
MpegEncContext * const s = &h->s;
const int big_mb_num= s->mb_stride * (s->mb_height+1);
- int x,y;
+ int x,y,q;
CHECKED_ALLOCZ(h->intra4x4_pred_mode, big_mb_num * 8 * sizeof(uint8_t))
@@ -2683,6 +2954,25 @@ static int alloc_tables(H264Context *h){
}
}
+ CHECKED_ALLOCZ(h->dequant4_coeff, 52*16 * sizeof(uint16_t));
+ CHECKED_ALLOCZ(h->dequant8_coeff, 52*64 * sizeof(uint16_t));
+ memcpy(h->dequant4_coeff, dequant_coeff, 52*16 * sizeof(uint16_t));
+ for(q=0; q<52; q++){
+ int shift = div6[q];
+ int idx = rem6[q];
+ if(shift >= 2) // qp<12 are shifted during dequant
+ shift -= 2;
+ for(x=0; x<64; x++)
+ h->dequant8_coeff[q][x] = dequant8_coeff_init[idx][
+ dequant8_coeff_init_scan[((x>>1)&12) | (x&3)] ] << shift;
+ }
+ if(h->sps.transform_bypass){
+ for(x=0; x<16; x++)
+ h->dequant4_coeff[0][x] = 1;
+ for(x=0; x<64; x++)
+ h->dequant8_coeff[0][x] = 1<<2;
+ }
+
s->obmc_scratchpad = NULL;
return 0;
@@ -2818,6 +3108,9 @@ b= t;
if(deblock_top){
XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+0), *(uint64_t*)(src_y +1), temp64, xchg);
XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x]+8), *(uint64_t*)(src_y +9), temp64, 1);
+ if(s->mb_x < s->mb_width){
+ XCHG(*(uint64_t*)(h->top_borders[0][s->mb_x+1]), *(uint64_t*)(src_y +17), temp64, 1);
+ }
}
if(!(s->flags&CODEC_FLAG_GRAY)){
@@ -2930,6 +3223,8 @@ static void hl_decode_mb(H264Context *h){
int i;
int *block_offset = &h->block_offset[0];
const unsigned int bottom = mb_y & 1;
+ const int transform_bypass = (s->qscale == 0 && h->sps.transform_bypass);
+ void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);
if(!s->decode)
return;
@@ -2952,6 +3247,10 @@ static void hl_decode_mb(H264Context *h){
uvlinesize = s->uvlinesize;
// dct_offset = s->linesize * 16;
}
+
+ idct_add = transform_bypass
+ ? IS_8x8DCT(mb_type) ? s->dsp.add_pixels8 : s->dsp.add_pixels4
+ : IS_8x8DCT(mb_type) ? s->dsp.h264_idct8_add : s->dsp.h264_idct_add;
if (IS_INTRA_PCM(mb_type)) {
unsigned int x, y;
@@ -2997,6 +3296,16 @@ static void hl_decode_mb(H264Context *h){
if(IS_INTRA4x4(mb_type)){
if(!s->encoding){
+ if(IS_8x8DCT(mb_type)){
+ for(i=0; i<16; i+=4){
+ uint8_t * const ptr= dest_y + block_offset[i];
+ const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
+ h->pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000,
+ (h->topright_samples_available<<(i+1))&0x8000, linesize);
+ if(h->non_zero_count_cache[ scan8[i] ])
+ idct_add(ptr, h->mb + i*16, linesize);
+ }
+ }else
for(i=0; i<16; i++){
uint8_t * const ptr= dest_y + block_offset[i];
uint8_t *topright;
@@ -3009,10 +3318,7 @@ static void hl_decode_mb(H264Context *h){
if(!topright_avail){
tr= ptr[3 - linesize]*0x01010101;
topright= (uint8_t*) &tr;
- }else if(i==5 && h->deblocking_filter){
- tr= *(uint32_t*)h->top_borders[h->mb_aff_frame ? IS_INTERLACED(mb_type) ? bottom : 1 : 0][mb_x+1];
- topright= (uint8_t*) &tr;
- }else
+ }else
topright= ptr + 4 - linesize;
}else
topright= NULL;
@@ -3020,7 +3326,7 @@ static void hl_decode_mb(H264Context *h){
h->pred4x4[ dir ](ptr, topright, linesize);
if(h->non_zero_count_cache[ scan8[i] ]){
if(s->codec_id == CODEC_ID_H264)
- s->dsp.h264_idct_add(ptr, h->mb + i*16, linesize);
+ idct_add(ptr, h->mb + i*16, linesize);
else
svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
}
@@ -3028,9 +3334,10 @@ static void hl_decode_mb(H264Context *h){
}
}else{
h->pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize);
- if(s->codec_id == CODEC_ID_H264)
- h264_luma_dc_dequant_idct_c(h->mb, s->qscale);
- else
+ if(s->codec_id == CODEC_ID_H264){
+ if(!transform_bypass)
+ h264_luma_dc_dequant_idct_c(h->mb, s->qscale);
+ }else
svq3_luma_dc_dequant_idct_c(h->mb, s->qscale);
}
if(h->deblocking_filter) {
@@ -3057,10 +3364,11 @@ static void hl_decode_mb(H264Context *h){
if(!IS_INTRA4x4(mb_type)){
if(s->codec_id == CODEC_ID_H264){
- for(i=0; i<16; i++){
+ const int di = IS_8x8DCT(mb_type) ? 4 : 1;
+ for(i=0; i<16; i+=di){
if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ //FIXME benchmark weird rule, & below
uint8_t * const ptr= dest_y + block_offset[i];
- s->dsp.h264_idct_add(ptr, h->mb + i*16, linesize);
+ idct_add(ptr, h->mb + i*16, linesize);
}
}
}else{
@@ -3074,19 +3382,22 @@ static void hl_decode_mb(H264Context *h){
}
if(!(s->flags&CODEC_FLAG_GRAY)){
- chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp);
- chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp);
+ idct_add = transform_bypass ? s->dsp.add_pixels4 : s->dsp.h264_idct_add;
+ if(!transform_bypass){
+ chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp);
+ chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp);
+ }
if(s->codec_id == CODEC_ID_H264){
for(i=16; i<16+4; i++){
if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
uint8_t * const ptr= dest_cb + block_offset[i];
- s->dsp.h264_idct_add(ptr, h->mb + i*16, uvlinesize);
+ idct_add(ptr, h->mb + i*16, uvlinesize);
}
}
for(i=20; i<20+4; i++){
if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
uint8_t * const ptr= dest_cr + block_offset[i];
- s->dsp.h264_idct_add(ptr, h->mb + i*16, uvlinesize);
+ idct_add(ptr, h->mb + i*16, uvlinesize);
}
}
}else{
@@ -3491,7 +3802,8 @@ static void flush_dpb(AVCodecContext *avctx){
h->delayed_pic[i]= NULL;
h->delayed_output_pic= NULL;
idr(h);
- h->s.current_picture_ptr->reference= 0;
+ if(h->s.current_picture_ptr)
+ h->s.current_picture_ptr->reference= 0;
}
/**
@@ -3582,8 +3894,10 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
switch(mmco[i].opcode){
case MMCO_SHORT2UNUSED:
pic= remove_short(h, mmco[i].short_frame_num);
- if(pic==NULL) return -1;
- unreference_pic(h, pic);
+ if(pic)
+ unreference_pic(h, pic);
+ else if(s->avctx->debug&FF_DEBUG_MMCO)
+ av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: remove_short() failure\n");
break;
case MMCO_SHORT2LONG:
pic= remove_long(h, mmco[i].long_index);
@@ -3595,8 +3909,10 @@ static int execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
break;
case MMCO_LONG2UNUSED:
pic= remove_long(h, mmco[i].long_index);
- if(pic==NULL) return -1;
- unreference_pic(h, pic);
+ if(pic)
+ unreference_pic(h, pic);
+ else if(s->avctx->debug&FF_DEBUG_MMCO)
+ av_log(h->s.avctx, AV_LOG_DEBUG, "mmco: remove_long() failure\n");
break;
case MMCO_LONG:
pic= remove_long(h, mmco[i].long_index);
@@ -3870,6 +4186,25 @@ static int decode_slice_header(H264Context *h){
if (!s->context_initialized) {
if (MPV_common_init(s) < 0)
return -1;
+
+ if(s->dsp.h264_idct_add == ff_h264_idct_add_c){ //FIXME little ugly
+ memcpy(h->zigzag_scan, zigzag_scan, 16*sizeof(uint8_t));
+ memcpy(h-> field_scan, field_scan, 16*sizeof(uint8_t));
+ }else{
+ int i;
+ for(i=0; i<16; i++){
+#define T(x) (x>>2) | ((x<<2) & 0xF)
+ h->zigzag_scan[i] = T(zigzag_scan[i]);
+ h-> field_scan[i] = T( field_scan[i]);
+ }
+ }
+ if(h->sps.transform_bypass){ //FIXME same ugly
+ h->zigzag_scan_q0 = zigzag_scan;
+ h->field_scan_q0 = field_scan;
+ }else{
+ h->zigzag_scan_q0 = h->zigzag_scan;
+ h->field_scan_q0 = h->field_scan;
+ }
alloc_tables(h);
@@ -3899,13 +4234,16 @@ static int decode_slice_header(H264Context *h){
s->picture_structure= PICT_TOP_FIELD + get_bits1(&s->gb); //bottom_field_flag
} else {
s->picture_structure= PICT_FRAME;
- first_mb_in_slice <<= 1;
+ first_mb_in_slice <<= h->sps.mb_aff;
h->mb_aff_frame = h->sps.mb_aff;
}
}
s->resync_mb_x = s->mb_x = first_mb_in_slice % s->mb_width;
s->resync_mb_y = s->mb_y = first_mb_in_slice / s->mb_width;
+ if(s->mb_y >= s->mb_height){
+ return -1;
+ }
if(s->picture_structure==PICT_FRAME){
h->curr_pic_num= h->frame_num;
@@ -3966,7 +4304,8 @@ static int decode_slice_header(H264Context *h){
fill_default_ref_list(h);
}
- decode_ref_pic_list_reordering(h);
+ if(decode_ref_pic_list_reordering(h) < 0)
+ return -1;
if( (h->pps.weighted_pred && (h->slice_type == P_TYPE || h->slice_type == SP_TYPE ))
|| (h->pps.weighted_bipred_idc==1 && h->slice_type==B_TYPE ) )
@@ -4010,6 +4349,11 @@ static int decode_slice_header(H264Context *h){
h->slice_beta_offset = get_se_golomb(&s->gb) << 1;
}
}
+ if( s->avctx->skip_loop_filter >= AVDISCARD_ALL
+ ||(s->avctx->skip_loop_filter >= AVDISCARD_NONKEY && h->slice_type != I_TYPE)
+ ||(s->avctx->skip_loop_filter >= AVDISCARD_BIDIR && h->slice_type == B_TYPE)
+ ||(s->avctx->skip_loop_filter >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
+ h->deblocking_filter= 0;
#if 0 //FMO
if( h->pps.num_slice_groups > 1 && h->pps.mb_slice_group_map_type >= 3 && h->pps.mb_slice_group_map_type <= 5)
@@ -4060,6 +4404,16 @@ static inline int get_level_prefix(GetBitContext *gb){
return log-1;
}
+static inline int get_dct8x8_allowed(H264Context *h){
+ int i;
+ for(i=0; i<4; i++){
+ if(!IS_SUB_8X8(h->sub_mb_type[i])
+ || (!h->sps.direct_8x8_inference_flag && IS_DIRECT(h->sub_mb_type[i])))
+ return 0;
+ }
+ return 1;
+}
+
/**
* decodes a residual block.
* @param n block index
@@ -4067,9 +4421,8 @@ static inline int get_level_prefix(GetBitContext *gb){
* @param max_coeff number of coefficients in the block
* @return <0 if an error occured
*/
-static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, int qp, int max_coeff){
+static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint16_t *qmul, int max_coeff){
MpegEncContext * const s = &h->s;
- const uint16_t *qmul= dequant_coeff[qp];
static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3};
int level[16], run[16];
int suffix_length, zeros_left, coeff_num, coeff_token, total_coeff, i, trailing_ones;
@@ -4257,6 +4610,7 @@ static int decode_mb_cavlc(H264Context *h){
MpegEncContext * const s = &h->s;
const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
int mb_type, partition_count, cbp;
+ int dct8x8_allowed= h->pps.transform_8x8_mode;
s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip handlong?
@@ -4313,7 +4667,6 @@ decode_intra_mb:
if(h->mb_field_decoding_flag)
mb_type |= MB_TYPE_INTERLACED;
- s->current_picture.mb_type[mb_xy]= mb_type;
h->slice_table[ mb_xy ]= h->slice_num;
if(IS_INTRA_PCM(mb_type)){
@@ -4351,6 +4704,7 @@ decode_intra_mb:
// All coeffs are present
memset(h->non_zero_count[mb_xy], 16, 16);
+ s->current_picture.mb_type[mb_xy]= mb_type;
return 0;
}
@@ -4361,9 +4715,14 @@ decode_intra_mb:
// init_top_left_availability(h);
if(IS_INTRA4x4(mb_type)){
int i;
+ int di = 1;
+ if(dct8x8_allowed && get_bits1(&s->gb)){
+ mb_type |= MB_TYPE_8x8DCT;
+ di = 4;
+ }
// fill_intra4x4_pred_table(h);
- for(i=0; i<16; i++){
+ for(i=0; i<16; i+=di){
const int mode_coded= !get_bits1(&s->gb);
const int predicted_mode= pred_intra_mode(h, i);
int mode;
@@ -4378,7 +4737,10 @@ decode_intra_mb:
mode= predicted_mode;
}
- h->intra4x4_pred_mode_cache[ scan8[i] ] = mode;
+ if(di==4)
+ fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 );
+ else
+ h->intra4x4_pred_mode_cache[ scan8[i] ] = mode;
}
write_back_intra_pred_mode(h);
if( check_intra4x4_pred_mode(h) < 0)
@@ -4439,6 +4801,9 @@ decode_intra_mb:
}
}
+ if(dct8x8_allowed)
+ dct8x8_allowed = get_dct8x8_allowed(h);
+
for(list=0; list<2; list++){
const int ref_count= IS_REF0(mb_type) ? 1 : h->ref_count[list];
if(ref_count == 0) continue;
@@ -4486,7 +4851,7 @@ decode_intra_mb:
}
}else if(IS_DIRECT(mb_type)){
pred_direct_motion(h, &mb_type);
- s->current_picture.mb_type[mb_xy]= mb_type;
+ dct8x8_allowed &= h->sps.direct_8x8_inference_flag;
}else{
int list, mx, my, i;
//FIXME we should set ref_idx_l? to 0 if we use that later ...
@@ -4582,6 +4947,12 @@ decode_intra_mb:
cbp= golomb_to_inter_cbp[cbp];
}
+ if(dct8x8_allowed && (cbp&15) && !IS_INTRA(mb_type)){
+ if(get_bits1(&s->gb))
+ mb_type |= MB_TYPE_8x8DCT;
+ }
+ s->current_picture.mb_type[mb_xy]= mb_type;
+
if(cbp || IS_INTRA16x16(mb_type)){
int i8x8, i4x4, chroma_idx;
int chroma_qp, dquant;
@@ -4591,10 +4962,10 @@ decode_intra_mb:
// fill_non_zero_count_cache(h);
if(IS_INTERLACED(mb_type)){
- scan= field_scan;
+ scan= s->qscale ? h->field_scan : h->field_scan_q0;
dc_scan= luma_dc_field_scan;
}else{
- scan= zigzag_scan;
+ scan= s->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
dc_scan= luma_dc_zigzag_scan;
}
@@ -4613,7 +4984,7 @@ decode_intra_mb:
h->chroma_qp= chroma_qp= get_chroma_qp(h->pps.chroma_qp_index_offset, s->qscale);
if(IS_INTRA16x16(mb_type)){
- if( decode_residual(h, h->intra_gb_ptr, h->mb, LUMA_DC_BLOCK_INDEX, dc_scan, s->qscale, 16) < 0){
+ if( decode_residual(h, h->intra_gb_ptr, h->mb, LUMA_DC_BLOCK_INDEX, dc_scan, h->dequant4_coeff[s->qscale], 16) < 0){
return -1; //FIXME continue if partitioned and other return -1 too
}
@@ -4623,7 +4994,7 @@ decode_intra_mb:
for(i8x8=0; i8x8<4; i8x8++){
for(i4x4=0; i4x4<4; i4x4++){
const int index= i4x4 + 4*i8x8;
- if( decode_residual(h, h->intra_gb_ptr, h->mb + 16*index, index, scan + 1, s->qscale, 15) < 0 ){
+ if( decode_residual(h, h->intra_gb_ptr, h->mb + 16*index, index, scan + 1, h->dequant4_coeff[s->qscale], 15) < 0 ){
return -1;
}
}
@@ -4634,11 +5005,28 @@ decode_intra_mb:
}else{
for(i8x8=0; i8x8<4; i8x8++){
if(cbp & (1<<i8x8)){
- for(i4x4=0; i4x4<4; i4x4++){
- const int index= i4x4 + 4*i8x8;
+ if(IS_8x8DCT(mb_type)){
+ DCTELEM *buf = &h->mb[64*i8x8];
+ uint8_t *nnz;
+ for(i4x4=0; i4x4<4; i4x4++){
+ if( decode_residual(h, gb, buf, i4x4+4*i8x8, zigzag_scan8x8_cavlc+16*i4x4,
+ h->dequant8_coeff[s->qscale], 16) <0 )
+ return -1;
+ }
+ if(s->qscale < 12){
+ int i;
+ for(i=0; i<64; i++)
+ buf[i] = (buf[i] + 2) >> 2;
+ }
+ nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ];
+ nnz[0] |= nnz[1] | nnz[8] | nnz[9];
+ }else{
+ for(i4x4=0; i4x4<4; i4x4++){
+ const int index= i4x4 + 4*i8x8;
- if( decode_residual(h, gb, h->mb + 16*index, index, scan, s->qscale, 16) <0 ){
- return -1;
+ if( decode_residual(h, gb, h->mb + 16*index, index, scan, h->dequant4_coeff[s->qscale], 16) <0 ){
+ return -1;
+ }
}
}
}else{
@@ -4650,7 +5038,7 @@ decode_intra_mb:
if(cbp&0x30){
for(chroma_idx=0; chroma_idx<2; chroma_idx++)
- if( decode_residual(h, gb, h->mb + 256 + 16*4*chroma_idx, CHROMA_DC_BLOCK_INDEX, chroma_dc_scan, chroma_qp, 4) < 0){
+ if( decode_residual(h, gb, h->mb + 256 + 16*4*chroma_idx, CHROMA_DC_BLOCK_INDEX, chroma_dc_scan, h->dequant4_coeff[chroma_qp], 4) < 0){
return -1;
}
}
@@ -4659,7 +5047,7 @@ decode_intra_mb:
for(chroma_idx=0; chroma_idx<2; chroma_idx++){
for(i4x4=0; i4x4<4; i4x4++){
const int index= 16 + 4*chroma_idx + i4x4;
- if( decode_residual(h, gb, h->mb + 16*index, index, scan + 1, chroma_qp, 15) < 0){
+ if( decode_residual(h, gb, h->mb + 16*index, index, scan + 1, h->dequant4_coeff[chroma_qp], 15) < 0){
return -1;
}
}
@@ -4997,6 +5385,10 @@ static int decode_cabac_b_mb_sub_type( H264Context *h ) {
return type;
}
+static inline int decode_cabac_mb_transform_size( H264Context *h ) {
+ return get_cabac( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] );
+}
+
static int decode_cabac_mb_ref( H264Context *h, int list, int n ) {
int refa = h->ref_cache[list][scan8[n] - 1];
int refb = h->ref_cache[list][scan8[n] - 8];
@@ -5092,15 +5484,30 @@ static int inline get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) {
return ctx + 4 * cat;
}
-static int inline decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int qp, int max_coeff) {
+static int inline decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint16_t *qmul, int max_coeff) {
const int mb_xy = h->s.mb_x + h->s.mb_y*h->s.mb_stride;
- const uint16_t *qmul= dequant_coeff[qp];
static const int significant_coeff_flag_field_offset[2] = { 105, 277 };
static const int last_significant_coeff_flag_field_offset[2] = { 166, 338 };
- static const int significant_coeff_flag_offset[5] = { 0, 15, 29, 44, 47 };
- static const int coeff_abs_level_m1_offset[5] = {227+ 0, 227+10, 227+20, 227+30, 227+39 };
-
- int index[16];
+ static const int significant_coeff_flag_offset[6] = { 0, 15, 29, 44, 47, 297 };
+ static const int last_significant_coeff_flag_offset[6] = { 0, 15, 29, 44, 47, 251 };
+ static const int coeff_abs_level_m1_offset[6] = { 227+0, 227+10, 227+20, 227+30, 227+39, 426 };
+ static const int identity[15] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
+ };
+ static const int significant_coeff_flag_offset_8x8[63] = {
+ 0, 1, 2, 3, 4, 5, 5, 4, 4, 3, 3, 4, 4, 4, 5, 5,
+ 4, 4, 4, 4, 3, 3, 6, 7, 7, 7, 8, 9,10, 9, 8, 7,
+ 7, 6,11,12,13,11, 6, 7, 8, 9,14,10, 9, 8, 6,11,
+ 12,13,11, 6, 9,14,10, 9,11,12,13,11,14,10,12
+ };
+ static const int last_coeff_flag_offset_8x8[63] = {
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8
+ };
+
+ int index[64];
int i, last;
int coeff_count = 0;
@@ -5108,27 +5515,45 @@ static int inline decode_cabac_residual( H264Context *h, DCTELEM *block, int cat
int abslevel1 = 1;
int abslevelgt1 = 0;
+ const int* significant_coeff_ctx_offset;
+ const int* last_coeff_ctx_offset;
+ const int significant_coeff_ctx_base = significant_coeff_flag_offset[cat]
+ + significant_coeff_flag_field_offset[h->mb_field_decoding_flag];
+ const int last_coeff_ctx_base = last_significant_coeff_flag_offset[cat]
+ + last_significant_coeff_flag_field_offset[h->mb_field_decoding_flag];
+
/* cat: 0-> DC 16x16 n = 0
* 1-> AC 16x16 n = luma4x4idx
* 2-> Luma4x4 n = luma4x4idx
* 3-> DC Chroma n = iCbCr
* 4-> AC Chroma n = 4 * iCbCr + chroma4x4idx
+ * 5-> Luma8x8 n = 4 * luma8x8idx
*/
/* read coded block flag */
- if( get_cabac( &h->cabac, &h->cabac_state[85 + get_cabac_cbf_ctx( h, cat, n ) ] ) == 0 ) {
- if( cat == 1 || cat == 2 )
- h->non_zero_count_cache[scan8[n]] = 0;
- else if( cat == 4 )
- h->non_zero_count_cache[scan8[16+n]] = 0;
+ if( cat == 5 ) {
+ significant_coeff_ctx_offset = significant_coeff_flag_offset_8x8;
+ last_coeff_ctx_offset = last_coeff_flag_offset_8x8;
+ } else {
+ if( get_cabac( &h->cabac, &h->cabac_state[85 + get_cabac_cbf_ctx( h, cat, n ) ] ) == 0 ) {
+ if( cat == 1 || cat == 2 )
+ h->non_zero_count_cache[scan8[n]] = 0;
+ else if( cat == 4 )
+ h->non_zero_count_cache[scan8[16+n]] = 0;
- return 0;
+ return 0;
+ }
+
+ significant_coeff_ctx_offset =
+ last_coeff_ctx_offset = identity;
}
for(last= 0; last < max_coeff - 1; last++) {
- if( get_cabac( &h->cabac, &h->cabac_state[significant_coeff_flag_field_offset[h->mb_field_decoding_flag]+significant_coeff_flag_offset[cat]+last] )) {
+ int sig_ctx = significant_coeff_ctx_base + significant_coeff_ctx_offset[last];
+ if( get_cabac( &h->cabac, &h->cabac_state[sig_ctx] )) {
+ int last_ctx = last_coeff_ctx_base + last_coeff_ctx_offset[last];
index[coeff_count++] = last;
- if( get_cabac( &h->cabac, &h->cabac_state[last_significant_coeff_flag_field_offset[h->mb_field_decoding_flag]+significant_coeff_flag_offset[cat]+last] ) ) {
+ if( get_cabac( &h->cabac, &h->cabac_state[last_ctx] ) ) {
last= max_coeff;
break;
}
@@ -5145,9 +5570,11 @@ static int inline decode_cabac_residual( H264Context *h, DCTELEM *block, int cat
h->non_zero_count_cache[scan8[n]] = coeff_count;
else if( cat == 3 )
h->cbp_table[mb_xy] |= 0x40 << n;
- else {
- assert( cat == 4 );
+ else if( cat == 4 )
h->non_zero_count_cache[scan8[16+n]] = coeff_count;
+ else {
+ assert( cat == 5 );
+ fill_rectangle(&h->non_zero_count_cache[scan8[n]], 2, 2, 8, 1, 1);
}
for( i = coeff_count - 1; i >= 0; i-- ) {
@@ -5232,6 +5659,7 @@ static int decode_mb_cabac(H264Context *h) {
MpegEncContext * const s = &h->s;
const int mb_xy= s->mb_x + s->mb_y*s->mb_stride;
int mb_type, partition_count, cbp = 0;
+ int dct8x8_allowed= h->pps.transform_8x8_mode;
s->dsp.clear_blocks(h->mb); //FIXME avoid if already clear (move after skip handlong?)
@@ -5290,7 +5718,6 @@ decode_intra_mb:
if(h->mb_field_decoding_flag)
mb_type |= MB_TYPE_INTERLACED;
- s->current_picture.mb_type[mb_xy]= mb_type;
h->slice_table[ mb_xy ]= h->slice_num;
if(IS_INTRA_PCM(mb_type)) {
@@ -5336,19 +5763,29 @@ decode_intra_mb:
h->chroma_qp = get_chroma_qp(h->pps.chroma_qp_index_offset, 0);
// All coeffs are present
memset(h->non_zero_count[mb_xy], 16, 16);
+ s->current_picture.mb_type[mb_xy]= mb_type;
return 0;
}
fill_caches(h, mb_type, 0);
if( IS_INTRA( mb_type ) ) {
+ int i;
if( IS_INTRA4x4( mb_type ) ) {
- int i;
- for( i = 0; i < 16; i++ ) {
- int pred = pred_intra_mode( h, i );
- h->intra4x4_pred_mode_cache[ scan8[i] ] = decode_cabac_mb_intra4x4_pred_mode( h, pred );
+ if( dct8x8_allowed && decode_cabac_mb_transform_size( h ) ) {
+ mb_type |= MB_TYPE_8x8DCT;
+ for( i = 0; i < 16; i+=4 ) {
+ int pred = pred_intra_mode( h, i );
+ int mode = decode_cabac_mb_intra4x4_pred_mode( h, pred );
+ fill_rectangle( &h->intra4x4_pred_mode_cache[ scan8[i] ], 2, 2, 8, mode, 1 );
+ }
+ } else {
+ for( i = 0; i < 16; i++ ) {
+ int pred = pred_intra_mode( h, i );
+ h->intra4x4_pred_mode_cache[ scan8[i] ] = decode_cabac_mb_intra4x4_pred_mode( h, pred );
//av_log( s->avctx, AV_LOG_ERROR, "i4x4 pred=%d mode=%d\n", pred, h->intra4x4_pred_mode_cache[ scan8[i] ] );
+ }
}
write_back_intra_pred_mode(h);
if( check_intra4x4_pred_mode(h) < 0 ) return -1;
@@ -5405,6 +5842,9 @@ decode_intra_mb:
}
}
+ if(dct8x8_allowed)
+ dct8x8_allowed = get_dct8x8_allowed(h);
+
for(list=0; list<2; list++){
for(i=0; i<4; i++){
if(IS_DIRECT(h->sub_mb_type[i])){
@@ -5469,9 +5909,9 @@ decode_intra_mb:
}
} else if( IS_DIRECT(mb_type) ) {
pred_direct_motion(h, &mb_type);
- s->current_picture.mb_type[mb_xy]= mb_type;
fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 4);
fill_rectangle(h->mvd_cache[1][scan8[0]], 4, 4, 8, 0, 4);
+ dct8x8_allowed &= h->sps.direct_8x8_inference_flag;
} else {
int list, mx, my, i, mpx, mpy;
if(IS_16X16(mb_type)){
@@ -5570,15 +6010,21 @@ decode_intra_mb:
h->cbp_table[mb_xy] = cbp;
+ if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) {
+ if( decode_cabac_mb_transform_size( h ) )
+ mb_type |= MB_TYPE_8x8DCT;
+ }
+ s->current_picture.mb_type[mb_xy]= mb_type;
+
if( cbp || IS_INTRA16x16( mb_type ) ) {
const uint8_t *scan, *dc_scan;
int dqp;
if(IS_INTERLACED(mb_type)){
- scan= field_scan;
+ scan= s->qscale ? h->field_scan : h->field_scan_q0;
dc_scan= luma_dc_field_scan;
}else{
- scan= zigzag_scan;
+ scan= s->qscale ? h->zigzag_scan : h->zigzag_scan_q0;
dc_scan= luma_dc_zigzag_scan;
}
@@ -5593,12 +6039,12 @@ decode_intra_mb:
if( IS_INTRA16x16( mb_type ) ) {
int i;
//av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 DC\n" );
- if( decode_cabac_residual( h, h->mb, 0, 0, dc_scan, s->qscale, 16) < 0)
+ if( decode_cabac_residual( h, h->mb, 0, 0, dc_scan, h->dequant4_coeff[s->qscale], 16) < 0)
return -1;
if( cbp&15 ) {
for( i = 0; i < 16; i++ ) {
//av_log( s->avctx, AV_LOG_ERROR, "INTRA16x16 AC:%d\n", i );
- if( decode_cabac_residual(h, h->mb + 16*i, 1, i, scan + 1, s->qscale, 15) < 0 )
+ if( decode_cabac_residual(h, h->mb + 16*i, 1, i, scan + 1, h->dequant4_coeff[s->qscale], 15) < 0 )
return -1;
}
} else {
@@ -5608,10 +6054,20 @@ decode_intra_mb:
int i8x8, i4x4;
for( i8x8 = 0; i8x8 < 4; i8x8++ ) {
if( cbp & (1<<i8x8) ) {
+ if( IS_8x8DCT(mb_type) ) {
+ if( decode_cabac_residual(h, h->mb + 64*i8x8, 5, 4*i8x8,
+ zigzag_scan8x8, h->dequant8_coeff[s->qscale], 64) < 0 )
+ return -1;
+ if(s->qscale < 12){
+ int i;
+ for(i=0; i<64; i++)
+ h->mb[64*i8x8+i] = (h->mb[64*i8x8+i] + 2) >> 2;
+ }
+ } else
for( i4x4 = 0; i4x4 < 4; i4x4++ ) {
const int index = 4*i8x8 + i4x4;
//av_log( s->avctx, AV_LOG_ERROR, "Luma4x4: %d\n", index );
- if( decode_cabac_residual(h, h->mb + 16*index, 2, index, scan, s->qscale, 16) < 0 )
+ if( decode_cabac_residual(h, h->mb + 16*index, 2, index, scan, h->dequant4_coeff[s->qscale], 16) < 0 )
return -1;
}
} else {
@@ -5625,7 +6081,7 @@ decode_intra_mb:
int c;
for( c = 0; c < 2; c++ ) {
//av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-DC\n",c );
- if( decode_cabac_residual(h, h->mb + 256 + 16*4*c, 3, c, chroma_dc_scan, h->chroma_qp, 4) < 0)
+ if( decode_cabac_residual(h, h->mb + 256 + 16*4*c, 3, c, chroma_dc_scan, h->dequant4_coeff[h->chroma_qp], 4) < 0)
return -1;
}
}
@@ -5636,7 +6092,7 @@ decode_intra_mb:
for( i = 0; i < 4; i++ ) {
const int index = 16 + 4 * c + i;
//av_log( s->avctx, AV_LOG_ERROR, "INTRA C%d-AC %d\n",c, index - 16 );
- if( decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, h->chroma_qp, 15) < 0)
+ if( decode_cabac_residual(h, h->mb + 16*index, 4, index - 16, scan + 1, h->dequant4_coeff[h->chroma_qp], 15) < 0)
return -1;
}
}
@@ -6003,6 +6459,7 @@ static void filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8
IS_INTRA( s->current_picture.mb_type[mbn_xy] ) ) {
bS[i] = 4;
} else if( h->non_zero_count_cache[b_idx] != 0 ||
+ /* FIXME: with 8x8dct + cavlc, should check cbp instead of nnz */
h->non_zero_count_cache[bn_idx] != 0 ) {
bS[i] = 2;
} else {
@@ -6058,6 +6515,9 @@ static void filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8
int bS[4];
int qp;
+ if( (edge&1) && IS_8x8DCT(s->current_picture.mb_type[mb_xy]) )
+ continue;
+
if (h->mb_aff_frame && (dir == 1) && (edge == 0) && ((mb_y & 1) == 0)
&& !IS_INTERLACED(s->current_picture.mb_type[mb_xy])
&& IS_INTERLACED(s->current_picture.mb_type[mbn_xy])
@@ -6205,7 +6665,7 @@ static int decode_slice(H264Context *h){
s->gb.buffer + get_bits_count(&s->gb)/8,
( s->gb.size_in_bits - get_bits_count(&s->gb) + 7)/8);
/* calculate pre-state */
- for( i= 0; i < 399; i++ ) {
+ for( i= 0; i < 460; i++ ) {
int pre;
if( h->slice_type == I_TYPE )
pre = clip( ((cabac_context_init_I[i][0] * s->qscale) >>4 ) + cabac_context_init_I[i][1], 1, 126 );
@@ -6473,6 +6933,18 @@ static inline int decode_seq_parameter_set(H264Context *h){
sps->profile_idc= profile_idc;
sps->level_idc= level_idc;
+ if(sps->profile_idc >= 100){ //high profile
+ if(get_ue_golomb(&s->gb) == 3) //chroma_format_idc
+ get_bits1(&s->gb); //residual_color_transform_flag
+ get_ue_golomb(&s->gb); //bit_depth_luma_minus8
+ get_ue_golomb(&s->gb); //bit_depth_chroma_minus8
+ sps->transform_bypass = get_bits1(&s->gb);
+ if(get_bits1(&s->gb)){ //seq_scaling_matrix_present_flag
+ av_log(h->s.avctx, AV_LOG_ERROR, "custom scaling matrix not implemented\n");
+ return -1;
+ }
+ }
+
sps->log2_max_frame_num= get_ue_golomb(&s->gb) + 4;
sps->poc_type= get_ue_golomb(&s->gb);
@@ -6547,7 +7019,7 @@ static inline int decode_seq_parameter_set(H264Context *h){
return 0;
}
-static inline int decode_picture_parameter_set(H264Context *h){
+static inline int decode_picture_parameter_set(H264Context *h, int bit_length){
MpegEncContext * const s = &h->s;
int pps_id= get_ue_golomb(&s->gb);
PPS *pps= &h->pps_buffer[pps_id];
@@ -6608,9 +7080,18 @@ static inline int decode_picture_parameter_set(H264Context *h){
pps->deblocking_filter_parameters_present= get_bits1(&s->gb);
pps->constrained_intra_pred= get_bits1(&s->gb);
pps->redundant_pic_cnt_present = get_bits1(&s->gb);
+
+ if(get_bits_count(&s->gb) < bit_length){
+ pps->transform_8x8_mode= get_bits1(&s->gb);
+ if(get_bits1(&s->gb)){ //pic_scaling_matrix_present_flag
+ av_log(h->s.avctx, AV_LOG_ERROR, "custom scaling matrix not implemented\n");
+ return -1;
+ }
+ get_se_golomb(&s->gb); //second_chroma_qp_index_offset
+ }
if(s->avctx->debug&FF_DEBUG_PICT_INFO){
- av_log(h->s.avctx, AV_LOG_DEBUG, "pps:%d sps:%d %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d %s %s %s\n",
+ av_log(h->s.avctx, AV_LOG_DEBUG, "pps:%d sps:%d %s slice_groups:%d ref:%d/%d %s qp:%d/%d/%d %s %s %s %s\n",
pps_id, pps->sps_id,
pps->cabac ? "CABAC" : "CAVLC",
pps->slice_group_count,
@@ -6619,7 +7100,8 @@ static inline int decode_picture_parameter_set(H264Context *h){
pps->init_qp, pps->init_qs, pps->chroma_qp_index_offset,
pps->deblocking_filter_parameters_present ? "LPAR" : "",
pps->constrained_intra_pred ? "CONSTR" : "",
- pps->redundant_pic_cnt_present ? "REDU" : ""
+ pps->redundant_pic_cnt_present ? "REDU" : "",
+ pps->transform_8x8_mode ? "8x8DCT" : ""
);
}
@@ -6656,6 +7138,13 @@ static int find_frame_end(H264Context *h, const uint8_t *buf, int buf_size){
}
pc->frame_start_found = 1;
}
+ if((state&0xFFFFFF1F) == 0x107 || (state&0xFFFFFF1F) == 0x108 || (state&0xFFFFFF1F) == 0x109){
+ if(pc->frame_start_found){
+ pc->state=-1;
+ pc->frame_start_found= 0;
+ return i-4;
+ }
+ }
if (i<buf_size)
state= (state<<8) | buf[i];
}
@@ -6686,6 +7175,31 @@ static int h264_parse(AVCodecParserContext *s,
return next;
}
+static int h264_split(AVCodecContext *avctx,
+ const uint8_t *buf, int buf_size)
+{
+ int i;
+ uint32_t state = -1;
+ int has_sps= 0;
+
+ for(i=0; i<=buf_size; i++){
+ if((state&0xFFFFFF1F) == 0x107)
+ has_sps=1;
+/* if((state&0xFFFFFF1F) == 0x101 || (state&0xFFFFFF1F) == 0x102 || (state&0xFFFFFF1F) == 0x105){
+ }*/
+ if((state&0xFFFFFF00) == 0x100 && (state&0xFFFFFF1F) != 0x107 && (state&0xFFFFFF1F) != 0x108 && (state&0xFFFFFF1F) != 0x109){
+ if(has_sps){
+ while(i>4 && buf[i-5]==0) i--;
+ return i-4;
+ }
+ }
+ if (i<buf_size)
+ state= (state<<8) | buf[i];
+ }
+ return 0;
+}
+
+
static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
MpegEncContext * const s = &h->s;
AVCodecContext * const avctx= s->avctx;
@@ -6697,6 +7211,7 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
}
#endif
h->slice_num = 0;
+ s->current_picture_ptr= NULL;
for(;;){
int consumed;
int dst_length;
@@ -6735,7 +7250,8 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
buf_index += consumed;
- if( s->hurry_up == 1 && h->nal_ref_idc == 0 )
+ if( (s->hurry_up == 1 && h->nal_ref_idc == 0)
+ ||(avctx->skip_frame >= AVDISCARD_NONREF && h->nal_ref_idc == 0))
continue;
switch(h->nal_unit_type){
@@ -6747,8 +7263,15 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
h->inter_gb_ptr= &s->gb;
s->data_partitioning = 0;
- if(decode_slice_header(h) < 0) return -1;
- if(h->redundant_pic_count==0 && s->hurry_up < 5 )
+ if(decode_slice_header(h) < 0){
+ av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
+ break;
+ }
+ if(h->redundant_pic_count==0 && s->hurry_up < 5
+ && (avctx->skip_frame < AVDISCARD_NONREF || h->nal_ref_idc)
+ && (avctx->skip_frame < AVDISCARD_BIDIR || h->slice_type!=B_TYPE)
+ && (avctx->skip_frame < AVDISCARD_NONKEY || h->slice_type==I_TYPE)
+ && avctx->skip_frame < AVDISCARD_ALL)
decode_slice(h);
break;
case NAL_DPA:
@@ -6757,7 +7280,9 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
h->inter_gb_ptr= NULL;
s->data_partitioning = 1;
- if(decode_slice_header(h) < 0) return -1;
+ if(decode_slice_header(h) < 0){
+ av_log(h->s.avctx, AV_LOG_ERROR, "decode_slice_header error\n");
+ }
break;
case NAL_DPB:
init_get_bits(&h->intra_gb, ptr, bit_length);
@@ -6767,7 +7292,12 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
init_get_bits(&h->inter_gb, ptr, bit_length);
h->inter_gb_ptr= &h->inter_gb;
- if(h->redundant_pic_count==0 && h->intra_gb_ptr && s->data_partitioning && s->hurry_up < 5 )
+ if(h->redundant_pic_count==0 && h->intra_gb_ptr && s->data_partitioning
+ && s->hurry_up < 5
+ && (avctx->skip_frame < AVDISCARD_NONREF || h->nal_ref_idc)
+ && (avctx->skip_frame < AVDISCARD_BIDIR || h->slice_type!=B_TYPE)
+ && (avctx->skip_frame < AVDISCARD_NONKEY || h->slice_type==I_TYPE)
+ && avctx->skip_frame < AVDISCARD_ALL)
decode_slice(h);
break;
case NAL_SEI:
@@ -6785,7 +7315,7 @@ static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
case NAL_PPS:
init_get_bits(&s->gb, ptr, bit_length);
- decode_picture_parameter_set(h);
+ decode_picture_parameter_set(h, bit_length);
break;
case NAL_PICTURE_DELIMITER:
@@ -6902,7 +7432,7 @@ static int decode_frame(AVCodecContext *avctx,
}
if(!h->is_avc && s->avctx->extradata_size && s->picture_number==0){
- if(0 < decode_nal_units(h, s->avctx->extradata, s->avctx->extradata_size) )
+ if(decode_nal_units(h, s->avctx->extradata, s->avctx->extradata_size) < 0)
return -1;
}
@@ -7226,6 +7756,7 @@ AVCodecParser h264_parser = {
NULL,
h264_parse,
ff_parse_close,
+ h264_split,
};
#include "svq3.c"
diff --git a/src/libffmpeg/libavcodec/h264data.h b/src/libffmpeg/libavcodec/h264data.h
index 21d2260e8..3e326bf30 100644
--- a/src/libffmpeg/libavcodec/h264data.h
+++ b/src/libffmpeg/libavcodec/h264data.h
@@ -306,8 +306,50 @@ static const uint8_t chroma_dc_scan[4]={
(0+1*2)*16, (1+1*2)*16, //FIXME
};
+static const uint8_t zigzag_scan8x8[64]={
+ 0+0*8, 1+0*8, 0+1*8, 0+2*8,
+ 1+1*8, 2+0*8, 3+0*8, 2+1*8,
+ 1+2*8, 0+3*8, 0+4*8, 1+3*8,
+ 2+2*8, 3+1*8, 4+0*8, 5+0*8,
+ 4+1*8, 3+2*8, 2+3*8, 1+4*8,
+ 0+5*8, 0+6*8, 1+5*8, 2+4*8,
+ 3+3*8, 4+2*8, 5+1*8, 6+0*8,
+ 7+0*8, 6+1*8, 5+2*8, 4+3*8,
+ 3+4*8, 2+5*8, 1+6*8, 0+7*8,
+ 1+7*8, 2+6*8, 3+5*8, 4+4*8,
+ 5+3*8, 6+2*8, 7+1*8, 7+2*8,
+ 6+3*8, 5+4*8, 4+5*8, 3+6*8,
+ 2+7*8, 3+7*8, 4+6*8, 5+5*8,
+ 6+4*8, 7+3*8, 7+4*8, 6+5*8,
+ 5+6*8, 4+7*8, 5+7*8, 6+6*8,
+ 7+5*8, 7+6*8, 6+7*8, 7+7*8,
+};
+
+// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
+static const uint8_t zigzag_scan8x8_cavlc[64]={
+ 0+0*8, 1+1*8, 1+2*8, 2+2*8,
+ 4+1*8, 0+5*8, 3+3*8, 7+0*8,
+ 3+4*8, 1+7*8, 5+3*8, 6+3*8,
+ 2+7*8, 6+4*8, 5+6*8, 7+5*8,
+ 1+0*8, 2+0*8, 0+3*8, 3+1*8,
+ 3+2*8, 0+6*8, 4+2*8, 6+1*8,
+ 2+5*8, 2+6*8, 6+2*8, 5+4*8,
+ 3+7*8, 7+3*8, 4+7*8, 7+6*8,
+ 0+1*8, 3+0*8, 0+4*8, 4+0*8,
+ 2+3*8, 1+5*8, 5+1*8, 5+2*8,
+ 1+6*8, 3+5*8, 7+1*8, 4+5*8,
+ 4+6*8, 7+4*8, 5+7*8, 6+7*8,
+ 0+2*8, 2+1*8, 1+3*8, 5+0*8,
+ 1+4*8, 2+4*8, 6+0*8, 4+3*8,
+ 0+7*8, 4+4*8, 7+2*8, 3+6*8,
+ 5+5*8, 6+5*8, 6+6*8, 7+7*8,
+};
+
#define MB_TYPE_REF0 MB_TYPE_ACPRED //dirty but it fits in 16bit
+#define MB_TYPE_8x8DCT 0x01000000
#define IS_REF0(a) ((a)&MB_TYPE_REF0)
+#define IS_8x8DCT(a) ((a)&MB_TYPE_8x8DCT)
+
typedef struct IMbInfo{
uint16_t type;
@@ -472,6 +514,18 @@ static const uint16_t dequant_coeff[52][16]={
//{4608,5888,4608,5888, 5888,7424,5888,7424, 4608,5888,4608,5888, 5888,7424,5888,7424, },
};
+static const int dequant8_coeff_init_scan[16] = {
+ 0,3,4,3, 3,1,5,1, 4,5,2,5, 3,1,5,1
+};
+static const int dequant8_coeff_init[6][6]={
+ {20,18,32,19,25,24},
+ {22,19,35,21,28,26},
+ {26,23,42,24,33,31},
+ {28,25,45,26,35,33},
+ {32,28,51,30,40,38},
+ {36,32,58,34,46,43},
+};
+
#define QUANT_SHIFT 22
static const int quant_coeff[52][16]={
@@ -561,7 +615,7 @@ static const int tc0_table[52][3] = {
/* Cabac pre state table */
-static const int cabac_context_init_I[399][2] =
+static const int cabac_context_init_I[460][2] =
{
/* 0 - 10 */
{ 20, -15 }, { 2, 54 }, { 3, 74 }, { 20, -15 },
@@ -707,10 +761,30 @@ static const int cabac_context_init_I[399][2] =
{ 31, -7 }, { 35, -15 }, { 34, -3 }, { 34, 3 },
{ 36, -1 }, { 34, 5 }, { 32, 11 }, { 35, 5 },
{ 34, 12 }, { 39, 11 }, { 30, 29 }, { 34, 26 },
- { 29, 39 }, { 19, 66 }
+ { 29, 39 }, { 19, 66 },
+
+ /* 399 -> 435 */
+ { 31, 21 }, { 31, 31 }, { 25, 50 },
+ { -17, 120 }, { -20, 112 }, { -18, 114 }, { -11, 85 },
+ { -15, 92 }, { -14, 89 }, { -26, 71 }, { -15, 81 },
+ { -14, 80 }, { 0, 68 }, { -14, 70 }, { -24, 56 },
+ { -23, 68 }, { -24, 50 }, { -11, 74 }, { 23, -13 },
+ { 26, -13 }, { 40, -15 }, { 49, -14 }, { 44, 3 },
+ { 45, 6 }, { 44, 34 }, { 33, 54 }, { 19, 82 },
+ { -3, 75 }, { -1, 23 }, { 1, 34 }, { 1, 43 },
+ { 0, 54 }, { -2, 55 }, { 0, 61 }, { 1, 64 },
+ { 0, 68 }, { -9, 92 },
+
+ /* 436 -> 459 */
+ { -14, 106 }, { -13, 97 }, { -15, 90 }, { -12, 90 },
+ { -18, 88 }, { -10, 73 }, { -9, 79 }, { -14, 86 },
+ { -10, 73 }, { -10, 70 }, { -10, 69 }, { -5, 66 },
+ { -9, 64 }, { -5, 58 }, { 2, 59 }, { 21, -10 },
+ { 24, -11 }, { 28, -8 }, { 28, -1 }, { 29, 3 },
+ { 29, 9 }, { 35, 20 }, { 29, 36 }, { 14, 67 }
};
-static const int cabac_context_init_PB[3][399][2] =
+static const int cabac_context_init_PB[3][460][2] =
{
/* i_cabac_init_idc == 0 */
{
@@ -847,7 +921,25 @@ static const int cabac_context_init_PB[3][399][2] =
{ 23, 42 }, { 19, 57 }, { 22, 53 }, { 22, 61 },
{ 11, 86 },
-
+ /* 399 - 435 */
+ { 12, 40 }, { 11, 51 }, { 14, 59 },
+ { -4, 79 }, { -7, 71 }, { -5, 69 }, { -9, 70 },
+ { -8, 66 }, { -10, 68 }, { -19, 73 }, { -12, 69 },
+ { -16, 70 }, { -15, 67 }, { -20, 62 }, { -19, 70 },
+ { -16, 66 }, { -22, 65 }, { -20, 63 }, { 9, -2 },
+ { 26, -9 }, { 33, -9 }, { 39, -7 }, { 41, -2 },
+ { 45, 3 }, { 49, 9 }, { 45, 27 }, { 36, 59 },
+ { -6, 66 }, { -7, 35 }, { -7, 42 }, { -8, 45 },
+ { -5, 48 }, { -12, 56 }, { -6, 60 }, { -5, 62 },
+ { -8, 66 }, { -8, 76 },
+
+ /* 436 - 459 */
+ { -5, 85 }, { -6, 81 }, { -10, 77 }, { -7, 81 },
+ { -17, 80 }, { -18, 73 }, { -4, 74 }, { -10, 83 },
+ { -9, 71 }, { -9, 67 }, { -1, 61 }, { -8, 66 },
+ { -14, 66 }, { 0, 59 }, { 2, 59 }, { 21, -13 },
+ { 33, -14 }, { 39, -7 }, { 46, -2 }, { 51, 2 },
+ { 60, 6 }, { 61, 17 }, { 55, 34 }, { 42, 62 },
},
/* i_cabac_init_idc == 1 */
@@ -985,6 +1077,25 @@ static const int cabac_context_init_PB[3][399][2] =
{ 18, 50 }, { 12, 70 }, { 21, 54 }, { 14, 71 },
{ 11, 83 },
+ /* 399 - 435 */
+ { 25, 32 }, { 21, 49 }, { 21, 54 },
+ { -5, 85 }, { -6, 81 }, { -10, 77 }, { -7, 81 },
+ { -17, 80 }, { -18, 73 }, { -4, 74 }, { -10, 83 },
+ { -9, 71 }, { -9, 67 }, { -1, 61 }, { -8, 66 },
+ { -14, 66 }, { 0, 59 }, { 2, 59 }, { 17, -10 },
+ { 32, -13 }, { 42, -9 }, { 49, -5 }, { 53, 0 },
+ { 64, 3 }, { 68, 10 }, { 66, 27 }, { 47, 57 },
+ { -5, 71 }, { 0, 24 }, { -1, 36 }, { -2, 42 },
+ { -2, 52 }, { -9, 57 }, { -6, 63 }, { -4, 65 },
+ { -4, 67 }, { -7, 82 },
+
+ /* 436 - 459 */
+ { -3, 81 }, { -3, 76 }, { -7, 72 }, { -6, 78 },
+ { -12, 72 }, { -14, 68 }, { -3, 70 }, { -6, 76 },
+ { -5, 66 }, { -5, 62 }, { 0, 57 }, { -4, 61 },
+ { -9, 60 }, { 1, 54 }, { 2, 58 }, { 17, -10 },
+ { 32, -13 }, { 42, -9 }, { 49, -5 }, { 53, 0 },
+ { 64, 3 }, { 68, 10 }, { 66, 27 }, { 47, 57 },
},
/* i_cabac_init_idc == 2 */
@@ -1121,5 +1232,25 @@ static const int cabac_context_init_PB[3][399][2] =
{ 22, 42 }, { 16, 60 }, { 15, 52 }, { 14, 60 },
{ 3, 78 }, { -16, 123 }, { 21, 53 }, { 22, 56 },
{ 25, 61 },
+
+ /* 399 - 435 */
+ { 21, 33 }, { 19, 50 }, { 17, 61 },
+ { -3, 78 }, { -8, 74 }, { -9, 72 }, { -10, 72 },
+ { -18, 75 }, { -12, 71 }, { -11, 63 }, { -5, 70 },
+ { -17, 75 }, { -14, 72 }, { -16, 67 }, { -8, 53 },
+ { -14, 59 }, { -9, 52 }, { -11, 68 }, { 9, -2 },
+ { 30, -10 }, { 31, -4 }, { 33, -1 }, { 33, 7 },
+ { 31, 12 }, { 37, 23 }, { 31, 38 }, { 20, 64 },
+ { -9, 71 }, { -7, 37 }, { -8, 44 }, { -11, 49 },
+ { -10, 56 }, { -12, 59 }, { -8, 63 }, { -9, 67 },
+ { -6, 68 }, { -10, 79 },
+
+ /* 436 - 459 */
+ { -3, 78 }, { -8, 74 }, { -9, 72 }, { -10, 72 },
+ { -18, 75 }, { -12, 71 }, { -11, 63 }, { -5, 70 },
+ { -17, 75 }, { -14, 72 }, { -16, 67 }, { -8, 53 },
+ { -14, 59 }, { -9, 52 }, { -11, 68 }, { 9, -2 },
+ { 30, -10 }, { 31, -4 }, { 33, -1 }, { 33, 7 },
+ { 31, 12 }, { 37, 23 }, { 31, 38 }, { 20, 64 },
}
};
diff --git a/src/libffmpeg/libavcodec/h264idct.c b/src/libffmpeg/libavcodec/h264idct.c
index 551197d37..e59324d58 100755
--- a/src/libffmpeg/libavcodec/h264idct.c
+++ b/src/libffmpeg/libavcodec/h264idct.c
@@ -68,3 +68,74 @@ void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block){
void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block){
idct_internal(dst, block, stride, 8, 3, 0);
}
+
+void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride){
+ int i;
+ DCTELEM (*src)[8] = (DCTELEM(*)[8])block;
+ uint8_t *cm = cropTbl + MAX_NEG_CROP;
+
+ block[0] += 32;
+
+ for( i = 0; i < 8; i++ )
+ {
+ const int a0 = src[i][0] + src[i][4];
+ const int a2 = src[i][0] - src[i][4];
+ const int a4 = (src[i][2]>>1) - src[i][6];
+ const int a6 = (src[i][6]>>1) + src[i][2];
+
+ const int b0 = a0 + a6;
+ const int b2 = a2 + a4;
+ const int b4 = a2 - a4;
+ const int b6 = a0 - a6;
+
+ const int a1 = -src[i][3] + src[i][5] - src[i][7] - (src[i][7]>>1);
+ const int a3 = src[i][1] + src[i][7] - src[i][3] - (src[i][3]>>1);
+ const int a5 = -src[i][1] + src[i][7] + src[i][5] + (src[i][5]>>1);
+ const int a7 = src[i][3] + src[i][5] + src[i][1] + (src[i][1]>>1);
+
+ const int b1 = (a7>>2) + a1;
+ const int b3 = a3 + (a5>>2);
+ const int b5 = (a3>>2) - a5;
+ const int b7 = a7 - (a1>>2);
+
+ src[i][0] = b0 + b7;
+ src[i][7] = b0 - b7;
+ src[i][1] = b2 + b5;
+ src[i][6] = b2 - b5;
+ src[i][2] = b4 + b3;
+ src[i][5] = b4 - b3;
+ src[i][3] = b6 + b1;
+ src[i][4] = b6 - b1;
+ }
+ for( i = 0; i < 8; i++ )
+ {
+ const int a0 = src[0][i] + src[4][i];
+ const int a2 = src[0][i] - src[4][i];
+ const int a4 = (src[2][i]>>1) - src[6][i];
+ const int a6 = (src[6][i]>>1) + src[2][i];
+
+ const int b0 = a0 + a6;
+ const int b2 = a2 + a4;
+ const int b4 = a2 - a4;
+ const int b6 = a0 - a6;
+
+ const int a1 = -src[3][i] + src[5][i] - src[7][i] - (src[7][i]>>1);
+ const int a3 = src[1][i] + src[7][i] - src[3][i] - (src[3][i]>>1);
+ const int a5 = -src[1][i] + src[7][i] + src[5][i] + (src[5][i]>>1);
+ const int a7 = src[3][i] + src[5][i] + src[1][i] + (src[1][i]>>1);
+
+ const int b1 = (a7>>2) + a1;
+ const int b3 = a3 + (a5>>2);
+ const int b5 = (a3>>2) - a5;
+ const int b7 = a7 - (a1>>2);
+
+ dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((b0 + b7) >> 6) ];
+ dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((b2 + b5) >> 6) ];
+ dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((b4 + b3) >> 6) ];
+ dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((b6 + b1) >> 6) ];
+ dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((b6 - b1) >> 6) ];
+ dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b4 - b3) >> 6) ];
+ dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b2 - b5) >> 6) ];
+ dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b7) >> 6) ];
+ }
+}
diff --git a/src/libffmpeg/libavcodec/i386/Makefile.am b/src/libffmpeg/libavcodec/i386/Makefile.am
index ea651c42e..f692ba62b 100644
--- a/src/libffmpeg/libavcodec/i386/Makefile.am
+++ b/src/libffmpeg/libavcodec/i386/Makefile.am
@@ -27,6 +27,7 @@ EXTRA_DIST = \
$(libavcodec_mmx_dummy) \
$(libavcodec_mmx_src) \
dsputil_h264_template_mmx.c \
+ h264dsp_mmx.c \
mpegvideo_mmx_template.c
if HAVE_FFMMX
diff --git a/src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c b/src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c
index 516a477a6..4cd4d52d8 100644
--- a/src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c
+++ b/src/libffmpeg/libavcodec/i386/dsputil_h264_template_mmx.c
@@ -50,7 +50,7 @@ static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*
"paddw %3, %%mm4\n\t"
"psubw %%mm7, %%mm4\n\t" /* mm4 = A = xy - (8x+8y) + 64 */
"pxor %%mm7, %%mm7\n\t"
- : "=m" (DD) : "rm" (x), "rm" (y), "m" (sixtyfour));
+ : "=m" (DD) : "rm" (x), "rm" (y), "m" (ff_pw_64));
asm volatile("movq %%mm4, %0" : "=m" (AA));
@@ -134,7 +134,7 @@ static void H264_CHROMA_MC8_TMPL(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*
"packuswb %%mm3, %%mm2\n\t"
H264_CHROMA_OP(%0, %%mm2)
"movq %%mm2, %0\n\t"
- : "=m" (dst[0]) : "m" (thirtytwo));
+ : "=m" (dst[0]) : "m" (ff_pw_32));
dst+= stride;
}
}
diff --git a/src/libffmpeg/libavcodec/i386/dsputil_mmx.c b/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
index 32565c3d3..6bd2b32b9 100644
--- a/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
+++ b/src/libffmpeg/libavcodec/i386/dsputil_mmx.c
@@ -43,6 +43,7 @@ static const uint64_t ff_pw_4 attribute_used __attribute__ ((aligned(8))) = 0x0
static const uint64_t ff_pw_5 attribute_used __attribute__ ((aligned(8))) = 0x0005000500050005ULL;
static const uint64_t ff_pw_16 attribute_used __attribute__ ((aligned(8))) = 0x0010001000100010ULL;
static const uint64_t ff_pw_32 attribute_used __attribute__ ((aligned(8))) = 0x0020002000200020ULL;
+static const uint64_t ff_pw_64 attribute_used __attribute__ ((aligned(8))) = 0x0040004000400040ULL;
static const uint64_t ff_pw_15 attribute_used __attribute__ ((aligned(8))) = 0x000F000F000F000FULL;
static const uint64_t ff_pb_3F attribute_used __attribute__ ((aligned(8))) = 0x3F3F3F3F3F3F3F3FULL;
@@ -299,7 +300,7 @@ void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size
:"memory");
}
-static unsigned char __align8 vector128[8] =
+static const unsigned char __align8 vector128[8] =
{ 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 };
void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size)
@@ -693,265 +694,6 @@ static void h263_h_loop_filter_mmx(uint8_t *src, int stride, int qscale){
);
}
-
-// out: o = |x-y|>a
-// clobbers: t
-#define DIFF_GT_MMX(x,y,a,o,t)\
- "movq "#y", "#t" \n\t"\
- "movq "#x", "#o" \n\t"\
- "psubusb "#x", "#t" \n\t"\
- "psubusb "#y", "#o" \n\t"\
- "por "#t", "#o" \n\t"\
- "psubusb "#a", "#o" \n\t"
-
-// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1
-// out: mm5=beta-1, mm7=mask
-// clobbers: mm4,mm6
-#define H264_DEBLOCK_MASK(alpha1, beta1) \
- "pshufw $0, "#alpha1", %%mm4 \n\t"\
- "pshufw $0, "#beta1 ", %%mm5 \n\t"\
- "packuswb %%mm4, %%mm4 \n\t"\
- "packuswb %%mm5, %%mm5 \n\t"\
- DIFF_GT_MMX(%%mm1, %%mm2, %%mm4, %%mm7, %%mm6) /* |p0-q0| > alpha-1 */\
- DIFF_GT_MMX(%%mm0, %%mm1, %%mm5, %%mm4, %%mm6) /* |p1-p0| > beta-1 */\
- "por %%mm4, %%mm7 \n\t"\
- DIFF_GT_MMX(%%mm3, %%mm2, %%mm5, %%mm4, %%mm6) /* |q1-q0| > beta-1 */\
- "por %%mm4, %%mm7 \n\t"\
- "pxor %%mm6, %%mm6 \n\t"\
- "pcmpeqb %%mm6, %%mm7 \n\t"
-
-// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask)
-// out: mm1=p0' mm2=q0'
-// clobbers: mm0,3-6
-#define H264_DEBLOCK_P0_Q0(pb_01, pb_3f)\
- /* a = q0^p0^((p1-q1)>>2) */\
- "movq %%mm0, %%mm4 \n\t"\
- "psubb %%mm3, %%mm4 \n\t"\
- "psrlw $2, %%mm4 \n\t"\
- "pxor %%mm1, %%mm4 \n\t"\
- "pxor %%mm2, %%mm4 \n\t"\
- /* b = p0^(q1>>2) */\
- "psrlw $2, %%mm3 \n\t"\
- "pand "#pb_3f", %%mm3 \n\t"\
- "movq %%mm1, %%mm5 \n\t"\
- "pxor %%mm3, %%mm5 \n\t"\
- /* c = q0^(p1>>2) */\
- "psrlw $2, %%mm0 \n\t"\
- "pand "#pb_3f", %%mm0 \n\t"\
- "movq %%mm2, %%mm6 \n\t"\
- "pxor %%mm0, %%mm6 \n\t"\
- /* d = (c^b) & ~(b^a) & 1 */\
- "pxor %%mm5, %%mm6 \n\t"\
- "pxor %%mm4, %%mm5 \n\t"\
- "pandn %%mm6, %%mm5 \n\t"\
- "pand "#pb_01", %%mm5 \n\t"\
- /* delta = (avg(q0, p1>>2) + (d&a))
- * - (avg(p0, q1>>2) + (d&~a)) */\
- "pavgb %%mm2, %%mm0 \n\t"\
- "movq %%mm5, %%mm6 \n\t"\
- "pand %%mm4, %%mm6 \n\t"\
- "paddusb %%mm6, %%mm0 \n\t"\
- "pavgb %%mm1, %%mm3 \n\t"\
- "pandn %%mm5, %%mm4 \n\t"\
- "paddusb %%mm4, %%mm3 \n\t"\
- /* p0 += clip(delta, -tc0, tc0)
- * q0 -= clip(delta, -tc0, tc0) */\
- "movq %%mm0, %%mm4 \n\t"\
- "psubusb %%mm3, %%mm0 \n\t"\
- "psubusb %%mm4, %%mm3 \n\t"\
- "pminub %%mm7, %%mm0 \n\t"\
- "pminub %%mm7, %%mm3 \n\t"\
- "paddusb %%mm0, %%mm1 \n\t"\
- "paddusb %%mm3, %%mm2 \n\t"\
- "psubusb %%mm3, %%mm1 \n\t"\
- "psubusb %%mm0, %%mm2 \n\t"
-
-// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask) %8=mm_bone
-// out: (q1addr) = clip( (q2+((p0+q0+1)>>1))>>1, q1-tc0, q1+tc0 )
-// clobbers: q2, tmp, tc0
-#define H264_DEBLOCK_Q1(p1, q2, q2addr, q1addr, tc0, tmp)\
- "movq %%mm1, "#tmp" \n\t"\
- "pavgb %%mm2, "#tmp" \n\t"\
- "pavgb "#tmp", "#q2" \n\t" /* avg(p2,avg(p0,q0)) */\
- "pxor "q2addr", "#tmp" \n\t"\
- "pand %8, "#tmp" \n\t" /* (p2^avg(p0,q0))&1 */\
- "psubusb "#tmp", "#q2" \n\t" /* (p2+((p0+q0+1)>>1))>>1 */\
- "movq "#p1", "#tmp" \n\t"\
- "psubusb "#tc0", "#tmp" \n\t"\
- "paddusb "#p1", "#tc0" \n\t"\
- "pmaxub "#tmp", "#q2" \n\t"\
- "pminub "#tc0", "#q2" \n\t"\
- "movq "#q2", "q1addr" \n\t"
-
-static inline void h264_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
-{
- uint64_t tmp0;
- uint64_t tc = (uint8_t)tc0[1]*0x01010000 | (uint8_t)tc0[0]*0x0101;
- // with luma, tc0=0 doesn't mean no filtering, so we need a separate input mask
- uint32_t mask[2] = { (tc0[0]>=0)*0xffffffff, (tc0[1]>=0)*0xffffffff };
-
- asm volatile(
- "movq (%1,%3), %%mm0 \n\t" //p1
- "movq (%1,%3,2), %%mm1 \n\t" //p0
- "movq (%2), %%mm2 \n\t" //q0
- "movq (%2,%3), %%mm3 \n\t" //q1
- H264_DEBLOCK_MASK(%6, %7)
- "pand %5, %%mm7 \n\t"
- "movq %%mm7, %0 \n\t"
-
- /* filter p1 */
- "movq (%1), %%mm3 \n\t" //p2
- DIFF_GT_MMX(%%mm1, %%mm3, %%mm5, %%mm6, %%mm4) // |p2-p0|>beta-1
- "pandn %%mm7, %%mm6 \n\t"
- "pcmpeqb %%mm7, %%mm6 \n\t"
- "pand %%mm7, %%mm6 \n\t" // mask & |p2-p0|<beta
- "pshufw $80, %4, %%mm4 \n\t"
- "pand %%mm7, %%mm4 \n\t" // mask & tc0
- "movq %8, %%mm7 \n\t"
- "pand %%mm6, %%mm7 \n\t" // mask & |p2-p0|<beta & 1
- "pand %%mm4, %%mm6 \n\t" // mask & |p2-p0|<beta & tc0
- "paddb %%mm4, %%mm7 \n\t" // tc++
- H264_DEBLOCK_Q1(%%mm0, %%mm3, "(%1)", "(%1,%3)", %%mm6, %%mm4)
-
- /* filter q1 */
- "movq (%2,%3,2), %%mm4 \n\t" //q2
- DIFF_GT_MMX(%%mm2, %%mm4, %%mm5, %%mm6, %%mm3) // |q2-q0|>beta-1
- "pandn %0, %%mm6 \n\t"
- "pcmpeqb %0, %%mm6 \n\t"
- "pand %0, %%mm6 \n\t"
- "pshufw $80, %4, %%mm5 \n\t"
- "pand %%mm6, %%mm5 \n\t"
- "pand %8, %%mm6 \n\t"
- "paddb %%mm6, %%mm7 \n\t"
- "movq (%2,%3), %%mm3 \n\t"
- H264_DEBLOCK_Q1(%%mm3, %%mm4, "(%2,%3,2)", "(%2,%3)", %%mm5, %%mm6)
-
- /* filter p0, q0 */
- H264_DEBLOCK_P0_Q0(%8, %9)
- "movq %%mm1, (%1,%3,2) \n\t"
- "movq %%mm2, (%2) \n\t"
-
- : "=m"(tmp0)
- : "r"(pix-3*stride), "r"(pix), "r"((long)stride),
- "m"(tc), "m"(*(uint64_t*)mask), "m"(alpha1), "m"(beta1),
- "m"(mm_bone), "m"(ff_pb_3F)
- );
-}
-
-static void h264_v_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- if((tc0[0] & tc0[1]) >= 0)
- h264_loop_filter_luma_mmx2(pix, stride, alpha-1, beta-1, tc0);
- if((tc0[2] & tc0[3]) >= 0)
- h264_loop_filter_luma_mmx2(pix+8, stride, alpha-1, beta-1, tc0+2);
-}
-static void h264_h_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- //FIXME: could cut some load/stores by merging transpose with filter
- // also, it only needs to transpose 6x8
- uint8_t trans[8*8];
- int i;
- for(i=0; i<2; i++, pix+=8*stride, tc0+=2) {
- if((tc0[0] & tc0[1]) < 0)
- continue;
- transpose4x4(trans, pix-4, 8, stride);
- transpose4x4(trans +4*8, pix, 8, stride);
- transpose4x4(trans+4, pix-4+4*stride, 8, stride);
- transpose4x4(trans+4+4*8, pix +4*stride, 8, stride);
- h264_loop_filter_luma_mmx2(trans+4*8, 8, alpha-1, beta-1, tc0);
- transpose4x4(pix-2, trans +2*8, stride, 8);
- transpose4x4(pix-2+4*stride, trans+4+2*8, stride, 8);
- }
-}
-
-static inline void h264_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
-{
- asm volatile(
- "movq (%0), %%mm0 \n\t" //p1
- "movq (%0,%2), %%mm1 \n\t" //p0
- "movq (%1), %%mm2 \n\t" //q0
- "movq (%1,%2), %%mm3 \n\t" //q1
- H264_DEBLOCK_MASK(%4, %5)
- "movd %3, %%mm6 \n\t"
- "punpcklbw %%mm6, %%mm6 \n\t"
- "pand %%mm6, %%mm7 \n\t" // mm7 = tc&mask
- H264_DEBLOCK_P0_Q0(%6, %7)
- "movq %%mm1, (%0,%2) \n\t"
- "movq %%mm2, (%1) \n\t"
-
- :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
- "r"(*(uint32_t*)tc0),
- "m"(alpha1), "m"(beta1), "m"(mm_bone), "m"(ff_pb_3F)
- );
-}
-
-static void h264_v_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- h264_loop_filter_chroma_mmx2(pix, stride, alpha-1, beta-1, tc0);
-}
-
-static void h264_h_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
-{
- //FIXME: could cut some load/stores by merging transpose with filter
- uint8_t trans[8*4];
- transpose4x4(trans, pix-2, 8, stride);
- transpose4x4(trans+4, pix-2+4*stride, 8, stride);
- h264_loop_filter_chroma_mmx2(trans+2*8, 8, alpha-1, beta-1, tc0);
- transpose4x4(pix-2, trans, stride, 8);
- transpose4x4(pix-2+4*stride, trans+4, stride, 8);
-}
-
-// p0 = (p0 + q1 + 2*p1 + 2) >> 2
-#define H264_FILTER_CHROMA4(p0, p1, q1, one) \
- "movq "#p0", %%mm4 \n\t"\
- "pxor "#q1", %%mm4 \n\t"\
- "pand "#one", %%mm4 \n\t" /* mm4 = (p0^q1)&1 */\
- "pavgb "#q1", "#p0" \n\t"\
- "psubusb %%mm4, "#p0" \n\t"\
- "pavgb "#p1", "#p0" \n\t" /* dst = avg(p1, avg(p0,q1) - ((p0^q1)&1)) */\
-
-static inline void h264_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha1, int beta1)
-{
- asm volatile(
- "movq (%0), %%mm0 \n\t"
- "movq (%0,%2), %%mm1 \n\t"
- "movq (%1), %%mm2 \n\t"
- "movq (%1,%2), %%mm3 \n\t"
- H264_DEBLOCK_MASK(%3, %4)
- "movq %%mm1, %%mm5 \n\t"
- "movq %%mm2, %%mm6 \n\t"
- H264_FILTER_CHROMA4(%%mm1, %%mm0, %%mm3, %5) //p0'
- H264_FILTER_CHROMA4(%%mm2, %%mm3, %%mm0, %5) //q0'
- "psubb %%mm5, %%mm1 \n\t"
- "psubb %%mm6, %%mm2 \n\t"
- "pand %%mm7, %%mm1 \n\t"
- "pand %%mm7, %%mm2 \n\t"
- "paddb %%mm5, %%mm1 \n\t"
- "paddb %%mm6, %%mm2 \n\t"
- "movq %%mm1, (%0,%2) \n\t"
- "movq %%mm2, (%1) \n\t"
- :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
- "m"(alpha1), "m"(beta1), "m"(mm_bone)
- );
-}
-
-static void h264_v_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
-{
- h264_loop_filter_chroma_intra_mmx2(pix, stride, alpha-1, beta-1);
-}
-
-static void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
-{
- //FIXME: could cut some load/stores by merging transpose with filter
- uint8_t trans[8*4];
- transpose4x4(trans, pix-2, 8, stride);
- transpose4x4(trans+4, pix-2+4*stride, 8, stride);
- h264_loop_filter_chroma_intra_mmx2(trans+2*8, 8, alpha-1, beta-1);
- transpose4x4(pix-2, trans, stride, 8);
- transpose4x4(pix-2+4*stride, trans+4, stride, 8);
-}
-
-
#ifdef CONFIG_ENCODERS
static int pix_norm1_mmx(uint8_t *pix, int line_size) {
int tmp;
@@ -2546,500 +2288,6 @@ static void OPNAME ## qpel16_mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride
OPNAME ## mpeg4_qpel16_v_lowpass_ ## MMX(dst, halfH, stride, 16);\
}
-#define QPEL_H264V(A,B,C,D,E,F,OP)\
- "movd (%0), "#F" \n\t"\
- "movq "#C", %%mm6 \n\t"\
- "paddw "#D", %%mm6 \n\t"\
- "psllw $2, %%mm6 \n\t"\
- "psubw "#B", %%mm6 \n\t"\
- "psubw "#E", %%mm6 \n\t"\
- "pmullw %4, %%mm6 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, "#F" \n\t"\
- "paddw %5, "#A" \n\t"\
- "paddw "#F", "#A" \n\t"\
- "paddw "#A", %%mm6 \n\t"\
- "psraw $5, %%mm6 \n\t"\
- "packuswb %%mm6, %%mm6 \n\t"\
- OP(%%mm6, (%1), A, d)\
- "add %3, %1 \n\t"
-
-#define QPEL_H264HV(A,B,C,D,E,F,OF)\
- "movd (%0), "#F" \n\t"\
- "movq "#C", %%mm6 \n\t"\
- "paddw "#D", %%mm6 \n\t"\
- "psllw $2, %%mm6 \n\t"\
- "psubw "#B", %%mm6 \n\t"\
- "psubw "#E", %%mm6 \n\t"\
- "pmullw %3, %%mm6 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, "#F" \n\t"\
- "paddw "#F", "#A" \n\t"\
- "paddw "#A", %%mm6 \n\t"\
- "movq %%mm6, "#OF"(%1) \n\t"
-
-#define QPEL_H264(OPNAME, OP, MMX)\
-static void OPNAME ## h264_qpel4_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- int h=4;\
-\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movq %5, %%mm4 \n\t"\
- "movq %6, %%mm5 \n\t"\
- "1: \n\t"\
- "movd -1(%0), %%mm1 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "movd 1(%0), %%mm3 \n\t"\
- "movd 2(%0), %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "paddw %%mm0, %%mm1 \n\t"\
- "paddw %%mm3, %%mm2 \n\t"\
- "movd -2(%0), %%mm0 \n\t"\
- "movd 3(%0), %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "paddw %%mm3, %%mm0 \n\t"\
- "psllw $2, %%mm2 \n\t"\
- "psubw %%mm1, %%mm2 \n\t"\
- "pmullw %%mm4, %%mm2 \n\t"\
- "paddw %%mm5, %%mm0 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "packuswb %%mm0, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm6, d)\
- "add %3, %0 \n\t"\
- "add %4, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(src), "+c"(dst), "+m"(h)\
- : "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
-}\
-static void OPNAME ## h264_qpel4_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- src -= 2*srcStride;\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd (%0), %%mm0 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm1 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm3 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm4 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
- QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
- QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
- QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
- \
- : "+a"(src), "+c"(dst)\
- : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
-}\
-static void OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- int h=4;\
- int w=3;\
- src -= 2*srcStride+2;\
- while(w--){\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd (%0), %%mm0 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm1 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm3 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm4 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*3)\
- QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*3)\
- QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*3)\
- QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*3)\
- \
- : "+a"(src)\
- : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
- : "memory"\
- );\
- tmp += 4;\
- src += 4 - 9*srcStride;\
- }\
- tmp -= 3*4;\
- asm volatile(\
- "movq %4, %%mm6 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "paddw 10(%0), %%mm0 \n\t"\
- "movq 2(%0), %%mm1 \n\t"\
- "paddw 8(%0), %%mm1 \n\t"\
- "movq 4(%0), %%mm2 \n\t"\
- "paddw 6(%0), %%mm2 \n\t"\
- "psubw %%mm1, %%mm0 \n\t"/*a-b (abccba)*/\
- "psraw $2, %%mm0 \n\t"/*(a-b)/4 */\
- "psubw %%mm1, %%mm0 \n\t"/*(a-b)/4-b */\
- "paddsw %%mm2, %%mm0 \n\t"\
- "psraw $2, %%mm0 \n\t"/*((a-b)/4-b)/4 */\
- "paddw %%mm6, %%mm2 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "psraw $6, %%mm0 \n\t"\
- "packuswb %%mm0, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm7, d)\
- "add $24, %0 \n\t"\
- "add %3, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(tmp), "+c"(dst), "+m"(h)\
- : "S"((long)dstStride), "m"(ff_pw_32)\
- : "memory"\
- );\
-}\
-\
-static void OPNAME ## h264_qpel8_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- int h=8;\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movq %5, %%mm6 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "movq 1(%0), %%mm2 \n\t"\
- "movq %%mm0, %%mm1 \n\t"\
- "movq %%mm2, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpckhbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm3, %%mm1 \n\t"\
- "psllw $2, %%mm0 \n\t"\
- "psllw $2, %%mm1 \n\t"\
- "movq -1(%0), %%mm2 \n\t"\
- "movq 2(%0), %%mm4 \n\t"\
- "movq %%mm2, %%mm3 \n\t"\
- "movq %%mm4, %%mm5 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpckhbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- "punpckhbw %%mm7, %%mm5 \n\t"\
- "paddw %%mm4, %%mm2 \n\t"\
- "paddw %%mm3, %%mm5 \n\t"\
- "psubw %%mm2, %%mm0 \n\t"\
- "psubw %%mm5, %%mm1 \n\t"\
- "pmullw %%mm6, %%mm0 \n\t"\
- "pmullw %%mm6, %%mm1 \n\t"\
- "movd -2(%0), %%mm2 \n\t"\
- "movd 7(%0), %%mm5 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm5 \n\t"\
- "paddw %%mm3, %%mm2 \n\t"\
- "paddw %%mm5, %%mm4 \n\t"\
- "movq %6, %%mm5 \n\t"\
- "paddw %%mm5, %%mm2 \n\t"\
- "paddw %%mm5, %%mm4 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm4, %%mm1 \n\t"\
- "psraw $5, %%mm0 \n\t"\
- "psraw $5, %%mm1 \n\t"\
- "packuswb %%mm1, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm5, q)\
- "add %3, %0 \n\t"\
- "add %4, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(src), "+c"(dst), "+m"(h)\
- : "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
-}\
-\
-static void OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- int h= 2;\
- src -= 2*srcStride;\
- \
- while(h--){\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd (%0), %%mm0 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm1 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm3 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm4 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
- QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
- QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
- QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
- QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\
- QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\
- QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
- QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
- \
- : "+a"(src), "+c"(dst)\
- : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
- : "memory"\
- );\
- src += 4-13*srcStride;\
- dst += 4-8*dstStride;\
- }\
-}\
-static void OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- int h=8;\
- int w=4;\
- src -= 2*srcStride+2;\
- while(w--){\
- asm volatile(\
- "pxor %%mm7, %%mm7 \n\t"\
- "movd (%0), %%mm0 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm1 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm2 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm3 \n\t"\
- "add %2, %0 \n\t"\
- "movd (%0), %%mm4 \n\t"\
- "add %2, %0 \n\t"\
- "punpcklbw %%mm7, %%mm0 \n\t"\
- "punpcklbw %%mm7, %%mm1 \n\t"\
- "punpcklbw %%mm7, %%mm2 \n\t"\
- "punpcklbw %%mm7, %%mm3 \n\t"\
- "punpcklbw %%mm7, %%mm4 \n\t"\
- QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*4)\
- QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*4)\
- QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*4)\
- QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*4)\
- QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 4*8*4)\
- QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 5*8*4)\
- QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 6*8*4)\
- QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 7*8*4)\
- \
- : "+a"(src)\
- : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
- : "memory"\
- );\
- tmp += 4;\
- src += 4 - 13*srcStride;\
- }\
- tmp -= 4*4;\
- asm volatile(\
- "movq %4, %%mm6 \n\t"\
- "1: \n\t"\
- "movq (%0), %%mm0 \n\t"\
- "movq 8(%0), %%mm3 \n\t"\
- "movq 2(%0), %%mm1 \n\t"\
- "movq 10(%0), %%mm4 \n\t"\
- "paddw %%mm4, %%mm0 \n\t"\
- "paddw %%mm3, %%mm1 \n\t"\
- "paddw 18(%0), %%mm3 \n\t"\
- "paddw 16(%0), %%mm4 \n\t"\
- "movq 4(%0), %%mm2 \n\t"\
- "movq 12(%0), %%mm5 \n\t"\
- "paddw 6(%0), %%mm2 \n\t"\
- "paddw 14(%0), %%mm5 \n\t"\
- "psubw %%mm1, %%mm0 \n\t"\
- "psubw %%mm4, %%mm3 \n\t"\
- "psraw $2, %%mm0 \n\t"\
- "psraw $2, %%mm3 \n\t"\
- "psubw %%mm1, %%mm0 \n\t"\
- "psubw %%mm4, %%mm3 \n\t"\
- "paddsw %%mm2, %%mm0 \n\t"\
- "paddsw %%mm5, %%mm3 \n\t"\
- "psraw $2, %%mm0 \n\t"\
- "psraw $2, %%mm3 \n\t"\
- "paddw %%mm6, %%mm2 \n\t"\
- "paddw %%mm6, %%mm5 \n\t"\
- "paddw %%mm2, %%mm0 \n\t"\
- "paddw %%mm5, %%mm3 \n\t"\
- "psraw $6, %%mm0 \n\t"\
- "psraw $6, %%mm3 \n\t"\
- "packuswb %%mm3, %%mm0 \n\t"\
- OP(%%mm0, (%1),%%mm7, q)\
- "add $32, %0 \n\t"\
- "add %3, %1 \n\t"\
- "decl %2 \n\t"\
- " jnz 1b \n\t"\
- : "+a"(tmp), "+c"(dst), "+m"(h)\
- : "S"((long)dstStride), "m"(ff_pw_32)\
- : "memory"\
- );\
-}\
-static void OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
- src += 8*srcStride;\
- dst += 8*dstStride;\
- OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
- OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
- src += 8*srcStride;\
- dst += 8*dstStride;\
- OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
- OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
-}\
-\
-static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
- OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride);\
- OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst+8, tmp , src+8, dstStride, tmpStride, srcStride);\
- src += 8*srcStride;\
- dst += 8*dstStride;\
- OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride);\
- OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst+8, tmp , src+8, dstStride, tmpStride, srcStride);\
-}\
-
-#define H264_MC(OPNAME, SIZE, MMX) \
-static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## pixels ## SIZE ## _mmx(dst, src, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+1, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/8];\
- uint8_t * const half= (uint8_t*)temp;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, half, stride, stride, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/4];\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/4];\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/4];\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*SIZE/4];\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4];\
- int16_t * const tmp= (int16_t*)temp;\
- OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, tmp, src, stride, SIZE, stride);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
- uint8_t * const halfH= (uint8_t*)temp;\
- uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
- uint8_t * const halfV= (uint8_t*)temp;\
- uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfV, halfHV, stride, SIZE, SIZE);\
-}\
-\
-static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
- uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
- uint8_t * const halfV= (uint8_t*)temp;\
- uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
- int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
- put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
- put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
- OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfV, halfHV, stride, SIZE, SIZE);\
-}\
-
-
#define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b " \n\t"
#define AVG_3DNOW_OP(a,b,temp, size) \
"mov" #size " " #b ", " #temp " \n\t"\
@@ -3060,48 +2308,6 @@ QPEL_OP(put_ , ff_pw_16, _ , PUT_OP, mmx2)
QPEL_OP(avg_ , ff_pw_16, _ , AVG_MMX2_OP, mmx2)
QPEL_OP(put_no_rnd_, ff_pw_15, _no_rnd_, PUT_OP, mmx2)
-QPEL_H264(put_ , PUT_OP, 3dnow)
-QPEL_H264(avg_ , AVG_3DNOW_OP, 3dnow)
-QPEL_H264(put_ , PUT_OP, mmx2)
-QPEL_H264(avg_ , AVG_MMX2_OP, mmx2)
-
-H264_MC(put_, 4, 3dnow)
-H264_MC(put_, 8, 3dnow)
-H264_MC(put_, 16,3dnow)
-H264_MC(avg_, 4, 3dnow)
-H264_MC(avg_, 8, 3dnow)
-H264_MC(avg_, 16,3dnow)
-H264_MC(put_, 4, mmx2)
-H264_MC(put_, 8, mmx2)
-H264_MC(put_, 16,mmx2)
-H264_MC(avg_, 4, mmx2)
-H264_MC(avg_, 8, mmx2)
-H264_MC(avg_, 16,mmx2)
-
-
-/** These are used by *_h264_chroma_mc8_* */
-static const uint64_t thirtytwo __align8 = 0x0020002000200020ULL;
-static const uint64_t sixtyfour __align8 = 0x0040004000400040ULL;
-
-#define H264_CHROMA_OP(S,D)
-#define H264_CHROMA_MC8_TMPL put_h264_chroma_mc8_mmx
-#include "dsputil_h264_template_mmx.c"
-#undef H264_CHROMA_OP
-#undef H264_CHROMA_MC8_TMPL
-
-#define H264_CHROMA_OP(S,D) "pavgb " #S ", " #D " \n\t"
-#define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_mmx2
-#include "dsputil_h264_template_mmx.c"
-#undef H264_CHROMA_OP
-#undef H264_CHROMA_MC8_TMPL
-
-#define H264_CHROMA_OP(S,D) "pavgusb " #S ", " #D " \n\t"
-#define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_3dnow
-#include "dsputil_h264_template_mmx.c"
-#undef H264_CHROMA_OP
-#undef H264_CHROMA_MC8_TMPL
-
-
#if 0
static void just_return() { return; }
#endif
@@ -3196,6 +2402,8 @@ static void add_8x8basis_mmx(int16_t rem[64], int16_t basis[64], int scale){
}
}
}
+
+#include "h264dsp_mmx.c"
/* external functions, from idct_mmx.c */
void ff_mmx_idct(DCTELEM *block);
@@ -3424,6 +2632,8 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->vsad[4]= vsad_intra16_mmx2;
#endif //CONFIG_ENCODERS
+ c->h264_idct_add= ff_h264_idct_add_mmx2;
+
if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_mmx2;
c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_mmx2;
diff --git a/src/libffmpeg/libavcodec/i386/h264dsp_mmx.c b/src/libffmpeg/libavcodec/i386/h264dsp_mmx.c
new file mode 100644
index 000000000..47fcf938b
--- /dev/null
+++ b/src/libffmpeg/libavcodec/i386/h264dsp_mmx.c
@@ -0,0 +1,912 @@
+/*
+ * Copyright (c) 2004-2005 Michael Niedermayer, Loren Merritt
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+/***********************************/
+/* IDCT */
+
+/* in/out: mma=mma+mmb, mmb=mmb-mma */
+#define SUMSUB_BA( a, b ) \
+ "paddw "#b", "#a" \n\t"\
+ "paddw "#b", "#b" \n\t"\
+ "psubw "#a", "#b" \n\t"
+
+#define SUMSUB_BADC( a, b, c, d ) \
+ "paddw "#b", "#a" \n\t"\
+ "paddw "#d", "#c" \n\t"\
+ "paddw "#b", "#b" \n\t"\
+ "paddw "#d", "#d" \n\t"\
+ "psubw "#a", "#b" \n\t"\
+ "psubw "#c", "#d" \n\t"
+
+#define SUMSUBD2_AB( a, b, t ) \
+ "movq "#b", "#t" \n\t"\
+ "psraw $1 , "#b" \n\t"\
+ "paddw "#a", "#b" \n\t"\
+ "psraw $1 , "#a" \n\t"\
+ "psubw "#t", "#a" \n\t"
+
+#define IDCT4_1D( s02, s13, d02, d13, t ) \
+ SUMSUB_BA ( s02, d02 )\
+ SUMSUBD2_AB( s13, d13, t )\
+ SUMSUB_BADC( d13, s02, s13, d02 )
+
+#define SBUTTERFLY(a,b,t,n)\
+ "movq " #a ", " #t " \n\t" /* abcd */\
+ "punpckl" #n " " #b ", " #a " \n\t" /* aebf */\
+ "punpckh" #n " " #b ", " #t " \n\t" /* cgdh */\
+
+#define TRANSPOSE4(a,b,c,d,t)\
+ SBUTTERFLY(a,b,t,wd) /* a=aebf t=cgdh */\
+ SBUTTERFLY(c,d,b,wd) /* c=imjn b=kolp */\
+ SBUTTERFLY(a,c,d,dq) /* a=aeim d=bfjn */\
+ SBUTTERFLY(t,b,c,dq) /* t=cgko c=dhlp */
+
+#define STORE_DIFF_4P( p, t, z ) \
+ "psraw $6, "#p" \n\t"\
+ "movd (%0), "#t" \n\t"\
+ "punpcklbw "#z", "#t" \n\t"\
+ "paddsw "#t", "#p" \n\t"\
+ "packuswb "#z", "#p" \n\t"\
+ "movd "#p", (%0) \n\t"
+
+void ff_h264_idct_add_mmx2(uint8_t *dst, int16_t *block, int stride)
+{
+ /* Load dct coeffs */
+ asm volatile(
+ "movq (%0), %%mm0 \n\t"
+ "movq 8(%0), %%mm1 \n\t"
+ "movq 16(%0), %%mm2 \n\t"
+ "movq 24(%0), %%mm3 \n\t"
+ :: "r"(block) );
+
+ asm volatile(
+ /* mm1=s02+s13 mm2=s02-s13 mm4=d02+d13 mm0=d02-d13 */
+ IDCT4_1D( %%mm2, %%mm1, %%mm0, %%mm3, %%mm4 )
+
+ "movq %0, %%mm6 \n\t"
+ /* in: 1,4,0,2 out: 1,2,3,0 */
+ TRANSPOSE4( %%mm3, %%mm1, %%mm0, %%mm2, %%mm4 )
+
+ "paddw %%mm6, %%mm3 \n\t"
+
+ /* mm2=s02+s13 mm3=s02-s13 mm4=d02+d13 mm1=d02-d13 */
+ IDCT4_1D( %%mm4, %%mm2, %%mm3, %%mm0, %%mm1 )
+
+ "pxor %%mm7, %%mm7 \n\t"
+ :: "m"(ff_pw_32));
+
+ asm volatile(
+ STORE_DIFF_4P( %%mm0, %%mm1, %%mm7)
+ "add %1, %0 \n\t"
+ STORE_DIFF_4P( %%mm2, %%mm1, %%mm7)
+ "add %1, %0 \n\t"
+ STORE_DIFF_4P( %%mm3, %%mm1, %%mm7)
+ "add %1, %0 \n\t"
+ STORE_DIFF_4P( %%mm4, %%mm1, %%mm7)
+ : "+r"(dst)
+ : "r" ((long)stride)
+ );
+}
+
+
+/***********************************/
+/* deblocking */
+
+// out: o = |x-y|>a
+// clobbers: t
+#define DIFF_GT_MMX(x,y,a,o,t)\
+ "movq "#y", "#t" \n\t"\
+ "movq "#x", "#o" \n\t"\
+ "psubusb "#x", "#t" \n\t"\
+ "psubusb "#y", "#o" \n\t"\
+ "por "#t", "#o" \n\t"\
+ "psubusb "#a", "#o" \n\t"
+
+// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1
+// out: mm5=beta-1, mm7=mask
+// clobbers: mm4,mm6
+#define H264_DEBLOCK_MASK(alpha1, beta1) \
+ "pshufw $0, "#alpha1", %%mm4 \n\t"\
+ "pshufw $0, "#beta1 ", %%mm5 \n\t"\
+ "packuswb %%mm4, %%mm4 \n\t"\
+ "packuswb %%mm5, %%mm5 \n\t"\
+ DIFF_GT_MMX(%%mm1, %%mm2, %%mm4, %%mm7, %%mm6) /* |p0-q0| > alpha-1 */\
+ DIFF_GT_MMX(%%mm0, %%mm1, %%mm5, %%mm4, %%mm6) /* |p1-p0| > beta-1 */\
+ "por %%mm4, %%mm7 \n\t"\
+ DIFF_GT_MMX(%%mm3, %%mm2, %%mm5, %%mm4, %%mm6) /* |q1-q0| > beta-1 */\
+ "por %%mm4, %%mm7 \n\t"\
+ "pxor %%mm6, %%mm6 \n\t"\
+ "pcmpeqb %%mm6, %%mm7 \n\t"
+
+// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask)
+// out: mm1=p0' mm2=q0'
+// clobbers: mm0,3-6
+#define H264_DEBLOCK_P0_Q0(pb_01, pb_3f)\
+ /* a = q0^p0^((p1-q1)>>2) */\
+ "movq %%mm0, %%mm4 \n\t"\
+ "psubb %%mm3, %%mm4 \n\t"\
+ "psrlw $2, %%mm4 \n\t"\
+ "pxor %%mm1, %%mm4 \n\t"\
+ "pxor %%mm2, %%mm4 \n\t"\
+ /* b = p0^(q1>>2) */\
+ "psrlw $2, %%mm3 \n\t"\
+ "pand "#pb_3f", %%mm3 \n\t"\
+ "movq %%mm1, %%mm5 \n\t"\
+ "pxor %%mm3, %%mm5 \n\t"\
+ /* c = q0^(p1>>2) */\
+ "psrlw $2, %%mm0 \n\t"\
+ "pand "#pb_3f", %%mm0 \n\t"\
+ "movq %%mm2, %%mm6 \n\t"\
+ "pxor %%mm0, %%mm6 \n\t"\
+ /* d = (c^b) & ~(b^a) & 1 */\
+ "pxor %%mm5, %%mm6 \n\t"\
+ "pxor %%mm4, %%mm5 \n\t"\
+ "pandn %%mm6, %%mm5 \n\t"\
+ "pand "#pb_01", %%mm5 \n\t"\
+ /* delta = (avg(q0, p1>>2) + (d&a))
+ * - (avg(p0, q1>>2) + (d&~a)) */\
+ "pavgb %%mm2, %%mm0 \n\t"\
+ "movq %%mm5, %%mm6 \n\t"\
+ "pand %%mm4, %%mm6 \n\t"\
+ "paddusb %%mm6, %%mm0 \n\t"\
+ "pavgb %%mm1, %%mm3 \n\t"\
+ "pandn %%mm5, %%mm4 \n\t"\
+ "paddusb %%mm4, %%mm3 \n\t"\
+ /* p0 += clip(delta, -tc0, tc0)
+ * q0 -= clip(delta, -tc0, tc0) */\
+ "movq %%mm0, %%mm4 \n\t"\
+ "psubusb %%mm3, %%mm0 \n\t"\
+ "psubusb %%mm4, %%mm3 \n\t"\
+ "pminub %%mm7, %%mm0 \n\t"\
+ "pminub %%mm7, %%mm3 \n\t"\
+ "paddusb %%mm0, %%mm1 \n\t"\
+ "paddusb %%mm3, %%mm2 \n\t"\
+ "psubusb %%mm3, %%mm1 \n\t"\
+ "psubusb %%mm0, %%mm2 \n\t"
+
+// in: mm0=p1 mm1=p0 mm2=q0 mm3=q1 mm7=(tc&mask) %8=mm_bone
+// out: (q1addr) = clip( (q2+((p0+q0+1)>>1))>>1, q1-tc0, q1+tc0 )
+// clobbers: q2, tmp, tc0
+#define H264_DEBLOCK_Q1(p1, q2, q2addr, q1addr, tc0, tmp)\
+ "movq %%mm1, "#tmp" \n\t"\
+ "pavgb %%mm2, "#tmp" \n\t"\
+ "pavgb "#tmp", "#q2" \n\t" /* avg(p2,avg(p0,q0)) */\
+ "pxor "q2addr", "#tmp" \n\t"\
+ "pand %8, "#tmp" \n\t" /* (p2^avg(p0,q0))&1 */\
+ "psubusb "#tmp", "#q2" \n\t" /* (p2+((p0+q0+1)>>1))>>1 */\
+ "movq "#p1", "#tmp" \n\t"\
+ "psubusb "#tc0", "#tmp" \n\t"\
+ "paddusb "#p1", "#tc0" \n\t"\
+ "pmaxub "#tmp", "#q2" \n\t"\
+ "pminub "#tc0", "#q2" \n\t"\
+ "movq "#q2", "q1addr" \n\t"
+
+static inline void h264_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
+{
+ uint64_t tmp0;
+ uint64_t tc = (uint8_t)tc0[1]*0x01010000 | (uint8_t)tc0[0]*0x0101;
+ // with luma, tc0=0 doesn't mean no filtering, so we need a separate input mask
+ uint32_t mask[2] = { (tc0[0]>=0)*0xffffffff, (tc0[1]>=0)*0xffffffff };
+
+ asm volatile(
+ "movq (%1,%3), %%mm0 \n\t" //p1
+ "movq (%1,%3,2), %%mm1 \n\t" //p0
+ "movq (%2), %%mm2 \n\t" //q0
+ "movq (%2,%3), %%mm3 \n\t" //q1
+ H264_DEBLOCK_MASK(%6, %7)
+ "pand %5, %%mm7 \n\t"
+ "movq %%mm7, %0 \n\t"
+
+ /* filter p1 */
+ "movq (%1), %%mm3 \n\t" //p2
+ DIFF_GT_MMX(%%mm1, %%mm3, %%mm5, %%mm6, %%mm4) // |p2-p0|>beta-1
+ "pandn %%mm7, %%mm6 \n\t"
+ "pcmpeqb %%mm7, %%mm6 \n\t"
+ "pand %%mm7, %%mm6 \n\t" // mask & |p2-p0|<beta
+ "pshufw $80, %4, %%mm4 \n\t"
+ "pand %%mm7, %%mm4 \n\t" // mask & tc0
+ "movq %8, %%mm7 \n\t"
+ "pand %%mm6, %%mm7 \n\t" // mask & |p2-p0|<beta & 1
+ "pand %%mm4, %%mm6 \n\t" // mask & |p2-p0|<beta & tc0
+ "paddb %%mm4, %%mm7 \n\t" // tc++
+ H264_DEBLOCK_Q1(%%mm0, %%mm3, "(%1)", "(%1,%3)", %%mm6, %%mm4)
+
+ /* filter q1 */
+ "movq (%2,%3,2), %%mm4 \n\t" //q2
+ DIFF_GT_MMX(%%mm2, %%mm4, %%mm5, %%mm6, %%mm3) // |q2-q0|>beta-1
+ "pandn %0, %%mm6 \n\t"
+ "pcmpeqb %0, %%mm6 \n\t"
+ "pand %0, %%mm6 \n\t"
+ "pshufw $80, %4, %%mm5 \n\t"
+ "pand %%mm6, %%mm5 \n\t"
+ "pand %8, %%mm6 \n\t"
+ "paddb %%mm6, %%mm7 \n\t"
+ "movq (%2,%3), %%mm3 \n\t"
+ H264_DEBLOCK_Q1(%%mm3, %%mm4, "(%2,%3,2)", "(%2,%3)", %%mm5, %%mm6)
+
+ /* filter p0, q0 */
+ H264_DEBLOCK_P0_Q0(%8, %9)
+ "movq %%mm1, (%1,%3,2) \n\t"
+ "movq %%mm2, (%2) \n\t"
+
+ : "=m"(tmp0)
+ : "r"(pix-3*stride), "r"(pix), "r"((long)stride),
+ "m"(tc), "m"(*(uint64_t*)mask), "m"(alpha1), "m"(beta1),
+ "m"(mm_bone), "m"(ff_pb_3F)
+ );
+}
+
+static void h264_v_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
+{
+ if((tc0[0] & tc0[1]) >= 0)
+ h264_loop_filter_luma_mmx2(pix, stride, alpha-1, beta-1, tc0);
+ if((tc0[2] & tc0[3]) >= 0)
+ h264_loop_filter_luma_mmx2(pix+8, stride, alpha-1, beta-1, tc0+2);
+}
+static void h264_h_loop_filter_luma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
+{
+ //FIXME: could cut some load/stores by merging transpose with filter
+ // also, it only needs to transpose 6x8
+ uint8_t trans[8*8];
+ int i;
+ for(i=0; i<2; i++, pix+=8*stride, tc0+=2) {
+ if((tc0[0] & tc0[1]) < 0)
+ continue;
+ transpose4x4(trans, pix-4, 8, stride);
+ transpose4x4(trans +4*8, pix, 8, stride);
+ transpose4x4(trans+4, pix-4+4*stride, 8, stride);
+ transpose4x4(trans+4+4*8, pix +4*stride, 8, stride);
+ h264_loop_filter_luma_mmx2(trans+4*8, 8, alpha-1, beta-1, tc0);
+ transpose4x4(pix-2, trans +2*8, stride, 8);
+ transpose4x4(pix-2+4*stride, trans+4+2*8, stride, 8);
+ }
+}
+
+static inline void h264_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha1, int beta1, int8_t *tc0)
+{
+ asm volatile(
+ "movq (%0), %%mm0 \n\t" //p1
+ "movq (%0,%2), %%mm1 \n\t" //p0
+ "movq (%1), %%mm2 \n\t" //q0
+ "movq (%1,%2), %%mm3 \n\t" //q1
+ H264_DEBLOCK_MASK(%4, %5)
+ "movd %3, %%mm6 \n\t"
+ "punpcklbw %%mm6, %%mm6 \n\t"
+ "pand %%mm6, %%mm7 \n\t" // mm7 = tc&mask
+ H264_DEBLOCK_P0_Q0(%6, %7)
+ "movq %%mm1, (%0,%2) \n\t"
+ "movq %%mm2, (%1) \n\t"
+
+ :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
+ "r"(*(uint32_t*)tc0),
+ "m"(alpha1), "m"(beta1), "m"(mm_bone), "m"(ff_pb_3F)
+ );
+}
+
+static void h264_v_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
+{
+ h264_loop_filter_chroma_mmx2(pix, stride, alpha-1, beta-1, tc0);
+}
+
+static void h264_h_loop_filter_chroma_mmx2(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0)
+{
+ //FIXME: could cut some load/stores by merging transpose with filter
+ uint8_t trans[8*4];
+ transpose4x4(trans, pix-2, 8, stride);
+ transpose4x4(trans+4, pix-2+4*stride, 8, stride);
+ h264_loop_filter_chroma_mmx2(trans+2*8, 8, alpha-1, beta-1, tc0);
+ transpose4x4(pix-2, trans, stride, 8);
+ transpose4x4(pix-2+4*stride, trans+4, stride, 8);
+}
+
+// p0 = (p0 + q1 + 2*p1 + 2) >> 2
+#define H264_FILTER_CHROMA4(p0, p1, q1, one) \
+ "movq "#p0", %%mm4 \n\t"\
+ "pxor "#q1", %%mm4 \n\t"\
+ "pand "#one", %%mm4 \n\t" /* mm4 = (p0^q1)&1 */\
+ "pavgb "#q1", "#p0" \n\t"\
+ "psubusb %%mm4, "#p0" \n\t"\
+ "pavgb "#p1", "#p0" \n\t" /* dst = avg(p1, avg(p0,q1) - ((p0^q1)&1)) */\
+
+static inline void h264_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha1, int beta1)
+{
+ asm volatile(
+ "movq (%0), %%mm0 \n\t"
+ "movq (%0,%2), %%mm1 \n\t"
+ "movq (%1), %%mm2 \n\t"
+ "movq (%1,%2), %%mm3 \n\t"
+ H264_DEBLOCK_MASK(%3, %4)
+ "movq %%mm1, %%mm5 \n\t"
+ "movq %%mm2, %%mm6 \n\t"
+ H264_FILTER_CHROMA4(%%mm1, %%mm0, %%mm3, %5) //p0'
+ H264_FILTER_CHROMA4(%%mm2, %%mm3, %%mm0, %5) //q0'
+ "psubb %%mm5, %%mm1 \n\t"
+ "psubb %%mm6, %%mm2 \n\t"
+ "pand %%mm7, %%mm1 \n\t"
+ "pand %%mm7, %%mm2 \n\t"
+ "paddb %%mm5, %%mm1 \n\t"
+ "paddb %%mm6, %%mm2 \n\t"
+ "movq %%mm1, (%0,%2) \n\t"
+ "movq %%mm2, (%1) \n\t"
+ :: "r"(pix-2*stride), "r"(pix), "r"((long)stride),
+ "m"(alpha1), "m"(beta1), "m"(mm_bone)
+ );
+}
+
+static void h264_v_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
+{
+ h264_loop_filter_chroma_intra_mmx2(pix, stride, alpha-1, beta-1);
+}
+
+static void h264_h_loop_filter_chroma_intra_mmx2(uint8_t *pix, int stride, int alpha, int beta)
+{
+ //FIXME: could cut some load/stores by merging transpose with filter
+ uint8_t trans[8*4];
+ transpose4x4(trans, pix-2, 8, stride);
+ transpose4x4(trans+4, pix-2+4*stride, 8, stride);
+ h264_loop_filter_chroma_intra_mmx2(trans+2*8, 8, alpha-1, beta-1);
+ transpose4x4(pix-2, trans, stride, 8);
+ transpose4x4(pix-2+4*stride, trans+4, stride, 8);
+}
+
+
+/***********************************/
+/* motion compensation */
+
+#define QPEL_H264V(A,B,C,D,E,F,OP)\
+ "movd (%0), "#F" \n\t"\
+ "movq "#C", %%mm6 \n\t"\
+ "paddw "#D", %%mm6 \n\t"\
+ "psllw $2, %%mm6 \n\t"\
+ "psubw "#B", %%mm6 \n\t"\
+ "psubw "#E", %%mm6 \n\t"\
+ "pmullw %4, %%mm6 \n\t"\
+ "add %2, %0 \n\t"\
+ "punpcklbw %%mm7, "#F" \n\t"\
+ "paddw %5, "#A" \n\t"\
+ "paddw "#F", "#A" \n\t"\
+ "paddw "#A", %%mm6 \n\t"\
+ "psraw $5, %%mm6 \n\t"\
+ "packuswb %%mm6, %%mm6 \n\t"\
+ OP(%%mm6, (%1), A, d)\
+ "add %3, %1 \n\t"
+
+#define QPEL_H264HV(A,B,C,D,E,F,OF)\
+ "movd (%0), "#F" \n\t"\
+ "movq "#C", %%mm6 \n\t"\
+ "paddw "#D", %%mm6 \n\t"\
+ "psllw $2, %%mm6 \n\t"\
+ "psubw "#B", %%mm6 \n\t"\
+ "psubw "#E", %%mm6 \n\t"\
+ "pmullw %3, %%mm6 \n\t"\
+ "add %2, %0 \n\t"\
+ "punpcklbw %%mm7, "#F" \n\t"\
+ "paddw "#F", "#A" \n\t"\
+ "paddw "#A", %%mm6 \n\t"\
+ "movq %%mm6, "#OF"(%1) \n\t"
+
+#define QPEL_H264(OPNAME, OP, MMX)\
+static void OPNAME ## h264_qpel4_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
+ int h=4;\
+\
+ asm volatile(\
+ "pxor %%mm7, %%mm7 \n\t"\
+ "movq %5, %%mm4 \n\t"\
+ "movq %6, %%mm5 \n\t"\
+ "1: \n\t"\
+ "movd -1(%0), %%mm1 \n\t"\
+ "movd (%0), %%mm2 \n\t"\
+ "movd 1(%0), %%mm3 \n\t"\
+ "movd 2(%0), %%mm0 \n\t"\
+ "punpcklbw %%mm7, %%mm1 \n\t"\
+ "punpcklbw %%mm7, %%mm2 \n\t"\
+ "punpcklbw %%mm7, %%mm3 \n\t"\
+ "punpcklbw %%mm7, %%mm0 \n\t"\
+ "paddw %%mm0, %%mm1 \n\t"\
+ "paddw %%mm3, %%mm2 \n\t"\
+ "movd -2(%0), %%mm0 \n\t"\
+ "movd 3(%0), %%mm3 \n\t"\
+ "punpcklbw %%mm7, %%mm0 \n\t"\
+ "punpcklbw %%mm7, %%mm3 \n\t"\
+ "paddw %%mm3, %%mm0 \n\t"\
+ "psllw $2, %%mm2 \n\t"\
+ "psubw %%mm1, %%mm2 \n\t"\
+ "pmullw %%mm4, %%mm2 \n\t"\
+ "paddw %%mm5, %%mm0 \n\t"\
+ "paddw %%mm2, %%mm0 \n\t"\
+ "psraw $5, %%mm0 \n\t"\
+ "packuswb %%mm0, %%mm0 \n\t"\
+ OP(%%mm0, (%1),%%mm6, d)\
+ "add %3, %0 \n\t"\
+ "add %4, %1 \n\t"\
+ "decl %2 \n\t"\
+ " jnz 1b \n\t"\
+ : "+a"(src), "+c"(dst), "+m"(h)\
+ : "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
+ : "memory"\
+ );\
+}\
+static void OPNAME ## h264_qpel4_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
+ src -= 2*srcStride;\
+ asm volatile(\
+ "pxor %%mm7, %%mm7 \n\t"\
+ "movd (%0), %%mm0 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm1 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm2 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm3 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm4 \n\t"\
+ "add %2, %0 \n\t"\
+ "punpcklbw %%mm7, %%mm0 \n\t"\
+ "punpcklbw %%mm7, %%mm1 \n\t"\
+ "punpcklbw %%mm7, %%mm2 \n\t"\
+ "punpcklbw %%mm7, %%mm3 \n\t"\
+ "punpcklbw %%mm7, %%mm4 \n\t"\
+ QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
+ QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
+ QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
+ QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
+ \
+ : "+a"(src), "+c"(dst)\
+ : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
+ : "memory"\
+ );\
+}\
+static void OPNAME ## h264_qpel4_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
+ int h=4;\
+ int w=3;\
+ src -= 2*srcStride+2;\
+ while(w--){\
+ asm volatile(\
+ "pxor %%mm7, %%mm7 \n\t"\
+ "movd (%0), %%mm0 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm1 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm2 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm3 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm4 \n\t"\
+ "add %2, %0 \n\t"\
+ "punpcklbw %%mm7, %%mm0 \n\t"\
+ "punpcklbw %%mm7, %%mm1 \n\t"\
+ "punpcklbw %%mm7, %%mm2 \n\t"\
+ "punpcklbw %%mm7, %%mm3 \n\t"\
+ "punpcklbw %%mm7, %%mm4 \n\t"\
+ QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*3)\
+ QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*3)\
+ QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*3)\
+ QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*3)\
+ \
+ : "+a"(src)\
+ : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
+ : "memory"\
+ );\
+ tmp += 4;\
+ src += 4 - 9*srcStride;\
+ }\
+ tmp -= 3*4;\
+ asm volatile(\
+ "movq %4, %%mm6 \n\t"\
+ "1: \n\t"\
+ "movq (%0), %%mm0 \n\t"\
+ "paddw 10(%0), %%mm0 \n\t"\
+ "movq 2(%0), %%mm1 \n\t"\
+ "paddw 8(%0), %%mm1 \n\t"\
+ "movq 4(%0), %%mm2 \n\t"\
+ "paddw 6(%0), %%mm2 \n\t"\
+ "psubw %%mm1, %%mm0 \n\t"/*a-b (abccba)*/\
+ "psraw $2, %%mm0 \n\t"/*(a-b)/4 */\
+ "psubw %%mm1, %%mm0 \n\t"/*(a-b)/4-b */\
+ "paddsw %%mm2, %%mm0 \n\t"\
+ "psraw $2, %%mm0 \n\t"/*((a-b)/4-b)/4 */\
+ "paddw %%mm6, %%mm2 \n\t"\
+ "paddw %%mm2, %%mm0 \n\t"\
+ "psraw $6, %%mm0 \n\t"\
+ "packuswb %%mm0, %%mm0 \n\t"\
+ OP(%%mm0, (%1),%%mm7, d)\
+ "add $24, %0 \n\t"\
+ "add %3, %1 \n\t"\
+ "decl %2 \n\t"\
+ " jnz 1b \n\t"\
+ : "+a"(tmp), "+c"(dst), "+m"(h)\
+ : "S"((long)dstStride), "m"(ff_pw_32)\
+ : "memory"\
+ );\
+}\
+\
+static void OPNAME ## h264_qpel8_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
+ int h=8;\
+ asm volatile(\
+ "pxor %%mm7, %%mm7 \n\t"\
+ "movq %5, %%mm6 \n\t"\
+ "1: \n\t"\
+ "movq (%0), %%mm0 \n\t"\
+ "movq 1(%0), %%mm2 \n\t"\
+ "movq %%mm0, %%mm1 \n\t"\
+ "movq %%mm2, %%mm3 \n\t"\
+ "punpcklbw %%mm7, %%mm0 \n\t"\
+ "punpckhbw %%mm7, %%mm1 \n\t"\
+ "punpcklbw %%mm7, %%mm2 \n\t"\
+ "punpckhbw %%mm7, %%mm3 \n\t"\
+ "paddw %%mm2, %%mm0 \n\t"\
+ "paddw %%mm3, %%mm1 \n\t"\
+ "psllw $2, %%mm0 \n\t"\
+ "psllw $2, %%mm1 \n\t"\
+ "movq -1(%0), %%mm2 \n\t"\
+ "movq 2(%0), %%mm4 \n\t"\
+ "movq %%mm2, %%mm3 \n\t"\
+ "movq %%mm4, %%mm5 \n\t"\
+ "punpcklbw %%mm7, %%mm2 \n\t"\
+ "punpckhbw %%mm7, %%mm3 \n\t"\
+ "punpcklbw %%mm7, %%mm4 \n\t"\
+ "punpckhbw %%mm7, %%mm5 \n\t"\
+ "paddw %%mm4, %%mm2 \n\t"\
+ "paddw %%mm3, %%mm5 \n\t"\
+ "psubw %%mm2, %%mm0 \n\t"\
+ "psubw %%mm5, %%mm1 \n\t"\
+ "pmullw %%mm6, %%mm0 \n\t"\
+ "pmullw %%mm6, %%mm1 \n\t"\
+ "movd -2(%0), %%mm2 \n\t"\
+ "movd 7(%0), %%mm5 \n\t"\
+ "punpcklbw %%mm7, %%mm2 \n\t"\
+ "punpcklbw %%mm7, %%mm5 \n\t"\
+ "paddw %%mm3, %%mm2 \n\t"\
+ "paddw %%mm5, %%mm4 \n\t"\
+ "movq %6, %%mm5 \n\t"\
+ "paddw %%mm5, %%mm2 \n\t"\
+ "paddw %%mm5, %%mm4 \n\t"\
+ "paddw %%mm2, %%mm0 \n\t"\
+ "paddw %%mm4, %%mm1 \n\t"\
+ "psraw $5, %%mm0 \n\t"\
+ "psraw $5, %%mm1 \n\t"\
+ "packuswb %%mm1, %%mm0 \n\t"\
+ OP(%%mm0, (%1),%%mm5, q)\
+ "add %3, %0 \n\t"\
+ "add %4, %1 \n\t"\
+ "decl %2 \n\t"\
+ " jnz 1b \n\t"\
+ : "+a"(src), "+c"(dst), "+m"(h)\
+ : "d"((long)srcStride), "S"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
+ : "memory"\
+ );\
+}\
+\
+static void OPNAME ## h264_qpel8_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
+ int h= 2;\
+ src -= 2*srcStride;\
+ \
+ while(h--){\
+ asm volatile(\
+ "pxor %%mm7, %%mm7 \n\t"\
+ "movd (%0), %%mm0 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm1 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm2 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm3 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm4 \n\t"\
+ "add %2, %0 \n\t"\
+ "punpcklbw %%mm7, %%mm0 \n\t"\
+ "punpcklbw %%mm7, %%mm1 \n\t"\
+ "punpcklbw %%mm7, %%mm2 \n\t"\
+ "punpcklbw %%mm7, %%mm3 \n\t"\
+ "punpcklbw %%mm7, %%mm4 \n\t"\
+ QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
+ QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
+ QPEL_H264V(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, OP)\
+ QPEL_H264V(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, OP)\
+ QPEL_H264V(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, OP)\
+ QPEL_H264V(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, OP)\
+ QPEL_H264V(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, OP)\
+ QPEL_H264V(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, OP)\
+ \
+ : "+a"(src), "+c"(dst)\
+ : "S"((long)srcStride), "D"((long)dstStride), "m"(ff_pw_5), "m"(ff_pw_16)\
+ : "memory"\
+ );\
+ src += 4-13*srcStride;\
+ dst += 4-8*dstStride;\
+ }\
+}\
+static void OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
+ int h=8;\
+ int w=4;\
+ src -= 2*srcStride+2;\
+ while(w--){\
+ asm volatile(\
+ "pxor %%mm7, %%mm7 \n\t"\
+ "movd (%0), %%mm0 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm1 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm2 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm3 \n\t"\
+ "add %2, %0 \n\t"\
+ "movd (%0), %%mm4 \n\t"\
+ "add %2, %0 \n\t"\
+ "punpcklbw %%mm7, %%mm0 \n\t"\
+ "punpcklbw %%mm7, %%mm1 \n\t"\
+ "punpcklbw %%mm7, %%mm2 \n\t"\
+ "punpcklbw %%mm7, %%mm3 \n\t"\
+ "punpcklbw %%mm7, %%mm4 \n\t"\
+ QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 0*8*4)\
+ QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 1*8*4)\
+ QPEL_H264HV(%%mm2, %%mm3, %%mm4, %%mm5, %%mm0, %%mm1, 2*8*4)\
+ QPEL_H264HV(%%mm3, %%mm4, %%mm5, %%mm0, %%mm1, %%mm2, 3*8*4)\
+ QPEL_H264HV(%%mm4, %%mm5, %%mm0, %%mm1, %%mm2, %%mm3, 4*8*4)\
+ QPEL_H264HV(%%mm5, %%mm0, %%mm1, %%mm2, %%mm3, %%mm4, 5*8*4)\
+ QPEL_H264HV(%%mm0, %%mm1, %%mm2, %%mm3, %%mm4, %%mm5, 6*8*4)\
+ QPEL_H264HV(%%mm1, %%mm2, %%mm3, %%mm4, %%mm5, %%mm0, 7*8*4)\
+ \
+ : "+a"(src)\
+ : "c"(tmp), "S"((long)srcStride), "m"(ff_pw_5)\
+ : "memory"\
+ );\
+ tmp += 4;\
+ src += 4 - 13*srcStride;\
+ }\
+ tmp -= 4*4;\
+ asm volatile(\
+ "movq %4, %%mm6 \n\t"\
+ "1: \n\t"\
+ "movq (%0), %%mm0 \n\t"\
+ "movq 8(%0), %%mm3 \n\t"\
+ "movq 2(%0), %%mm1 \n\t"\
+ "movq 10(%0), %%mm4 \n\t"\
+ "paddw %%mm4, %%mm0 \n\t"\
+ "paddw %%mm3, %%mm1 \n\t"\
+ "paddw 18(%0), %%mm3 \n\t"\
+ "paddw 16(%0), %%mm4 \n\t"\
+ "movq 4(%0), %%mm2 \n\t"\
+ "movq 12(%0), %%mm5 \n\t"\
+ "paddw 6(%0), %%mm2 \n\t"\
+ "paddw 14(%0), %%mm5 \n\t"\
+ "psubw %%mm1, %%mm0 \n\t"\
+ "psubw %%mm4, %%mm3 \n\t"\
+ "psraw $2, %%mm0 \n\t"\
+ "psraw $2, %%mm3 \n\t"\
+ "psubw %%mm1, %%mm0 \n\t"\
+ "psubw %%mm4, %%mm3 \n\t"\
+ "paddsw %%mm2, %%mm0 \n\t"\
+ "paddsw %%mm5, %%mm3 \n\t"\
+ "psraw $2, %%mm0 \n\t"\
+ "psraw $2, %%mm3 \n\t"\
+ "paddw %%mm6, %%mm2 \n\t"\
+ "paddw %%mm6, %%mm5 \n\t"\
+ "paddw %%mm2, %%mm0 \n\t"\
+ "paddw %%mm5, %%mm3 \n\t"\
+ "psraw $6, %%mm0 \n\t"\
+ "psraw $6, %%mm3 \n\t"\
+ "packuswb %%mm3, %%mm0 \n\t"\
+ OP(%%mm0, (%1),%%mm7, q)\
+ "add $32, %0 \n\t"\
+ "add %3, %1 \n\t"\
+ "decl %2 \n\t"\
+ " jnz 1b \n\t"\
+ : "+a"(tmp), "+c"(dst), "+m"(h)\
+ : "S"((long)dstStride), "m"(ff_pw_32)\
+ : "memory"\
+ );\
+}\
+static void OPNAME ## h264_qpel16_v_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
+ OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
+ OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
+ src += 8*srcStride;\
+ dst += 8*dstStride;\
+ OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
+ OPNAME ## h264_qpel8_v_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
+}\
+\
+static void OPNAME ## h264_qpel16_h_lowpass_ ## MMX(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
+ OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
+ OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
+ src += 8*srcStride;\
+ dst += 8*dstStride;\
+ OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst , src , dstStride, srcStride);\
+ OPNAME ## h264_qpel8_h_lowpass_ ## MMX(dst+8, src+8, dstStride, srcStride);\
+}\
+\
+static void OPNAME ## h264_qpel16_hv_lowpass_ ## MMX(uint8_t *dst, int16_t *tmp, uint8_t *src, int dstStride, int tmpStride, int srcStride){\
+ OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride);\
+ OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst+8, tmp , src+8, dstStride, tmpStride, srcStride);\
+ src += 8*srcStride;\
+ dst += 8*dstStride;\
+ OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst , tmp , src , dstStride, tmpStride, srcStride);\
+ OPNAME ## h264_qpel8_hv_lowpass_ ## MMX(dst+8, tmp , src+8, dstStride, tmpStride, srcStride);\
+}\
+
+#define H264_MC(OPNAME, SIZE, MMX) \
+static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## MMX (uint8_t *dst, uint8_t *src, int stride){\
+ OPNAME ## pixels ## SIZE ## _mmx(dst, src, stride, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*SIZE/8];\
+ uint8_t * const half= (uint8_t*)temp;\
+ put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(half, src, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, half, stride, stride, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## MMX(dst, src, stride, stride);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*SIZE/8];\
+ uint8_t * const half= (uint8_t*)temp;\
+ put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(half, src, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+1, half, stride, stride, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*SIZE/8];\
+ uint8_t * const half= (uint8_t*)temp;\
+ put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, half, stride, stride, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## MMX(dst, src, stride, stride);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*SIZE/8];\
+ uint8_t * const half= (uint8_t*)temp;\
+ put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(half, src, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, half, stride, stride, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*SIZE/4];\
+ uint8_t * const halfH= (uint8_t*)temp;\
+ uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
+ put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
+ put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*SIZE/4];\
+ uint8_t * const halfH= (uint8_t*)temp;\
+ uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
+ put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
+ put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*SIZE/4];\
+ uint8_t * const halfH= (uint8_t*)temp;\
+ uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
+ put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
+ put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*SIZE/4];\
+ uint8_t * const halfH= (uint8_t*)temp;\
+ uint8_t * const halfV= ((uint8_t*)temp) + SIZE*SIZE;\
+ put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
+ put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfV, stride, SIZE, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*(SIZE+8)/4];\
+ int16_t * const tmp= (int16_t*)temp;\
+ OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(dst, tmp, src, stride, SIZE, stride);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
+ uint8_t * const halfH= (uint8_t*)temp;\
+ uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
+ int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
+ put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src, SIZE, stride);\
+ put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfHV, stride, SIZE, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
+ uint8_t * const halfH= (uint8_t*)temp;\
+ uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
+ int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
+ put_h264_qpel ## SIZE ## _h_lowpass_ ## MMX(halfH, src + stride, SIZE, stride);\
+ put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfH, halfHV, stride, SIZE, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
+ uint8_t * const halfV= (uint8_t*)temp;\
+ uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
+ int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
+ put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src, SIZE, stride);\
+ put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfV, halfHV, stride, SIZE, SIZE);\
+}\
+\
+static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## MMX(uint8_t *dst, uint8_t *src, int stride){\
+ uint64_t temp[SIZE*(SIZE+8)/4 + SIZE*SIZE/4];\
+ uint8_t * const halfV= (uint8_t*)temp;\
+ uint8_t * const halfHV= ((uint8_t*)temp) + SIZE*SIZE;\
+ int16_t * const tmp= ((int16_t*)temp) + SIZE*SIZE;\
+ put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(halfV, src+1, SIZE, stride);\
+ put_h264_qpel ## SIZE ## _hv_lowpass_ ## MMX(halfHV, tmp, src, SIZE, SIZE, stride);\
+ OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, halfV, halfHV, stride, SIZE, SIZE);\
+}\
+
+
+#define PUT_OP(a,b,temp, size) "mov" #size " " #a ", " #b " \n\t"
+#define AVG_3DNOW_OP(a,b,temp, size) \
+"mov" #size " " #b ", " #temp " \n\t"\
+"pavgusb " #temp ", " #a " \n\t"\
+"mov" #size " " #a ", " #b " \n\t"
+#define AVG_MMX2_OP(a,b,temp, size) \
+"mov" #size " " #b ", " #temp " \n\t"\
+"pavgb " #temp ", " #a " \n\t"\
+"mov" #size " " #a ", " #b " \n\t"
+
+QPEL_H264(put_, PUT_OP, 3dnow)
+QPEL_H264(avg_, AVG_3DNOW_OP, 3dnow)
+QPEL_H264(put_, PUT_OP, mmx2)
+QPEL_H264(avg_, AVG_MMX2_OP, mmx2)
+
+H264_MC(put_, 4, 3dnow)
+H264_MC(put_, 8, 3dnow)
+H264_MC(put_, 16,3dnow)
+H264_MC(avg_, 4, 3dnow)
+H264_MC(avg_, 8, 3dnow)
+H264_MC(avg_, 16,3dnow)
+H264_MC(put_, 4, mmx2)
+H264_MC(put_, 8, mmx2)
+H264_MC(put_, 16,mmx2)
+H264_MC(avg_, 4, mmx2)
+H264_MC(avg_, 8, mmx2)
+H264_MC(avg_, 16,mmx2)
+
+
+#define H264_CHROMA_OP(S,D)
+#define H264_CHROMA_MC8_TMPL put_h264_chroma_mc8_mmx
+#include "dsputil_h264_template_mmx.c"
+#undef H264_CHROMA_OP
+#undef H264_CHROMA_MC8_TMPL
+
+#define H264_CHROMA_OP(S,D) "pavgb " #S ", " #D " \n\t"
+#define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_mmx2
+#include "dsputil_h264_template_mmx.c"
+#undef H264_CHROMA_OP
+#undef H264_CHROMA_MC8_TMPL
+
+#define H264_CHROMA_OP(S,D) "pavgusb " #S ", " #D " \n\t"
+#define H264_CHROMA_MC8_TMPL avg_h264_chroma_mc8_3dnow
+#include "dsputil_h264_template_mmx.c"
+#undef H264_CHROMA_OP
+#undef H264_CHROMA_MC8_TMPL
+
diff --git a/src/libffmpeg/libavcodec/i386/idct_mmx.c b/src/libffmpeg/libavcodec/i386/idct_mmx.c
index c356afe12..d9586efc5 100644
--- a/src/libffmpeg/libavcodec/i386/idct_mmx.c
+++ b/src/libffmpeg/libavcodec/i386/idct_mmx.c
@@ -597,3 +597,4 @@ declare_idct (ff_mmxext_idct, mmxext_table,
declare_idct (ff_mmx_idct, mmx_table,
mmx_row_head, mmx_row, mmx_row_tail, mmx_row_mid)
+
diff --git a/src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c b/src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c
index ea0405717..3d220c1d4 100644
--- a/src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c
+++ b/src/libffmpeg/libavcodec/i386/vp3dsp_mmx.c
@@ -32,7 +32,7 @@
* idct_constants[44..47] = 8
*/
static uint16_t idct_constants[(4 + 7 + 1) * 4];
-static uint16_t idct_cosine_table[7] = {
+static const uint16_t idct_cosine_table[7] = {
64277, 60547, 54491, 46341, 36410, 25080, 12785
};
diff --git a/src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c b/src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c
index 9c69ddb21..97937651a 100644
--- a/src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c
+++ b/src/libffmpeg/libavcodec/i386/vp3dsp_sse2.c
@@ -24,7 +24,7 @@
#include "../dsputil.h"
#include "mmx.h"
-static unsigned short __align16 SSE2_dequant_const[] =
+static const unsigned short __align16 SSE2_dequant_const[] =
{
0,65535,65535,0,0,0,0,0, // 0x0000 0000 0000 0000 0000 FFFF FFFF 0000
0,0,0,0,65535,65535,0,0, // 0x0000 0000 FFFF FFFF 0000 0000 0000 0000
@@ -35,7 +35,7 @@ static unsigned short __align16 SSE2_dequant_const[] =
0,0,65535,65535, 0,0,0,0 // 0x0000 0000 0000 0000 FFFF FFFF 0000 0000
};
-static unsigned int __align16 eight_data[] =
+static const unsigned int __align16 eight_data[] =
{
0x00080008,
0x00080008,
@@ -43,7 +43,7 @@ static unsigned int __align16 eight_data[] =
0x00080008
};
-static unsigned short __align16 SSE2_idct_data[7 * 8] =
+static const unsigned short __align16 SSE2_idct_data[7 * 8] =
{
64277,64277,64277,64277,64277,64277,64277,64277,
60547,60547,60547,60547,60547,60547,60547,60547,
diff --git a/src/libffmpeg/libavcodec/imgconvert.c b/src/libffmpeg/libavcodec/imgconvert.c
index 1ba723a95..afb66fa85 100644
--- a/src/libffmpeg/libavcodec/imgconvert.c
+++ b/src/libffmpeg/libavcodec/imgconvert.c
@@ -576,6 +576,8 @@ static void img_copy_plane(uint8_t *dst, int dst_wrap,
const uint8_t *src, int src_wrap,
int width, int height)
{
+ if((!dst) || (!src))
+ return;
for(;height > 0; height--) {
memcpy(dst, src, width);
dst += dst_wrap;
diff --git a/src/libffmpeg/libavcodec/indeo2.c b/src/libffmpeg/libavcodec/indeo2.c
index 25561ec2d..5063117ca 100644
--- a/src/libffmpeg/libavcodec/indeo2.c
+++ b/src/libffmpeg/libavcodec/indeo2.c
@@ -118,11 +118,11 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_
c -= 0x7F;
out += c * 2;
} else { /* add two deltas from table */
- t = dst[out] + (table[c * 2] - 128);
+ t = dst[out] + (((table[c * 2] - 128)*3) >> 2);
t= clip_uint8(t);
dst[out] = t;
out++;
- t = dst[out] + (table[(c * 2) + 1] - 128);
+ t = dst[out] + (((table[(c * 2) + 1] - 128)*3) >> 2);
t= clip_uint8(t);
dst[out] = t;
out++;
diff --git a/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c b/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c
index 0b88be69d..8f225636e 100644
--- a/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c
+++ b/src/libffmpeg/libavcodec/libpostproc/postprocess_template.c
@@ -3495,7 +3495,7 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int
"prefetchnta 32(%%"REG_a", %0) \n\t"
"prefetcht0 32(%%"REG_d", %2) \n\t"
:: "r" (srcBlock), "r" ((long)srcStride), "r" (dstBlock), "r" ((long)dstStride),
- "m" ((long)x), "m" ((long)copyAhead)
+ "g" ((long)x), "g" ((long)copyAhead)
: "%"REG_a, "%"REG_d
);
@@ -3641,7 +3641,7 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int
"prefetchnta 32(%%"REG_a", %0) \n\t"
"prefetcht0 32(%%"REG_d", %2) \n\t"
:: "r" (srcBlock), "r" ((long)srcStride), "r" (dstBlock), "r" ((long)dstStride),
- "m" ((long)x), "m" ((long)copyAhead)
+ "g" ((long)x), "g" ((long)copyAhead)
: "%"REG_a, "%"REG_d
);
diff --git a/src/libffmpeg/libavcodec/mjpeg.c b/src/libffmpeg/libavcodec/mjpeg.c
index 4c2b4793b..7aaf1e73a 100644
--- a/src/libffmpeg/libavcodec/mjpeg.c
+++ b/src/libffmpeg/libavcodec/mjpeg.c
@@ -896,11 +896,8 @@ static int mjpeg_decode_init(AVCodecContext *avctx)
s->idct_put= s2.dsp.idct_put;
s->mpeg_enc_ctx_allocated = 0;
- s->buffer_size = 102400; /* smaller buffer should be enough,
- but photojpg files could ahive bigger sizes */
- s->buffer = av_malloc(s->buffer_size);
- if (!s->buffer)
- return -1;
+ s->buffer_size = 0;
+ s->buffer = NULL;
s->start_code = -1;
s->first_picture = 1;
s->org_height = avctx->coded_height;
@@ -1585,10 +1582,11 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
{
int len, id;
- /* XXX: verify len field validity */
len = get_bits(&s->gb, 16);
if (len < 5)
return -1;
+ if(8*len + get_bits_count(&s->gb) > s->gb.size_in_bits)
+ return -1;
id = (get_bits(&s->gb, 16) << 16) | get_bits(&s->gb, 16);
id = be2me_32(id);
@@ -1727,10 +1725,8 @@ out:
static int mjpeg_decode_com(MJpegDecodeContext *s)
{
- /* XXX: verify len field validity */
int len = get_bits(&s->gb, 16);
- if (len >= 2 && len < 32768) {
- /* XXX: any better upper bound */
+ if (len >= 2 && 8*len - 16 + get_bits_count(&s->gb) <= s->gb.size_in_bits) {
uint8_t *cbuf = av_malloc(len - 1);
if (cbuf) {
int i;
@@ -1842,7 +1838,7 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
{
av_free(s->buffer);
s->buffer_size = buf_end-buf_ptr;
- s->buffer = av_malloc(s->buffer_size);
+ s->buffer = av_malloc(s->buffer_size + FF_INPUT_BUFFER_PADDING_SIZE);
dprintf("buffer too small, expanding to %d bytes\n",
s->buffer_size);
}
diff --git a/src/libffmpeg/libavcodec/motion_est.c b/src/libffmpeg/libavcodec/motion_est.c
index 0136dcdfe..695111c78 100644
--- a/src/libffmpeg/libavcodec/motion_est.c
+++ b/src/libffmpeg/libavcodec/motion_est.c
@@ -667,7 +667,7 @@ static inline void set_p_mv_tables(MpegEncContext * s, int mx, int my, int mv4)
s->p_mv_table[xy][0] = mx;
s->p_mv_table[xy][1] = my;
- /* has allready been set to the 4 MV if 4MV is done */
+ /* has already been set to the 4 MV if 4MV is done */
if(mv4){
int mot_xy= s->block_index[0];
diff --git a/src/libffmpeg/libavcodec/mpeg12.c b/src/libffmpeg/libavcodec/mpeg12.c
index d446ee95c..f245131dc 100644
--- a/src/libffmpeg/libavcodec/mpeg12.c
+++ b/src/libffmpeg/libavcodec/mpeg12.c
@@ -2212,7 +2212,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
if (s->pict_type == P_TYPE || s->pict_type == B_TYPE) {
s->full_pel[0] = get_bits1(&s->gb);
f_code = get_bits(&s->gb, 3);
- if (f_code == 0)
+ if (f_code == 0 && avctx->error_resilience >= FF_ER_COMPLIANT)
return -1;
s->mpeg_f_code[0][0] = f_code;
s->mpeg_f_code[0][1] = f_code;
@@ -2220,7 +2220,7 @@ static int mpeg1_decode_picture(AVCodecContext *avctx,
if (s->pict_type == B_TYPE) {
s->full_pel[1] = get_bits1(&s->gb);
f_code = get_bits(&s->gb, 3);
- if (f_code == 0)
+ if (f_code == 0 && avctx->error_resilience >= FF_ER_COMPLIANT)
return -1;
s->mpeg_f_code[1][0] = f_code;
s->mpeg_f_code[1][1] = f_code;
@@ -3078,7 +3078,7 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
/* find start next code */
start_code = find_start_code(&buf_ptr, buf_end);
if (start_code < 0){
- if(s2->pict_type != B_TYPE || avctx->hurry_up==0){
+ if(s2->pict_type != B_TYPE || avctx->skip_frame <= AVDISCARD_DEFAULT){
if(avctx->thread_count > 1){
int i;
@@ -3130,10 +3130,18 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
start_code <= SLICE_MAX_START_CODE) {
int mb_y= start_code - SLICE_MIN_START_CODE;
+ if(s2->last_picture_ptr==NULL){
/* skip b frames if we dont have reference frames */
- if(s2->last_picture_ptr==NULL && s2->pict_type==B_TYPE) break;
+ if(s2->pict_type==B_TYPE) break;
+ /* skip P frames if we dont have reference frame no valid header */
+ if(s2->pict_type==P_TYPE && !s2->first_slice) break;
+ }
/* skip b frames if we are in a hurry */
if(avctx->hurry_up && s2->pict_type==B_TYPE) break;
+ if( (avctx->skip_frame >= AVDISCARD_NONREF && s2->pict_type==B_TYPE)
+ ||(avctx->skip_frame >= AVDISCARD_NONKEY && s2->pict_type!=I_TYPE)
+ || avctx->skip_frame >= AVDISCARD_ALL)
+ break;
/* skip everything if we are in a hurry>=5 */
if(avctx->hurry_up>=5) break;
diff --git a/src/libffmpeg/libavcodec/mpeg12data.h b/src/libffmpeg/libavcodec/mpeg12data.h
index 82e2ab6a1..d9c09001e 100644
--- a/src/libffmpeg/libavcodec/mpeg12data.h
+++ b/src/libffmpeg/libavcodec/mpeg12data.h
@@ -359,7 +359,7 @@ static const uint8_t non_linear_qscale[32] = {
56,64,72,80,88,96,104,112,
};
-uint8_t ff_mpeg1_dc_scale_table[128]={
+const uint8_t ff_mpeg1_dc_scale_table[128]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
@@ -367,7 +367,7 @@ uint8_t ff_mpeg1_dc_scale_table[128]={
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
};
-static uint8_t mpeg2_dc_scale_table1[128]={
+const static uint8_t mpeg2_dc_scale_table1[128]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
@@ -375,7 +375,7 @@ static uint8_t mpeg2_dc_scale_table1[128]={
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
};
-static uint8_t mpeg2_dc_scale_table2[128]={
+static const uint8_t mpeg2_dc_scale_table2[128]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -383,7 +383,7 @@ static uint8_t mpeg2_dc_scale_table2[128]={
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
};
-static uint8_t mpeg2_dc_scale_table3[128]={
+static const uint8_t mpeg2_dc_scale_table3[128]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -391,7 +391,7 @@ static uint8_t mpeg2_dc_scale_table3[128]={
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
};
-static uint8_t *mpeg2_dc_scale_table[4]={
+static const uint8_t *mpeg2_dc_scale_table[4]={
ff_mpeg1_dc_scale_table,
mpeg2_dc_scale_table1,
mpeg2_dc_scale_table2,
diff --git a/src/libffmpeg/libavcodec/mpeg4data.h b/src/libffmpeg/libavcodec/mpeg4data.h
index 0092a9f5e..0ceef90b7 100644
--- a/src/libffmpeg/libavcodec/mpeg4data.h
+++ b/src/libffmpeg/libavcodec/mpeg4data.h
@@ -383,11 +383,11 @@ const int16_t ff_mpeg4_default_non_intra_matrix[64] = {
23, 24, 25, 27, 28, 30, 31, 33,
};
-uint8_t ff_mpeg4_y_dc_scale_table[32]={
+const uint8_t ff_mpeg4_y_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,36,38,40,42,44,46
};
-uint8_t ff_mpeg4_c_dc_scale_table[32]={
+const uint8_t ff_mpeg4_c_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,21,22,23,24,25
};
diff --git a/src/libffmpeg/libavcodec/mpegaudiodec.c b/src/libffmpeg/libavcodec/mpegaudiodec.c
index 106c9fe68..708d35536 100644
--- a/src/libffmpeg/libavcodec/mpegaudiodec.c
+++ b/src/libffmpeg/libavcodec/mpegaudiodec.c
@@ -190,7 +190,7 @@ static int32_t scale_factor_mult[15][3];
#define SCALE_GEN(v) \
{ FIXR(1.0 * (v)), FIXR(0.7937005259 * (v)), FIXR(0.6299605249 * (v)) }
-static int32_t scale_factor_mult2[3][3] = {
+static const int32_t scale_factor_mult2[3][3] = {
SCALE_GEN(4.0 / 3.0), /* 3 steps */
SCALE_GEN(4.0 / 5.0), /* 5 steps */
SCALE_GEN(4.0 / 9.0), /* 9 steps */
diff --git a/src/libffmpeg/libavcodec/mpegaudiodectab.h b/src/libffmpeg/libavcodec/mpegaudiodectab.h
index 8a13127ad..a60edb646 100644
--- a/src/libffmpeg/libavcodec/mpegaudiodectab.h
+++ b/src/libffmpeg/libavcodec/mpegaudiodectab.h
@@ -719,12 +719,12 @@ const uint8_t mpa_huff_data[32][2] = {
/* huffman tables for quadrules */
-static uint8_t mpa_quad_codes[2][16] = {
+static const uint8_t mpa_quad_codes[2][16] = {
{ 1, 5, 4, 5, 6, 5, 4, 4, 7, 3, 6, 0, 7, 2, 3, 1, },
{ 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, },
};
-static uint8_t mpa_quad_bits[2][16] = {
+static const uint8_t mpa_quad_bits[2][16] = {
{ 1, 4, 4, 5, 4, 6, 5, 6, 4, 5, 5, 6, 5, 6, 6, 6, },
{ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, },
};
diff --git a/src/libffmpeg/libavcodec/mpegaudiotab.h b/src/libffmpeg/libavcodec/mpegaudiotab.h
index 59bf86893..d2c13edd6 100644
--- a/src/libffmpeg/libavcodec/mpegaudiotab.h
+++ b/src/libffmpeg/libavcodec/mpegaudiotab.h
@@ -77,7 +77,7 @@ static unsigned short total_quant_bits[17];
/* signal to noise ratio of each quantification step (could be
computed from quant_steps[]). The values are dB multiplied by 10
*/
-static unsigned short quant_snr[17] = {
+static const unsigned short quant_snr[17] = {
70, 110, 160, 208,
253, 316, 378, 439,
499, 559, 620, 680,
diff --git a/src/libffmpeg/libavcodec/mpegvideo.c b/src/libffmpeg/libavcodec/mpegvideo.c
index d37087c3f..38d8a99b9 100644
--- a/src/libffmpeg/libavcodec/mpegvideo.c
+++ b/src/libffmpeg/libavcodec/mpegvideo.c
@@ -372,7 +372,7 @@ static int alloc_picture(MpegEncContext *s, Picture *pic, int shared){
}
if(pic->linesize[1] != pic->linesize[2]){
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (uv stride missmatch)\n");
+ av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed (uv stride mismatch)\n");
return -1;
}
@@ -550,9 +550,9 @@ static void update_duplicate_context_after_me(MpegEncContext *dst, MpegEncContex
COPY(lambda2);
COPY(picture_in_gop_number);
COPY(gop_picture_number);
- COPY(frame_pred_frame_dct); //FIXME dont set in encode_header
- COPY(progressive_frame); //FIXME dont set in encode_header
- COPY(partitioned_frame); //FIXME dont set in encode_header
+ COPY(frame_pred_frame_dct); //FIXME don't set in encode_header
+ COPY(progressive_frame); //FIXME don't set in encode_header
+ COPY(partitioned_frame); //FIXME don't set in encode_header
#undef COPY
}
@@ -1493,7 +1493,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
}
alloc:
if(!s->encoding){
- /* release non refernce frames */
+ /* release non reference frames */
for(i=0; i<MAX_PICTURE_COUNT; i++){
if(s->picture[i].data[0] && !s->picture[i].reference /*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/){
s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[i]);
@@ -1544,7 +1544,7 @@ alloc:
if(s->pict_type != I_TYPE && (s->last_picture_ptr==NULL || s->last_picture_ptr->data[0]==NULL)){
av_log(avctx, AV_LOG_ERROR, "warning: first frame is no keyframe\n");
- assert(s->pict_type != B_TYPE); //these should have been dropped if we dont have a reference
+ assert(s->pict_type != B_TYPE); //these should have been dropped if we don't have a reference
goto alloc;
}
@@ -1566,8 +1566,8 @@ alloc:
s->hurry_up= s->avctx->hurry_up;
s->error_resilience= avctx->error_resilience;
- /* set dequantizer, we cant do it during init as it might change for mpeg4
- and we cant do it in the header decode as init isnt called for mpeg4 there yet */
+ /* set dequantizer, we can't do it during init as it might change for mpeg4
+ and we can't do it in the header decode as init isnt called for mpeg4 there yet */
if(s->mpeg_quant || s->codec_id == CODEC_ID_MPEG2VIDEO){
s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra;
s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter;
@@ -1626,7 +1626,7 @@ void MPV_frame_end(MpegEncContext *s)
#endif
if(s->encoding){
- /* release non refernce frames */
+ /* release non-reference frames */
for(i=0; i<MAX_PICTURE_COUNT; i++){
if(s->picture[i].data[0] && !s->picture[i].reference /*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/){
s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[i]);
@@ -2164,7 +2164,7 @@ static void select_input_picture(MpegEncContext *s){
s->reordered_input_picture[i-1]= s->reordered_input_picture[i];
s->reordered_input_picture[MAX_PICTURE_COUNT-1]= NULL;
- /* set next picture types & ordering */
+ /* set next picture type & ordering */
if(s->reordered_input_picture[0]==NULL && s->input_picture[0]){
if(/*s->picture_in_gop_number >= s->gop_size ||*/ s->next_picture_ptr==NULL || s->intra_only){
s->reordered_input_picture[0]= s->input_picture[0];
@@ -2281,7 +2281,7 @@ no_output_pic:
copy_picture(&s->new_picture, s->reordered_input_picture[0]);
if(s->reordered_input_picture[0]->type == FF_BUFFER_TYPE_SHARED){
- // input is a shared pix, so we cant modifiy it -> alloc a new one & ensure that the shared one is reuseable
+ // input is a shared pix, so we can't modifiy it -> alloc a new one & ensure that the shared one is reuseable
int i= ff_find_unused_picture(s, 0);
Picture *pic= &s->picture[i];
@@ -3231,7 +3231,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
}
/**
- * motion compesation of a single macroblock
+ * motion compensation of a single macroblock
* @param s context
* @param dest_y luma destination pointer
* @param dest_cb chroma cb/u destination pointer
@@ -3480,7 +3480,7 @@ static inline void MPV_motion(MpegEncContext *s,
}
/**
- * motion compesation of a single macroblock
+ * motion compensation of a single macroblock
* @param s context
* @param dest_y luma destination pointer
* @param dest_cb chroma cb/u destination pointer
@@ -3798,7 +3798,13 @@ static always_inline void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM bloc
}
/* skip dequant / idct if we are really late ;) */
- if(s->hurry_up>1) return;
+ if(s->hurry_up>1) goto skip_idct;
+ if(s->avctx->skip_idct){
+ if( (s->avctx->skip_idct >= AVDISCARD_NONREF && s->pict_type == B_TYPE)
+ ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && s->pict_type != I_TYPE)
+ || s->avctx->skip_idct >= AVDISCARD_ALL)
+ goto skip_idct;
+ }
/* add dct residue */
if(s->encoding || !( s->h263_msmpeg4 || s->codec_id==CODEC_ID_MPEG1VIDEO || s->codec_id==CODEC_ID_MPEG2VIDEO
@@ -3884,6 +3890,7 @@ static always_inline void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM bloc
}//gray
}
}
+skip_idct:
if(!readable){
s->dsp.put_pixels_tab[0][0](s->dest[0], dest_y , linesize,16);
s->dsp.put_pixels_tab[s->chroma_x_shift][0](s->dest[1], dest_cb, uvlinesize,16 >> s->chroma_y_shift);
@@ -4025,7 +4032,7 @@ void ff_draw_horiz_band(MpegEncContext *s, int y, int h){
}
void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename
- const int linesize= s->current_picture.linesize[0]; //not s->linesize as this woulnd be wrong for field pics
+ const int linesize= s->current_picture.linesize[0]; //not s->linesize as this would be wrong for field pics
const int uvlinesize= s->current_picture.linesize[1];
const int mb_size= 4 - s->avctx->lowres;
diff --git a/src/libffmpeg/libavcodec/mpegvideo.h b/src/libffmpeg/libavcodec/mpegvideo.h
index f5db85952..0605463d2 100644
--- a/src/libffmpeg/libavcodec/mpegvideo.h
+++ b/src/libffmpeg/libavcodec/mpegvideo.h
@@ -181,7 +181,7 @@ typedef struct Picture{
uint16_t *mb_var; ///< Table for MB variances
uint16_t *mc_mb_var; ///< Table for motion compensated MB variances
uint8_t *mb_mean; ///< Table for MB luminance
- int32_t *mb_cmp_score; ///< Table for MB cmp scores, for mb decission FIXME remove
+ int32_t *mb_cmp_score; ///< Table for MB cmp scores, for mb decision FIXME remove
int b_frame_score; /* */
} Picture;
@@ -292,10 +292,10 @@ typedef struct MpegEncContext {
int b_frames_since_non_b; ///< used for encoding, relative to not yet reordered input
int64_t user_specified_pts;///< last non zero pts from AVFrame which was passed into avcodec_encode_video()
int mb_width, mb_height; ///< number of MBs horizontally & vertically
- int mb_stride; ///< mb_width+1 used for some arrays to allow simple addressng of left & top MBs withoutt sig11
- int b8_stride; ///< 2*mb_width+1 used for some 8x8 block arrays to allow simple addressng
- int b4_stride; ///< 4*mb_width+1 used for some 4x4 block arrays to allow simple addressng
- int h_edge_pos, v_edge_pos;///< horizontal / vertical position of the right/bottom edge (pixel replicateion)
+ int mb_stride; ///< mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11
+ int b8_stride; ///< 2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
+ int b4_stride; ///< 4*mb_width+1 used for some 4x4 block arrays to allow simple addressing
+ int h_edge_pos, v_edge_pos;///< horizontal / vertical position of the right/bottom edge (pixel replication)
int mb_num; ///< number of MBs of a picture
int linesize; ///< line size, in bytes, may be different from width
int uvlinesize; ///< line size, for chroma in bytes, may be different from width
@@ -340,8 +340,8 @@ typedef struct MpegEncContext {
int16_t *dc_val[3]; ///< used for mpeg4 DC prediction, all 3 arrays must be continuous
int16_t dc_cache[4*5];
int y_dc_scale, c_dc_scale;
- uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table
- uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table
+ const uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table
+ const uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table
const uint8_t *chroma_qscale_table; ///< qscale -> chroma_qscale (h263)
uint8_t *coded_block_base;
uint8_t *coded_block; ///< used for coded block pattern prediction (msmpeg4v3, wmv1)
@@ -358,7 +358,7 @@ typedef struct MpegEncContext {
uint8_t *pred_dir_table; ///< used to store pred_dir for partitioned decoding
uint8_t *allocated_edge_emu_buffer;
uint8_t *edge_emu_buffer; ///< points into the middle of allocated_edge_emu_buffer
- uint8_t *rd_scratchpad; ///< scartchpad for rate distortion mb decission
+ uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision
uint8_t *obmc_scratchpad;
uint8_t *b_scratchpad; ///< scratchpad used for writing into write only buffers
@@ -380,7 +380,7 @@ typedef struct MpegEncContext {
int h263_long_vectors; ///< use horrible h263v1 long vector mode
int decode; ///< if 0 then decoding will be skipped (for encoding b frames for example)
- DSPContext dsp; ///< pointers for accelerated dsp fucntions
+ DSPContext dsp; ///< pointers for accelerated dsp functions
int f_code; ///< forward MV resolution
int b_code; ///< backward MV resolution for B Frames (mpeg4)
int16_t (*p_mv_table_base)[2];
@@ -819,7 +819,7 @@ extern __inline__ int ff_get_mb_score(MpegEncContext * s, int mx, int my, int sr
/* mpeg12.c */
extern const int16_t ff_mpeg1_default_intra_matrix[64];
extern const int16_t ff_mpeg1_default_non_intra_matrix[64];
-extern uint8_t ff_mpeg1_dc_scale_table[128];
+extern const uint8_t ff_mpeg1_dc_scale_table[128];
void mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
void mpeg1_encode_mb(MpegEncContext *s,
@@ -859,9 +859,9 @@ static inline int get_rl_index(const RLTable *rl, int last, int run, int level)
return index + level - 1;
}
-extern uint8_t ff_mpeg4_y_dc_scale_table[32];
-extern uint8_t ff_mpeg4_c_dc_scale_table[32];
-extern uint8_t ff_aic_dc_scale_table[32];
+extern const uint8_t ff_mpeg4_y_dc_scale_table[32];
+extern const uint8_t ff_mpeg4_c_dc_scale_table[32];
+extern const uint8_t ff_aic_dc_scale_table[32];
extern const int16_t ff_mpeg4_default_intra_matrix[64];
extern const int16_t ff_mpeg4_default_non_intra_matrix[64];
extern const uint8_t ff_h263_chroma_qscale_table[32];
diff --git a/src/libffmpeg/libavcodec/msmpeg4data.h b/src/libffmpeg/libavcodec/msmpeg4data.h
index bc4b454ac..3b6940695 100644
--- a/src/libffmpeg/libavcodec/msmpeg4data.h
+++ b/src/libffmpeg/libavcodec/msmpeg4data.h
@@ -1799,20 +1799,20 @@ static const uint8_t v2_intra_cbpc[4][2] = {
{1, 1}, {0, 3}, {1, 3}, {1, 2},
};
-static uint8_t wmv1_y_dc_scale_table[32]={
+static const uint8_t wmv1_y_dc_scale_table[32]={
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
0, 8, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21
};
-static uint8_t wmv1_c_dc_scale_table[32]={
+static const uint8_t wmv1_c_dc_scale_table[32]={
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22
};
-static uint8_t old_ff_y_dc_scale_table[32]={
+static const uint8_t old_ff_y_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
};
-static uint8_t old_ff_c_dc_scale_table[32]={
+static const uint8_t old_ff_c_dc_scale_table[32]={
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22
};
diff --git a/src/libffmpeg/libavcodec/parser.c b/src/libffmpeg/libavcodec/parser.c
index 93bbf87d1..280bb45f5 100644
--- a/src/libffmpeg/libavcodec/parser.c
+++ b/src/libffmpeg/libavcodec/parser.c
@@ -142,6 +142,42 @@ int av_parser_parse(AVCodecParserContext *s,
return index;
}
+/**
+ *
+ * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
+ */
+int av_parser_change(AVCodecParserContext *s,
+ AVCodecContext *avctx,
+ uint8_t **poutbuf, int *poutbuf_size,
+ const uint8_t *buf, int buf_size, int keyframe){
+
+ if(s && s->parser->split){
+ if((avctx->flags & CODEC_FLAG_GLOBAL_HEADER) || (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER)){
+ int i= s->parser->split(avctx, buf, buf_size);
+ buf += i;
+ buf_size -= i;
+ }
+ }
+
+ *poutbuf= buf;
+ *poutbuf_size= buf_size;
+ if(avctx->extradata){
+ if( (keyframe && (avctx->flags2 & CODEC_FLAG2_LOCAL_HEADER))
+ /*||(s->pict_type != I_TYPE && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_NOKEY))*/
+ /*||(? && (s->flags & PARSER_FLAG_DUMP_EXTRADATA_AT_BEGIN)*/){
+ int size= buf_size + avctx->extradata_size;
+ *poutbuf_size= size;
+ *poutbuf= av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
+
+ memcpy(*poutbuf, avctx->extradata, avctx->extradata_size);
+ memcpy((*poutbuf) + avctx->extradata_size, buf, buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
void av_parser_close(AVCodecParserContext *s)
{
if (s->parser->parser_close)
@@ -294,7 +330,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
int frame_rate_ext_n, frame_rate_ext_d;
int picture_structure, top_field_first, repeat_first_field, progressive_frame;
int horiz_size_ext, vert_size_ext, bit_rate_ext;
-
+//FIXME replace the crap with get_bits()
s->repeat_pict = 0;
buf_end = buf + buf_size;
while (buf < buf_end) {
@@ -415,6 +451,20 @@ static int mpegvideo_parse(AVCodecParserContext *s,
return next;
}
+static int mpegvideo_split(AVCodecContext *avctx,
+ const uint8_t *buf, int buf_size)
+{
+ int i;
+ uint32_t state= -1;
+
+ for(i=0; i<buf_size; i++){
+ state= (state<<8) | buf[i];
+ if(state != 0x1B3 && state != 0x1B5 && state < 0x200 && state >= 0x100)
+ return i-3;
+ }
+ return 0;
+}
+
void ff_parse_close(AVCodecParserContext *s)
{
ParseContext *pc = s->priv_data;
@@ -493,6 +543,20 @@ static int mpeg4video_parse(AVCodecParserContext *s,
return next;
}
+static int mpeg4video_split(AVCodecContext *avctx,
+ const uint8_t *buf, int buf_size)
+{
+ int i;
+ uint32_t state= -1;
+
+ for(i=0; i<buf_size; i++){
+ state= (state<<8) | buf[i];
+ if(state == 0x1B3 || state == 0x1B6)
+ return i-3;
+ }
+ return 0;
+}
+
/*************************/
typedef struct MpegAudioParseContext {
@@ -768,6 +832,7 @@ AVCodecParser mpegvideo_parser = {
NULL,
mpegvideo_parse,
parse1_close,
+ mpegvideo_split,
};
AVCodecParser mpeg4video_parser = {
@@ -776,6 +841,7 @@ AVCodecParser mpeg4video_parser = {
mpeg4video_parse_init,
mpeg4video_parse,
parse1_close,
+ mpeg4video_split,
};
AVCodecParser mpegaudio_parser = {
diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c b/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c
index 80dea036d..776f4235c 100644
--- a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c
+++ b/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c
@@ -305,6 +305,8 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
}
#endif //CONFIG_ENCODERS
+ if (avctx->lowres==0)
+ {
if ((avctx->idct_algo == FF_IDCT_AUTO) ||
(avctx->idct_algo == FF_IDCT_ALTIVEC))
{
@@ -316,6 +318,7 @@ void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
c->idct_permutation_type = FF_NO_IDCT_PERM;
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
+ }
#ifdef POWERPC_PERFORMANCE_REPORT
{
diff --git a/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c b/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c
index c8269eb9a..832baced0 100644
--- a/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c
+++ b/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c
@@ -39,6 +39,8 @@ void MPV_common_init_ppc(MpegEncContext *s)
#ifdef HAVE_ALTIVEC
if (has_altivec())
{
+ if (s->avctx->lowres==0)
+ {
if ((s->avctx->idct_algo == FF_IDCT_AUTO) ||
(s->avctx->idct_algo == FF_IDCT_ALTIVEC))
{
@@ -50,6 +52,7 @@ void MPV_common_init_ppc(MpegEncContext *s)
s->dsp.idct_permutation_type = FF_NO_IDCT_PERM;
#endif /* ALTIVEC_USE_REFERENCE_C_CODE */
}
+ }
// Test to make sure that the dct required alignments are met.
if ((((long)(s->q_intra_matrix) & 0x0f) != 0) ||
diff --git a/src/libffmpeg/libavcodec/sp5x.h b/src/libffmpeg/libavcodec/sp5x.h
index 469d1b46d..dee3591bc 100644
--- a/src/libffmpeg/libavcodec/sp5x.h
+++ b/src/libffmpeg/libavcodec/sp5x.h
@@ -20,7 +20,7 @@
#ifndef SP5X_H
#define SP5X_H
-static uint8_t sp5x_data_sof[] =
+static const uint8_t sp5x_data_sof[] =
{
0xFF, 0xC0, /* SOF */
0x00, 0x11, /* len */
@@ -33,7 +33,7 @@ static uint8_t sp5x_data_sof[] =
0x03, 0x11, 0x01
};
-static uint8_t sp5x_data_sos[] =
+static const uint8_t sp5x_data_sos[] =
{
0xFF, 0xDA, /* SOS */
0x00, 0x0C, /* len */
@@ -46,7 +46,7 @@ static uint8_t sp5x_data_sos[] =
0x00 /* Ah/Al */
};
-static uint8_t sp5x_data_dqt[] =
+static const uint8_t sp5x_data_dqt[] =
{
0xFF, 0xDB, /* DQT */
0x00, 0x84, /* len */
@@ -70,7 +70,7 @@ static uint8_t sp5x_data_dqt[] =
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22
};
-static uint8_t sp5x_data_dht[] = {
+static const uint8_t sp5x_data_dht[] = {
0xFF, 0xC4, /* DHT */
0x01, 0xA2, /* len */
0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01,
@@ -128,7 +128,7 @@ static uint8_t sp5x_data_dht[] = {
};
-static uint8_t sp5x_quant_table[20][64]=
+static const uint8_t sp5x_quant_table[20][64]=
{
/* index 0, Q50 */
{ 16, 11, 12, 14, 12, 10, 16, 14, 13, 14, 18, 17, 16, 19, 24, 40,
@@ -233,7 +233,7 @@ static uint8_t sp5x_quant_table[20][64]=
#if 0
/* 4NF-M, not ZigZag */
-static uint8_t sp5x_quant_table_orig[18][64] =
+static const uint8_t sp5x_quant_table_orig[18][64] =
{
/* index 0, Q50 */
{ 16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55,
diff --git a/src/libffmpeg/libavcodec/svq1.c b/src/libffmpeg/libavcodec/svq1.c
index 068dd51d3..e59f1c731 100644
--- a/src/libffmpeg/libavcodec/svq1.c
+++ b/src/libffmpeg/libavcodec/svq1.c
@@ -748,6 +748,10 @@ static int svq1_decode_frame(AVCodecContext *avctx,
if(s->pict_type==B_TYPE && s->last_picture_ptr==NULL) return buf_size;
if(avctx->hurry_up && s->pict_type==B_TYPE) return buf_size;
+ if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
+ ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
+ || avctx->skip_frame >= AVDISCARD_ALL)
+ return buf_size;
if(MPV_frame_start(s, avctx) < 0)
return -1;
diff --git a/src/libffmpeg/libavcodec/svq3.c b/src/libffmpeg/libavcodec/svq3.c
index 547679bf1..f0f995acf 100644
--- a/src/libffmpeg/libavcodec/svq3.c
+++ b/src/libffmpeg/libavcodec/svq3.c
@@ -896,6 +896,10 @@ static int svq3_decode_frame (AVCodecContext *avctx,
if (avctx->hurry_up && s->pict_type == B_TYPE) return 0;
/* skip everything if we are in a hurry >= 5 */
if (avctx->hurry_up >= 5) return 0;
+ if( (avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type==B_TYPE)
+ ||(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type!=I_TYPE)
+ || avctx->skip_frame >= AVDISCARD_ALL)
+ return 0;
if (s->next_p_frame_damaged) {
if (s->pict_type == B_TYPE)
diff --git a/src/libffmpeg/libavcodec/truemotion1.c b/src/libffmpeg/libavcodec/truemotion1.c
index 0c3bb09cf..b382e2cfa 100644
--- a/src/libffmpeg/libavcodec/truemotion1.c
+++ b/src/libffmpeg/libavcodec/truemotion1.c
@@ -248,7 +248,7 @@ static int make_cdt24_entry(int p1, int p2, int16_t *cdt)
return ((b+r) << 1);
}
-static void gen_vector_table15(TrueMotion1Context *s, uint8_t *sel_vector_table)
+static void gen_vector_table15(TrueMotion1Context *s, const uint8_t *sel_vector_table)
{
int len, i, j;
unsigned char delta_pair;
@@ -269,7 +269,7 @@ static void gen_vector_table15(TrueMotion1Context *s, uint8_t *sel_vector_table)
}
}
-static void gen_vector_table16(TrueMotion1Context *s, uint8_t *sel_vector_table)
+static void gen_vector_table16(TrueMotion1Context *s, const uint8_t *sel_vector_table)
{
int len, i, j;
unsigned char delta_pair;
@@ -290,7 +290,7 @@ static void gen_vector_table16(TrueMotion1Context *s, uint8_t *sel_vector_table)
}
}
-static void gen_vector_table24(TrueMotion1Context *s, uint8_t *sel_vector_table)
+static void gen_vector_table24(TrueMotion1Context *s, const uint8_t *sel_vector_table)
{
int len, i, j;
unsigned char delta_pair;
@@ -324,7 +324,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
int i;
struct frame_header header;
uint8_t header_buffer[128]; /* logical maximum size of the header */
- uint8_t *sel_vector_table;
+ const uint8_t *sel_vector_table;
/* There is 1 change bit per 4 pixels, so each change byte represents
* 32 pixels; divide width by 4 to obtain the number of change bits and
diff --git a/src/libffmpeg/libavcodec/truemotion1data.h b/src/libffmpeg/libavcodec/truemotion1data.h
index d56e015a4..59b863713 100644
--- a/src/libffmpeg/libavcodec/truemotion1data.h
+++ b/src/libffmpeg/libavcodec/truemotion1data.h
@@ -10,29 +10,29 @@
#define TRUEMOTION1DATA_H
/* Y delta tables, skinny and fat */
-static int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 };
-static int16_t ydt2[8] = { 0, -2, 2, -6, 6, -12, 12, -12 };
-static int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 };
-static int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 };
-static int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 };
-static int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 };
+static const int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 };
+static const int16_t ydt2[8] = { 0, -2, 2, -6, 6, -12, 12, -12 };
+static const int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 };
+static const int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 };
+static const int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 };
+static const int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 };
/* C delta tables, skinny and fat */
-static int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 };
-static int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 };
-static int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 };
-static int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 };
+static const int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 };
+static const int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 };
+static const int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 };
+static const int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 };
/* NOTE: This table breaks the [+,-] pattern that the rest of the
* tables maintain. Is this intentional? */
-static int16_t fat_cdt3[8] = { 0, 40, 80, -76, 160, -154, 236, -236 };
+static const int16_t fat_cdt3[8] = { 0, 40, 80, -76, 160, -154, 236, -236 };
/* all the delta tables to choose from, at all 4 delta levels */
-static int16_t *ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL };
-static int16_t *fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL };
-static int16_t *cdts[] = { cdt1, cdt2, cdt3, cdt3, NULL };
-static int16_t *fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL };
+static const int16_t *ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL };
+static const int16_t *fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL };
+static const int16_t *cdts[] = { cdt1, cdt2, cdt3, cdt3, NULL };
+static const int16_t *fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_cdt3, NULL };
-static uint8_t pc_tbl2[] = {
+static const uint8_t pc_tbl2[] = {
0x8,0x00,0x00,0x00,0x00,
0x8,0x00,0x00,0x00,0x00,
0x8,0x10,0x00,0x00,0x00,
@@ -291,7 +291,7 @@ static uint8_t pc_tbl2[] = {
0x2,0x66
};
-static uint8_t pc_tbl3[] = {
+static const uint8_t pc_tbl3[] = {
0x6,0x00,0x00,0x00,
0x6,0x00,0x00,0x00,
0x6,0x00,0x00,0x01,
@@ -550,7 +550,7 @@ static uint8_t pc_tbl3[] = {
0x2,0x77
};
-static uint8_t pc_tbl4[] = {
+static const uint8_t pc_tbl4[] = {
0x8,0x00,0x00,0x00,0x00,
0x8,0x00,0x00,0x00,0x00,
0x8,0x20,0x00,0x00,0x00,
@@ -809,5 +809,5 @@ static uint8_t pc_tbl4[] = {
0x2,0x77
};
-static uint8_t *tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 };
+static const uint8_t *tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 };
#endif
diff --git a/src/libffmpeg/libavcodec/ulti.c b/src/libffmpeg/libavcodec/ulti.c
index d4a0c847a..1b5853047 100755
--- a/src/libffmpeg/libavcodec/ulti.c
+++ b/src/libffmpeg/libavcodec/ulti.c
@@ -1,5 +1,5 @@
/*
- *
+ * IBM Ultimotion Video Decoder
* Copyright (C) 2004 Konstantin Shishkov
*
* This library is free software; you can redistribute it and/or
@@ -16,8 +16,6 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * IBM Ultimotion Video Decoder
- *
*/
/**
diff --git a/src/libffmpeg/libavcodec/ulti_cb.h b/src/libffmpeg/libavcodec/ulti_cb.h
index d059439dc..835910f6d 100755
--- a/src/libffmpeg/libavcodec/ulti_cb.h
+++ b/src/libffmpeg/libavcodec/ulti_cb.h
@@ -1,4 +1,4 @@
-static unsigned char ulti_codebook[16384]={
+static const unsigned char ulti_codebook[16384]={
0x00, 0x01, 0x01, 0x02,
0x00, 0x01, 0x02, 0x03,
0x00, 0x02, 0x03, 0x04,
diff --git a/src/libffmpeg/libavcodec/utils.c b/src/libffmpeg/libavcodec/utils.c
index d1debfe40..0a0971fc3 100644
--- a/src/libffmpeg/libavcodec/utils.c
+++ b/src/libffmpeg/libavcodec/utils.c
@@ -583,13 +583,22 @@ int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || pict){
int ret = avctx->codec->encode(avctx, buf, buf_size, (void *)pict);
avctx->frame_number++;
- emms_c(); //needed to avoid a emms_c() call before every return;
+ emms_c(); //needed to avoid an emms_c() call before every return;
return ret;
}else
return 0;
}
+int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+ const AVSubtitle *sub)
+{
+ int ret;
+ ret = avctx->codec->encode(avctx, buf, buf_size, (void *)sub);
+ avctx->frame_number++;
+ return ret;
+}
+
/**
* decode a frame.
* @param buf bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE larger then the actual read bytes
@@ -612,7 +621,7 @@ int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
buf, buf_size);
- emms_c(); //needed to avoid a emms_c() call before every return;
+ emms_c(); //needed to avoid an emms_c() call before every return;
if (*got_picture_ptr)
avctx->frame_number++;
@@ -633,9 +642,29 @@ int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
int ret;
*frame_size_ptr= 0;
- ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
- buf, buf_size);
- avctx->frame_number++;
+ if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
+ ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
+ buf, buf_size);
+ avctx->frame_number++;
+ }else
+ ret= 0;
+ return ret;
+}
+
+/* decode a subtitle message. return -1 if error, otherwise return the
+ *number of bytes used. If no subtitle could be decompressed,
+ *got_sub_ptr is zero. Otherwise, the subtitle is stored in *sub. */
+int avcodec_decode_subtitle(AVCodecContext *avctx, AVSubtitle *sub,
+ int *got_sub_ptr,
+ const uint8_t *buf, int buf_size)
+{
+ int ret;
+
+ *got_sub_ptr = 0;
+ ret = avctx->codec->decode(avctx, sub, got_sub_ptr,
+ (uint8_t *)buf, buf_size);
+ if (*got_sub_ptr)
+ avctx->frame_number++;
return ret;
}
@@ -808,6 +837,10 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf, buf_size, "Data: %s", codec_name);
bitrate = enc->bit_rate;
break;
+ case CODEC_TYPE_SUBTITLE:
+ snprintf(buf, buf_size, "Subtitle: %s", codec_name);
+ bitrate = enc->bit_rate;
+ break;
default:
snprintf(buf, buf_size, "Invalid Codec type %d", enc->codec_type);
return;
diff --git a/src/libffmpeg/libavcodec/vorbis.c b/src/libffmpeg/libavcodec/vorbis.c
new file mode 100644
index 000000000..3cc81520a
--- /dev/null
+++ b/src/libffmpeg/libavcodec/vorbis.c
@@ -0,0 +1,1471 @@
+/**
+ * @file vorbis.c
+ * Vorbis I decoder
+ * @author Denes Balatoni ( dbalatoni programozo hu )
+
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#undef V_DEBUG
+
+#include <math.h>
+
+#define ALT_BITSTREAM_READER_LE
+#include "avcodec.h"
+#include "bitstream.h"
+#include "dsputil.h"
+
+#include "vorbis.h"
+
+#define V_NB_BITS 8
+#define V_NB_BITS2 11
+#define V_MAX_VLCS (1<<16)
+
+#ifndef V_DEBUG
+#define AV_DEBUG(...)
+#endif
+
+#undef NDEBUG
+#include <assert.h>
+
+/* Helper functions */
+
+/**
+ * reads 0-32 bits when using the ALT_BITSTREAM_READER_LE bitstream reader
+ */
+unsigned int get_bits_long_le(GetBitContext *s, int n){
+ if(n<=17) return get_bits(s, n);
+ else{
+ int ret= get_bits(s, 16);
+ return ret | (get_bits(s, n-16) << 16);
+ }
+}
+
+#define ilog(i) av_log2(2*(i))
+
+static unsigned int nth_root(unsigned int x, unsigned int n) { // x^(1/n)
+ unsigned int ret=0, i, j;
+
+ do {
+ ++ret;
+ for(i=0,j=ret;i<n-1;i++) j*=ret;
+ } while (j<=x);
+
+ return (ret-1);
+}
+
+static float vorbisfloat2float(uint_fast32_t val) {
+ double mant=val&0x1fffff;
+ long exp=(val&0x7fe00000L)>>21;
+ if (val&0x80000000) mant=-mant;
+ return(ldexp(mant, exp-20-768));
+}
+
+
+// Generate vlc codes from vorbis huffman code lengths
+
+static int vorbis_len2vlc(vorbis_context *vc, uint_fast8_t *bits, uint_fast32_t *codes, uint_fast32_t num) {
+ uint_fast32_t exit_at_level[33]={404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+
+ uint_fast8_t i,j;
+ uint_fast32_t code,p;
+
+#ifdef V_DEBUG
+ GetBitContext gb;
+#endif
+
+ for(p=0;(bits[p]==0) && (p<num);++p);
+ if (p==num) {
+// av_log(vc->avccontext, AV_LOG_INFO, "An empty codebook. Heh?! \n");
+ return 0;
+ }
+
+ codes[p]=0;
+ for(i=0;i<bits[p];++i) {
+ exit_at_level[i+1]=1<<i;
+ }
+
+#ifdef V_DEBUG
+ av_log(vc->avccontext, AV_LOG_INFO, " %d. of %d code len %d code %d - ", p, num, bits[p], codes[p]);
+ init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
+ for(i=0;i<bits[p];++i) {
+ av_log(vc->avccontext, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
+ }
+ av_log(vc->avccontext, AV_LOG_INFO, "\n");
+#endif
+
+ ++p;
+
+ for(;p<num;++p) {
+ if (bits[p]==0) continue;
+ // find corresponding exit(node which the tree can grow further from)
+ for(i=bits[p];i>0;--i) {
+ if (exit_at_level[i]) break;
+ }
+ if (!i) return 1; // overspecified tree
+ code=exit_at_level[i];
+ exit_at_level[i]=0;
+ // construct code (append 0s to end) and introduce new exits
+ for(j=i+1;j<=bits[p];++j) {
+ exit_at_level[j]=code+(1<<(j-1));
+ }
+ codes[p]=code;
+
+#ifdef V_DEBUG
+ av_log(vc->avccontext, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
+ init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
+ for(i=0;i<bits[p];++i) {
+ av_log(vc->avccontext, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
+ }
+ av_log(vc->avccontext, AV_LOG_INFO, "\n");
+#endif
+
+ }
+
+ //FIXME no exits should be left (underspecified tree - ie. unused valid vlcs - not allowed by SPEC)
+
+ return 0;
+}
+
+// Free all allocated memory -----------------------------------------
+
+static void vorbis_free(vorbis_context *vc) {
+ int_fast16_t i;
+
+ av_freep(&vc->channel_residues);
+ av_freep(&vc->channel_floors);
+ av_freep(&vc->saved);
+ av_freep(&vc->ret);
+ av_freep(&vc->buf);
+ av_freep(&vc->buf_tmp);
+
+ av_freep(&vc->residues);
+ av_freep(&vc->modes);
+
+ ff_mdct_end(&vc->mdct0);
+ ff_mdct_end(&vc->mdct1);
+
+ for(i=0;i<vc->codebook_count;++i) {
+ av_free(vc->codebooks[i].codevectors);
+ free_vlc(&vc->codebooks[i].vlc);
+ }
+ av_freep(&vc->codebooks);
+
+ for(i=0;i<vc->floor_count;++i) {
+ av_free(vc->floors[i].x_list);
+ av_free(vc->floors[i].x_list_order);
+ av_free(vc->floors[i].low_neighbour);
+ av_free(vc->floors[i].high_neighbour);
+ }
+ av_freep(&vc->floors);
+
+ for(i=0;i<vc->mapping_count;++i) {
+ av_free(vc->mappings[i].magnitude);
+ av_free(vc->mappings[i].angle);
+ av_free(vc->mappings[i].mux);
+ }
+ av_freep(&vc->mappings);
+}
+
+// Parse setup header -------------------------------------------------
+
+// Process codebooks part
+
+static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc) {
+ uint_fast16_t cb;
+ uint_fast8_t *tmp_vlc_bits;
+ uint_fast32_t *tmp_vlc_codes;
+ GetBitContext *gb=&vc->gb;
+
+ vc->codebook_count=get_bits(gb,8)+1;
+
+ AV_DEBUG(" Codebooks: %d \n", vc->codebook_count);
+
+ vc->codebooks=(vorbis_codebook *)av_mallocz(vc->codebook_count * sizeof(vorbis_codebook));
+ tmp_vlc_bits=(uint_fast8_t *)av_mallocz(V_MAX_VLCS * sizeof(uint_fast8_t));
+ tmp_vlc_codes=(uint_fast32_t *)av_mallocz(V_MAX_VLCS * sizeof(uint_fast32_t));
+
+ for(cb=0;cb<vc->codebook_count;++cb) {
+ vorbis_codebook *codebook_setup=&vc->codebooks[cb];
+ uint_fast8_t ordered;
+ uint_fast32_t t, used_entries=0;
+ uint_fast32_t entries;
+
+ AV_DEBUG(" %d. Codebook \n", cb);
+
+ if (get_bits(gb, 24)!=0x564342) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " %d. Codebook setup data corrupt. \n", cb);
+ goto error;
+ }
+
+ codebook_setup->dimensions=get_bits(gb, 16);
+ if (codebook_setup->dimensions>16) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " %d. Codebook's dimension is too large (%d). \n", cb, codebook_setup->dimensions);
+ goto error;
+ }
+ entries=get_bits(gb, 24);
+ if (entries>V_MAX_VLCS) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " %d. Codebook has too many entries (%d). \n", cb, entries);
+ goto error;
+ }
+
+ ordered=get_bits1(gb);
+
+ AV_DEBUG(" codebook_dimensions %d, codebook_entries %d \n", codebook_setup->dimensions, entries);
+
+ if (!ordered) {
+ uint_fast16_t ce;
+ uint_fast8_t flag;
+ uint_fast8_t sparse=get_bits1(gb);
+
+ AV_DEBUG(" not ordered \n");
+
+ if (sparse) {
+ AV_DEBUG(" sparse \n");
+
+ used_entries=0;
+ for(ce=0;ce<entries;++ce) {
+ flag=get_bits1(gb);
+ if (flag) {
+ tmp_vlc_bits[ce]=get_bits(gb, 5)+1;
+ ++used_entries;
+ }
+ else tmp_vlc_bits[ce]=0;
+ }
+ } else {
+ AV_DEBUG(" not sparse \n");
+
+ used_entries=entries;
+ for(ce=0;ce<entries;++ce) {
+ tmp_vlc_bits[ce]=get_bits(gb, 5)+1;
+ }
+ }
+ } else {
+ uint_fast16_t current_entry=0;
+ uint_fast8_t current_length=get_bits(gb, 5)+1;
+
+ AV_DEBUG(" ordered, current length: %d \n", current_length); //FIXME
+
+ used_entries=entries;
+ for(;current_entry<used_entries;++current_length) {
+ uint_fast16_t i, number;
+
+ AV_DEBUG(" number bits: %d ", ilog(entries - current_entry));
+
+ number=get_bits(gb, ilog(entries - current_entry));
+
+ AV_DEBUG(" number: %d \n", number);
+
+ for(i=current_entry;i<number+current_entry;++i) {
+ if (i<used_entries) tmp_vlc_bits[i]=current_length;
+ }
+
+ current_entry+=number;
+ }
+ if (current_entry>used_entries) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " More codelengths than codes in codebook. \n");
+ goto error;
+ }
+ }
+
+ codebook_setup->lookup_type=get_bits(gb, 4);
+
+ AV_DEBUG(" lookup type: %d : %s \n", codebook_setup->lookup_type, codebook_setup->lookup_type ? "vq" : "no lookup" );
+
+// If the codebook is used for (inverse) VQ, calculate codevectors.
+
+ if (codebook_setup->lookup_type==1) {
+ uint_fast16_t i, j, k;
+ uint_fast16_t codebook_lookup_values=nth_root(entries, codebook_setup->dimensions);
+ uint_fast16_t codebook_multiplicands[codebook_lookup_values];
+
+ float codebook_minimum_value=vorbisfloat2float(get_bits_long_le(gb, 32));
+ float codebook_delta_value=vorbisfloat2float(get_bits_long_le(gb, 32));
+ uint_fast8_t codebook_value_bits=get_bits(gb, 4)+1;
+ uint_fast8_t codebook_sequence_p=get_bits1(gb);
+
+ AV_DEBUG(" We expect %d numbers for building the codevectors. \n", codebook_lookup_values);
+ AV_DEBUG(" delta %f minmum %f \n", codebook_delta_value, codebook_minimum_value);
+
+ for(i=0;i<codebook_lookup_values;++i) {
+ codebook_multiplicands[i]=get_bits(gb, codebook_value_bits);
+
+ AV_DEBUG(" multiplicands*delta+minmum : %e \n", (float)codebook_multiplicands[i]*codebook_delta_value+codebook_minimum_value);
+ AV_DEBUG(" multiplicand %d \n", codebook_multiplicands[i]);
+ }
+
+// Weed out unused vlcs and build codevector vector
+ codebook_setup->codevectors=(float *)av_mallocz(used_entries*codebook_setup->dimensions * sizeof(float));
+ for(j=0, i=0;i<entries;++i) {
+ uint_fast8_t dim=codebook_setup->dimensions;
+
+ if (tmp_vlc_bits[i]) {
+ float last=0.0;
+ uint_fast32_t lookup_offset=i;
+
+#ifdef V_DEBUG
+ av_log(vc->avccontext, AV_LOG_INFO, "Lookup offset %d ,", i);
+#endif
+
+ for(k=0;k<dim;++k) {
+ uint_fast32_t multiplicand_offset = lookup_offset % codebook_lookup_values;
+ codebook_setup->codevectors[j*dim+k]=codebook_multiplicands[multiplicand_offset]*codebook_delta_value+codebook_minimum_value+last;
+ if (codebook_sequence_p) {
+ last=codebook_setup->codevectors[j*dim+k];
+ }
+ lookup_offset/=codebook_lookup_values;
+ }
+ tmp_vlc_bits[j]=tmp_vlc_bits[i];
+
+#ifdef V_DEBUG
+ av_log(vc->avccontext, AV_LOG_INFO, "real lookup offset %d, vector: ", j);
+ for(k=0;k<dim;++k) {
+ av_log(vc->avccontext, AV_LOG_INFO, " %f ", codebook_setup->codevectors[j*dim+k]);
+ }
+ av_log(vc->avccontext, AV_LOG_INFO, "\n");
+#endif
+
+ ++j;
+ }
+ }
+ if (j!=used_entries) {
+ av_log(vc->avccontext, AV_LOG_ERROR, "Bug in codevector vector building code. \n");
+ goto error;
+ }
+ entries=used_entries;
+ }
+ else if (codebook_setup->lookup_type>=2) {
+ av_log(vc->avccontext, AV_LOG_ERROR, "Codebook lookup type not supported. \n");
+ goto error;
+ }
+
+// Initialize VLC table
+ if (vorbis_len2vlc(vc, tmp_vlc_bits, tmp_vlc_codes, entries)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Invalid code lengths while generating vlcs. \n");
+ goto error;
+ }
+ codebook_setup->maxdepth=0;
+ for(t=0;t<entries;++t)
+ if (tmp_vlc_bits[t]>=codebook_setup->maxdepth) codebook_setup->maxdepth=tmp_vlc_bits[t];
+
+ if(codebook_setup->maxdepth > 3*V_NB_BITS) codebook_setup->nb_bits=V_NB_BITS2;
+ else codebook_setup->nb_bits=V_NB_BITS;
+
+ codebook_setup->maxdepth=(codebook_setup->maxdepth+codebook_setup->nb_bits-1)/codebook_setup->nb_bits;
+
+ if (init_vlc(&codebook_setup->vlc, codebook_setup->nb_bits, entries, tmp_vlc_bits, sizeof(*tmp_vlc_bits), sizeof(*tmp_vlc_bits), tmp_vlc_codes, sizeof(*tmp_vlc_codes), sizeof(*tmp_vlc_codes), INIT_VLC_LE)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Error generating vlc tables. \n");
+ goto error;
+ }
+ }
+
+ av_free(tmp_vlc_bits);
+ av_free(tmp_vlc_codes);
+ return 0;
+
+// Error:
+error:
+ av_free(tmp_vlc_bits);
+ av_free(tmp_vlc_codes);
+ return 1;
+}
+
+// Process time domain transforms part (unused in Vorbis I)
+
+static int vorbis_parse_setup_hdr_tdtransforms(vorbis_context *vc) {
+ GetBitContext *gb=&vc->gb;
+ uint_fast8_t i;
+ uint_fast8_t vorbis_time_count=get_bits(gb, 6)+1;
+
+ for(i=0;i<vorbis_time_count;++i) {
+ uint_fast16_t vorbis_tdtransform=get_bits(gb, 16);
+
+ AV_DEBUG(" Vorbis time domain transform %d: %d \n", vorbis_time_count, vorbis_tdtransform);
+
+ if (vorbis_tdtransform) {
+ av_log(vc->avccontext, AV_LOG_ERROR, "Vorbis time domain transform data nonzero. \n");
+ return 1;
+ }
+ }
+ return 0;
+}
+
+// Process floors part - only floor type 1 is supported
+
+static int vorbis_parse_setup_hdr_floors(vorbis_context *vc) {
+ GetBitContext *gb=&vc->gb;
+ uint_fast16_t i,j,k;
+
+ vc->floor_count=get_bits(gb, 6)+1;
+
+ vc->floors=(vorbis_floor *)av_mallocz(vc->floor_count * sizeof(vorbis_floor));
+
+ for (i=0;i<vc->floor_count;++i) {
+ vorbis_floor *floor_setup=&vc->floors[i];
+
+ floor_setup->floor_type=get_bits(gb, 16);
+
+ AV_DEBUG(" %d. floor type %d \n", i, floor_setup->floor_type);
+
+ if (floor_setup->floor_type==1) {
+ uint_fast8_t maximum_class=0;
+ uint_fast8_t rangebits;
+ uint_fast16_t floor1_values=2;
+
+ floor_setup->partitions=get_bits(gb, 5);
+
+ AV_DEBUG(" %d.floor: %d partitions \n", i, floor_setup->partitions);
+
+ for(j=0;j<floor_setup->partitions;++j) {
+ floor_setup->partition_class[j]=get_bits(gb, 4);
+ if (floor_setup->partition_class[j]>maximum_class) maximum_class=floor_setup->partition_class[j];
+
+ AV_DEBUG(" %d. floor %d partition class %d \n", i, j, floor_setup->partition_class[j]);
+
+ }
+
+ AV_DEBUG(" maximum class %d \n", maximum_class);
+
+ floor_setup->maximum_class=maximum_class;
+
+ for(j=0;j<=maximum_class;++j) {
+ floor_setup->class_dimensions[j]=get_bits(gb, 3)+1;
+ floor_setup->class_subclasses[j]=get_bits(gb, 2);
+
+ AV_DEBUG(" %d floor %d class dim: %d subclasses %d \n", i, j, floor_setup->class_dimensions[j], floor_setup->class_subclasses[j]);
+
+ if (floor_setup->class_subclasses[j]) {
+ floor_setup->class_masterbook[j]=get_bits(gb, 8);
+
+ AV_DEBUG(" masterbook: %d \n", floor_setup->class_masterbook[j]);
+ }
+
+ for(k=0;k<(1<<floor_setup->class_subclasses[j]);++k) {
+ floor_setup->subclass_books[j][k]=get_bits(gb, 8)-1;
+
+ AV_DEBUG(" book %d. : %d \n", k, floor_setup->subclass_books[j][k]);
+ }
+ }
+
+ floor_setup->multiplier=get_bits(gb, 2)+1;
+ floor_setup->x_list_dim=2;
+
+ for(j=0;j<floor_setup->partitions;++j) {
+ floor_setup->x_list_dim+=floor_setup->class_dimensions[floor_setup->partition_class[j]];
+ }
+
+ floor_setup->x_list=(uint_fast16_t *)av_mallocz(floor_setup->x_list_dim * sizeof(uint_fast16_t));
+ floor_setup->x_list_order=(uint_fast16_t *)av_mallocz(floor_setup->x_list_dim * sizeof(uint_fast16_t));
+ floor_setup->low_neighbour=(uint_fast16_t *)av_mallocz(floor_setup->x_list_dim * sizeof(uint_fast16_t));
+ floor_setup->high_neighbour=(uint_fast16_t *)av_mallocz(floor_setup->x_list_dim * sizeof(uint_fast16_t));
+
+
+ rangebits=get_bits(gb, 4);
+ floor_setup->x_list[0] = 0;
+ floor_setup->x_list[1] = (1<<rangebits);
+
+ for(j=0;j<floor_setup->partitions;++j) {
+ for(k=0;k<floor_setup->class_dimensions[floor_setup->partition_class[j]];++k,++floor1_values) {
+ floor_setup->x_list[floor1_values]=get_bits(gb, rangebits);
+
+ AV_DEBUG(" %d. floor1 Y coord. %d \n", floor1_values, floor_setup->x_list[floor1_values]);
+ }
+ }
+
+// Precalculate order of x coordinates - needed for decode
+
+ for(k=0;k<floor_setup->x_list_dim;++k) {
+ floor_setup->x_list_order[k]=k;
+ }
+
+ for(k=0;k<floor_setup->x_list_dim-1;++k) { // FIXME optimize sorting ?
+ for(j=k+1;j<floor_setup->x_list_dim;++j) {
+ if(floor_setup->x_list[floor_setup->x_list_order[k]]>floor_setup->x_list[floor_setup->x_list_order[j]]) {
+ uint_fast16_t tmp=floor_setup->x_list_order[k];
+ floor_setup->x_list_order[k]=floor_setup->x_list_order[j];
+ floor_setup->x_list_order[j]=tmp;
+ }
+ }
+ }
+
+// Precalculate low and high neighbours
+
+ for(k=2;k<floor_setup->x_list_dim;++k) {
+ floor_setup->low_neighbour[k]=0;
+ floor_setup->high_neighbour[k]=1; // correct according to SPEC requirements
+
+ for (j=0;j<k;++j) {
+ if ((floor_setup->x_list[j]<floor_setup->x_list[k]) &&
+ (floor_setup->x_list[j]>floor_setup->x_list[floor_setup->low_neighbour[k]])) {
+ floor_setup->low_neighbour[k]=j;
+ }
+ if ((floor_setup->x_list[j]>floor_setup->x_list[k]) &&
+ (floor_setup->x_list[j]<floor_setup->x_list[floor_setup->high_neighbour[k]])) {
+ floor_setup->high_neighbour[k]=j;
+ }
+ }
+ }
+ }
+ else {
+ av_log(vc->avccontext, AV_LOG_ERROR, "Only floor type 1 supported. \n");
+ return 1;
+ }
+ }
+ return 0;
+}
+
+// Process residues part
+
+static int vorbis_parse_setup_hdr_residues(vorbis_context *vc){
+ GetBitContext *gb=&vc->gb;
+ uint_fast8_t i, j, k;
+
+ vc->residue_count=get_bits(gb, 6)+1;
+ vc->residues=(vorbis_residue *)av_mallocz(vc->residue_count * sizeof(vorbis_residue));
+
+ AV_DEBUG(" There are %d residues. \n", vc->residue_count);
+
+ for(i=0;i<vc->residue_count;++i) {
+ vorbis_residue *res_setup=&vc->residues[i];
+ uint_fast8_t cascade[64];
+ uint_fast8_t high_bits;
+ uint_fast8_t low_bits;
+
+ res_setup->type=get_bits(gb, 16);
+
+ AV_DEBUG(" %d. residue type %d \n", i, res_setup->type);
+
+ res_setup->begin=get_bits(gb, 24);
+ res_setup->end=get_bits(gb, 24);
+ res_setup->partition_size=get_bits(gb, 24)+1;
+ res_setup->classifications=get_bits(gb, 6)+1;
+ res_setup->classbook=get_bits(gb, 8);
+
+ AV_DEBUG(" begin %d end %d part.size %d classif.s %d classbook %d \n", res_setup->begin, res_setup->end, res_setup->partition_size,
+ res_setup->classifications, res_setup->classbook);
+
+ for(j=0;j<res_setup->classifications;++j) {
+ high_bits=0;
+ low_bits=get_bits(gb, 3);
+ if (get_bits1(gb)) {
+ high_bits=get_bits(gb, 5);
+ }
+ cascade[j]=(high_bits<<3)+low_bits;
+
+ AV_DEBUG(" %d class casscade depth: %d \n", j, ilog(cascade[j]));
+ }
+
+ res_setup->maxpass=0;
+ for(j=0;j<res_setup->classifications;++j) {
+ for(k=0;k<8;++k) {
+ if (cascade[j]&(1<<k)) {
+ res_setup->books[j][k]=get_bits(gb, 8);
+
+ AV_DEBUG(" %d class casscade depth %d book: %d \n", j, k, res_setup->books[j][k]);
+
+ if (k>res_setup->maxpass) {
+ res_setup->maxpass=k;
+ }
+ } else {
+ res_setup->books[j][k]=-1;
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+// Process mappings part
+
+static int vorbis_parse_setup_hdr_mappings(vorbis_context *vc) {
+ GetBitContext *gb=&vc->gb;
+ uint_fast8_t i, j;
+
+ vc->mapping_count=get_bits(gb, 6)+1;
+ vc->mappings=(vorbis_mapping *)av_mallocz(vc->mapping_count * sizeof(vorbis_mapping));
+
+ AV_DEBUG(" There are %d mappings. \n", vc->mapping_count);
+
+ for(i=0;i<vc->mapping_count;++i) {
+ vorbis_mapping *mapping_setup=&vc->mappings[i];
+
+ if (get_bits(gb, 16)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, "Other mappings than type 0 are not compliant with the Vorbis I specification. \n");
+ return 1;
+ }
+ if (get_bits1(gb)) {
+ mapping_setup->submaps=get_bits(gb, 4)+1;
+ } else {
+ mapping_setup->submaps=1;
+ }
+
+ if (get_bits1(gb)) {
+ mapping_setup->coupling_steps=get_bits(gb, 8)+1;
+ mapping_setup->magnitude=(uint_fast8_t *)av_mallocz(mapping_setup->coupling_steps * sizeof(uint_fast8_t));
+ mapping_setup->angle=(uint_fast8_t *)av_mallocz(mapping_setup->coupling_steps * sizeof(uint_fast8_t));
+ for(j=0;j<mapping_setup->coupling_steps;++j) {
+ mapping_setup->magnitude[j]=get_bits(gb, ilog(vc->audio_channels-1));
+ mapping_setup->angle[j]=get_bits(gb, ilog(vc->audio_channels-1));
+ // FIXME: sanity checks
+ }
+ } else {
+ mapping_setup->coupling_steps=0;
+ }
+
+ AV_DEBUG(" %d mapping coupling steps: %d \n", i, mapping_setup->coupling_steps);
+
+ if(get_bits(gb, 2)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, "%d. mapping setup data invalid. \n", i);
+ return 1; // following spec.
+ }
+
+ if (mapping_setup->submaps>1) {
+ mapping_setup->mux=(uint_fast8_t *)av_mallocz(vc->audio_channels * sizeof(uint_fast8_t));
+ for(j=0;j<vc->audio_channels;++j) {
+ mapping_setup->mux[j]=get_bits(gb, 4);
+ }
+ }
+
+ for(j=0;j<mapping_setup->submaps;++j) {
+ get_bits(gb, 8); // FIXME check?
+ mapping_setup->submap_floor[j]=get_bits(gb, 8);
+ mapping_setup->submap_residue[j]=get_bits(gb, 8);
+
+ AV_DEBUG(" %d mapping %d submap : floor %d, residue %d \n", i, j, mapping_setup->submap_floor[j], mapping_setup->submap_residue[j]);
+ }
+ }
+ return 0;
+}
+
+// Process modes part
+
+static int vorbis_parse_setup_hdr_modes(vorbis_context *vc) {
+ GetBitContext *gb=&vc->gb;
+ uint_fast8_t i;
+
+ vc->mode_count=get_bits(gb, 6)+1;
+ vc->modes=(vorbis_mode *)av_mallocz(vc->mode_count * sizeof(vorbis_mode));
+
+ AV_DEBUG(" There are %d modes.\n", vc->mode_count);
+
+ for(i=0;i<vc->mode_count;++i) {
+ vorbis_mode *mode_setup=&vc->modes[i];
+
+ mode_setup->blockflag=get_bits(gb, 1);
+ mode_setup->windowtype=get_bits(gb, 16); //FIXME check
+ mode_setup->transformtype=get_bits(gb, 16); //FIXME check
+ mode_setup->mapping=get_bits(gb, 8); //FIXME check
+
+ AV_DEBUG(" %d mode: blockflag %d, windowtype %d, transformtype %d, mapping %d \n", i, mode_setup->blockflag, mode_setup->windowtype, mode_setup->transformtype, mode_setup->mapping);
+ }
+ return 0;
+}
+
+// Process the whole setup header using the functions above
+
+static int vorbis_parse_setup_hdr(vorbis_context *vc) {
+ GetBitContext *gb=&vc->gb;
+
+ if ((get_bits(gb, 8)!='v') || (get_bits(gb, 8)!='o') ||
+ (get_bits(gb, 8)!='r') || (get_bits(gb, 8)!='b') ||
+ (get_bits(gb, 8)!='i') || (get_bits(gb, 8)!='s')) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (no vorbis signature). \n");
+ return 1;
+ }
+
+ if (vorbis_parse_setup_hdr_codebooks(vc)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (codebooks). \n");
+ return 2;
+ }
+ if (vorbis_parse_setup_hdr_tdtransforms(vc)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (time domain transforms). \n");
+ return 3;
+ }
+ if (vorbis_parse_setup_hdr_floors(vc)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (floors). \n");
+ return 4;
+ }
+ if (vorbis_parse_setup_hdr_residues(vc)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (residues). \n");
+ return 5;
+ }
+ if (vorbis_parse_setup_hdr_mappings(vc)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (mappings). \n");
+ return 6;
+ }
+ if (vorbis_parse_setup_hdr_modes(vc)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (modes). \n");
+ return 7;
+ }
+ if (!get_bits1(gb)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis setup header packet corrupt (framing flag). \n");
+ return 8; // framing flag bit unset error
+ }
+
+ return 0;
+}
+
+// Process the identification header
+
+static int vorbis_parse_id_hdr(vorbis_context *vc){
+ GetBitContext *gb=&vc->gb;
+ uint_fast8_t bl0, bl1;
+ const float *vwin[8]={ vwin64, vwin128, vwin256, vwin512, vwin1024, vwin2048, vwin4096, vwin8192 };
+
+ if ((get_bits(gb, 8)!='v') || (get_bits(gb, 8)!='o') ||
+ (get_bits(gb, 8)!='r') || (get_bits(gb, 8)!='b') ||
+ (get_bits(gb, 8)!='i') || (get_bits(gb, 8)!='s')) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (no vorbis signature). \n");
+ return 1;
+ }
+
+ vc->version=get_bits_long_le(gb, 32); //FIXME check 0
+ vc->audio_channels=get_bits(gb, 8); //FIXME check >0
+ vc->audio_samplerate=get_bits_long_le(gb, 32); //FIXME check >0
+ vc->bitrate_maximum=get_bits_long_le(gb, 32);
+ vc->bitrate_nominal=get_bits_long_le(gb, 32);
+ vc->bitrate_minimum=get_bits_long_le(gb, 32);
+ bl0=get_bits(gb, 4);
+ bl1=get_bits(gb, 4);
+ vc->blocksize_0=(1<<bl0);
+ vc->blocksize_1=(1<<bl1);
+ if (bl0>13 || bl0<6 || bl1>13 || bl1<6) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (illegal blocksize). \n");
+ return 3;
+ }
+ vc->swin=vwin[bl0-6];
+ vc->lwin=vwin[bl1-6];
+
+ if ((get_bits1(gb)) == 0) {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (framing flag not set). \n");
+ return 2;
+ }
+
+ vc->channel_residues=(float *)av_malloc((vc->blocksize_1/2)*vc->audio_channels * sizeof(float));
+ vc->channel_floors=(float *)av_malloc((vc->blocksize_1/2)*vc->audio_channels * sizeof(float));
+ vc->saved=(float *)av_malloc((vc->blocksize_1/2)*vc->audio_channels * sizeof(float));
+ vc->ret=(float *)av_malloc((vc->blocksize_1/2)*vc->audio_channels * sizeof(float));
+ vc->buf=(float *)av_malloc(vc->blocksize_1 * sizeof(float));
+ vc->buf_tmp=(float *)av_malloc(vc->blocksize_1 * sizeof(float));
+ vc->saved_start=0;
+
+ ff_mdct_init(&vc->mdct0, bl0, 1);
+ ff_mdct_init(&vc->mdct1, bl1, 1);
+
+ AV_DEBUG(" vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ",
+ vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize_0, vc->blocksize_1);
+
+/*
+ BLK=vc->blocksize_0;
+ for(i=0;i<BLK/2;++i) {
+ vc->swin[i]=sin(0.5*3.14159265358*(sin(((float)i+0.5)/(float)BLK*3.14159265358))*(sin(((float)i+0.5)/(float)BLK*3.14159265358)));
+ }
+*/
+
+ return 0;
+}
+
+// Process the extradata using the functions above (identification header, setup header)
+
+static int vorbis_decode_init(AVCodecContext *avccontext) {
+ vorbis_context *vc = avccontext->priv_data ;
+ uint8_t *headers = avccontext->extradata;
+ int headers_len=avccontext->extradata_size;
+ uint8_t *header_start[3];
+ int header_len[3];
+ GetBitContext *gb = &(vc->gb);
+ int i, j, hdr_type;
+
+ vc->avccontext = avccontext;
+
+ if (!headers_len) {
+ av_log(avccontext, AV_LOG_ERROR, "Extradata corrupt.\n");
+ return -1;
+ }
+
+ if(headers[0] == 0 && headers[1] == 30) {
+ for(i = 0; i < 3; i++){
+ header_len[i] = *headers++ << 8;
+ header_len[i] += *headers++;
+ header_start[i] = headers;
+ headers += header_len[i];
+ }
+ } else if(headers[0] == 2) {
+ for(j=1,i=0;i<2;++i, ++j) {
+ header_len[i]=0;
+ while(j<headers_len && headers[j]==0xff) {
+ header_len[i]+=0xff;
+ ++j;
+ }
+ if (j>=headers_len) {
+ av_log(avccontext, AV_LOG_ERROR, "Extradata corrupt.\n");
+ return -1;
+ }
+ header_len[i]+=headers[j];
+ }
+ header_len[2]=headers_len-header_len[0]-header_len[1]-j;
+ headers+=j;
+ header_start[0] = headers;
+ header_start[1] = header_start[0] + header_len[0];
+ header_start[2] = header_start[1] + header_len[1];
+ } else {
+ av_log(avccontext, AV_LOG_ERROR, "Extradata corrupt.\n");
+ return -1;
+ }
+
+ init_get_bits(gb, header_start[0], header_len[0]*8);
+ hdr_type=get_bits(gb, 8);
+ if (hdr_type!=1) {
+ av_log(avccontext, AV_LOG_ERROR, "First header is not the id header.\n");
+ return -1;
+ }
+ if (vorbis_parse_id_hdr(vc)) {
+ av_log(avccontext, AV_LOG_ERROR, "Id header corrupt.\n");
+ vorbis_free(vc);
+ return -1;
+ }
+
+ init_get_bits(gb, header_start[2], header_len[2]*8);
+ hdr_type=get_bits(gb, 8);
+ if (hdr_type!=5) {
+ av_log(avccontext, AV_LOG_ERROR, "Third header is not the setup header.\n");
+ return -1;
+ }
+ if (vorbis_parse_setup_hdr(vc)) {
+ av_log(avccontext, AV_LOG_ERROR, "Setup header corrupt.\n");
+ vorbis_free(vc);
+ return -1;
+ }
+
+ avccontext->channels = vc->audio_channels;
+ avccontext->sample_rate = vc->audio_samplerate;
+
+ return 0 ;
+}
+
+// Decode audiopackets -------------------------------------------------
+
+// Read and decode floor (type 1 only)
+
+static uint_fast8_t vorbis_floor1_decode(vorbis_context *vc, vorbis_floor *vf, float *vec) {
+ GetBitContext *gb=&vc->gb;
+ uint_fast16_t range_v[4]={ 256, 128, 86, 64 };
+ uint_fast16_t range=range_v[vf->multiplier-1];
+ uint_fast16_t floor1_Y[vf->x_list_dim];
+ uint_fast16_t floor1_Y_final[vf->x_list_dim];
+ uint_fast8_t floor1_flag[vf->x_list_dim];
+ uint_fast8_t class_;
+ uint_fast8_t cdim;
+ uint_fast8_t cbits;
+ uint_fast8_t csub;
+ uint_fast8_t cval;
+ int_fast16_t book;
+ uint_fast16_t offset;
+ uint_fast16_t i,j;
+ uint_fast16_t *floor_x_sort=vf->x_list_order;
+ /*u*/int_fast16_t adx, ady, off, predicted; // WTF ? dy/adx= (unsigned)dy/adx ?
+ int_fast16_t dy, err;
+ uint_fast16_t lx,hx, ly, hy=0;
+
+
+ if (!get_bits1(gb)) return 1; // silence
+
+// Read values (or differences) for the floor's points
+
+ floor1_Y[0]=get_bits(gb, ilog(range-1));
+ floor1_Y[1]=get_bits(gb, ilog(range-1));
+
+ AV_DEBUG("floor 0 Y %d floor 1 Y %d \n", floor1_Y[0], floor1_Y[1]);
+
+ offset=2;
+ for(i=0;i<vf->partitions;++i) {
+ class_=vf->partition_class[i];
+ cdim=vf->class_dimensions[class_];
+ cbits=vf->class_subclasses[class_];
+ csub=(1<<cbits)-1;
+ cval=0;
+
+ AV_DEBUG("Cbits %d \n", cbits);
+
+ if (cbits) { // this reads all subclasses for this partition's class
+ cval=get_vlc2(gb, vc->codebooks[vf->class_masterbook[class_]].vlc.table,
+ vc->codebooks[vf->class_masterbook[class_]].nb_bits, 3);
+ }
+
+ for(j=0;j<cdim;++j) {
+ book=vf->subclass_books[class_][cval & csub];
+
+ AV_DEBUG("book %d Cbits %d cval %d bits:%d \n", book, cbits, cval, get_bits_count(gb));
+
+ cval=cval>>cbits;
+ if (book>0) {
+ floor1_Y[offset+j]=get_vlc2(gb, vc->codebooks[book].vlc.table,
+ vc->codebooks[book].nb_bits, 3);
+ } else {
+ floor1_Y[offset+j]=0;
+ }
+
+ AV_DEBUG(" floor(%d) = %d \n", vf->x_list[offset+j], floor1_Y[offset+j]);
+ }
+ offset+=cdim;
+ }
+
+// Amplitude calculation from the differences
+
+ floor1_flag[0]=1;
+ floor1_flag[1]=1;
+ floor1_Y_final[0]=floor1_Y[0];
+ floor1_Y_final[1]=floor1_Y[1];
+
+ for(i=2;i<vf->x_list_dim;++i) {
+ uint_fast16_t val, highroom, lowroom, room;
+ uint_fast16_t high_neigh_offs;
+ uint_fast16_t low_neigh_offs;
+
+ low_neigh_offs=vf->low_neighbour[i];
+ high_neigh_offs=vf->high_neighbour[i];
+ dy=floor1_Y_final[high_neigh_offs]-floor1_Y_final[low_neigh_offs]; // render_point begin
+ adx=vf->x_list[high_neigh_offs]-vf->x_list[low_neigh_offs];
+ ady= ABS(dy);
+ err=ady*(vf->x_list[i]-vf->x_list[low_neigh_offs]);
+ off=err/adx;
+ if (dy<0) {
+ predicted=floor1_Y_final[low_neigh_offs]-off;
+ } else {
+ predicted=floor1_Y_final[low_neigh_offs]+off;
+ } // render_point end
+
+ val=floor1_Y[i];
+ highroom=range-predicted;
+ lowroom=predicted;
+ if (highroom < lowroom) {
+ room=highroom*2;
+ } else {
+ room=lowroom*2; // SPEC mispelling
+ }
+ if (val) {
+ floor1_flag[low_neigh_offs]=1;
+ floor1_flag[high_neigh_offs]=1;
+ floor1_flag[i]=1;
+ if (val>=room) {
+ if (highroom > lowroom) {
+ floor1_Y_final[i]=val-lowroom+predicted;
+ } else {
+ floor1_Y_final[i]=predicted-val+highroom-1;
+ }
+ } else {
+ if (val & 1) {
+ floor1_Y_final[i]=predicted-(val+1)/2;
+ } else {
+ floor1_Y_final[i]=predicted+val/2;
+ }
+ }
+ } else {
+ floor1_flag[i]=0;
+ floor1_Y_final[i]=predicted;
+ }
+
+ AV_DEBUG(" Decoded floor(%d) = %d / val %d \n", vf->x_list[i], floor1_Y_final[i], val);
+ }
+
+// Curve synth - connect the calculated dots and convert from dB scale FIXME optimize ?
+
+ hx=0;
+ lx=0;
+ ly=floor1_Y_final[0]*vf->multiplier; // conforms to SPEC
+
+ vec[0]=floor1_inverse_db_table[ly];
+
+ for(i=1;i<vf->x_list_dim;++i) {
+ AV_DEBUG(" Looking at post %d \n", i);
+
+ if (floor1_flag[floor_x_sort[i]]) { // SPEC mispelled
+ int_fast16_t x, y, dy, base, sy; // if uncommented: dy = -32 adx = 2 base = 2blablabla ?????
+
+ hy=floor1_Y_final[floor_x_sort[i]]*vf->multiplier;
+ hx=vf->x_list[floor_x_sort[i]];
+
+ dy=hy-ly;
+ adx=hx-lx;
+ ady= (dy<0) ? -dy:dy;//ABS(dy);
+ base=dy/adx;
+
+ AV_DEBUG(" dy %d adx %d base %d = %d \n", dy, adx, base, dy/adx);
+
+ x=lx;
+ y=ly;
+ err=0;
+ if (dy<0) {
+ sy=base-1;
+ } else {
+ sy=base+1;
+ }
+ ady=ady-(base<0 ? -base : base)*adx;
+ vec[x]=floor1_inverse_db_table[y];
+
+ AV_DEBUG(" vec[ %d ] = %d \n", x, y);
+
+ for(x=lx+1;(x<hx) && (x<vf->x_list[1]);++x) {
+ err+=ady;
+ if (err>=adx) {
+ err-=adx;
+ y+=sy;
+ } else {
+ y+=base;
+ }
+ vec[x]=floor1_inverse_db_table[y];
+
+ AV_DEBUG(" vec[ %d ] = %d \n", x, y);
+ }
+
+/* for(j=1;j<hx-lx+1;++j) { // iterating render_point
+ dy=hy-ly;
+ adx=hx-lx;
+ ady= dy<0 ? -dy : dy;
+ err=ady*j;
+ off=err/adx;
+ if (dy<0) {
+ predicted=ly-off;
+ } else {
+ predicted=ly+off;
+ }
+ if (lx+j < vf->x_list[1]) {
+ vec[lx+j]=floor1_inverse_db_table[predicted];
+ }
+ }*/
+
+ lx=hx;
+ ly=hy;
+ }
+ }
+
+ if (hx<vf->x_list[1]) {
+ for(i=hx;i<vf->x_list[1];++i) {
+ vec[i]=floor1_inverse_db_table[hy];
+ }
+ }
+
+ AV_DEBUG(" Floor decoded\n");
+
+ return 0;
+}
+
+// Read and decode residue
+
+static int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr, uint_fast8_t ch, uint_fast8_t *do_not_decode, float *vec, uint_fast16_t vlen) {
+ GetBitContext *gb=&vc->gb;
+ uint_fast8_t c_p_c=vc->codebooks[vr->classbook].dimensions;
+ uint_fast16_t n_to_read=vr->end-vr->begin;
+ uint_fast16_t ptns_to_read=n_to_read/vr->partition_size;
+ uint_fast8_t classifs[ptns_to_read*vc->audio_channels];
+ uint_fast8_t pass;
+ uint_fast8_t ch_used;
+ uint_fast8_t i,j,l;
+ uint_fast16_t k;
+
+ if (vr->type==2) {
+ for(j=1;j<ch;++j) {
+ do_not_decode[0]&=do_not_decode[j]; // FIXME - clobbering input
+ }
+ if (do_not_decode[0]) return 0;
+ ch_used=1;
+ } else {
+ ch_used=ch;
+ }
+
+ AV_DEBUG(" residue type 0/1/2 decode begin, ch: %d cpc %d \n", ch, c_p_c);
+
+ for(pass=0;pass<=vr->maxpass;++pass) { // FIXME OPTIMIZE?
+ uint_fast16_t voffset;
+ uint_fast16_t partition_count;
+ uint_fast16_t j_times_ptns_to_read;
+
+ voffset=vr->begin;
+ for(partition_count=0;partition_count<ptns_to_read;) { // SPEC error
+ if (!pass) {
+ for(j_times_ptns_to_read=0, j=0;j<ch_used;++j) {
+ if (!do_not_decode[j]) {
+ uint_fast32_t temp=get_vlc2(gb, vc->codebooks[vr->classbook].vlc.table,
+ vc->codebooks[vr->classbook].nb_bits, 3);
+
+ AV_DEBUG("Classword: %d \n", temp);
+
+ assert(vr->classifications > 1 && vr->classifications<256 && temp<=65536); //needed for inverse[]
+ for(i=0;i<c_p_c;++i) {
+ uint_fast32_t temp2;
+
+ temp2=(((uint_fast64_t)temp) * inverse[vr->classifications])>>32;
+ classifs[j_times_ptns_to_read+partition_count+c_p_c-1-i]=temp-temp2*vr->classifications;
+ temp=temp2;
+ }
+ }
+ j_times_ptns_to_read+=ptns_to_read;
+ }
+ }
+ for(i=0;(i<c_p_c) && (partition_count<ptns_to_read);++i) {
+ for(j_times_ptns_to_read=0, j=0;j<ch_used;++j) {
+ uint_fast16_t voffs;
+
+ if (!do_not_decode[j]) {
+ uint_fast8_t vqclass=classifs[j_times_ptns_to_read+partition_count];
+ int_fast16_t vqbook=vr->books[vqclass][pass];
+
+ if (vqbook>=0) {
+ uint_fast16_t coffs;
+ uint_fast16_t step=vr->partition_size/vc->codebooks[vqbook].dimensions;
+ vorbis_codebook codebook= vc->codebooks[vqbook];
+
+ if (vr->type==0) {
+
+ voffs=voffset+j*vlen;
+ for(k=0;k<step;++k) {
+ coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * codebook.dimensions;
+ for(l=0;l<codebook.dimensions;++l) {
+ vec[voffs+k+l*step]+=codebook.codevectors[coffs+l]; // FPMATH
+ }
+ }
+ }
+ else if (vr->type==1) {
+ voffs=voffset+j*vlen;
+ for(k=0;k<step;++k) {
+ coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * codebook.dimensions;
+ for(l=0;l<codebook.dimensions;++l, ++voffs) {
+ vec[voffs]+=codebook.codevectors[coffs+l]; // FPMATH
+
+ AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d \n", pass, voffs, vec[voffs], codebook.codevectors[coffs+l], coffs);
+ }
+ }
+ }
+ else if (vr->type==2 && ch==2 && (voffset&1)==0 && (codebook.dimensions&1)==0) { // most frequent case optimized
+ voffs=voffset>>1;
+
+ for(k=0;k<step;++k) {
+ coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * codebook.dimensions;
+ for(l=0;l<codebook.dimensions;l+=2, voffs++) {
+ vec[voffs ]+=codebook.codevectors[coffs+l ]; // FPMATH
+ vec[voffs+vlen]+=codebook.codevectors[coffs+l+1]; // FPMATH
+
+ AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n", pass, voffset/ch+(voffs%ch)*vlen, vec[voffset/ch+(voffs%ch)*vlen], codebook.codevectors[coffs+l], coffs, l);
+ }
+ }
+
+ }
+ else if (vr->type==2) {
+ voffs=voffset;
+
+ for(k=0;k<step;++k) {
+ coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * codebook.dimensions;
+ for(l=0;l<codebook.dimensions;++l, ++voffs) {
+ vec[voffs/ch+(voffs%ch)*vlen]+=codebook.codevectors[coffs+l]; // FPMATH FIXME use if and counter instead of / and %
+
+ AV_DEBUG(" pass %d offs: %d curr: %f change: %f cv offs.: %d+%d \n", pass, voffset/ch+(voffs%ch)*vlen, vec[voffset/ch+(voffs%ch)*vlen], codebook.codevectors[coffs+l], coffs, l);
+ }
+ }
+ } else {
+ av_log(vc->avccontext, AV_LOG_ERROR, " Invalid residue type while residue decode?! \n");
+ return 1;
+ }
+ }
+ }
+ j_times_ptns_to_read+=ptns_to_read;
+ }
+ ++partition_count;
+ voffset+=vr->partition_size;
+ }
+ }
+ }
+ return 0;
+}
+
+// Decode the audio packet using the functions above
+#define BIAS 385
+
+static int vorbis_parse_audio_packet(vorbis_context *vc) {
+ GetBitContext *gb=&vc->gb;
+
+ uint_fast8_t previous_window=0,next_window=0;
+ uint_fast8_t mode_number;
+ uint_fast16_t blocksize;
+ int_fast32_t i,j;
+ uint_fast8_t no_residue[vc->audio_channels];
+ uint_fast8_t do_not_decode[vc->audio_channels];
+ vorbis_mapping *mapping;
+ float *ch_res_ptr=vc->channel_residues;
+ float *ch_floor_ptr=vc->channel_floors;
+ uint_fast8_t res_chan[vc->audio_channels];
+ uint_fast8_t res_num=0;
+ int_fast16_t retlen=0;
+ uint_fast16_t saved_start=0;
+
+ if (get_bits1(gb)) {
+ av_log(vc->avccontext, AV_LOG_ERROR, "Not a Vorbis I audio packet.\n");
+ return -1; // packet type not audio
+ }
+
+ if (vc->mode_count==1) {
+ mode_number=0;
+ } else {
+ mode_number=get_bits(gb, ilog(vc->mode_count-1));
+ }
+ mapping=&vc->mappings[vc->modes[mode_number].mapping];
+
+ AV_DEBUG(" Mode number: %d , mapping: %d , blocktype %d \n", mode_number, vc->modes[mode_number].mapping, vc->modes[mode_number].blockflag);
+
+ if (vc->modes[mode_number].blockflag) {
+ previous_window=get_bits1(gb);
+ next_window=get_bits1(gb);
+ }
+
+ blocksize=vc->modes[mode_number].blockflag ? vc->blocksize_1 : vc->blocksize_0;
+ memset(ch_res_ptr, 0, sizeof(float)*vc->audio_channels*blocksize/2); //FIXME can this be removed ?
+ memset(ch_floor_ptr, 0, sizeof(float)*vc->audio_channels*blocksize/2); //FIXME can this be removed ?
+
+// Decode floor(1)
+
+ for(i=0;i<vc->audio_channels;++i) {
+ vorbis_floor *floor;
+ if (mapping->submaps>1) {
+ floor=&vc->floors[mapping->submap_floor[mapping->mux[i]]];
+ } else {
+ floor=&vc->floors[mapping->submap_floor[0]];
+ }
+
+ no_residue[i]=vorbis_floor1_decode(vc, floor, ch_floor_ptr);
+ ch_floor_ptr+=blocksize/2;
+ }
+
+// Nonzero vector propagate
+
+ for(i=mapping->coupling_steps-1;i>=0;--i) {
+ if (!(no_residue[mapping->magnitude[i]] & no_residue[mapping->angle[i]])) {
+ no_residue[mapping->magnitude[i]]=0;
+ no_residue[mapping->angle[i]]=0;
+ }
+ }
+
+// Decode residue
+
+ for(i=0;i<mapping->submaps;++i) {
+ vorbis_residue *residue;
+ uint_fast8_t ch=0;
+
+ for(j=0;j<vc->audio_channels;++j) {
+ if ((mapping->submaps==1) || (i=mapping->mux[j])) {
+ res_chan[j]=res_num;
+ if (no_residue[j]) {
+ do_not_decode[ch]=1;
+ } else {
+ do_not_decode[ch]=0;
+ }
+ ++ch;
+ ++res_num;
+ }
+ }
+ residue=&vc->residues[mapping->submap_residue[i]];
+ vorbis_residue_decode(vc, residue, ch, do_not_decode, ch_res_ptr, blocksize/2);
+
+ ch_res_ptr+=ch*blocksize/2;
+ }
+
+// Inverse coupling
+
+ for(i=mapping->coupling_steps-1;i>=0;--i) { //warning: i has to be signed
+ float *mag, *ang;
+
+ mag=vc->channel_residues+res_chan[mapping->magnitude[i]]*blocksize/2;
+ ang=vc->channel_residues+res_chan[mapping->angle[i]]*blocksize/2;
+ for(j=0;j<blocksize/2;++j) {
+ float temp;
+ if (mag[j]>0.0) {
+ if (ang[j]>0.0) {
+ ang[j]=mag[j]-ang[j];
+ } else {
+ temp=ang[j];
+ ang[j]=mag[j];
+ mag[j]+=temp;
+ }
+ } else {
+ if (ang[j]>0.0) {
+ ang[j]+=mag[j];
+ } else {
+ temp=ang[j];
+ ang[j]=mag[j];
+ mag[j]-=temp;
+ }
+ }
+ }
+ }
+
+// Dotproduct
+
+ for(j=0, ch_floor_ptr=vc->channel_floors;j<vc->audio_channels;++j,ch_floor_ptr+=blocksize/2) {
+ ch_res_ptr=vc->channel_residues+res_chan[j]*blocksize/2;
+
+ for(i=0;i<blocksize/2;++i) {
+ ch_floor_ptr[i]*=ch_res_ptr[i]; //FPMATH
+ }
+ }
+
+// MDCT, overlap/add, save data for next overlapping FPMATH
+
+ for(j=0;j<vc->audio_channels;++j) {
+ uint_fast8_t step=vc->audio_channels;
+ uint_fast16_t k;
+ float *saved=vc->saved+j*vc->blocksize_1/2;
+ float *ret=vc->ret;
+ const float *lwin=vc->lwin;
+ const float *swin=vc->swin;
+ float *buf=vc->buf;
+ float *buf_tmp=vc->buf_tmp;
+
+ ch_floor_ptr=vc->channel_floors+j*blocksize/2;
+
+ saved_start=vc->saved_start;
+
+ ff_imdct_calc(vc->modes[mode_number].blockflag ? &vc->mdct1 : &vc->mdct0, buf, ch_floor_ptr, buf_tmp);
+
+ if (vc->modes[mode_number].blockflag) {
+ // -- overlap/add
+ if (previous_window) {
+ for(k=j, i=0;i<vc->blocksize_1/2;++i, k+=step) {
+ ret[k]=saved[i]+buf[i]*lwin[i]+BIAS;
+ }
+ retlen=vc->blocksize_1/2;
+ } else {
+ buf += (vc->blocksize_1-vc->blocksize_0)/4;
+ for(k=j, i=0;i<vc->blocksize_0/2;++i, k+=step) {
+ ret[k]=saved[i]+buf[i]*swin[i]+BIAS;
+ }
+ buf += vc->blocksize_0/2;
+ for(i=0;i<(vc->blocksize_1-vc->blocksize_0)/4;++i, k+=step) {
+ ret[k]=buf[i]+BIAS;
+ }
+ buf=vc->buf;
+ retlen=vc->blocksize_0/2+(vc->blocksize_1-vc->blocksize_0)/4;
+ }
+ // -- save
+ if (next_window) {
+ buf += vc->blocksize_1/2;
+ lwin += vc->blocksize_1/2-1;
+ for(i=0;i<vc->blocksize_1/2;++i) {
+ saved[i]=buf[i]*lwin[-i];
+ }
+ saved_start=0;
+ } else {
+ saved_start=(vc->blocksize_1-vc->blocksize_0)/4;
+ buf += vc->blocksize_1/2;
+ for(i=0;i<saved_start;++i) {
+ saved[i]=buf[i];
+ }
+ swin += vc->blocksize_0/2-1;
+ for(i=0;i<vc->blocksize_0/2;++i) {
+ saved[saved_start+i]=buf[saved_start+i]*swin[-i];
+ }
+ }
+ } else {
+ // --overlap/add
+ for(k=j, i=0;i<saved_start;++i, k+=step) {
+ ret[k]=saved[i]+BIAS;
+ }
+ for(i=0;i<vc->blocksize_0/2;++i, k+=step) {
+ ret[k]=saved[saved_start+i]+buf[i]*swin[i]+BIAS;
+ }
+ retlen=saved_start+vc->blocksize_0/2;
+ // -- save
+ buf += vc->blocksize_0/2;
+ swin += vc->blocksize_0/2-1;
+ for(i=0;i<vc->blocksize_0/2;++i) {
+ saved[i]=buf[i]*swin[-i];
+ }
+ saved_start=0;
+ }
+ }
+ vc->saved_start=saved_start;
+
+ return retlen*vc->audio_channels;
+}
+
+// Return the decoded audio packet through the standard api
+
+static int vorbis_decode_frame(AVCodecContext *avccontext,
+ void *data, int *data_size,
+ uint8_t *buf, int buf_size)
+{
+ vorbis_context *vc = avccontext->priv_data ;
+ GetBitContext *gb = &(vc->gb);
+
+ int_fast16_t i, len;
+
+ if(!buf_size){
+ return 0;
+ }
+
+ AV_DEBUG("packet length %d \n", buf_size);
+
+ init_get_bits(gb, buf, buf_size*8);
+
+ len=vorbis_parse_audio_packet(vc);
+
+ if (len<=0) {
+ *data_size=0;
+ return buf_size;
+ }
+
+ if (!vc->first_frame) {
+ vc->first_frame=1;
+ *data_size=0;
+ return buf_size ;
+ }
+
+ AV_DEBUG("parsed %d bytes %d bits, returned %d samples (*ch*bits) \n", get_bits_count(gb)/8, get_bits_count(gb)%8, len);
+
+ for(i=0;i<len;++i) {
+ int_fast32_t tmp= ((int32_t*)vc->ret)[i];
+ if(tmp & 0xf0000){
+// tmp= (0x43c0ffff - tmp)>>31; //ask gcc devs why this is slower
+ if(tmp > 0x43c0ffff) tmp= 0xFFFF;
+ else tmp= 0;
+ }
+ ((int16_t*)data)[i]=tmp - 0x8000;
+ }
+
+ *data_size=len*2;
+
+ return buf_size ;
+}
+
+// Close decoder
+
+static int vorbis_decode_close(AVCodecContext *avccontext) {
+ vorbis_context *vc = avccontext->priv_data;
+
+ vorbis_free(vc);
+
+ return 0 ;
+}
+
+AVCodec vorbis_decoder = {
+ "vorbis",
+ CODEC_TYPE_AUDIO,
+ CODEC_ID_VORBIS,
+ sizeof(vorbis_context),
+ vorbis_decode_init,
+ NULL,
+ vorbis_decode_close,
+ vorbis_decode_frame,
+};
+
diff --git a/src/libffmpeg/libavcodec/vorbis.h b/src/libffmpeg/libavcodec/vorbis.h
new file mode 100644
index 000000000..27274a126
--- /dev/null
+++ b/src/libffmpeg/libavcodec/vorbis.h
@@ -0,0 +1,2228 @@
+#define ALT_BITSTREAM_READER_LE
+#include "avcodec.h"
+#include "bitstream.h"
+#include "dsputil.h"
+
+typedef struct {
+ uint_fast8_t dimensions;
+ uint_fast8_t lookup_type;
+ uint_fast8_t maxdepth;
+ VLC vlc;
+ float *codevectors;
+ unsigned int nb_bits;
+} vorbis_codebook;
+
+typedef struct {
+ uint_fast8_t floor_type;
+ uint_fast8_t partitions;
+ uint_fast8_t maximum_class;
+ uint_fast8_t partition_class[32];
+ uint_fast8_t class_dimensions[16];
+ uint_fast8_t class_subclasses[16];
+ uint_fast8_t class_masterbook[16];
+ int_fast16_t subclass_books[16][8];
+ uint_fast8_t multiplier;
+ uint_fast16_t x_list_dim;
+ uint_fast16_t *x_list;
+ uint_fast16_t *x_list_order;
+ uint_fast16_t *low_neighbour;
+ uint_fast16_t *high_neighbour;
+} vorbis_floor;
+
+typedef struct {
+ uint_fast16_t type;
+ uint_fast32_t begin;
+ uint_fast32_t end;
+ uint_fast32_t partition_size;
+ uint_fast8_t classifications;
+ uint_fast8_t classbook;
+ int_fast16_t books[64][8];
+ uint_fast8_t maxpass;
+} vorbis_residue;
+
+typedef struct {
+ uint_fast8_t submaps;
+ uint_fast16_t coupling_steps;
+ uint_fast8_t *magnitude;
+ uint_fast8_t *angle;
+ uint_fast8_t *mux;
+ uint_fast8_t submap_floor[16];
+ uint_fast8_t submap_residue[16];
+} vorbis_mapping;
+
+typedef struct {
+ uint_fast8_t blockflag;
+ uint_fast16_t windowtype;
+ uint_fast16_t transformtype;
+ uint_fast8_t mapping;
+} vorbis_mode;
+
+typedef struct {
+ AVCodecContext *avccontext;
+ GetBitContext gb;
+
+ MDCTContext mdct0;
+ MDCTContext mdct1;
+ uint_fast8_t first_frame;
+ uint_fast32_t version;
+ uint_fast8_t audio_channels;
+ uint_fast32_t audio_samplerate;
+ uint_fast32_t bitrate_maximum;
+ uint_fast32_t bitrate_nominal;
+ uint_fast32_t bitrate_minimum;
+ uint_fast32_t blocksize_0;
+ uint_fast32_t blocksize_1;
+ const float * swin;
+ const float * lwin;
+ uint_fast16_t codebook_count;
+ vorbis_codebook *codebooks;
+ uint_fast8_t floor_count;
+ vorbis_floor *floors;
+ uint_fast8_t residue_count;
+ vorbis_residue *residues;
+ uint_fast8_t mapping_count;
+ vorbis_mapping *mappings;
+ uint_fast8_t mode_count;
+ vorbis_mode *modes;
+ float *channel_residues;
+ float *channel_floors;
+ float *saved;
+ uint_fast16_t saved_start;
+ float *ret;
+ float *buf;
+ float *buf_tmp;
+} vorbis_context;
+
+
+
+static const float vwin64[32] = {
+ 0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F,
+ 0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F,
+ 0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F,
+ 0.4975789974F, 0.5601459521F, 0.6211085051F, 0.6793382689F,
+ 0.7338252629F, 0.7837245849F, 0.8283939355F, 0.8674186656F,
+ 0.9006222429F, 0.9280614787F, 0.9500073081F, 0.9669131782F,
+ 0.9793740220F, 0.9880792941F, 0.9937636139F, 0.9971582668F,
+ 0.9989462667F, 0.9997230082F, 0.9999638688F, 0.9999995525F,
+};
+
+static const float vwin128[64] = {
+ 0.0002365472F, 0.0021280687F, 0.0059065254F, 0.0115626550F,
+ 0.0190823442F, 0.0284463735F, 0.0396300935F, 0.0526030430F,
+ 0.0673285281F, 0.0837631763F, 0.1018564887F, 0.1215504095F,
+ 0.1427789367F, 0.1654677960F, 0.1895342001F, 0.2148867160F,
+ 0.2414252576F, 0.2690412240F, 0.2976177952F, 0.3270303960F,
+ 0.3571473350F, 0.3878306189F, 0.4189369387F, 0.4503188188F,
+ 0.4818259135F, 0.5133064334F, 0.5446086751F, 0.5755826278F,
+ 0.6060816248F, 0.6359640047F, 0.6650947483F, 0.6933470543F,
+ 0.7206038179F, 0.7467589810F, 0.7717187213F, 0.7954024542F,
+ 0.8177436264F, 0.8386902831F, 0.8582053981F, 0.8762669622F,
+ 0.8928678298F, 0.9080153310F, 0.9217306608F, 0.9340480615F,
+ 0.9450138200F, 0.9546851041F, 0.9631286621F, 0.9704194171F,
+ 0.9766389810F, 0.9818741197F, 0.9862151938F, 0.9897546035F,
+ 0.9925852598F, 0.9947991032F, 0.9964856900F, 0.9977308602F,
+ 0.9986155015F, 0.9992144193F, 0.9995953200F, 0.9998179155F,
+ 0.9999331503F, 0.9999825563F, 0.9999977357F, 0.9999999720F,
+};
+
+static const float vwin256[128] = {
+ 0.0000591390F, 0.0005321979F, 0.0014780301F, 0.0028960636F,
+ 0.0047854363F, 0.0071449926F, 0.0099732775F, 0.0132685298F,
+ 0.0170286741F, 0.0212513119F, 0.0259337111F, 0.0310727950F,
+ 0.0366651302F, 0.0427069140F, 0.0491939614F, 0.0561216907F,
+ 0.0634851102F, 0.0712788035F, 0.0794969160F, 0.0881331402F,
+ 0.0971807028F, 0.1066323515F, 0.1164803426F, 0.1267164297F,
+ 0.1373318534F, 0.1483173323F, 0.1596630553F, 0.1713586755F,
+ 0.1833933062F, 0.1957555184F, 0.2084333404F, 0.2214142599F,
+ 0.2346852280F, 0.2482326664F, 0.2620424757F, 0.2761000481F,
+ 0.2903902813F, 0.3048975959F, 0.3196059553F, 0.3344988887F,
+ 0.3495595160F, 0.3647705766F, 0.3801144597F, 0.3955732382F,
+ 0.4111287047F, 0.4267624093F, 0.4424557009F, 0.4581897696F,
+ 0.4739456913F, 0.4897044744F, 0.5054471075F, 0.5211546088F,
+ 0.5368080763F, 0.5523887395F, 0.5678780103F, 0.5832575361F,
+ 0.5985092508F, 0.6136154277F, 0.6285587300F, 0.6433222619F,
+ 0.6578896175F, 0.6722449294F, 0.6863729144F, 0.7002589187F,
+ 0.7138889597F, 0.7272497662F, 0.7403288154F, 0.7531143679F,
+ 0.7655954985F, 0.7777621249F, 0.7896050322F, 0.8011158947F,
+ 0.8122872932F, 0.8231127294F, 0.8335866365F, 0.8437043850F,
+ 0.8534622861F, 0.8628575905F, 0.8718884835F, 0.8805540765F,
+ 0.8888543947F, 0.8967903616F, 0.9043637797F, 0.9115773078F,
+ 0.9184344360F, 0.9249394562F, 0.9310974312F, 0.9369141608F,
+ 0.9423961446F, 0.9475505439F, 0.9523851406F, 0.9569082947F,
+ 0.9611289005F, 0.9650563408F, 0.9687004405F, 0.9720714191F,
+ 0.9751798427F, 0.9780365753F, 0.9806527301F, 0.9830396204F,
+ 0.9852087111F, 0.9871715701F, 0.9889398207F, 0.9905250941F,
+ 0.9919389832F, 0.9931929973F, 0.9942985174F, 0.9952667537F,
+ 0.9961087037F, 0.9968351119F, 0.9974564312F, 0.9979827858F,
+ 0.9984239359F, 0.9987892441F, 0.9990876435F, 0.9993276081F,
+ 0.9995171241F, 0.9996636648F, 0.9997741654F, 0.9998550016F,
+ 0.9999119692F, 0.9999502656F, 0.9999744742F, 0.9999885497F,
+ 0.9999958064F, 0.9999989077F, 0.9999998584F, 0.9999999983F,
+};
+
+static const float vwin512[256] = {
+ 0.0000147849F, 0.0001330607F, 0.0003695946F, 0.0007243509F,
+ 0.0011972759F, 0.0017882983F, 0.0024973285F, 0.0033242588F,
+ 0.0042689632F, 0.0053312973F, 0.0065110982F, 0.0078081841F,
+ 0.0092223540F, 0.0107533880F, 0.0124010466F, 0.0141650703F,
+ 0.0160451800F, 0.0180410758F, 0.0201524373F, 0.0223789233F,
+ 0.0247201710F, 0.0271757958F, 0.0297453914F, 0.0324285286F,
+ 0.0352247556F, 0.0381335972F, 0.0411545545F, 0.0442871045F,
+ 0.0475306997F, 0.0508847676F, 0.0543487103F, 0.0579219038F,
+ 0.0616036982F, 0.0653934164F, 0.0692903546F, 0.0732937809F,
+ 0.0774029356F, 0.0816170305F, 0.0859352485F, 0.0903567428F,
+ 0.0948806375F, 0.0995060259F, 0.1042319712F, 0.1090575056F,
+ 0.1139816300F, 0.1190033137F, 0.1241214941F, 0.1293350764F,
+ 0.1346429333F, 0.1400439046F, 0.1455367974F, 0.1511203852F,
+ 0.1567934083F, 0.1625545735F, 0.1684025537F, 0.1743359881F,
+ 0.1803534820F, 0.1864536069F, 0.1926349000F, 0.1988958650F,
+ 0.2052349715F, 0.2116506555F, 0.2181413191F, 0.2247053313F,
+ 0.2313410275F, 0.2380467105F, 0.2448206500F, 0.2516610835F,
+ 0.2585662164F, 0.2655342226F, 0.2725632448F, 0.2796513950F,
+ 0.2867967551F, 0.2939973773F, 0.3012512852F, 0.3085564739F,
+ 0.3159109111F, 0.3233125375F, 0.3307592680F, 0.3382489922F,
+ 0.3457795756F, 0.3533488602F, 0.3609546657F, 0.3685947904F,
+ 0.3762670121F, 0.3839690896F, 0.3916987634F, 0.3994537572F,
+ 0.4072317788F, 0.4150305215F, 0.4228476653F, 0.4306808783F,
+ 0.4385278181F, 0.4463861329F, 0.4542534630F, 0.4621274424F,
+ 0.4700057001F, 0.4778858615F, 0.4857655502F, 0.4936423891F,
+ 0.5015140023F, 0.5093780165F, 0.5172320626F, 0.5250737772F,
+ 0.5329008043F, 0.5407107971F, 0.5485014192F, 0.5562703465F,
+ 0.5640152688F, 0.5717338914F, 0.5794239366F, 0.5870831457F,
+ 0.5947092801F, 0.6023001235F, 0.6098534829F, 0.6173671907F,
+ 0.6248391059F, 0.6322671161F, 0.6396491384F, 0.6469831217F,
+ 0.6542670475F, 0.6614989319F, 0.6686768267F, 0.6757988210F,
+ 0.6828630426F, 0.6898676592F, 0.6968108799F, 0.7036909564F,
+ 0.7105061843F, 0.7172549043F, 0.7239355032F, 0.7305464154F,
+ 0.7370861235F, 0.7435531598F, 0.7499461068F, 0.7562635986F,
+ 0.7625043214F, 0.7686670148F, 0.7747504721F, 0.7807535410F,
+ 0.7866751247F, 0.7925141825F, 0.7982697296F, 0.8039408387F,
+ 0.8095266395F, 0.8150263196F, 0.8204391248F, 0.8257643590F,
+ 0.8310013848F, 0.8361496236F, 0.8412085555F, 0.8461777194F,
+ 0.8510567129F, 0.8558451924F, 0.8605428730F, 0.8651495278F,
+ 0.8696649882F, 0.8740891432F, 0.8784219392F, 0.8826633797F,
+ 0.8868135244F, 0.8908724888F, 0.8948404441F, 0.8987176157F,
+ 0.9025042831F, 0.9062007791F, 0.9098074886F, 0.9133248482F,
+ 0.9167533451F, 0.9200935163F, 0.9233459472F, 0.9265112712F,
+ 0.9295901680F, 0.9325833632F, 0.9354916263F, 0.9383157705F,
+ 0.9410566504F, 0.9437151618F, 0.9462922398F, 0.9487888576F,
+ 0.9512060252F, 0.9535447882F, 0.9558062262F, 0.9579914516F,
+ 0.9601016078F, 0.9621378683F, 0.9641014348F, 0.9659935361F,
+ 0.9678154261F, 0.9695683830F, 0.9712537071F, 0.9728727198F,
+ 0.9744267618F, 0.9759171916F, 0.9773453842F, 0.9787127293F,
+ 0.9800206298F, 0.9812705006F, 0.9824637665F, 0.9836018613F,
+ 0.9846862258F, 0.9857183066F, 0.9866995544F, 0.9876314227F,
+ 0.9885153662F, 0.9893528393F, 0.9901452948F, 0.9908941823F,
+ 0.9916009470F, 0.9922670279F, 0.9928938570F, 0.9934828574F,
+ 0.9940354423F, 0.9945530133F, 0.9950369595F, 0.9954886562F,
+ 0.9959094633F, 0.9963007242F, 0.9966637649F, 0.9969998925F,
+ 0.9973103939F, 0.9975965351F, 0.9978595598F, 0.9981006885F,
+ 0.9983211172F, 0.9985220166F, 0.9987045311F, 0.9988697776F,
+ 0.9990188449F, 0.9991527924F, 0.9992726499F, 0.9993794157F,
+ 0.9994740570F, 0.9995575079F, 0.9996306699F, 0.9996944099F,
+ 0.9997495605F, 0.9997969190F, 0.9998372465F, 0.9998712678F,
+ 0.9998996704F, 0.9999231041F, 0.9999421807F, 0.9999574732F,
+ 0.9999695157F, 0.9999788026F, 0.9999857885F, 0.9999908879F,
+ 0.9999944746F, 0.9999968817F, 0.9999984010F, 0.9999992833F,
+ 0.9999997377F, 0.9999999317F, 0.9999999911F, 0.9999999999F,
+};
+
+static const float vwin1024[512] = {
+ 0.0000036962F, 0.0000332659F, 0.0000924041F, 0.0001811086F,
+ 0.0002993761F, 0.0004472021F, 0.0006245811F, 0.0008315063F,
+ 0.0010679699F, 0.0013339631F, 0.0016294757F, 0.0019544965F,
+ 0.0023090133F, 0.0026930125F, 0.0031064797F, 0.0035493989F,
+ 0.0040217533F, 0.0045235250F, 0.0050546946F, 0.0056152418F,
+ 0.0062051451F, 0.0068243817F, 0.0074729278F, 0.0081507582F,
+ 0.0088578466F, 0.0095941655F, 0.0103596863F, 0.0111543789F,
+ 0.0119782122F, 0.0128311538F, 0.0137131701F, 0.0146242260F,
+ 0.0155642855F, 0.0165333111F, 0.0175312640F, 0.0185581042F,
+ 0.0196137903F, 0.0206982797F, 0.0218115284F, 0.0229534910F,
+ 0.0241241208F, 0.0253233698F, 0.0265511886F, 0.0278075263F,
+ 0.0290923308F, 0.0304055484F, 0.0317471241F, 0.0331170013F,
+ 0.0345151222F, 0.0359414274F, 0.0373958560F, 0.0388783456F,
+ 0.0403888325F, 0.0419272511F, 0.0434935347F, 0.0450876148F,
+ 0.0467094213F, 0.0483588828F, 0.0500359261F, 0.0517404765F,
+ 0.0534724575F, 0.0552317913F, 0.0570183983F, 0.0588321971F,
+ 0.0606731048F, 0.0625410369F, 0.0644359070F, 0.0663576272F,
+ 0.0683061077F, 0.0702812571F, 0.0722829821F, 0.0743111878F,
+ 0.0763657775F, 0.0784466526F, 0.0805537129F, 0.0826868561F,
+ 0.0848459782F, 0.0870309736F, 0.0892417345F, 0.0914781514F,
+ 0.0937401128F, 0.0960275056F, 0.0983402145F, 0.1006781223F,
+ 0.1030411101F, 0.1054290568F, 0.1078418397F, 0.1102793336F,
+ 0.1127414119F, 0.1152279457F, 0.1177388042F, 0.1202738544F,
+ 0.1228329618F, 0.1254159892F, 0.1280227980F, 0.1306532471F,
+ 0.1333071937F, 0.1359844927F, 0.1386849970F, 0.1414085575F,
+ 0.1441550230F, 0.1469242403F, 0.1497160539F, 0.1525303063F,
+ 0.1553668381F, 0.1582254875F, 0.1611060909F, 0.1640084822F,
+ 0.1669324936F, 0.1698779549F, 0.1728446939F, 0.1758325362F,
+ 0.1788413055F, 0.1818708232F, 0.1849209084F, 0.1879913785F,
+ 0.1910820485F, 0.1941927312F, 0.1973232376F, 0.2004733764F,
+ 0.2036429541F, 0.2068317752F, 0.2100396421F, 0.2132663552F,
+ 0.2165117125F, 0.2197755102F, 0.2230575422F, 0.2263576007F,
+ 0.2296754753F, 0.2330109540F, 0.2363638225F, 0.2397338646F,
+ 0.2431208619F, 0.2465245941F, 0.2499448389F, 0.2533813719F,
+ 0.2568339669F, 0.2603023956F, 0.2637864277F, 0.2672858312F,
+ 0.2708003718F, 0.2743298135F, 0.2778739186F, 0.2814324472F,
+ 0.2850051576F, 0.2885918065F, 0.2921921485F, 0.2958059366F,
+ 0.2994329219F, 0.3030728538F, 0.3067254799F, 0.3103905462F,
+ 0.3140677969F, 0.3177569747F, 0.3214578205F, 0.3251700736F,
+ 0.3288934718F, 0.3326277513F, 0.3363726468F, 0.3401278914F,
+ 0.3438932168F, 0.3476683533F, 0.3514530297F, 0.3552469734F,
+ 0.3590499106F, 0.3628615659F, 0.3666816630F, 0.3705099239F,
+ 0.3743460698F, 0.3781898204F, 0.3820408945F, 0.3858990095F,
+ 0.3897638820F, 0.3936352274F, 0.3975127601F, 0.4013961936F,
+ 0.4052852405F, 0.4091796123F, 0.4130790198F, 0.4169831732F,
+ 0.4208917815F, 0.4248045534F, 0.4287211965F, 0.4326414181F,
+ 0.4365649248F, 0.4404914225F, 0.4444206167F, 0.4483522125F,
+ 0.4522859146F, 0.4562214270F, 0.4601584538F, 0.4640966984F,
+ 0.4680358644F, 0.4719756548F, 0.4759157726F, 0.4798559209F,
+ 0.4837958024F, 0.4877351199F, 0.4916735765F, 0.4956108751F,
+ 0.4995467188F, 0.5034808109F, 0.5074128550F, 0.5113425550F,
+ 0.5152696149F, 0.5191937395F, 0.5231146336F, 0.5270320028F,
+ 0.5309455530F, 0.5348549910F, 0.5387600239F, 0.5426603597F,
+ 0.5465557070F, 0.5504457754F, 0.5543302752F, 0.5582089175F,
+ 0.5620814145F, 0.5659474793F, 0.5698068262F, 0.5736591704F,
+ 0.5775042283F, 0.5813417176F, 0.5851713571F, 0.5889928670F,
+ 0.5928059689F, 0.5966103856F, 0.6004058415F, 0.6041920626F,
+ 0.6079687761F, 0.6117357113F, 0.6154925986F, 0.6192391705F,
+ 0.6229751612F, 0.6267003064F, 0.6304143441F, 0.6341170137F,
+ 0.6378080569F, 0.6414872173F, 0.6451542405F, 0.6488088741F,
+ 0.6524508681F, 0.6560799742F, 0.6596959469F, 0.6632985424F,
+ 0.6668875197F, 0.6704626398F, 0.6740236662F, 0.6775703649F,
+ 0.6811025043F, 0.6846198554F, 0.6881221916F, 0.6916092892F,
+ 0.6950809269F, 0.6985368861F, 0.7019769510F, 0.7054009085F,
+ 0.7088085484F, 0.7121996632F, 0.7155740484F, 0.7189315023F,
+ 0.7222718263F, 0.7255948245F, 0.7289003043F, 0.7321880760F,
+ 0.7354579530F, 0.7387097518F, 0.7419432921F, 0.7451583966F,
+ 0.7483548915F, 0.7515326059F, 0.7546913723F, 0.7578310265F,
+ 0.7609514077F, 0.7640523581F, 0.7671337237F, 0.7701953535F,
+ 0.7732371001F, 0.7762588195F, 0.7792603711F, 0.7822416178F,
+ 0.7852024259F, 0.7881426654F, 0.7910622097F, 0.7939609356F,
+ 0.7968387237F, 0.7996954579F, 0.8025310261F, 0.8053453193F,
+ 0.8081382324F, 0.8109096638F, 0.8136595156F, 0.8163876936F,
+ 0.8190941071F, 0.8217786690F, 0.8244412960F, 0.8270819086F,
+ 0.8297004305F, 0.8322967896F, 0.8348709171F, 0.8374227481F,
+ 0.8399522213F, 0.8424592789F, 0.8449438672F, 0.8474059356F,
+ 0.8498454378F, 0.8522623306F, 0.8546565748F, 0.8570281348F,
+ 0.8593769787F, 0.8617030779F, 0.8640064080F, 0.8662869477F,
+ 0.8685446796F, 0.8707795899F, 0.8729916682F, 0.8751809079F,
+ 0.8773473059F, 0.8794908626F, 0.8816115819F, 0.8837094713F,
+ 0.8857845418F, 0.8878368079F, 0.8898662874F, 0.8918730019F,
+ 0.8938569760F, 0.8958182380F, 0.8977568194F, 0.8996727552F,
+ 0.9015660837F, 0.9034368465F, 0.9052850885F, 0.9071108577F,
+ 0.9089142057F, 0.9106951869F, 0.9124538591F, 0.9141902832F,
+ 0.9159045233F, 0.9175966464F, 0.9192667228F, 0.9209148257F,
+ 0.9225410313F, 0.9241454187F, 0.9257280701F, 0.9272890704F,
+ 0.9288285075F, 0.9303464720F, 0.9318430576F, 0.9333183603F,
+ 0.9347724792F, 0.9362055158F, 0.9376175745F, 0.9390087622F,
+ 0.9403791881F, 0.9417289644F, 0.9430582055F, 0.9443670283F,
+ 0.9456555521F, 0.9469238986F, 0.9481721917F, 0.9494005577F,
+ 0.9506091252F, 0.9517980248F, 0.9529673894F, 0.9541173540F,
+ 0.9552480557F, 0.9563596334F, 0.9574522282F, 0.9585259830F,
+ 0.9595810428F, 0.9606175542F, 0.9616356656F, 0.9626355274F,
+ 0.9636172915F, 0.9645811114F, 0.9655271425F, 0.9664555414F,
+ 0.9673664664F, 0.9682600774F, 0.9691365355F, 0.9699960034F,
+ 0.9708386448F, 0.9716646250F, 0.9724741103F, 0.9732672685F,
+ 0.9740442683F, 0.9748052795F, 0.9755504729F, 0.9762800205F,
+ 0.9769940950F, 0.9776928703F, 0.9783765210F, 0.9790452223F,
+ 0.9796991504F, 0.9803384823F, 0.9809633954F, 0.9815740679F,
+ 0.9821706784F, 0.9827534063F, 0.9833224312F, 0.9838779332F,
+ 0.9844200928F, 0.9849490910F, 0.9854651087F, 0.9859683274F,
+ 0.9864589286F, 0.9869370940F, 0.9874030054F, 0.9878568447F,
+ 0.9882987937F, 0.9887290343F, 0.9891477481F, 0.9895551169F,
+ 0.9899513220F, 0.9903365446F, 0.9907109658F, 0.9910747662F,
+ 0.9914281260F, 0.9917712252F, 0.9921042433F, 0.9924273593F,
+ 0.9927407516F, 0.9930445982F, 0.9933390763F, 0.9936243626F,
+ 0.9939006331F, 0.9941680631F, 0.9944268269F, 0.9946770982F,
+ 0.9949190498F, 0.9951528537F, 0.9953786808F, 0.9955967011F,
+ 0.9958070836F, 0.9960099963F, 0.9962056061F, 0.9963940787F,
+ 0.9965755786F, 0.9967502693F, 0.9969183129F, 0.9970798704F,
+ 0.9972351013F, 0.9973841640F, 0.9975272151F, 0.9976644103F,
+ 0.9977959036F, 0.9979218476F, 0.9980423932F, 0.9981576901F,
+ 0.9982678862F, 0.9983731278F, 0.9984735596F, 0.9985693247F,
+ 0.9986605645F, 0.9987474186F, 0.9988300248F, 0.9989085193F,
+ 0.9989830364F, 0.9990537085F, 0.9991206662F, 0.9991840382F,
+ 0.9992439513F, 0.9993005303F, 0.9993538982F, 0.9994041757F,
+ 0.9994514817F, 0.9994959330F, 0.9995376444F, 0.9995767286F,
+ 0.9996132960F, 0.9996474550F, 0.9996793121F, 0.9997089710F,
+ 0.9997365339F, 0.9997621003F, 0.9997857677F, 0.9998076311F,
+ 0.9998277836F, 0.9998463156F, 0.9998633155F, 0.9998788692F,
+ 0.9998930603F, 0.9999059701F, 0.9999176774F, 0.9999282586F,
+ 0.9999377880F, 0.9999463370F, 0.9999539749F, 0.9999607685F,
+ 0.9999667820F, 0.9999720773F, 0.9999767136F, 0.9999807479F,
+ 0.9999842344F, 0.9999872249F, 0.9999897688F, 0.9999919127F,
+ 0.9999937009F, 0.9999951749F, 0.9999963738F, 0.9999973342F,
+ 0.9999980900F, 0.9999986724F, 0.9999991103F, 0.9999994297F,
+ 0.9999996543F, 0.9999998049F, 0.9999999000F, 0.9999999552F,
+ 0.9999999836F, 0.9999999957F, 0.9999999994F, 1.0000000000F,
+};
+
+static const float vwin2048[1024] = {
+ 0.0000009241F, 0.0000083165F, 0.0000231014F, 0.0000452785F,
+ 0.0000748476F, 0.0001118085F, 0.0001561608F, 0.0002079041F,
+ 0.0002670379F, 0.0003335617F, 0.0004074748F, 0.0004887765F,
+ 0.0005774661F, 0.0006735427F, 0.0007770054F, 0.0008878533F,
+ 0.0010060853F, 0.0011317002F, 0.0012646969F, 0.0014050742F,
+ 0.0015528307F, 0.0017079650F, 0.0018704756F, 0.0020403610F,
+ 0.0022176196F, 0.0024022497F, 0.0025942495F, 0.0027936173F,
+ 0.0030003511F, 0.0032144490F, 0.0034359088F, 0.0036647286F,
+ 0.0039009061F, 0.0041444391F, 0.0043953253F, 0.0046535621F,
+ 0.0049191472F, 0.0051920781F, 0.0054723520F, 0.0057599664F,
+ 0.0060549184F, 0.0063572052F, 0.0066668239F, 0.0069837715F,
+ 0.0073080449F, 0.0076396410F, 0.0079785566F, 0.0083247884F,
+ 0.0086783330F, 0.0090391871F, 0.0094073470F, 0.0097828092F,
+ 0.0101655700F, 0.0105556258F, 0.0109529726F, 0.0113576065F,
+ 0.0117695237F, 0.0121887200F, 0.0126151913F, 0.0130489335F,
+ 0.0134899422F, 0.0139382130F, 0.0143937415F, 0.0148565233F,
+ 0.0153265536F, 0.0158038279F, 0.0162883413F, 0.0167800889F,
+ 0.0172790660F, 0.0177852675F, 0.0182986882F, 0.0188193231F,
+ 0.0193471668F, 0.0198822141F, 0.0204244594F, 0.0209738974F,
+ 0.0215305225F, 0.0220943289F, 0.0226653109F, 0.0232434627F,
+ 0.0238287784F, 0.0244212519F, 0.0250208772F, 0.0256276481F,
+ 0.0262415582F, 0.0268626014F, 0.0274907711F, 0.0281260608F,
+ 0.0287684638F, 0.0294179736F, 0.0300745833F, 0.0307382859F,
+ 0.0314090747F, 0.0320869424F, 0.0327718819F, 0.0334638860F,
+ 0.0341629474F, 0.0348690586F, 0.0355822122F, 0.0363024004F,
+ 0.0370296157F, 0.0377638502F, 0.0385050960F, 0.0392533451F,
+ 0.0400085896F, 0.0407708211F, 0.0415400315F, 0.0423162123F,
+ 0.0430993552F, 0.0438894515F, 0.0446864926F, 0.0454904698F,
+ 0.0463013742F, 0.0471191969F, 0.0479439288F, 0.0487755607F,
+ 0.0496140836F, 0.0504594879F, 0.0513117642F, 0.0521709031F,
+ 0.0530368949F, 0.0539097297F, 0.0547893979F, 0.0556758894F,
+ 0.0565691941F, 0.0574693019F, 0.0583762026F, 0.0592898858F,
+ 0.0602103410F, 0.0611375576F, 0.0620715250F, 0.0630122324F,
+ 0.0639596688F, 0.0649138234F, 0.0658746848F, 0.0668422421F,
+ 0.0678164838F, 0.0687973985F, 0.0697849746F, 0.0707792005F,
+ 0.0717800645F, 0.0727875547F, 0.0738016591F, 0.0748223656F,
+ 0.0758496620F, 0.0768835359F, 0.0779239751F, 0.0789709668F,
+ 0.0800244985F, 0.0810845574F, 0.0821511306F, 0.0832242052F,
+ 0.0843037679F, 0.0853898056F, 0.0864823050F, 0.0875812525F,
+ 0.0886866347F, 0.0897984378F, 0.0909166480F, 0.0920412513F,
+ 0.0931722338F, 0.0943095813F, 0.0954532795F, 0.0966033140F,
+ 0.0977596702F, 0.0989223336F, 0.1000912894F, 0.1012665227F,
+ 0.1024480185F, 0.1036357616F, 0.1048297369F, 0.1060299290F,
+ 0.1072363224F, 0.1084489014F, 0.1096676504F, 0.1108925534F,
+ 0.1121235946F, 0.1133607577F, 0.1146040267F, 0.1158533850F,
+ 0.1171088163F, 0.1183703040F, 0.1196378312F, 0.1209113812F,
+ 0.1221909370F, 0.1234764815F, 0.1247679974F, 0.1260654674F,
+ 0.1273688740F, 0.1286781995F, 0.1299934263F, 0.1313145365F,
+ 0.1326415121F, 0.1339743349F, 0.1353129866F, 0.1366574490F,
+ 0.1380077035F, 0.1393637315F, 0.1407255141F, 0.1420930325F,
+ 0.1434662677F, 0.1448452004F, 0.1462298115F, 0.1476200814F,
+ 0.1490159906F, 0.1504175195F, 0.1518246482F, 0.1532373569F,
+ 0.1546556253F, 0.1560794333F, 0.1575087606F, 0.1589435866F,
+ 0.1603838909F, 0.1618296526F, 0.1632808509F, 0.1647374648F,
+ 0.1661994731F, 0.1676668546F, 0.1691395880F, 0.1706176516F,
+ 0.1721010238F, 0.1735896829F, 0.1750836068F, 0.1765827736F,
+ 0.1780871610F, 0.1795967468F, 0.1811115084F, 0.1826314234F,
+ 0.1841564689F, 0.1856866221F, 0.1872218600F, 0.1887621595F,
+ 0.1903074974F, 0.1918578503F, 0.1934131947F, 0.1949735068F,
+ 0.1965387630F, 0.1981089393F, 0.1996840117F, 0.2012639560F,
+ 0.2028487479F, 0.2044383630F, 0.2060327766F, 0.2076319642F,
+ 0.2092359007F, 0.2108445614F, 0.2124579211F, 0.2140759545F,
+ 0.2156986364F, 0.2173259411F, 0.2189578432F, 0.2205943168F,
+ 0.2222353361F, 0.2238808751F, 0.2255309076F, 0.2271854073F,
+ 0.2288443480F, 0.2305077030F, 0.2321754457F, 0.2338475493F,
+ 0.2355239869F, 0.2372047315F, 0.2388897560F, 0.2405790329F,
+ 0.2422725350F, 0.2439702347F, 0.2456721043F, 0.2473781159F,
+ 0.2490882418F, 0.2508024539F, 0.2525207240F, 0.2542430237F,
+ 0.2559693248F, 0.2576995986F, 0.2594338166F, 0.2611719498F,
+ 0.2629139695F, 0.2646598466F, 0.2664095520F, 0.2681630564F,
+ 0.2699203304F, 0.2716813445F, 0.2734460691F, 0.2752144744F,
+ 0.2769865307F, 0.2787622079F, 0.2805414760F, 0.2823243047F,
+ 0.2841106637F, 0.2859005227F, 0.2876938509F, 0.2894906179F,
+ 0.2912907928F, 0.2930943447F, 0.2949012426F, 0.2967114554F,
+ 0.2985249520F, 0.3003417009F, 0.3021616708F, 0.3039848301F,
+ 0.3058111471F, 0.3076405901F, 0.3094731273F, 0.3113087266F,
+ 0.3131473560F, 0.3149889833F, 0.3168335762F, 0.3186811024F,
+ 0.3205315294F, 0.3223848245F, 0.3242409552F, 0.3260998886F,
+ 0.3279615918F, 0.3298260319F, 0.3316931758F, 0.3335629903F,
+ 0.3354354423F, 0.3373104982F, 0.3391881247F, 0.3410682882F,
+ 0.3429509551F, 0.3448360917F, 0.3467236642F, 0.3486136387F,
+ 0.3505059811F, 0.3524006575F, 0.3542976336F, 0.3561968753F,
+ 0.3580983482F, 0.3600020179F, 0.3619078499F, 0.3638158096F,
+ 0.3657258625F, 0.3676379737F, 0.3695521086F, 0.3714682321F,
+ 0.3733863094F, 0.3753063055F, 0.3772281852F, 0.3791519134F,
+ 0.3810774548F, 0.3830047742F, 0.3849338362F, 0.3868646053F,
+ 0.3887970459F, 0.3907311227F, 0.3926667998F, 0.3946040417F,
+ 0.3965428125F, 0.3984830765F, 0.4004247978F, 0.4023679403F,
+ 0.4043124683F, 0.4062583455F, 0.4082055359F, 0.4101540034F,
+ 0.4121037117F, 0.4140546246F, 0.4160067058F, 0.4179599190F,
+ 0.4199142277F, 0.4218695956F, 0.4238259861F, 0.4257833627F,
+ 0.4277416888F, 0.4297009279F, 0.4316610433F, 0.4336219983F,
+ 0.4355837562F, 0.4375462803F, 0.4395095337F, 0.4414734797F,
+ 0.4434380815F, 0.4454033021F, 0.4473691046F, 0.4493354521F,
+ 0.4513023078F, 0.4532696345F, 0.4552373954F, 0.4572055533F,
+ 0.4591740713F, 0.4611429123F, 0.4631120393F, 0.4650814151F,
+ 0.4670510028F, 0.4690207650F, 0.4709906649F, 0.4729606651F,
+ 0.4749307287F, 0.4769008185F, 0.4788708972F, 0.4808409279F,
+ 0.4828108732F, 0.4847806962F, 0.4867503597F, 0.4887198264F,
+ 0.4906890593F, 0.4926580213F, 0.4946266753F, 0.4965949840F,
+ 0.4985629105F, 0.5005304176F, 0.5024974683F, 0.5044640255F,
+ 0.5064300522F, 0.5083955114F, 0.5103603659F, 0.5123245790F,
+ 0.5142881136F, 0.5162509328F, 0.5182129997F, 0.5201742774F,
+ 0.5221347290F, 0.5240943178F, 0.5260530070F, 0.5280107598F,
+ 0.5299675395F, 0.5319233095F, 0.5338780330F, 0.5358316736F,
+ 0.5377841946F, 0.5397355596F, 0.5416857320F, 0.5436346755F,
+ 0.5455823538F, 0.5475287304F, 0.5494737691F, 0.5514174337F,
+ 0.5533596881F, 0.5553004962F, 0.5572398218F, 0.5591776291F,
+ 0.5611138821F, 0.5630485449F, 0.5649815818F, 0.5669129570F,
+ 0.5688426349F, 0.5707705799F, 0.5726967564F, 0.5746211290F,
+ 0.5765436624F, 0.5784643212F, 0.5803830702F, 0.5822998743F,
+ 0.5842146984F, 0.5861275076F, 0.5880382669F, 0.5899469416F,
+ 0.5918534968F, 0.5937578981F, 0.5956601107F, 0.5975601004F,
+ 0.5994578326F, 0.6013532732F, 0.6032463880F, 0.6051371429F,
+ 0.6070255039F, 0.6089114372F, 0.6107949090F, 0.6126758856F,
+ 0.6145543334F, 0.6164302191F, 0.6183035092F, 0.6201741706F,
+ 0.6220421700F, 0.6239074745F, 0.6257700513F, 0.6276298674F,
+ 0.6294868903F, 0.6313410873F, 0.6331924262F, 0.6350408745F,
+ 0.6368864001F, 0.6387289710F, 0.6405685552F, 0.6424051209F,
+ 0.6442386364F, 0.6460690702F, 0.6478963910F, 0.6497205673F,
+ 0.6515415682F, 0.6533593625F, 0.6551739194F, 0.6569852082F,
+ 0.6587931984F, 0.6605978593F, 0.6623991609F, 0.6641970728F,
+ 0.6659915652F, 0.6677826081F, 0.6695701718F, 0.6713542268F,
+ 0.6731347437F, 0.6749116932F, 0.6766850461F, 0.6784547736F,
+ 0.6802208469F, 0.6819832374F, 0.6837419164F, 0.6854968559F,
+ 0.6872480275F, 0.6889954034F, 0.6907389556F, 0.6924786566F,
+ 0.6942144788F, 0.6959463950F, 0.6976743780F, 0.6993984008F,
+ 0.7011184365F, 0.7028344587F, 0.7045464407F, 0.7062543564F,
+ 0.7079581796F, 0.7096578844F, 0.7113534450F, 0.7130448359F,
+ 0.7147320316F, 0.7164150070F, 0.7180937371F, 0.7197681970F,
+ 0.7214383620F, 0.7231042077F, 0.7247657098F, 0.7264228443F,
+ 0.7280755871F, 0.7297239147F, 0.7313678035F, 0.7330072301F,
+ 0.7346421715F, 0.7362726046F, 0.7378985069F, 0.7395198556F,
+ 0.7411366285F, 0.7427488034F, 0.7443563584F, 0.7459592717F,
+ 0.7475575218F, 0.7491510873F, 0.7507399471F, 0.7523240803F,
+ 0.7539034661F, 0.7554780839F, 0.7570479136F, 0.7586129349F,
+ 0.7601731279F, 0.7617284730F, 0.7632789506F, 0.7648245416F,
+ 0.7663652267F, 0.7679009872F, 0.7694318044F, 0.7709576599F,
+ 0.7724785354F, 0.7739944130F, 0.7755052749F, 0.7770111035F,
+ 0.7785118815F, 0.7800075916F, 0.7814982170F, 0.7829837410F,
+ 0.7844641472F, 0.7859394191F, 0.7874095408F, 0.7888744965F,
+ 0.7903342706F, 0.7917888476F, 0.7932382124F, 0.7946823501F,
+ 0.7961212460F, 0.7975548855F, 0.7989832544F, 0.8004063386F,
+ 0.8018241244F, 0.8032365981F, 0.8046437463F, 0.8060455560F,
+ 0.8074420141F, 0.8088331080F, 0.8102188253F, 0.8115991536F,
+ 0.8129740810F, 0.8143435957F, 0.8157076861F, 0.8170663409F,
+ 0.8184195489F, 0.8197672994F, 0.8211095817F, 0.8224463853F,
+ 0.8237777001F, 0.8251035161F, 0.8264238235F, 0.8277386129F,
+ 0.8290478750F, 0.8303516008F, 0.8316497814F, 0.8329424083F,
+ 0.8342294731F, 0.8355109677F, 0.8367868841F, 0.8380572148F,
+ 0.8393219523F, 0.8405810893F, 0.8418346190F, 0.8430825345F,
+ 0.8443248294F, 0.8455614974F, 0.8467925323F, 0.8480179285F,
+ 0.8492376802F, 0.8504517822F, 0.8516602292F, 0.8528630164F,
+ 0.8540601391F, 0.8552515928F, 0.8564373733F, 0.8576174766F,
+ 0.8587918990F, 0.8599606368F, 0.8611236868F, 0.8622810460F,
+ 0.8634327113F, 0.8645786802F, 0.8657189504F, 0.8668535195F,
+ 0.8679823857F, 0.8691055472F, 0.8702230025F, 0.8713347503F,
+ 0.8724407896F, 0.8735411194F, 0.8746357394F, 0.8757246489F,
+ 0.8768078479F, 0.8778853364F, 0.8789571146F, 0.8800231832F,
+ 0.8810835427F, 0.8821381942F, 0.8831871387F, 0.8842303777F,
+ 0.8852679127F, 0.8862997456F, 0.8873258784F, 0.8883463132F,
+ 0.8893610527F, 0.8903700994F, 0.8913734562F, 0.8923711263F,
+ 0.8933631129F, 0.8943494196F, 0.8953300500F, 0.8963050083F,
+ 0.8972742985F, 0.8982379249F, 0.8991958922F, 0.9001482052F,
+ 0.9010948688F, 0.9020358883F, 0.9029712690F, 0.9039010165F,
+ 0.9048251367F, 0.9057436357F, 0.9066565195F, 0.9075637946F,
+ 0.9084654678F, 0.9093615456F, 0.9102520353F, 0.9111369440F,
+ 0.9120162792F, 0.9128900484F, 0.9137582595F, 0.9146209204F,
+ 0.9154780394F, 0.9163296248F, 0.9171756853F, 0.9180162296F,
+ 0.9188512667F, 0.9196808057F, 0.9205048559F, 0.9213234270F,
+ 0.9221365285F, 0.9229441704F, 0.9237463629F, 0.9245431160F,
+ 0.9253344404F, 0.9261203465F, 0.9269008453F, 0.9276759477F,
+ 0.9284456648F, 0.9292100080F, 0.9299689889F, 0.9307226190F,
+ 0.9314709103F, 0.9322138747F, 0.9329515245F, 0.9336838721F,
+ 0.9344109300F, 0.9351327108F, 0.9358492275F, 0.9365604931F,
+ 0.9372665208F, 0.9379673239F, 0.9386629160F, 0.9393533107F,
+ 0.9400385220F, 0.9407185637F, 0.9413934501F, 0.9420631954F,
+ 0.9427278141F, 0.9433873208F, 0.9440417304F, 0.9446910576F,
+ 0.9453353176F, 0.9459745255F, 0.9466086968F, 0.9472378469F,
+ 0.9478619915F, 0.9484811463F, 0.9490953274F, 0.9497045506F,
+ 0.9503088323F, 0.9509081888F, 0.9515026365F, 0.9520921921F,
+ 0.9526768723F, 0.9532566940F, 0.9538316742F, 0.9544018300F,
+ 0.9549671786F, 0.9555277375F, 0.9560835241F, 0.9566345562F,
+ 0.9571808513F, 0.9577224275F, 0.9582593027F, 0.9587914949F,
+ 0.9593190225F, 0.9598419038F, 0.9603601571F, 0.9608738012F,
+ 0.9613828546F, 0.9618873361F, 0.9623872646F, 0.9628826591F,
+ 0.9633735388F, 0.9638599227F, 0.9643418303F, 0.9648192808F,
+ 0.9652922939F, 0.9657608890F, 0.9662250860F, 0.9666849046F,
+ 0.9671403646F, 0.9675914861F, 0.9680382891F, 0.9684807937F,
+ 0.9689190202F, 0.9693529890F, 0.9697827203F, 0.9702082347F,
+ 0.9706295529F, 0.9710466953F, 0.9714596828F, 0.9718685362F,
+ 0.9722732762F, 0.9726739240F, 0.9730705005F, 0.9734630267F,
+ 0.9738515239F, 0.9742360134F, 0.9746165163F, 0.9749930540F,
+ 0.9753656481F, 0.9757343198F, 0.9760990909F, 0.9764599829F,
+ 0.9768170175F, 0.9771702164F, 0.9775196013F, 0.9778651941F,
+ 0.9782070167F, 0.9785450909F, 0.9788794388F, 0.9792100824F,
+ 0.9795370437F, 0.9798603449F, 0.9801800080F, 0.9804960554F,
+ 0.9808085092F, 0.9811173916F, 0.9814227251F, 0.9817245318F,
+ 0.9820228343F, 0.9823176549F, 0.9826090160F, 0.9828969402F,
+ 0.9831814498F, 0.9834625674F, 0.9837403156F, 0.9840147169F,
+ 0.9842857939F, 0.9845535692F, 0.9848180654F, 0.9850793052F,
+ 0.9853373113F, 0.9855921062F, 0.9858437127F, 0.9860921535F,
+ 0.9863374512F, 0.9865796287F, 0.9868187085F, 0.9870547136F,
+ 0.9872876664F, 0.9875175899F, 0.9877445067F, 0.9879684396F,
+ 0.9881894112F, 0.9884074444F, 0.9886225619F, 0.9888347863F,
+ 0.9890441404F, 0.9892506468F, 0.9894543284F, 0.9896552077F,
+ 0.9898533074F, 0.9900486502F, 0.9902412587F, 0.9904311555F,
+ 0.9906183633F, 0.9908029045F, 0.9909848019F, 0.9911640779F,
+ 0.9913407550F, 0.9915148557F, 0.9916864025F, 0.9918554179F,
+ 0.9920219241F, 0.9921859437F, 0.9923474989F, 0.9925066120F,
+ 0.9926633054F, 0.9928176012F, 0.9929695218F, 0.9931190891F,
+ 0.9932663254F, 0.9934112527F, 0.9935538932F, 0.9936942686F,
+ 0.9938324012F, 0.9939683126F, 0.9941020248F, 0.9942335597F,
+ 0.9943629388F, 0.9944901841F, 0.9946153170F, 0.9947383593F,
+ 0.9948593325F, 0.9949782579F, 0.9950951572F, 0.9952100516F,
+ 0.9953229625F, 0.9954339111F, 0.9955429186F, 0.9956500062F,
+ 0.9957551948F, 0.9958585056F, 0.9959599593F, 0.9960595769F,
+ 0.9961573792F, 0.9962533869F, 0.9963476206F, 0.9964401009F,
+ 0.9965308483F, 0.9966198833F, 0.9967072261F, 0.9967928971F,
+ 0.9968769164F, 0.9969593041F, 0.9970400804F, 0.9971192651F,
+ 0.9971968781F, 0.9972729391F, 0.9973474680F, 0.9974204842F,
+ 0.9974920074F, 0.9975620569F, 0.9976306521F, 0.9976978122F,
+ 0.9977635565F, 0.9978279039F, 0.9978908736F, 0.9979524842F,
+ 0.9980127547F, 0.9980717037F, 0.9981293499F, 0.9981857116F,
+ 0.9982408073F, 0.9982946554F, 0.9983472739F, 0.9983986810F,
+ 0.9984488947F, 0.9984979328F, 0.9985458132F, 0.9985925534F,
+ 0.9986381711F, 0.9986826838F, 0.9987261086F, 0.9987684630F,
+ 0.9988097640F, 0.9988500286F, 0.9988892738F, 0.9989275163F,
+ 0.9989647727F, 0.9990010597F, 0.9990363938F, 0.9990707911F,
+ 0.9991042679F, 0.9991368404F, 0.9991685244F, 0.9991993358F,
+ 0.9992292905F, 0.9992584038F, 0.9992866914F, 0.9993141686F,
+ 0.9993408506F, 0.9993667526F, 0.9993918895F, 0.9994162761F,
+ 0.9994399273F, 0.9994628576F, 0.9994850815F, 0.9995066133F,
+ 0.9995274672F, 0.9995476574F, 0.9995671978F, 0.9995861021F,
+ 0.9996043841F, 0.9996220573F, 0.9996391352F, 0.9996556310F,
+ 0.9996715579F, 0.9996869288F, 0.9997017568F, 0.9997160543F,
+ 0.9997298342F, 0.9997431088F, 0.9997558905F, 0.9997681914F,
+ 0.9997800236F, 0.9997913990F, 0.9998023292F, 0.9998128261F,
+ 0.9998229009F, 0.9998325650F, 0.9998418296F, 0.9998507058F,
+ 0.9998592044F, 0.9998673362F, 0.9998751117F, 0.9998825415F,
+ 0.9998896358F, 0.9998964047F, 0.9999028584F, 0.9999090066F,
+ 0.9999148590F, 0.9999204253F, 0.9999257148F, 0.9999307368F,
+ 0.9999355003F, 0.9999400144F, 0.9999442878F, 0.9999483293F,
+ 0.9999521472F, 0.9999557499F, 0.9999591457F, 0.9999623426F,
+ 0.9999653483F, 0.9999681708F, 0.9999708175F, 0.9999732959F,
+ 0.9999756132F, 0.9999777765F, 0.9999797928F, 0.9999816688F,
+ 0.9999834113F, 0.9999850266F, 0.9999865211F, 0.9999879009F,
+ 0.9999891721F, 0.9999903405F, 0.9999914118F, 0.9999923914F,
+ 0.9999932849F, 0.9999940972F, 0.9999948336F, 0.9999954989F,
+ 0.9999960978F, 0.9999966349F, 0.9999971146F, 0.9999975411F,
+ 0.9999979185F, 0.9999982507F, 0.9999985414F, 0.9999987944F,
+ 0.9999990129F, 0.9999992003F, 0.9999993596F, 0.9999994939F,
+ 0.9999996059F, 0.9999996981F, 0.9999997732F, 0.9999998333F,
+ 0.9999998805F, 0.9999999170F, 0.9999999444F, 0.9999999643F,
+ 0.9999999784F, 0.9999999878F, 0.9999999937F, 0.9999999972F,
+ 0.9999999990F, 0.9999999997F, 1.0000000000F, 1.0000000000F,
+};
+
+static const float vwin4096[2048] = {
+ 0.0000002310F, 0.0000020791F, 0.0000057754F, 0.0000113197F,
+ 0.0000187121F, 0.0000279526F, 0.0000390412F, 0.0000519777F,
+ 0.0000667623F, 0.0000833949F, 0.0001018753F, 0.0001222036F,
+ 0.0001443798F, 0.0001684037F, 0.0001942754F, 0.0002219947F,
+ 0.0002515616F, 0.0002829761F, 0.0003162380F, 0.0003513472F,
+ 0.0003883038F, 0.0004271076F, 0.0004677584F, 0.0005102563F,
+ 0.0005546011F, 0.0006007928F, 0.0006488311F, 0.0006987160F,
+ 0.0007504474F, 0.0008040251F, 0.0008594490F, 0.0009167191F,
+ 0.0009758351F, 0.0010367969F, 0.0010996044F, 0.0011642574F,
+ 0.0012307558F, 0.0012990994F, 0.0013692880F, 0.0014413216F,
+ 0.0015151998F, 0.0015909226F, 0.0016684898F, 0.0017479011F,
+ 0.0018291565F, 0.0019122556F, 0.0019971983F, 0.0020839845F,
+ 0.0021726138F, 0.0022630861F, 0.0023554012F, 0.0024495588F,
+ 0.0025455588F, 0.0026434008F, 0.0027430847F, 0.0028446103F,
+ 0.0029479772F, 0.0030531853F, 0.0031602342F, 0.0032691238F,
+ 0.0033798538F, 0.0034924239F, 0.0036068338F, 0.0037230833F,
+ 0.0038411721F, 0.0039610999F, 0.0040828664F, 0.0042064714F,
+ 0.0043319145F, 0.0044591954F, 0.0045883139F, 0.0047192696F,
+ 0.0048520622F, 0.0049866914F, 0.0051231569F, 0.0052614583F,
+ 0.0054015953F, 0.0055435676F, 0.0056873748F, 0.0058330166F,
+ 0.0059804926F, 0.0061298026F, 0.0062809460F, 0.0064339226F,
+ 0.0065887320F, 0.0067453738F, 0.0069038476F, 0.0070641531F,
+ 0.0072262899F, 0.0073902575F, 0.0075560556F, 0.0077236838F,
+ 0.0078931417F, 0.0080644288F, 0.0082375447F, 0.0084124891F,
+ 0.0085892615F, 0.0087678614F, 0.0089482885F, 0.0091305422F,
+ 0.0093146223F, 0.0095005281F, 0.0096882592F, 0.0098778153F,
+ 0.0100691958F, 0.0102624002F, 0.0104574281F, 0.0106542791F,
+ 0.0108529525F, 0.0110534480F, 0.0112557651F, 0.0114599032F,
+ 0.0116658618F, 0.0118736405F, 0.0120832387F, 0.0122946560F,
+ 0.0125078917F, 0.0127229454F, 0.0129398166F, 0.0131585046F,
+ 0.0133790090F, 0.0136013292F, 0.0138254647F, 0.0140514149F,
+ 0.0142791792F, 0.0145087572F, 0.0147401481F, 0.0149733515F,
+ 0.0152083667F, 0.0154451932F, 0.0156838304F, 0.0159242777F,
+ 0.0161665345F, 0.0164106001F, 0.0166564741F, 0.0169041557F,
+ 0.0171536443F, 0.0174049393F, 0.0176580401F, 0.0179129461F,
+ 0.0181696565F, 0.0184281708F, 0.0186884883F, 0.0189506084F,
+ 0.0192145303F, 0.0194802535F, 0.0197477772F, 0.0200171008F,
+ 0.0202882236F, 0.0205611449F, 0.0208358639F, 0.0211123801F,
+ 0.0213906927F, 0.0216708011F, 0.0219527043F, 0.0222364019F,
+ 0.0225218930F, 0.0228091769F, 0.0230982529F, 0.0233891203F,
+ 0.0236817782F, 0.0239762259F, 0.0242724628F, 0.0245704880F,
+ 0.0248703007F, 0.0251719002F, 0.0254752858F, 0.0257804565F,
+ 0.0260874117F, 0.0263961506F, 0.0267066722F, 0.0270189760F,
+ 0.0273330609F, 0.0276489263F, 0.0279665712F, 0.0282859949F,
+ 0.0286071966F, 0.0289301753F, 0.0292549303F, 0.0295814607F,
+ 0.0299097656F, 0.0302398442F, 0.0305716957F, 0.0309053191F,
+ 0.0312407135F, 0.0315778782F, 0.0319168122F, 0.0322575145F,
+ 0.0325999844F, 0.0329442209F, 0.0332902231F, 0.0336379900F,
+ 0.0339875208F, 0.0343388146F, 0.0346918703F, 0.0350466871F,
+ 0.0354032640F, 0.0357616000F, 0.0361216943F, 0.0364835458F,
+ 0.0368471535F, 0.0372125166F, 0.0375796339F, 0.0379485046F,
+ 0.0383191276F, 0.0386915020F, 0.0390656267F, 0.0394415008F,
+ 0.0398191231F, 0.0401984927F, 0.0405796086F, 0.0409624698F,
+ 0.0413470751F, 0.0417334235F, 0.0421215141F, 0.0425113457F,
+ 0.0429029172F, 0.0432962277F, 0.0436912760F, 0.0440880610F,
+ 0.0444865817F, 0.0448868370F, 0.0452888257F, 0.0456925468F,
+ 0.0460979992F, 0.0465051816F, 0.0469140931F, 0.0473247325F,
+ 0.0477370986F, 0.0481511902F, 0.0485670064F, 0.0489845458F,
+ 0.0494038074F, 0.0498247899F, 0.0502474922F, 0.0506719131F,
+ 0.0510980514F, 0.0515259060F, 0.0519554756F, 0.0523867590F,
+ 0.0528197550F, 0.0532544624F, 0.0536908800F, 0.0541290066F,
+ 0.0545688408F, 0.0550103815F, 0.0554536274F, 0.0558985772F,
+ 0.0563452297F, 0.0567935837F, 0.0572436377F, 0.0576953907F,
+ 0.0581488412F, 0.0586039880F, 0.0590608297F, 0.0595193651F,
+ 0.0599795929F, 0.0604415117F, 0.0609051202F, 0.0613704170F,
+ 0.0618374009F, 0.0623060704F, 0.0627764243F, 0.0632484611F,
+ 0.0637221795F, 0.0641975781F, 0.0646746555F, 0.0651534104F,
+ 0.0656338413F, 0.0661159469F, 0.0665997257F, 0.0670851763F,
+ 0.0675722973F, 0.0680610873F, 0.0685515448F, 0.0690436684F,
+ 0.0695374567F, 0.0700329081F, 0.0705300213F, 0.0710287947F,
+ 0.0715292269F, 0.0720313163F, 0.0725350616F, 0.0730404612F,
+ 0.0735475136F, 0.0740562172F, 0.0745665707F, 0.0750785723F,
+ 0.0755922207F, 0.0761075143F, 0.0766244515F, 0.0771430307F,
+ 0.0776632505F, 0.0781851092F, 0.0787086052F, 0.0792337371F,
+ 0.0797605032F, 0.0802889018F, 0.0808189315F, 0.0813505905F,
+ 0.0818838773F, 0.0824187903F, 0.0829553277F, 0.0834934881F,
+ 0.0840332697F, 0.0845746708F, 0.0851176899F, 0.0856623252F,
+ 0.0862085751F, 0.0867564379F, 0.0873059119F, 0.0878569954F,
+ 0.0884096867F, 0.0889639840F, 0.0895198858F, 0.0900773902F,
+ 0.0906364955F, 0.0911972000F, 0.0917595019F, 0.0923233995F,
+ 0.0928888909F, 0.0934559745F, 0.0940246485F, 0.0945949110F,
+ 0.0951667604F, 0.0957401946F, 0.0963152121F, 0.0968918109F,
+ 0.0974699893F, 0.0980497454F, 0.0986310773F, 0.0992139832F,
+ 0.0997984614F, 0.1003845098F, 0.1009721267F, 0.1015613101F,
+ 0.1021520582F, 0.1027443692F, 0.1033382410F, 0.1039336718F,
+ 0.1045306597F, 0.1051292027F, 0.1057292990F, 0.1063309466F,
+ 0.1069341435F, 0.1075388878F, 0.1081451776F, 0.1087530108F,
+ 0.1093623856F, 0.1099732998F, 0.1105857516F, 0.1111997389F,
+ 0.1118152597F, 0.1124323121F, 0.1130508939F, 0.1136710032F,
+ 0.1142926379F, 0.1149157960F, 0.1155404755F, 0.1161666742F,
+ 0.1167943901F, 0.1174236211F, 0.1180543652F, 0.1186866202F,
+ 0.1193203841F, 0.1199556548F, 0.1205924300F, 0.1212307078F,
+ 0.1218704860F, 0.1225117624F, 0.1231545349F, 0.1237988013F,
+ 0.1244445596F, 0.1250918074F, 0.1257405427F, 0.1263907632F,
+ 0.1270424667F, 0.1276956512F, 0.1283503142F, 0.1290064537F,
+ 0.1296640674F, 0.1303231530F, 0.1309837084F, 0.1316457312F,
+ 0.1323092193F, 0.1329741703F, 0.1336405820F, 0.1343084520F,
+ 0.1349777782F, 0.1356485582F, 0.1363207897F, 0.1369944704F,
+ 0.1376695979F, 0.1383461700F, 0.1390241842F, 0.1397036384F,
+ 0.1403845300F, 0.1410668567F, 0.1417506162F, 0.1424358061F,
+ 0.1431224240F, 0.1438104674F, 0.1444999341F, 0.1451908216F,
+ 0.1458831274F, 0.1465768492F, 0.1472719844F, 0.1479685308F,
+ 0.1486664857F, 0.1493658468F, 0.1500666115F, 0.1507687775F,
+ 0.1514723422F, 0.1521773031F, 0.1528836577F, 0.1535914035F,
+ 0.1543005380F, 0.1550110587F, 0.1557229631F, 0.1564362485F,
+ 0.1571509124F, 0.1578669524F, 0.1585843657F, 0.1593031499F,
+ 0.1600233024F, 0.1607448205F, 0.1614677017F, 0.1621919433F,
+ 0.1629175428F, 0.1636444975F, 0.1643728047F, 0.1651024619F,
+ 0.1658334665F, 0.1665658156F, 0.1672995067F, 0.1680345371F,
+ 0.1687709041F, 0.1695086050F, 0.1702476372F, 0.1709879978F,
+ 0.1717296843F, 0.1724726938F, 0.1732170237F, 0.1739626711F,
+ 0.1747096335F, 0.1754579079F, 0.1762074916F, 0.1769583819F,
+ 0.1777105760F, 0.1784640710F, 0.1792188642F, 0.1799749529F,
+ 0.1807323340F, 0.1814910049F, 0.1822509628F, 0.1830122046F,
+ 0.1837747277F, 0.1845385292F, 0.1853036062F, 0.1860699558F,
+ 0.1868375751F, 0.1876064613F, 0.1883766114F, 0.1891480226F,
+ 0.1899206919F, 0.1906946164F, 0.1914697932F, 0.1922462194F,
+ 0.1930238919F, 0.1938028079F, 0.1945829643F, 0.1953643583F,
+ 0.1961469868F, 0.1969308468F, 0.1977159353F, 0.1985022494F,
+ 0.1992897859F, 0.2000785420F, 0.2008685145F, 0.2016597005F,
+ 0.2024520968F, 0.2032457005F, 0.2040405084F, 0.2048365175F,
+ 0.2056337247F, 0.2064321269F, 0.2072317211F, 0.2080325041F,
+ 0.2088344727F, 0.2096376240F, 0.2104419547F, 0.2112474618F,
+ 0.2120541420F, 0.2128619923F, 0.2136710094F, 0.2144811902F,
+ 0.2152925315F, 0.2161050301F, 0.2169186829F, 0.2177334866F,
+ 0.2185494381F, 0.2193665340F, 0.2201847712F, 0.2210041465F,
+ 0.2218246565F, 0.2226462981F, 0.2234690680F, 0.2242929629F,
+ 0.2251179796F, 0.2259441147F, 0.2267713650F, 0.2275997272F,
+ 0.2284291979F, 0.2292597739F, 0.2300914518F, 0.2309242283F,
+ 0.2317581001F, 0.2325930638F, 0.2334291160F, 0.2342662534F,
+ 0.2351044727F, 0.2359437703F, 0.2367841431F, 0.2376255875F,
+ 0.2384681001F, 0.2393116776F, 0.2401563165F, 0.2410020134F,
+ 0.2418487649F, 0.2426965675F, 0.2435454178F, 0.2443953122F,
+ 0.2452462474F, 0.2460982199F, 0.2469512262F, 0.2478052628F,
+ 0.2486603262F, 0.2495164129F, 0.2503735194F, 0.2512316421F,
+ 0.2520907776F, 0.2529509222F, 0.2538120726F, 0.2546742250F,
+ 0.2555373760F, 0.2564015219F, 0.2572666593F, 0.2581327845F,
+ 0.2589998939F, 0.2598679840F, 0.2607370510F, 0.2616070916F,
+ 0.2624781019F, 0.2633500783F, 0.2642230173F, 0.2650969152F,
+ 0.2659717684F, 0.2668475731F, 0.2677243257F, 0.2686020226F,
+ 0.2694806601F, 0.2703602344F, 0.2712407419F, 0.2721221789F,
+ 0.2730045417F, 0.2738878265F, 0.2747720297F, 0.2756571474F,
+ 0.2765431760F, 0.2774301117F, 0.2783179508F, 0.2792066895F,
+ 0.2800963240F, 0.2809868505F, 0.2818782654F, 0.2827705647F,
+ 0.2836637447F, 0.2845578016F, 0.2854527315F, 0.2863485307F,
+ 0.2872451953F, 0.2881427215F, 0.2890411055F, 0.2899403433F,
+ 0.2908404312F, 0.2917413654F, 0.2926431418F, 0.2935457567F,
+ 0.2944492061F, 0.2953534863F, 0.2962585932F, 0.2971645230F,
+ 0.2980712717F, 0.2989788356F, 0.2998872105F, 0.3007963927F,
+ 0.3017063781F, 0.3026171629F, 0.3035287430F, 0.3044411145F,
+ 0.3053542736F, 0.3062682161F, 0.3071829381F, 0.3080984356F,
+ 0.3090147047F, 0.3099317413F, 0.3108495414F, 0.3117681011F,
+ 0.3126874163F, 0.3136074830F, 0.3145282972F, 0.3154498548F,
+ 0.3163721517F, 0.3172951841F, 0.3182189477F, 0.3191434385F,
+ 0.3200686525F, 0.3209945856F, 0.3219212336F, 0.3228485927F,
+ 0.3237766585F, 0.3247054271F, 0.3256348943F, 0.3265650560F,
+ 0.3274959081F, 0.3284274465F, 0.3293596671F, 0.3302925657F,
+ 0.3312261382F, 0.3321603804F, 0.3330952882F, 0.3340308574F,
+ 0.3349670838F, 0.3359039634F, 0.3368414919F, 0.3377796651F,
+ 0.3387184789F, 0.3396579290F, 0.3405980113F, 0.3415387216F,
+ 0.3424800556F, 0.3434220091F, 0.3443645779F, 0.3453077578F,
+ 0.3462515446F, 0.3471959340F, 0.3481409217F, 0.3490865036F,
+ 0.3500326754F, 0.3509794328F, 0.3519267715F, 0.3528746873F,
+ 0.3538231759F, 0.3547722330F, 0.3557218544F, 0.3566720357F,
+ 0.3576227727F, 0.3585740610F, 0.3595258964F, 0.3604782745F,
+ 0.3614311910F, 0.3623846417F, 0.3633386221F, 0.3642931280F,
+ 0.3652481549F, 0.3662036987F, 0.3671597548F, 0.3681163191F,
+ 0.3690733870F, 0.3700309544F, 0.3709890167F, 0.3719475696F,
+ 0.3729066089F, 0.3738661299F, 0.3748261285F, 0.3757866002F,
+ 0.3767475406F, 0.3777089453F, 0.3786708100F, 0.3796331302F,
+ 0.3805959014F, 0.3815591194F, 0.3825227796F, 0.3834868777F,
+ 0.3844514093F, 0.3854163698F, 0.3863817549F, 0.3873475601F,
+ 0.3883137810F, 0.3892804131F, 0.3902474521F, 0.3912148933F,
+ 0.3921827325F, 0.3931509650F, 0.3941195865F, 0.3950885925F,
+ 0.3960579785F, 0.3970277400F, 0.3979978725F, 0.3989683716F,
+ 0.3999392328F, 0.4009104516F, 0.4018820234F, 0.4028539438F,
+ 0.4038262084F, 0.4047988125F, 0.4057717516F, 0.4067450214F,
+ 0.4077186172F, 0.4086925345F, 0.4096667688F, 0.4106413155F,
+ 0.4116161703F, 0.4125913284F, 0.4135667854F, 0.4145425368F,
+ 0.4155185780F, 0.4164949044F, 0.4174715116F, 0.4184483949F,
+ 0.4194255498F, 0.4204029718F, 0.4213806563F, 0.4223585987F,
+ 0.4233367946F, 0.4243152392F, 0.4252939281F, 0.4262728566F,
+ 0.4272520202F, 0.4282314144F, 0.4292110345F, 0.4301908760F,
+ 0.4311709343F, 0.4321512047F, 0.4331316828F, 0.4341123639F,
+ 0.4350932435F, 0.4360743168F, 0.4370555794F, 0.4380370267F,
+ 0.4390186540F, 0.4400004567F, 0.4409824303F, 0.4419645701F,
+ 0.4429468716F, 0.4439293300F, 0.4449119409F, 0.4458946996F,
+ 0.4468776014F, 0.4478606418F, 0.4488438162F, 0.4498271199F,
+ 0.4508105483F, 0.4517940967F, 0.4527777607F, 0.4537615355F,
+ 0.4547454165F, 0.4557293991F, 0.4567134786F, 0.4576976505F,
+ 0.4586819101F, 0.4596662527F, 0.4606506738F, 0.4616351687F,
+ 0.4626197328F, 0.4636043614F, 0.4645890499F, 0.4655737936F,
+ 0.4665585880F, 0.4675434284F, 0.4685283101F, 0.4695132286F,
+ 0.4704981791F, 0.4714831570F, 0.4724681577F, 0.4734531766F,
+ 0.4744382089F, 0.4754232501F, 0.4764082956F, 0.4773933406F,
+ 0.4783783806F, 0.4793634108F, 0.4803484267F, 0.4813334237F,
+ 0.4823183969F, 0.4833033419F, 0.4842882540F, 0.4852731285F,
+ 0.4862579608F, 0.4872427462F, 0.4882274802F, 0.4892121580F,
+ 0.4901967751F, 0.4911813267F, 0.4921658083F, 0.4931502151F,
+ 0.4941345427F, 0.4951187863F, 0.4961029412F, 0.4970870029F,
+ 0.4980709667F, 0.4990548280F, 0.5000385822F, 0.5010222245F,
+ 0.5020057505F, 0.5029891553F, 0.5039724345F, 0.5049555834F,
+ 0.5059385973F, 0.5069214716F, 0.5079042018F, 0.5088867831F,
+ 0.5098692110F, 0.5108514808F, 0.5118335879F, 0.5128155277F,
+ 0.5137972956F, 0.5147788869F, 0.5157602971F, 0.5167415215F,
+ 0.5177225555F, 0.5187033945F, 0.5196840339F, 0.5206644692F,
+ 0.5216446956F, 0.5226247086F, 0.5236045035F, 0.5245840759F,
+ 0.5255634211F, 0.5265425344F, 0.5275214114F, 0.5285000474F,
+ 0.5294784378F, 0.5304565781F, 0.5314344637F, 0.5324120899F,
+ 0.5333894522F, 0.5343665461F, 0.5353433670F, 0.5363199102F,
+ 0.5372961713F, 0.5382721457F, 0.5392478287F, 0.5402232159F,
+ 0.5411983027F, 0.5421730845F, 0.5431475569F, 0.5441217151F,
+ 0.5450955548F, 0.5460690714F, 0.5470422602F, 0.5480151169F,
+ 0.5489876368F, 0.5499598155F, 0.5509316484F, 0.5519031310F,
+ 0.5528742587F, 0.5538450271F, 0.5548154317F, 0.5557854680F,
+ 0.5567551314F, 0.5577244174F, 0.5586933216F, 0.5596618395F,
+ 0.5606299665F, 0.5615976983F, 0.5625650302F, 0.5635319580F,
+ 0.5644984770F, 0.5654645828F, 0.5664302709F, 0.5673955370F,
+ 0.5683603765F, 0.5693247850F, 0.5702887580F, 0.5712522912F,
+ 0.5722153800F, 0.5731780200F, 0.5741402069F, 0.5751019362F,
+ 0.5760632034F, 0.5770240042F, 0.5779843341F, 0.5789441889F,
+ 0.5799035639F, 0.5808624549F, 0.5818208575F, 0.5827787673F,
+ 0.5837361800F, 0.5846930910F, 0.5856494961F, 0.5866053910F,
+ 0.5875607712F, 0.5885156324F, 0.5894699703F, 0.5904237804F,
+ 0.5913770586F, 0.5923298004F, 0.5932820016F, 0.5942336578F,
+ 0.5951847646F, 0.5961353179F, 0.5970853132F, 0.5980347464F,
+ 0.5989836131F, 0.5999319090F, 0.6008796298F, 0.6018267713F,
+ 0.6027733292F, 0.6037192993F, 0.6046646773F, 0.6056094589F,
+ 0.6065536400F, 0.6074972162F, 0.6084401833F, 0.6093825372F,
+ 0.6103242736F, 0.6112653884F, 0.6122058772F, 0.6131457359F,
+ 0.6140849604F, 0.6150235464F, 0.6159614897F, 0.6168987862F,
+ 0.6178354318F, 0.6187714223F, 0.6197067535F, 0.6206414213F,
+ 0.6215754215F, 0.6225087501F, 0.6234414028F, 0.6243733757F,
+ 0.6253046646F, 0.6262352654F, 0.6271651739F, 0.6280943862F,
+ 0.6290228982F, 0.6299507057F, 0.6308778048F, 0.6318041913F,
+ 0.6327298612F, 0.6336548105F, 0.6345790352F, 0.6355025312F,
+ 0.6364252945F, 0.6373473211F, 0.6382686070F, 0.6391891483F,
+ 0.6401089409F, 0.6410279808F, 0.6419462642F, 0.6428637869F,
+ 0.6437805452F, 0.6446965350F, 0.6456117524F, 0.6465261935F,
+ 0.6474398544F, 0.6483527311F, 0.6492648197F, 0.6501761165F,
+ 0.6510866174F, 0.6519963186F, 0.6529052162F, 0.6538133064F,
+ 0.6547205854F, 0.6556270492F, 0.6565326941F, 0.6574375162F,
+ 0.6583415117F, 0.6592446769F, 0.6601470079F, 0.6610485009F,
+ 0.6619491521F, 0.6628489578F, 0.6637479143F, 0.6646460177F,
+ 0.6655432643F, 0.6664396505F, 0.6673351724F, 0.6682298264F,
+ 0.6691236087F, 0.6700165157F, 0.6709085436F, 0.6717996889F,
+ 0.6726899478F, 0.6735793167F, 0.6744677918F, 0.6753553697F,
+ 0.6762420466F, 0.6771278190F, 0.6780126832F, 0.6788966357F,
+ 0.6797796728F, 0.6806617909F, 0.6815429866F, 0.6824232562F,
+ 0.6833025961F, 0.6841810030F, 0.6850584731F, 0.6859350031F,
+ 0.6868105894F, 0.6876852284F, 0.6885589168F, 0.6894316510F,
+ 0.6903034275F, 0.6911742430F, 0.6920440939F, 0.6929129769F,
+ 0.6937808884F, 0.6946478251F, 0.6955137837F, 0.6963787606F,
+ 0.6972427525F, 0.6981057560F, 0.6989677678F, 0.6998287845F,
+ 0.7006888028F, 0.7015478194F, 0.7024058309F, 0.7032628340F,
+ 0.7041188254F, 0.7049738019F, 0.7058277601F, 0.7066806969F,
+ 0.7075326089F, 0.7083834929F, 0.7092333457F, 0.7100821640F,
+ 0.7109299447F, 0.7117766846F, 0.7126223804F, 0.7134670291F,
+ 0.7143106273F, 0.7151531721F, 0.7159946602F, 0.7168350885F,
+ 0.7176744539F, 0.7185127534F, 0.7193499837F, 0.7201861418F,
+ 0.7210212247F, 0.7218552293F, 0.7226881526F, 0.7235199914F,
+ 0.7243507428F, 0.7251804039F, 0.7260089715F, 0.7268364426F,
+ 0.7276628144F, 0.7284880839F, 0.7293122481F, 0.7301353040F,
+ 0.7309572487F, 0.7317780794F, 0.7325977930F, 0.7334163868F,
+ 0.7342338579F, 0.7350502033F, 0.7358654202F, 0.7366795059F,
+ 0.7374924573F, 0.7383042718F, 0.7391149465F, 0.7399244787F,
+ 0.7407328655F, 0.7415401041F, 0.7423461920F, 0.7431511261F,
+ 0.7439549040F, 0.7447575227F, 0.7455589797F, 0.7463592723F,
+ 0.7471583976F, 0.7479563532F, 0.7487531363F, 0.7495487443F,
+ 0.7503431745F, 0.7511364244F, 0.7519284913F, 0.7527193726F,
+ 0.7535090658F, 0.7542975683F, 0.7550848776F, 0.7558709910F,
+ 0.7566559062F, 0.7574396205F, 0.7582221314F, 0.7590034366F,
+ 0.7597835334F, 0.7605624194F, 0.7613400923F, 0.7621165495F,
+ 0.7628917886F, 0.7636658072F, 0.7644386030F, 0.7652101735F,
+ 0.7659805164F, 0.7667496292F, 0.7675175098F, 0.7682841556F,
+ 0.7690495645F, 0.7698137341F, 0.7705766622F, 0.7713383463F,
+ 0.7720987844F, 0.7728579741F, 0.7736159132F, 0.7743725994F,
+ 0.7751280306F, 0.7758822046F, 0.7766351192F, 0.7773867722F,
+ 0.7781371614F, 0.7788862848F, 0.7796341401F, 0.7803807253F,
+ 0.7811260383F, 0.7818700769F, 0.7826128392F, 0.7833543230F,
+ 0.7840945263F, 0.7848334471F, 0.7855710833F, 0.7863074330F,
+ 0.7870424941F, 0.7877762647F, 0.7885087428F, 0.7892399264F,
+ 0.7899698137F, 0.7906984026F, 0.7914256914F, 0.7921516780F,
+ 0.7928763607F, 0.7935997375F, 0.7943218065F, 0.7950425661F,
+ 0.7957620142F, 0.7964801492F, 0.7971969692F, 0.7979124724F,
+ 0.7986266570F, 0.7993395214F, 0.8000510638F, 0.8007612823F,
+ 0.8014701754F, 0.8021777413F, 0.8028839784F, 0.8035888849F,
+ 0.8042924592F, 0.8049946997F, 0.8056956048F, 0.8063951727F,
+ 0.8070934020F, 0.8077902910F, 0.8084858381F, 0.8091800419F,
+ 0.8098729007F, 0.8105644130F, 0.8112545774F, 0.8119433922F,
+ 0.8126308561F, 0.8133169676F, 0.8140017251F, 0.8146851272F,
+ 0.8153671726F, 0.8160478598F, 0.8167271874F, 0.8174051539F,
+ 0.8180817582F, 0.8187569986F, 0.8194308741F, 0.8201033831F,
+ 0.8207745244F, 0.8214442966F, 0.8221126986F, 0.8227797290F,
+ 0.8234453865F, 0.8241096700F, 0.8247725781F, 0.8254341097F,
+ 0.8260942636F, 0.8267530385F, 0.8274104334F, 0.8280664470F,
+ 0.8287210782F, 0.8293743259F, 0.8300261889F, 0.8306766662F,
+ 0.8313257566F, 0.8319734591F, 0.8326197727F, 0.8332646963F,
+ 0.8339082288F, 0.8345503692F, 0.8351911167F, 0.8358304700F,
+ 0.8364684284F, 0.8371049907F, 0.8377401562F, 0.8383739238F,
+ 0.8390062927F, 0.8396372618F, 0.8402668305F, 0.8408949977F,
+ 0.8415217626F, 0.8421471245F, 0.8427710823F, 0.8433936354F,
+ 0.8440147830F, 0.8446345242F, 0.8452528582F, 0.8458697844F,
+ 0.8464853020F, 0.8470994102F, 0.8477121084F, 0.8483233958F,
+ 0.8489332718F, 0.8495417356F, 0.8501487866F, 0.8507544243F,
+ 0.8513586479F, 0.8519614568F, 0.8525628505F, 0.8531628283F,
+ 0.8537613897F, 0.8543585341F, 0.8549542611F, 0.8555485699F,
+ 0.8561414603F, 0.8567329315F, 0.8573229832F, 0.8579116149F,
+ 0.8584988262F, 0.8590846165F, 0.8596689855F, 0.8602519327F,
+ 0.8608334577F, 0.8614135603F, 0.8619922399F, 0.8625694962F,
+ 0.8631453289F, 0.8637197377F, 0.8642927222F, 0.8648642821F,
+ 0.8654344172F, 0.8660031272F, 0.8665704118F, 0.8671362708F,
+ 0.8677007039F, 0.8682637109F, 0.8688252917F, 0.8693854460F,
+ 0.8699441737F, 0.8705014745F, 0.8710573485F, 0.8716117953F,
+ 0.8721648150F, 0.8727164073F, 0.8732665723F, 0.8738153098F,
+ 0.8743626197F, 0.8749085021F, 0.8754529569F, 0.8759959840F,
+ 0.8765375835F, 0.8770777553F, 0.8776164996F, 0.8781538162F,
+ 0.8786897054F, 0.8792241670F, 0.8797572013F, 0.8802888082F,
+ 0.8808189880F, 0.8813477407F, 0.8818750664F, 0.8824009653F,
+ 0.8829254375F, 0.8834484833F, 0.8839701028F, 0.8844902961F,
+ 0.8850090636F, 0.8855264054F, 0.8860423218F, 0.8865568131F,
+ 0.8870698794F, 0.8875815212F, 0.8880917386F, 0.8886005319F,
+ 0.8891079016F, 0.8896138479F, 0.8901183712F, 0.8906214719F,
+ 0.8911231503F, 0.8916234067F, 0.8921222417F, 0.8926196556F,
+ 0.8931156489F, 0.8936102219F, 0.8941033752F, 0.8945951092F,
+ 0.8950854244F, 0.8955743212F, 0.8960618003F, 0.8965478621F,
+ 0.8970325071F, 0.8975157359F, 0.8979975490F, 0.8984779471F,
+ 0.8989569307F, 0.8994345004F, 0.8999106568F, 0.9003854005F,
+ 0.9008587323F, 0.9013306526F, 0.9018011623F, 0.9022702619F,
+ 0.9027379521F, 0.9032042337F, 0.9036691074F, 0.9041325739F,
+ 0.9045946339F, 0.9050552882F, 0.9055145376F, 0.9059723828F,
+ 0.9064288246F, 0.9068838638F, 0.9073375013F, 0.9077897379F,
+ 0.9082405743F, 0.9086900115F, 0.9091380503F, 0.9095846917F,
+ 0.9100299364F, 0.9104737854F, 0.9109162397F, 0.9113573001F,
+ 0.9117969675F, 0.9122352430F, 0.9126721275F, 0.9131076219F,
+ 0.9135417273F, 0.9139744447F, 0.9144057750F, 0.9148357194F,
+ 0.9152642787F, 0.9156914542F, 0.9161172468F, 0.9165416576F,
+ 0.9169646877F, 0.9173863382F, 0.9178066102F, 0.9182255048F,
+ 0.9186430232F, 0.9190591665F, 0.9194739359F, 0.9198873324F,
+ 0.9202993574F, 0.9207100120F, 0.9211192973F, 0.9215272147F,
+ 0.9219337653F, 0.9223389504F, 0.9227427713F, 0.9231452290F,
+ 0.9235463251F, 0.9239460607F, 0.9243444371F, 0.9247414557F,
+ 0.9251371177F, 0.9255314245F, 0.9259243774F, 0.9263159778F,
+ 0.9267062270F, 0.9270951264F, 0.9274826774F, 0.9278688814F,
+ 0.9282537398F, 0.9286372540F, 0.9290194254F, 0.9294002555F,
+ 0.9297797458F, 0.9301578976F, 0.9305347125F, 0.9309101919F,
+ 0.9312843373F, 0.9316571503F, 0.9320286323F, 0.9323987849F,
+ 0.9327676097F, 0.9331351080F, 0.9335012816F, 0.9338661320F,
+ 0.9342296607F, 0.9345918694F, 0.9349527596F, 0.9353123330F,
+ 0.9356705911F, 0.9360275357F, 0.9363831683F, 0.9367374905F,
+ 0.9370905042F, 0.9374422108F, 0.9377926122F, 0.9381417099F,
+ 0.9384895057F, 0.9388360014F, 0.9391811985F, 0.9395250989F,
+ 0.9398677043F, 0.9402090165F, 0.9405490371F, 0.9408877680F,
+ 0.9412252110F, 0.9415613678F, 0.9418962402F, 0.9422298301F,
+ 0.9425621392F, 0.9428931695F, 0.9432229226F, 0.9435514005F,
+ 0.9438786050F, 0.9442045381F, 0.9445292014F, 0.9448525971F,
+ 0.9451747268F, 0.9454955926F, 0.9458151963F, 0.9461335399F,
+ 0.9464506253F, 0.9467664545F, 0.9470810293F, 0.9473943517F,
+ 0.9477064238F, 0.9480172474F, 0.9483268246F, 0.9486351573F,
+ 0.9489422475F, 0.9492480973F, 0.9495527087F, 0.9498560837F,
+ 0.9501582243F, 0.9504591325F, 0.9507588105F, 0.9510572603F,
+ 0.9513544839F, 0.9516504834F, 0.9519452609F, 0.9522388186F,
+ 0.9525311584F, 0.9528222826F, 0.9531121932F, 0.9534008923F,
+ 0.9536883821F, 0.9539746647F, 0.9542597424F, 0.9545436171F,
+ 0.9548262912F, 0.9551077667F, 0.9553880459F, 0.9556671309F,
+ 0.9559450239F, 0.9562217272F, 0.9564972429F, 0.9567715733F,
+ 0.9570447206F, 0.9573166871F, 0.9575874749F, 0.9578570863F,
+ 0.9581255236F, 0.9583927890F, 0.9586588849F, 0.9589238134F,
+ 0.9591875769F, 0.9594501777F, 0.9597116180F, 0.9599719003F,
+ 0.9602310267F, 0.9604889995F, 0.9607458213F, 0.9610014942F,
+ 0.9612560206F, 0.9615094028F, 0.9617616433F, 0.9620127443F,
+ 0.9622627083F, 0.9625115376F, 0.9627592345F, 0.9630058016F,
+ 0.9632512411F, 0.9634955555F, 0.9637387471F, 0.9639808185F,
+ 0.9642217720F, 0.9644616100F, 0.9647003349F, 0.9649379493F,
+ 0.9651744556F, 0.9654098561F, 0.9656441534F, 0.9658773499F,
+ 0.9661094480F, 0.9663404504F, 0.9665703593F, 0.9667991774F,
+ 0.9670269071F, 0.9672535509F, 0.9674791114F, 0.9677035909F,
+ 0.9679269921F, 0.9681493174F, 0.9683705694F, 0.9685907506F,
+ 0.9688098636F, 0.9690279108F, 0.9692448948F, 0.9694608182F,
+ 0.9696756836F, 0.9698894934F, 0.9701022503F, 0.9703139569F,
+ 0.9705246156F, 0.9707342291F, 0.9709428000F, 0.9711503309F,
+ 0.9713568243F, 0.9715622829F, 0.9717667093F, 0.9719701060F,
+ 0.9721724757F, 0.9723738210F, 0.9725741446F, 0.9727734490F,
+ 0.9729717369F, 0.9731690109F, 0.9733652737F, 0.9735605279F,
+ 0.9737547762F, 0.9739480212F, 0.9741402656F, 0.9743315120F,
+ 0.9745217631F, 0.9747110216F, 0.9748992901F, 0.9750865714F,
+ 0.9752728681F, 0.9754581829F, 0.9756425184F, 0.9758258775F,
+ 0.9760082627F, 0.9761896768F, 0.9763701224F, 0.9765496024F,
+ 0.9767281193F, 0.9769056760F, 0.9770822751F, 0.9772579193F,
+ 0.9774326114F, 0.9776063542F, 0.9777791502F, 0.9779510023F,
+ 0.9781219133F, 0.9782918858F, 0.9784609226F, 0.9786290264F,
+ 0.9787962000F, 0.9789624461F, 0.9791277676F, 0.9792921671F,
+ 0.9794556474F, 0.9796182113F, 0.9797798615F, 0.9799406009F,
+ 0.9801004321F, 0.9802593580F, 0.9804173813F, 0.9805745049F,
+ 0.9807307314F, 0.9808860637F, 0.9810405046F, 0.9811940568F,
+ 0.9813467232F, 0.9814985065F, 0.9816494095F, 0.9817994351F,
+ 0.9819485860F, 0.9820968650F, 0.9822442750F, 0.9823908186F,
+ 0.9825364988F, 0.9826813184F, 0.9828252801F, 0.9829683868F,
+ 0.9831106413F, 0.9832520463F, 0.9833926048F, 0.9835323195F,
+ 0.9836711932F, 0.9838092288F, 0.9839464291F, 0.9840827969F,
+ 0.9842183351F, 0.9843530464F, 0.9844869337F, 0.9846199998F,
+ 0.9847522475F, 0.9848836798F, 0.9850142993F, 0.9851441090F,
+ 0.9852731117F, 0.9854013101F, 0.9855287073F, 0.9856553058F,
+ 0.9857811087F, 0.9859061188F, 0.9860303388F, 0.9861537717F,
+ 0.9862764202F, 0.9863982872F, 0.9865193756F, 0.9866396882F,
+ 0.9867592277F, 0.9868779972F, 0.9869959993F, 0.9871132370F,
+ 0.9872297131F, 0.9873454304F, 0.9874603918F, 0.9875746001F,
+ 0.9876880581F, 0.9878007688F, 0.9879127348F, 0.9880239592F,
+ 0.9881344447F, 0.9882441941F, 0.9883532104F, 0.9884614962F,
+ 0.9885690546F, 0.9886758883F, 0.9887820001F, 0.9888873930F,
+ 0.9889920697F, 0.9890960331F, 0.9891992859F, 0.9893018312F,
+ 0.9894036716F, 0.9895048100F, 0.9896052493F, 0.9897049923F,
+ 0.9898040418F, 0.9899024006F, 0.9900000717F, 0.9900970577F,
+ 0.9901933616F, 0.9902889862F, 0.9903839343F, 0.9904782087F,
+ 0.9905718122F, 0.9906647477F, 0.9907570180F, 0.9908486259F,
+ 0.9909395742F, 0.9910298658F, 0.9911195034F, 0.9912084899F,
+ 0.9912968281F, 0.9913845208F, 0.9914715708F, 0.9915579810F,
+ 0.9916437540F, 0.9917288928F, 0.9918134001F, 0.9918972788F,
+ 0.9919805316F, 0.9920631613F, 0.9921451707F, 0.9922265626F,
+ 0.9923073399F, 0.9923875052F, 0.9924670615F, 0.9925460114F,
+ 0.9926243577F, 0.9927021033F, 0.9927792508F, 0.9928558032F,
+ 0.9929317631F, 0.9930071333F, 0.9930819167F, 0.9931561158F,
+ 0.9932297337F, 0.9933027728F, 0.9933752362F, 0.9934471264F,
+ 0.9935184462F, 0.9935891985F, 0.9936593859F, 0.9937290112F,
+ 0.9937980771F, 0.9938665864F, 0.9939345418F, 0.9940019460F,
+ 0.9940688018F, 0.9941351118F, 0.9942008789F, 0.9942661057F,
+ 0.9943307950F, 0.9943949494F, 0.9944585717F, 0.9945216645F,
+ 0.9945842307F, 0.9946462728F, 0.9947077936F, 0.9947687957F,
+ 0.9948292820F, 0.9948892550F, 0.9949487174F, 0.9950076719F,
+ 0.9950661212F, 0.9951240679F, 0.9951815148F, 0.9952384645F,
+ 0.9952949196F, 0.9953508828F, 0.9954063568F, 0.9954613442F,
+ 0.9955158476F, 0.9955698697F, 0.9956234132F, 0.9956764806F,
+ 0.9957290746F, 0.9957811978F, 0.9958328528F, 0.9958840423F,
+ 0.9959347688F, 0.9959850351F, 0.9960348435F, 0.9960841969F,
+ 0.9961330977F, 0.9961815486F, 0.9962295521F, 0.9962771108F,
+ 0.9963242274F, 0.9963709043F, 0.9964171441F, 0.9964629494F,
+ 0.9965083228F, 0.9965532668F, 0.9965977840F, 0.9966418768F,
+ 0.9966855479F, 0.9967287998F, 0.9967716350F, 0.9968140559F,
+ 0.9968560653F, 0.9968976655F, 0.9969388591F, 0.9969796485F,
+ 0.9970200363F, 0.9970600250F, 0.9970996170F, 0.9971388149F,
+ 0.9971776211F, 0.9972160380F, 0.9972540683F, 0.9972917142F,
+ 0.9973289783F, 0.9973658631F, 0.9974023709F, 0.9974385042F,
+ 0.9974742655F, 0.9975096571F, 0.9975446816F, 0.9975793413F,
+ 0.9976136386F, 0.9976475759F, 0.9976811557F, 0.9977143803F,
+ 0.9977472521F, 0.9977797736F, 0.9978119470F, 0.9978437748F,
+ 0.9978752593F, 0.9979064029F, 0.9979372079F, 0.9979676768F,
+ 0.9979978117F, 0.9980276151F, 0.9980570893F, 0.9980862367F,
+ 0.9981150595F, 0.9981435600F, 0.9981717406F, 0.9981996035F,
+ 0.9982271511F, 0.9982543856F, 0.9982813093F, 0.9983079246F,
+ 0.9983342336F, 0.9983602386F, 0.9983859418F, 0.9984113456F,
+ 0.9984364522F, 0.9984612638F, 0.9984857825F, 0.9985100108F,
+ 0.9985339507F, 0.9985576044F, 0.9985809743F, 0.9986040624F,
+ 0.9986268710F, 0.9986494022F, 0.9986716583F, 0.9986936413F,
+ 0.9987153535F, 0.9987367969F, 0.9987579738F, 0.9987788864F,
+ 0.9987995366F, 0.9988199267F, 0.9988400587F, 0.9988599348F,
+ 0.9988795572F, 0.9988989278F, 0.9989180487F, 0.9989369222F,
+ 0.9989555501F, 0.9989739347F, 0.9989920780F, 0.9990099820F,
+ 0.9990276487F, 0.9990450803F, 0.9990622787F, 0.9990792460F,
+ 0.9990959841F, 0.9991124952F, 0.9991287812F, 0.9991448440F,
+ 0.9991606858F, 0.9991763084F, 0.9991917139F, 0.9992069042F,
+ 0.9992218813F, 0.9992366471F, 0.9992512035F, 0.9992655525F,
+ 0.9992796961F, 0.9992936361F, 0.9993073744F, 0.9993209131F,
+ 0.9993342538F, 0.9993473987F, 0.9993603494F, 0.9993731080F,
+ 0.9993856762F, 0.9993980559F, 0.9994102490F, 0.9994222573F,
+ 0.9994340827F, 0.9994457269F, 0.9994571918F, 0.9994684793F,
+ 0.9994795910F, 0.9994905288F, 0.9995012945F, 0.9995118898F,
+ 0.9995223165F, 0.9995325765F, 0.9995426713F, 0.9995526029F,
+ 0.9995623728F, 0.9995719829F, 0.9995814349F, 0.9995907304F,
+ 0.9995998712F, 0.9996088590F, 0.9996176954F, 0.9996263821F,
+ 0.9996349208F, 0.9996433132F, 0.9996515609F, 0.9996596656F,
+ 0.9996676288F, 0.9996754522F, 0.9996831375F, 0.9996906862F,
+ 0.9996981000F, 0.9997053804F, 0.9997125290F, 0.9997195474F,
+ 0.9997264371F, 0.9997331998F, 0.9997398369F, 0.9997463500F,
+ 0.9997527406F, 0.9997590103F, 0.9997651606F, 0.9997711930F,
+ 0.9997771089F, 0.9997829098F, 0.9997885973F, 0.9997941728F,
+ 0.9997996378F, 0.9998049936F, 0.9998102419F, 0.9998153839F,
+ 0.9998204211F, 0.9998253550F, 0.9998301868F, 0.9998349182F,
+ 0.9998395503F, 0.9998440847F, 0.9998485226F, 0.9998528654F,
+ 0.9998571146F, 0.9998612713F, 0.9998653370F, 0.9998693130F,
+ 0.9998732007F, 0.9998770012F, 0.9998807159F, 0.9998843461F,
+ 0.9998878931F, 0.9998913581F, 0.9998947424F, 0.9998980473F,
+ 0.9999012740F, 0.9999044237F, 0.9999074976F, 0.9999104971F,
+ 0.9999134231F, 0.9999162771F, 0.9999190601F, 0.9999217733F,
+ 0.9999244179F, 0.9999269950F, 0.9999295058F, 0.9999319515F,
+ 0.9999343332F, 0.9999366519F, 0.9999389088F, 0.9999411050F,
+ 0.9999432416F, 0.9999453196F, 0.9999473402F, 0.9999493044F,
+ 0.9999512132F, 0.9999530677F, 0.9999548690F, 0.9999566180F,
+ 0.9999583157F, 0.9999599633F, 0.9999615616F, 0.9999631116F,
+ 0.9999646144F, 0.9999660709F, 0.9999674820F, 0.9999688487F,
+ 0.9999701719F, 0.9999714526F, 0.9999726917F, 0.9999738900F,
+ 0.9999750486F, 0.9999761682F, 0.9999772497F, 0.9999782941F,
+ 0.9999793021F, 0.9999802747F, 0.9999812126F, 0.9999821167F,
+ 0.9999829878F, 0.9999838268F, 0.9999846343F, 0.9999854113F,
+ 0.9999861584F, 0.9999868765F, 0.9999875664F, 0.9999882287F,
+ 0.9999888642F, 0.9999894736F, 0.9999900577F, 0.9999906172F,
+ 0.9999911528F, 0.9999916651F, 0.9999921548F, 0.9999926227F,
+ 0.9999930693F, 0.9999934954F, 0.9999939015F, 0.9999942883F,
+ 0.9999946564F, 0.9999950064F, 0.9999953390F, 0.9999956547F,
+ 0.9999959541F, 0.9999962377F, 0.9999965062F, 0.9999967601F,
+ 0.9999969998F, 0.9999972260F, 0.9999974392F, 0.9999976399F,
+ 0.9999978285F, 0.9999980056F, 0.9999981716F, 0.9999983271F,
+ 0.9999984724F, 0.9999986081F, 0.9999987345F, 0.9999988521F,
+ 0.9999989613F, 0.9999990625F, 0.9999991562F, 0.9999992426F,
+ 0.9999993223F, 0.9999993954F, 0.9999994625F, 0.9999995239F,
+ 0.9999995798F, 0.9999996307F, 0.9999996768F, 0.9999997184F,
+ 0.9999997559F, 0.9999997895F, 0.9999998195F, 0.9999998462F,
+ 0.9999998698F, 0.9999998906F, 0.9999999088F, 0.9999999246F,
+ 0.9999999383F, 0.9999999500F, 0.9999999600F, 0.9999999684F,
+ 0.9999999754F, 0.9999999811F, 0.9999999858F, 0.9999999896F,
+ 0.9999999925F, 0.9999999948F, 0.9999999965F, 0.9999999978F,
+ 0.9999999986F, 0.9999999992F, 0.9999999996F, 0.9999999998F,
+ 0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
+};
+
+static const float vwin8192[4096] = {
+ 0.0000000578F, 0.0000005198F, 0.0000014438F, 0.0000028299F,
+ 0.0000046780F, 0.0000069882F, 0.0000097604F, 0.0000129945F,
+ 0.0000166908F, 0.0000208490F, 0.0000254692F, 0.0000305515F,
+ 0.0000360958F, 0.0000421021F, 0.0000485704F, 0.0000555006F,
+ 0.0000628929F, 0.0000707472F, 0.0000790635F, 0.0000878417F,
+ 0.0000970820F, 0.0001067842F, 0.0001169483F, 0.0001275744F,
+ 0.0001386625F, 0.0001502126F, 0.0001622245F, 0.0001746984F,
+ 0.0001876343F, 0.0002010320F, 0.0002148917F, 0.0002292132F,
+ 0.0002439967F, 0.0002592421F, 0.0002749493F, 0.0002911184F,
+ 0.0003077493F, 0.0003248421F, 0.0003423967F, 0.0003604132F,
+ 0.0003788915F, 0.0003978316F, 0.0004172335F, 0.0004370971F,
+ 0.0004574226F, 0.0004782098F, 0.0004994587F, 0.0005211694F,
+ 0.0005433418F, 0.0005659759F, 0.0005890717F, 0.0006126292F,
+ 0.0006366484F, 0.0006611292F, 0.0006860716F, 0.0007114757F,
+ 0.0007373414F, 0.0007636687F, 0.0007904576F, 0.0008177080F,
+ 0.0008454200F, 0.0008735935F, 0.0009022285F, 0.0009313250F,
+ 0.0009608830F, 0.0009909025F, 0.0010213834F, 0.0010523257F,
+ 0.0010837295F, 0.0011155946F, 0.0011479211F, 0.0011807090F,
+ 0.0012139582F, 0.0012476687F, 0.0012818405F, 0.0013164736F,
+ 0.0013515679F, 0.0013871235F, 0.0014231402F, 0.0014596182F,
+ 0.0014965573F, 0.0015339576F, 0.0015718190F, 0.0016101415F,
+ 0.0016489251F, 0.0016881698F, 0.0017278754F, 0.0017680421F,
+ 0.0018086698F, 0.0018497584F, 0.0018913080F, 0.0019333185F,
+ 0.0019757898F, 0.0020187221F, 0.0020621151F, 0.0021059690F,
+ 0.0021502837F, 0.0021950591F, 0.0022402953F, 0.0022859921F,
+ 0.0023321497F, 0.0023787679F, 0.0024258467F, 0.0024733861F,
+ 0.0025213861F, 0.0025698466F, 0.0026187676F, 0.0026681491F,
+ 0.0027179911F, 0.0027682935F, 0.0028190562F, 0.0028702794F,
+ 0.0029219628F, 0.0029741066F, 0.0030267107F, 0.0030797749F,
+ 0.0031332994F, 0.0031872841F, 0.0032417289F, 0.0032966338F,
+ 0.0033519988F, 0.0034078238F, 0.0034641089F, 0.0035208539F,
+ 0.0035780589F, 0.0036357237F, 0.0036938485F, 0.0037524331F,
+ 0.0038114775F, 0.0038709817F, 0.0039309456F, 0.0039913692F,
+ 0.0040522524F, 0.0041135953F, 0.0041753978F, 0.0042376599F,
+ 0.0043003814F, 0.0043635624F, 0.0044272029F, 0.0044913028F,
+ 0.0045558620F, 0.0046208806F, 0.0046863585F, 0.0047522955F,
+ 0.0048186919F, 0.0048855473F, 0.0049528619F, 0.0050206356F,
+ 0.0050888684F, 0.0051575601F, 0.0052267108F, 0.0052963204F,
+ 0.0053663890F, 0.0054369163F, 0.0055079025F, 0.0055793474F,
+ 0.0056512510F, 0.0057236133F, 0.0057964342F, 0.0058697137F,
+ 0.0059434517F, 0.0060176482F, 0.0060923032F, 0.0061674166F,
+ 0.0062429883F, 0.0063190183F, 0.0063955066F, 0.0064724532F,
+ 0.0065498579F, 0.0066277207F, 0.0067060416F, 0.0067848205F,
+ 0.0068640575F, 0.0069437523F, 0.0070239051F, 0.0071045157F,
+ 0.0071855840F, 0.0072671102F, 0.0073490940F, 0.0074315355F,
+ 0.0075144345F, 0.0075977911F, 0.0076816052F, 0.0077658768F,
+ 0.0078506057F, 0.0079357920F, 0.0080214355F, 0.0081075363F,
+ 0.0081940943F, 0.0082811094F, 0.0083685816F, 0.0084565108F,
+ 0.0085448970F, 0.0086337401F, 0.0087230401F, 0.0088127969F,
+ 0.0089030104F, 0.0089936807F, 0.0090848076F, 0.0091763911F,
+ 0.0092684311F, 0.0093609276F, 0.0094538805F, 0.0095472898F,
+ 0.0096411554F, 0.0097354772F, 0.0098302552F, 0.0099254894F,
+ 0.0100211796F, 0.0101173259F, 0.0102139281F, 0.0103109863F,
+ 0.0104085002F, 0.0105064700F, 0.0106048955F, 0.0107037766F,
+ 0.0108031133F, 0.0109029056F, 0.0110031534F, 0.0111038565F,
+ 0.0112050151F, 0.0113066289F, 0.0114086980F, 0.0115112222F,
+ 0.0116142015F, 0.0117176359F, 0.0118215252F, 0.0119258695F,
+ 0.0120306686F, 0.0121359225F, 0.0122416312F, 0.0123477944F,
+ 0.0124544123F, 0.0125614847F, 0.0126690116F, 0.0127769928F,
+ 0.0128854284F, 0.0129943182F, 0.0131036623F, 0.0132134604F,
+ 0.0133237126F, 0.0134344188F, 0.0135455790F, 0.0136571929F,
+ 0.0137692607F, 0.0138817821F, 0.0139947572F, 0.0141081859F,
+ 0.0142220681F, 0.0143364037F, 0.0144511927F, 0.0145664350F,
+ 0.0146821304F, 0.0147982791F, 0.0149148808F, 0.0150319355F,
+ 0.0151494431F, 0.0152674036F, 0.0153858168F, 0.0155046828F,
+ 0.0156240014F, 0.0157437726F, 0.0158639962F, 0.0159846723F,
+ 0.0161058007F, 0.0162273814F, 0.0163494142F, 0.0164718991F,
+ 0.0165948361F, 0.0167182250F, 0.0168420658F, 0.0169663584F,
+ 0.0170911027F, 0.0172162987F, 0.0173419462F, 0.0174680452F,
+ 0.0175945956F, 0.0177215974F, 0.0178490504F, 0.0179769545F,
+ 0.0181053098F, 0.0182341160F, 0.0183633732F, 0.0184930812F,
+ 0.0186232399F, 0.0187538494F, 0.0188849094F, 0.0190164200F,
+ 0.0191483809F, 0.0192807923F, 0.0194136539F, 0.0195469656F,
+ 0.0196807275F, 0.0198149394F, 0.0199496012F, 0.0200847128F,
+ 0.0202202742F, 0.0203562853F, 0.0204927460F, 0.0206296561F,
+ 0.0207670157F, 0.0209048245F, 0.0210430826F, 0.0211817899F,
+ 0.0213209462F, 0.0214605515F, 0.0216006057F, 0.0217411086F,
+ 0.0218820603F, 0.0220234605F, 0.0221653093F, 0.0223076066F,
+ 0.0224503521F, 0.0225935459F, 0.0227371879F, 0.0228812779F,
+ 0.0230258160F, 0.0231708018F, 0.0233162355F, 0.0234621169F,
+ 0.0236084459F, 0.0237552224F, 0.0239024462F, 0.0240501175F,
+ 0.0241982359F, 0.0243468015F, 0.0244958141F, 0.0246452736F,
+ 0.0247951800F, 0.0249455331F, 0.0250963329F, 0.0252475792F,
+ 0.0253992720F, 0.0255514111F, 0.0257039965F, 0.0258570281F,
+ 0.0260105057F, 0.0261644293F, 0.0263187987F, 0.0264736139F,
+ 0.0266288747F, 0.0267845811F, 0.0269407330F, 0.0270973302F,
+ 0.0272543727F, 0.0274118604F, 0.0275697930F, 0.0277281707F,
+ 0.0278869932F, 0.0280462604F, 0.0282059723F, 0.0283661287F,
+ 0.0285267295F, 0.0286877747F, 0.0288492641F, 0.0290111976F,
+ 0.0291735751F, 0.0293363965F, 0.0294996617F, 0.0296633706F,
+ 0.0298275231F, 0.0299921190F, 0.0301571583F, 0.0303226409F,
+ 0.0304885667F, 0.0306549354F, 0.0308217472F, 0.0309890017F,
+ 0.0311566989F, 0.0313248388F, 0.0314934211F, 0.0316624459F,
+ 0.0318319128F, 0.0320018220F, 0.0321721732F, 0.0323429663F,
+ 0.0325142013F, 0.0326858779F, 0.0328579962F, 0.0330305559F,
+ 0.0332035570F, 0.0333769994F, 0.0335508829F, 0.0337252074F,
+ 0.0338999728F, 0.0340751790F, 0.0342508259F, 0.0344269134F,
+ 0.0346034412F, 0.0347804094F, 0.0349578178F, 0.0351356663F,
+ 0.0353139548F, 0.0354926831F, 0.0356718511F, 0.0358514588F,
+ 0.0360315059F, 0.0362119924F, 0.0363929182F, 0.0365742831F,
+ 0.0367560870F, 0.0369383297F, 0.0371210113F, 0.0373041315F,
+ 0.0374876902F, 0.0376716873F, 0.0378561226F, 0.0380409961F,
+ 0.0382263077F, 0.0384120571F, 0.0385982443F, 0.0387848691F,
+ 0.0389719315F, 0.0391594313F, 0.0393473683F, 0.0395357425F,
+ 0.0397245537F, 0.0399138017F, 0.0401034866F, 0.0402936080F,
+ 0.0404841660F, 0.0406751603F, 0.0408665909F, 0.0410584576F,
+ 0.0412507603F, 0.0414434988F, 0.0416366731F, 0.0418302829F,
+ 0.0420243282F, 0.0422188088F, 0.0424137246F, 0.0426090755F,
+ 0.0428048613F, 0.0430010819F, 0.0431977371F, 0.0433948269F,
+ 0.0435923511F, 0.0437903095F, 0.0439887020F, 0.0441875285F,
+ 0.0443867889F, 0.0445864830F, 0.0447866106F, 0.0449871717F,
+ 0.0451881661F, 0.0453895936F, 0.0455914542F, 0.0457937477F,
+ 0.0459964738F, 0.0461996326F, 0.0464032239F, 0.0466072475F,
+ 0.0468117032F, 0.0470165910F, 0.0472219107F, 0.0474276622F,
+ 0.0476338452F, 0.0478404597F, 0.0480475056F, 0.0482549827F,
+ 0.0484628907F, 0.0486712297F, 0.0488799994F, 0.0490891998F,
+ 0.0492988306F, 0.0495088917F, 0.0497193830F, 0.0499303043F,
+ 0.0501416554F, 0.0503534363F, 0.0505656468F, 0.0507782867F,
+ 0.0509913559F, 0.0512048542F, 0.0514187815F, 0.0516331376F,
+ 0.0518479225F, 0.0520631358F, 0.0522787775F, 0.0524948475F,
+ 0.0527113455F, 0.0529282715F, 0.0531456252F, 0.0533634066F,
+ 0.0535816154F, 0.0538002515F, 0.0540193148F, 0.0542388051F,
+ 0.0544587222F, 0.0546790660F, 0.0548998364F, 0.0551210331F,
+ 0.0553426561F, 0.0555647051F, 0.0557871801F, 0.0560100807F,
+ 0.0562334070F, 0.0564571587F, 0.0566813357F, 0.0569059378F,
+ 0.0571309649F, 0.0573564168F, 0.0575822933F, 0.0578085942F,
+ 0.0580353195F, 0.0582624689F, 0.0584900423F, 0.0587180396F,
+ 0.0589464605F, 0.0591753049F, 0.0594045726F, 0.0596342635F,
+ 0.0598643774F, 0.0600949141F, 0.0603258735F, 0.0605572555F,
+ 0.0607890597F, 0.0610212862F, 0.0612539346F, 0.0614870049F,
+ 0.0617204968F, 0.0619544103F, 0.0621887451F, 0.0624235010F,
+ 0.0626586780F, 0.0628942758F, 0.0631302942F, 0.0633667331F,
+ 0.0636035923F, 0.0638408717F, 0.0640785710F, 0.0643166901F,
+ 0.0645552288F, 0.0647941870F, 0.0650335645F, 0.0652733610F,
+ 0.0655135765F, 0.0657542108F, 0.0659952636F, 0.0662367348F,
+ 0.0664786242F, 0.0667209316F, 0.0669636570F, 0.0672068000F,
+ 0.0674503605F, 0.0676943384F, 0.0679387334F, 0.0681835454F,
+ 0.0684287742F, 0.0686744196F, 0.0689204814F, 0.0691669595F,
+ 0.0694138536F, 0.0696611637F, 0.0699088894F, 0.0701570307F,
+ 0.0704055873F, 0.0706545590F, 0.0709039458F, 0.0711537473F,
+ 0.0714039634F, 0.0716545939F, 0.0719056387F, 0.0721570975F,
+ 0.0724089702F, 0.0726612565F, 0.0729139563F, 0.0731670694F,
+ 0.0734205956F, 0.0736745347F, 0.0739288866F, 0.0741836510F,
+ 0.0744388277F, 0.0746944166F, 0.0749504175F, 0.0752068301F,
+ 0.0754636543F, 0.0757208899F, 0.0759785367F, 0.0762365946F,
+ 0.0764950632F, 0.0767539424F, 0.0770132320F, 0.0772729319F,
+ 0.0775330418F, 0.0777935616F, 0.0780544909F, 0.0783158298F,
+ 0.0785775778F, 0.0788397349F, 0.0791023009F, 0.0793652755F,
+ 0.0796286585F, 0.0798924498F, 0.0801566492F, 0.0804212564F,
+ 0.0806862712F, 0.0809516935F, 0.0812175231F, 0.0814837597F,
+ 0.0817504031F, 0.0820174532F, 0.0822849097F, 0.0825527724F,
+ 0.0828210412F, 0.0830897158F, 0.0833587960F, 0.0836282816F,
+ 0.0838981724F, 0.0841684682F, 0.0844391688F, 0.0847102740F,
+ 0.0849817835F, 0.0852536973F, 0.0855260150F, 0.0857987364F,
+ 0.0860718614F, 0.0863453897F, 0.0866193211F, 0.0868936554F,
+ 0.0871683924F, 0.0874435319F, 0.0877190737F, 0.0879950175F,
+ 0.0882713632F, 0.0885481105F, 0.0888252592F, 0.0891028091F,
+ 0.0893807600F, 0.0896591117F, 0.0899378639F, 0.0902170165F,
+ 0.0904965692F, 0.0907765218F, 0.0910568740F, 0.0913376258F,
+ 0.0916187767F, 0.0919003268F, 0.0921822756F, 0.0924646230F,
+ 0.0927473687F, 0.0930305126F, 0.0933140545F, 0.0935979940F,
+ 0.0938823310F, 0.0941670653F, 0.0944521966F, 0.0947377247F,
+ 0.0950236494F, 0.0953099704F, 0.0955966876F, 0.0958838007F,
+ 0.0961713094F, 0.0964592136F, 0.0967475131F, 0.0970362075F,
+ 0.0973252967F, 0.0976147805F, 0.0979046585F, 0.0981949307F,
+ 0.0984855967F, 0.0987766563F, 0.0990681093F, 0.0993599555F,
+ 0.0996521945F, 0.0999448263F, 0.1002378506F, 0.1005312671F,
+ 0.1008250755F, 0.1011192757F, 0.1014138675F, 0.1017088505F,
+ 0.1020042246F, 0.1022999895F, 0.1025961450F, 0.1028926909F,
+ 0.1031896268F, 0.1034869526F, 0.1037846680F, 0.1040827729F,
+ 0.1043812668F, 0.1046801497F, 0.1049794213F, 0.1052790813F,
+ 0.1055791294F, 0.1058795656F, 0.1061803894F, 0.1064816006F,
+ 0.1067831991F, 0.1070851846F, 0.1073875568F, 0.1076903155F,
+ 0.1079934604F, 0.1082969913F, 0.1086009079F, 0.1089052101F,
+ 0.1092098975F, 0.1095149699F, 0.1098204270F, 0.1101262687F,
+ 0.1104324946F, 0.1107391045F, 0.1110460982F, 0.1113534754F,
+ 0.1116612359F, 0.1119693793F, 0.1122779055F, 0.1125868142F,
+ 0.1128961052F, 0.1132057781F, 0.1135158328F, 0.1138262690F,
+ 0.1141370863F, 0.1144482847F, 0.1147598638F, 0.1150718233F,
+ 0.1153841631F, 0.1156968828F, 0.1160099822F, 0.1163234610F,
+ 0.1166373190F, 0.1169515559F, 0.1172661714F, 0.1175811654F,
+ 0.1178965374F, 0.1182122874F, 0.1185284149F, 0.1188449198F,
+ 0.1191618018F, 0.1194790606F, 0.1197966960F, 0.1201147076F,
+ 0.1204330953F, 0.1207518587F, 0.1210709976F, 0.1213905118F,
+ 0.1217104009F, 0.1220306647F, 0.1223513029F, 0.1226723153F,
+ 0.1229937016F, 0.1233154615F, 0.1236375948F, 0.1239601011F,
+ 0.1242829803F, 0.1246062319F, 0.1249298559F, 0.1252538518F,
+ 0.1255782195F, 0.1259029586F, 0.1262280689F, 0.1265535501F,
+ 0.1268794019F, 0.1272056241F, 0.1275322163F, 0.1278591784F,
+ 0.1281865099F, 0.1285142108F, 0.1288422805F, 0.1291707190F,
+ 0.1294995259F, 0.1298287009F, 0.1301582437F, 0.1304881542F,
+ 0.1308184319F, 0.1311490766F, 0.1314800881F, 0.1318114660F,
+ 0.1321432100F, 0.1324753200F, 0.1328077955F, 0.1331406364F,
+ 0.1334738422F, 0.1338074129F, 0.1341413479F, 0.1344756472F,
+ 0.1348103103F, 0.1351453370F, 0.1354807270F, 0.1358164801F,
+ 0.1361525959F, 0.1364890741F, 0.1368259145F, 0.1371631167F,
+ 0.1375006805F, 0.1378386056F, 0.1381768917F, 0.1385155384F,
+ 0.1388545456F, 0.1391939129F, 0.1395336400F, 0.1398737266F,
+ 0.1402141724F, 0.1405549772F, 0.1408961406F, 0.1412376623F,
+ 0.1415795421F, 0.1419217797F, 0.1422643746F, 0.1426073268F,
+ 0.1429506358F, 0.1432943013F, 0.1436383231F, 0.1439827008F,
+ 0.1443274342F, 0.1446725229F, 0.1450179667F, 0.1453637652F,
+ 0.1457099181F, 0.1460564252F, 0.1464032861F, 0.1467505006F,
+ 0.1470980682F, 0.1474459888F, 0.1477942620F, 0.1481428875F,
+ 0.1484918651F, 0.1488411942F, 0.1491908748F, 0.1495409065F,
+ 0.1498912889F, 0.1502420218F, 0.1505931048F, 0.1509445376F,
+ 0.1512963200F, 0.1516484516F, 0.1520009321F, 0.1523537612F,
+ 0.1527069385F, 0.1530604638F, 0.1534143368F, 0.1537685571F,
+ 0.1541231244F, 0.1544780384F, 0.1548332987F, 0.1551889052F,
+ 0.1555448574F, 0.1559011550F, 0.1562577978F, 0.1566147853F,
+ 0.1569721173F, 0.1573297935F, 0.1576878135F, 0.1580461771F,
+ 0.1584048838F, 0.1587639334F, 0.1591233255F, 0.1594830599F,
+ 0.1598431361F, 0.1602035540F, 0.1605643131F, 0.1609254131F,
+ 0.1612868537F, 0.1616486346F, 0.1620107555F, 0.1623732160F,
+ 0.1627360158F, 0.1630991545F, 0.1634626319F, 0.1638264476F,
+ 0.1641906013F, 0.1645550926F, 0.1649199212F, 0.1652850869F,
+ 0.1656505892F, 0.1660164278F, 0.1663826024F, 0.1667491127F,
+ 0.1671159583F, 0.1674831388F, 0.1678506541F, 0.1682185036F,
+ 0.1685866872F, 0.1689552044F, 0.1693240549F, 0.1696932384F,
+ 0.1700627545F, 0.1704326029F, 0.1708027833F, 0.1711732952F,
+ 0.1715441385F, 0.1719153127F, 0.1722868175F, 0.1726586526F,
+ 0.1730308176F, 0.1734033121F, 0.1737761359F, 0.1741492886F,
+ 0.1745227698F, 0.1748965792F, 0.1752707164F, 0.1756451812F,
+ 0.1760199731F, 0.1763950918F, 0.1767705370F, 0.1771463083F,
+ 0.1775224054F, 0.1778988279F, 0.1782755754F, 0.1786526477F,
+ 0.1790300444F, 0.1794077651F, 0.1797858094F, 0.1801641771F,
+ 0.1805428677F, 0.1809218810F, 0.1813012165F, 0.1816808739F,
+ 0.1820608528F, 0.1824411530F, 0.1828217739F, 0.1832027154F,
+ 0.1835839770F, 0.1839655584F, 0.1843474592F, 0.1847296790F,
+ 0.1851122175F, 0.1854950744F, 0.1858782492F, 0.1862617417F,
+ 0.1866455514F, 0.1870296780F, 0.1874141211F, 0.1877988804F,
+ 0.1881839555F, 0.1885693461F, 0.1889550517F, 0.1893410721F,
+ 0.1897274068F, 0.1901140555F, 0.1905010178F, 0.1908882933F,
+ 0.1912758818F, 0.1916637828F, 0.1920519959F, 0.1924405208F,
+ 0.1928293571F, 0.1932185044F, 0.1936079625F, 0.1939977308F,
+ 0.1943878091F, 0.1947781969F, 0.1951688939F, 0.1955598998F,
+ 0.1959512141F, 0.1963428364F, 0.1967347665F, 0.1971270038F,
+ 0.1975195482F, 0.1979123990F, 0.1983055561F, 0.1986990190F,
+ 0.1990927873F, 0.1994868607F, 0.1998812388F, 0.2002759212F,
+ 0.2006709075F, 0.2010661974F, 0.2014617904F, 0.2018576862F,
+ 0.2022538844F, 0.2026503847F, 0.2030471865F, 0.2034442897F,
+ 0.2038416937F, 0.2042393982F, 0.2046374028F, 0.2050357071F,
+ 0.2054343107F, 0.2058332133F, 0.2062324145F, 0.2066319138F,
+ 0.2070317110F, 0.2074318055F, 0.2078321970F, 0.2082328852F,
+ 0.2086338696F, 0.2090351498F, 0.2094367255F, 0.2098385962F,
+ 0.2102407617F, 0.2106432213F, 0.2110459749F, 0.2114490220F,
+ 0.2118523621F, 0.2122559950F, 0.2126599202F, 0.2130641373F,
+ 0.2134686459F, 0.2138734456F, 0.2142785361F, 0.2146839168F,
+ 0.2150895875F, 0.2154955478F, 0.2159017972F, 0.2163083353F,
+ 0.2167151617F, 0.2171222761F, 0.2175296780F, 0.2179373670F,
+ 0.2183453428F, 0.2187536049F, 0.2191621529F, 0.2195709864F,
+ 0.2199801051F, 0.2203895085F, 0.2207991961F, 0.2212091677F,
+ 0.2216194228F, 0.2220299610F, 0.2224407818F, 0.2228518850F,
+ 0.2232632699F, 0.2236749364F, 0.2240868839F, 0.2244991121F,
+ 0.2249116204F, 0.2253244086F, 0.2257374763F, 0.2261508229F,
+ 0.2265644481F, 0.2269783514F, 0.2273925326F, 0.2278069911F,
+ 0.2282217265F, 0.2286367384F, 0.2290520265F, 0.2294675902F,
+ 0.2298834292F, 0.2302995431F, 0.2307159314F, 0.2311325937F,
+ 0.2315495297F, 0.2319667388F, 0.2323842207F, 0.2328019749F,
+ 0.2332200011F, 0.2336382988F, 0.2340568675F, 0.2344757070F,
+ 0.2348948166F, 0.2353141961F, 0.2357338450F, 0.2361537629F,
+ 0.2365739493F, 0.2369944038F, 0.2374151261F, 0.2378361156F,
+ 0.2382573720F, 0.2386788948F, 0.2391006836F, 0.2395227380F,
+ 0.2399450575F, 0.2403676417F, 0.2407904902F, 0.2412136026F,
+ 0.2416369783F, 0.2420606171F, 0.2424845185F, 0.2429086820F,
+ 0.2433331072F, 0.2437577936F, 0.2441827409F, 0.2446079486F,
+ 0.2450334163F, 0.2454591435F, 0.2458851298F, 0.2463113747F,
+ 0.2467378779F, 0.2471646389F, 0.2475916573F, 0.2480189325F,
+ 0.2484464643F, 0.2488742521F, 0.2493022955F, 0.2497305940F,
+ 0.2501591473F, 0.2505879549F, 0.2510170163F, 0.2514463311F,
+ 0.2518758989F, 0.2523057193F, 0.2527357916F, 0.2531661157F,
+ 0.2535966909F, 0.2540275169F, 0.2544585931F, 0.2548899193F,
+ 0.2553214948F, 0.2557533193F, 0.2561853924F, 0.2566177135F,
+ 0.2570502822F, 0.2574830981F, 0.2579161608F, 0.2583494697F,
+ 0.2587830245F, 0.2592168246F, 0.2596508697F, 0.2600851593F,
+ 0.2605196929F, 0.2609544701F, 0.2613894904F, 0.2618247534F,
+ 0.2622602586F, 0.2626960055F, 0.2631319938F, 0.2635682230F,
+ 0.2640046925F, 0.2644414021F, 0.2648783511F, 0.2653155391F,
+ 0.2657529657F, 0.2661906305F, 0.2666285329F, 0.2670666725F,
+ 0.2675050489F, 0.2679436616F, 0.2683825101F, 0.2688215940F,
+ 0.2692609127F, 0.2697004660F, 0.2701402532F, 0.2705802739F,
+ 0.2710205278F, 0.2714610142F, 0.2719017327F, 0.2723426830F,
+ 0.2727838644F, 0.2732252766F, 0.2736669191F, 0.2741087914F,
+ 0.2745508930F, 0.2749932235F, 0.2754357824F, 0.2758785693F,
+ 0.2763215837F, 0.2767648251F, 0.2772082930F, 0.2776519870F,
+ 0.2780959066F, 0.2785400513F, 0.2789844207F, 0.2794290143F,
+ 0.2798738316F, 0.2803188722F, 0.2807641355F, 0.2812096211F,
+ 0.2816553286F, 0.2821012574F, 0.2825474071F, 0.2829937773F,
+ 0.2834403673F, 0.2838871768F, 0.2843342053F, 0.2847814523F,
+ 0.2852289174F, 0.2856765999F, 0.2861244996F, 0.2865726159F,
+ 0.2870209482F, 0.2874694962F, 0.2879182594F, 0.2883672372F,
+ 0.2888164293F, 0.2892658350F, 0.2897154540F, 0.2901652858F,
+ 0.2906153298F, 0.2910655856F, 0.2915160527F, 0.2919667306F,
+ 0.2924176189F, 0.2928687171F, 0.2933200246F, 0.2937715409F,
+ 0.2942232657F, 0.2946751984F, 0.2951273386F, 0.2955796856F,
+ 0.2960322391F, 0.2964849986F, 0.2969379636F, 0.2973911335F,
+ 0.2978445080F, 0.2982980864F, 0.2987518684F, 0.2992058534F,
+ 0.2996600409F, 0.3001144305F, 0.3005690217F, 0.3010238139F,
+ 0.3014788067F, 0.3019339995F, 0.3023893920F, 0.3028449835F,
+ 0.3033007736F, 0.3037567618F, 0.3042129477F, 0.3046693306F,
+ 0.3051259102F, 0.3055826859F, 0.3060396572F, 0.3064968236F,
+ 0.3069541847F, 0.3074117399F, 0.3078694887F, 0.3083274307F,
+ 0.3087855653F, 0.3092438920F, 0.3097024104F, 0.3101611199F,
+ 0.3106200200F, 0.3110791103F, 0.3115383902F, 0.3119978592F,
+ 0.3124575169F, 0.3129173627F, 0.3133773961F, 0.3138376166F,
+ 0.3142980238F, 0.3147586170F, 0.3152193959F, 0.3156803598F,
+ 0.3161415084F, 0.3166028410F, 0.3170643573F, 0.3175260566F,
+ 0.3179879384F, 0.3184500023F, 0.3189122478F, 0.3193746743F,
+ 0.3198372814F, 0.3203000685F, 0.3207630351F, 0.3212261807F,
+ 0.3216895048F, 0.3221530069F, 0.3226166865F, 0.3230805430F,
+ 0.3235445760F, 0.3240087849F, 0.3244731693F, 0.3249377285F,
+ 0.3254024622F, 0.3258673698F, 0.3263324507F, 0.3267977045F,
+ 0.3272631306F, 0.3277287286F, 0.3281944978F, 0.3286604379F,
+ 0.3291265482F, 0.3295928284F, 0.3300592777F, 0.3305258958F,
+ 0.3309926821F, 0.3314596361F, 0.3319267573F, 0.3323940451F,
+ 0.3328614990F, 0.3333291186F, 0.3337969033F, 0.3342648525F,
+ 0.3347329658F, 0.3352012427F, 0.3356696825F, 0.3361382849F,
+ 0.3366070492F, 0.3370759749F, 0.3375450616F, 0.3380143087F,
+ 0.3384837156F, 0.3389532819F, 0.3394230071F, 0.3398928905F,
+ 0.3403629317F, 0.3408331302F, 0.3413034854F, 0.3417739967F,
+ 0.3422446638F, 0.3427154860F, 0.3431864628F, 0.3436575938F,
+ 0.3441288782F, 0.3446003158F, 0.3450719058F, 0.3455436478F,
+ 0.3460155412F, 0.3464875856F, 0.3469597804F, 0.3474321250F,
+ 0.3479046189F, 0.3483772617F, 0.3488500527F, 0.3493229914F,
+ 0.3497960774F, 0.3502693100F, 0.3507426887F, 0.3512162131F,
+ 0.3516898825F, 0.3521636965F, 0.3526376545F, 0.3531117559F,
+ 0.3535860003F, 0.3540603870F, 0.3545349157F, 0.3550095856F,
+ 0.3554843964F, 0.3559593474F, 0.3564344381F, 0.3569096680F,
+ 0.3573850366F, 0.3578605432F, 0.3583361875F, 0.3588119687F,
+ 0.3592878865F, 0.3597639402F, 0.3602401293F, 0.3607164533F,
+ 0.3611929117F, 0.3616695038F, 0.3621462292F, 0.3626230873F,
+ 0.3631000776F, 0.3635771995F, 0.3640544525F, 0.3645318360F,
+ 0.3650093496F, 0.3654869926F, 0.3659647645F, 0.3664426648F,
+ 0.3669206930F, 0.3673988484F, 0.3678771306F, 0.3683555390F,
+ 0.3688340731F, 0.3693127322F, 0.3697915160F, 0.3702704237F,
+ 0.3707494549F, 0.3712286091F, 0.3717078857F, 0.3721872840F,
+ 0.3726668037F, 0.3731464441F, 0.3736262047F, 0.3741060850F,
+ 0.3745860843F, 0.3750662023F, 0.3755464382F, 0.3760267915F,
+ 0.3765072618F, 0.3769878484F, 0.3774685509F, 0.3779493686F,
+ 0.3784303010F, 0.3789113475F, 0.3793925076F, 0.3798737809F,
+ 0.3803551666F, 0.3808366642F, 0.3813182733F, 0.3817999932F,
+ 0.3822818234F, 0.3827637633F, 0.3832458124F, 0.3837279702F,
+ 0.3842102360F, 0.3846926093F, 0.3851750897F, 0.3856576764F,
+ 0.3861403690F, 0.3866231670F, 0.3871060696F, 0.3875890765F,
+ 0.3880721870F, 0.3885554007F, 0.3890387168F, 0.3895221349F,
+ 0.3900056544F, 0.3904892748F, 0.3909729955F, 0.3914568160F,
+ 0.3919407356F, 0.3924247539F, 0.3929088702F, 0.3933930841F,
+ 0.3938773949F, 0.3943618021F, 0.3948463052F, 0.3953309035F,
+ 0.3958155966F, 0.3963003838F, 0.3967852646F, 0.3972702385F,
+ 0.3977553048F, 0.3982404631F, 0.3987257127F, 0.3992110531F,
+ 0.3996964838F, 0.4001820041F, 0.4006676136F, 0.4011533116F,
+ 0.4016390976F, 0.4021249710F, 0.4026109313F, 0.4030969779F,
+ 0.4035831102F, 0.4040693277F, 0.4045556299F, 0.4050420160F,
+ 0.4055284857F, 0.4060150383F, 0.4065016732F, 0.4069883899F,
+ 0.4074751879F, 0.4079620665F, 0.4084490252F, 0.4089360635F,
+ 0.4094231807F, 0.4099103763F, 0.4103976498F, 0.4108850005F,
+ 0.4113724280F, 0.4118599315F, 0.4123475107F, 0.4128351648F,
+ 0.4133228934F, 0.4138106959F, 0.4142985716F, 0.4147865201F,
+ 0.4152745408F, 0.4157626330F, 0.4162507963F, 0.4167390301F,
+ 0.4172273337F, 0.4177157067F, 0.4182041484F, 0.4186926583F,
+ 0.4191812359F, 0.4196698805F, 0.4201585915F, 0.4206473685F,
+ 0.4211362108F, 0.4216251179F, 0.4221140892F, 0.4226031241F,
+ 0.4230922221F, 0.4235813826F, 0.4240706050F, 0.4245598887F,
+ 0.4250492332F, 0.4255386379F, 0.4260281022F, 0.4265176256F,
+ 0.4270072075F, 0.4274968473F, 0.4279865445F, 0.4284762984F,
+ 0.4289661086F, 0.4294559743F, 0.4299458951F, 0.4304358704F,
+ 0.4309258996F, 0.4314159822F, 0.4319061175F, 0.4323963050F,
+ 0.4328865441F, 0.4333768342F, 0.4338671749F, 0.4343575654F,
+ 0.4348480052F, 0.4353384938F, 0.4358290306F, 0.4363196149F,
+ 0.4368102463F, 0.4373009241F, 0.4377916478F, 0.4382824168F,
+ 0.4387732305F, 0.4392640884F, 0.4397549899F, 0.4402459343F,
+ 0.4407369212F, 0.4412279499F, 0.4417190198F, 0.4422101305F,
+ 0.4427012813F, 0.4431924717F, 0.4436837010F, 0.4441749686F,
+ 0.4446662742F, 0.4451576169F, 0.4456489963F, 0.4461404118F,
+ 0.4466318628F, 0.4471233487F, 0.4476148690F, 0.4481064230F,
+ 0.4485980103F, 0.4490896302F, 0.4495812821F, 0.4500729654F,
+ 0.4505646797F, 0.4510564243F, 0.4515481986F, 0.4520400021F,
+ 0.4525318341F, 0.4530236942F, 0.4535155816F, 0.4540074959F,
+ 0.4544994365F, 0.4549914028F, 0.4554833941F, 0.4559754100F,
+ 0.4564674499F, 0.4569595131F, 0.4574515991F, 0.4579437074F,
+ 0.4584358372F, 0.4589279881F, 0.4594201595F, 0.4599123508F,
+ 0.4604045615F, 0.4608967908F, 0.4613890383F, 0.4618813034F,
+ 0.4623735855F, 0.4628658841F, 0.4633581984F, 0.4638505281F,
+ 0.4643428724F, 0.4648352308F, 0.4653276028F, 0.4658199877F,
+ 0.4663123849F, 0.4668047940F, 0.4672972143F, 0.4677896451F,
+ 0.4682820861F, 0.4687745365F, 0.4692669958F, 0.4697594634F,
+ 0.4702519387F, 0.4707444211F, 0.4712369102F, 0.4717294052F,
+ 0.4722219056F, 0.4727144109F, 0.4732069204F, 0.4736994336F,
+ 0.4741919498F, 0.4746844686F, 0.4751769893F, 0.4756695113F,
+ 0.4761620341F, 0.4766545571F, 0.4771470797F, 0.4776396013F,
+ 0.4781321213F, 0.4786246392F, 0.4791171544F, 0.4796096663F,
+ 0.4801021744F, 0.4805946779F, 0.4810871765F, 0.4815796694F,
+ 0.4820721561F, 0.4825646360F, 0.4830571086F, 0.4835495732F,
+ 0.4840420293F, 0.4845344763F, 0.4850269136F, 0.4855193407F,
+ 0.4860117569F, 0.4865041617F, 0.4869965545F, 0.4874889347F,
+ 0.4879813018F, 0.4884736551F, 0.4889659941F, 0.4894583182F,
+ 0.4899506268F, 0.4904429193F, 0.4909351952F, 0.4914274538F,
+ 0.4919196947F, 0.4924119172F, 0.4929041207F, 0.4933963046F,
+ 0.4938884685F, 0.4943806116F, 0.4948727335F, 0.4953648335F,
+ 0.4958569110F, 0.4963489656F, 0.4968409965F, 0.4973330032F,
+ 0.4978249852F, 0.4983169419F, 0.4988088726F, 0.4993007768F,
+ 0.4997926539F, 0.5002845034F, 0.5007763247F, 0.5012681171F,
+ 0.5017598801F, 0.5022516132F, 0.5027433157F, 0.5032349871F,
+ 0.5037266268F, 0.5042182341F, 0.5047098086F, 0.5052013497F,
+ 0.5056928567F, 0.5061843292F, 0.5066757664F, 0.5071671679F,
+ 0.5076585330F, 0.5081498613F, 0.5086411520F, 0.5091324047F,
+ 0.5096236187F, 0.5101147934F, 0.5106059284F, 0.5110970230F,
+ 0.5115880766F, 0.5120790887F, 0.5125700587F, 0.5130609860F,
+ 0.5135518700F, 0.5140427102F, 0.5145335059F, 0.5150242566F,
+ 0.5155149618F, 0.5160056208F, 0.5164962331F, 0.5169867980F,
+ 0.5174773151F, 0.5179677837F, 0.5184582033F, 0.5189485733F,
+ 0.5194388931F, 0.5199291621F, 0.5204193798F, 0.5209095455F,
+ 0.5213996588F, 0.5218897190F, 0.5223797256F, 0.5228696779F,
+ 0.5233595755F, 0.5238494177F, 0.5243392039F, 0.5248289337F,
+ 0.5253186063F, 0.5258082213F, 0.5262977781F, 0.5267872760F,
+ 0.5272767146F, 0.5277660932F, 0.5282554112F, 0.5287446682F,
+ 0.5292338635F, 0.5297229965F, 0.5302120667F, 0.5307010736F,
+ 0.5311900164F, 0.5316788947F, 0.5321677079F, 0.5326564554F,
+ 0.5331451366F, 0.5336337511F, 0.5341222981F, 0.5346107771F,
+ 0.5350991876F, 0.5355875290F, 0.5360758007F, 0.5365640021F,
+ 0.5370521327F, 0.5375401920F, 0.5380281792F, 0.5385160939F,
+ 0.5390039355F, 0.5394917034F, 0.5399793971F, 0.5404670159F,
+ 0.5409545594F, 0.5414420269F, 0.5419294179F, 0.5424167318F,
+ 0.5429039680F, 0.5433911261F, 0.5438782053F, 0.5443652051F,
+ 0.5448521250F, 0.5453389644F, 0.5458257228F, 0.5463123995F,
+ 0.5467989940F, 0.5472855057F, 0.5477719341F, 0.5482582786F,
+ 0.5487445387F, 0.5492307137F, 0.5497168031F, 0.5502028063F,
+ 0.5506887228F, 0.5511745520F, 0.5516602934F, 0.5521459463F,
+ 0.5526315103F, 0.5531169847F, 0.5536023690F, 0.5540876626F,
+ 0.5545728649F, 0.5550579755F, 0.5555429937F, 0.5560279189F,
+ 0.5565127507F, 0.5569974884F, 0.5574821315F, 0.5579666794F,
+ 0.5584511316F, 0.5589354875F, 0.5594197465F, 0.5599039080F,
+ 0.5603879716F, 0.5608719367F, 0.5613558026F, 0.5618395689F,
+ 0.5623232350F, 0.5628068002F, 0.5632902642F, 0.5637736262F,
+ 0.5642568858F, 0.5647400423F, 0.5652230953F, 0.5657060442F,
+ 0.5661888883F, 0.5666716272F, 0.5671542603F, 0.5676367870F,
+ 0.5681192069F, 0.5686015192F, 0.5690837235F, 0.5695658192F,
+ 0.5700478058F, 0.5705296827F, 0.5710114494F, 0.5714931052F,
+ 0.5719746497F, 0.5724560822F, 0.5729374023F, 0.5734186094F,
+ 0.5738997029F, 0.5743806823F, 0.5748615470F, 0.5753422965F,
+ 0.5758229301F, 0.5763034475F, 0.5767838480F, 0.5772641310F,
+ 0.5777442960F, 0.5782243426F, 0.5787042700F, 0.5791840778F,
+ 0.5796637654F, 0.5801433322F, 0.5806227778F, 0.5811021016F,
+ 0.5815813029F, 0.5820603814F, 0.5825393363F, 0.5830181673F,
+ 0.5834968737F, 0.5839754549F, 0.5844539105F, 0.5849322399F,
+ 0.5854104425F, 0.5858885179F, 0.5863664653F, 0.5868442844F,
+ 0.5873219746F, 0.5877995353F, 0.5882769660F, 0.5887542661F,
+ 0.5892314351F, 0.5897084724F, 0.5901853776F, 0.5906621500F,
+ 0.5911387892F, 0.5916152945F, 0.5920916655F, 0.5925679016F,
+ 0.5930440022F, 0.5935199669F, 0.5939957950F, 0.5944714861F,
+ 0.5949470396F, 0.5954224550F, 0.5958977317F, 0.5963728692F,
+ 0.5968478669F, 0.5973227244F, 0.5977974411F, 0.5982720163F,
+ 0.5987464497F, 0.5992207407F, 0.5996948887F, 0.6001688932F,
+ 0.6006427537F, 0.6011164696F, 0.6015900405F, 0.6020634657F,
+ 0.6025367447F, 0.6030098770F, 0.6034828621F, 0.6039556995F,
+ 0.6044283885F, 0.6049009288F, 0.6053733196F, 0.6058455606F,
+ 0.6063176512F, 0.6067895909F, 0.6072613790F, 0.6077330152F,
+ 0.6082044989F, 0.6086758295F, 0.6091470065F, 0.6096180294F,
+ 0.6100888977F, 0.6105596108F, 0.6110301682F, 0.6115005694F,
+ 0.6119708139F, 0.6124409011F, 0.6129108305F, 0.6133806017F,
+ 0.6138502139F, 0.6143196669F, 0.6147889599F, 0.6152580926F,
+ 0.6157270643F, 0.6161958746F, 0.6166645230F, 0.6171330088F,
+ 0.6176013317F, 0.6180694910F, 0.6185374863F, 0.6190053171F,
+ 0.6194729827F, 0.6199404828F, 0.6204078167F, 0.6208749841F,
+ 0.6213419842F, 0.6218088168F, 0.6222754811F, 0.6227419768F,
+ 0.6232083032F, 0.6236744600F, 0.6241404465F, 0.6246062622F,
+ 0.6250719067F, 0.6255373795F, 0.6260026799F, 0.6264678076F,
+ 0.6269327619F, 0.6273975425F, 0.6278621487F, 0.6283265800F,
+ 0.6287908361F, 0.6292549163F, 0.6297188201F, 0.6301825471F,
+ 0.6306460966F, 0.6311094683F, 0.6315726617F, 0.6320356761F,
+ 0.6324985111F, 0.6329611662F, 0.6334236410F, 0.6338859348F,
+ 0.6343480472F, 0.6348099777F, 0.6352717257F, 0.6357332909F,
+ 0.6361946726F, 0.6366558704F, 0.6371168837F, 0.6375777122F,
+ 0.6380383552F, 0.6384988123F, 0.6389590830F, 0.6394191668F,
+ 0.6398790631F, 0.6403387716F, 0.6407982916F, 0.6412576228F,
+ 0.6417167645F, 0.6421757163F, 0.6426344778F, 0.6430930483F,
+ 0.6435514275F, 0.6440096149F, 0.6444676098F, 0.6449254119F,
+ 0.6453830207F, 0.6458404356F, 0.6462976562F, 0.6467546820F,
+ 0.6472115125F, 0.6476681472F, 0.6481245856F, 0.6485808273F,
+ 0.6490368717F, 0.6494927183F, 0.6499483667F, 0.6504038164F,
+ 0.6508590670F, 0.6513141178F, 0.6517689684F, 0.6522236185F,
+ 0.6526780673F, 0.6531323146F, 0.6535863598F, 0.6540402024F,
+ 0.6544938419F, 0.6549472779F, 0.6554005099F, 0.6558535373F,
+ 0.6563063598F, 0.6567589769F, 0.6572113880F, 0.6576635927F,
+ 0.6581155906F, 0.6585673810F, 0.6590189637F, 0.6594703380F,
+ 0.6599215035F, 0.6603724598F, 0.6608232064F, 0.6612737427F,
+ 0.6617240684F, 0.6621741829F, 0.6626240859F, 0.6630737767F,
+ 0.6635232550F, 0.6639725202F, 0.6644215720F, 0.6648704098F,
+ 0.6653190332F, 0.6657674417F, 0.6662156348F, 0.6666636121F,
+ 0.6671113731F, 0.6675589174F, 0.6680062445F, 0.6684533538F,
+ 0.6689002450F, 0.6693469177F, 0.6697933712F, 0.6702396052F,
+ 0.6706856193F, 0.6711314129F, 0.6715769855F, 0.6720223369F,
+ 0.6724674664F, 0.6729123736F, 0.6733570581F, 0.6738015194F,
+ 0.6742457570F, 0.6746897706F, 0.6751335596F, 0.6755771236F,
+ 0.6760204621F, 0.6764635747F, 0.6769064609F, 0.6773491204F,
+ 0.6777915525F, 0.6782337570F, 0.6786757332F, 0.6791174809F,
+ 0.6795589995F, 0.6800002886F, 0.6804413477F, 0.6808821765F,
+ 0.6813227743F, 0.6817631409F, 0.6822032758F, 0.6826431785F,
+ 0.6830828485F, 0.6835222855F, 0.6839614890F, 0.6844004585F,
+ 0.6848391936F, 0.6852776939F, 0.6857159589F, 0.6861539883F,
+ 0.6865917815F, 0.6870293381F, 0.6874666576F, 0.6879037398F,
+ 0.6883405840F, 0.6887771899F, 0.6892135571F, 0.6896496850F,
+ 0.6900855733F, 0.6905212216F, 0.6909566294F, 0.6913917963F,
+ 0.6918267218F, 0.6922614055F, 0.6926958471F, 0.6931300459F,
+ 0.6935640018F, 0.6939977141F, 0.6944311825F, 0.6948644066F,
+ 0.6952973859F, 0.6957301200F, 0.6961626085F, 0.6965948510F,
+ 0.6970268470F, 0.6974585961F, 0.6978900980F, 0.6983213521F,
+ 0.6987523580F, 0.6991831154F, 0.6996136238F, 0.7000438828F,
+ 0.7004738921F, 0.7009036510F, 0.7013331594F, 0.7017624166F,
+ 0.7021914224F, 0.7026201763F, 0.7030486779F, 0.7034769268F,
+ 0.7039049226F, 0.7043326648F, 0.7047601531F, 0.7051873870F,
+ 0.7056143662F, 0.7060410902F, 0.7064675586F, 0.7068937711F,
+ 0.7073197271F, 0.7077454264F, 0.7081708684F, 0.7085960529F,
+ 0.7090209793F, 0.7094456474F, 0.7098700566F, 0.7102942066F,
+ 0.7107180970F, 0.7111417274F, 0.7115650974F, 0.7119882066F,
+ 0.7124110545F, 0.7128336409F, 0.7132559653F, 0.7136780272F,
+ 0.7140998264F, 0.7145213624F, 0.7149426348F, 0.7153636433F,
+ 0.7157843874F, 0.7162048668F, 0.7166250810F, 0.7170450296F,
+ 0.7174647124F, 0.7178841289F, 0.7183032786F, 0.7187221613F,
+ 0.7191407765F, 0.7195591239F, 0.7199772030F, 0.7203950135F,
+ 0.7208125550F, 0.7212298271F, 0.7216468294F, 0.7220635616F,
+ 0.7224800233F, 0.7228962140F, 0.7233121335F, 0.7237277813F,
+ 0.7241431571F, 0.7245582604F, 0.7249730910F, 0.7253876484F,
+ 0.7258019322F, 0.7262159422F, 0.7266296778F, 0.7270431388F,
+ 0.7274563247F, 0.7278692353F, 0.7282818700F, 0.7286942287F,
+ 0.7291063108F, 0.7295181160F, 0.7299296440F, 0.7303408944F,
+ 0.7307518669F, 0.7311625609F, 0.7315729763F, 0.7319831126F,
+ 0.7323929695F, 0.7328025466F, 0.7332118435F, 0.7336208600F,
+ 0.7340295955F, 0.7344380499F, 0.7348462226F, 0.7352541134F,
+ 0.7356617220F, 0.7360690478F, 0.7364760907F, 0.7368828502F,
+ 0.7372893259F, 0.7376955176F, 0.7381014249F, 0.7385070475F,
+ 0.7389123849F, 0.7393174368F, 0.7397222029F, 0.7401266829F,
+ 0.7405308763F, 0.7409347829F, 0.7413384023F, 0.7417417341F,
+ 0.7421447780F, 0.7425475338F, 0.7429500009F, 0.7433521791F,
+ 0.7437540681F, 0.7441556674F, 0.7445569769F, 0.7449579960F,
+ 0.7453587245F, 0.7457591621F, 0.7461593084F, 0.7465591631F,
+ 0.7469587259F, 0.7473579963F, 0.7477569741F, 0.7481556590F,
+ 0.7485540506F, 0.7489521486F, 0.7493499526F, 0.7497474623F,
+ 0.7501446775F, 0.7505415977F, 0.7509382227F, 0.7513345521F,
+ 0.7517305856F, 0.7521263229F, 0.7525217636F, 0.7529169074F,
+ 0.7533117541F, 0.7537063032F, 0.7541005545F, 0.7544945076F,
+ 0.7548881623F, 0.7552815182F, 0.7556745749F, 0.7560673323F,
+ 0.7564597899F, 0.7568519474F, 0.7572438046F, 0.7576353611F,
+ 0.7580266166F, 0.7584175708F, 0.7588082235F, 0.7591985741F,
+ 0.7595886226F, 0.7599783685F, 0.7603678116F, 0.7607569515F,
+ 0.7611457879F, 0.7615343206F, 0.7619225493F, 0.7623104735F,
+ 0.7626980931F, 0.7630854078F, 0.7634724171F, 0.7638591209F,
+ 0.7642455188F, 0.7646316106F, 0.7650173959F, 0.7654028744F,
+ 0.7657880459F, 0.7661729100F, 0.7665574664F, 0.7669417150F,
+ 0.7673256553F, 0.7677092871F, 0.7680926100F, 0.7684756239F,
+ 0.7688583284F, 0.7692407232F, 0.7696228080F, 0.7700045826F,
+ 0.7703860467F, 0.7707671999F, 0.7711480420F, 0.7715285728F,
+ 0.7719087918F, 0.7722886989F, 0.7726682938F, 0.7730475762F,
+ 0.7734265458F, 0.7738052023F, 0.7741835454F, 0.7745615750F,
+ 0.7749392906F, 0.7753166921F, 0.7756937791F, 0.7760705514F,
+ 0.7764470087F, 0.7768231508F, 0.7771989773F, 0.7775744880F,
+ 0.7779496827F, 0.7783245610F, 0.7786991227F, 0.7790733676F,
+ 0.7794472953F, 0.7798209056F, 0.7801941982F, 0.7805671729F,
+ 0.7809398294F, 0.7813121675F, 0.7816841869F, 0.7820558873F,
+ 0.7824272684F, 0.7827983301F, 0.7831690720F, 0.7835394940F,
+ 0.7839095957F, 0.7842793768F, 0.7846488373F, 0.7850179767F,
+ 0.7853867948F, 0.7857552914F, 0.7861234663F, 0.7864913191F,
+ 0.7868588497F, 0.7872260578F, 0.7875929431F, 0.7879595055F,
+ 0.7883257445F, 0.7886916601F, 0.7890572520F, 0.7894225198F,
+ 0.7897874635F, 0.7901520827F, 0.7905163772F, 0.7908803468F,
+ 0.7912439912F, 0.7916073102F, 0.7919703035F, 0.7923329710F,
+ 0.7926953124F, 0.7930573274F, 0.7934190158F, 0.7937803774F,
+ 0.7941414120F, 0.7945021193F, 0.7948624991F, 0.7952225511F,
+ 0.7955822752F, 0.7959416711F, 0.7963007387F, 0.7966594775F,
+ 0.7970178875F, 0.7973759685F, 0.7977337201F, 0.7980911422F,
+ 0.7984482346F, 0.7988049970F, 0.7991614292F, 0.7995175310F,
+ 0.7998733022F, 0.8002287426F, 0.8005838519F, 0.8009386299F,
+ 0.8012930765F, 0.8016471914F, 0.8020009744F, 0.8023544253F,
+ 0.8027075438F, 0.8030603298F, 0.8034127831F, 0.8037649035F,
+ 0.8041166906F, 0.8044681445F, 0.8048192647F, 0.8051700512F,
+ 0.8055205038F, 0.8058706222F, 0.8062204062F, 0.8065698556F,
+ 0.8069189702F, 0.8072677499F, 0.8076161944F, 0.8079643036F,
+ 0.8083120772F, 0.8086595151F, 0.8090066170F, 0.8093533827F,
+ 0.8096998122F, 0.8100459051F, 0.8103916613F, 0.8107370806F,
+ 0.8110821628F, 0.8114269077F, 0.8117713151F, 0.8121153849F,
+ 0.8124591169F, 0.8128025108F, 0.8131455666F, 0.8134882839F,
+ 0.8138306627F, 0.8141727027F, 0.8145144038F, 0.8148557658F,
+ 0.8151967886F, 0.8155374718F, 0.8158778154F, 0.8162178192F,
+ 0.8165574830F, 0.8168968067F, 0.8172357900F, 0.8175744328F,
+ 0.8179127349F, 0.8182506962F, 0.8185883164F, 0.8189255955F,
+ 0.8192625332F, 0.8195991295F, 0.8199353840F, 0.8202712967F,
+ 0.8206068673F, 0.8209420958F, 0.8212769820F, 0.8216115256F,
+ 0.8219457266F, 0.8222795848F, 0.8226131000F, 0.8229462721F,
+ 0.8232791009F, 0.8236115863F, 0.8239437280F, 0.8242755260F,
+ 0.8246069801F, 0.8249380901F, 0.8252688559F, 0.8255992774F,
+ 0.8259293544F, 0.8262590867F, 0.8265884741F, 0.8269175167F,
+ 0.8272462141F, 0.8275745663F, 0.8279025732F, 0.8282302344F,
+ 0.8285575501F, 0.8288845199F, 0.8292111437F, 0.8295374215F,
+ 0.8298633530F, 0.8301889382F, 0.8305141768F, 0.8308390688F,
+ 0.8311636141F, 0.8314878124F, 0.8318116637F, 0.8321351678F,
+ 0.8324583246F, 0.8327811340F, 0.8331035957F, 0.8334257098F,
+ 0.8337474761F, 0.8340688944F, 0.8343899647F, 0.8347106867F,
+ 0.8350310605F, 0.8353510857F, 0.8356707624F, 0.8359900904F,
+ 0.8363090696F, 0.8366276999F, 0.8369459811F, 0.8372639131F,
+ 0.8375814958F, 0.8378987292F, 0.8382156130F, 0.8385321472F,
+ 0.8388483316F, 0.8391641662F, 0.8394796508F, 0.8397947853F,
+ 0.8401095697F, 0.8404240037F, 0.8407380873F, 0.8410518204F,
+ 0.8413652029F, 0.8416782347F, 0.8419909156F, 0.8423032456F,
+ 0.8426152245F, 0.8429268523F, 0.8432381289F, 0.8435490541F,
+ 0.8438596279F, 0.8441698502F, 0.8444797208F, 0.8447892396F,
+ 0.8450984067F, 0.8454072218F, 0.8457156849F, 0.8460237959F,
+ 0.8463315547F, 0.8466389612F, 0.8469460154F, 0.8472527170F,
+ 0.8475590661F, 0.8478650625F, 0.8481707063F, 0.8484759971F,
+ 0.8487809351F, 0.8490855201F, 0.8493897521F, 0.8496936308F,
+ 0.8499971564F, 0.8503003286F, 0.8506031474F, 0.8509056128F,
+ 0.8512077246F, 0.8515094828F, 0.8518108872F, 0.8521119379F,
+ 0.8524126348F, 0.8527129777F, 0.8530129666F, 0.8533126015F,
+ 0.8536118822F, 0.8539108087F, 0.8542093809F, 0.8545075988F,
+ 0.8548054623F, 0.8551029712F, 0.8554001257F, 0.8556969255F,
+ 0.8559933707F, 0.8562894611F, 0.8565851968F, 0.8568805775F,
+ 0.8571756034F, 0.8574702743F, 0.8577645902F, 0.8580585509F,
+ 0.8583521566F, 0.8586454070F, 0.8589383021F, 0.8592308420F,
+ 0.8595230265F, 0.8598148556F, 0.8601063292F, 0.8603974473F,
+ 0.8606882098F, 0.8609786167F, 0.8612686680F, 0.8615583636F,
+ 0.8618477034F, 0.8621366874F, 0.8624253156F, 0.8627135878F,
+ 0.8630015042F, 0.8632890646F, 0.8635762690F, 0.8638631173F,
+ 0.8641496096F, 0.8644357457F, 0.8647215257F, 0.8650069495F,
+ 0.8652920171F, 0.8655767283F, 0.8658610833F, 0.8661450820F,
+ 0.8664287243F, 0.8667120102F, 0.8669949397F, 0.8672775127F,
+ 0.8675597293F, 0.8678415894F, 0.8681230929F, 0.8684042398F,
+ 0.8686850302F, 0.8689654640F, 0.8692455412F, 0.8695252617F,
+ 0.8698046255F, 0.8700836327F, 0.8703622831F, 0.8706405768F,
+ 0.8709185138F, 0.8711960940F, 0.8714733174F, 0.8717501840F,
+ 0.8720266939F, 0.8723028469F, 0.8725786430F, 0.8728540824F,
+ 0.8731291648F, 0.8734038905F, 0.8736782592F, 0.8739522711F,
+ 0.8742259261F, 0.8744992242F, 0.8747721653F, 0.8750447496F,
+ 0.8753169770F, 0.8755888475F, 0.8758603611F, 0.8761315177F,
+ 0.8764023175F, 0.8766727603F, 0.8769428462F, 0.8772125752F,
+ 0.8774819474F, 0.8777509626F, 0.8780196209F, 0.8782879224F,
+ 0.8785558669F, 0.8788234546F, 0.8790906854F, 0.8793575594F,
+ 0.8796240765F, 0.8798902368F, 0.8801560403F, 0.8804214870F,
+ 0.8806865768F, 0.8809513099F, 0.8812156863F, 0.8814797059F,
+ 0.8817433687F, 0.8820066749F, 0.8822696243F, 0.8825322171F,
+ 0.8827944532F, 0.8830563327F, 0.8833178556F, 0.8835790219F,
+ 0.8838398316F, 0.8841002848F, 0.8843603815F, 0.8846201217F,
+ 0.8848795054F, 0.8851385327F, 0.8853972036F, 0.8856555182F,
+ 0.8859134764F, 0.8861710783F, 0.8864283239F, 0.8866852133F,
+ 0.8869417464F, 0.8871979234F, 0.8874537443F, 0.8877092090F,
+ 0.8879643177F, 0.8882190704F, 0.8884734671F, 0.8887275078F,
+ 0.8889811927F, 0.8892345216F, 0.8894874948F, 0.8897401122F,
+ 0.8899923738F, 0.8902442798F, 0.8904958301F, 0.8907470248F,
+ 0.8909978640F, 0.8912483477F, 0.8914984759F, 0.8917482487F,
+ 0.8919976662F, 0.8922467284F, 0.8924954353F, 0.8927437871F,
+ 0.8929917837F, 0.8932394252F, 0.8934867118F, 0.8937336433F,
+ 0.8939802199F, 0.8942264417F, 0.8944723087F, 0.8947178210F,
+ 0.8949629785F, 0.8952077815F, 0.8954522299F, 0.8956963239F,
+ 0.8959400634F, 0.8961834486F, 0.8964264795F, 0.8966691561F,
+ 0.8969114786F, 0.8971534470F, 0.8973950614F, 0.8976363219F,
+ 0.8978772284F, 0.8981177812F, 0.8983579802F, 0.8985978256F,
+ 0.8988373174F, 0.8990764556F, 0.8993152405F, 0.8995536720F,
+ 0.8997917502F, 0.9000294751F, 0.9002668470F, 0.9005038658F,
+ 0.9007405317F, 0.9009768446F, 0.9012128048F, 0.9014484123F,
+ 0.9016836671F, 0.9019185693F, 0.9021531191F, 0.9023873165F,
+ 0.9026211616F, 0.9028546546F, 0.9030877954F, 0.9033205841F,
+ 0.9035530210F, 0.9037851059F, 0.9040168392F, 0.9042482207F,
+ 0.9044792507F, 0.9047099293F, 0.9049402564F, 0.9051702323F,
+ 0.9053998569F, 0.9056291305F, 0.9058580531F, 0.9060866248F,
+ 0.9063148457F, 0.9065427159F, 0.9067702355F, 0.9069974046F,
+ 0.9072242233F, 0.9074506917F, 0.9076768100F, 0.9079025782F,
+ 0.9081279964F, 0.9083530647F, 0.9085777833F, 0.9088021523F,
+ 0.9090261717F, 0.9092498417F, 0.9094731623F, 0.9096961338F,
+ 0.9099187561F, 0.9101410295F, 0.9103629540F, 0.9105845297F,
+ 0.9108057568F, 0.9110266354F, 0.9112471656F, 0.9114673475F,
+ 0.9116871812F, 0.9119066668F, 0.9121258046F, 0.9123445945F,
+ 0.9125630367F, 0.9127811314F, 0.9129988786F, 0.9132162785F,
+ 0.9134333312F, 0.9136500368F, 0.9138663954F, 0.9140824073F,
+ 0.9142980724F, 0.9145133910F, 0.9147283632F, 0.9149429890F,
+ 0.9151572687F, 0.9153712023F, 0.9155847900F, 0.9157980319F,
+ 0.9160109282F, 0.9162234790F, 0.9164356844F, 0.9166475445F,
+ 0.9168590595F, 0.9170702296F, 0.9172810548F, 0.9174915354F,
+ 0.9177016714F, 0.9179114629F, 0.9181209102F, 0.9183300134F,
+ 0.9185387726F, 0.9187471879F, 0.9189552595F, 0.9191629876F,
+ 0.9193703723F, 0.9195774136F, 0.9197841119F, 0.9199904672F,
+ 0.9201964797F, 0.9204021495F, 0.9206074767F, 0.9208124616F,
+ 0.9210171043F, 0.9212214049F, 0.9214253636F, 0.9216289805F,
+ 0.9218322558F, 0.9220351896F, 0.9222377821F, 0.9224400335F,
+ 0.9226419439F, 0.9228435134F, 0.9230447423F, 0.9232456307F,
+ 0.9234461787F, 0.9236463865F, 0.9238462543F, 0.9240457822F,
+ 0.9242449704F, 0.9244438190F, 0.9246423282F, 0.9248404983F,
+ 0.9250383293F, 0.9252358214F, 0.9254329747F, 0.9256297896F,
+ 0.9258262660F, 0.9260224042F, 0.9262182044F, 0.9264136667F,
+ 0.9266087913F, 0.9268035783F, 0.9269980280F, 0.9271921405F,
+ 0.9273859160F, 0.9275793546F, 0.9277724566F, 0.9279652221F,
+ 0.9281576513F, 0.9283497443F, 0.9285415014F, 0.9287329227F,
+ 0.9289240084F, 0.9291147586F, 0.9293051737F, 0.9294952536F,
+ 0.9296849987F, 0.9298744091F, 0.9300634850F, 0.9302522266F,
+ 0.9304406340F, 0.9306287074F, 0.9308164471F, 0.9310038532F,
+ 0.9311909259F, 0.9313776654F, 0.9315640719F, 0.9317501455F,
+ 0.9319358865F, 0.9321212951F, 0.9323063713F, 0.9324911155F,
+ 0.9326755279F, 0.9328596085F, 0.9330433577F, 0.9332267756F,
+ 0.9334098623F, 0.9335926182F, 0.9337750434F, 0.9339571380F,
+ 0.9341389023F, 0.9343203366F, 0.9345014409F, 0.9346822155F,
+ 0.9348626606F, 0.9350427763F, 0.9352225630F, 0.9354020207F,
+ 0.9355811498F, 0.9357599503F, 0.9359384226F, 0.9361165667F,
+ 0.9362943830F, 0.9364718716F, 0.9366490327F, 0.9368258666F,
+ 0.9370023733F, 0.9371785533F, 0.9373544066F, 0.9375299335F,
+ 0.9377051341F, 0.9378800087F, 0.9380545576F, 0.9382287809F,
+ 0.9384026787F, 0.9385762515F, 0.9387494993F, 0.9389224223F,
+ 0.9390950209F, 0.9392672951F, 0.9394392453F, 0.9396108716F,
+ 0.9397821743F, 0.9399531536F, 0.9401238096F, 0.9402941427F,
+ 0.9404641530F, 0.9406338407F, 0.9408032061F, 0.9409722495F,
+ 0.9411409709F, 0.9413093707F, 0.9414774491F, 0.9416452062F,
+ 0.9418126424F, 0.9419797579F, 0.9421465528F, 0.9423130274F,
+ 0.9424791819F, 0.9426450166F, 0.9428105317F, 0.9429757274F,
+ 0.9431406039F, 0.9433051616F, 0.9434694005F, 0.9436333209F,
+ 0.9437969232F, 0.9439602074F, 0.9441231739F, 0.9442858229F,
+ 0.9444481545F, 0.9446101691F, 0.9447718669F, 0.9449332481F,
+ 0.9450943129F, 0.9452550617F, 0.9454154945F, 0.9455756118F,
+ 0.9457354136F, 0.9458949003F, 0.9460540721F, 0.9462129292F,
+ 0.9463714719F, 0.9465297003F, 0.9466876149F, 0.9468452157F,
+ 0.9470025031F, 0.9471594772F, 0.9473161384F, 0.9474724869F,
+ 0.9476285229F, 0.9477842466F, 0.9479396584F, 0.9480947585F,
+ 0.9482495470F, 0.9484040243F, 0.9485581906F, 0.9487120462F,
+ 0.9488655913F, 0.9490188262F, 0.9491717511F, 0.9493243662F,
+ 0.9494766718F, 0.9496286683F, 0.9497803557F, 0.9499317345F,
+ 0.9500828047F, 0.9502335668F, 0.9503840209F, 0.9505341673F,
+ 0.9506840062F, 0.9508335380F, 0.9509827629F, 0.9511316810F,
+ 0.9512802928F, 0.9514285984F, 0.9515765982F, 0.9517242923F,
+ 0.9518716810F, 0.9520187646F, 0.9521655434F, 0.9523120176F,
+ 0.9524581875F, 0.9526040534F, 0.9527496154F, 0.9528948739F,
+ 0.9530398292F, 0.9531844814F, 0.9533288310F, 0.9534728780F,
+ 0.9536166229F, 0.9537600659F, 0.9539032071F, 0.9540460470F,
+ 0.9541885858F, 0.9543308237F, 0.9544727611F, 0.9546143981F,
+ 0.9547557351F, 0.9548967723F, 0.9550375100F, 0.9551779485F,
+ 0.9553180881F, 0.9554579290F, 0.9555974714F, 0.9557367158F,
+ 0.9558756623F, 0.9560143112F, 0.9561526628F, 0.9562907174F,
+ 0.9564284752F, 0.9565659366F, 0.9567031017F, 0.9568399710F,
+ 0.9569765446F, 0.9571128229F, 0.9572488061F, 0.9573844944F,
+ 0.9575198883F, 0.9576549879F, 0.9577897936F, 0.9579243056F,
+ 0.9580585242F, 0.9581924497F, 0.9583260824F, 0.9584594226F,
+ 0.9585924705F, 0.9587252264F, 0.9588576906F, 0.9589898634F,
+ 0.9591217452F, 0.9592533360F, 0.9593846364F, 0.9595156465F,
+ 0.9596463666F, 0.9597767971F, 0.9599069382F, 0.9600367901F,
+ 0.9601663533F, 0.9602956279F, 0.9604246143F, 0.9605533128F,
+ 0.9606817236F, 0.9608098471F, 0.9609376835F, 0.9610652332F,
+ 0.9611924963F, 0.9613194733F, 0.9614461644F, 0.9615725699F,
+ 0.9616986901F, 0.9618245253F, 0.9619500757F, 0.9620753418F,
+ 0.9622003238F, 0.9623250219F, 0.9624494365F, 0.9625735679F,
+ 0.9626974163F, 0.9628209821F, 0.9629442656F, 0.9630672671F,
+ 0.9631899868F, 0.9633124251F, 0.9634345822F, 0.9635564585F,
+ 0.9636780543F, 0.9637993699F, 0.9639204056F, 0.9640411616F,
+ 0.9641616383F, 0.9642818359F, 0.9644017549F, 0.9645213955F,
+ 0.9646407579F, 0.9647598426F, 0.9648786497F, 0.9649971797F,
+ 0.9651154328F, 0.9652334092F, 0.9653511095F, 0.9654685337F,
+ 0.9655856823F, 0.9657025556F, 0.9658191538F, 0.9659354773F,
+ 0.9660515263F, 0.9661673013F, 0.9662828024F, 0.9663980300F,
+ 0.9665129845F, 0.9666276660F, 0.9667420750F, 0.9668562118F,
+ 0.9669700766F, 0.9670836698F, 0.9671969917F, 0.9673100425F,
+ 0.9674228227F, 0.9675353325F, 0.9676475722F, 0.9677595422F,
+ 0.9678712428F, 0.9679826742F, 0.9680938368F, 0.9682047309F,
+ 0.9683153569F, 0.9684257150F, 0.9685358056F, 0.9686456289F,
+ 0.9687551853F, 0.9688644752F, 0.9689734987F, 0.9690822564F,
+ 0.9691907483F, 0.9692989750F, 0.9694069367F, 0.9695146337F,
+ 0.9696220663F, 0.9697292349F, 0.9698361398F, 0.9699427813F,
+ 0.9700491597F, 0.9701552754F, 0.9702611286F, 0.9703667197F,
+ 0.9704720490F, 0.9705771169F, 0.9706819236F, 0.9707864695F,
+ 0.9708907549F, 0.9709947802F, 0.9710985456F, 0.9712020514F,
+ 0.9713052981F, 0.9714082859F, 0.9715110151F, 0.9716134862F,
+ 0.9717156993F, 0.9718176549F, 0.9719193532F, 0.9720207946F,
+ 0.9721219794F, 0.9722229080F, 0.9723235806F, 0.9724239976F,
+ 0.9725241593F, 0.9726240661F, 0.9727237183F, 0.9728231161F,
+ 0.9729222601F, 0.9730211503F, 0.9731197873F, 0.9732181713F,
+ 0.9733163027F, 0.9734141817F, 0.9735118088F, 0.9736091842F,
+ 0.9737063083F, 0.9738031814F, 0.9738998039F, 0.9739961760F,
+ 0.9740922981F, 0.9741881706F, 0.9742837938F, 0.9743791680F,
+ 0.9744742935F, 0.9745691707F, 0.9746637999F, 0.9747581814F,
+ 0.9748523157F, 0.9749462029F, 0.9750398435F, 0.9751332378F,
+ 0.9752263861F, 0.9753192887F, 0.9754119461F, 0.9755043585F,
+ 0.9755965262F, 0.9756884496F, 0.9757801291F, 0.9758715650F,
+ 0.9759627575F, 0.9760537071F, 0.9761444141F, 0.9762348789F,
+ 0.9763251016F, 0.9764150828F, 0.9765048228F, 0.9765943218F,
+ 0.9766835802F, 0.9767725984F, 0.9768613767F, 0.9769499154F,
+ 0.9770382149F, 0.9771262755F, 0.9772140976F, 0.9773016815F,
+ 0.9773890275F, 0.9774761360F, 0.9775630073F, 0.9776496418F,
+ 0.9777360398F, 0.9778222016F, 0.9779081277F, 0.9779938182F,
+ 0.9780792736F, 0.9781644943F, 0.9782494805F, 0.9783342326F,
+ 0.9784187509F, 0.9785030359F, 0.9785870877F, 0.9786709069F,
+ 0.9787544936F, 0.9788378484F, 0.9789209714F, 0.9790038631F,
+ 0.9790865238F, 0.9791689538F, 0.9792511535F, 0.9793331232F,
+ 0.9794148633F, 0.9794963742F, 0.9795776561F, 0.9796587094F,
+ 0.9797395345F, 0.9798201316F, 0.9799005013F, 0.9799806437F,
+ 0.9800605593F, 0.9801402483F, 0.9802197112F, 0.9802989483F,
+ 0.9803779600F, 0.9804567465F, 0.9805353082F, 0.9806136455F,
+ 0.9806917587F, 0.9807696482F, 0.9808473143F, 0.9809247574F,
+ 0.9810019778F, 0.9810789759F, 0.9811557519F, 0.9812323064F,
+ 0.9813086395F, 0.9813847517F, 0.9814606433F, 0.9815363147F,
+ 0.9816117662F, 0.9816869981F, 0.9817620108F, 0.9818368047F,
+ 0.9819113801F, 0.9819857374F, 0.9820598769F, 0.9821337989F,
+ 0.9822075038F, 0.9822809920F, 0.9823542638F, 0.9824273195F,
+ 0.9825001596F, 0.9825727843F, 0.9826451940F, 0.9827173891F,
+ 0.9827893700F, 0.9828611368F, 0.9829326901F, 0.9830040302F,
+ 0.9830751574F, 0.9831460720F, 0.9832167745F, 0.9832872652F,
+ 0.9833575444F, 0.9834276124F, 0.9834974697F, 0.9835671166F,
+ 0.9836365535F, 0.9837057806F, 0.9837747983F, 0.9838436071F,
+ 0.9839122072F, 0.9839805990F, 0.9840487829F, 0.9841167591F,
+ 0.9841845282F, 0.9842520903F, 0.9843194459F, 0.9843865953F,
+ 0.9844535389F, 0.9845202771F, 0.9845868101F, 0.9846531383F,
+ 0.9847192622F, 0.9847851820F, 0.9848508980F, 0.9849164108F,
+ 0.9849817205F, 0.9850468276F, 0.9851117324F, 0.9851764352F,
+ 0.9852409365F, 0.9853052366F, 0.9853693358F, 0.9854332344F,
+ 0.9854969330F, 0.9855604317F, 0.9856237309F, 0.9856868310F,
+ 0.9857497325F, 0.9858124355F, 0.9858749404F, 0.9859372477F,
+ 0.9859993577F, 0.9860612707F, 0.9861229871F, 0.9861845072F,
+ 0.9862458315F, 0.9863069601F, 0.9863678936F, 0.9864286322F,
+ 0.9864891764F, 0.9865495264F, 0.9866096826F, 0.9866696454F,
+ 0.9867294152F, 0.9867889922F, 0.9868483769F, 0.9869075695F,
+ 0.9869665706F, 0.9870253803F, 0.9870839991F, 0.9871424273F,
+ 0.9872006653F, 0.9872587135F, 0.9873165721F, 0.9873742415F,
+ 0.9874317222F, 0.9874890144F, 0.9875461185F, 0.9876030348F,
+ 0.9876597638F, 0.9877163057F, 0.9877726610F, 0.9878288300F,
+ 0.9878848130F, 0.9879406104F, 0.9879962225F, 0.9880516497F,
+ 0.9881068924F, 0.9881619509F, 0.9882168256F, 0.9882715168F,
+ 0.9883260249F, 0.9883803502F, 0.9884344931F, 0.9884884539F,
+ 0.9885422331F, 0.9885958309F, 0.9886492477F, 0.9887024838F,
+ 0.9887555397F, 0.9888084157F, 0.9888611120F, 0.9889136292F,
+ 0.9889659675F, 0.9890181273F, 0.9890701089F, 0.9891219128F,
+ 0.9891735392F, 0.9892249885F, 0.9892762610F, 0.9893273572F,
+ 0.9893782774F, 0.9894290219F, 0.9894795911F, 0.9895299853F,
+ 0.9895802049F, 0.9896302502F, 0.9896801217F, 0.9897298196F,
+ 0.9897793443F, 0.9898286961F, 0.9898778755F, 0.9899268828F,
+ 0.9899757183F, 0.9900243823F, 0.9900728753F, 0.9901211976F,
+ 0.9901693495F, 0.9902173314F, 0.9902651436F, 0.9903127865F,
+ 0.9903602605F, 0.9904075659F, 0.9904547031F, 0.9905016723F,
+ 0.9905484740F, 0.9905951086F, 0.9906415763F, 0.9906878775F,
+ 0.9907340126F, 0.9907799819F, 0.9908257858F, 0.9908714247F,
+ 0.9909168988F, 0.9909622086F, 0.9910073543F, 0.9910523364F,
+ 0.9910971552F, 0.9911418110F, 0.9911863042F, 0.9912306351F,
+ 0.9912748042F, 0.9913188117F, 0.9913626580F, 0.9914063435F,
+ 0.9914498684F, 0.9914932333F, 0.9915364383F, 0.9915794839F,
+ 0.9916223703F, 0.9916650981F, 0.9917076674F, 0.9917500787F,
+ 0.9917923323F, 0.9918344286F, 0.9918763679F, 0.9919181505F,
+ 0.9919597769F, 0.9920012473F, 0.9920425621F, 0.9920837217F,
+ 0.9921247263F, 0.9921655765F, 0.9922062724F, 0.9922468145F,
+ 0.9922872030F, 0.9923274385F, 0.9923675211F, 0.9924074513F,
+ 0.9924472294F, 0.9924868557F, 0.9925263306F, 0.9925656544F,
+ 0.9926048275F, 0.9926438503F, 0.9926827230F, 0.9927214461F,
+ 0.9927600199F, 0.9927984446F, 0.9928367208F, 0.9928748486F,
+ 0.9929128285F, 0.9929506608F, 0.9929883459F, 0.9930258841F,
+ 0.9930632757F, 0.9931005211F, 0.9931376207F, 0.9931745747F,
+ 0.9932113836F, 0.9932480476F, 0.9932845671F, 0.9933209425F,
+ 0.9933571742F, 0.9933932623F, 0.9934292074F, 0.9934650097F,
+ 0.9935006696F, 0.9935361874F, 0.9935715635F, 0.9936067982F,
+ 0.9936418919F, 0.9936768448F, 0.9937116574F, 0.9937463300F,
+ 0.9937808629F, 0.9938152565F, 0.9938495111F, 0.9938836271F,
+ 0.9939176047F, 0.9939514444F, 0.9939851465F, 0.9940187112F,
+ 0.9940521391F, 0.9940854303F, 0.9941185853F, 0.9941516044F,
+ 0.9941844879F, 0.9942172361F, 0.9942498495F, 0.9942823283F,
+ 0.9943146729F, 0.9943468836F, 0.9943789608F, 0.9944109047F,
+ 0.9944427158F, 0.9944743944F, 0.9945059408F, 0.9945373553F,
+ 0.9945686384F, 0.9945997902F, 0.9946308112F, 0.9946617017F,
+ 0.9946924621F, 0.9947230926F, 0.9947535937F, 0.9947839656F,
+ 0.9948142086F, 0.9948443232F, 0.9948743097F, 0.9949041683F,
+ 0.9949338995F, 0.9949635035F, 0.9949929807F, 0.9950223315F,
+ 0.9950515561F, 0.9950806549F, 0.9951096282F, 0.9951384764F,
+ 0.9951671998F, 0.9951957987F, 0.9952242735F, 0.9952526245F,
+ 0.9952808520F, 0.9953089564F, 0.9953369380F, 0.9953647971F,
+ 0.9953925340F, 0.9954201491F, 0.9954476428F, 0.9954750153F,
+ 0.9955022670F, 0.9955293981F, 0.9955564092F, 0.9955833003F,
+ 0.9956100720F, 0.9956367245F, 0.9956632582F, 0.9956896733F,
+ 0.9957159703F, 0.9957421494F, 0.9957682110F, 0.9957941553F,
+ 0.9958199828F, 0.9958456937F, 0.9958712884F, 0.9958967672F,
+ 0.9959221305F, 0.9959473784F, 0.9959725115F, 0.9959975300F,
+ 0.9960224342F, 0.9960472244F, 0.9960719011F, 0.9960964644F,
+ 0.9961209148F, 0.9961452525F, 0.9961694779F, 0.9961935913F,
+ 0.9962175930F, 0.9962414834F, 0.9962652627F, 0.9962889313F,
+ 0.9963124895F, 0.9963359377F, 0.9963592761F, 0.9963825051F,
+ 0.9964056250F, 0.9964286361F, 0.9964515387F, 0.9964743332F,
+ 0.9964970198F, 0.9965195990F, 0.9965420709F, 0.9965644360F,
+ 0.9965866946F, 0.9966088469F, 0.9966308932F, 0.9966528340F,
+ 0.9966746695F, 0.9966964001F, 0.9967180260F, 0.9967395475F,
+ 0.9967609651F, 0.9967822789F, 0.9968034894F, 0.9968245968F,
+ 0.9968456014F, 0.9968665036F, 0.9968873037F, 0.9969080019F,
+ 0.9969285987F, 0.9969490942F, 0.9969694889F, 0.9969897830F,
+ 0.9970099769F, 0.9970300708F, 0.9970500651F, 0.9970699601F,
+ 0.9970897561F, 0.9971094533F, 0.9971290522F, 0.9971485531F,
+ 0.9971679561F, 0.9971872617F, 0.9972064702F, 0.9972255818F,
+ 0.9972445968F, 0.9972635157F, 0.9972823386F, 0.9973010659F,
+ 0.9973196980F, 0.9973382350F, 0.9973566773F, 0.9973750253F,
+ 0.9973932791F, 0.9974114392F, 0.9974295059F, 0.9974474793F,
+ 0.9974653599F, 0.9974831480F, 0.9975008438F, 0.9975184476F,
+ 0.9975359598F, 0.9975533806F, 0.9975707104F, 0.9975879495F,
+ 0.9976050981F, 0.9976221566F, 0.9976391252F, 0.9976560043F,
+ 0.9976727941F, 0.9976894950F, 0.9977061073F, 0.9977226312F,
+ 0.9977390671F, 0.9977554152F, 0.9977716759F, 0.9977878495F,
+ 0.9978039361F, 0.9978199363F, 0.9978358501F, 0.9978516780F,
+ 0.9978674202F, 0.9978830771F, 0.9978986488F, 0.9979141358F,
+ 0.9979295383F, 0.9979448566F, 0.9979600909F, 0.9979752417F,
+ 0.9979903091F, 0.9980052936F, 0.9980201952F, 0.9980350145F,
+ 0.9980497515F, 0.9980644067F, 0.9980789804F, 0.9980934727F,
+ 0.9981078841F, 0.9981222147F, 0.9981364649F, 0.9981506350F,
+ 0.9981647253F, 0.9981787360F, 0.9981926674F, 0.9982065199F,
+ 0.9982202936F, 0.9982339890F, 0.9982476062F, 0.9982611456F,
+ 0.9982746074F, 0.9982879920F, 0.9983012996F, 0.9983145304F,
+ 0.9983276849F, 0.9983407632F, 0.9983537657F, 0.9983666926F,
+ 0.9983795442F, 0.9983923208F, 0.9984050226F, 0.9984176501F,
+ 0.9984302033F, 0.9984426827F, 0.9984550884F, 0.9984674208F,
+ 0.9984796802F, 0.9984918667F, 0.9985039808F, 0.9985160227F,
+ 0.9985279926F, 0.9985398909F, 0.9985517177F, 0.9985634734F,
+ 0.9985751583F, 0.9985867727F, 0.9985983167F, 0.9986097907F,
+ 0.9986211949F, 0.9986325297F, 0.9986437953F, 0.9986549919F,
+ 0.9986661199F, 0.9986771795F, 0.9986881710F, 0.9986990946F,
+ 0.9987099507F, 0.9987207394F, 0.9987314611F, 0.9987421161F,
+ 0.9987527045F, 0.9987632267F, 0.9987736829F, 0.9987840734F,
+ 0.9987943985F, 0.9988046584F, 0.9988148534F, 0.9988249838F,
+ 0.9988350498F, 0.9988450516F, 0.9988549897F, 0.9988648641F,
+ 0.9988746753F, 0.9988844233F, 0.9988941086F, 0.9989037313F,
+ 0.9989132918F, 0.9989227902F, 0.9989322269F, 0.9989416021F,
+ 0.9989509160F, 0.9989601690F, 0.9989693613F, 0.9989784931F,
+ 0.9989875647F, 0.9989965763F, 0.9990055283F, 0.9990144208F,
+ 0.9990232541F, 0.9990320286F, 0.9990407443F, 0.9990494016F,
+ 0.9990580008F, 0.9990665421F, 0.9990750257F, 0.9990834519F,
+ 0.9990918209F, 0.9991001331F, 0.9991083886F, 0.9991165877F,
+ 0.9991247307F, 0.9991328177F, 0.9991408491F, 0.9991488251F,
+ 0.9991567460F, 0.9991646119F, 0.9991724232F, 0.9991801801F,
+ 0.9991878828F, 0.9991955316F, 0.9992031267F, 0.9992106684F,
+ 0.9992181569F, 0.9992255925F, 0.9992329753F, 0.9992403057F,
+ 0.9992475839F, 0.9992548101F, 0.9992619846F, 0.9992691076F,
+ 0.9992761793F, 0.9992832001F, 0.9992901701F, 0.9992970895F,
+ 0.9993039587F, 0.9993107777F, 0.9993175470F, 0.9993242667F,
+ 0.9993309371F, 0.9993375583F, 0.9993441307F, 0.9993506545F,
+ 0.9993571298F, 0.9993635570F, 0.9993699362F, 0.9993762678F,
+ 0.9993825519F, 0.9993887887F, 0.9993949785F, 0.9994011216F,
+ 0.9994072181F, 0.9994132683F, 0.9994192725F, 0.9994252307F,
+ 0.9994311434F, 0.9994370107F, 0.9994428327F, 0.9994486099F,
+ 0.9994543423F, 0.9994600303F, 0.9994656739F, 0.9994712736F,
+ 0.9994768294F, 0.9994823417F, 0.9994878105F, 0.9994932363F,
+ 0.9994986191F, 0.9995039592F, 0.9995092568F, 0.9995145122F,
+ 0.9995197256F, 0.9995248971F, 0.9995300270F, 0.9995351156F,
+ 0.9995401630F, 0.9995451695F, 0.9995501352F, 0.9995550604F,
+ 0.9995599454F, 0.9995647903F, 0.9995695953F, 0.9995743607F,
+ 0.9995790866F, 0.9995837734F, 0.9995884211F, 0.9995930300F,
+ 0.9995976004F, 0.9996021324F, 0.9996066263F, 0.9996110822F,
+ 0.9996155004F, 0.9996198810F, 0.9996242244F, 0.9996285306F,
+ 0.9996327999F, 0.9996370326F, 0.9996412287F, 0.9996453886F,
+ 0.9996495125F, 0.9996536004F, 0.9996576527F, 0.9996616696F,
+ 0.9996656512F, 0.9996695977F, 0.9996735094F, 0.9996773865F,
+ 0.9996812291F, 0.9996850374F, 0.9996888118F, 0.9996925523F,
+ 0.9996962591F, 0.9996999325F, 0.9997035727F, 0.9997071798F,
+ 0.9997107541F, 0.9997142957F, 0.9997178049F, 0.9997212818F,
+ 0.9997247266F, 0.9997281396F, 0.9997315209F, 0.9997348708F,
+ 0.9997381893F, 0.9997414767F, 0.9997447333F, 0.9997479591F,
+ 0.9997511544F, 0.9997543194F, 0.9997574542F, 0.9997605591F,
+ 0.9997636342F, 0.9997666797F, 0.9997696958F, 0.9997726828F,
+ 0.9997756407F, 0.9997785698F, 0.9997814703F, 0.9997843423F,
+ 0.9997871860F, 0.9997900016F, 0.9997927894F, 0.9997955494F,
+ 0.9997982818F, 0.9998009869F, 0.9998036648F, 0.9998063157F,
+ 0.9998089398F, 0.9998115373F, 0.9998141082F, 0.9998166529F,
+ 0.9998191715F, 0.9998216642F, 0.9998241311F, 0.9998265724F,
+ 0.9998289884F, 0.9998313790F, 0.9998337447F, 0.9998360854F,
+ 0.9998384015F, 0.9998406930F, 0.9998429602F, 0.9998452031F,
+ 0.9998474221F, 0.9998496171F, 0.9998517885F, 0.9998539364F,
+ 0.9998560610F, 0.9998581624F, 0.9998602407F, 0.9998622962F,
+ 0.9998643291F, 0.9998663394F, 0.9998683274F, 0.9998702932F,
+ 0.9998722370F, 0.9998741589F, 0.9998760591F, 0.9998779378F,
+ 0.9998797952F, 0.9998816313F, 0.9998834464F, 0.9998852406F,
+ 0.9998870141F, 0.9998887670F, 0.9998904995F, 0.9998922117F,
+ 0.9998939039F, 0.9998955761F, 0.9998972285F, 0.9998988613F,
+ 0.9999004746F, 0.9999020686F, 0.9999036434F, 0.9999051992F,
+ 0.9999067362F, 0.9999082544F, 0.9999097541F, 0.9999112354F,
+ 0.9999126984F, 0.9999141433F, 0.9999155703F, 0.9999169794F,
+ 0.9999183709F, 0.9999197449F, 0.9999211014F, 0.9999224408F,
+ 0.9999237631F, 0.9999250684F, 0.9999263570F, 0.9999276289F,
+ 0.9999288843F, 0.9999301233F, 0.9999313461F, 0.9999325529F,
+ 0.9999337437F, 0.9999349187F, 0.9999360780F, 0.9999372218F,
+ 0.9999383503F, 0.9999394635F, 0.9999405616F, 0.9999416447F,
+ 0.9999427129F, 0.9999437665F, 0.9999448055F, 0.9999458301F,
+ 0.9999468404F, 0.9999478365F, 0.9999488185F, 0.9999497867F,
+ 0.9999507411F, 0.9999516819F, 0.9999526091F, 0.9999535230F,
+ 0.9999544236F, 0.9999553111F, 0.9999561856F, 0.9999570472F,
+ 0.9999578960F, 0.9999587323F, 0.9999595560F, 0.9999603674F,
+ 0.9999611666F, 0.9999619536F, 0.9999627286F, 0.9999634917F,
+ 0.9999642431F, 0.9999649828F, 0.9999657110F, 0.9999664278F,
+ 0.9999671334F, 0.9999678278F, 0.9999685111F, 0.9999691835F,
+ 0.9999698451F, 0.9999704960F, 0.9999711364F, 0.9999717662F,
+ 0.9999723858F, 0.9999729950F, 0.9999735942F, 0.9999741834F,
+ 0.9999747626F, 0.9999753321F, 0.9999758919F, 0.9999764421F,
+ 0.9999769828F, 0.9999775143F, 0.9999780364F, 0.9999785495F,
+ 0.9999790535F, 0.9999795485F, 0.9999800348F, 0.9999805124F,
+ 0.9999809813F, 0.9999814417F, 0.9999818938F, 0.9999823375F,
+ 0.9999827731F, 0.9999832005F, 0.9999836200F, 0.9999840316F,
+ 0.9999844353F, 0.9999848314F, 0.9999852199F, 0.9999856008F,
+ 0.9999859744F, 0.9999863407F, 0.9999866997F, 0.9999870516F,
+ 0.9999873965F, 0.9999877345F, 0.9999880656F, 0.9999883900F,
+ 0.9999887078F, 0.9999890190F, 0.9999893237F, 0.9999896220F,
+ 0.9999899140F, 0.9999901999F, 0.9999904796F, 0.9999907533F,
+ 0.9999910211F, 0.9999912830F, 0.9999915391F, 0.9999917896F,
+ 0.9999920345F, 0.9999922738F, 0.9999925077F, 0.9999927363F,
+ 0.9999929596F, 0.9999931777F, 0.9999933907F, 0.9999935987F,
+ 0.9999938018F, 0.9999940000F, 0.9999941934F, 0.9999943820F,
+ 0.9999945661F, 0.9999947456F, 0.9999949206F, 0.9999950912F,
+ 0.9999952575F, 0.9999954195F, 0.9999955773F, 0.9999957311F,
+ 0.9999958807F, 0.9999960265F, 0.9999961683F, 0.9999963063F,
+ 0.9999964405F, 0.9999965710F, 0.9999966979F, 0.9999968213F,
+ 0.9999969412F, 0.9999970576F, 0.9999971707F, 0.9999972805F,
+ 0.9999973871F, 0.9999974905F, 0.9999975909F, 0.9999976881F,
+ 0.9999977824F, 0.9999978738F, 0.9999979624F, 0.9999980481F,
+ 0.9999981311F, 0.9999982115F, 0.9999982892F, 0.9999983644F,
+ 0.9999984370F, 0.9999985072F, 0.9999985750F, 0.9999986405F,
+ 0.9999987037F, 0.9999987647F, 0.9999988235F, 0.9999988802F,
+ 0.9999989348F, 0.9999989873F, 0.9999990379F, 0.9999990866F,
+ 0.9999991334F, 0.9999991784F, 0.9999992217F, 0.9999992632F,
+ 0.9999993030F, 0.9999993411F, 0.9999993777F, 0.9999994128F,
+ 0.9999994463F, 0.9999994784F, 0.9999995091F, 0.9999995384F,
+ 0.9999995663F, 0.9999995930F, 0.9999996184F, 0.9999996426F,
+ 0.9999996657F, 0.9999996876F, 0.9999997084F, 0.9999997282F,
+ 0.9999997469F, 0.9999997647F, 0.9999997815F, 0.9999997973F,
+ 0.9999998123F, 0.9999998265F, 0.9999998398F, 0.9999998524F,
+ 0.9999998642F, 0.9999998753F, 0.9999998857F, 0.9999998954F,
+ 0.9999999045F, 0.9999999130F, 0.9999999209F, 0.9999999282F,
+ 0.9999999351F, 0.9999999414F, 0.9999999472F, 0.9999999526F,
+ 0.9999999576F, 0.9999999622F, 0.9999999664F, 0.9999999702F,
+ 0.9999999737F, 0.9999999769F, 0.9999999798F, 0.9999999824F,
+ 0.9999999847F, 0.9999999868F, 0.9999999887F, 0.9999999904F,
+ 0.9999999919F, 0.9999999932F, 0.9999999943F, 0.9999999953F,
+ 0.9999999961F, 0.9999999969F, 0.9999999975F, 0.9999999980F,
+ 0.9999999985F, 0.9999999988F, 0.9999999991F, 0.9999999993F,
+ 0.9999999995F, 0.9999999997F, 0.9999999998F, 0.9999999999F,
+ 0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
+ 1.0000000000F, 1.0000000000F, 1.0000000000F, 1.0000000000F,
+};
+
+static const float floor1_inverse_db_table[256]={
+ 1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F,
+ 1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F,
+ 1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F,
+ 2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F,
+ 2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F,
+ 3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F,
+ 4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F,
+ 6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F,
+ 7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F,
+ 1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F,
+ 1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F,
+ 1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F,
+ 2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F,
+ 2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F,
+ 3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F,
+ 4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F,
+ 5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F,
+ 7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F,
+ 9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F,
+ 1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F,
+ 1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F,
+ 2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F,
+ 2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F,
+ 3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F,
+ 4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F,
+ 5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F,
+ 7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F,
+ 9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F,
+ 0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F,
+ 0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F,
+ 0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F,
+ 0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F,
+ 0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F,
+ 0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F,
+ 0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F,
+ 0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F,
+ 0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F,
+ 0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F,
+ 0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F,
+ 0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F,
+ 0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F,
+ 0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F,
+ 0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F,
+ 0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F,
+ 0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F,
+ 0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F,
+ 0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F,
+ 0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F,
+ 0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F,
+ 0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F,
+ 0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F,
+ 0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F,
+ 0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F,
+ 0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F,
+ 0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F,
+ 0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F,
+ 0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F,
+ 0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F,
+ 0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F,
+ 0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F,
+ 0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F,
+ 0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F,
+ 0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F,
+ 0.82788260F, 0.88168307F, 0.9389798F, 1.F,
+};
+
diff --git a/src/libffmpeg/libavcodec/wmadec.c b/src/libffmpeg/libavcodec/wmadec.c
index e0788375f..9ea685af1 100644
--- a/src/libffmpeg/libavcodec/wmadec.c
+++ b/src/libffmpeg/libavcodec/wmadec.c
@@ -48,7 +48,7 @@
#define NB_LSP_COEFS 10
/* XXX: is it a suitable value ? */
-#define MAX_CODED_SUPERFRAME_SIZE 4096
+#define MAX_CODED_SUPERFRAME_SIZE 16384
#define MAX_CHANNELS 2