diff -Naur ./ffmpeg-7.1.2/configure ./ffmpeg-7.1.2_cavs_dra/configure --- ./ffmpeg-7.1.2/configure 2025-09-15 03:20:09.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/configure 2026-01-22 19:29:20.523137100 +0800 @@ -2921,7 +2921,7 @@ bink_decoder_select="blockdsp hpeldsp" binkaudio_dct_decoder_select="wma_freqs" binkaudio_rdft_decoder_select="wma_freqs" -cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp" +cavs_decoder_select="libcavsdec" clearvideo_decoder_select="idctdsp" cllc_decoder_select="bswapdsp" comfortnoise_encoder_select="lpc" @@ -2932,6 +2932,7 @@ dirac_decoder_select="dirac_parse dwt golomb mpegvideoenc qpeldsp videodsp" dnxhd_decoder_select="blockdsp idctdsp" dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp videodsp" +dra_decoder_select="libdradec" dvvideo_decoder_select="dvprofile idctdsp" dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp" dxa_decoder_deps="zlib" diff -Naur ./ffmpeg-7.1.2/libavcodec/allcodecs.c ./ffmpeg-7.1.2_cavs_dra/libavcodec/allcodecs.c --- ./ffmpeg-7.1.2/libavcodec/allcodecs.c 2025-09-15 03:20:04.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/allcodecs.c 2026-01-22 19:40:23.709950200 +0800 @@ -550,6 +550,7 @@ extern const FFCodec ff_ws_snd1_decoder; extern const FFCodec ff_xma1_decoder; extern const FFCodec ff_xma2_decoder; +extern const FFCodec ff_libdra_decoder; /* PCM codecs */ extern const FFCodec ff_pcm_alaw_encoder; diff -Naur ./ffmpeg-7.1.2/libavcodec/codec_desc.c ./ffmpeg-7.1.2_cavs_dra/libavcodec/codec_desc.c --- ./ffmpeg-7.1.2/libavcodec/codec_desc.c 2025-09-15 03:20:04.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/codec_desc.c 2025-08-05 12:23:25.785440400 +0800 @@ -3433,7 +3433,14 @@ .long_name = NULL_IF_CONFIG_SMALL("LC3 (Low Complexity Communication Codec)"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, }, - + { + .id = AV_CODEC_ID_DRA, + .type = AVMEDIA_TYPE_AUDIO, + .name = "dra", + .long_name = NULL_IF_CONFIG_SMALL("dra audio decoder"), + .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, + }, + /* subtitle codecs */ { .id = AV_CODEC_ID_DVD_SUBTITLE, diff -Naur ./ffmpeg-7.1.2/libavcodec/codec_id.h ./ffmpeg-7.1.2_cavs_dra/libavcodec/codec_id.h --- ./ffmpeg-7.1.2/libavcodec/codec_id.h 2025-09-15 03:20:04.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/codec_id.h 2025-08-05 12:23:31.162832100 +0800 @@ -544,6 +544,7 @@ AV_CODEC_ID_OSQ, AV_CODEC_ID_QOA, AV_CODEC_ID_LC3, + AV_CODEC_ID_DRA, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. diff -Naur ./ffmpeg-7.1.2/libavcodec/dradec.c ./ffmpeg-7.1.2_cavs_dra/libavcodec/dradec.c --- ./ffmpeg-7.1.2/libavcodec/dradec.c 1970-01-01 08:00:00.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/dradec.c 2026-01-22 22:04:42.587747400 +0800 @@ -0,0 +1,13815 @@ +#include "dradec.h" + +#include +#include +#include + +//Bitstream +typedef struct DRABitstream +{ + unsigned char* pStart; + unsigned char* pCurrent; + unsigned char* pEnd; + int nLeft; +}DRABitstream; + +static inline void InitGetBits(DRABitstream* bs, const unsigned char* pBuffer, int nBitSize) +{ + bs->pStart = (unsigned char*)pBuffer; + bs->pCurrent = (unsigned char*)pBuffer; + bs->pEnd = bs->pCurrent + nBitSize; + bs->nLeft = 8; +} + +static inline int DRABitstreamEof(DRABitstream* bs) +{ + return(bs->pCurrent >= bs->pEnd ? 1 : 0); +} + +static inline void DRABitstreamNextByte(DRABitstream* bs) +{ + bs->pCurrent++; + bs->nLeft = 8; +} + +const static unsigned int g_stBitStreamMask[33] = { 0x00, + 0x01, 0x03, 0x07, 0x0f, + 0x1f, 0x3f, 0x7f, 0xff, + 0x1ff, 0x3ff, 0x7ff, 0xfff, + 0x1fff, 0x3fff, 0x7fff, 0xffff, + 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, + 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, + 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, + 0x1fffffff,0x3fffffff,0x7fffffff,0xffffffff }; + +static inline unsigned int GetBits(DRABitstream* bs, int nCount) +{ + int nShift = 0; + unsigned int nResult = 0; + + while (nCount > 0) + { + if (bs->pCurrent >= bs->pEnd) + { + break; + } + if ((nShift = bs->nLeft - nCount) >= 0) + { + nResult |= (*bs->pCurrent >> nShift) & g_stBitStreamMask[nCount]; + bs->nLeft -= nCount; + if (bs->nLeft == 0) + { + DRABitstreamNextByte(bs); + } + return(nResult); + } + else + {//������ȡ��һ���ֽڴ���ֱ��ȡ��Ϊֹ + nResult |= (*bs->pCurrent & g_stBitStreamMask[bs->nLeft]) << -nShift; + nCount -= bs->nLeft; + DRABitstreamNextByte(bs); + } + } + + return(nResult); +} + +static inline int ShowBits(DRABitstream* bs, int nCount) +{ + int m = 0; + int nShift = 0; + unsigned int nResult = 0; + int left = bs->nLeft; + while (nCount > 0) + { + if ((bs->pCurrent + m) >= bs->pEnd) + { + break; + } + if ((nShift = left - nCount) >= 0) + { + nResult |= (*(bs->pCurrent + m) >> nShift) & g_stBitStreamMask[nCount]; + left -= nCount; + if (left == 0) + { + m++; + left = 8; + } + return(nResult); + } + else + { + nResult |= (*(bs->pCurrent + m) & g_stBitStreamMask[left]) << -nShift; + nCount -= left; + m++; + left = 8; + } + } + return(nResult); +} + + +static inline unsigned int GetBits1(DRABitstream* bs) +{ + + if (bs->pCurrent < bs->pEnd) + { + unsigned int nResult; + + bs->nLeft--; + nResult = (*bs->pCurrent >> bs->nLeft) & 0x01; + if (bs->nLeft == 0) + { + DRABitstreamNextByte(bs); + } + return nResult; + } + + return 0; +} + +static inline int GetInt(DRABitstream* bs, int nCount) +{ + unsigned int i_temp = 1 << (nCount - 1); + unsigned int nResult = GetBits(bs, nCount); + if (nResult & i_temp) + { + return 0 - (int)((~nResult + 1) << (32 - nCount) >> (32 - nCount)); + } + else + { + return nResult; + } +} + +static inline void ClearBits(DRABitstream* bs, int nCount) +{ + while (nCount > 0) + { + if (bs->pCurrent >= bs->pEnd) + { + break; + } + if ((bs->nLeft - nCount) >= 0) + { + bs->nLeft -= nCount; + if (bs->nLeft == 0) + { + DRABitstreamNextByte(bs); + } + break; + } + else + { + nCount -= bs->nLeft; + DRABitstreamNextByte(bs); + } + } +} + +///FFT + +typedef float real_t; +typedef real_t complex_t[2]; +#define RE(A) A[0] +#define IM(A) A[1] + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif +#define FRAC_CONST(A) ((real_t)(A)) +#define MUL_R(A,B) ((A)*(B)) +#define MUL_C(A,B) ((A)*(B)) +#define MUL_F(A,B) ((A)*(B)) + +static inline void ComplexMult(real_t* y1, real_t* y2, real_t x1, real_t x2, real_t c1, real_t c2) +{ + *y1 = MUL_F(x1, c1) + MUL_F(x2, c2); + *y2 = MUL_F(x2, c1) - MUL_F(x1, c2); +} + +typedef struct DRAFFT +{ + unsigned short n; + unsigned short ifac[15]; + complex_t* work; + complex_t* tab; +} DRAFFT; + + +static void DRAFFTProcess2(const unsigned short ido, const unsigned short l1, const complex_t* cc, complex_t* ch, const complex_t* wa); +static void DRAFFTProcess3(const unsigned short ido, const unsigned short l1, const complex_t* cc, complex_t* ch, const complex_t* wa1, const complex_t* wa2, const char isign); +static void DRAFFTProcess4(const unsigned short ido, const unsigned short l1, const complex_t* cc, complex_t* ch, const complex_t* wa1, const complex_t* wa2, const complex_t* wa3); +static void DRAFFTProcess5(const unsigned short ido, const unsigned short l1, const complex_t* cc, complex_t* ch, const complex_t* wa1, const complex_t* wa2, const complex_t* wa3, + const complex_t* wa4, const char isign); + + +static inline void DRAFFTProcess1(unsigned short n, complex_t* c, complex_t* ch, + const unsigned short* ifac, const complex_t* wa, + const char isign) +{ + unsigned short i; + unsigned short k1, l1, l2; + unsigned short na, nf, ip, iw, ix2, ix3, ix4, ido; + + nf = ifac[1]; + na = 0; + l1 = 1; + iw = 0; + + for (k1 = 2; k1 <= nf + 1; k1++) + { + ip = ifac[k1]; + l2 = ip * l1; + ido = n / l2; + + switch (ip) + { + case 4: + ix2 = iw + ido; + ix3 = ix2 + ido; + + if (na == 0) + DRAFFTProcess4((const unsigned short)ido, (const unsigned short)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3]); + else + DRAFFTProcess4((const unsigned short)ido, (const unsigned short)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3]); + + na = 1 - na; + break; + case 2: + if (na == 0) + DRAFFTProcess2((const unsigned short)ido, (const unsigned short)l1, (const complex_t*)c, ch, &wa[iw]); + else + DRAFFTProcess2((const unsigned short)ido, (const unsigned short)l1, (const complex_t*)ch, c, &wa[iw]); + + na = 1 - na; + break; + case 3: + ix2 = iw + ido; + + if (na == 0) + DRAFFTProcess3((const unsigned short)ido, (const unsigned short)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], isign); + else + DRAFFTProcess3((const unsigned short)ido, (const unsigned short)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], isign); + + na = 1 - na; + break; + case 5: + ix2 = iw + ido; + ix3 = ix2 + ido; + ix4 = ix3 + ido; + + if (na == 0) + DRAFFTProcess5((const unsigned short)ido, (const unsigned short)l1, (const complex_t*)c, ch, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign); + else + DRAFFTProcess5((const unsigned short)ido, (const unsigned short)l1, (const complex_t*)ch, c, &wa[iw], &wa[ix2], &wa[ix3], &wa[ix4], isign); + + na = 1 - na; + break; + } + + l1 = l2; + iw += (ip - 1) * ido; + } + + if (na == 0) + return; + + for (i = 0; i < n; i++) + { + RE(c[i]) = RE(ch[i]); + IM(c[i]) = IM(ch[i]); + } +} + +static void DRAFFTProcess2(const unsigned short ido, const unsigned short l1, const complex_t* cc, + complex_t* ch, const complex_t* wa) +{ + unsigned short i, k, ah, ac; + + if (ido == 1) + { + for (k = 0; k < l1; k++) + { + ah = 2 * k; + ac = 4 * k; + + RE(ch[ah]) = RE(cc[ac]) + RE(cc[ac + 1]); + RE(ch[ah + l1]) = RE(cc[ac]) - RE(cc[ac + 1]); + IM(ch[ah]) = IM(cc[ac]) + IM(cc[ac + 1]); + IM(ch[ah + l1]) = IM(cc[ac]) - IM(cc[ac + 1]); + } + } + else + { + for (k = 0; k < l1; k++) + { + ah = k * ido; + ac = 2 * k * ido; + + for (i = 0; i < ido; i++) + { + complex_t t2; + + RE(ch[ah + i]) = RE(cc[ac + i]) + RE(cc[ac + i + ido]); + RE(t2) = RE(cc[ac + i]) - RE(cc[ac + i + ido]); + + IM(ch[ah + i]) = IM(cc[ac + i]) + IM(cc[ac + i + ido]); + IM(t2) = IM(cc[ac + i]) - IM(cc[ac + i + ido]); + + + ComplexMult(&IM(ch[ah + i + l1 * ido]), &RE(ch[ah + i + l1 * ido]), + IM(t2), RE(t2), RE(wa[i]), IM(wa[i])); + + } + } + } +} + + + + +static void DRAFFTProcess3(const unsigned short ido, const unsigned short l1, const complex_t* cc, + complex_t* ch, const complex_t* wa1, const complex_t* wa2, + const char isign) +{ + static real_t taur = FRAC_CONST(-0.5); + static real_t taui = FRAC_CONST(0.866025403784439); + unsigned short i, k, ac, ah; + complex_t c2, c3, d2, d3, t2; + + if (ido == 1) + { + if (isign == 1) + { + for (k = 0; k < l1; k++) + { + ac = 3 * k + 1; + ah = k; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + 1]); + IM(t2) = IM(cc[ac]) + IM(cc[ac + 1]); + RE(c2) = RE(cc[ac - 1]) + MUL_F(RE(t2), taur); + IM(c2) = IM(cc[ac - 1]) + MUL_F(IM(t2), taur); + + RE(ch[ah]) = RE(cc[ac - 1]) + RE(t2); + IM(ch[ah]) = IM(cc[ac - 1]) + IM(t2); + + RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac + 1])), taui); + IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac + 1])), taui); + + RE(ch[ah + l1]) = RE(c2) - IM(c3); + IM(ch[ah + l1]) = IM(c2) + RE(c3); + RE(ch[ah + 2 * l1]) = RE(c2) + IM(c3); + IM(ch[ah + 2 * l1]) = IM(c2) - RE(c3); + } + } + else + { + for (k = 0; k < l1; k++) + { + ac = 3 * k + 1; + ah = k; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + 1]); + IM(t2) = IM(cc[ac]) + IM(cc[ac + 1]); + RE(c2) = RE(cc[ac - 1]) + MUL_F(RE(t2), taur); + IM(c2) = IM(cc[ac - 1]) + MUL_F(IM(t2), taur); + + RE(ch[ah]) = RE(cc[ac - 1]) + RE(t2); + IM(ch[ah]) = IM(cc[ac - 1]) + IM(t2); + + RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac + 1])), taui); + IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac + 1])), taui); + + RE(ch[ah + l1]) = RE(c2) + IM(c3); + IM(ch[ah + l1]) = IM(c2) - RE(c3); + RE(ch[ah + 2 * l1]) = RE(c2) - IM(c3); + IM(ch[ah + 2 * l1]) = IM(c2) + RE(c3); + } + } + } + else + { + if (isign == 1) + { + for (k = 0; k < l1; k++) + { + for (i = 0; i < ido; i++) + { + ac = i + (3 * k + 1) * ido; + ah = i + k * ido; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + ido]); + RE(c2) = RE(cc[ac - ido]) + MUL_F(RE(t2), taur); + IM(t2) = IM(cc[ac]) + IM(cc[ac + ido]); + IM(c2) = IM(cc[ac - ido]) + MUL_F(IM(t2), taur); + + RE(ch[ah]) = RE(cc[ac - ido]) + RE(t2); + IM(ch[ah]) = IM(cc[ac - ido]) + IM(t2); + + RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac + ido])), taui); + IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac + ido])), taui); + + RE(d2) = RE(c2) - IM(c3); + IM(d3) = IM(c2) - RE(c3); + RE(d3) = RE(c2) + IM(c3); + IM(d2) = IM(c2) + RE(c3); + + + ComplexMult(&IM(ch[ah + l1 * ido]), &RE(ch[ah + l1 * ido]), + IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i])); + ComplexMult(&IM(ch[ah + 2 * l1 * ido]), &RE(ch[ah + 2 * l1 * ido]), + IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i])); + + } + } + } + else + { + for (k = 0; k < l1; k++) + { + for (i = 0; i < ido; i++) + { + ac = i + (3 * k + 1) * ido; + ah = i + k * ido; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + ido]); + RE(c2) = RE(cc[ac - ido]) + MUL_F(RE(t2), taur); + IM(t2) = IM(cc[ac]) + IM(cc[ac + ido]); + IM(c2) = IM(cc[ac - ido]) + MUL_F(IM(t2), taur); + + RE(ch[ah]) = RE(cc[ac - ido]) + RE(t2); + IM(ch[ah]) = IM(cc[ac - ido]) + IM(t2); + + RE(c3) = MUL_F((RE(cc[ac]) - RE(cc[ac + ido])), taui); + IM(c3) = MUL_F((IM(cc[ac]) - IM(cc[ac + ido])), taui); + + RE(d2) = RE(c2) + IM(c3); + IM(d3) = IM(c2) + RE(c3); + RE(d3) = RE(c2) - IM(c3); + IM(d2) = IM(c2) - RE(c3); + + ComplexMult(&RE(ch[ah + l1 * ido]), &IM(ch[ah + l1 * ido]), + RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i])); + ComplexMult(&RE(ch[ah + 2 * l1 * ido]), &IM(ch[ah + 2 * l1 * ido]), + RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i])); + + } + } + } + } +} + + +static void DRAFFTProcess4(const unsigned short ido, const unsigned short l1, const complex_t* cc, + complex_t* ch, const complex_t* wa1, const complex_t* wa2, + const complex_t* wa3) +{ + unsigned short i, k, ac, ah; + + if (ido == 1) + { + for (k = 0; k < l1; k++) + { + complex_t t1, t2, t3, t4; + + ac = 4 * k; + ah = k; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + 2]); + RE(t1) = RE(cc[ac]) - RE(cc[ac + 2]); + IM(t2) = IM(cc[ac]) + IM(cc[ac + 2]); + IM(t1) = IM(cc[ac]) - IM(cc[ac + 2]); + RE(t3) = RE(cc[ac + 1]) + RE(cc[ac + 3]); + IM(t4) = RE(cc[ac + 1]) - RE(cc[ac + 3]); + IM(t3) = IM(cc[ac + 3]) + IM(cc[ac + 1]); + RE(t4) = IM(cc[ac + 3]) - IM(cc[ac + 1]); + + RE(ch[ah]) = RE(t2) + RE(t3); + RE(ch[ah + 2 * l1]) = RE(t2) - RE(t3); + + IM(ch[ah]) = IM(t2) + IM(t3); + IM(ch[ah + 2 * l1]) = IM(t2) - IM(t3); + + RE(ch[ah + l1]) = RE(t1) + RE(t4); + RE(ch[ah + 3 * l1]) = RE(t1) - RE(t4); + + IM(ch[ah + l1]) = IM(t1) + IM(t4); + IM(ch[ah + 3 * l1]) = IM(t1) - IM(t4); + } + } + else + { + for (k = 0; k < l1; k++) + { + ac = 4 * k * ido; + ah = k * ido; + + for (i = 0; i < ido; i++) + { + complex_t c2, c3, c4, t1, t2, t3, t4; + + RE(t2) = RE(cc[ac + i]) + RE(cc[ac + i + 2 * ido]); + RE(t1) = RE(cc[ac + i]) - RE(cc[ac + i + 2 * ido]); + IM(t2) = IM(cc[ac + i]) + IM(cc[ac + i + 2 * ido]); + IM(t1) = IM(cc[ac + i]) - IM(cc[ac + i + 2 * ido]); + RE(t3) = RE(cc[ac + i + ido]) + RE(cc[ac + i + 3 * ido]); + IM(t4) = RE(cc[ac + i + ido]) - RE(cc[ac + i + 3 * ido]); + IM(t3) = IM(cc[ac + i + 3 * ido]) + IM(cc[ac + i + ido]); + RE(t4) = IM(cc[ac + i + 3 * ido]) - IM(cc[ac + i + ido]); + + RE(c2) = RE(t1) + RE(t4); + RE(c4) = RE(t1) - RE(t4); + + IM(c2) = IM(t1) + IM(t4); + IM(c4) = IM(t1) - IM(t4); + + RE(ch[ah + i]) = RE(t2) + RE(t3); + RE(c3) = RE(t2) - RE(t3); + + IM(ch[ah + i]) = IM(t2) + IM(t3); + IM(c3) = IM(t2) - IM(t3); + + ComplexMult(&IM(ch[ah + i + l1 * ido]), &RE(ch[ah + i + l1 * ido]), + IM(c2), RE(c2), RE(wa1[i]), IM(wa1[i])); + ComplexMult(&IM(ch[ah + i + 2 * l1 * ido]), &RE(ch[ah + i + 2 * l1 * ido]), + IM(c3), RE(c3), RE(wa2[i]), IM(wa2[i])); + ComplexMult(&IM(ch[ah + i + 3 * l1 * ido]), &RE(ch[ah + i + 3 * l1 * ido]), + IM(c4), RE(c4), RE(wa3[i]), IM(wa3[i])); + + } + } + } +} + + +static void DRAFFTProcess5(const unsigned short ido, const unsigned short l1, const complex_t* cc, + complex_t* ch, const complex_t* wa1, const complex_t* wa2, const complex_t* wa3, + const complex_t* wa4, const char isign) +{ + static real_t tr11 = FRAC_CONST(0.309016994374947); + static real_t ti11 = FRAC_CONST(0.951056516295154); + static real_t tr12 = FRAC_CONST(-0.809016994374947); + static real_t ti12 = FRAC_CONST(0.587785252292473); + unsigned short i, k, ac, ah; + complex_t c2, c3, c4, c5, d3, d4, d5, d2, t2, t3, t4, t5; + + if (ido == 1) + { + if (isign == 1) + { + for (k = 0; k < l1; k++) + { + ac = 5 * k + 1; + ah = k; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + 3]); + IM(t2) = IM(cc[ac]) + IM(cc[ac + 3]); + RE(t3) = RE(cc[ac + 1]) + RE(cc[ac + 2]); + IM(t3) = IM(cc[ac + 1]) + IM(cc[ac + 2]); + RE(t4) = RE(cc[ac + 1]) - RE(cc[ac + 2]); + IM(t4) = IM(cc[ac + 1]) - IM(cc[ac + 2]); + RE(t5) = RE(cc[ac]) - RE(cc[ac + 3]); + IM(t5) = IM(cc[ac]) - IM(cc[ac + 3]); + + RE(ch[ah]) = RE(cc[ac - 1]) + RE(t2) + RE(t3); + IM(ch[ah]) = IM(cc[ac - 1]) + IM(t2) + IM(t3); + + RE(c2) = RE(cc[ac - 1]) + MUL_F(RE(t2), tr11) + MUL_F(RE(t3), tr12); + IM(c2) = IM(cc[ac - 1]) + MUL_F(IM(t2), tr11) + MUL_F(IM(t3), tr12); + RE(c3) = RE(cc[ac - 1]) + MUL_F(RE(t2), tr12) + MUL_F(RE(t3), tr11); + IM(c3) = IM(cc[ac - 1]) + MUL_F(IM(t2), tr12) + MUL_F(IM(t3), tr11); + + ComplexMult(&RE(c5), &RE(c4), + ti11, ti12, RE(t5), RE(t4)); + ComplexMult(&IM(c5), &IM(c4), + ti11, ti12, IM(t5), IM(t4)); + + RE(ch[ah + l1]) = RE(c2) - IM(c5); + IM(ch[ah + l1]) = IM(c2) + RE(c5); + RE(ch[ah + 2 * l1]) = RE(c3) - IM(c4); + IM(ch[ah + 2 * l1]) = IM(c3) + RE(c4); + RE(ch[ah + 3 * l1]) = RE(c3) + IM(c4); + IM(ch[ah + 3 * l1]) = IM(c3) - RE(c4); + RE(ch[ah + 4 * l1]) = RE(c2) + IM(c5); + IM(ch[ah + 4 * l1]) = IM(c2) - RE(c5); + } + } + else + { + for (k = 0; k < l1; k++) + { + ac = 5 * k + 1; + ah = k; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + 3]); + IM(t2) = IM(cc[ac]) + IM(cc[ac + 3]); + RE(t3) = RE(cc[ac + 1]) + RE(cc[ac + 2]); + IM(t3) = IM(cc[ac + 1]) + IM(cc[ac + 2]); + RE(t4) = RE(cc[ac + 1]) - RE(cc[ac + 2]); + IM(t4) = IM(cc[ac + 1]) - IM(cc[ac + 2]); + RE(t5) = RE(cc[ac]) - RE(cc[ac + 3]); + IM(t5) = IM(cc[ac]) - IM(cc[ac + 3]); + + RE(ch[ah]) = RE(cc[ac - 1]) + RE(t2) + RE(t3); + IM(ch[ah]) = IM(cc[ac - 1]) + IM(t2) + IM(t3); + + RE(c2) = RE(cc[ac - 1]) + MUL_F(RE(t2), tr11) + MUL_F(RE(t3), tr12); + IM(c2) = IM(cc[ac - 1]) + MUL_F(IM(t2), tr11) + MUL_F(IM(t3), tr12); + RE(c3) = RE(cc[ac - 1]) + MUL_F(RE(t2), tr12) + MUL_F(RE(t3), tr11); + IM(c3) = IM(cc[ac - 1]) + MUL_F(IM(t2), tr12) + MUL_F(IM(t3), tr11); + + ComplexMult(&RE(c4), &RE(c5), + ti12, ti11, RE(t5), RE(t4)); + ComplexMult(&IM(c4), &IM(c5), + ti12, ti11, IM(t5), IM(t4)); + + RE(ch[ah + l1]) = RE(c2) + IM(c5); + IM(ch[ah + l1]) = IM(c2) - RE(c5); + RE(ch[ah + 2 * l1]) = RE(c3) + IM(c4); + IM(ch[ah + 2 * l1]) = IM(c3) - RE(c4); + RE(ch[ah + 3 * l1]) = RE(c3) - IM(c4); + IM(ch[ah + 3 * l1]) = IM(c3) + RE(c4); + RE(ch[ah + 4 * l1]) = RE(c2) - IM(c5); + IM(ch[ah + 4 * l1]) = IM(c2) + RE(c5); + } + } + } + else + { + if (isign == 1) + { + for (k = 0; k < l1; k++) + { + for (i = 0; i < ido; i++) + { + ac = i + (k * 5 + 1) * ido; + ah = i + k * ido; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + 3 * ido]); + IM(t2) = IM(cc[ac]) + IM(cc[ac + 3 * ido]); + RE(t3) = RE(cc[ac + ido]) + RE(cc[ac + 2 * ido]); + IM(t3) = IM(cc[ac + ido]) + IM(cc[ac + 2 * ido]); + RE(t4) = RE(cc[ac + ido]) - RE(cc[ac + 2 * ido]); + IM(t4) = IM(cc[ac + ido]) - IM(cc[ac + 2 * ido]); + RE(t5) = RE(cc[ac]) - RE(cc[ac + 3 * ido]); + IM(t5) = IM(cc[ac]) - IM(cc[ac + 3 * ido]); + + RE(ch[ah]) = RE(cc[ac - ido]) + RE(t2) + RE(t3); + IM(ch[ah]) = IM(cc[ac - ido]) + IM(t2) + IM(t3); + + RE(c2) = RE(cc[ac - ido]) + MUL_F(RE(t2), tr11) + MUL_F(RE(t3), tr12); + IM(c2) = IM(cc[ac - ido]) + MUL_F(IM(t2), tr11) + MUL_F(IM(t3), tr12); + RE(c3) = RE(cc[ac - ido]) + MUL_F(RE(t2), tr12) + MUL_F(RE(t3), tr11); + IM(c3) = IM(cc[ac - ido]) + MUL_F(IM(t2), tr12) + MUL_F(IM(t3), tr11); + + ComplexMult(&RE(c5), &RE(c4), + ti11, ti12, RE(t5), RE(t4)); + ComplexMult(&IM(c5), &IM(c4), + ti11, ti12, IM(t5), IM(t4)); + + IM(d2) = IM(c2) + RE(c5); + IM(d3) = IM(c3) + RE(c4); + RE(d4) = RE(c3) + IM(c4); + RE(d5) = RE(c2) + IM(c5); + RE(d2) = RE(c2) - IM(c5); + IM(d5) = IM(c2) - RE(c5); + RE(d3) = RE(c3) - IM(c4); + IM(d4) = IM(c3) - RE(c4); + + + ComplexMult(&IM(ch[ah + l1 * ido]), &RE(ch[ah + l1 * ido]), + IM(d2), RE(d2), RE(wa1[i]), IM(wa1[i])); + ComplexMult(&IM(ch[ah + 2 * l1 * ido]), &RE(ch[ah + 2 * l1 * ido]), + IM(d3), RE(d3), RE(wa2[i]), IM(wa2[i])); + ComplexMult(&IM(ch[ah + 3 * l1 * ido]), &RE(ch[ah + 3 * l1 * ido]), + IM(d4), RE(d4), RE(wa3[i]), IM(wa3[i])); + ComplexMult(&IM(ch[ah + 4 * l1 * ido]), &RE(ch[ah + 4 * l1 * ido]), + IM(d5), RE(d5), RE(wa4[i]), IM(wa4[i])); + + } + } + } + else + { + for (k = 0; k < l1; k++) + { + for (i = 0; i < ido; i++) + { + ac = i + (k * 5 + 1) * ido; + ah = i + k * ido; + + RE(t2) = RE(cc[ac]) + RE(cc[ac + 3 * ido]); + IM(t2) = IM(cc[ac]) + IM(cc[ac + 3 * ido]); + RE(t3) = RE(cc[ac + ido]) + RE(cc[ac + 2 * ido]); + IM(t3) = IM(cc[ac + ido]) + IM(cc[ac + 2 * ido]); + RE(t4) = RE(cc[ac + ido]) - RE(cc[ac + 2 * ido]); + IM(t4) = IM(cc[ac + ido]) - IM(cc[ac + 2 * ido]); + RE(t5) = RE(cc[ac]) - RE(cc[ac + 3 * ido]); + IM(t5) = IM(cc[ac]) - IM(cc[ac + 3 * ido]); + + RE(ch[ah]) = RE(cc[ac - ido]) + RE(t2) + RE(t3); + IM(ch[ah]) = IM(cc[ac - ido]) + IM(t2) + IM(t3); + + RE(c2) = RE(cc[ac - ido]) + MUL_F(RE(t2), tr11) + MUL_F(RE(t3), tr12); + IM(c2) = IM(cc[ac - ido]) + MUL_F(IM(t2), tr11) + MUL_F(IM(t3), tr12); + RE(c3) = RE(cc[ac - ido]) + MUL_F(RE(t2), tr12) + MUL_F(RE(t3), tr11); + IM(c3) = IM(cc[ac - ido]) + MUL_F(IM(t2), tr12) + MUL_F(IM(t3), tr11); + + ComplexMult(&RE(c4), &RE(c5), + ti12, ti11, RE(t5), RE(t4)); + ComplexMult(&IM(c4), &IM(c5), + ti12, ti11, IM(t5), IM(t4)); + + IM(d2) = IM(c2) - RE(c5); + IM(d3) = IM(c3) - RE(c4); + RE(d4) = RE(c3) - IM(c4); + RE(d5) = RE(c2) - IM(c5); + RE(d2) = RE(c2) + IM(c5); + IM(d5) = IM(c2) + RE(c5); + RE(d3) = RE(c3) + IM(c4); + IM(d4) = IM(c3) + RE(c4); + + ComplexMult(&RE(ch[ah + l1 * ido]), &IM(ch[ah + l1 * ido]), + RE(d2), IM(d2), RE(wa1[i]), IM(wa1[i])); + ComplexMult(&RE(ch[ah + 2 * l1 * ido]), &IM(ch[ah + 2 * l1 * ido]), + RE(d3), IM(d3), RE(wa2[i]), IM(wa2[i])); + ComplexMult(&RE(ch[ah + 3 * l1 * ido]), &IM(ch[ah + 3 * l1 * ido]), + RE(d4), IM(d4), RE(wa3[i]), IM(wa3[i])); + ComplexMult(&RE(ch[ah + 4 * l1 * ido]), &IM(ch[ah + 4 * l1 * ido]), + RE(d5), IM(d5), RE(wa4[i]), IM(wa4[i])); + + } + } + } + } +} + + + + + + +static void DRAFFTProcess(DRAFFT* fft, complex_t* c) +{ + DRAFFTProcess1(fft->n, c, fft->work, (const unsigned short*)fft->ifac, (const complex_t*)fft->tab, +1); +} + +static void init(unsigned short n, complex_t* wa, unsigned short* ifac) +{ + static unsigned short ntryh[4] = { 3, 4, 2, 5 }; + + real_t arg, argh, argld, fi; + unsigned short ido, ipm; + unsigned short i1, k1, l1, l2; + unsigned short ld, ii, ip; + + unsigned short ntry = 0, i, j; + unsigned short ib; + unsigned short nf, nl, nq, nr; + + nl = n; + nf = 0; + j = 0; + +startloop: + j++; + + if (j <= 4) + ntry = ntryh[j - 1]; + else + ntry += 2; + + do + { + nq = nl / ntry; + nr = nl - ntry * nq; + + if (nr != 0) + goto startloop; + + nf++; + ifac[nf + 1] = ntry; + nl = nq; + + if (ntry == 2 && nf != 1) + { + for (i = 2; i <= nf; i++) + { + ib = nf - i + 2; + ifac[ib + 1] = ifac[ib]; + } + ifac[2] = 2; + } + } while (nl != 1); + + ifac[0] = n; + ifac[1] = nf; + + + argh = (real_t)2.0 * (real_t)M_PI / (real_t)n; + i = 0; + l1 = 1; + + for (k1 = 1; k1 <= nf; k1++) + { + ip = ifac[k1 + 1]; + ld = 0; + l2 = l1 * ip; + ido = n / l2; + ipm = ip - 1; + + for (j = 0; j < ipm; j++) + { + i1 = i; + RE(wa[i]) = 1.0; + IM(wa[i]) = 0.0; + ld += l1; + fi = 0; + argld = ld * argh; + + for (ii = 0; ii < ido; ii++) + { + i++; + fi++; + arg = fi * argld; + RE(wa[i]) = (real_t)cos(arg); + IM(wa[i]) = (real_t)sin(arg); + } + + if (ip > 5) + { + RE(wa[i1]) = RE(wa[i]); + IM(wa[i1]) = IM(wa[i]); + } + } + l1 = l2; + } + +} + +static DRAFFT* DRAFFTInit(unsigned short n) +{ + DRAFFT* fft = (DRAFFT*)malloc(sizeof(DRAFFT)); + fft->n = n; + fft->work = (complex_t*)malloc(n * sizeof(complex_t)); + fft->tab = (complex_t*)malloc(n * sizeof(complex_t)); + init(n, fft->tab, fft->ifac); + return fft; +} + +static void DRAFFTFree(DRAFFT* fft) +{ + if (fft->work) + { + free(fft->work); + } + + if (fft->tab) + { + free(fft->tab); + } + + if (fft) + { + free(fft); + } +} + +///MDCT + +static const complex_t DRAMDCTTable2048[] = +{ + {0.9999999265f, 0.0003834952f}, {0.9999940437f, 0.0034514499f}, + {0.9999787487f, 0.0065193722f}, {0.9999540414f, 0.0095872330f}, + {0.9999199222f, 0.0126550037f}, {0.9998763914f, 0.0157226552f}, + {0.9998234494f, 0.0187901588f}, {0.9997610966f, 0.0218574855f}, + {0.9996893337f, 0.0249246064f}, {0.9996081614f, 0.0279914928f}, + {0.9995175804f, 0.0310581156f}, {0.9994175915f, 0.0341244462f}, + {0.9993081957f, 0.0371904556f}, {0.9991893941f, 0.0402561149f}, + {0.9990611877f, 0.0433213953f}, {0.9989235777f, 0.0463862679f}, + {0.9987765655f, 0.0494507040f}, {0.9986201525f, 0.0525146746f}, + {0.9984543400f, 0.0555781509f}, {0.9982791298f, 0.0586411041f}, + {0.9980945233f, 0.0617035053f}, {0.9979005224f, 0.0647653257f}, + {0.9976971289f, 0.0678265366f}, {0.9974843446f, 0.0708871090f}, + {0.9972621717f, 0.0739470143f}, {0.9970306121f, 0.0770062235f}, + {0.9967896682f, 0.0800647079f}, {0.9965393420f, 0.0831224387f}, + {0.9962796361f, 0.0861793871f}, {0.9960105527f, 0.0892355244f}, + {0.9957320946f, 0.0922908218f}, {0.9954442642f, 0.0953452504f}, + {0.9951470644f, 0.0983987817f}, {0.9948404978f, 0.1014513868f}, + {0.9945245675f, 0.1045030369f}, {0.9941992762f, 0.1075537035f}, + {0.9938646272f, 0.1106033577f}, {0.9935206236f, 0.1136519709f}, + {0.9931672686f, 0.1166995144f}, {0.9928045655f, 0.1197459594f}, + {0.9924325177f, 0.1227912773f}, {0.9920511288f, 0.1258354395f}, + {0.9916604023f, 0.1288784173f}, {0.9912603420f, 0.1319201820f}, + {0.9908509515f, 0.1349607050f}, {0.9904322348f, 0.1379999577f}, + {0.9900041957f, 0.1410379115f}, {0.9895668383f, 0.1440745379f}, + {0.9891201668f, 0.1471098081f}, {0.9886641853f, 0.1501436937f}, + {0.9881988981f, 0.1531761660f}, {0.9877243096f, 0.1562071967f}, + {0.9872404242f, 0.1592367570f}, {0.9867472466f, 0.1622648185f}, + {0.9862447813f, 0.1652913528f}, {0.9857330331f, 0.1683163312f}, + {0.9852120069f, 0.1713397254f}, {0.9846817074f, 0.1743615069f}, + {0.9841421397f, 0.1773816472f}, {0.9835933090f, 0.1804001180f}, + {0.9830352202f, 0.1834168907f}, {0.9824678788f, 0.1864319371f}, + {0.9818912900f, 0.1894452287f}, {0.9813054592f, 0.1924567371f}, + {0.9807103921f, 0.1954664341f}, {0.9801060941f, 0.1984742913f}, + {0.9794925710f, 0.2014802803f}, {0.9788698285f, 0.2044843730f}, + {0.9782378726f, 0.2074865410f}, {0.9775967091f, 0.2104867560f}, + {0.9769463440f, 0.2134849898f}, {0.9762867836f, 0.2164812143f}, + {0.9756180340f, 0.2194754011f}, {0.9749401015f, 0.2224675222f}, + {0.9742529925f, 0.2254575493f}, {0.9735567135f, 0.2284454543f}, + {0.9728512710f, 0.2314312091f}, {0.9721366716f, 0.2344147856f}, + {0.9714129221f, 0.2373961556f}, {0.9706800293f, 0.2403752912f}, + {0.9699380001f, 0.2433521644f}, {0.9691868415f, 0.2463267469f}, + {0.9684265605f, 0.2492990110f}, {0.9676571643f, 0.2522689286f}, + {0.9668786602f, 0.2552364717f}, {0.9660910554f, 0.2582016124f}, + {0.9652943574f, 0.2611643229f}, {0.9644885737f, 0.2641245751f}, + {0.9636737119f, 0.2670823413f}, {0.9628497796f, 0.2700375937f}, + {0.9620167845f, 0.2729903043f}, {0.9611747347f, 0.2759404455f}, + {0.9603236378f, 0.2788879894f}, {0.9594635021f, 0.2818329083f}, + {0.9585943355f, 0.2847751745f}, {0.9577161462f, 0.2877147602f}, + {0.9568289426f, 0.2906516379f}, {0.9559327329f, 0.2935857799f}, + {0.9550275256f, 0.2965171585f}, {0.9541133293f, 0.2994457462f}, + {0.9531901524f, 0.3023715154f}, {0.9522580038f, 0.3052944385f}, + {0.9513168922f, 0.3082144882f}, {0.9503668263f, 0.3111316367f}, + {0.9494078153f, 0.3140458568f}, {0.9484398681f, 0.3169571210f}, + {0.9474629938f, 0.3198654018f}, {0.9464772017f, 0.3227706720f}, + {0.9454825009f, 0.3256729041f}, {0.9444789009f, 0.3285720709f}, + {0.9434664111f, 0.3314681450f}, {0.9424450410f, 0.3343610992f}, + {0.9414148003f, 0.3372509062f}, {0.9403756986f, 0.3401375390f}, + {0.9393277458f, 0.3430209702f}, {0.9382709516f, 0.3459011728f}, + {0.9372053261f, 0.3487781196f}, {0.9361308792f, 0.3516517836f}, + {0.9350476212f, 0.3545221378f}, {0.9339555621f, 0.3573891550f}, + {0.9328547122f, 0.3602528083f}, {0.9317450820f, 0.3631130708f}, + {0.9306266818f, 0.3659699156f}, {0.9294995222f, 0.3688233157f}, + {0.9283636138f, 0.3716732443f}, {0.9272189673f, 0.3745196745f}, + {0.9260655935f, 0.3773625797f}, {0.9249035032f, 0.3802019329f}, + {0.9237327073f, 0.3830377076f}, {0.9225532169f, 0.3858698769f}, + {0.9213650431f, 0.3886984143f}, {0.9201681971f, 0.3915232932f}, + {0.9189626901f, 0.3943444868f}, {0.9177485334f, 0.3971619688f}, + {0.9165257386f, 0.3999757125f}, {0.9152943170f, 0.4027856914f}, + {0.9140542804f, 0.4055918792f}, {0.9128056403f, 0.4083942495f}, + {0.9115484086f, 0.4111927757f}, {0.9102825970f, 0.4139874317f}, + {0.9090082175f, 0.4167781910f}, {0.9077252821f, 0.4195650275f}, + {0.9064338028f, 0.4223479149f}, {0.9051337918f, 0.4251268269f}, + {0.9038252613f, 0.4279017375f}, {0.9025082237f, 0.4306726206f}, + {0.9011826914f, 0.4334394500f}, {0.8998486767f, 0.4362021996f}, + {0.8985061924f, 0.4389608436f}, {0.8971552510f, 0.4417153559f}, + {0.8957958652f, 0.4444657107f}, {0.8944280478f, 0.4472118819f}, + {0.8930518117f, 0.4499538438f}, {0.8916671699f, 0.4526915706f}, + {0.8902741354f, 0.4554250365f}, {0.8888727213f, 0.4581542157f}, + {0.8874629408f, 0.4608790826f}, {0.8860448071f, 0.4635996116f}, + {0.8846183336f, 0.4663157769f}, {0.8831835338f, 0.4690275532f}, + {0.8817404211f, 0.4717349147f}, {0.8802890092f, 0.4744378361f}, + {0.8788293116f, 0.4771362920f}, {0.8773613421f, 0.4798302568f}, + {0.8758851146f, 0.4825197053f}, {0.8744006429f, 0.4852046121f}, + {0.8729079411f, 0.4878849520f}, {0.8714070231f, 0.4905606998f}, + {0.8698979030f, 0.4932318302f}, {0.8683805952f, 0.4958983181f}, + {0.8668551138f, 0.4985601384f}, {0.8653214733f, 0.5012172661f}, + {0.8637796880f, 0.5038696761f}, {0.8622297726f, 0.5065173436f}, + {0.8606717414f, 0.5091602435f}, {0.8591056093f, 0.5117983509f}, + {0.8575313910f, 0.5144316412f}, {0.8559491013f, 0.5170600894f}, + {0.8543587550f, 0.5196836709f}, {0.8527603672f, 0.5223023608f}, + {0.8511539529f, 0.5249161347f}, {0.8495395272f, 0.5275249679f}, + {0.8479171053f, 0.5301288358f}, {0.8462867025f, 0.5327277139f}, + {0.8446483341f, 0.5353215778f}, {0.8430020156f, 0.5379104031f}, + {0.8413477624f, 0.5404941653f}, {0.8396855901f, 0.5430728402f}, + {0.8380155144f, 0.5456464035f}, {0.8363375510f, 0.5482148309f}, + {0.8346517156f, 0.5507780984f}, {0.8329580242f, 0.5533361817f}, + {0.8312564927f, 0.5558890568f}, {0.8295471370f, 0.5584366996f}, + {0.8278299734f, 0.5609790863f}, {0.8261050178f, 0.5635161928f}, + {0.8243722867f, 0.5660479952f}, {0.8226317963f, 0.5685744698f}, + {0.8208835629f, 0.5710955928f}, {0.8191276031f, 0.5736113404f}, + {0.8173639334f, 0.5761216889f}, {0.8155925703f, 0.5786266148f}, + {0.8138135305f, 0.5811260944f}, {0.8120268308f, 0.5836201042f}, + {0.8102324880f, 0.5861086208f}, {0.8084305190f, 0.5885916207f}, + {0.8066209407f, 0.5910690806f}, {0.8048037702f, 0.5935409771f}, + {0.8029790246f, 0.5960072869f}, {0.8011467210f, 0.5984679869f}, + {0.7993068768f, 0.6009230539f}, {0.7974595091f, 0.6033724648f}, + {0.7956046355f, 0.6058161965f}, {0.7937422734f, 0.6082542260f}, + {0.7918724402f, 0.6106865305f}, {0.7899951536f, 0.6131130869f}, + {0.7881104313f, 0.6155338724f}, {0.7862182910f, 0.6179488643f}, + {0.7843187505f, 0.6203580398f}, {0.7824118277f, 0.6227613763f}, + {0.7804975406f, 0.6251588512f}, {0.7785759071f, 0.6275504418f}, + {0.7766469453f, 0.6299361256f}, {0.7747106735f, 0.6323158803f}, + {0.7727671097f, 0.6346896833f}, {0.7708162725f, 0.6370575124f}, + {0.7688581799f, 0.6394193453f}, {0.7668928506f, 0.6417751597f}, + {0.7649203031f, 0.6441249335f}, {0.7629405558f, 0.6464686446f}, + {0.7609536274f, 0.6488062708f}, {0.7589595366f, 0.6511377902f}, + {0.7569583022f, 0.6534631809f}, {0.7549499430f, 0.6557824209f}, + {0.7529344780f, 0.6580954884f}, {0.7509119260f, 0.6604023617f}, + {0.7488823062f, 0.6627030191f}, {0.7468456376f, 0.6649974388f}, + {0.7448019394f, 0.6672855993f}, {0.7427512308f, 0.6695674791f}, + {0.7406935312f, 0.6718430567f}, {0.7386288599f, 0.6741123106f}, + {0.7365572364f, 0.6763752195f}, {0.7344786801f, 0.6786317621f}, + {0.7323932106f, 0.6808819171f}, {0.7303008475f, 0.6831256635f}, + {0.7282016106f, 0.6853629800f}, {0.7260955195f, 0.6875938456f}, + {0.7239825942f, 0.6898182393f}, {0.7218628545f, 0.6920361402f}, + {0.7197363203f, 0.6942475274f}, {0.7176030117f, 0.6964523800f}, + {0.7154629487f, 0.6986506774f}, {0.7133161515f, 0.7008423988f}, + {0.7111626404f, 0.7030275236f}, {0.7090024355f, 0.7052060313f}, + {0.7068355571f, 0.7073779012f}, {0.7046620258f, 0.7095431131f}, + {0.7024818620f, 0.7117016465f}, {0.7002950861f, 0.7138534811f}, + {0.6981017187f, 0.7159985966f}, {0.6959017806f, 0.7181369728f}, + {0.6936952924f, 0.7202685897f}, {0.6914822748f, 0.7223934272f}, + {0.6892627488f, 0.7245114652f}, {0.6870367351f, 0.7266226838f}, + {0.6848042548f, 0.7287270632f}, {0.6825653289f, 0.7308245835f}, + {0.6803199784f, 0.7329152250f}, {0.6780682244f, 0.7349989680f}, + {0.6758100883f, 0.7370757930f}, {0.6735455911f, 0.7391456803f}, + {0.6712747543f, 0.7412086105f}, {0.6689975992f, 0.7432645642f}, + {0.6667141472f, 0.7453135219f}, {0.6644244198f, 0.7473554645f}, + {0.6621284387f, 0.7493903727f}, {0.6598262253f, 0.7514182273f}, + {0.6575178014f, 0.7534390094f}, {0.6552031887f, 0.7554526997f}, + {0.6528824090f, 0.7574592795f}, {0.6505554841f, 0.7594587297f}, + {0.6482224359f, 0.7614510317f}, {0.6458832864f, 0.7634361665f}, + {0.6435380576f, 0.7654141157f}, {0.6411867716f, 0.7673848604f}, + {0.6388294504f, 0.7693483822f}, {0.6364661164f, 0.7713046627f}, + {0.6340967917f, 0.7732536833f}, {0.6317214987f, 0.7751954258f}, + {0.6293402596f, 0.7771298718f}, {0.6269530970f, 0.7790570032f}, + {0.6245600332f, 0.7809768018f}, {0.6221610909f, 0.7828892495f}, + {0.6197562925f, 0.7847943284f}, {0.6173456607f, 0.7866920205f}, + {0.6149292183f, 0.7885823080f}, {0.6125069879f, 0.7904651730f}, + {0.6100789923f, 0.7923405979f}, {0.6076452545f, 0.7942085650f}, + {0.6052057973f, 0.7960690567f}, {0.6027606436f, 0.7979220554f}, + {0.6003098165f, 0.7997675438f}, {0.5978533391f, 0.8016055045f}, + {0.5953912345f, 0.8034359202f}, {0.5929235258f, 0.8052587737f}, + {0.5904502363f, 0.8070740477f}, {0.5879713892f, 0.8088817253f}, + {0.5854870079f, 0.8106817893f}, {0.5829971159f, 0.8124742229f}, + {0.5805017364f, 0.8142590092f}, {0.5780008930f, 0.8160361314f}, + {0.5754946092f, 0.8178055727f}, {0.5729829087f, 0.8195673165f}, + {0.5704658151f, 0.8213213463f}, {0.5679433520f, 0.8230676454f}, + {0.5654155432f, 0.8248061976f}, {0.5628824124f, 0.8265369863f}, + {0.5603439837f, 0.8282599954f}, {0.5578002807f, 0.8299752085f}, + {0.5552513276f, 0.8316826097f}, {0.5526971482f, 0.8333821827f}, + {0.5501377666f, 0.8350739116f}, {0.5475732069f, 0.8367577804f}, + {0.5450034932f, 0.8384337734f}, {0.5424286497f, 0.8401018747f}, + {0.5398487007f, 0.8417620687f}, {0.5372636705f, 0.8434143397f}, + {0.5346735833f, 0.8450586721f}, {0.5320784635f, 0.8466950506f}, + {0.5294783357f, 0.8483234596f}, {0.5268732241f, 0.8499438838f}, + {0.5242631535f, 0.8515563081f}, {0.5216481483f, 0.8531607172f}, + {0.5190282331f, 0.8547570960f}, {0.5164034326f, 0.8563454296f}, + {0.5137737716f, 0.8579257029f}, {0.5111392747f, 0.8594979010f}, + {0.5084999668f, 0.8610620092f}, {0.5058558727f, 0.8626180128f}, + {0.5032070173f, 0.8641658971f}, {0.5005534255f, 0.8657056476f}, + {0.4978951223f, 0.8672372497f}, {0.4952321327f, 0.8687606890f}, + {0.4925644818f, 0.8702759512f}, {0.4898921947f, 0.8717830221f}, + {0.4872152966f, 0.8732818874f}, {0.4845338126f, 0.8747725330f}, + {0.4818477680f, 0.8762549449f}, {0.4791571880f, 0.8777291092f}, + {0.4764620980f, 0.8791950120f}, {0.4737625234f, 0.8806526395f}, + {0.4710584896f, 0.8821019779f}, {0.4683500220f, 0.8835430136f}, + {0.4656371461f, 0.8849757331f}, {0.4629198874f, 0.8864001229f}, + {0.4601982716f, 0.8878161695f}, {0.4574723242f, 0.8892238597f}, + {0.4547420709f, 0.8906231801f}, {0.4520075374f, 0.8920141177f}, + {0.4492687494f, 0.8933966593f}, {0.4465257327f, 0.8947707919f}, + {0.4437785132f, 0.8961365026f}, {0.4410271166f, 0.8974937785f}, + {0.4382715690f, 0.8988426068f}, {0.4355118961f, 0.9001829749f}, + {0.4327481241f, 0.9015148702f}, {0.4299802788f, 0.9028382800f}, + {0.4272083864f, 0.9041531920f}, {0.4244324730f, 0.9054595937f}, + {0.4216525647f, 0.9067574729f}, {0.4188686876f, 0.9080468174f}, + {0.4160808679f, 0.9093276150f}, {0.4132891320f, 0.9105998536f}, + {0.4104935060f, 0.9118635213f}, {0.4076940163f, 0.9131186063f}, + {0.4048906892f, 0.9143650966f}, {0.4020835511f, 0.9156029805f}, + {0.3992726285f, 0.9168322465f}, {0.3964579477f, 0.9180528828f}, + {0.3936395354f, 0.9192648782f}, {0.3908174179f, 0.9204682210f}, + {0.3879916219f, 0.9216629000f}, {0.3851621741f, 0.9228489040f}, + {0.3823291009f, 0.9240262218f}, {0.3794924291f, 0.9251948423f}, + {0.3766521853f, 0.9263547546f}, {0.3738083964f, 0.9275059476f}, + {0.3709610890f, 0.9286484106f}, {0.3681102900f, 0.9297821327f}, + {0.3652560263f, 0.9309071035f}, {0.3623983246f, 0.9320233121f}, + {0.3595372118f, 0.9331307482f}, {0.3566727150f, 0.9342294014f}, + {0.3538048610f, 0.9353192612f}, {0.3509336769f, 0.9364003174f}, + {0.3480591896f, 0.9374725599f}, {0.3451814263f, 0.9385359785f}, + {0.3423004140f, 0.9395905633f}, {0.3394161799f, 0.9406363042f}, + {0.3365287510f, 0.9416731916f}, {0.3336381546f, 0.9427012155f}, + {0.3307444179f, 0.9437203665f}, {0.3278475680f, 0.9447306347f}, + {0.3249476324f, 0.9457320108f}, {0.3220446382f, 0.9467244853f}, + {0.3191386128f, 0.9477080488f}, {0.3162295836f, 0.9486826922f}, + {0.3133175778f, 0.9496484062f}, {0.3104026231f, 0.9506051818f}, + {0.3074847467f, 0.9515530099f}, {0.3045639761f, 0.9524918816f}, + {0.3016403388f, 0.9534217881f}, {0.2987138624f, 0.9543427206f}, + {0.2957845744f, 0.9552546705f}, {0.2928525024f, 0.9561576292f}, + {0.2899176739f, 0.9570515881f}, {0.2869801166f, 0.9579365390f}, + {0.2840398581f, 0.9588124733f}, {0.2810969262f, 0.9596793830f}, + {0.2781513484f, 0.9605372598f}, {0.2752031526f, 0.9613860956f}, + {0.2722523665f, 0.9622258825f}, {0.2692990178f, 0.9630566126f}, + {0.2663431344f, 0.9638782780f}, {0.2633847440f, 0.9646908710f}, + {0.2604238746f, 0.9654943840f}, {0.2574605540f, 0.9662888094f}, + {0.2544948100f, 0.9670741397f}, {0.2515266707f, 0.9678503675f}, + {0.2485561639f, 0.9686174856f}, {0.2455833176f, 0.9693754867f}, + {0.2426081597f, 0.9701243636f}, {0.2396307184f, 0.9708641093f}, + {0.2366510215f, 0.9715947170f}, {0.2336690972f, 0.9723161796f}, + {0.2306849735f, 0.9730284903f}, {0.2276986785f, 0.9737316426f}, + {0.2247102403f, 0.9744256297f}, {0.2217196871f, 0.9751104452f}, + {0.2187270470f, 0.9757860826f}, {0.2157323481f, 0.9764525355f}, + {0.2127356187f, 0.9771097976f}, {0.2097368869f, 0.9777578628f}, + {0.2067361810f, 0.9783967250f}, {0.2037335292f, 0.9790263781f}, + {0.2007289598f, 0.9796468163f}, {0.1977225010f, 0.9802580337f}, + {0.1947141812f, 0.9808600245f}, {0.1917040287f, 0.9814527831f}, + {0.1886920718f, 0.9820363038f}, {0.1856783389f, 0.9826105813f}, + {0.1826628583f, 0.9831756101f}, {0.1796456584f, 0.9837313848f}, + {0.1766267676f, 0.9842779003f}, {0.1736062143f, 0.9848151514f}, + {0.1705840270f, 0.9853431330f}, {0.1675602340f, 0.9858618402f}, + {0.1645348640f, 0.9863712681f}, {0.1615079452f, 0.9868714119f}, + {0.1584795063f, 0.9873622669f}, {0.1554495757f, 0.9878438284f}, + {0.1524181820f, 0.9883160920f}, {0.1493853537f, 0.9887790532f}, + {0.1463511192f, 0.9892327077f}, {0.1433155073f, 0.9896770510f}, + {0.1402785464f, 0.9901120792f}, {0.1372402652f, 0.9905377881f}, + {0.1342006922f, 0.9909541736f}, {0.1311598561f, 0.9913612319f}, + {0.1281177854f, 0.9917589592f}, {0.1250745089f, 0.9921473516f}, + {0.1220300551f, 0.9925264055f}, {0.1189844527f, 0.9928961174f}, + {0.1159377304f, 0.9932564838f}, {0.1128899168f, 0.9936075013f}, + {0.1098410406f, 0.9939491666f}, {0.1067911306f, 0.9942814765f}, + {0.1037402155f, 0.9946044277f}, {0.1006883239f, 0.9949180174f}, + {0.0976354846f, 0.9952222426f}, {0.0945817263f, 0.9955171003f}, + {0.0915270777f, 0.9958025879f}, {0.0884715677f, 0.9960787026f}, + {0.0854152249f, 0.9963454418f}, {0.0823580782f, 0.9966028030f}, + {0.0793001563f, 0.9968507838f}, {0.0762414880f, 0.9970893819f}, + {0.0731821021f, 0.9973185950f}, {0.0701220274f, 0.9975384210f}, + {0.0670612926f, 0.9977488577f}, {0.0639999267f, 0.9979499032f}, + {0.0609379583f, 0.9981415557f}, {0.0578754164f, 0.9983238133f}, + {0.0548123297f, 0.9984966743f}, {0.0517487271f, 0.9986601370f}, + {0.0486846375f, 0.9988142000f}, {0.0456200896f, 0.9989588617f}, + {0.0425551123f, 0.9990941209f}, {0.0394897344f, 0.9992199762f}, + {0.0364239849f, 0.9993364265f}, {0.0333578925f, 0.9994434706f}, + {0.0302914862f, 0.9995411076f}, {0.0272247947f, 0.9996293366f}, + {0.0241578470f, 0.9997081566f}, {0.0210906719f, 0.9997775670f}, + {0.0180232983f, 0.9998375672f}, {0.0149557551f, 0.9998881564f}, + {0.0118880711f, 0.9999293344f}, {0.0088202752f, 0.9999611006f}, + {0.0057523962f, 0.9999834548f}, {0.0026844632f, 0.9999963968f}, + {-0.0003834952f, 0.9999999265f}, {-0.0034514499f, 0.9999940437f}, + {-0.0065193722f, 0.9999787487f}, {-0.0095872330f, 0.9999540414f}, + {-0.0126550037f, 0.9999199222f}, {-0.0157226552f, 0.9998763914f}, + {-0.0187901588f, 0.9998234494f}, {-0.0218574855f, 0.9997610966f}, + {-0.0249246064f, 0.9996893337f}, {-0.0279914928f, 0.9996081614f}, + {-0.0310581156f, 0.9995175804f}, {-0.0341244462f, 0.9994175915f}, + {-0.0371904556f, 0.9993081957f}, {-0.0402561149f, 0.9991893941f}, + {-0.0433213953f, 0.9990611877f}, {-0.0463862679f, 0.9989235777f}, + {-0.0494507040f, 0.9987765655f}, {-0.0525146746f, 0.9986201525f}, + {-0.0555781509f, 0.9984543400f}, {-0.0586411041f, 0.9982791298f}, + {-0.0617035053f, 0.9980945233f}, {-0.0647653257f, 0.9979005224f}, + {-0.0678265366f, 0.9976971289f}, {-0.0708871090f, 0.9974843446f}, + {-0.0739470143f, 0.9972621717f}, {-0.0770062235f, 0.9970306121f}, + {-0.0800647079f, 0.9967896682f}, {-0.0831224387f, 0.9965393420f}, + {-0.0861793871f, 0.9962796361f}, {-0.0892355244f, 0.9960105527f}, + {-0.0922908218f, 0.9957320946f}, {-0.0953452504f, 0.9954442642f}, + {-0.0983987817f, 0.9951470644f}, {-0.1014513868f, 0.9948404978f}, + {-0.1045030369f, 0.9945245675f}, {-0.1075537035f, 0.9941992762f}, + {-0.1106033577f, 0.9938646272f}, {-0.1136519709f, 0.9935206236f}, + {-0.1166995144f, 0.9931672686f}, {-0.1197459594f, 0.9928045655f}, + {-0.1227912773f, 0.9924325177f}, {-0.1258354395f, 0.9920511288f}, + {-0.1288784173f, 0.9916604023f}, {-0.1319201820f, 0.9912603420f}, + {-0.1349607050f, 0.9908509515f}, {-0.1379999577f, 0.9904322348f}, + {-0.1410379115f, 0.9900041957f}, {-0.1440745379f, 0.9895668383f}, + {-0.1471098081f, 0.9891201668f}, {-0.1501436937f, 0.9886641853f}, + {-0.1531761660f, 0.9881988981f}, {-0.1562071967f, 0.9877243096f}, + {-0.1592367570f, 0.9872404242f}, {-0.1622648185f, 0.9867472466f}, + {-0.1652913528f, 0.9862447813f}, {-0.1683163312f, 0.9857330331f}, + {-0.1713397254f, 0.9852120069f}, {-0.1743615069f, 0.9846817074f}, + {-0.1773816472f, 0.9841421397f}, {-0.1804001180f, 0.9835933090f}, + {-0.1834168907f, 0.9830352202f}, {-0.1864319371f, 0.9824678788f}, + {-0.1894452287f, 0.9818912900f}, {-0.1924567371f, 0.9813054592f}, + {-0.1954664341f, 0.9807103921f}, {-0.1984742913f, 0.9801060941f}, + {-0.2014802803f, 0.9794925710f}, {-0.2044843730f, 0.9788698285f}, + {-0.2074865410f, 0.9782378726f}, {-0.2104867560f, 0.9775967091f}, + {-0.2134849898f, 0.9769463440f}, {-0.2164812143f, 0.9762867836f}, + {-0.2194754011f, 0.9756180340f}, {-0.2224675222f, 0.9749401015f}, + {-0.2254575493f, 0.9742529925f}, {-0.2284454543f, 0.9735567135f}, + {-0.2314312091f, 0.9728512710f}, {-0.2344147856f, 0.9721366716f}, + {-0.2373961556f, 0.9714129221f}, {-0.2403752912f, 0.9706800293f}, + {-0.2433521644f, 0.9699380001f}, {-0.2463267469f, 0.9691868415f}, + {-0.2492990110f, 0.9684265605f}, {-0.2522689286f, 0.9676571643f}, + {-0.2552364717f, 0.9668786602f}, {-0.2582016124f, 0.9660910554f}, + {-0.2611643229f, 0.9652943574f}, {-0.2641245751f, 0.9644885737f}, + {-0.2670823413f, 0.9636737119f}, {-0.2700375937f, 0.9628497796f}, + {-0.2729903043f, 0.9620167845f}, {-0.2759404455f, 0.9611747347f}, + {-0.2788879894f, 0.9603236378f}, {-0.2818329083f, 0.9594635021f}, + {-0.2847751745f, 0.9585943355f}, {-0.2877147602f, 0.9577161462f}, + {-0.2906516379f, 0.9568289426f}, {-0.2935857799f, 0.9559327329f}, + {-0.2965171585f, 0.9550275256f}, {-0.2994457462f, 0.9541133293f}, + {-0.3023715154f, 0.9531901524f}, {-0.3052944385f, 0.9522580038f}, + {-0.3082144882f, 0.9513168922f}, {-0.3111316367f, 0.9503668263f}, + {-0.3140458568f, 0.9494078153f}, {-0.3169571210f, 0.9484398681f}, + {-0.3198654018f, 0.9474629938f}, {-0.3227706720f, 0.9464772017f}, + {-0.3256729041f, 0.9454825009f}, {-0.3285720709f, 0.9444789009f}, + {-0.3314681450f, 0.9434664111f}, {-0.3343610992f, 0.9424450410f}, + {-0.3372509062f, 0.9414148003f}, {-0.3401375390f, 0.9403756986f}, + {-0.3430209702f, 0.9393277458f}, {-0.3459011728f, 0.9382709516f}, + {-0.3487781196f, 0.9372053261f}, {-0.3516517836f, 0.9361308792f}, + {-0.3545221378f, 0.9350476212f}, {-0.3573891550f, 0.9339555621f}, + {-0.3602528083f, 0.9328547122f}, {-0.3631130708f, 0.9317450820f}, + {-0.3659699156f, 0.9306266818f}, {-0.3688233157f, 0.9294995222f}, + {-0.3716732443f, 0.9283636138f}, {-0.3745196745f, 0.9272189673f}, + {-0.3773625797f, 0.9260655935f}, {-0.3802019329f, 0.9249035032f}, + {-0.3830377076f, 0.9237327073f}, {-0.3858698769f, 0.9225532169f}, + {-0.3886984143f, 0.9213650431f}, {-0.3915232932f, 0.9201681971f}, + {-0.3943444868f, 0.9189626901f}, {-0.3971619688f, 0.9177485334f}, + {-0.3999757125f, 0.9165257386f}, {-0.4027856914f, 0.9152943170f}, + {-0.4055918792f, 0.9140542804f}, {-0.4083942495f, 0.9128056403f}, + {-0.4111927757f, 0.9115484086f}, {-0.4139874317f, 0.9102825970f}, + {-0.4167781910f, 0.9090082175f}, {-0.4195650275f, 0.9077252821f}, + {-0.4223479149f, 0.9064338028f}, {-0.4251268269f, 0.9051337918f}, + {-0.4279017375f, 0.9038252613f}, {-0.4306726206f, 0.9025082237f}, + {-0.4334394500f, 0.9011826914f}, {-0.4362021996f, 0.8998486767f}, + {-0.4389608436f, 0.8985061924f}, {-0.4417153559f, 0.8971552510f}, + {-0.4444657107f, 0.8957958652f}, {-0.4472118819f, 0.8944280478f}, + {-0.4499538438f, 0.8930518117f}, {-0.4526915706f, 0.8916671699f}, + {-0.4554250365f, 0.8902741354f}, {-0.4581542157f, 0.8888727213f}, + {-0.4608790826f, 0.8874629408f}, {-0.4635996116f, 0.8860448071f}, + {-0.4663157769f, 0.8846183336f}, {-0.4690275532f, 0.8831835338f}, + {-0.4717349147f, 0.8817404211f}, {-0.4744378361f, 0.8802890092f}, + {-0.4771362920f, 0.8788293116f}, {-0.4798302568f, 0.8773613421f}, + {-0.4825197053f, 0.8758851146f}, {-0.4852046121f, 0.8744006429f}, + {-0.4878849520f, 0.8729079411f}, {-0.4905606998f, 0.8714070231f}, + {-0.4932318302f, 0.8698979030f}, {-0.4958983181f, 0.8683805952f}, + {-0.4985601384f, 0.8668551138f}, {-0.5012172661f, 0.8653214733f}, + {-0.5038696761f, 0.8637796880f}, {-0.5065173436f, 0.8622297726f}, + {-0.5091602435f, 0.8606717414f}, {-0.5117983509f, 0.8591056093f}, + {-0.5144316412f, 0.8575313910f}, {-0.5170600894f, 0.8559491013f}, + {-0.5196836709f, 0.8543587550f}, {-0.5223023608f, 0.8527603672f}, + {-0.5249161347f, 0.8511539529f}, {-0.5275249679f, 0.8495395272f}, + {-0.5301288358f, 0.8479171053f}, {-0.5327277139f, 0.8462867025f}, + {-0.5353215778f, 0.8446483341f}, {-0.5379104031f, 0.8430020156f}, + {-0.5404941653f, 0.8413477624f}, {-0.5430728402f, 0.8396855901f}, + {-0.5456464035f, 0.8380155144f}, {-0.5482148309f, 0.8363375510f}, + {-0.5507780984f, 0.8346517156f}, {-0.5533361817f, 0.8329580242f}, + {-0.5558890568f, 0.8312564927f}, {-0.5584366996f, 0.8295471370f}, + {-0.5609790863f, 0.8278299734f}, {-0.5635161928f, 0.8261050178f}, + {-0.5660479952f, 0.8243722867f}, {-0.5685744698f, 0.8226317963f}, + {-0.5710955928f, 0.8208835629f}, {-0.5736113404f, 0.8191276031f}, + {-0.5761216889f, 0.8173639334f}, {-0.5786266148f, 0.8155925703f}, + {-0.5811260944f, 0.8138135305f}, {-0.5836201042f, 0.8120268308f}, + {-0.5861086208f, 0.8102324880f}, {-0.5885916207f, 0.8084305190f}, + {-0.5910690806f, 0.8066209407f}, {-0.5935409771f, 0.8048037702f}, + {-0.5960072869f, 0.8029790246f}, {-0.5984679869f, 0.8011467210f}, + {-0.6009230539f, 0.7993068768f}, {-0.6033724648f, 0.7974595091f}, + {-0.6058161965f, 0.7956046355f}, {-0.6082542260f, 0.7937422734f}, + {-0.6106865305f, 0.7918724402f}, {-0.6131130869f, 0.7899951536f}, + {-0.6155338724f, 0.7881104313f}, {-0.6179488643f, 0.7862182910f}, + {-0.6203580398f, 0.7843187505f}, {-0.6227613763f, 0.7824118277f}, + {-0.6251588512f, 0.7804975406f}, {-0.6275504418f, 0.7785759071f}, + {-0.6299361256f, 0.7766469453f}, {-0.6323158803f, 0.7747106735f}, + {-0.6346896833f, 0.7727671097f}, {-0.6370575124f, 0.7708162725f}, + {-0.6394193453f, 0.7688581799f}, {-0.6417751597f, 0.7668928506f}, + {-0.6441249335f, 0.7649203031f}, {-0.6464686446f, 0.7629405558f}, + {-0.6488062708f, 0.7609536274f}, {-0.6511377902f, 0.7589595366f}, + {-0.6534631809f, 0.7569583022f}, {-0.6557824209f, 0.7549499430f}, + {-0.6580954884f, 0.7529344780f}, {-0.6604023617f, 0.7509119260f}, + {-0.6627030191f, 0.7488823062f}, {-0.6649974388f, 0.7468456376f}, + {-0.6672855993f, 0.7448019394f}, {-0.6695674791f, 0.7427512308f}, + {-0.6718430567f, 0.7406935312f}, {-0.6741123106f, 0.7386288599f}, + {-0.6763752195f, 0.7365572364f}, {-0.6786317621f, 0.7344786801f}, + {-0.6808819171f, 0.7323932106f}, {-0.6831256635f, 0.7303008475f}, + {-0.6853629800f, 0.7282016106f}, {-0.6875938456f, 0.7260955195f}, + {-0.6898182393f, 0.7239825942f}, {-0.6920361402f, 0.7218628545f}, + {-0.6942475274f, 0.7197363203f}, {-0.6964523800f, 0.7176030117f}, + {-0.6986506774f, 0.7154629487f}, {-0.7008423988f, 0.7133161515f}, + {-0.7030275236f, 0.7111626404f}, {-0.7052060313f, 0.7090024355f}, + {-0.7073779012f, 0.7068355571f}, {-0.7095431131f, 0.7046620258f}, + {-0.7117016465f, 0.7024818620f}, {-0.7138534811f, 0.7002950861f}, + {-0.7159985966f, 0.6981017187f}, {-0.7181369728f, 0.6959017806f}, + {-0.7202685897f, 0.6936952924f}, {-0.7223934272f, 0.6914822748f}, + {-0.7245114652f, 0.6892627488f}, {-0.7266226838f, 0.6870367351f}, + {-0.7287270632f, 0.6848042548f}, {-0.7308245835f, 0.6825653289f}, + {-0.7329152250f, 0.6803199784f}, {-0.7349989680f, 0.6780682244f}, + {-0.7370757930f, 0.6758100883f}, {-0.7391456803f, 0.6735455911f}, + {-0.7412086105f, 0.6712747543f}, {-0.7432645642f, 0.6689975992f}, + {-0.7453135219f, 0.6667141472f}, {-0.7473554645f, 0.6644244198f}, + {-0.7493903727f, 0.6621284387f}, {-0.7514182273f, 0.6598262253f}, + {-0.7534390094f, 0.6575178014f}, {-0.7554526997f, 0.6552031887f}, + {-0.7574592795f, 0.6528824090f}, {-0.7594587297f, 0.6505554841f}, + {-0.7614510317f, 0.6482224359f}, {-0.7634361665f, 0.6458832864f}, + {-0.7654141157f, 0.6435380576f}, {-0.7673848604f, 0.6411867716f}, + {-0.7693483822f, 0.6388294504f}, {-0.7713046627f, 0.6364661164f}, + {-0.7732536833f, 0.6340967917f}, {-0.7751954258f, 0.6317214987f}, + {-0.7771298718f, 0.6293402596f}, {-0.7790570032f, 0.6269530970f}, + {-0.7809768018f, 0.6245600332f}, {-0.7828892495f, 0.6221610909f}, + {-0.7847943284f, 0.6197562925f}, {-0.7866920205f, 0.6173456607f}, + {-0.7885823080f, 0.6149292183f}, {-0.7904651730f, 0.6125069879f}, + {-0.7923405979f, 0.6100789923f}, {-0.7942085650f, 0.6076452545f}, + {-0.7960690567f, 0.6052057973f}, {-0.7979220554f, 0.6027606436f}, + {-0.7997675438f, 0.6003098165f}, {-0.8016055045f, 0.5978533391f}, + {-0.8034359202f, 0.5953912345f}, {-0.8052587737f, 0.5929235258f}, + {-0.8070740477f, 0.5904502363f}, {-0.8088817253f, 0.5879713892f}, + {-0.8106817893f, 0.5854870079f}, {-0.8124742229f, 0.5829971159f}, + {-0.8142590092f, 0.5805017364f}, {-0.8160361314f, 0.5780008930f}, + {-0.8178055727f, 0.5754946092f}, {-0.8195673165f, 0.5729829087f}, + {-0.8213213463f, 0.5704658151f}, {-0.8230676454f, 0.5679433520f}, + {-0.8248061976f, 0.5654155432f}, {-0.8265369863f, 0.5628824124f}, + {-0.8282599954f, 0.5603439837f}, {-0.8299752085f, 0.5578002807f}, + {-0.8316826097f, 0.5552513276f}, {-0.8333821827f, 0.5526971482f}, + {-0.8350739116f, 0.5501377666f}, {-0.8367577804f, 0.5475732069f}, + {-0.8384337734f, 0.5450034932f}, {-0.8401018747f, 0.5424286497f}, + {-0.8417620687f, 0.5398487007f}, {-0.8434143397f, 0.5372636705f}, + {-0.8450586721f, 0.5346735833f}, {-0.8466950506f, 0.5320784635f}, + {-0.8483234596f, 0.5294783357f}, {-0.8499438838f, 0.5268732241f}, + {-0.8515563081f, 0.5242631535f}, {-0.8531607172f, 0.5216481483f}, + {-0.8547570960f, 0.5190282331f}, {-0.8563454296f, 0.5164034326f}, + {-0.8579257029f, 0.5137737716f}, {-0.8594979010f, 0.5111392747f}, + {-0.8610620092f, 0.5084999668f}, {-0.8626180128f, 0.5058558727f}, + {-0.8641658971f, 0.5032070173f}, {-0.8657056476f, 0.5005534255f}, + {-0.8672372497f, 0.4978951223f}, {-0.8687606890f, 0.4952321327f}, + {-0.8702759512f, 0.4925644818f}, {-0.8717830221f, 0.4898921947f}, + {-0.8732818874f, 0.4872152966f}, {-0.8747725330f, 0.4845338126f}, + {-0.8762549449f, 0.4818477680f}, {-0.8777291092f, 0.4791571880f}, + {-0.8791950120f, 0.4764620980f}, {-0.8806526395f, 0.4737625234f}, + {-0.8821019779f, 0.4710584896f}, {-0.8835430136f, 0.4683500220f}, + {-0.8849757331f, 0.4656371461f}, {-0.8864001229f, 0.4629198874f}, + {-0.8878161695f, 0.4601982716f}, {-0.8892238597f, 0.4574723242f}, + {-0.8906231801f, 0.4547420709f}, {-0.8920141177f, 0.4520075374f}, + {-0.8933966593f, 0.4492687494f}, {-0.8947707919f, 0.4465257327f}, + {-0.8961365026f, 0.4437785132f}, {-0.8974937785f, 0.4410271166f}, + {-0.8988426068f, 0.4382715690f}, {-0.9001829749f, 0.4355118961f}, + {-0.9015148702f, 0.4327481241f}, {-0.9028382800f, 0.4299802788f}, + {-0.9041531920f, 0.4272083864f}, {-0.9054595937f, 0.4244324730f}, + {-0.9067574729f, 0.4216525647f}, {-0.9080468174f, 0.4188686876f}, + {-0.9093276150f, 0.4160808679f}, {-0.9105998536f, 0.4132891320f}, + {-0.9118635213f, 0.4104935060f}, {-0.9131186063f, 0.4076940163f}, + {-0.9143650966f, 0.4048906892f}, {-0.9156029805f, 0.4020835511f}, + {-0.9168322465f, 0.3992726285f}, {-0.9180528828f, 0.3964579477f}, + {-0.9192648782f, 0.3936395354f}, {-0.9204682210f, 0.3908174179f}, + {-0.9216629000f, 0.3879916219f}, {-0.9228489040f, 0.3851621741f}, + {-0.9240262218f, 0.3823291009f}, {-0.9251948423f, 0.3794924291f}, + {-0.9263547546f, 0.3766521853f}, {-0.9275059476f, 0.3738083964f}, + {-0.9286484106f, 0.3709610890f}, {-0.9297821327f, 0.3681102900f}, + {-0.9309071035f, 0.3652560263f}, {-0.9320233121f, 0.3623983246f}, + {-0.9331307482f, 0.3595372118f}, {-0.9342294014f, 0.3566727150f}, + {-0.9353192612f, 0.3538048610f}, {-0.9364003174f, 0.3509336769f}, + {-0.9374725599f, 0.3480591896f}, {-0.9385359785f, 0.3451814263f}, + {-0.9395905633f, 0.3423004140f}, {-0.9406363042f, 0.3394161799f}, + {-0.9416731916f, 0.3365287510f}, {-0.9427012155f, 0.3336381546f}, + {-0.9437203665f, 0.3307444179f}, {-0.9447306347f, 0.3278475680f}, + {-0.9457320108f, 0.3249476324f}, {-0.9467244853f, 0.3220446382f}, + {-0.9477080488f, 0.3191386128f}, {-0.9486826922f, 0.3162295836f}, + {-0.9496484062f, 0.3133175778f}, {-0.9506051818f, 0.3104026231f}, + {-0.9515530099f, 0.3074847467f}, {-0.9524918816f, 0.3045639761f}, + {-0.9534217881f, 0.3016403388f}, {-0.9543427206f, 0.2987138624f}, + {-0.9552546705f, 0.2957845744f}, {-0.9561576292f, 0.2928525024f}, + {-0.9570515881f, 0.2899176739f}, {-0.9579365390f, 0.2869801166f}, + {-0.9588124733f, 0.2840398581f}, {-0.9596793830f, 0.2810969262f}, + {-0.9605372598f, 0.2781513484f}, {-0.9613860956f, 0.2752031526f}, + {-0.9622258825f, 0.2722523665f}, {-0.9630566126f, 0.2692990178f}, + {-0.9638782780f, 0.2663431344f}, {-0.9646908710f, 0.2633847440f}, + {-0.9654943840f, 0.2604238746f}, {-0.9662888094f, 0.2574605540f}, + {-0.9670741397f, 0.2544948100f}, {-0.9678503675f, 0.2515266707f}, + {-0.9686174856f, 0.2485561639f}, {-0.9693754867f, 0.2455833176f}, + {-0.9701243636f, 0.2426081597f}, {-0.9708641093f, 0.2396307184f}, + {-0.9715947170f, 0.2366510215f}, {-0.9723161796f, 0.2336690972f}, + {-0.9730284903f, 0.2306849735f}, {-0.9737316426f, 0.2276986785f}, + {-0.9744256297f, 0.2247102403f}, {-0.9751104452f, 0.2217196871f}, + {-0.9757860826f, 0.2187270470f}, {-0.9764525355f, 0.2157323481f}, + {-0.9771097976f, 0.2127356187f}, {-0.9777578628f, 0.2097368869f}, + {-0.9783967250f, 0.2067361810f}, {-0.9790263781f, 0.2037335292f}, + {-0.9796468163f, 0.2007289598f}, {-0.9802580337f, 0.1977225010f}, + {-0.9808600245f, 0.1947141812f}, {-0.9814527831f, 0.1917040287f}, + {-0.9820363038f, 0.1886920718f}, {-0.9826105813f, 0.1856783389f}, + {-0.9831756101f, 0.1826628583f}, {-0.9837313848f, 0.1796456584f}, + {-0.9842779003f, 0.1766267676f}, {-0.9848151514f, 0.1736062143f}, + {-0.9853431330f, 0.1705840270f}, {-0.9858618402f, 0.1675602340f}, + {-0.9863712681f, 0.1645348640f}, {-0.9868714119f, 0.1615079452f}, + {-0.9873622669f, 0.1584795063f}, {-0.9878438284f, 0.1554495757f}, + {-0.9883160920f, 0.1524181820f}, {-0.9887790532f, 0.1493853537f}, + {-0.9892327077f, 0.1463511192f}, {-0.9896770510f, 0.1433155073f}, + {-0.9901120792f, 0.1402785464f}, {-0.9905377881f, 0.1372402652f}, + {-0.9909541736f, 0.1342006922f}, {-0.9913612319f, 0.1311598561f}, + {-0.9917589592f, 0.1281177854f}, {-0.9921473516f, 0.1250745089f}, + {-0.9925264055f, 0.1220300551f}, {-0.9928961174f, 0.1189844527f}, + {-0.9932564838f, 0.1159377304f}, {-0.9936075013f, 0.1128899168f}, + {-0.9939491666f, 0.1098410406f}, {-0.9942814765f, 0.1067911306f}, + {-0.9946044277f, 0.1037402155f}, {-0.9949180174f, 0.1006883239f}, + {-0.9952222426f, 0.0976354846f}, {-0.9955171003f, 0.0945817263f}, + {-0.9958025879f, 0.0915270777f}, {-0.9960787026f, 0.0884715677f}, + {-0.9963454418f, 0.0854152249f}, {-0.9966028030f, 0.0823580782f}, + {-0.9968507838f, 0.0793001563f}, {-0.9970893819f, 0.0762414880f}, + {-0.9973185950f, 0.0731821021f}, {-0.9975384210f, 0.0701220274f}, + {-0.9977488577f, 0.0670612926f}, {-0.9979499032f, 0.0639999267f}, + {-0.9981415557f, 0.0609379583f}, {-0.9983238133f, 0.0578754164f}, + {-0.9984966743f, 0.0548123297f}, {-0.9986601370f, 0.0517487271f}, + {-0.9988142000f, 0.0486846375f}, {-0.9989588617f, 0.0456200896f}, + {-0.9990941209f, 0.0425551123f}, {-0.9992199762f, 0.0394897344f}, + {-0.9993364265f, 0.0364239849f}, {-0.9994434706f, 0.0333578925f}, + {-0.9995411076f, 0.0302914862f}, {-0.9996293366f, 0.0272247947f}, + {-0.9997081566f, 0.0241578470f}, {-0.9997775670f, 0.0210906719f}, + {-0.9998375672f, 0.0180232983f}, {-0.9998881564f, 0.0149557551f}, + {-0.9999293344f, 0.0118880711f}, {-0.9999611006f, 0.0088202752f}, + {-0.9999834548f, 0.0057523962f}, {-0.9999963968f, 0.0026844632f}, + {-0.9999999265f, -0.0003834952f}, {-0.9999940437f, -0.0034514499f}, + {-0.9999787487f, -0.0065193722f}, {-0.9999540414f, -0.0095872330f}, + {-0.9999199222f, -0.0126550037f}, {-0.9998763914f, -0.0157226552f}, + {-0.9998234494f, -0.0187901588f}, {-0.9997610966f, -0.0218574855f}, + {-0.9996893337f, -0.0249246064f}, {-0.9996081614f, -0.0279914928f}, + {-0.9995175804f, -0.0310581156f}, {-0.9994175915f, -0.0341244462f}, + {-0.9993081957f, -0.0371904556f}, {-0.9991893941f, -0.0402561149f}, + {-0.9990611877f, -0.0433213953f}, {-0.9989235777f, -0.0463862679f}, + {-0.9987765655f, -0.0494507040f}, {-0.9986201525f, -0.0525146746f}, + {-0.9984543400f, -0.0555781509f}, {-0.9982791298f, -0.0586411041f}, + {-0.9980945233f, -0.0617035053f}, {-0.9979005224f, -0.0647653257f}, + {-0.9976971289f, -0.0678265366f}, {-0.9974843446f, -0.0708871090f}, + {-0.9972621717f, -0.0739470143f}, {-0.9970306121f, -0.0770062235f}, + {-0.9967896682f, -0.0800647079f}, {-0.9965393420f, -0.0831224387f}, + {-0.9962796361f, -0.0861793871f}, {-0.9960105527f, -0.0892355244f}, + {-0.9957320946f, -0.0922908218f}, {-0.9954442642f, -0.0953452504f}, + {-0.9951470644f, -0.0983987817f}, {-0.9948404978f, -0.1014513868f}, + {-0.9945245675f, -0.1045030369f}, {-0.9941992762f, -0.1075537035f}, + {-0.9938646272f, -0.1106033577f}, {-0.9935206236f, -0.1136519709f}, + {-0.9931672686f, -0.1166995144f}, {-0.9928045655f, -0.1197459594f}, + {-0.9924325177f, -0.1227912773f}, {-0.9920511288f, -0.1258354395f}, + {-0.9916604023f, -0.1288784173f}, {-0.9912603420f, -0.1319201820f}, + {-0.9908509515f, -0.1349607050f}, {-0.9904322348f, -0.1379999577f}, + {-0.9900041957f, -0.1410379115f}, {-0.9895668383f, -0.1440745379f}, + {-0.9891201668f, -0.1471098081f}, {-0.9886641853f, -0.1501436937f}, + {-0.9881988981f, -0.1531761660f}, {-0.9877243096f, -0.1562071967f}, + {-0.9872404242f, -0.1592367570f}, {-0.9867472466f, -0.1622648185f}, + {-0.9862447813f, -0.1652913528f}, {-0.9857330331f, -0.1683163312f}, + {-0.9852120069f, -0.1713397254f}, {-0.9846817074f, -0.1743615069f}, + {-0.9841421397f, -0.1773816472f}, {-0.9835933090f, -0.1804001180f}, + {-0.9830352202f, -0.1834168907f}, {-0.9824678788f, -0.1864319371f}, + {-0.9818912900f, -0.1894452287f}, {-0.9813054592f, -0.1924567371f}, + {-0.9807103921f, -0.1954664341f}, {-0.9801060941f, -0.1984742913f}, + {-0.9794925710f, -0.2014802803f}, {-0.9788698285f, -0.2044843730f}, + {-0.9782378726f, -0.2074865410f}, {-0.9775967091f, -0.2104867560f}, + {-0.9769463440f, -0.2134849898f}, {-0.9762867836f, -0.2164812143f}, + {-0.9756180340f, -0.2194754011f}, {-0.9749401015f, -0.2224675222f}, + {-0.9742529925f, -0.2254575493f}, {-0.9735567135f, -0.2284454543f}, + {-0.9728512710f, -0.2314312091f}, {-0.9721366716f, -0.2344147856f}, + {-0.9714129221f, -0.2373961556f}, {-0.9706800293f, -0.2403752912f}, + {-0.9699380001f, -0.2433521644f}, {-0.9691868415f, -0.2463267469f}, + {-0.9684265605f, -0.2492990110f}, {-0.9676571643f, -0.2522689286f}, + {-0.9668786602f, -0.2552364717f}, {-0.9660910554f, -0.2582016124f}, + {-0.9652943574f, -0.2611643229f}, {-0.9644885737f, -0.2641245751f}, + {-0.9636737119f, -0.2670823413f}, {-0.9628497796f, -0.2700375937f}, + {-0.9620167845f, -0.2729903043f}, {-0.9611747347f, -0.2759404455f}, + {-0.9603236378f, -0.2788879894f}, {-0.9594635021f, -0.2818329083f}, + {-0.9585943355f, -0.2847751745f}, {-0.9577161462f, -0.2877147602f}, + {-0.9568289426f, -0.2906516379f}, {-0.9559327329f, -0.2935857799f}, + {-0.9550275256f, -0.2965171585f}, {-0.9541133293f, -0.2994457462f}, + {-0.9531901524f, -0.3023715154f}, {-0.9522580038f, -0.3052944385f}, + {-0.9513168922f, -0.3082144882f}, {-0.9503668263f, -0.3111316367f}, + {-0.9494078153f, -0.3140458568f}, {-0.9484398681f, -0.3169571210f}, + {-0.9474629938f, -0.3198654018f}, {-0.9464772017f, -0.3227706720f}, + {-0.9454825009f, -0.3256729041f}, {-0.9444789009f, -0.3285720709f}, + {-0.9434664111f, -0.3314681450f}, {-0.9424450410f, -0.3343610992f}, + {-0.9414148003f, -0.3372509062f}, {-0.9403756986f, -0.3401375390f}, + {-0.9393277458f, -0.3430209702f}, {-0.9382709516f, -0.3459011728f}, + {-0.9372053261f, -0.3487781196f}, {-0.9361308792f, -0.3516517836f}, + {-0.9350476212f, -0.3545221378f}, {-0.9339555621f, -0.3573891550f}, + {-0.9328547122f, -0.3602528083f}, {-0.9317450820f, -0.3631130708f}, + {-0.9306266818f, -0.3659699156f}, {-0.9294995222f, -0.3688233157f}, + {-0.9283636138f, -0.3716732443f}, {-0.9272189673f, -0.3745196745f}, + {-0.9260655935f, -0.3773625797f}, {-0.9249035032f, -0.3802019329f}, + {-0.9237327073f, -0.3830377076f}, {-0.9225532169f, -0.3858698769f}, + {-0.9213650431f, -0.3886984143f}, {-0.9201681971f, -0.3915232932f}, + {-0.9189626901f, -0.3943444868f}, {-0.9177485334f, -0.3971619688f}, + {-0.9165257386f, -0.3999757125f}, {-0.9152943170f, -0.4027856914f}, + {-0.9140542804f, -0.4055918792f}, {-0.9128056403f, -0.4083942495f}, + {-0.9115484086f, -0.4111927757f}, {-0.9102825970f, -0.4139874317f}, + {-0.9090082175f, -0.4167781910f}, {-0.9077252821f, -0.4195650275f}, + {-0.9064338028f, -0.4223479149f}, {-0.9051337918f, -0.4251268269f}, + {-0.9038252613f, -0.4279017375f}, {-0.9025082237f, -0.4306726206f}, + {-0.9011826914f, -0.4334394500f}, {-0.8998486767f, -0.4362021996f}, + {-0.8985061924f, -0.4389608436f}, {-0.8971552510f, -0.4417153559f}, + {-0.8957958652f, -0.4444657107f}, {-0.8944280478f, -0.4472118819f}, + {-0.8930518117f, -0.4499538438f}, {-0.8916671699f, -0.4526915706f}, + {-0.8902741354f, -0.4554250365f}, {-0.8888727213f, -0.4581542157f}, + {-0.8874629408f, -0.4608790826f}, {-0.8860448071f, -0.4635996116f}, + {-0.8846183336f, -0.4663157769f}, {-0.8831835338f, -0.4690275532f}, + {-0.8817404211f, -0.4717349147f}, {-0.8802890092f, -0.4744378361f}, + {-0.8788293116f, -0.4771362920f}, {-0.8773613421f, -0.4798302568f}, + {-0.8758851146f, -0.4825197053f}, {-0.8744006429f, -0.4852046121f}, + {-0.8729079411f, -0.4878849520f}, {-0.8714070231f, -0.4905606998f}, + {-0.8698979030f, -0.4932318302f}, {-0.8683805952f, -0.4958983181f}, + {-0.8668551138f, -0.4985601384f}, {-0.8653214733f, -0.5012172661f}, + {-0.8637796880f, -0.5038696761f}, {-0.8622297726f, -0.5065173436f}, + {-0.8606717414f, -0.5091602435f}, {-0.8591056093f, -0.5117983509f}, + {-0.8575313910f, -0.5144316412f}, {-0.8559491013f, -0.5170600894f}, + {-0.8543587550f, -0.5196836709f}, {-0.8527603672f, -0.5223023608f}, + {-0.8511539529f, -0.5249161347f}, {-0.8495395272f, -0.5275249679f}, + {-0.8479171053f, -0.5301288358f}, {-0.8462867025f, -0.5327277139f}, + {-0.8446483341f, -0.5353215778f}, {-0.8430020156f, -0.5379104031f}, + {-0.8413477624f, -0.5404941653f}, {-0.8396855901f, -0.5430728402f}, + {-0.8380155144f, -0.5456464035f}, {-0.8363375510f, -0.5482148309f}, + {-0.8346517156f, -0.5507780984f}, {-0.8329580242f, -0.5533361817f}, + {-0.8312564927f, -0.5558890568f}, {-0.8295471370f, -0.5584366996f}, + {-0.8278299734f, -0.5609790863f}, {-0.8261050178f, -0.5635161928f}, + {-0.8243722867f, -0.5660479952f}, {-0.8226317963f, -0.5685744698f}, + {-0.8208835629f, -0.5710955928f}, {-0.8191276031f, -0.5736113404f}, + {-0.8173639334f, -0.5761216889f}, {-0.8155925703f, -0.5786266148f}, + {-0.8138135305f, -0.5811260944f}, {-0.8120268308f, -0.5836201042f}, + {-0.8102324880f, -0.5861086208f}, {-0.8084305190f, -0.5885916207f}, + {-0.8066209407f, -0.5910690806f}, {-0.8048037702f, -0.5935409771f}, + {-0.8029790246f, -0.5960072869f}, {-0.8011467210f, -0.5984679869f}, + {-0.7993068768f, -0.6009230539f}, {-0.7974595091f, -0.6033724648f}, + {-0.7956046355f, -0.6058161965f}, {-0.7937422734f, -0.6082542260f}, + {-0.7918724402f, -0.6106865305f}, {-0.7899951536f, -0.6131130869f}, + {-0.7881104313f, -0.6155338724f}, {-0.7862182910f, -0.6179488643f}, + {-0.7843187505f, -0.6203580398f}, {-0.7824118277f, -0.6227613763f}, + {-0.7804975406f, -0.6251588512f}, {-0.7785759071f, -0.6275504418f}, + {-0.7766469453f, -0.6299361256f}, {-0.7747106735f, -0.6323158803f}, + {-0.7727671097f, -0.6346896833f}, {-0.7708162725f, -0.6370575124f}, + {-0.7688581799f, -0.6394193453f}, {-0.7668928506f, -0.6417751597f}, + {-0.7649203031f, -0.6441249335f}, {-0.7629405558f, -0.6464686446f}, + {-0.7609536274f, -0.6488062708f}, {-0.7589595366f, -0.6511377902f}, + {-0.7569583022f, -0.6534631809f}, {-0.7549499430f, -0.6557824209f}, + {-0.7529344780f, -0.6580954884f}, {-0.7509119260f, -0.6604023617f}, + {-0.7488823062f, -0.6627030191f}, {-0.7468456376f, -0.6649974388f}, + {-0.7448019394f, -0.6672855993f}, {-0.7427512308f, -0.6695674791f}, + {-0.7406935312f, -0.6718430567f}, {-0.7386288599f, -0.6741123106f}, + {-0.7365572364f, -0.6763752195f}, {-0.7344786801f, -0.6786317621f}, + {-0.7323932106f, -0.6808819171f}, {-0.7303008475f, -0.6831256635f}, + {-0.7282016106f, -0.6853629800f}, {-0.7260955195f, -0.6875938456f}, + {-0.7239825942f, -0.6898182393f}, {-0.7218628545f, -0.6920361402f}, + {-0.7197363203f, -0.6942475274f}, {-0.7176030117f, -0.6964523800f}, + {-0.7154629487f, -0.6986506774f}, {-0.7133161515f, -0.7008423988f}, + {-0.7111626404f, -0.7030275236f}, {-0.7090024355f, -0.7052060313f}, + {-0.7068355571f, -0.7073779012f}, {-0.7046620258f, -0.7095431131f}, + {-0.7024818620f, -0.7117016465f}, {-0.7002950861f, -0.7138534811f}, + {-0.6981017187f, -0.7159985966f}, {-0.6959017806f, -0.7181369728f}, + {-0.6936952924f, -0.7202685897f}, {-0.6914822748f, -0.7223934272f}, + {-0.6892627488f, -0.7245114652f}, {-0.6870367351f, -0.7266226838f}, + {-0.6848042548f, -0.7287270632f}, {-0.6825653289f, -0.7308245835f}, + {-0.6803199784f, -0.7329152250f}, {-0.6780682244f, -0.7349989680f}, + {-0.6758100883f, -0.7370757930f}, {-0.6735455911f, -0.7391456803f}, + {-0.6712747543f, -0.7412086105f}, {-0.6689975992f, -0.7432645642f}, + {-0.6667141472f, -0.7453135219f}, {-0.6644244198f, -0.7473554645f}, + {-0.6621284387f, -0.7493903727f}, {-0.6598262253f, -0.7514182273f}, + {-0.6575178014f, -0.7534390094f}, {-0.6552031887f, -0.7554526997f}, + {-0.6528824090f, -0.7574592795f}, {-0.6505554841f, -0.7594587297f}, + {-0.6482224359f, -0.7614510317f}, {-0.6458832864f, -0.7634361665f}, + {-0.6435380576f, -0.7654141157f}, {-0.6411867716f, -0.7673848604f}, + {-0.6388294504f, -0.7693483822f}, {-0.6364661164f, -0.7713046627f}, + {-0.6340967917f, -0.7732536833f}, {-0.6317214987f, -0.7751954258f}, + {-0.6293402596f, -0.7771298718f}, {-0.6269530970f, -0.7790570032f}, + {-0.6245600332f, -0.7809768018f}, {-0.6221610909f, -0.7828892495f}, + {-0.6197562925f, -0.7847943284f}, {-0.6173456607f, -0.7866920205f}, + {-0.6149292183f, -0.7885823080f}, {-0.6125069879f, -0.7904651730f}, + {-0.6100789923f, -0.7923405979f}, {-0.6076452545f, -0.7942085650f}, + {-0.6052057973f, -0.7960690567f}, {-0.6027606436f, -0.7979220554f}, + {-0.6003098165f, -0.7997675438f}, {-0.5978533391f, -0.8016055045f}, + {-0.5953912345f, -0.8034359202f}, {-0.5929235258f, -0.8052587737f}, + {-0.5904502363f, -0.8070740477f}, {-0.5879713892f, -0.8088817253f}, + {-0.5854870079f, -0.8106817893f}, {-0.5829971159f, -0.8124742229f}, + {-0.5805017364f, -0.8142590092f}, {-0.5780008930f, -0.8160361314f}, + {-0.5754946092f, -0.8178055727f}, {-0.5729829087f, -0.8195673165f}, + {-0.5704658151f, -0.8213213463f}, {-0.5679433520f, -0.8230676454f}, + {-0.5654155432f, -0.8248061976f}, {-0.5628824124f, -0.8265369863f}, + {-0.5603439837f, -0.8282599954f}, {-0.5578002807f, -0.8299752085f}, + {-0.5552513276f, -0.8316826097f}, {-0.5526971482f, -0.8333821827f}, + {-0.5501377666f, -0.8350739116f}, {-0.5475732069f, -0.8367577804f}, + {-0.5450034932f, -0.8384337734f}, {-0.5424286497f, -0.8401018747f}, + {-0.5398487007f, -0.8417620687f}, {-0.5372636705f, -0.8434143397f}, + {-0.5346735833f, -0.8450586721f}, {-0.5320784635f, -0.8466950506f}, + {-0.5294783357f, -0.8483234596f}, {-0.5268732241f, -0.8499438838f}, + {-0.5242631535f, -0.8515563081f}, {-0.5216481483f, -0.8531607172f}, + {-0.5190282331f, -0.8547570960f}, {-0.5164034326f, -0.8563454296f}, + {-0.5137737716f, -0.8579257029f}, {-0.5111392747f, -0.8594979010f}, + {-0.5084999668f, -0.8610620092f}, {-0.5058558727f, -0.8626180128f}, + {-0.5032070173f, -0.8641658971f}, {-0.5005534255f, -0.8657056476f}, + {-0.4978951223f, -0.8672372497f}, {-0.4952321327f, -0.8687606890f}, + {-0.4925644818f, -0.8702759512f}, {-0.4898921947f, -0.8717830221f}, + {-0.4872152966f, -0.8732818874f}, {-0.4845338126f, -0.8747725330f}, + {-0.4818477680f, -0.8762549449f}, {-0.4791571880f, -0.8777291092f}, + {-0.4764620980f, -0.8791950120f}, {-0.4737625234f, -0.8806526395f}, + {-0.4710584896f, -0.8821019779f}, {-0.4683500220f, -0.8835430136f}, + {-0.4656371461f, -0.8849757331f}, {-0.4629198874f, -0.8864001229f}, + {-0.4601982716f, -0.8878161695f}, {-0.4574723242f, -0.8892238597f}, + {-0.4547420709f, -0.8906231801f}, {-0.4520075374f, -0.8920141177f}, + {-0.4492687494f, -0.8933966593f}, {-0.4465257327f, -0.8947707919f}, + {-0.4437785132f, -0.8961365026f}, {-0.4410271166f, -0.8974937785f}, + {-0.4382715690f, -0.8988426068f}, {-0.4355118961f, -0.9001829749f}, + {-0.4327481241f, -0.9015148702f}, {-0.4299802788f, -0.9028382800f}, + {-0.4272083864f, -0.9041531920f}, {-0.4244324730f, -0.9054595937f}, + {-0.4216525647f, -0.9067574729f}, {-0.4188686876f, -0.9080468174f}, + {-0.4160808679f, -0.9093276150f}, {-0.4132891320f, -0.9105998536f}, + {-0.4104935060f, -0.9118635213f}, {-0.4076940163f, -0.9131186063f}, + {-0.4048906892f, -0.9143650966f}, {-0.4020835511f, -0.9156029805f}, + {-0.3992726285f, -0.9168322465f}, {-0.3964579477f, -0.9180528828f}, + {-0.3936395354f, -0.9192648782f}, {-0.3908174179f, -0.9204682210f}, + {-0.3879916219f, -0.9216629000f}, {-0.3851621741f, -0.9228489040f}, + {-0.3823291009f, -0.9240262218f}, {-0.3794924291f, -0.9251948423f}, + {-0.3766521853f, -0.9263547546f}, {-0.3738083964f, -0.9275059476f}, + {-0.3709610890f, -0.9286484106f}, {-0.3681102900f, -0.9297821327f}, + {-0.3652560263f, -0.9309071035f}, {-0.3623983246f, -0.9320233121f}, + {-0.3595372118f, -0.9331307482f}, {-0.3566727150f, -0.9342294014f}, + {-0.3538048610f, -0.9353192612f}, {-0.3509336769f, -0.9364003174f}, + {-0.3480591896f, -0.9374725599f}, {-0.3451814263f, -0.9385359785f}, + {-0.3423004140f, -0.9395905633f}, {-0.3394161799f, -0.9406363042f}, + {-0.3365287510f, -0.9416731916f}, {-0.3336381546f, -0.9427012155f}, + {-0.3307444179f, -0.9437203665f}, {-0.3278475680f, -0.9447306347f}, + {-0.3249476324f, -0.9457320108f}, {-0.3220446382f, -0.9467244853f}, + {-0.3191386128f, -0.9477080488f}, {-0.3162295836f, -0.9486826922f}, + {-0.3133175778f, -0.9496484062f}, {-0.3104026231f, -0.9506051818f}, + {-0.3074847467f, -0.9515530099f}, {-0.3045639761f, -0.9524918816f}, + {-0.3016403388f, -0.9534217881f}, {-0.2987138624f, -0.9543427206f}, + {-0.2957845744f, -0.9552546705f}, {-0.2928525024f, -0.9561576292f}, + {-0.2899176739f, -0.9570515881f}, {-0.2869801166f, -0.9579365390f}, + {-0.2840398581f, -0.9588124733f}, {-0.2810969262f, -0.9596793830f}, + {-0.2781513484f, -0.9605372598f}, {-0.2752031526f, -0.9613860956f}, + {-0.2722523665f, -0.9622258825f}, {-0.2692990178f, -0.9630566126f}, + {-0.2663431344f, -0.9638782780f}, {-0.2633847440f, -0.9646908710f}, + {-0.2604238746f, -0.9654943840f}, {-0.2574605540f, -0.9662888094f}, + {-0.2544948100f, -0.9670741397f}, {-0.2515266707f, -0.9678503675f}, + {-0.2485561639f, -0.9686174856f}, {-0.2455833176f, -0.9693754867f}, + {-0.2426081597f, -0.9701243636f}, {-0.2396307184f, -0.9708641093f}, + {-0.2366510215f, -0.9715947170f}, {-0.2336690972f, -0.9723161796f}, + {-0.2306849735f, -0.9730284903f}, {-0.2276986785f, -0.9737316426f}, + {-0.2247102403f, -0.9744256297f}, {-0.2217196871f, -0.9751104452f}, + {-0.2187270470f, -0.9757860826f}, {-0.2157323481f, -0.9764525355f}, + {-0.2127356187f, -0.9771097976f}, {-0.2097368869f, -0.9777578628f}, + {-0.2067361810f, -0.9783967250f}, {-0.2037335292f, -0.9790263781f}, + {-0.2007289598f, -0.9796468163f}, {-0.1977225010f, -0.9802580337f}, + {-0.1947141812f, -0.9808600245f}, {-0.1917040287f, -0.9814527831f}, + {-0.1886920718f, -0.9820363038f}, {-0.1856783389f, -0.9826105813f}, + {-0.1826628583f, -0.9831756101f}, {-0.1796456584f, -0.9837313848f}, + {-0.1766267676f, -0.9842779003f}, {-0.1736062143f, -0.9848151514f}, + {-0.1705840270f, -0.9853431330f}, {-0.1675602340f, -0.9858618402f}, + {-0.1645348640f, -0.9863712681f}, {-0.1615079452f, -0.9868714119f}, + {-0.1584795063f, -0.9873622669f}, {-0.1554495757f, -0.9878438284f}, + {-0.1524181820f, -0.9883160920f}, {-0.1493853537f, -0.9887790532f}, + {-0.1463511192f, -0.9892327077f}, {-0.1433155073f, -0.9896770510f}, + {-0.1402785464f, -0.9901120792f}, {-0.1372402652f, -0.9905377881f}, + {-0.1342006922f, -0.9909541736f}, {-0.1311598561f, -0.9913612319f}, + {-0.1281177854f, -0.9917589592f}, {-0.1250745089f, -0.9921473516f}, + {-0.1220300551f, -0.9925264055f}, {-0.1189844527f, -0.9928961174f}, + {-0.1159377304f, -0.9932564838f}, {-0.1128899168f, -0.9936075013f}, + {-0.1098410406f, -0.9939491666f}, {-0.1067911306f, -0.9942814765f}, + {-0.1037402155f, -0.9946044277f}, {-0.1006883239f, -0.9949180174f}, + {-0.0976354846f, -0.9952222426f}, {-0.0945817263f, -0.9955171003f}, + {-0.0915270777f, -0.9958025879f}, {-0.0884715677f, -0.9960787026f}, + {-0.0854152249f, -0.9963454418f}, {-0.0823580782f, -0.9966028030f}, + {-0.0793001563f, -0.9968507838f}, {-0.0762414880f, -0.9970893819f}, + {-0.0731821021f, -0.9973185950f}, {-0.0701220274f, -0.9975384210f}, + {-0.0670612926f, -0.9977488577f}, {-0.0639999267f, -0.9979499032f}, + {-0.0609379583f, -0.9981415557f}, {-0.0578754164f, -0.9983238133f}, + {-0.0548123297f, -0.9984966743f}, {-0.0517487271f, -0.9986601370f}, + {-0.0486846375f, -0.9988142000f}, {-0.0456200896f, -0.9989588617f}, + {-0.0425551123f, -0.9990941209f}, {-0.0394897344f, -0.9992199762f}, + {-0.0364239849f, -0.9993364265f}, {-0.0333578925f, -0.9994434706f}, + {-0.0302914862f, -0.9995411076f}, {-0.0272247947f, -0.9996293366f}, + {-0.0241578470f, -0.9997081566f}, {-0.0210906719f, -0.9997775670f}, + {-0.0180232983f, -0.9998375672f}, {-0.0149557551f, -0.9998881564f}, + {-0.0118880711f, -0.9999293344f}, {-0.0088202752f, -0.9999611006f}, + {-0.0057523962f, -0.9999834548f}, {-0.0026844632f, -0.9999963968f}, + {0.0003834952f, -0.9999999265f}, {0.0034514499f, -0.9999940437f}, + {0.0065193722f, -0.9999787487f}, {0.0095872330f, -0.9999540414f}, + {0.0126550037f, -0.9999199222f}, {0.0157226552f, -0.9998763914f}, + {0.0187901588f, -0.9998234494f}, {0.0218574855f, -0.9997610966f}, + {0.0249246064f, -0.9996893337f}, {0.0279914928f, -0.9996081614f}, + {0.0310581156f, -0.9995175804f}, {0.0341244462f, -0.9994175915f}, + {0.0371904556f, -0.9993081957f}, {0.0402561149f, -0.9991893941f}, + {0.0433213953f, -0.9990611877f}, {0.0463862679f, -0.9989235777f}, + {0.0494507040f, -0.9987765655f}, {0.0525146746f, -0.9986201525f}, + {0.0555781509f, -0.9984543400f}, {0.0586411041f, -0.9982791298f}, + {0.0617035053f, -0.9980945233f}, {0.0647653257f, -0.9979005224f}, + {0.0678265366f, -0.9976971289f}, {0.0708871090f, -0.9974843446f}, + {0.0739470143f, -0.9972621717f}, {0.0770062235f, -0.9970306121f}, + {0.0800647079f, -0.9967896682f}, {0.0831224387f, -0.9965393420f}, + {0.0861793871f, -0.9962796361f}, {0.0892355244f, -0.9960105527f}, + {0.0922908218f, -0.9957320946f}, {0.0953452504f, -0.9954442642f}, + {0.0983987817f, -0.9951470644f}, {0.1014513868f, -0.9948404978f}, + {0.1045030369f, -0.9945245675f}, {0.1075537035f, -0.9941992762f}, + {0.1106033577f, -0.9938646272f}, {0.1136519709f, -0.9935206236f}, + {0.1166995144f, -0.9931672686f}, {0.1197459594f, -0.9928045655f}, + {0.1227912773f, -0.9924325177f}, {0.1258354395f, -0.9920511288f}, + {0.1288784173f, -0.9916604023f}, {0.1319201820f, -0.9912603420f}, + {0.1349607050f, -0.9908509515f}, {0.1379999577f, -0.9904322348f}, + {0.1410379115f, -0.9900041957f}, {0.1440745379f, -0.9895668383f}, + {0.1471098081f, -0.9891201668f}, {0.1501436937f, -0.9886641853f}, + {0.1531761660f, -0.9881988981f}, {0.1562071967f, -0.9877243096f}, + {0.1592367570f, -0.9872404242f}, {0.1622648185f, -0.9867472466f}, + {0.1652913528f, -0.9862447813f}, {0.1683163312f, -0.9857330331f}, + {0.1713397254f, -0.9852120069f}, {0.1743615069f, -0.9846817074f}, + {0.1773816472f, -0.9841421397f}, {0.1804001180f, -0.9835933090f}, + {0.1834168907f, -0.9830352202f}, {0.1864319371f, -0.9824678788f}, + {0.1894452287f, -0.9818912900f}, {0.1924567371f, -0.9813054592f}, + {0.1954664341f, -0.9807103921f}, {0.1984742913f, -0.9801060941f}, + {0.2014802803f, -0.9794925710f}, {0.2044843730f, -0.9788698285f}, + {0.2074865410f, -0.9782378726f}, {0.2104867560f, -0.9775967091f}, + {0.2134849898f, -0.9769463440f}, {0.2164812143f, -0.9762867836f}, + {0.2194754011f, -0.9756180340f}, {0.2224675222f, -0.9749401015f}, + {0.2254575493f, -0.9742529925f}, {0.2284454543f, -0.9735567135f}, + {0.2314312091f, -0.9728512710f}, {0.2344147856f, -0.9721366716f}, + {0.2373961556f, -0.9714129221f}, {0.2403752912f, -0.9706800293f}, + {0.2433521644f, -0.9699380001f}, {0.2463267469f, -0.9691868415f}, + {0.2492990110f, -0.9684265605f}, {0.2522689286f, -0.9676571643f}, + {0.2552364717f, -0.9668786602f}, {0.2582016124f, -0.9660910554f}, + {0.2611643229f, -0.9652943574f}, {0.2641245751f, -0.9644885737f}, + {0.2670823413f, -0.9636737119f}, {0.2700375937f, -0.9628497796f}, + {0.2729903043f, -0.9620167845f}, {0.2759404455f, -0.9611747347f}, + {0.2788879894f, -0.9603236378f}, {0.2818329083f, -0.9594635021f}, + {0.2847751745f, -0.9585943355f}, {0.2877147602f, -0.9577161462f}, + {0.2906516379f, -0.9568289426f}, {0.2935857799f, -0.9559327329f}, + {0.2965171585f, -0.9550275256f}, {0.2994457462f, -0.9541133293f}, + {0.3023715154f, -0.9531901524f}, {0.3052944385f, -0.9522580038f}, + {0.3082144882f, -0.9513168922f}, {0.3111316367f, -0.9503668263f}, + {0.3140458568f, -0.9494078153f}, {0.3169571210f, -0.9484398681f}, + {0.3198654018f, -0.9474629938f}, {0.3227706720f, -0.9464772017f}, + {0.3256729041f, -0.9454825009f}, {0.3285720709f, -0.9444789009f}, + {0.3314681450f, -0.9434664111f}, {0.3343610992f, -0.9424450410f}, + {0.3372509062f, -0.9414148003f}, {0.3401375390f, -0.9403756986f}, + {0.3430209702f, -0.9393277458f}, {0.3459011728f, -0.9382709516f}, + {0.3487781196f, -0.9372053261f}, {0.3516517836f, -0.9361308792f}, + {0.3545221378f, -0.9350476212f}, {0.3573891550f, -0.9339555621f}, + {0.3602528083f, -0.9328547122f}, {0.3631130708f, -0.9317450820f}, + {0.3659699156f, -0.9306266818f}, {0.3688233157f, -0.9294995222f}, + {0.3716732443f, -0.9283636138f}, {0.3745196745f, -0.9272189673f}, + {0.3773625797f, -0.9260655935f}, {0.3802019329f, -0.9249035032f}, + {0.3830377076f, -0.9237327073f}, {0.3858698769f, -0.9225532169f}, + {0.3886984143f, -0.9213650431f}, {0.3915232932f, -0.9201681971f}, + {0.3943444868f, -0.9189626901f}, {0.3971619688f, -0.9177485334f}, + {0.3999757125f, -0.9165257386f}, {0.4027856914f, -0.9152943170f}, + {0.4055918792f, -0.9140542804f}, {0.4083942495f, -0.9128056403f}, + {0.4111927757f, -0.9115484086f}, {0.4139874317f, -0.9102825970f}, + {0.4167781910f, -0.9090082175f}, {0.4195650275f, -0.9077252821f}, + {0.4223479149f, -0.9064338028f}, {0.4251268269f, -0.9051337918f}, + {0.4279017375f, -0.9038252613f}, {0.4306726206f, -0.9025082237f}, + {0.4334394500f, -0.9011826914f}, {0.4362021996f, -0.8998486767f}, + {0.4389608436f, -0.8985061924f}, {0.4417153559f, -0.8971552510f}, + {0.4444657107f, -0.8957958652f}, {0.4472118819f, -0.8944280478f}, + {0.4499538438f, -0.8930518117f}, {0.4526915706f, -0.8916671699f}, + {0.4554250365f, -0.8902741354f}, {0.4581542157f, -0.8888727213f}, + {0.4608790826f, -0.8874629408f}, {0.4635996116f, -0.8860448071f}, + {0.4663157769f, -0.8846183336f}, {0.4690275532f, -0.8831835338f}, + {0.4717349147f, -0.8817404211f}, {0.4744378361f, -0.8802890092f}, + {0.4771362920f, -0.8788293116f}, {0.4798302568f, -0.8773613421f}, + {0.4825197053f, -0.8758851146f}, {0.4852046121f, -0.8744006429f}, + {0.4878849520f, -0.8729079411f}, {0.4905606998f, -0.8714070231f}, + {0.4932318302f, -0.8698979030f}, {0.4958983181f, -0.8683805952f}, + {0.4985601384f, -0.8668551138f}, {0.5012172661f, -0.8653214733f}, + {0.5038696761f, -0.8637796880f}, {0.5065173436f, -0.8622297726f}, + {0.5091602435f, -0.8606717414f}, {0.5117983509f, -0.8591056093f}, + {0.5144316412f, -0.8575313910f}, {0.5170600894f, -0.8559491013f}, + {0.5196836709f, -0.8543587550f}, {0.5223023608f, -0.8527603672f}, + {0.5249161347f, -0.8511539529f}, {0.5275249679f, -0.8495395272f}, + {0.5301288358f, -0.8479171053f}, {0.5327277139f, -0.8462867025f}, + {0.5353215778f, -0.8446483341f}, {0.5379104031f, -0.8430020156f}, + {0.5404941653f, -0.8413477624f}, {0.5430728402f, -0.8396855901f}, + {0.5456464035f, -0.8380155144f}, {0.5482148309f, -0.8363375510f}, + {0.5507780984f, -0.8346517156f}, {0.5533361817f, -0.8329580242f}, + {0.5558890568f, -0.8312564927f}, {0.5584366996f, -0.8295471370f}, + {0.5609790863f, -0.8278299734f}, {0.5635161928f, -0.8261050178f}, + {0.5660479952f, -0.8243722867f}, {0.5685744698f, -0.8226317963f}, + {0.5710955928f, -0.8208835629f}, {0.5736113404f, -0.8191276031f}, + {0.5761216889f, -0.8173639334f}, {0.5786266148f, -0.8155925703f}, + {0.5811260944f, -0.8138135305f}, {0.5836201042f, -0.8120268308f}, + {0.5861086208f, -0.8102324880f}, {0.5885916207f, -0.8084305190f}, + {0.5910690806f, -0.8066209407f}, {0.5935409771f, -0.8048037702f}, + {0.5960072869f, -0.8029790246f}, {0.5984679869f, -0.8011467210f}, + {0.6009230539f, -0.7993068768f}, {0.6033724648f, -0.7974595091f}, + {0.6058161965f, -0.7956046355f}, {0.6082542260f, -0.7937422734f}, + {0.6106865305f, -0.7918724402f}, {0.6131130869f, -0.7899951536f}, + {0.6155338724f, -0.7881104313f}, {0.6179488643f, -0.7862182910f}, + {0.6203580398f, -0.7843187505f}, {0.6227613763f, -0.7824118277f}, + {0.6251588512f, -0.7804975406f}, {0.6275504418f, -0.7785759071f}, + {0.6299361256f, -0.7766469453f}, {0.6323158803f, -0.7747106735f}, + {0.6346896833f, -0.7727671097f}, {0.6370575124f, -0.7708162725f}, + {0.6394193453f, -0.7688581799f}, {0.6417751597f, -0.7668928506f}, + {0.6441249335f, -0.7649203031f}, {0.6464686446f, -0.7629405558f}, + {0.6488062708f, -0.7609536274f}, {0.6511377902f, -0.7589595366f}, + {0.6534631809f, -0.7569583022f}, {0.6557824209f, -0.7549499430f}, + {0.6580954884f, -0.7529344780f}, {0.6604023617f, -0.7509119260f}, + {0.6627030191f, -0.7488823062f}, {0.6649974388f, -0.7468456376f}, + {0.6672855993f, -0.7448019394f}, {0.6695674791f, -0.7427512308f}, + {0.6718430567f, -0.7406935312f}, {0.6741123106f, -0.7386288599f}, + {0.6763752195f, -0.7365572364f}, {0.6786317621f, -0.7344786801f}, + {0.6808819171f, -0.7323932106f}, {0.6831256635f, -0.7303008475f}, + {0.6853629800f, -0.7282016106f}, {0.6875938456f, -0.7260955195f}, + {0.6898182393f, -0.7239825942f}, {0.6920361402f, -0.7218628545f}, + {0.6942475274f, -0.7197363203f}, {0.6964523800f, -0.7176030117f}, + {0.6986506774f, -0.7154629487f}, {0.7008423988f, -0.7133161515f}, + {0.7030275236f, -0.7111626404f}, {0.7052060313f, -0.7090024355f}, + {0.7073779012f, -0.7068355571f}, {0.7095431131f, -0.7046620258f}, + {0.7117016465f, -0.7024818620f}, {0.7138534811f, -0.7002950861f}, + {0.7159985966f, -0.6981017187f}, {0.7181369728f, -0.6959017806f}, + {0.7202685897f, -0.6936952924f}, {0.7223934272f, -0.6914822748f}, + {0.7245114652f, -0.6892627488f}, {0.7266226838f, -0.6870367351f}, + {0.7287270632f, -0.6848042548f}, {0.7308245835f, -0.6825653289f}, + {0.7329152250f, -0.6803199784f}, {0.7349989680f, -0.6780682244f}, + {0.7370757930f, -0.6758100883f}, {0.7391456803f, -0.6735455911f}, + {0.7412086105f, -0.6712747543f}, {0.7432645642f, -0.6689975992f}, + {0.7453135219f, -0.6667141472f}, {0.7473554645f, -0.6644244198f}, + {0.7493903727f, -0.6621284387f}, {0.7514182273f, -0.6598262253f}, + {0.7534390094f, -0.6575178014f}, {0.7554526997f, -0.6552031887f}, + {0.7574592795f, -0.6528824090f}, {0.7594587297f, -0.6505554841f}, + {0.7614510317f, -0.6482224359f}, {0.7634361665f, -0.6458832864f}, + {0.7654141157f, -0.6435380576f}, {0.7673848604f, -0.6411867716f}, + {0.7693483822f, -0.6388294504f}, {0.7713046627f, -0.6364661164f}, + {0.7732536833f, -0.6340967917f}, {0.7751954258f, -0.6317214987f}, + {0.7771298718f, -0.6293402596f}, {0.7790570032f, -0.6269530970f}, + {0.7809768018f, -0.6245600332f}, {0.7828892495f, -0.6221610909f}, + {0.7847943284f, -0.6197562925f}, {0.7866920205f, -0.6173456607f}, + {0.7885823080f, -0.6149292183f}, {0.7904651730f, -0.6125069879f}, + {0.7923405979f, -0.6100789923f}, {0.7942085650f, -0.6076452545f}, + {0.7960690567f, -0.6052057973f}, {0.7979220554f, -0.6027606436f}, + {0.7997675438f, -0.6003098165f}, {0.8016055045f, -0.5978533391f}, + {0.8034359202f, -0.5953912345f}, {0.8052587737f, -0.5929235258f}, + {0.8070740477f, -0.5904502363f}, {0.8088817253f, -0.5879713892f}, + {0.8106817893f, -0.5854870079f}, {0.8124742229f, -0.5829971159f}, + {0.8142590092f, -0.5805017364f}, {0.8160361314f, -0.5780008930f}, + {0.8178055727f, -0.5754946092f}, {0.8195673165f, -0.5729829087f}, + {0.8213213463f, -0.5704658151f}, {0.8230676454f, -0.5679433520f}, + {0.8248061976f, -0.5654155432f}, {0.8265369863f, -0.5628824124f}, + {0.8282599954f, -0.5603439837f}, {0.8299752085f, -0.5578002807f}, + {0.8316826097f, -0.5552513276f}, {0.8333821827f, -0.5526971482f}, + {0.8350739116f, -0.5501377666f}, {0.8367577804f, -0.5475732069f}, + {0.8384337734f, -0.5450034932f}, {0.8401018747f, -0.5424286497f}, + {0.8417620687f, -0.5398487007f}, {0.8434143397f, -0.5372636705f}, + {0.8450586721f, -0.5346735833f}, {0.8466950506f, -0.5320784635f}, + {0.8483234596f, -0.5294783357f}, {0.8499438838f, -0.5268732241f}, + {0.8515563081f, -0.5242631535f}, {0.8531607172f, -0.5216481483f}, + {0.8547570960f, -0.5190282331f}, {0.8563454296f, -0.5164034326f}, + {0.8579257029f, -0.5137737716f}, {0.8594979010f, -0.5111392747f}, + {0.8610620092f, -0.5084999668f}, {0.8626180128f, -0.5058558727f}, + {0.8641658971f, -0.5032070173f}, {0.8657056476f, -0.5005534255f}, + {0.8672372497f, -0.4978951223f}, {0.8687606890f, -0.4952321327f}, + {0.8702759512f, -0.4925644818f}, {0.8717830221f, -0.4898921947f}, + {0.8732818874f, -0.4872152966f}, {0.8747725330f, -0.4845338126f}, + {0.8762549449f, -0.4818477680f}, {0.8777291092f, -0.4791571880f}, + {0.8791950120f, -0.4764620980f}, {0.8806526395f, -0.4737625234f}, + {0.8821019779f, -0.4710584896f}, {0.8835430136f, -0.4683500220f}, + {0.8849757331f, -0.4656371461f}, {0.8864001229f, -0.4629198874f}, + {0.8878161695f, -0.4601982716f}, {0.8892238597f, -0.4574723242f}, + {0.8906231801f, -0.4547420709f}, {0.8920141177f, -0.4520075374f}, + {0.8933966593f, -0.4492687494f}, {0.8947707919f, -0.4465257327f}, + {0.8961365026f, -0.4437785132f}, {0.8974937785f, -0.4410271166f}, + {0.8988426068f, -0.4382715690f}, {0.9001829749f, -0.4355118961f}, + {0.9015148702f, -0.4327481241f}, {0.9028382800f, -0.4299802788f}, + {0.9041531920f, -0.4272083864f}, {0.9054595937f, -0.4244324730f}, + {0.9067574729f, -0.4216525647f}, {0.9080468174f, -0.4188686876f}, + {0.9093276150f, -0.4160808679f}, {0.9105998536f, -0.4132891320f}, + {0.9118635213f, -0.4104935060f}, {0.9131186063f, -0.4076940163f}, + {0.9143650966f, -0.4048906892f}, {0.9156029805f, -0.4020835511f}, + {0.9168322465f, -0.3992726285f}, {0.9180528828f, -0.3964579477f}, + {0.9192648782f, -0.3936395354f}, {0.9204682210f, -0.3908174179f}, + {0.9216629000f, -0.3879916219f}, {0.9228489040f, -0.3851621741f}, + {0.9240262218f, -0.3823291009f}, {0.9251948423f, -0.3794924291f}, + {0.9263547546f, -0.3766521853f}, {0.9275059476f, -0.3738083964f}, + {0.9286484106f, -0.3709610890f}, {0.9297821327f, -0.3681102900f}, + {0.9309071035f, -0.3652560263f}, {0.9320233121f, -0.3623983246f}, + {0.9331307482f, -0.3595372118f}, {0.9342294014f, -0.3566727150f}, + {0.9353192612f, -0.3538048610f}, {0.9364003174f, -0.3509336769f}, + {0.9374725599f, -0.3480591896f}, {0.9385359785f, -0.3451814263f}, + {0.9395905633f, -0.3423004140f}, {0.9406363042f, -0.3394161799f}, + {0.9416731916f, -0.3365287510f}, {0.9427012155f, -0.3336381546f}, + {0.9437203665f, -0.3307444179f}, {0.9447306347f, -0.3278475680f}, + {0.9457320108f, -0.3249476324f}, {0.9467244853f, -0.3220446382f}, + {0.9477080488f, -0.3191386128f}, {0.9486826922f, -0.3162295836f}, + {0.9496484062f, -0.3133175778f}, {0.9506051818f, -0.3104026231f}, + {0.9515530099f, -0.3074847467f}, {0.9524918816f, -0.3045639761f}, + {0.9534217881f, -0.3016403388f}, {0.9543427206f, -0.2987138624f}, + {0.9552546705f, -0.2957845744f}, {0.9561576292f, -0.2928525024f}, + {0.9570515881f, -0.2899176739f}, {0.9579365390f, -0.2869801166f}, + {0.9588124733f, -0.2840398581f}, {0.9596793830f, -0.2810969262f}, + {0.9605372598f, -0.2781513484f}, {0.9613860956f, -0.2752031526f}, + {0.9622258825f, -0.2722523665f}, {0.9630566126f, -0.2692990178f}, + {0.9638782780f, -0.2663431344f}, {0.9646908710f, -0.2633847440f}, + {0.9654943840f, -0.2604238746f}, {0.9662888094f, -0.2574605540f}, + {0.9670741397f, -0.2544948100f}, {0.9678503675f, -0.2515266707f}, + {0.9686174856f, -0.2485561639f}, {0.9693754867f, -0.2455833176f}, + {0.9701243636f, -0.2426081597f}, {0.9708641093f, -0.2396307184f}, + {0.9715947170f, -0.2366510215f}, {0.9723161796f, -0.2336690972f}, + {0.9730284903f, -0.2306849735f}, {0.9737316426f, -0.2276986785f}, + {0.9744256297f, -0.2247102403f}, {0.9751104452f, -0.2217196871f}, + {0.9757860826f, -0.2187270470f}, {0.9764525355f, -0.2157323481f}, + {0.9771097976f, -0.2127356187f}, {0.9777578628f, -0.2097368869f}, + {0.9783967250f, -0.2067361810f}, {0.9790263781f, -0.2037335292f}, + {0.9796468163f, -0.2007289598f}, {0.9802580337f, -0.1977225010f}, + {0.9808600245f, -0.1947141812f}, {0.9814527831f, -0.1917040287f}, + {0.9820363038f, -0.1886920718f}, {0.9826105813f, -0.1856783389f}, + {0.9831756101f, -0.1826628583f}, {0.9837313848f, -0.1796456584f}, + {0.9842779003f, -0.1766267676f}, {0.9848151514f, -0.1736062143f}, + {0.9853431330f, -0.1705840270f}, {0.9858618402f, -0.1675602340f}, + {0.9863712681f, -0.1645348640f}, {0.9868714119f, -0.1615079452f}, + {0.9873622669f, -0.1584795063f}, {0.9878438284f, -0.1554495757f}, + {0.9883160920f, -0.1524181820f}, {0.9887790532f, -0.1493853537f}, + {0.9892327077f, -0.1463511192f}, {0.9896770510f, -0.1433155073f}, + {0.9901120792f, -0.1402785464f}, {0.9905377881f, -0.1372402652f}, + {0.9909541736f, -0.1342006922f}, {0.9913612319f, -0.1311598561f}, + {0.9917589592f, -0.1281177854f}, {0.9921473516f, -0.1250745089f}, + {0.9925264055f, -0.1220300551f}, {0.9928961174f, -0.1189844527f}, + {0.9932564838f, -0.1159377304f}, {0.9936075013f, -0.1128899168f}, + {0.9939491666f, -0.1098410406f}, {0.9942814765f, -0.1067911306f}, + {0.9946044277f, -0.1037402155f}, {0.9949180174f, -0.1006883239f}, + {0.9952222426f, -0.0976354846f}, {0.9955171003f, -0.0945817263f}, + {0.9958025879f, -0.0915270777f}, {0.9960787026f, -0.0884715677f}, + {0.9963454418f, -0.0854152249f}, {0.9966028030f, -0.0823580782f}, + {0.9968507838f, -0.0793001563f}, {0.9970893819f, -0.0762414880f}, + {0.9973185950f, -0.0731821021f}, {0.9975384210f, -0.0701220274f}, + {0.9977488577f, -0.0670612926f}, {0.9979499032f, -0.0639999267f}, + {0.9981415557f, -0.0609379583f}, {0.9983238133f, -0.0578754164f}, + {0.9984966743f, -0.0548123297f}, {0.9986601370f, -0.0517487271f}, + {0.9988142000f, -0.0486846375f}, {0.9989588617f, -0.0456200896f}, + {0.9990941209f, -0.0425551123f}, {0.9992199762f, -0.0394897344f}, + {0.9993364265f, -0.0364239849f}, {0.9994434706f, -0.0333578925f}, + {0.9995411076f, -0.0302914862f}, {0.9996293366f, -0.0272247947f}, + {0.9997081566f, -0.0241578470f}, {0.9997775670f, -0.0210906719f}, + {0.9998375672f, -0.0180232983f}, {0.9998881564f, -0.0149557551f}, + {0.9999293344f, -0.0118880711f}, {0.9999611006f, -0.0088202752f}, + {0.9999834548f, -0.0057523962f}, {0.9999963968f, -0.0026844632f} +}; + +static const complex_t DRAMDCTTable256[] = +{ + {0.9999952938f, 0.0030679568f}, {0.9996188225f, 0.0276081458f}, + {0.9986402182f, 0.0521317047f}, {0.9970600703f, 0.0766238614f}, + {0.9948793308f, 0.1010698628f}, {0.9920993131f, 0.1254549834f}, + {0.9887216920f, 0.1497645347f}, {0.9847485018f, 0.1739838734f}, + {0.9801821360f, 0.1980984107f}, {0.9750253451f, 0.2220936210f}, + {0.9692812354f, 0.2459550503f}, {0.9629532669f, 0.2696683256f}, + {0.9560452513f, 0.2932191627f}, {0.9485613499f, 0.3165933756f}, + {0.9405060706f, 0.3397768844f}, {0.9318842656f, 0.3627557244f}, + {0.9227011283f, 0.3855160538f}, {0.9129621904f, 0.4080441629f}, + {0.9026733182f, 0.4303264813f}, {0.8918407094f, 0.4523495872f}, + {0.8804708891f, 0.4741002147f}, {0.8685707060f, 0.4955652618f}, + {0.8561473284f, 0.5167317990f}, {0.8432082396f, 0.5375870763f}, + {0.8297612338f, 0.5581185312f}, {0.8158144108f, 0.5783137964f}, + {0.8013761717f, 0.5981607070f}, {0.7864552136f, 0.6176473079f}, + {0.7710605243f, 0.6367618612f}, {0.7552013769f, 0.6554928530f}, + {0.7388873245f, 0.6738290004f}, {0.7221281939f, 0.6917592584f}, + {0.7049340804f, 0.7092728264f}, {0.6873153409f, 0.7263591551f}, + {0.6692825883f, 0.7430079521f}, {0.6508466850f, 0.7592091890f}, + {0.6320187359f, 0.7749531066f}, {0.6128100824f, 0.7902302214f}, + {0.5932322950f, 0.8050313311f}, {0.5732971667f, 0.8193475201f}, + {0.5530167056f, 0.8331701647f}, {0.5324031279f, 0.8464909388f}, + {0.5114688504f, 0.8593018184f}, {0.4902264833f, 0.8715950867f}, + {0.4686888220f, 0.8833633387f}, {0.4468688402f, 0.8945994856f}, + {0.4247796812f, 0.9052967593f}, {0.4024346509f, 0.9154487161f}, + {0.3798472089f, 0.9250492408f}, {0.3570309612f, 0.9340925504f}, + {0.3339996514f, 0.9425731976f}, {0.3107671527f, 0.9504860739f}, + {0.2873474595f, 0.9578264130f}, {0.2637546790f, 0.9645897933f}, + {0.2400030224f, 0.9707721407f}, {0.2161067971f, 0.9763697313f}, + {0.1920803970f, 0.9813791933f}, {0.1679382950f, 0.9857975092f}, + {0.1436950332f, 0.9896220175f}, {0.1193652148f, 0.9928504145f}, + {0.0949634953f, 0.9954807555f}, {0.0705045734f, 0.9975114561f}, + {0.0460031821f, 0.9989412932f}, {0.0214740803f, 0.9997694054f}, + {-0.0030679568f, 0.9999952938f}, {-0.0276081458f, 0.9996188225f}, + {-0.0521317047f, 0.9986402182f}, {-0.0766238614f, 0.9970600703f}, + {-0.1010698628f, 0.9948793308f}, {-0.1254549834f, 0.9920993131f}, + {-0.1497645347f, 0.9887216920f}, {-0.1739838734f, 0.9847485018f}, + {-0.1980984107f, 0.9801821360f}, {-0.2220936210f, 0.9750253451f}, + {-0.2459550503f, 0.9692812354f}, {-0.2696683256f, 0.9629532669f}, + {-0.2932191627f, 0.9560452513f}, {-0.3165933756f, 0.9485613499f}, + {-0.3397768844f, 0.9405060706f}, {-0.3627557244f, 0.9318842656f}, + {-0.3855160538f, 0.9227011283f}, {-0.4080441629f, 0.9129621904f}, + {-0.4303264813f, 0.9026733182f}, {-0.4523495872f, 0.8918407094f}, + {-0.4741002147f, 0.8804708891f}, {-0.4955652618f, 0.8685707060f}, + {-0.5167317990f, 0.8561473284f}, {-0.5375870763f, 0.8432082396f}, + {-0.5581185312f, 0.8297612338f}, {-0.5783137964f, 0.8158144108f}, + {-0.5981607070f, 0.8013761717f}, {-0.6176473079f, 0.7864552136f}, + {-0.6367618612f, 0.7710605243f}, {-0.6554928530f, 0.7552013769f}, + {-0.6738290004f, 0.7388873245f}, {-0.6917592584f, 0.7221281939f}, + {-0.7092728264f, 0.7049340804f}, {-0.7263591551f, 0.6873153409f}, + {-0.7430079521f, 0.6692825883f}, {-0.7592091890f, 0.6508466850f}, + {-0.7749531066f, 0.6320187359f}, {-0.7902302214f, 0.6128100824f}, + {-0.8050313311f, 0.5932322950f}, {-0.8193475201f, 0.5732971667f}, + {-0.8331701647f, 0.5530167056f}, {-0.8464909388f, 0.5324031279f}, + {-0.8593018184f, 0.5114688504f}, {-0.8715950867f, 0.4902264833f}, + {-0.8833633387f, 0.4686888220f}, {-0.8945994856f, 0.4468688402f}, + {-0.9052967593f, 0.4247796812f}, {-0.9154487161f, 0.4024346509f}, + {-0.9250492408f, 0.3798472089f}, {-0.9340925504f, 0.3570309612f}, + {-0.9425731976f, 0.3339996514f}, {-0.9504860739f, 0.3107671527f}, + {-0.9578264130f, 0.2873474595f}, {-0.9645897933f, 0.2637546790f}, + {-0.9707721407f, 0.2400030224f}, {-0.9763697313f, 0.2161067971f}, + {-0.9813791933f, 0.1920803970f}, {-0.9857975092f, 0.1679382950f}, + {-0.9896220175f, 0.1436950332f}, {-0.9928504145f, 0.1193652148f}, + {-0.9954807555f, 0.0949634953f}, {-0.9975114561f, 0.0705045734f}, + {-0.9989412932f, 0.0460031821f}, {-0.9997694054f, 0.0214740803f}, + {-0.9999952938f, -0.0030679568f}, {-0.9996188225f, -0.0276081458f}, + {-0.9986402182f, -0.0521317047f}, {-0.9970600703f, -0.0766238614f}, + {-0.9948793308f, -0.1010698628f}, {-0.9920993131f, -0.1254549834f}, + {-0.9887216920f, -0.1497645347f}, {-0.9847485018f, -0.1739838734f}, + {-0.9801821360f, -0.1980984107f}, {-0.9750253451f, -0.2220936210f}, + {-0.9692812354f, -0.2459550503f}, {-0.9629532669f, -0.2696683256f}, + {-0.9560452513f, -0.2932191627f}, {-0.9485613499f, -0.3165933756f}, + {-0.9405060706f, -0.3397768844f}, {-0.9318842656f, -0.3627557244f}, + {-0.9227011283f, -0.3855160538f}, {-0.9129621904f, -0.4080441629f}, + {-0.9026733182f, -0.4303264813f}, {-0.8918407094f, -0.4523495872f}, + {-0.8804708891f, -0.4741002147f}, {-0.8685707060f, -0.4955652618f}, + {-0.8561473284f, -0.5167317990f}, {-0.8432082396f, -0.5375870763f}, + {-0.8297612338f, -0.5581185312f}, {-0.8158144108f, -0.5783137964f}, + {-0.8013761717f, -0.5981607070f}, {-0.7864552136f, -0.6176473079f}, + {-0.7710605243f, -0.6367618612f}, {-0.7552013769f, -0.6554928530f}, + {-0.7388873245f, -0.6738290004f}, {-0.7221281939f, -0.6917592584f}, + {-0.7049340804f, -0.7092728264f}, {-0.6873153409f, -0.7263591551f}, + {-0.6692825883f, -0.7430079521f}, {-0.6508466850f, -0.7592091890f}, + {-0.6320187359f, -0.7749531066f}, {-0.6128100824f, -0.7902302214f}, + {-0.5932322950f, -0.8050313311f}, {-0.5732971667f, -0.8193475201f}, + {-0.5530167056f, -0.8331701647f}, {-0.5324031279f, -0.8464909388f}, + {-0.5114688504f, -0.8593018184f}, {-0.4902264833f, -0.8715950867f}, + {-0.4686888220f, -0.8833633387f}, {-0.4468688402f, -0.8945994856f}, + {-0.4247796812f, -0.9052967593f}, {-0.4024346509f, -0.9154487161f}, + {-0.3798472089f, -0.9250492408f}, {-0.3570309612f, -0.9340925504f}, + {-0.3339996514f, -0.9425731976f}, {-0.3107671527f, -0.9504860739f}, + {-0.2873474595f, -0.9578264130f}, {-0.2637546790f, -0.9645897933f}, + {-0.2400030224f, -0.9707721407f}, {-0.2161067971f, -0.9763697313f}, + {-0.1920803970f, -0.9813791933f}, {-0.1679382950f, -0.9857975092f}, + {-0.1436950332f, -0.9896220175f}, {-0.1193652148f, -0.9928504145f}, + {-0.0949634953f, -0.9954807555f}, {-0.0705045734f, -0.9975114561f}, + {-0.0460031821f, -0.9989412932f}, {-0.0214740803f, -0.9997694054f}, + {0.0030679568f, -0.9999952938f}, {0.0276081458f, -0.9996188225f}, + {0.0521317047f, -0.9986402182f}, {0.0766238614f, -0.9970600703f}, + {0.1010698628f, -0.9948793308f}, {0.1254549834f, -0.9920993131f}, + {0.1497645347f, -0.9887216920f}, {0.1739838734f, -0.9847485018f}, + {0.1980984107f, -0.9801821360f}, {0.2220936210f, -0.9750253451f}, + {0.2459550503f, -0.9692812354f}, {0.2696683256f, -0.9629532669f}, + {0.2932191627f, -0.9560452513f}, {0.3165933756f, -0.9485613499f}, + {0.3397768844f, -0.9405060706f}, {0.3627557244f, -0.9318842656f}, + {0.3855160538f, -0.9227011283f}, {0.4080441629f, -0.9129621904f}, + {0.4303264813f, -0.9026733182f}, {0.4523495872f, -0.8918407094f}, + {0.4741002147f, -0.8804708891f}, {0.4955652618f, -0.8685707060f}, + {0.5167317990f, -0.8561473284f}, {0.5375870763f, -0.8432082396f}, + {0.5581185312f, -0.8297612338f}, {0.5783137964f, -0.8158144108f}, + {0.5981607070f, -0.8013761717f}, {0.6176473079f, -0.7864552136f}, + {0.6367618612f, -0.7710605243f}, {0.6554928530f, -0.7552013769f}, + {0.6738290004f, -0.7388873245f}, {0.6917592584f, -0.7221281939f}, + {0.7092728264f, -0.7049340804f}, {0.7263591551f, -0.6873153409f}, + {0.7430079521f, -0.6692825883f}, {0.7592091890f, -0.6508466850f}, + {0.7749531066f, -0.6320187359f}, {0.7902302214f, -0.6128100824f}, + {0.8050313311f, -0.5932322950f}, {0.8193475201f, -0.5732971667f}, + {0.8331701647f, -0.5530167056f}, {0.8464909388f, -0.5324031279f}, + {0.8593018184f, -0.5114688504f}, {0.8715950867f, -0.4902264833f}, + {0.8833633387f, -0.4686888220f}, {0.8945994856f, -0.4468688402f}, + {0.9052967593f, -0.4247796812f}, {0.9154487161f, -0.4024346509f}, + {0.9250492408f, -0.3798472089f}, {0.9340925504f, -0.3570309612f}, + {0.9425731976f, -0.3339996514f}, {0.9504860739f, -0.3107671527f}, + {0.9578264130f, -0.2873474595f}, {0.9645897933f, -0.2637546790f}, + {0.9707721407f, -0.2400030224f}, {0.9763697313f, -0.2161067971f}, + {0.9813791933f, -0.1920803970f}, {0.9857975092f, -0.1679382950f}, + {0.9896220175f, -0.1436950332f}, {0.9928504145f, -0.1193652148f}, + {0.9954807555f, -0.0949634953f}, {0.9975114561f, -0.0705045734f}, + {0.9989412932f, -0.0460031821f}, {0.9997694054f, -0.0214740803f} +}; + +typedef struct DRAMDCT +{ + unsigned short N; + DRAFFT* fft; + const complex_t* sincos; +} DRAMDCT; + +static void* DRAMDCTCreate(int N) +{ + DRAMDCT* p = NULL; + if (N != 256 && N != 2048) + { + return NULL; + } + p = (DRAMDCT*)malloc(sizeof(DRAMDCT)); + if (p == NULL) + { + return NULL; + } + memset(p, 0, sizeof(DRAMDCT)); + p->N = N; + p->sincos = N == 256 ? DRAMDCTTable256 : DRAMDCTTable2048; + p->fft = DRAFFTInit(N / 4); + if (p->fft == NULL) + { + free(p); + return NULL; + } + return p; +} + +static void DRAMDCTIMDCT(void* mdct, float* X_in, float* X_out) +{ + DRAMDCT* p = (DRAMDCT*)mdct; + if (p == NULL || p->fft == NULL) + { + return; + } + unsigned short k; + complex_t x; + complex_t Z1[512]; + const complex_t* sincos = p->sincos; + unsigned short N = p->N; + unsigned short N2 = N >> 1; + unsigned short N4 = N >> 2; + unsigned short N8 = N >> 3; + /* pre-IFFT complex multiplication */ + for (k = 0; k < N4; k++) + { + ComplexMult(&IM(Z1[k]), &RE(Z1[k]), X_in[2 * k], X_in[N2 - 1 - 2 * k], RE(sincos[k]), IM(sincos[k])); + } + /* complex IFFT, any non-scaling FFT can be used here */ + DRAFFTProcess(p->fft, Z1); + /* post-IFFT complex multiplication */ + for (k = 0; k < N4; k++) + { + RE(x) = RE(Z1[k]); + IM(x) = IM(Z1[k]); + ComplexMult(&IM(Z1[k]), &RE(Z1[k]), IM(x), RE(x), RE(sincos[k]), IM(sincos[k])); + } + + /* reordering */ + for (k = 0; k < N8; k += 2) + { + X_out[2 * k] = IM(Z1[N8 + k]); + X_out[2 + 2 * k] = IM(Z1[N8 + 1 + k]); + + X_out[1 + 2 * k] = -RE(Z1[N8 - 1 - k]); + X_out[3 + 2 * k] = -RE(Z1[N8 - 2 - k]); + + X_out[N4 + 2 * k] = RE(Z1[k]); + X_out[N4 + +2 + 2 * k] = RE(Z1[1 + k]); + + X_out[N4 + 1 + 2 * k] = -IM(Z1[N4 - 1 - k]); + X_out[N4 + 3 + 2 * k] = -IM(Z1[N4 - 2 - k]); + + X_out[N2 + 2 * k] = RE(Z1[N8 + k]); + X_out[N2 + +2 + 2 * k] = RE(Z1[N8 + 1 + k]); + + X_out[N2 + 1 + 2 * k] = -IM(Z1[N8 - 1 - k]); + X_out[N2 + 3 + 2 * k] = -IM(Z1[N8 - 2 - k]); + + X_out[N2 + N4 + 2 * k] = -IM(Z1[k]); + X_out[N2 + N4 + 2 + 2 * k] = -IM(Z1[1 + k]); + + X_out[N2 + N4 + 1 + 2 * k] = RE(Z1[N4 - 1 - k]); + X_out[N2 + N4 + 3 + 2 * k] = RE(Z1[N4 - 2 - k]); + } +} + +static void DRAMDCTDestroy(void* mdct) +{ + DRAMDCT* p = (DRAMDCT*)mdct; + if (p != NULL) + { + DRAFFTFree(p->fft); + free(p); + } +} + +///Huffman + +#define DRA_S_BIT 9 +#define DRA_S_BIT_MASK 511 + +typedef struct DRAHuffmanCodebook +{ + int index; + int num_codes; + int dim; + int size; + int l0, l1; + const short* l0_items; + const short** l1_items; +}DRAHuffmanCodebook; + +static const short gs_table_l0_1[16] = +{ + 1024, 1024, 1024, 1024, 1539, 1539, 1538, 1538, + 2054, 2052, 1541, 1541, 1025, 1025, 1025, 1025 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook1 = { 1, 7, 1, 7, 4, 0, gs_table_l0_1, NULL }; + +static const short gs_table_l0_2[512] = +{ + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 2570, 2570, 2570, 2570, 2570, 2570, 2570, 2570, + 2570, 2570, 2570, 2570, 2570, 2570, 2570, 2570, + 4636, -2, 4118, 4118, 3601, 3601, 3601, 3601, + 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2569, 2569, 2569, 2569, 2569, 2569, 2569, 2569, + 2569, 2569, 2569, 2569, 2569, 2569, 2569, 2569, + 4635, 4634, -3, -4, 4117, 4117, 4116, 4116, + 3084, 3084, 3084, 3084, 3084, 3084, 3084, 3084, + 2052, 2052, 2052, 2052, 2052, 2052, 2052, 2052, + 2052, 2052, 2052, 2052, 2052, 2052, 2052, 2052, + 2052, 2052, 2052, 2052, 2052, 2052, 2052, 2052, + 2052, 2052, 2052, 2052, 2052, 2052, 2052, 2052, + 3600, 3600, 3600, 3600, -5, -6, 4115, 4115, + 3599, 3599, 3599, 3599, -7, 4633, 4114, 4114, + 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, + 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + -8, 4637, 4119, 4119, 4120, 4120, 4638, -9, + 3086, 3086, 3086, 3086, 3086, 3086, 3086, 3086, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536 +}; + +static const short gs_table_l1_2_81[64] = +{ + 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, + 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1069, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 556, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556 +}; + +static const short gs_table_l1_2_178[64] = +{ + 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, + 545, 545, 545, 545, 545, 545, 545, 545, + 544, 544, 544, 544, 544, 544, 544, 544, + 544, 544, 544, 544, 544, 544, 544, 544, + 544, 544, 544, 544, 544, 544, 544, 544, + 544, 544, 544, 544, 544, 544, 544, 544 +}; + +static const short gs_table_l1_2_179[64] = +{ + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548 +}; + +static const short gs_table_l1_2_228[64] = +{ + 1590, 1590, 1590, 1590, 1590, 1590, 1590, 1590, + 3132, 3131, 2617, 2617, 2110, 2110, 2110, 2110, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 543, 543, 543, 543, 543, 543, 543, 543, + 543, 543, 543, 543, 543, 543, 543, 543, + 543, 543, 543, 543, 543, 543, 543, 543, + 543, 543, 543, 543, 543, 543, 543, 543 +}; + +static const short gs_table_l1_2_229[64] = +{ + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1588, 1588, 1588, 1588, 1588, 1588, 1588, 1588, + 1589, 1589, 1589, 1589, 1589, 1589, 1589, 1589, + 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546, + 546, 546, 546, 546, 546, 546, 546, 546 +}; + +static const short gs_table_l1_2_236[64] = +{ + 1583, 1583, 1583, 1583, 1583, 1583, 1583, 1583, + 1585, 1585, 1585, 1585, 1585, 1585, 1585, 1585, + 2099, 2099, 2099, 2099, 2106, 2106, 2106, 2106, + 2096, 2096, 2096, 2096, 2098, 2098, 2098, 2098, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065, + 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1065 +}; + +static const short gs_table_l1_2_400[64] = +{ + 554, 554, 554, 554, 554, 554, 554, 554, + 554, 554, 554, 554, 554, 554, 554, 554, + 554, 554, 554, 554, 554, 554, 554, 554, + 554, 554, 554, 554, 554, 554, 554, 554, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549 +}; + +static const short gs_table_l1_2_407[64] = +{ + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 1591, 1591, 1591, 1591, 1591, 1591, 1591, 1591, + 2109, 2109, 2109, 2109, 2104, 2104, 2104, 2104, + 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070, + 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070 +}; + +static const short* gs_table_l1_2[8] = +{ + gs_table_l1_2_81, gs_table_l1_2_178, + gs_table_l1_2_179, gs_table_l1_2_228, + gs_table_l1_2_229, gs_table_l1_2_236, + gs_table_l1_2_400, gs_table_l1_2_407 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook2 = { 2, 64, 1, 64, 9, 6, gs_table_l0_2, gs_table_l1_2 }; + + +static const short gs_table_l0_3[512] = +{ + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 3087, 3087, 3087, 3087, 3087, 3087, 3087, 3087, + -2, 4633, 4119, 4119, 4634, 4630, -3, 4639, + 2570, 2570, 2570, 2570, 2570, 2570, 2570, 2570, + 2570, 2570, 2570, 2570, 2570, 2570, 2570, 2570, + 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048, + 3086, 3086, 3086, 3086, 3086, 3086, 3086, 3086, + 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, + 3602, 3602, 3602, 3602, 4116, 4116, 4117, 4117, + 3084, 3084, 3084, 3084, 3084, 3084, 3084, 3084, + 2052, 2052, 2052, 2052, 2052, 2052, 2052, 2052, + 2052, 2052, 2052, 2052, 2052, 2052, 2052, 2052, + 2052, 2052, 2052, 2052, 2052, 2052, 2052, 2052, + 2052, 2052, 2052, 2052, 2052, 2052, 2052, 2052, + 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057, + 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057, + 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057, + 2057, 2057, 2057, 2057, 2057, 2057, 2057, 2057, + 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, + 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, + 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, + 2056, 2056, 2056, 2056, 2056, 2056, 2056, 2056, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 3088, 3088, 3088, 3088, 3088, 3088, 3088, 3088, + 3601, 3601, 3601, 3601, 3603, 3603, 3603, 3603, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054 +}; + +static const short gs_table_l1_3_136[4] = +{ + 540, 540, 1054, 1051 +}; + +static const short gs_table_l1_3_142[4] = +{ + 541, 541, 536, 536 +}; + +static const short* gs_table_l1_3[2] = +{ + gs_table_l1_3_136, gs_table_l1_3_142 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook3 = { 3, 32, 1, 32, 9, 2, gs_table_l0_3, gs_table_l1_3 }; + + +static const short gs_table_l0_4[512] = +{ + 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059, + 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059, + 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059, + 2059, 2059, 2059, 2059, 2059, 2059, 2059, 2059, + 3086, 3086, 3086, 3086, 3086, 3086, 3086, 3086, + 3599, 3599, 3599, 3599, -2, 4624, 4098, 4098, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2572, 2572, 2572, 2572, 2572, 2572, 2572, 2572, + 2572, 2572, 2572, 2572, 2572, 2572, 2572, 2572, + 3075, 3075, 3075, 3075, 3075, 3075, 3075, 3075, + 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, + 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, + 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, + 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, + 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, + 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, + 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, + 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, + 1546, 1546, 1546, 1546, 1546, 1546, 1546, 1546, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033 +}; + +static const short gs_table_l1_4_44[4] = +{ + 1024, 1041, 513, 513 +}; + +static const short* gs_table_l1_4[1] = +{ + gs_table_l1_4_44 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook4 = { 4, 18, 1, 18, 9, 2, gs_table_l0_4, gs_table_l1_4 }; + + +static const short gs_table_l0_5[512] = +{ + 2572, 2572, 2572, 2572, 2572, 2572, 2572, 2572, + 2572, 2572, 2572, 2572, 2572, 2572, 2572, 2572, + 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, + 4611, -2, 4110, 4110, 3588, 3588, 3588, 3588, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2054, 2054, 2054, 2054, 2054, 2054, 2054, 2054, + 2058, 2058, 2058, 2058, 2058, 2058, 2058, 2058, + 2058, 2058, 2058, 2058, 2058, 2058, 2058, 2058, + 2058, 2058, 2058, 2058, 2058, 2058, 2058, 2058, + 2058, 2058, 2058, 2058, 2058, 2058, 2058, 2058, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + 1545, 1545, 1545, 1545, 1545, 1545, 1545, 1545, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 1543, 1543, 1543, 1543, 1543, 1543, 1543, 1543, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520 +}; + +static const short gs_table_l1_5_25[8] = +{ + 1538, 1553, 1536, 1537, 1040, 1040, 1039, 1039 +}; + +static const short* gs_table_l1_5[1] = +{ + gs_table_l1_5_25 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook5 = { 5, 18, 1, 18, 9, 3, gs_table_l0_5, gs_table_l1_5 }; + + +static const short gs_table_l0_6[512] = +{ + 2671, 2671, 2671, 2671, 2671, 2671, 2671, 2671, + 2671, 2671, 2671, 2671, 2671, 2671, 2671, 2671, + 3079, 3079, 3079, 3079, 3079, 3079, 3079, 3079, + 4637, -2, -3, -4, 4639, -5, -6, -7, + 2162, 2162, 2162, 2162, 2162, 2162, 2162, 2162, + 2162, 2162, 2162, 2162, 2162, 2162, 2162, 2162, + 2162, 2162, 2162, 2162, 2162, 2162, 2162, 2162, + 2162, 2162, 2162, 2162, 2162, 2162, 2162, 2162, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 3180, 3180, 3180, 3180, 3180, 3180, 3180, 3180, + 3689, 3689, 3689, 3689, 4196, 4196, 4108, 4108, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2163, 2163, 2163, 2163, 2163, 2163, 2163, 2163, + 2163, 2163, 2163, 2163, 2163, 2163, 2163, 2163, + 2163, 2163, 2163, 2163, 2163, 2163, 2163, 2163, + 2163, 2163, 2163, 2163, 2163, 2163, 2163, 2163, + 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, + 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, + 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, + 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, + -8, 4622, 4197, 4197, 4640, -9, -10, -11, + 3593, 3593, 3593, 3593, 4198, 4198, 4638, 4705, + 3181, 3181, 3181, 3181, 3181, 3181, 3181, 3181, + 3078, 3078, 3078, 3078, 3078, 3078, 3078, 3078, + 2160, 2160, 2160, 2160, 2160, 2160, 2160, 2160, + 2160, 2160, 2160, 2160, 2160, 2160, 2160, 2160, + 2160, 2160, 2160, 2160, 2160, 2160, 2160, 2160, + 2160, 2160, 2160, 2160, 2160, 2160, 2160, 2160, + 3178, 3178, 3178, 3178, 3178, 3178, 3178, 3178, + -12, 4642, -13, 4657, -14, 4660, 4636, -15, + 3179, 3179, 3179, 3179, 3179, 3179, 3179, 3179, + 4624, 4659, 4194, 4194, -16, 4658, 4195, 4195, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 2670, 2670, 2670, 2670, 2670, 2670, 2670, 2670, + 2670, 2670, 2670, 2670, 2670, 2670, 2670, 2670, + 3080, 3080, 3080, 3080, 3080, 3080, 3080, 3080, + 3595, 3595, 3595, 3595, 4623, -17, 4109, 4109, + 2161, 2161, 2161, 2161, 2161, 2161, 2161, 2161, + 2161, 2161, 2161, 2161, 2161, 2161, 2161, 2161, + 2161, 2161, 2161, 2161, 2161, 2161, 2161, 2161, + 2161, 2161, 2161, 2161, 2161, 2161, 2161, 2161, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 3687, 3687, 3687, 3687, 4641, 4704, -18, -19, + 3594, 3594, 3594, 3594, 3688, 3688, 3688, 3688, + 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, + 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, + 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, + 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051 +}; + +static const short gs_table_l1_6_25[256] = +{ + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569, + 569, 569, 569, 569, 569, 569, 569, 569 +}; + +static const short gs_table_l1_6_26[256] = +{ + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 573, 573, 573, 573, 573 +}; + +static const short gs_table_l1_6_27[256] = +{ + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, + 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + 1606, 1606, 1606, 1606, 1606, 1606, 1606, 1606, + 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, + 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, + 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, + 1628, 1628, 1628, 1628, 1628, 1628, 1628, 1628, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090 +}; + +static const short gs_table_l1_6_29[256] = +{ + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 565, 565, 565, 565, 565, 565, 565, 565, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568, + 568, 568, 568, 568, 568, 568, 568, 568 +}; + +static const short gs_table_l1_6_30[256] = +{ + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 548, 548, 548, 548, 548, 548, 548, 548, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1066, 1066, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, + 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117 +}; + +static const short gs_table_l1_6_31[256] = +{ + 1562, 1562, 1562, 1562, 1562, 1562, 1562, 1562, + 1562, 1562, 1562, 1562, 1562, 1562, 1562, 1562, + 1562, 1562, 1562, 1562, 1562, 1562, 1562, 1562, + 1562, 1562, 1562, 1562, 1562, 1562, 1562, 1562, + 1577, 1577, 1577, 1577, 1577, 1577, 1577, 1577, + 1577, 1577, 1577, 1577, 1577, 1577, 1577, 1577, + 1577, 1577, 1577, 1577, 1577, 1577, 1577, 1577, + 1577, 1577, 1577, 1577, 1577, 1577, 1577, 1577, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 1046, 1046, 1046, 1046, 1046, 1046, 1046, 1046, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547, + 547, 547, 547, 547, 547, 547, 547, 547 +}; + +static const short gs_table_l1_6_224[256] = +{ + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 560, 560, 560, 560, 560, 560, 560, 560, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559, + 559, 559, 559, 559, 559, 559, 559, 559 +}; + +static const short gs_table_l1_6_229[256] = +{ + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1044, 1044, 1044, 1044, 1044, 1044, 1044, 1044, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530, + 530, 530, 530, 530, 530, 530, 530, 530 +}; + +static const short gs_table_l1_6_230[256] = +{ + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 3158, 3158, 3158, 3158, 3668, 3668, 4178, 4179, + 2633, 2633, 2633, 2633, 2633, 2633, 2633, 2633, + 2648, 2648, 2648, 2648, 2648, 2648, 2648, 2648, + 3159, 3159, 3159, 3159, 3161, 3161, 3161, 3161, + 1561, 1561, 1561, 1561, 1561, 1561, 1561, 1561, + 1561, 1561, 1561, 1561, 1561, 1561, 1561, 1561, + 1561, 1561, 1561, 1561, 1561, 1561, 1561, 1561, + 1561, 1561, 1561, 1561, 1561, 1561, 1561, 1561, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607, + 607, 607, 607, 607, 607, 607, 607, 607 +}; + +static const short gs_table_l1_6_231[256] = +{ + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1068, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529 +}; + +static const short gs_table_l1_6_296[256] = +{ + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549 +}; + +static const short gs_table_l1_6_298[256] = +{ + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, + 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, + 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, + 1607, 1607, 1607, 1607, 1607, 1607, 1607, 1607, + 2138, 2138, 2138, 2138, 2138, 2138, 2138, 2138, + 2138, 2138, 2138, 2138, 2138, 2138, 2138, 2138, + 2139, 2139, 2139, 2139, 2139, 2139, 2139, 2139, + 2139, 2139, 2139, 2139, 2139, 2139, 2139, 2139, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606, + 606, 606, 606, 606, 606, 606, 606, 606 +}; + +static const short gs_table_l1_6_300[256] = +{ + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 572, 572, 572, 572, 572, 572, 572, 572, + 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + 1047, 1047, 1047, 1047, 1047, 1047, 1047, 1047, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048, + 1048, 1048, 1048, 1048, 1048, 1048, 1048, 1048 +}; + +static const short gs_table_l1_6_303[256] = +{ + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570, + 570, 570, 570, 570, 570, 570, 570, 570 +}; + +static const short gs_table_l1_6_316[256] = +{ + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 575, 575, 575, 575, 575, 575, 575, 575, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, + 1092, 1092, 1092, 1092, 1092, 1092, 1092, 1092, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062 +}; + +static const short gs_table_l1_6_413[256] = +{ + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 571, 571, 571, 571, 571, 571, 571, 571, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567, + 567, 567, 567, 567, 567, 567, 567, 567 +}; + +static const short gs_table_l1_6_470[256] = +{ + 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, + 2120, 2120, 2120, 2120, 2120, 2120, 2120, 2120, + 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, + 2122, 2122, 2122, 2122, 2122, 2122, 2122, 2122, + 3147, 3147, 3147, 3147, 3157, 3157, 3157, 3157, + 3663, 3663, 3664, 3664, 3661, 3661, 3662, 3662, + 2636, 2636, 2636, 2636, 2636, 2636, 2636, 2636, + 2641, 2641, 2641, 2641, 2641, 2641, 2641, 2641, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531, + 531, 531, 531, 531, 531, 531, 531, 531 +}; + +static const short gs_table_l1_6_471[256] = +{ + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1091, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577, + 577, 577, 577, 577, 577, 577, 577, 577 +}; + +static const short* gs_table_l1_6[18] = +{ + gs_table_l1_6_25, gs_table_l1_6_26, + gs_table_l1_6_27, gs_table_l1_6_29, + gs_table_l1_6_30, gs_table_l1_6_31, + gs_table_l1_6_224, gs_table_l1_6_229, + gs_table_l1_6_230, gs_table_l1_6_231, + gs_table_l1_6_296, gs_table_l1_6_298, + gs_table_l1_6_300, gs_table_l1_6_303, + gs_table_l1_6_316, gs_table_l1_6_413, + gs_table_l1_6_470, gs_table_l1_6_471 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook6 = { 6, 116, 1, 116, 9, 8, gs_table_l0_6, gs_table_l1_6 }; + + +static const short gs_table_l0_7[512] = +{ + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 1536, 1536, 1536, 1536, 1536, 1536, 1536, 1536, + 3598, 3598, 3598, 3598, -2, -3, -4, 4632, + 3599, 3599, 3599, 3599, 4115, 4115, 4116, 4116, + 3597, 3597, 3597, 3597, 3687, 3687, 3687, 3687, + 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566, + 3179, 3179, 3179, 3179, 3179, 3179, 3179, 3179, + 3080, 3080, 3080, 3080, 3080, 3080, 3080, 3080, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2671, 2671, 2671, 2671, 2671, 2671, 2671, 2671, + 2671, 2671, 2671, 2671, 2671, 2671, 2671, 2671, + 4664, 4661, 4662, 4665, -5, -6, -7, 4663, + 3081, 3081, 3081, 3081, 3081, 3081, 3081, 3081, + -8, -9, 4667, 4704, 4197, 4197, 4114, 4114, + 3180, 3180, 3180, 3180, 3180, 3180, 3180, 3180, + 2672, 2672, 2672, 2672, 2672, 2672, 2672, 2672, + 2672, 2672, 2672, 2672, 2672, 2672, 2672, 2672, + 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, + 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, + 3688, 3688, 3688, 3688, 4196, 4196, 4198, 4198, + -10, -11, 4666, 4705, 3689, 3689, 3689, 3689, + 2162, 2162, 2162, 2162, 2162, 2162, 2162, 2162, + 2162, 2162, 2162, 2162, 2162, 2162, 2162, 2162, + 2162, 2162, 2162, 2162, 2162, 2162, 2162, 2162, + 2162, 2162, 2162, 2162, 2162, 2162, 2162, 2162, + 2161, 2161, 2161, 2161, 2161, 2161, 2161, 2161, + 2161, 2161, 2161, 2161, 2161, 2161, 2161, 2161, + 2161, 2161, 2161, 2161, 2161, 2161, 2161, 2161, + 2161, 2161, 2161, 2161, 2161, 2161, 2161, 2161, + 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, + 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, + 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, + 2050, 2050, 2050, 2050, 2050, 2050, 2050, 2050, + 2669, 2669, 2669, 2669, 2669, 2669, 2669, 2669, + 2669, 2669, 2669, 2669, 2669, 2669, 2669, 2669, + -12, -13, 4117, 4117, 3600, 3600, 3600, 3600, + 4194, 4194, 4118, 4118, 3601, 3601, 3601, 3601, + 3178, 3178, 3178, 3178, 3178, 3178, 3178, 3178, + 3083, 3083, 3083, 3083, 3083, 3083, 3083, 3083, + 2567, 2567, 2567, 2567, 2567, 2567, 2567, 2567, + 2567, 2567, 2567, 2567, 2567, 2567, 2567, 2567, + 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, + 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, + 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, + 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, + 3084, 3084, 3084, 3084, 3084, 3084, 3084, 3084, + 4195, 4195, 4669, -14, 4668, 4703, -15, -16, + 2670, 2670, 2670, 2670, 2670, 2670, 2670, 2670, + 2670, 2670, 2670, 2670, 2670, 2670, 2670, 2670, + 2163, 2163, 2163, 2163, 2163, 2163, 2163, 2163, + 2163, 2163, 2163, 2163, 2163, 2163, 2163, 2163, + 2163, 2163, 2163, 2163, 2163, 2163, 2163, 2163, + 2163, 2163, 2163, 2163, 2163, 2163, 2163, 2163 +}; + +static const short gs_table_l1_7_68[16] = +{ + 564, 564, 564, 564, 564, 564, 564, 564, + 602, 602, 602, 602, 602, 602, 602, 602 +}; + +static const short gs_table_l1_7_69[16] = +{ + 558, 558, 558, 558, 558, 558, 558, 558, + 562, 562, 562, 562, 562, 562, 562, 562 +}; + +static const short gs_table_l1_7_70[16] = +{ + 604, 604, 604, 604, 604, 604, 604, 604, + 539, 539, 539, 539, 539, 539, 539, 539 +}; + +static const short gs_table_l1_7_180[16] = +{ + 575, 575, 575, 575, 575, 575, 575, 575, + 1091, 1091, 1091, 1091, 1111, 1111, 1111, 1111 +}; + +static const short gs_table_l1_7_181[16] = +{ + 1616, 1616, 1617, 1617, 1608, 1608, 1609, 1609, + 540, 540, 540, 540, 540, 540, 540, 540 +}; + +static const short gs_table_l1_7_182[16] = +{ + 1072, 1072, 1072, 1072, 1073, 1073, 1073, 1073, + 2127, 2133, 2125, 2126, 1050, 1050, 1050, 1050 +}; + +static const short gs_table_l1_7_192[16] = +{ + 1575, 1575, 1579, 1579, 1570, 1570, 1573, 1573, + 1605, 1605, 1606, 1606, 1581, 1581, 1602, 1602 +}; + +static const short gs_table_l1_7_193[16] = +{ + 2089, 2090, 2084, 2086, 2123, 2124, 2119, 2122, + 1568, 1568, 1569, 1569, 1566, 1566, 1567, 1567 +}; + +static const short gs_table_l1_7_248[16] = +{ + 1118, 1118, 1118, 1118, 1620, 1620, 1565, 1565, + 574, 574, 574, 574, 574, 574, 574, 574 +}; + +static const short gs_table_l1_7_249[16] = +{ + 1049, 1049, 1049, 1049, 1092, 1092, 1092, 1092, + 563, 563, 563, 563, 563, 563, 563, 563 +}; + +static const short gs_table_l1_7_368[16] = +{ + 601, 601, 601, 601, 601, 601, 601, 601, + 603, 603, 603, 603, 603, 603, 603, 603 +}; + +static const short gs_table_l1_7_369[16] = +{ + 598, 598, 598, 598, 598, 598, 598, 598, + 600, 600, 600, 600, 600, 600, 600, 600 +}; + +static const short gs_table_l1_7_459[16] = +{ + 605, 605, 605, 605, 605, 605, 605, 605, + 1106, 1106, 1106, 1106, 1107, 1107, 1107, 1107 +}; + +static const short gs_table_l1_7_462[16] = +{ + 1059, 1059, 1059, 1059, 1064, 1064, 1064, 1064, + 535, 535, 535, 535, 535, 535, 535, 535 +}; + +static const short gs_table_l1_7_463[16] = +{ + 1088, 1088, 1088, 1088, 1089, 1089, 1089, 1089, + 1068, 1068, 1068, 1068, 1071, 1071, 1071, 1071 +}; + +static const short* gs_table_l1_7[15] = +{ + gs_table_l1_7_68, gs_table_l1_7_69, + gs_table_l1_7_70, gs_table_l1_7_180, + gs_table_l1_7_181, gs_table_l1_7_182, + gs_table_l1_7_192, gs_table_l1_7_193, + gs_table_l1_7_248, gs_table_l1_7_249, + gs_table_l1_7_368, gs_table_l1_7_369, + gs_table_l1_7_459, gs_table_l1_7_462, + gs_table_l1_7_463 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook7 = { 7, 116, 1, 116, 9, 4, gs_table_l0_7, gs_table_l1_7 }; + + +static const short gs_table_l0_8[512] = +{ + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1539, 1539, 1539, 1539, 1539, 1539, 1539, 1539, + 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, + 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, + 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, + 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, + 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, + 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, + 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, + 1540, 1540, 1540, 1540, 1540, 1540, 1540, 1540, + 3084, 3084, 3084, 3084, 3084, 3084, 3084, 3084, + -2, 4615, 4106, 4106, 3595, 3595, 3595, 3595, + 2574, 2574, 2574, 2574, 2574, 2574, 2574, 2574, + 2574, 2574, 2574, 2574, 2574, 2574, 2574, 2574, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 2053, 2053, 2053, 2053, 2053, 2053, 2053, 2053, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 1537, 1537, 1537, 1537, 1537, 1537, 1537, 1537, + 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, + 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, + 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, + 2063, 2063, 2063, 2063, 2063, 2063, 2063, 2063, + 2573, 2573, 2573, 2573, 2573, 2573, 2573, 2573, + 2573, 2573, 2573, 2573, 2573, 2573, 2573, 2573, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566 +}; + +static const short gs_table_l1_8_200[2] = +{ + 520, 521 +}; + +static const short* gs_table_l1_8[1] = +{ + gs_table_l1_8_200 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook8 = { 8, 16, 1, 16, 9, 1, gs_table_l0_8, gs_table_l1_8 }; + + +static const short gs_table_l0_9[512] = +{ + -2, 4616, 4103, 4103, 3590, 3590, 3590, 3590, + 3077, 3077, 3077, 3077, 3077, 3077, 3077, 3077, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, + 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, + 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, + 2051, 2051, 2051, 2051, 2051, 2051, 2051, 2051, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1538, 1538, 1538, 1538, 1538, 1538, 1538, 1538, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512 +}; + +static const short gs_table_l1_9_0[64] = +{ + 3087, 3086, 2573, 2573, 2060, 2060, 2060, 2060, + 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, + 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, + 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, + 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521, + 521, 521, 521, 521, 521, 521, 521, 521 +}; + +static const short* gs_table_l1_9[1] = +{ + gs_table_l1_9_0 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook9 = { 9, 16, 1, 16, 9, 6, gs_table_l0_9, gs_table_l1_9 }; + + +static const short gs_table_l0_10[512] = +{ + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 3614, 3614, 3614, 3614, 3660, 3660, 3660, 3660, + 3634, 3634, 3634, 3634, 3598, 3598, 3598, 3598, + 3652, 3652, 3652, 3652, -2, -3, 4617, 4685, + 3612, 3612, 3612, 3612, 3628, 3628, 3628, 3628, + 3636, 3636, 3636, 3636, 3588, 3588, 3588, 3588, + 3632, 3632, 3632, 3632, 3596, 3596, 3596, 3596, + 3616, 3616, 3616, 3616, 3600, 3600, 3600, 3600, + 3648, 3648, 3648, 3648, 4679, 4619, 4659, -4, + 3618, 3618, 3618, 3618, 3620, 3620, 3620, 3620, + 3630, 3630, 3630, 3630, 3642, 3642, 3642, 3642, + 3606, 3606, 3606, 3606, 4665, 4609, 4611, 4615, + 3626, 3626, 3626, 3626, 3622, 3622, 3622, 3622, + 2609, 2609, 2609, 2609, 2609, 2609, 2609, 2609, + 2609, 2609, 2609, 2609, 2609, 2609, 2609, 2609, + 2573, 2573, 2573, 2573, 2573, 2573, 2573, 2573, + 2573, 2573, 2573, 2573, 2573, 2573, 2573, 2573, + 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, + 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, + 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, + 2115, 2115, 2115, 2115, 2115, 2115, 2115, 2115, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2085, 2085, 2085, 2085, 2085, 2085, 2085, 2085, + 2085, 2085, 2085, 2085, 2085, 2085, 2085, 2085, + 2085, 2085, 2085, 2085, 2085, 2085, 2085, 2085, + 2085, 2085, 2085, 2085, 2085, 2085, 2085, 2085, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 4119, 4119, 4151, 4151, 4159, 4159, 4131, 4131, + 4141, 4141, 4175, 4175, 4169, 4169, 4149, 4149, + 4165, 4165, 4123, 4123, 4125, 4125, 4628, 4668, + 4101, 4101, 4171, 4171, 4113, 4113, 4121, 4121, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 4117, 4117, 4155, 4155, 4143, 4143, 4161, 4161, + 4157, 4157, 4115, 4115, 4129, 4129, 4111, 4111, + -5, -6, -7, -8, 3654, 3654, 3654, 3654, + 3594, 3594, 3594, 3594, 3650, 3650, 3650, 3650 +}; + +static const short gs_table_l1_10_148[2] = +{ + 584, 538 +}; + +static const short gs_table_l1_10_149[2] = +{ + 592, 536 +}; + +static const short gs_table_l1_10_191[2] = +{ + 568, 512 +}; + +static const short gs_table_l1_10_496[2] = +{ + 514, 518 +}; + +static const short gs_table_l1_10_497[2] = +{ + 586, 566 +}; + +static const short gs_table_l1_10_498[2] = +{ + 590, 530 +}; + +static const short gs_table_l1_10_499[2] = +{ + 520, 574 +}; + +static const short* gs_table_l1_10[7] = +{ + gs_table_l1_10_148, gs_table_l1_10_149, + gs_table_l1_10_191, gs_table_l1_10_496, + gs_table_l1_10_497, gs_table_l1_10_498, + gs_table_l1_10_499 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook10 = { 10, 3, 4, 81, 9, 1, gs_table_l0_10, gs_table_l1_10 }; + + +static const short gs_table_l0_11[128] = +{ + 2582, 2582, 2582, 2582, 3095, 3095, 3073, 3073, + 2570, 2570, 2570, 2570, 2574, 2574, 2574, 2574, + 3091, 3091, 3077, 3077, 3081, 3081, 3075, 3075, + 3093, 3093, 3087, 3087, 2578, 2578, 2578, 2578, + 2566, 2566, 2566, 2566, 2568, 2568, 2568, 2568, + 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, + 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, + 2064, 2064, 2064, 2064, 2064, 2064, 2064, 2064, + 3608, 3584, 3588, 3604, 2562, 2562, 2562, 2562, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook11 = { 11, 5, 2, 25, 7, 0, gs_table_l0_11, NULL }; + + +static const short gs_table_l0_12[512] = +{ + 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, + 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, + 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, + 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, + 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, + 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, + 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, + 1576, 1576, 1576, 1576, 1576, 1576, 1576, 1576, + 2590, 2590, 2590, 2590, 2590, 2590, 2590, 2590, + 2590, 2590, 2590, 2590, 2590, 2590, 2590, 2590, + 3095, 3095, 3095, 3095, 3095, 3095, 3095, 3095, + 4686, 4670, 4140, 4140, 3612, 3612, 3612, 3612, + 2610, 2610, 2610, 2610, 2610, 2610, 2610, 2610, + 2610, 2610, 2610, 2610, 2610, 2610, 2610, 2610, + 2608, 2608, 2608, 2608, 2608, 2608, 2608, 2608, + 2608, 2608, 2608, 2608, 2608, 2608, 2608, 2608, + 4682, 4614, 4100, 4100, 3596, 3596, 3596, 3596, + 3105, 3105, 3105, 3105, 3105, 3105, 3105, 3105, + 2592, 2592, 2592, 2592, 2592, 2592, 2592, 2592, + 2592, 2592, 2592, 2592, 2592, 2592, 2592, 2592, + 3119, 3119, 3119, 3119, 3119, 3119, 3119, 3119, + 3636, 3636, 3636, 3636, 3652, 3652, 3652, 3652, + 3129, 3129, 3129, 3129, 3129, 3129, 3129, 3129, + 3644, 3644, 3644, 3644, 4172, 4172, -2, 4634, + 3604, 3604, 3604, 3604, 4132, 4132, 4662, -3, + 3618, 3618, 3618, 3618, 3650, 3650, 3650, 3650, + 3598, 3598, 3598, 3598, 3630, 3630, 3630, 3630, + 4115, 4115, 4165, 4165, 4157, 4157, -4, 4678, + 3608, 3608, 3608, 3608, 3640, 3640, 3640, 3640, + 4107, 4107, 4121, 4121, -5, 4618, 4661, 4611, + 4624, 4672, -6, 4635, 4161, 4161, 4151, 4151, + 4111, 4111, 4613, 4685, 3651, 3651, 3651, 3651, + 2602, 2602, 2602, 2602, 2602, 2602, 2602, 2602, + 2602, 2602, 2602, 2602, 2602, 2602, 2602, 2602, + 2598, 2598, 2598, 2598, 2598, 2598, 2598, 2598, + 2598, 2598, 2598, 2598, 2598, 2598, 2598, 2598, + 2618, 2618, 2618, 2618, 2618, 2618, 2618, 2618, + 2618, 2618, 2618, 2618, 2618, 2618, 2618, 2618, + 2582, 2582, 2582, 2582, 2582, 2582, 2582, 2582, + 2582, 2582, 2582, 2582, 2582, 2582, 2582, 2582, + 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, + 3115, 3115, 3115, 3115, 3115, 3115, 3115, 3115, + 3109, 3109, 3109, 3109, 3109, 3109, 3109, 3109, + 4171, 4171, 4131, 4131, 4141, 4141, 4610, 4626, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 3093, 3093, 3093, 3093, 3093, 3093, 3093, 3093, + 3101, 3101, 3101, 3101, 3101, 3101, 3101, 3101, + 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, + 3131, 3131, 3131, 3131, 3131, 3131, 3131, 3131 +}; + +static const short gs_table_l1_12_190[4] = +{ + 521, 521, 513, 513 +}; + +static const short gs_table_l1_12_199[4] = +{ + 591, 591, 1024, 1096 +}; + +static const short gs_table_l1_12_222[4] = +{ + 583, 583, 585, 585 +}; + +static const short gs_table_l1_12_236[4] = +{ + 575, 575, 519, 519 +}; + +static const short gs_table_l1_12_242[4] = +{ + 529, 529, 1104, 1032 +}; + +static const short* gs_table_l1_12[5] = +{ + gs_table_l1_12_190, gs_table_l1_12_199, + gs_table_l1_12_222, gs_table_l1_12_236, + gs_table_l1_12_242 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook12 = { 12, 9, 2, 81, 9, 2, gs_table_l0_12, gs_table_l1_12 }; + + +static const short gs_table_l0_13[512] = +{ + 4307, 4307, 4171, 4171, -2, 4651, 4218, 4218, + -3, -4, -5, -6, 4156, 4156, 4729, -7, + 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2721, + 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2721, + 2687, 2687, 2687, 2687, 2687, 2687, 2687, 2687, + 2687, 2687, 2687, 2687, 2687, 2687, 2687, 2687, + 4324, 4324, 4741, -8, 3692, 3692, 3692, 3692, + 4219, 4219, 4664, -9, 3696, 3696, 3696, 3696, + 2703, 2703, 2703, 2703, 2703, 2703, 2703, 2703, + 2703, 2703, 2703, 2703, 2703, 2703, 2703, 2703, + 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, + 2705, 2705, 2705, 2705, 2705, 2705, 2705, 2705, + -10, 4696, -11, 4697, 4227, 4227, 4253, 4253, + 3250, 3250, 3250, 3250, 3250, 3250, 3250, 3250, + 3182, 3182, 3182, 3182, 3182, 3182, 3182, 3182, + 4763, 4670, 4798, 4823, 3760, 3760, 3760, 3760, + 2192, 2192, 2192, 2192, 2192, 2192, 2192, 2192, + 2192, 2192, 2192, 2192, 2192, 2192, 2192, 2192, + 2192, 2192, 2192, 2192, 2192, 2192, 2192, 2192, + 2192, 2192, 2192, 2192, 2192, 2192, 2192, 2192, + 3218, 3218, 3218, 3218, 3218, 3218, 3218, 3218, + 4228, 4228, -12, 4834, 3779, 3779, 3779, 3779, + 3214, 3214, 3214, 3214, 3214, 3214, 3214, 3214, + 3725, 3725, 3725, 3725, -13, -14, 4681, 4799, + 3731, 3731, 3731, 3731, 3677, 3677, 3677, 3677, + 4687, 4758, -15, 4817, 4325, 4325, 4705, 4807, + 3234, 3234, 3234, 3234, 3234, 3234, 3234, 3234, + 4244, 4244, -16, 4706, 4277, 4277, 4245, 4245, + -17, -18, 4235, 4235, 4236, 4236, -19, 4650, + 3198, 3198, 3198, 3198, 3198, 3198, 3198, 3198, + -20, -21, 4293, 4293, 4191, 4191, -22, 4682, + 3200, 3200, 3200, 3200, 3200, 3200, 3200, 3200, + 3796, 3796, 3796, 3796, 3697, 3697, 3697, 3697, + -23, 4663, 4780, 4695, 3675, 3675, 3675, 3675, + 3643, 3643, 3643, 3643, 4342, 4342, 4234, 4234, + 4745, 4871, -24, -25, 3691, 3691, 3691, 3691, + 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, + 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, + 3660, 3660, 3660, 3660, -26, 4689, 4279, 4279, + 4688, 4797, 4833, -27, 4633, 4762, 4157, 4157, + 3777, 3777, 3777, 3777, 3759, 3759, 3759, 3759, + 4679, 4671, 4825, 4707, 4278, 4278, 4201, 4201, + 4310, 4310, -28, 4712, 4153, 4153, 4306, 4306, + 3235, 3235, 3235, 3235, 3235, 3235, 3235, 3235, + 3197, 3197, 3197, 3197, 3197, 3197, 3197, 3197, + 3251, 3251, 3251, 3251, 3251, 3251, 3251, 3251, + 3183, 3183, 3183, 3183, 3183, 3183, 3183, 3183, + 3249, 3249, 3249, 3249, 3249, 3249, 3249, 3249, + 4680, -29, 4792, -30, 3676, 3676, 3676, 3676, + 3231, 3231, 3231, 3231, 3231, 3231, 3231, 3231, + 3181, 3181, 3181, 3181, 3181, 3181, 3181, 3181, + 4270, 4270, 4652, 4815, 4824, -31, -32, 4759, + 3201, 3201, 3201, 3201, 3201, 3201, 3201, 3201, + 4211, 4211, 4327, 4327, 4724, -33, 4210, 4210, + 4174, 4174, 4269, 4269, -34, 4816, 4294, 4294, + -35, 4852, 4326, 4326, 4202, 4202, -36, -37, + 4186, 4186, 4323, 4323, 3780, 3780, 3780, 3780, + 3748, 3748, 3748, 3748, 3678, 3678, 3678, 3678, + 3708, 3708, 3708, 3708, -38, -39, 4261, 4261, + 3714, 3714, 3714, 3714, 4288, 4288, -40, -41, + 4649, 4855, 4192, 4192, 4808, 4840, 4309, 4309, + 3742, 3742, 3742, 3742, -42, 4853, 4154, 4154, + 3778, 3778, 3778, 3778, 4775, -43, 4252, 4252, + 3764, 3764, 3764, 3764, 4173, 4173, 4262, 4262 +}; + +static const short gs_table_l1_13_4[32] = +{ + 648, 648, 648, 648, 648, 648, 648, 648, + 648, 648, 648, 648, 648, 648, 648, 648, + 1210, 1210, 1210, 1210, 1210, 1210, 1210, 1210, + 1076, 1076, 1076, 1076, 1076, 1076, 1076, 1076 +}; + +static const short gs_table_l1_13_8[32] = +{ + 1126, 1126, 1126, 1126, 1126, 1126, 1126, 1126, + 1275, 1275, 1275, 1275, 1275, 1275, 1275, 1275, + 551, 551, 551, 551, 551, 551, 551, 551, + 551, 551, 551, 551, 551, 551, 551, 551 +}; + +static const short gs_table_l1_13_9[32] = +{ + 683, 683, 683, 683, 683, 683, 683, 683, + 683, 683, 683, 683, 683, 683, 683, 683, + 718, 718, 718, 718, 718, 718, 718, 718, + 718, 718, 718, 718, 718, 718, 718, 718 +}; + +static const short gs_table_l1_13_10[32] = +{ + 1540, 1540, 1540, 1540, 1549, 1549, 1549, 1549, + 2049, 2049, 2318, 2318, 1539, 1539, 1539, 1539, + 539, 539, 539, 539, 539, 539, 539, 539, + 539, 539, 539, 539, 539, 539, 539, 539 +}; + +static const short gs_table_l1_13_11[32] = +{ + 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, + 629, 629, 629, 629, 629, 629, 629, 629, + 629, 629, 629, 629, 629, 629, 629, 629 +}; + +static const short gs_table_l1_13_15[32] = +{ + 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, + 1306, 1306, 1306, 1306, 1306, 1306, 1306, 1306, + 536, 536, 536, 536, 536, 536, 536, 536, + 536, 536, 536, 536, 536, 536, 536, 536 +}; + +static const short gs_table_l1_13_51[32] = +{ + 680, 680, 680, 680, 680, 680, 680, 680, + 680, 680, 680, 680, 680, 680, 680, 680, + 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646 +}; + +static const short gs_table_l1_13_59[32] = +{ + 736, 736, 736, 736, 736, 736, 736, 736, + 736, 736, 736, 736, 736, 736, 736, 736, + 1211, 1211, 1211, 1211, 1211, 1211, 1211, 1211, + 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107 +}; + +static const short gs_table_l1_13_96[32] = +{ + 632, 632, 632, 632, 632, 632, 632, 632, + 632, 632, 632, 632, 632, 632, 632, 632, + 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, + 1229, 1229, 1229, 1229, 1229, 1229, 1229, 1229 +}; + +static const short gs_table_l1_13_98[32] = +{ + 776, 776, 776, 776, 776, 776, 776, 776, + 776, 776, 776, 776, 776, 776, 776, 776, + 1283, 1283, 1283, 1283, 1283, 1283, 1283, 1283, + 2320, 2320, 2048, 2048, 1603, 1603, 1603, 1603 +}; + +static const short gs_table_l1_13_170[32] = +{ + 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, + 1556, 1556, 1556, 1556, 1793, 1793, 1793, 1793, + 755, 755, 755, 755, 755, 755, 755, 755, + 755, 755, 755, 755, 755, 755, 755, 755 +}; + +static const short gs_table_l1_13_188[32] = +{ + 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, + 1811, 1811, 1811, 1811, 2050, 2050, 2321, 2321, + 1773, 1773, 1773, 1773, 1775, 1775, 1775, 1775 +}; + +static const short gs_table_l1_13_189[32] = +{ + 1567, 1567, 1567, 1567, 1585, 1585, 1585, 1585, + 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, + 774, 774, 774, 774, 774, 774, 774, 774, + 774, 774, 774, 774, 774, 774, 774, 774 +}; + +static const short gs_table_l1_13_202[32] = +{ + 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1033, + 1212, 1212, 1212, 1212, 1212, 1212, 1212, 1212, + 538, 538, 538, 538, 538, 538, 538, 538, + 538, 538, 538, 538, 538, 538, 538, 538 +}; + +static const short gs_table_l1_13_218[32] = +{ + 1587, 1587, 1587, 1587, 1805, 1805, 1805, 1805, + 1243, 1243, 1243, 1243, 1243, 1243, 1243, 1243, + 557, 557, 557, 557, 557, 557, 557, 557, + 557, 557, 557, 557, 557, 557, 557, 557 +}; + +static const short gs_table_l1_13_224[32] = +{ + 1247, 1247, 1247, 1247, 1247, 1247, 1247, 1247, + 1265, 1265, 1265, 1265, 1265, 1265, 1265, 1265, + 1820, 1820, 1820, 1820, 2831, 2814, 2065, 2065, + 1089, 1089, 1089, 1089, 1089, 1089, 1089, 1089 +}; + +static const short gs_table_l1_13_225[32] = +{ + 760, 760, 760, 760, 760, 760, 760, 760, + 760, 760, 760, 760, 760, 760, 760, 760, + 1077, 1077, 1077, 1077, 1077, 1077, 1077, 1077, + 1259, 1259, 1259, 1259, 1259, 1259, 1259, 1259 +}; + +static const short gs_table_l1_13_230[32] = +{ + 552, 552, 552, 552, 552, 552, 552, 552, + 552, 552, 552, 552, 552, 552, 552, 552, + 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 745, 745, 745, 745, 745, 745 +}; + +static const short gs_table_l1_13_240[32] = +{ + 1303, 1303, 1303, 1303, 1303, 1303, 1303, 1303, + 1604, 1604, 1604, 1604, 1772, 1772, 1772, 1772, + 1812, 1812, 1812, 1812, 2303, 2303, 2081, 2081, + 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124 +}; + +static const short gs_table_l1_13_241[32] = +{ + 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, + 1302, 1302, 1302, 1302, 1302, 1302, 1302, 1302, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761 +}; + +static const short gs_table_l1_13_246[32] = +{ + 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, + 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, + 1093, 1093, 1093, 1093, 1093, 1093, 1093, 1093, + 1757, 1757, 1757, 1757, 1548, 1548, 1548, 1548 +}; + +static const short gs_table_l1_13_264[32] = +{ + 534, 534, 534, 534, 534, 534, 534, 534, + 534, 534, 534, 534, 534, 534, 534, 534, + 540, 540, 540, 540, 540, 540, 540, 540, + 540, 540, 540, 540, 540, 540, 540, 540 +}; + +static const short gs_table_l1_13_282[32] = +{ + 714, 714, 714, 714, 714, 714, 714, 714, + 714, 714, 714, 714, 714, 714, 714, 714, + 772, 772, 772, 772, 772, 772, 772, 772, + 772, 772, 772, 772, 772, 772, 772, 772 +}; + +static const short gs_table_l1_13_283[32] = +{ + 1059, 1059, 1059, 1059, 1059, 1059, 1059, 1059, + 1282, 1282, 1282, 1282, 1282, 1282, 1282, 1282, + 647, 647, 647, 647, 647, 647, 647, 647, + 647, 647, 647, 647, 647, 647, 647, 647 +}; + +static const short gs_table_l1_13_308[32] = +{ + 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, + 1309, 1309, 1309, 1309, 1309, 1309, 1309, 1309, + 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549 +}; + +static const short gs_table_l1_13_315[32] = +{ + 1586, 1586, 1586, 1586, 1570, 1570, 1570, 1570, + 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, + 793, 793, 793, 793, 793, 793, 793, 793, + 793, 793, 793, 793, 793, 793, 793, 793 +}; + +static const short gs_table_l1_13_338[32] = +{ + 1307, 1307, 1307, 1307, 1307, 1307, 1307, 1307, + 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, + 631, 631, 631, 631, 631, 631, 631, 631, + 631, 631, 631, 631, 631, 631, 631, 631 +}; + +static const short gs_table_l1_13_385[32] = +{ + 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1054, + 1301, 1301, 1301, 1301, 1301, 1301, 1301, 1301, + 665, 665, 665, 665, 665, 665, 665, 665, + 665, 665, 665, 665, 665, 665, 665, 665 +}; + +static const short gs_table_l1_13_387[32] = +{ + 697, 697, 697, 697, 697, 697, 697, 697, + 697, 697, 697, 697, 697, 697, 697, 697, + 519, 519, 519, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 519, 519, 519 +}; + +static const short gs_table_l1_13_413[32] = +{ + 754, 754, 754, 754, 754, 754, 754, 754, + 754, 754, 754, 754, 754, 754, 754, 754, + 1554, 1554, 1554, 1554, 2576, 2848, 2063, 2063, + 1550, 1550, 1550, 1550, 1792, 1792, 1792, 1792 +}; + +static const short gs_table_l1_13_414[32] = +{ + 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1244, + 1246, 1246, 1246, 1246, 1246, 1246, 1246, 1246, + 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, + 1227, 1227, 1227, 1227, 1227, 1227, 1227, 1227 +}; + +static const short gs_table_l1_13_429[32] = +{ + 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1072, + 1264, 1264, 1264, 1264, 1264, 1264, 1264, 1264, + 594, 594, 594, 594, 594, 594, 594, 594, + 594, 594, 594, 594, 594, 594, 594, 594 +}; + +static const short gs_table_l1_13_436[32] = +{ + 535, 535, 535, 535, 535, 535, 535, 535, + 535, 535, 535, 535, 535, 535, 535, 535, + 566, 566, 566, 566, 566, 566, 566, 566, + 566, 566, 566, 566, 566, 566, 566, 566 +}; + +static const short gs_table_l1_13_440[32] = +{ + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1276, 1276, 1276, 1276, 1276, 1276, 1276, 1276, + 762, 762, 762, 762, 762, 762, 762, 762, + 762, 762, 762, 762, 762, 762, 762, 762 +}; + +static const short gs_table_l1_13_446[32] = +{ + 664, 664, 664, 664, 664, 664, 664, 664, + 664, 664, 664, 664, 664, 664, 664, 664, + 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, + 1291, 1291, 1291, 1291, 1291, 1291, 1291, 1291 +}; + +static const short gs_table_l1_13_447[32] = +{ + 576, 576, 576, 576, 576, 576, 576, 576, + 576, 576, 576, 576, 576, 576, 576, 576, + 582, 582, 582, 582, 582, 582, 582, 582, + 582, 582, 582, 582, 582, 582, 582, 582 +}; + +static const short gs_table_l1_13_468[32] = +{ + 520, 520, 520, 520, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, + 1789, 1789, 1789, 1789, 2334, 2334, 2335, 2335, + 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030 +}; + +static const short gs_table_l1_13_469[32] = +{ + 792, 792, 792, 792, 792, 792, 792, 792, + 792, 792, 792, 792, 792, 792, 792, 792, + 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, + 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090 +}; + +static const short gs_table_l1_13_478[32] = +{ + 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, + 746, 746, 746, 746, 746, 746, 746, 746, + 746, 746, 746, 746, 746, 746, 746, 746 +}; + +static const short gs_table_l1_13_479[32] = +{ + 1290, 1290, 1290, 1290, 1290, 1290, 1290, 1290, + 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 615, 615, 615, 615, 615, 615, 615, 615, + 615, 615, 615, 615, 615, 615, 615, 615 +}; + +static const short gs_table_l1_13_492[32] = +{ + 1774, 1774, 1774, 1774, 1555, 1555, 1555, 1555, + 1035, 1035, 1035, 1035, 1035, 1035, 1035, 1035, + 730, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 730, 730, 730, 730, 730, 730 +}; + +static const short gs_table_l1_13_501[32] = +{ + 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, + 1568, 1568, 1568, 1568, 1810, 1810, 1810, 1810, + 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110 +}; + +static const short* gs_table_l1_13[42] = +{ + gs_table_l1_13_4, gs_table_l1_13_8, + gs_table_l1_13_9, gs_table_l1_13_10, + gs_table_l1_13_11, gs_table_l1_13_15, + gs_table_l1_13_51, gs_table_l1_13_59, + gs_table_l1_13_96, gs_table_l1_13_98, + gs_table_l1_13_170, gs_table_l1_13_188, + gs_table_l1_13_189, gs_table_l1_13_202, + gs_table_l1_13_218, gs_table_l1_13_224, + gs_table_l1_13_225, gs_table_l1_13_230, + gs_table_l1_13_240, gs_table_l1_13_241, + gs_table_l1_13_246, gs_table_l1_13_264, + gs_table_l1_13_282, gs_table_l1_13_283, + gs_table_l1_13_308, gs_table_l1_13_315, + gs_table_l1_13_338, gs_table_l1_13_385, + gs_table_l1_13_387, gs_table_l1_13_413, + gs_table_l1_13_414, gs_table_l1_13_429, + gs_table_l1_13_436, gs_table_l1_13_440, + gs_table_l1_13_446, gs_table_l1_13_447, + gs_table_l1_13_468, gs_table_l1_13_469, + gs_table_l1_13_478, gs_table_l1_13_479, + gs_table_l1_13_492, gs_table_l1_13_501 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook13 = { 13, 17, 2, 289, 9, 5, gs_table_l0_13, gs_table_l1_13 }; + + +static const short gs_table_l0_14[256] = +{ + 3097, 3097, 3097, 3097, 3077, 3077, 3077, 3077, + 2580, 2580, 2580, 2580, 2580, 2580, 2580, 2580, + 2570, 2570, 2570, 2570, 2570, 2570, 2570, 2570, + 3080, 3080, 3080, 3080, 3094, 3094, 3094, 3094, + 4126, 4096, 4097, 4125, 3078, 3078, 3078, 3078, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, + 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, + 2579, 2579, 2579, 2579, 2579, 2579, 2579, 2579, + 3096, 3096, 3096, 3096, 3610, 3610, 3588, 3588, + 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551, + 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551, + 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551, + 1551, 1551, 1551, 1551, 1551, 1551, 1551, 1551, + 2569, 2569, 2569, 2569, 2569, 2569, 2569, 2569, + 2581, 2581, 2581, 2581, 2581, 2581, 2581, 2581, + 3612, 3612, 3586, 3586, 3095, 3095, 3095, 3095, + 3079, 3079, 3079, 3079, 3611, 3611, 3587, 3587, + 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, + 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, + 2060, 2060, 2060, 2060, 2060, 2060, 2060, 2060, + 2060, 2060, 2060, 2060, 2060, 2060, 2060, 2060, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook14 = { 14, 31, 1, 31, 8, 0, gs_table_l0_14, NULL }; + + +static const short gs_table_l0_15[512] = +{ + 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077, + 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077, + 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077, + 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077, + 4611, 4669, 4666, 4612, 3627, 3627, 3627, 3627, + 3628, 3628, 3628, 3628, 3632, 3632, 3632, 3632, + 2587, 2587, 2587, 2587, 2587, 2587, 2587, 2587, + 2587, 2587, 2587, 2587, 2587, 2587, 2587, 2587, + 3110, 3110, 3110, 3110, 3110, 3110, 3110, 3110, + 3598, 3598, 3598, 3598, 4106, 4106, 4148, 4148, + 3096, 3096, 3096, 3096, 3096, 3096, 3096, 3096, + 3603, 3603, 3603, 3603, 4664, -2, 4149, 4149, + 3604, 3604, 3604, 3604, 3626, 3626, 3626, 3626, + 3631, 3631, 3631, 3631, 3599, 3599, 3599, 3599, + 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, + 4665, 4614, 4142, 4142, 4107, 4107, 4147, 4147, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 2588, 2588, 2588, 2588, 2588, 2588, 2588, 2588, + 2588, 2588, 2588, 2588, 2588, 2588, 2588, 2588, + 3109, 3109, 3109, 3109, 3109, 3109, 3109, 3109, + 4112, 4112, 4613, 4663, 3625, 3625, 3625, 3625, + 2594, 2594, 2594, 2594, 2594, 2594, 2594, 2594, + 2594, 2594, 2594, 2594, 2594, 2594, 2594, 2594, + 3606, 3606, 3606, 3606, 4113, 4113, 4615, -3, + 3605, 3605, 3605, 3605, 4141, 4141, 4616, 4662, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, + 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, + 3112, 3112, 3112, 3112, 3112, 3112, 3112, 3112, + 3633, 3633, 3633, 3633, 3634, 3634, 3634, 3634, + 2586, 2586, 2586, 2586, 2586, 2586, 2586, 2586, + 2586, 2586, 2586, 2586, 2586, 2586, 2586, 2586, + 3095, 3095, 3095, 3095, 3095, 3095, 3095, 3095, + 4610, 4667, 4105, 4105, 3597, 3597, 3597, 3597, + 3111, 3111, 3111, 3111, 3111, 3111, 3111, 3111, + 3596, 3596, 3596, 3596, 3602, 3602, 3602, 3602, + 2595, 2595, 2595, 2595, 2595, 2595, 2595, 2595, + 2595, 2595, 2595, 2595, 2595, 2595, 2595, 2595, + 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, + 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, + 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, + 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081 +}; + +static const short gs_table_l1_15_93[2] = +{ + 512, 574 +}; + +static const short gs_table_l1_15_247[2] = +{ + 572, 513 +}; + +static const short* gs_table_l1_15[2] = +{ + gs_table_l1_15_93, gs_table_l1_15_247 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook15 = { 15, 63, 1, 63, 9, 1, gs_table_l0_15, gs_table_l1_15 }; + + +static const short gs_table_l0_16[512] = +{ + -2, 4631, 4181, 4181, 4696, 4712, 4126, 4126, + 3141, 3141, 3141, 3141, 3141, 3141, 3141, 3141, + 4194, 4194, -3, -4, 4141, 4141, 4193, 4193, + 4139, 4139, 4628, 4699, 3636, 3636, 3636, 3636, + 3129, 3129, 3129, 3129, 3129, 3129, 3129, 3129, + 4178, 4178, 4701, 4711, -5, 4630, 4125, 4125, + 4716, -6, 4632, 4642, 3658, 3658, 3658, 3658, + 4646, 4697, 4142, 4142, 4192, 4192, -7, 4709, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, + 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, + 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, + 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, + 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110, + 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110, + 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110, + 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110, + 2620, 2620, 2620, 2620, 2620, 2620, 2620, 2620, + 2620, 2620, 2620, 2620, 2620, 2620, 2620, 2620, + 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, + 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, + -8, 4698, 4144, 4144, 4176, 4176, 4714, -9, + 4140, 4140, 4644, -10, 3638, 3638, 3638, 3638, + 4647, -11, 4174, 4174, 3655, 3655, 3655, 3655, + 3657, 3657, 3657, 3657, 3639, 3639, 3639, 3639, + 3615, 3615, 3615, 3615, 3665, 3665, 3665, 3665, + 3125, 3125, 3125, 3125, 3125, 3125, 3125, 3125, + 3663, 3663, 3663, 3663, 3631, 3631, 3631, 3631, + 3144, 3144, 3144, 3144, 3144, 3144, 3144, 3144, + 2618, 2618, 2618, 2618, 2618, 2618, 2618, 2618, + 2618, 2618, 2618, 2618, 2618, 2618, 2618, 2618, + 4620, 4718, 4720, 4721, 4122, 4122, 4196, 4196, + 4182, 4182, 4198, 4198, 4121, 4121, 4131, 4131, + 2628, 2628, 2628, 2628, 2628, 2628, 2628, 2628, + 2628, 2628, 2628, 2628, 2628, 2628, 2628, 2628, + 4137, 4137, 4625, 4700, 4730, -12, 4138, 4138, + 4183, 4183, 4623, 4624, 3661, 3661, 3661, 3661, + 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, + 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, + 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, + 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, + 2109, 2109, 2109, 2109, 2109, 2109, 2109, 2109, + 2109, 2109, 2109, 2109, 2109, 2109, 2109, 2109, + 2109, 2109, 2109, 2109, 2109, 2109, 2109, 2109, + 2109, 2109, 2109, 2109, 2109, 2109, 2109, 2109, + 2619, 2619, 2619, 2619, 2619, 2619, 2619, 2619, + 2619, 2619, 2619, 2619, 2619, 2619, 2619, 2619, + 3634, 3634, 3634, 3634, 4629, 4618, 4626, 4640, + 3633, 3633, 3633, 3633, 4133, 4133, 4195, 4195, + 4702, -13, 4123, 4123, 4180, 4180, 4627, 4713, + 4715, 4641, 4191, 4191, 3659, 3659, 3659, 3659, + 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, + 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, + 3142, 3142, 3142, 3142, 3142, 3142, 3142, 3142, + 3660, 3660, 3660, 3660, 4717, 4723, 4124, 4124, + 3128, 3128, 3128, 3128, 3128, 3128, 3128, 3128, + 4136, 4136, 4179, 4179, 3635, 3635, 3635, 3635 +}; + +static const short gs_table_l1_16_0[4] = +{ + 626, 626, 512, 512 +}; + +static const short gs_table_l1_16_18[4] = +{ + 519, 519, 628, 628 +}; + +static const short gs_table_l1_16_19[4] = +{ + 638, 638, 629, 629 +}; + +static const short gs_table_l1_16_44[4] = +{ + 631, 631, 515, 515 +}; + +static const short gs_table_l1_16_49[4] = +{ + 517, 517, 633, 633 +}; + +static const short gs_table_l1_16_62[4] = +{ + 1025, 1149, 518, 518 +}; + +static const short gs_table_l1_16_224[4] = +{ + 521, 521, 525, 525 +}; + +static const short gs_table_l1_16_231[4] = +{ + 623, 623, 516, 516 +}; + +static const short gs_table_l1_16_235[4] = +{ + 526, 526, 630, 630 +}; + +static const short gs_table_l1_16_241[4] = +{ + 514, 514, 523, 523 +}; + +static const short gs_table_l1_16_341[4] = +{ + 520, 520, 632, 632 +}; + +static const short gs_table_l1_16_449[4] = +{ + 635, 635, 636, 636 +}; + +static const short* gs_table_l1_16[12] = +{ + gs_table_l1_16_0, gs_table_l1_16_18, + gs_table_l1_16_19, gs_table_l1_16_44, + gs_table_l1_16_49, gs_table_l1_16_62, + gs_table_l1_16_224, gs_table_l1_16_231, + gs_table_l1_16_235, gs_table_l1_16_241, + gs_table_l1_16_341, gs_table_l1_16_449 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook16 = { 16, 127, 1, 127, 9, 2, gs_table_l0_16, gs_table_l1_16 }; + + +static const short gs_table_l0_17[512] = +{ + 2690, 2690, 2690, 2690, 2690, 2690, 2690, 2690, + 2690, 2690, 2690, 2690, 2690, 2690, 2690, 2690, + 4704, 4706, -2, 4656, 4766, 4771, 4708, 4765, + -3, -4, -5, -6, -7, -8, -9, -10, + 4801, -11, 4208, 4208, 4682, 4705, 4668, 4669, + 3205, 3205, 3205, 3205, 3205, 3205, 3205, 3205, + 3193, 3193, 3193, 3193, 3193, 3193, 3193, 3193, + 3701, 3701, 3701, 3701, 4205, 4205, 4769, 4802, + 2174, 2174, 2174, 2174, 2174, 2174, 2174, 2174, + 2174, 2174, 2174, 2174, 2174, 2174, 2174, 2174, + 2174, 2174, 2174, 2174, 2174, 2174, 2174, 2174, + 2174, 2174, 2174, 2174, 2174, 2174, 2174, 2174, + 2176, 2176, 2176, 2176, 2176, 2176, 2176, 2176, + 2176, 2176, 2176, 2176, 2176, 2176, 2176, 2176, + 2176, 2176, 2176, 2176, 2176, 2176, 2176, 2176, + 2176, 2176, 2176, 2176, 2176, 2176, 2176, 2176, + 3700, 3700, 3700, 3700, -12, -13, -14, -15, + 4206, 4206, 4813, -16, 3721, 3721, 3721, 3721, + 4204, 4204, 4770, 4772, 4667, 4692, 4239, 4239, + 4767, 4768, 4709, 4759, 4800, -17, 4240, 4240, + 3194, 3194, 3194, 3194, 3194, 3194, 3194, 3194, + -18, -19, -20, -21, -22, -23, -24, -25, + 4804, 4812, 4700, 4799, 3722, 3722, 3722, 3722, + -26, 4703, -27, 4671, -28, -29, 4207, 4207, + 2689, 2689, 2689, 2689, 2689, 2689, 2689, 2689, + 2689, 2689, 2689, 2689, 2689, 2689, 2689, 2689, + -30, -31, -32, -33, 3703, 3703, 3703, 3703, + 3720, 3720, 3720, 3720, 3702, 3702, 3702, 3702, + 3204, 3204, 3204, 3204, 3204, 3204, 3204, 3204, + 4701, -34, 4210, 4210, 3719, 3719, 3719, 3719, + -35, -36, 4238, 4238, -37, -38, -39, -40, + 4707, 4763, -41, -42, 4712, 4762, 4209, 4209, + 2173, 2173, 2173, 2173, 2173, 2173, 2173, 2173, + 2173, 2173, 2173, 2173, 2173, 2173, 2173, 2173, + 2173, 2173, 2173, 2173, 2173, 2173, 2173, 2173, + 2173, 2173, 2173, 2173, 2173, 2173, 2173, 2173, + 4844, 4645, 4809, 4818, 4198, 4198, 4248, 4248, + 3192, 3192, 3192, 3192, 3192, 3192, 3192, 3192, + 2691, 2691, 2691, 2691, 2691, 2691, 2691, 2691, + 2691, 2691, 2691, 2691, 2691, 2691, 2691, 2691, + 4663, 4684, 4653, 4654, 4788, 4808, 4687, 4774, + 3723, 3723, 3723, 3723, -43, -44, 4249, 4249, + 2683, 2683, 2683, 2683, 2683, 2683, 2683, 2683, + 2683, 2683, 2683, 2683, 2683, 2683, 2683, 2683, + 3206, 3206, 3206, 3206, 3206, 3206, 3206, 3206, + 4697, 4775, 4666, 4696, 4792, 4811, 4778, 4781, + -45, -46, -47, -48, 4658, 4661, -49, 4633, + 3725, 3725, 3725, 3725, 3699, 3699, 3699, 3699, + 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, + 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, + 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, + 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, + 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, + 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, + 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, + 1663, 1663, 1663, 1663, 1663, 1663, 1663, 1663, + 4199, 4199, 4245, 4245, 3724, 3724, 3724, 3724, + 4201, 4201, 4244, 4244, 4806, -50, 4241, 4241, + 4655, 4664, -51, -52, 4695, 4698, 4665, 4683, + 4202, 4202, 4246, 4246, -53, -54, -55, -56, + 4803, 4814, 4702, 4777, 4203, 4203, 4242, 4242, + 4693, 4764, 4648, 4670, 4815, -57, 4243, 4243, + 2684, 2684, 2684, 2684, 2684, 2684, 2684, 2684, + 2684, 2684, 2684, 2684, 2684, 2684, 2684, 2684 +}; + +static const short gs_table_l1_17_18[16] = +{ + 1256, 1256, 1256, 1256, 1269, 1269, 1269, 1269, + 1209, 1209, 1209, 1209, 1212, 1212, 1212, 1212 +}; + +static const short gs_table_l1_17_24[16] = +{ + 579, 579, 579, 579, 579, 579, 579, 579, + 580, 580, 580, 580, 580, 580, 580, 580 +}; + +static const short gs_table_l1_17_25[16] = +{ + 535, 535, 535, 535, 535, 535, 535, 535, + 539, 539, 539, 539, 539, 539, 539, 539 +}; + +static const short gs_table_l1_17_26[16] = +{ + 729, 729, 729, 729, 729, 729, 729, 729, + 733, 733, 733, 733, 733, 733, 733, 733 +}; + +static const short gs_table_l1_17_27[16] = +{ + 582, 582, 582, 582, 582, 582, 582, 582, + 593, 593, 593, 593, 593, 593, 593, 593 +}; + +static const short gs_table_l1_17_28[16] = +{ + 517, 517, 517, 517, 517, 517, 517, 517, + 519, 519, 519, 519, 519, 519, 519, 519 +}; + +static const short gs_table_l1_17_29[16] = +{ + 1088, 1088, 1088, 1088, 1096, 1096, 1096, 1096, + 1038, 1038, 1038, 1038, 1058, 1058, 1058, 1058 +}; + +static const short gs_table_l1_17_30[16] = +{ + 533, 533, 533, 533, 533, 533, 533, 533, + 534, 534, 534, 534, 534, 534, 534, 534 +}; + +static const short gs_table_l1_17_31[16] = +{ + 520, 520, 520, 520, 520, 520, 520, 520, + 524, 524, 524, 524, 524, 524, 524, 524 +}; + +static const short gs_table_l1_17_33[16] = +{ + 764, 764, 764, 764, 764, 764, 764, 764, + 545, 545, 545, 545, 545, 545, 545, 545 +}; + +static const short gs_table_l1_17_132[16] = +{ + 581, 581, 581, 581, 581, 581, 581, 581, + 594, 594, 594, 594, 594, 594, 594, 594 +}; + +static const short gs_table_l1_17_133[16] = +{ + 551, 551, 551, 551, 551, 551, 551, 551, + 555, 555, 555, 555, 555, 555, 555, 555 +}; + +static const short gs_table_l1_17_134[16] = +{ + 727, 727, 727, 727, 727, 727, 727, 727, + 737, 737, 737, 737, 737, 737, 737, 737 +}; + +static const short gs_table_l1_17_135[16] = +{ + 702, 702, 702, 702, 702, 702, 702, 702, + 726, 726, 726, 726, 726, 726, 726, 726 +}; + +static const short gs_table_l1_17_139[16] = +{ + 760, 760, 760, 760, 760, 760, 760, 760, + 1267, 1267, 1267, 1267, 1268, 1268, 1268, 1268 +}; + +static const short gs_table_l1_17_157[16] = +{ + 728, 728, 728, 728, 728, 728, 728, 728, + 732, 732, 732, 732, 732, 732, 732, 732 +}; + +static const short gs_table_l1_17_168[16] = +{ + 680, 680, 680, 680, 680, 680, 680, 680, + 687, 687, 687, 687, 687, 687, 687, 687 +}; + +static const short gs_table_l1_17_169[16] = +{ + 564, 564, 564, 564, 564, 564, 564, 564, + 598, 598, 598, 598, 598, 598, 598, 598 +}; + +static const short gs_table_l1_17_170[16] = +{ + 709, 709, 709, 709, 709, 709, 709, 709, + 725, 725, 725, 725, 725, 725, 725, 725 +}; + +static const short gs_table_l1_17_171[16] = +{ + 691, 691, 691, 691, 691, 691, 691, 691, + 699, 699, 699, 699, 699, 699, 699, 699 +}; + +static const short gs_table_l1_17_172[16] = +{ + 525, 525, 525, 525, 525, 525, 525, 525, + 527, 527, 527, 527, 527, 527, 527, 527 +}; + +static const short gs_table_l1_17_173[16] = +{ + 1050, 1050, 1050, 1050, 1089, 1089, 1089, 1089, + 1034, 1034, 1034, 1034, 1044, 1044, 1044, 1044 +}; + +static const short gs_table_l1_17_174[16] = +{ + 548, 548, 548, 548, 548, 548, 548, 548, + 554, 554, 554, 554, 554, 554, 554, 554 +}; + +static const short gs_table_l1_17_175[16] = +{ + 540, 540, 540, 540, 540, 540, 540, 540, + 547, 547, 547, 547, 547, 547, 547, 547 +}; + +static const short gs_table_l1_17_184[16] = +{ + 738, 738, 738, 738, 738, 738, 738, 738, + 1271, 1271, 1271, 1271, 1787, 1787, 2049, 2230 +}; + +static const short gs_table_l1_17_186[16] = +{ + 543, 543, 543, 543, 543, 543, 543, 543, + 583, 583, 583, 583, 583, 583, 583, 583 +}; + +static const short gs_table_l1_17_188[16] = +{ + 750, 750, 750, 750, 750, 750, 750, 750, + 751, 751, 751, 751, 751, 751, 751, 751 +}; + +static const short gs_table_l1_17_189[16] = +{ + 721, 721, 721, 721, 721, 721, 721, 721, + 747, 747, 747, 747, 747, 747, 747, 747 +}; + +static const short gs_table_l1_17_208[16] = +{ + 603, 603, 603, 603, 603, 603, 603, 603, + 677, 677, 677, 677, 677, 677, 677, 677 +}; + +static const short gs_table_l1_17_209[16] = +{ + 590, 590, 590, 590, 590, 590, 590, 590, + 595, 595, 595, 595, 595, 595, 595, 595 +}; + +static const short gs_table_l1_17_210[16] = +{ + 714, 714, 714, 714, 714, 714, 714, 714, + 720, 720, 720, 720, 720, 720, 720, 720 +}; + +static const short gs_table_l1_17_211[16] = +{ + 690, 690, 690, 690, 690, 690, 690, 690, + 711, 711, 711, 711, 711, 711, 711, 711 +}; + +static const short gs_table_l1_17_233[16] = +{ + 761, 761, 761, 761, 761, 761, 761, 761, + 1274, 1274, 1274, 1274, 1278, 1278, 1278, 1278 +}; + +static const short gs_table_l1_17_240[16] = +{ + 724, 724, 724, 724, 724, 724, 724, 724, + 731, 731, 731, 731, 731, 731, 731, 731 +}; + +static const short gs_table_l1_17_241[16] = +{ + 689, 689, 689, 689, 689, 689, 689, 689, + 695, 695, 695, 695, 695, 695, 695, 695 +}; + +static const short gs_table_l1_17_244[16] = +{ + 561, 561, 561, 561, 561, 561, 561, 561, + 563, 563, 563, 563, 563, 563, 563, 563 +}; + +static const short gs_table_l1_17_245[16] = +{ + 1043, 1043, 1043, 1043, 1062, 1062, 1062, 1062, + 541, 541, 541, 541, 541, 541, 541, 541 +}; + +static const short gs_table_l1_17_246[16] = +{ + 686, 686, 686, 686, 686, 686, 686, 686, + 688, 688, 688, 688, 688, 688, 688, 688 +}; + +static const short gs_table_l1_17_247[16] = +{ + 589, 589, 589, 589, 589, 589, 589, 589, + 683, 683, 683, 683, 683, 683, 683, 683 +}; + +static const short gs_table_l1_17_250[16] = +{ + 1242, 1242, 1242, 1242, 1246, 1246, 1246, 1246, + 1065, 1065, 1065, 1065, 1235, 1235, 1235, 1235 +}; + +static const short gs_table_l1_17_251[16] = +{ + 1257, 1257, 1257, 1257, 1265, 1265, 1265, 1265, + 1253, 1253, 1253, 1253, 1254, 1254, 1254, 1254 +}; + +static const short gs_table_l1_17_332[16] = +{ + 740, 740, 740, 740, 740, 740, 740, 740, + 749, 749, 749, 749, 749, 749, 749, 749 +}; + +static const short gs_table_l1_17_333[16] = +{ + 735, 735, 735, 735, 735, 735, 735, 735, + 739, 739, 739, 739, 739, 739, 739, 739 +}; + +static const short gs_table_l1_17_368[16] = +{ + 529, 529, 529, 529, 529, 529, 529, 529, + 530, 530, 530, 530, 530, 530, 530, 530 +}; + +static const short gs_table_l1_17_369[16] = +{ + 514, 514, 514, 514, 514, 514, 514, 514, + 528, 528, 528, 528, 528, 528, 528, 528 +}; + +static const short gs_table_l1_17_370[16] = +{ + 693, 693, 693, 693, 693, 693, 693, 693, + 698, 698, 698, 698, 698, 698, 698, 698 +}; + +static const short gs_table_l1_17_371[16] = +{ + 585, 585, 585, 585, 585, 585, 585, 585, + 684, 684, 684, 684, 684, 684, 684, 684 +}; + +static const short gs_table_l1_17_374[16] = +{ + 1028, 1028, 1028, 1028, 1030, 1030, 1030, 1030, + 1024, 1024, 1024, 1024, 1027, 1027, 1027, 1027 +}; + +static const short gs_table_l1_17_461[16] = +{ + 754, 754, 754, 754, 754, 754, 754, 754, + 765, 765, 765, 765, 765, 765, 765, 765 +}; + +static const short gs_table_l1_17_466[16] = +{ + 536, 536, 536, 536, 536, 536, 536, 536, + 542, 542, 542, 542, 542, 542, 542, 542 +}; + +static const short gs_table_l1_17_467[16] = +{ + 1270, 1270, 1270, 1270, 1033, 1033, 1033, 1033, + 523, 523, 523, 523, 523, 523, 523, 523 +}; + +static const short gs_table_l1_17_476[16] = +{ + 566, 566, 566, 566, 566, 566, 566, 566, + 578, 578, 578, 578, 578, 578, 578, 578 +}; + +static const short gs_table_l1_17_477[16] = +{ + 544, 544, 544, 544, 544, 544, 544, 544, + 556, 556, 556, 556, 556, 556, 556, 556 +}; + +static const short gs_table_l1_17_478[16] = +{ + 743, 743, 743, 743, 743, 743, 743, 743, + 752, 752, 752, 752, 752, 752, 752, 752 +}; + +static const short gs_table_l1_17_479[16] = +{ + 592, 592, 592, 592, 592, 592, 592, 592, + 701, 701, 701, 701, 701, 701, 701, 701 +}; + +static const short gs_table_l1_17_493[16] = +{ + 736, 736, 736, 736, 736, 736, 736, 736, + 746, 746, 746, 746, 746, 746, 746, 746 +}; + +static const short* gs_table_l1_17[56] = +{ + gs_table_l1_17_18, gs_table_l1_17_24, + gs_table_l1_17_25, gs_table_l1_17_26, + gs_table_l1_17_27, gs_table_l1_17_28, + gs_table_l1_17_29, gs_table_l1_17_30, + gs_table_l1_17_31, gs_table_l1_17_33, + gs_table_l1_17_132, gs_table_l1_17_133, + gs_table_l1_17_134, gs_table_l1_17_135, + gs_table_l1_17_139, gs_table_l1_17_157, + gs_table_l1_17_168, gs_table_l1_17_169, + gs_table_l1_17_170, gs_table_l1_17_171, + gs_table_l1_17_172, gs_table_l1_17_173, + gs_table_l1_17_174, gs_table_l1_17_175, + gs_table_l1_17_184, gs_table_l1_17_186, + gs_table_l1_17_188, gs_table_l1_17_189, + gs_table_l1_17_208, gs_table_l1_17_209, + gs_table_l1_17_210, gs_table_l1_17_211, + gs_table_l1_17_233, gs_table_l1_17_240, + gs_table_l1_17_241, gs_table_l1_17_244, + gs_table_l1_17_245, gs_table_l1_17_246, + gs_table_l1_17_247, gs_table_l1_17_250, + gs_table_l1_17_251, gs_table_l1_17_332, + gs_table_l1_17_333, gs_table_l1_17_368, + gs_table_l1_17_369, gs_table_l1_17_370, + gs_table_l1_17_371, gs_table_l1_17_374, + gs_table_l1_17_461, gs_table_l1_17_466, + gs_table_l1_17_467, gs_table_l1_17_476, + gs_table_l1_17_477, gs_table_l1_17_478, + gs_table_l1_17_479, gs_table_l1_17_493 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook17 = { 17, 255, 1, 255, 9, 4, gs_table_l0_17, gs_table_l1_17 }; + + +static const short gs_table_l0_18[512] = +{ + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 2565, 2565, 2565, 2565, 2565, 2565, 2565, 2565, + 3085, 3085, 3085, 3085, 3085, 3085, 3085, 3085, + -2, -3, 4145, 4145, -4, -5, 4142, 4142, + 2560, 2560, 2560, 2560, 2560, 2560, 2560, 2560, + 2560, 2560, 2560, 2560, 2560, 2560, 2560, 2560, + 4698, -6, 4137, 4137, 4691, -7, 4685, -8, + 3609, 3609, 3609, 3609, 4136, 4136, 4673, -9, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 2564, 2564, 2564, 2564, 2564, 2564, 2564, 2564, + 3607, 3607, 3607, 3607, 3606, 3606, 3606, 3606, + 3084, 3084, 3084, 3084, 3084, 3084, 3084, 3084, + 4669, 4681, 4683, -10, -11, 4684, -12, -13, + 4678, 4679, 4138, 4138, 3608, 3608, 3608, 3608, + 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, + 2563, 2563, 2563, 2563, 2563, 2563, 2563, 2563, + -14, -15, -16, -17, -18, 4667, 4133, 4133, + 3605, 3605, 3605, 3605, 4682, 4680, 4690, -19, + -20, 4686, 4134, 4134, 4687, -21, 4135, 4135, + 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, + 4672, -22, -23, -24, -25, 4671, -26, -27, + 3083, 3083, 3083, 3083, 3083, 3083, 3083, 3083, + 4677, -28, -29, -30, 4132, 4132, -31, 4670, + 3080, 3080, 3080, 3080, 3080, 3080, 3080, 3080, + 3081, 3081, 3081, 3081, 3081, 3081, 3081, 3081, + 4131, 4131, -32, 4666, 4130, 4130, -33, -34, + 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, + 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, + 4674, -35, 4128, 4128, 4675, -36, -37, 4676, + 4665, 4668, -38, 4663, 3604, 3604, 3604, 3604, + -39, -40, -41, -42, 4664, -43, -44, 4659, + 3603, 3603, 3603, 3603, 4127, 4127, -45, -46, + 3090, 3090, 3090, 3090, 3090, 3090, 3090, 3090, + 4739, 4745, 4756, -47, 4148, 4148, 4743, 4752, + 2567, 2567, 2567, 2567, 2567, 2567, 2567, 2567, + 2567, 2567, 2567, 2567, 2567, 2567, 2567, 2567, + -48, 4692, 4149, 4149, 3617, 3617, 3617, 3617, + 3087, 3087, 3087, 3087, 3087, 3087, 3087, 3087, + -49, -50, 4720, 4737, 4695, 4696, -51, -52, + 3614, 3614, 3614, 3614, 4741, 4716, 4144, 4144, + 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, + 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, + 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, + 2049, 2049, 2049, 2049, 2049, 2049, 2049, 2049, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566, + 3089, 3089, 3089, 3089, 3089, 3089, 3089, 3089, + -53, -54, 4146, 4146, 3611, 3611, 3611, 3611, + 4689, -55, 4706, 4708, 3613, 3613, 3613, 3613, + -56, 4702, 4711, -57, 4693, 4703, -58, -59, + 3086, 3086, 3086, 3086, 3086, 3086, 3086, 3086, + 3612, 3612, 3612, 3612, -60, 4688, 4140, 4140, + 3088, 3088, 3088, 3088, 3088, 3088, 3088, 3088, + -61, -62, 4699, 4707, 4143, 4143, 4713, -63, + 4139, 4139, -64, -65, -66, -67, 4141, 4141, + 3610, 3610, 3610, 3610, 4701, -68, 4150, 4150, + 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791, + 1791, 1791, 1791, 1791, 1791, 1791, 1791, 1791 +}; + +static const short gs_table_l1_18_24[4] = +{ + 703, 703, 704, 704 +}; + +static const short gs_table_l1_18_25[4] = +{ + 721, 721, 667, 667 +}; + +static const short gs_table_l1_18_28[4] = +{ + 750, 750, 753, 753 +}; + +static const short gs_table_l1_18_29[4] = +{ + 681, 681, 690, 690 +}; + +static const short gs_table_l1_18_49[4] = +{ + 668, 668, 694, 694 +}; + +static const short gs_table_l1_18_53[4] = +{ + 697, 697, 717, 717 +}; + +static const short gs_table_l1_18_55[4] = +{ + 719, 719, 671, 671 +}; + +static const short gs_table_l1_18_63[4] = +{ + 675, 675, 683, 683 +}; + +static const short gs_table_l1_18_99[4] = +{ + 686, 686, 1275, 1267 +}; + +static const short gs_table_l1_18_100[4] = +{ + 635, 635, 648, 648 +}; + +static const short gs_table_l1_18_102[4] = +{ + 685, 685, 695, 695 +}; + +static const short gs_table_l1_18_103[4] = +{ + 663, 663, 680, 680 +}; + +static const short gs_table_l1_18_128[4] = +{ + 670, 670, 674, 674 +}; + +static const short gs_table_l1_18_129[4] = +{ + 653, 653, 659, 659 +}; + +static const short gs_table_l1_18_130[4] = +{ + 702, 702, 632, 632 +}; + +static const short gs_table_l1_18_131[4] = +{ + 676, 676, 679, 679 +}; + +static const short gs_table_l1_18_132[4] = +{ + 639, 639, 666, 666 +}; + +static const short gs_table_l1_18_143[4] = +{ + 712, 712, 1272, 1245 +}; + +static const short gs_table_l1_18_144[4] = +{ + 622, 622, 628, 628 +}; + +static const short gs_table_l1_18_149[4] = +{ + 631, 631, 1261, 1273 +}; + +static const short gs_table_l1_18_161[4] = +{ + 658, 658, 673, 673 +}; + +static const short gs_table_l1_18_162[4] = +{ + 1247, 1260, 637, 637 +}; + +static const short gs_table_l1_18_163[4] = +{ + 669, 669, 677, 677 +}; + +static const short gs_table_l1_18_164[4] = +{ + 625, 625, 626, 626 +}; + +static const short gs_table_l1_18_166[4] = +{ + 654, 654, 657, 657 +}; + +static const short gs_table_l1_18_167[4] = +{ + 644, 644, 652, 652 +}; + +static const short gs_table_l1_18_177[4] = +{ + 621, 621, 1230, 1244 +}; + +static const short gs_table_l1_18_178[4] = +{ + 614, 614, 629, 629 +}; + +static const short gs_table_l1_18_179[4] = +{ + 608, 608, 613, 613 +}; + +static const short gs_table_l1_18_182[4] = +{ + 661, 661, 1255, 1266 +}; + +static const short gs_table_l1_18_202[4] = +{ + 609, 609, 1269, 1217 +}; + +static const short gs_table_l1_18_206[4] = +{ + 636, 636, 640, 640 +}; + +static const short gs_table_l1_18_207[4] = +{ + 623, 623, 634, 634 +}; + +static const short gs_table_l1_18_225[4] = +{ + 650, 650, 1277, 1278 +}; + +static const short gs_table_l1_18_229[4] = +{ + 642, 642, 646, 646 +}; + +static const short gs_table_l1_18_230[4] = +{ + 1246, 1259, 1222, 1241 +}; + +static const short gs_table_l1_18_234[4] = +{ + 651, 651, 616, 616 +}; + +static const short gs_table_l1_18_240[4] = +{ + 627, 627, 655, 655 +}; + +static const short gs_table_l1_18_241[4] = +{ + 638, 638, 664, 664 +}; + +static const short gs_table_l1_18_242[4] = +{ + 1227, 1228, 598, 598 +}; + +static const short gs_table_l1_18_243[4] = +{ + 665, 665, 601, 601 +}; + +static const short gs_table_l1_18_245[4] = +{ + 630, 630, 662, 662 +}; + +static const short gs_table_l1_18_246[4] = +{ + 604, 604, 618, 618 +}; + +static const short gs_table_l1_18_254[4] = +{ + 1238, 1258, 1200, 1204 +}; + +static const short gs_table_l1_18_255[4] = +{ + 691, 691, 619, 619 +}; + +static const short gs_table_l1_18_267[4] = +{ + 727, 727, 730, 730 +}; + +static const short gs_table_l1_18_288[4] = +{ + 693, 693, 714, 714 +}; + +static const short gs_table_l1_18_304[4] = +{ + 756, 756, 699, 699 +}; + +static const short gs_table_l1_18_305[4] = +{ + 739, 739, 741, 741 +}; + +static const short gs_table_l1_18_310[4] = +{ + 723, 723, 725, 725 +}; + +static const short gs_table_l1_18_311[4] = +{ + 700, 700, 701, 701 +}; + +static const short gs_table_l1_18_376[4] = +{ + 737, 737, 745, 745 +}; + +static const short gs_table_l1_18_377[4] = +{ + 633, 633, 711, 711 +}; + +static const short gs_table_l1_18_385[4] = +{ + 752, 752, 759, 759 +}; + +static const short gs_table_l1_18_392[4] = +{ + 713, 713, 724, 724 +}; + +static const short gs_table_l1_18_395[4] = +{ + 762, 762, 672, 672 +}; + +static const short gs_table_l1_18_398[4] = +{ + 742, 742, 751, 751 +}; + +static const short gs_table_l1_18_399[4] = +{ + 709, 709, 738, 738 +}; + +static const short gs_table_l1_18_412[4] = +{ + 678, 678, 682, 682 +}; + +static const short gs_table_l1_18_424[4] = +{ + 708, 708, 740, 740 +}; + +static const short gs_table_l1_18_425[4] = +{ + 698, 698, 707, 707 +}; + +static const short gs_table_l1_18_431[4] = +{ + 736, 736, 758, 758 +}; + +static const short gs_table_l1_18_434[4] = +{ + 696, 696, 706, 706 +}; + +static const short gs_table_l1_18_435[4] = +{ + 684, 684, 687, 687 +}; + +static const short gs_table_l1_18_436[4] = +{ + 728, 728, 731, 731 +}; + +static const short gs_table_l1_18_437[4] = +{ + 720, 720, 722, 722 +}; + +static const short gs_table_l1_18_445[4] = +{ + 1276, 1256, 689, 689 +}; + +static const short* gs_table_l1_18[67] = +{ + gs_table_l1_18_24, gs_table_l1_18_25, + gs_table_l1_18_28, gs_table_l1_18_29, + gs_table_l1_18_49, gs_table_l1_18_53, + gs_table_l1_18_55, gs_table_l1_18_63, + gs_table_l1_18_99, gs_table_l1_18_100, + gs_table_l1_18_102, gs_table_l1_18_103, + gs_table_l1_18_128, gs_table_l1_18_129, + gs_table_l1_18_130, gs_table_l1_18_131, + gs_table_l1_18_132, gs_table_l1_18_143, + gs_table_l1_18_144, gs_table_l1_18_149, + gs_table_l1_18_161, gs_table_l1_18_162, + gs_table_l1_18_163, gs_table_l1_18_164, + gs_table_l1_18_166, gs_table_l1_18_167, + gs_table_l1_18_177, gs_table_l1_18_178, + gs_table_l1_18_179, gs_table_l1_18_182, + gs_table_l1_18_202, gs_table_l1_18_206, + gs_table_l1_18_207, gs_table_l1_18_225, + gs_table_l1_18_229, gs_table_l1_18_230, + gs_table_l1_18_234, gs_table_l1_18_240, + gs_table_l1_18_241, gs_table_l1_18_242, + gs_table_l1_18_243, gs_table_l1_18_245, + gs_table_l1_18_246, gs_table_l1_18_254, + gs_table_l1_18_255, gs_table_l1_18_267, + gs_table_l1_18_288, gs_table_l1_18_304, + gs_table_l1_18_305, gs_table_l1_18_310, + gs_table_l1_18_311, gs_table_l1_18_376, + gs_table_l1_18_377, gs_table_l1_18_385, + gs_table_l1_18_392, gs_table_l1_18_395, + gs_table_l1_18_398, gs_table_l1_18_399, + gs_table_l1_18_412, gs_table_l1_18_424, + gs_table_l1_18_425, gs_table_l1_18_431, + gs_table_l1_18_434, gs_table_l1_18_435, + gs_table_l1_18_436, gs_table_l1_18_437, + gs_table_l1_18_445 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook18 = { 18, 256, 1, 256, 9, 2, gs_table_l0_18, gs_table_l1_18 }; + + +static const short gs_table_l0_19[512] = +{ + 3606, 3606, 3606, 3606, 3636, 3636, 3636, 3636, + -2, 4627, 4681, 4611, 3632, 3632, 3632, 3632, + 4175, 4175, 4631, 4643, 3618, 3618, 3618, 3618, + 3622, 3622, 3622, 3622, 4653, -3, 4615, 4671, + 3598, 3598, 3598, 3598, 3660, 3660, 3660, 3660, + 3612, 3612, 3612, 3612, 3626, 3626, 3626, 3626, + 3634, 3634, 3634, 3634, 3630, 3630, 3630, 3630, + 4685, 4633, 4097, 4097, 3588, 3588, 3588, 3588, + 3648, 3648, 3648, 3648, 3614, 3614, 3614, 3614, + 3616, 3616, 3616, 3616, 3642, 3642, 3642, 3642, + 3652, 3652, 3652, 3652, 4659, 4667, 4123, 4123, + 3650, 3650, 3650, 3650, -4, 4641, 4655, 4683, + 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, + 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, + 2573, 2573, 2573, 2573, 2573, 2573, 2573, 2573, + 2573, 2573, 2573, 2573, 2573, 2573, 2573, 2573, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 2085, 2085, 2085, 2085, 2085, 2085, 2085, 2085, + 2085, 2085, 2085, 2085, 2085, 2085, 2085, 2085, + 2085, 2085, 2085, 2085, 2085, 2085, 2085, 2085, + 2085, 2085, 2085, 2085, 2085, 2085, 2085, 2085, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091, + 3637, 3637, 3637, 3637, 4617, 4619, 4151, 4151, + 3108, 3108, 3108, 3108, 3108, 3108, 3108, 3108, + 3116, 3116, 3116, 3116, 3116, 3116, 3116, 3116, + 4167, 4167, 4629, 4634, 3594, 3594, 3594, 3594, + 3654, 3654, 3654, 3654, 4662, 4613, 4125, 4125, + 3600, 3600, 3600, 3600, 3664, 3664, 3664, 3664, + 4669, -5, 4673, 4677, 3584, 3584, 3584, 3584, + 4625, 4665, 4111, 4111, 3596, 3596, 3596, 3596, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087 +}; + +static const short gs_table_l1_19_8[4] = +{ + 530, 530, 568, 568 +}; + +static const short gs_table_l1_19_29[4] = +{ + 1030, 1032, 572, 572 +}; + +static const short gs_table_l1_19_92[4] = +{ + 1086, 1048, 1096, 1102 +}; + +static const short gs_table_l1_19_433[4] = +{ + 1044, 1098, 514, 514 +}; + +static const short* gs_table_l1_19[4] = +{ + gs_table_l1_19_8, gs_table_l1_19_29, + gs_table_l1_19_92, gs_table_l1_19_433 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook19 = { 19, 3, 4, 81, 9, 2, gs_table_l0_19, gs_table_l1_19 }; + + +static const short gs_table_l0_20[256] = +{ + 2576, 2576, 2576, 2576, 2576, 2576, 2576, 2576, + 2566, 2566, 2566, 2566, 2566, 2566, 2566, 2566, + 4116, 4100, 4120, 4096, 3094, 3094, 3094, 3094, + 2578, 2578, 2578, 2578, 2578, 2578, 2578, 2578, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 2055, 2055, 2055, 2055, 2055, 2055, 2055, 2055, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 1036, 1036, 1036, 1036, 1036, 1036, 1036, 1036, + 3075, 3075, 3075, 3075, 3081, 3081, 3081, 3081, + 3073, 3073, 3073, 3073, 3093, 3093, 3093, 3093, + 2562, 2562, 2562, 2562, 2562, 2562, 2562, 2562, + 3095, 3095, 3095, 3095, 3087, 3087, 3087, 3087, + 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, + 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, + 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, + 1547, 1547, 1547, 1547, 1547, 1547, 1547, 1547, + 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, + 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, + 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, + 1549, 1549, 1549, 1549, 1549, 1549, 1549, 1549, + 3091, 3091, 3091, 3091, 3077, 3077, 3077, 3077, + 2574, 2574, 2574, 2574, 2574, 2574, 2574, 2574, + 2570, 2570, 2570, 2570, 2570, 2570, 2570, 2570, + 2568, 2568, 2568, 2568, 2568, 2568, 2568, 2568 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook20 = { 20, 5, 2, 25, 8, 0, gs_table_l0_20, NULL }; + + +static const short gs_table_l0_21[512] = +{ + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 2097, 2097, 2097, 2097, 2097, 2097, 2097, 2097, + 3115, 3115, 3115, 3115, 3115, 3115, 3115, 3115, + 3618, 3618, 3618, 3618, 3636, 3636, 3636, 3636, + 3109, 3109, 3109, 3109, 3109, 3109, 3109, 3109, + -2, 4613, 4172, 4172, 3630, 3630, 3630, 3630, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2079, 2079, 2079, 2079, 2079, 2079, 2079, 2079, + 2590, 2590, 2590, 2590, 2590, 2590, 2590, 2590, + 2590, 2590, 2590, 2590, 2590, 2590, 2590, 2590, + 4111, 4111, 4152, 4152, -3, 4653, 4149, 4149, + 3130, 3130, 3130, 3130, 3130, 3130, 3130, 3130, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2089, 2089, 2089, 2089, 2089, 2089, 2089, 2089, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 2087, 2087, 2087, 2087, 2087, 2087, 2087, 2087, + 3094, 3094, 3094, 3094, 3094, 3094, 3094, 3094, + 3605, 3605, 3605, 3605, 3617, 3617, 3617, 3617, + -4, 4678, -5, 4683, 3597, 3597, 3597, 3597, + 3607, 3607, 3607, 3607, 3643, 3643, 3643, 3643, + 4140, 4140, 4120, 4120, 4627, 4643, 4673, -6, + 3631, 3631, 3631, 3631, 3641, 3641, 3641, 3641, + 3110, 3110, 3110, 3110, 3110, 3110, 3110, 3110, + 4132, 4132, 4619, 4663, 4164, 4164, -7, 4618, + 3101, 3101, 3101, 3101, 3101, 3101, 3101, 3101, + 3123, 3123, 3123, 3123, 3123, 3123, 3123, 3123, + 2602, 2602, 2602, 2602, 2602, 2602, 2602, 2602, + 2602, 2602, 2602, 2602, 2602, 2602, 2602, 2602, + 3644, 3644, 3644, 3644, 3598, 3598, 3598, 3598, + 3139, 3139, 3139, 3139, 3139, 3139, 3139, 3139, + 2610, 2610, 2610, 2610, 2610, 2610, 2610, 2610, + 2610, 2610, 2610, 2610, 2610, 2610, 2610, 2610, + 4626, 4672, 4121, 4121, 3604, 3604, 3604, 3604, + 4123, 4123, 4165, 4165, 3612, 3612, 3612, 3612, + 2592, 2592, 2592, 2592, 2592, 2592, 2592, 2592, + 2592, 2592, 2592, 2592, 2592, 2592, 2592, 2592, + 3650, 3650, 3650, 3650, 4157, 4157, 4611, 4685, + 3596, 3596, 3596, 3596, -8, 4610, 4100, 4100, + 2608, 2608, 2608, 2608, 2608, 2608, 2608, 2608, + 2608, 2608, 2608, 2608, 2608, 2608, 2608, 2608, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064, + 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1064 +}; + +static const short gs_table_l1_21_56[8] = +{ + 583, 583, 583, 583, 512, 512, 512, 512 +}; + +static const short gs_table_l1_21_116[8] = +{ + 513, 513, 513, 513, 574, 574, 574, 574 +}; + +static const short gs_table_l1_21_208[8] = +{ + 1030, 1030, 1031, 1031, 1033, 1033, 1544, 1608 +}; + +static const short gs_table_l1_21_210[8] = +{ + 528, 528, 528, 528, 1097, 1097, 1104, 1104 +}; + +static const short gs_table_l1_21_231[8] = +{ + 591, 591, 591, 591, 566, 566, 566, 566 +}; + +static const short gs_table_l1_21_254[8] = +{ + 586, 586, 586, 586, 1041, 1041, 1102, 1102 +}; + +static const short gs_table_l1_21_364[8] = +{ + 538, 538, 538, 538, 575, 575, 575, 575 +}; + +static const short* gs_table_l1_21[7] = +{ + gs_table_l1_21_56, gs_table_l1_21_116, + gs_table_l1_21_208, gs_table_l1_21_210, + gs_table_l1_21_231, gs_table_l1_21_254, + gs_table_l1_21_364 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook21 = { 21, 9, 2, 81, 9, 3, gs_table_l0_21, gs_table_l1_21 }; + + +static const short gs_table_l0_22[512] = +{ + 3182, 3182, 3182, 3182, 3182, 3182, 3182, 3182, + 4246, 4246, 4818, 4888, 4664, 4687, 4253, 4253, + 3250, 3250, 3250, 3250, 3250, 3250, 3250, 3250, + 4780, 4808, 4721, 4742, 3695, 3695, 3695, 3695, + 4191, 4191, 4234, 4234, 3731, 3731, 3731, 3731, + 4289, 4289, -2, -3, 4138, 4138, 4172, 4172, + 3234, 3234, 3234, 3234, 3234, 3234, 3234, 3234, + -4, -5, -6, -7, 4685, 4723, -8, -9, + 4821, 4836, 4763, 4807, 4342, 4342, 4155, 4155, + 4188, 4188, 4220, 4220, 3743, 3743, 3743, 3743, + 4276, 4276, 4190, 4190, 4204, 4204, 4262, 4262, + 3198, 3198, 3198, 3198, 3198, 3198, 3198, 3198, + 3218, 3218, 3218, 3218, 3218, 3218, 3218, 3218, + 3725, 3725, 3725, 3725, -10, -11, 4244, 4244, + 3214, 3214, 3214, 3214, 3214, 3214, 3214, 3214, + 4806, 4835, 4729, 4790, 3761, 3761, 3761, 3761, + -12, -13, -14, -15, -16, 4666, -17, -18, + -19, -20, -21, -22, -23, -24, -25, -26, + 3763, 3763, 3763, 3763, 4855, 4759, 4764, 4773, + 3693, 3693, 3693, 3693, 4235, 4235, 4775, -27, + 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2721, + 2721, 2721, 2721, 2721, 2721, 2721, 2721, 2721, + 2687, 2687, 2687, 2687, 2687, 2687, 2687, 2687, + 2687, 2687, 2687, 2687, 2687, 2687, 2687, 2687, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 1680, 1680, 1680, 1680, 1680, 1680, 1680, 1680, + 3235, 3235, 3235, 3235, 3235, 3235, 3235, 3235, + 3724, 3724, 3724, 3724, 4269, 4269, 4326, 4326, + 4662, 4697, 4616, 4649, 4725, 4741, 4704, 4706, + 3813, 3813, 3813, 3813, 4270, 4270, 4327, 4327, + 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, + 2720, 2720, 2720, 2720, 2720, 2720, 2720, 2720, + 2688, 2688, 2688, 2688, 2688, 2688, 2688, 2688, + 2688, 2688, 2688, 2688, 2688, 2688, 2688, 2688, + 4121, 4121, 4171, 4171, 3760, 3760, 3760, 3760, + 3714, 3714, 3714, 3714, 4307, 4307, 4308, 4308, + -28, 4634, -29, -30, 4799, 4809, 4727, 4776, + -31, -32, 4156, 4156, -33, -34, -35, -36, + 3201, 3201, 3201, 3201, 3201, 3201, 3201, 3201, + 4825, -37, 4203, 4203, 3696, 3696, 3696, 3696, + 4290, 4290, 4669, 4714, 3742, 3742, 3742, 3742, + 3197, 3197, 3197, 3197, 3197, 3197, 3197, 3197, + 2193, 2193, 2193, 2193, 2193, 2193, 2193, 2193, + 2193, 2193, 2193, 2193, 2193, 2193, 2193, 2193, + 2193, 2193, 2193, 2193, 2193, 2193, 2193, 2193, + 2193, 2193, 2193, 2193, 2193, 2193, 2193, 2193, + 4187, 4187, 4277, 4277, 3779, 3779, 3779, 3779, + 4292, 4292, 4744, -38, 3733, 3733, 3733, 3733, + 4201, 4201, 4271, 4271, 4293, 4293, 4824, 4853, + 3677, 3677, 3677, 3677, 3748, 3748, 3748, 3748, + 2191, 2191, 2191, 2191, 2191, 2191, 2191, 2191, + 2191, 2191, 2191, 2191, 2191, 2191, 2191, 2191, + 2191, 2191, 2191, 2191, 2191, 2191, 2191, 2191, + 2191, 2191, 2191, 2191, 2191, 2191, 2191, 2191, + -39, 4651, -40, -41, 4745, 4822, 4665, 4686, + -42, -43, -44, -45, -46, -47, -48, -49, + 4219, 4219, 4279, 4279, -50, -51, -52, -53, + 4359, 4359, 4218, 4218, 4227, 4227, 4228, 4228 +}; + +static const short gs_table_l1_22_42[16] = +{ + 1311, 1311, 1311, 1311, 1821, 1821, 1824, 1824, + 556, 556, 556, 556, 556, 556, 556, 556 +}; + +static const short gs_table_l1_22_43[16] = +{ + 779, 779, 779, 779, 779, 779, 779, 779, + 793, 793, 793, 793, 793, 793, 793, 793 +}; + +static const short gs_table_l1_22_56[16] = +{ + 681, 681, 681, 681, 681, 681, 681, 681, + 714, 714, 714, 714, 714, 714, 714, 714 +}; + +static const short gs_table_l1_22_57[16] = +{ + 626, 626, 626, 626, 626, 626, 626, 626, + 632, 632, 632, 632, 632, 632, 632, 632 +}; + +static const short gs_table_l1_22_58[16] = +{ + 738, 738, 738, 738, 738, 738, 738, 738, + 744, 744, 744, 744, 744, 744, 744, 744 +}; + +static const short gs_table_l1_22_59[16] = +{ + 720, 720, 720, 720, 720, 720, 720, 720, + 736, 736, 736, 736, 736, 736, 736, 736 +}; + +static const short gs_table_l1_22_62[16] = +{ + 600, 600, 600, 600, 600, 600, 600, 600, + 616, 616, 616, 616, 616, 616, 616, 616 +}; + +static const short gs_table_l1_22_63[16] = +{ + 557, 557, 557, 557, 557, 557, 557, 557, + 567, 567, 567, 567, 567, 567, 567, 567 +}; + +static const short gs_table_l1_22_108[16] = +{ + 727, 727, 727, 727, 727, 727, 727, 727, + 745, 745, 745, 745, 745, 745, 745, 745 +}; + +static const short gs_table_l1_22_109[16] = +{ + 702, 702, 702, 702, 702, 702, 702, 702, + 704, 704, 704, 704, 704, 704, 704, 704 +}; + +static const short gs_table_l1_22_128[16] = +{ + 1051, 1051, 1051, 1051, 1052, 1052, 1052, 1052, + 2322, 2332, 2319, 2320, 1028, 1028, 1028, 1028 +}; + +static const short gs_table_l1_22_129[16] = +{ + 1094, 1094, 1094, 1094, 1123, 1123, 1123, 1123, + 1062, 1062, 1062, 1062, 1093, 1093, 1093, 1093 +}; + +static const short gs_table_l1_22_130[16] = +{ + 1542, 1542, 1549, 1549, 2049, 2050, 1536, 1536, + 1555, 1555, 1556, 1556, 1551, 1551, 1553, 1553 +}; + +static const short gs_table_l1_22_131[16] = +{ + 2270, 2288, 2113, 2269, 2316, 2318, 2302, 2306, + 2062, 2064, 2051, 2060, 2083, 2099, 2080, 2081 +}; + +static const short gs_table_l1_22_132[16] = +{ + 1300, 1300, 1300, 1300, 1301, 1301, 1301, 1301, + 1265, 1265, 1265, 1265, 1272, 1272, 1272, 1272 +}; + +static const short gs_table_l1_22_134[16] = +{ + 1210, 1210, 1210, 1210, 1212, 1212, 1212, 1212, + 1126, 1126, 1126, 1126, 1178, 1178, 1178, 1178 +}; + +static const short gs_table_l1_22_135[16] = +{ + 1249, 1249, 1249, 1249, 1260, 1260, 1260, 1260, + 1227, 1227, 1227, 1227, 1229, 1229, 1229, 1229 +}; + +static const short gs_table_l1_22_136[16] = +{ + 599, 599, 599, 599, 599, 599, 599, 599, + 602, 602, 602, 602, 602, 602, 602, 602 +}; + +static const short gs_table_l1_22_137[16] = +{ + 583, 583, 583, 583, 583, 583, 583, 583, + 593, 593, 593, 593, 593, 593, 593, 593 +}; + +static const short gs_table_l1_22_138[16] = +{ + 696, 696, 696, 696, 696, 696, 696, 696, + 701, 701, 701, 701, 701, 701, 701, 701 +}; + +static const short gs_table_l1_22_139[16] = +{ + 615, 615, 615, 615, 615, 615, 615, 615, + 665, 665, 665, 665, 665, 665, 665, 665 +}; + +static const short gs_table_l1_22_140[16] = +{ + 1774, 1774, 1788, 1788, 1759, 1759, 1773, 1773, + 1795, 1795, 1805, 1805, 1791, 1791, 1793, 1793 +}; + +static const short gs_table_l1_22_141[16] = +{ + 1573, 1573, 1584, 1584, 1558, 1558, 1567, 1567, + 1604, 1604, 1723, 1723, 1602, 1602, 1603, 1603 +}; + +static const short gs_table_l1_22_142[16] = +{ + 574, 574, 574, 574, 574, 574, 574, 574, + 575, 575, 575, 575, 575, 575, 575, 575 +}; + +static const short gs_table_l1_22_143[16] = +{ + 1814, 1814, 1815, 1815, 1809, 1809, 1811, 1811, + 552, 552, 552, 552, 552, 552, 552, 552 +}; + +static const short gs_table_l1_22_159[16] = +{ + 647, 647, 647, 647, 647, 647, 647, 647, + 683, 683, 683, 683, 683, 683, 683, 683 +}; + +static const short gs_table_l1_22_336[16] = +{ + 521, 521, 521, 521, 521, 521, 521, 521, + 523, 523, 523, 523, 523, 523, 523, 523 +}; + +static const short gs_table_l1_22_338[16] = +{ + 565, 565, 565, 565, 565, 565, 565, 565, + 585, 585, 585, 585, 585, 585, 585, 585 +}; + +static const short gs_table_l1_22_339[16] = +{ + 542, 542, 542, 542, 542, 542, 542, 542, + 559, 559, 559, 559, 559, 559, 559, 559 +}; + +static const short gs_table_l1_22_344[16] = +{ + 773, 773, 773, 773, 773, 773, 773, 773, + 774, 774, 774, 774, 774, 774, 774, 774 +}; + +static const short gs_table_l1_22_345[16] = +{ + 762, 762, 762, 762, 762, 762, 762, 762, + 765, 765, 765, 765, 765, 765, 765, 765 +}; + +static const short gs_table_l1_22_348[16] = +{ + 628, 628, 628, 628, 628, 628, 628, 628, + 630, 630, 630, 630, 630, 630, 630, 630 +}; + +static const short gs_table_l1_22_349[16] = +{ + 586, 586, 586, 586, 586, 586, 586, 586, + 598, 598, 598, 598, 598, 598, 598, 598 +}; + +static const short gs_table_l1_22_350[16] = +{ + 747, 747, 747, 747, 747, 747, 747, 747, + 754, 754, 754, 754, 754, 754, 754, 754 +}; + +static const short gs_table_l1_22_351[16] = +{ + 719, 719, 719, 719, 719, 719, 719, 719, + 746, 746, 746, 746, 746, 746, 746, 746 +}; + +static const short gs_table_l1_22_361[16] = +{ + 777, 777, 777, 777, 777, 777, 777, 777, + 1307, 1307, 1307, 1307, 1310, 1310, 1310, 1310 +}; + +static const short gs_table_l1_22_427[16] = +{ + 761, 761, 761, 761, 761, 761, 761, 761, + 763, 763, 763, 763, 763, 763, 763, 763 +}; + +static const short gs_table_l1_22_480[16] = +{ + 1290, 1290, 1290, 1290, 1306, 1306, 1306, 1306, + 1284, 1284, 1284, 1284, 1288, 1288, 1288, 1288 +}; + +static const short gs_table_l1_22_482[16] = +{ + 1243, 1243, 1243, 1243, 1244, 1244, 1244, 1244, + 1230, 1230, 1230, 1230, 1242, 1242, 1242, 1242 +}; + +static const short gs_table_l1_22_483[16] = +{ + 1268, 1268, 1268, 1268, 1280, 1280, 1280, 1280, + 1263, 1263, 1263, 1263, 1267, 1267, 1267, 1267 +}; + +static const short gs_table_l1_22_488[16] = +{ + 541, 541, 541, 541, 541, 541, 541, 541, + 548, 548, 548, 548, 548, 548, 548, 548 +}; + +static const short gs_table_l1_22_489[16] = +{ + 535, 535, 535, 535, 535, 535, 535, 535, + 536, 536, 536, 536, 536, 536, 536, 536 +}; + +static const short gs_table_l1_22_490[16] = +{ + 592, 592, 592, 592, 592, 592, 592, 592, + 594, 594, 594, 594, 594, 594, 594, 594 +}; + +static const short gs_table_l1_22_491[16] = +{ + 551, 551, 551, 551, 551, 551, 551, 551, + 584, 584, 584, 584, 584, 584, 584, 584 +}; + +static const short gs_table_l1_22_492[16] = +{ + 1074, 1074, 1074, 1074, 1076, 1076, 1076, 1076, + 1070, 1070, 1070, 1070, 1073, 1073, 1073, 1073 +}; + +static const short gs_table_l1_22_493[16] = +{ + 1125, 1125, 1125, 1125, 1228, 1228, 1228, 1228, + 1088, 1088, 1088, 1088, 1109, 1109, 1109, 1109 +}; + +static const short gs_table_l1_22_494[16] = +{ + 519, 519, 519, 519, 519, 519, 519, 519, + 522, 522, 522, 522, 522, 522, 522, 522 +}; + +static const short gs_table_l1_22_495[16] = +{ + 1045, 1045, 1045, 1045, 1058, 1058, 1058, 1058, + 1029, 1029, 1029, 1029, 1042, 1042, 1042, 1042 +}; + +static const short gs_table_l1_22_500[16] = +{ + 609, 609, 609, 609, 609, 609, 609, 609, + 612, 612, 612, 612, 612, 612, 612, 612 +}; + +static const short gs_table_l1_22_501[16] = +{ + 595, 595, 595, 595, 595, 595, 595, 595, + 596, 596, 596, 596, 596, 596, 596, 596 +}; + +static const short gs_table_l1_22_502[16] = +{ + 697, 697, 697, 697, 697, 697, 697, 697, + 721, 721, 721, 721, 721, 721, 721, 721 +}; + +static const short gs_table_l1_22_503[16] = +{ + 664, 664, 664, 664, 664, 664, 664, 664, + 682, 682, 682, 682, 682, 682, 682, 682 +}; + +static const short* gs_table_l1_22[52] = +{ + gs_table_l1_22_42, gs_table_l1_22_43, + gs_table_l1_22_56, gs_table_l1_22_57, + gs_table_l1_22_58, gs_table_l1_22_59, + gs_table_l1_22_62, gs_table_l1_22_63, + gs_table_l1_22_108, gs_table_l1_22_109, + gs_table_l1_22_128, gs_table_l1_22_129, + gs_table_l1_22_130, gs_table_l1_22_131, + gs_table_l1_22_132, gs_table_l1_22_134, + gs_table_l1_22_135, gs_table_l1_22_136, + gs_table_l1_22_137, gs_table_l1_22_138, + gs_table_l1_22_139, gs_table_l1_22_140, + gs_table_l1_22_141, gs_table_l1_22_142, + gs_table_l1_22_143, gs_table_l1_22_159, + gs_table_l1_22_336, gs_table_l1_22_338, + gs_table_l1_22_339, gs_table_l1_22_344, + gs_table_l1_22_345, gs_table_l1_22_348, + gs_table_l1_22_349, gs_table_l1_22_350, + gs_table_l1_22_351, gs_table_l1_22_361, + gs_table_l1_22_427, gs_table_l1_22_480, + gs_table_l1_22_482, gs_table_l1_22_483, + gs_table_l1_22_488, gs_table_l1_22_489, + gs_table_l1_22_490, gs_table_l1_22_491, + gs_table_l1_22_492, gs_table_l1_22_493, + gs_table_l1_22_494, gs_table_l1_22_495, + gs_table_l1_22_500, gs_table_l1_22_501, + gs_table_l1_22_502, gs_table_l1_22_503 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook22 = { 22, 17, 2, 289, 9, 4, gs_table_l0_22, gs_table_l1_22 }; + + +static const short gs_table_l0_23[512] = +{ + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 1552, 1552, 1552, 1552, 1552, 1552, 1552, 1552, + 3081, 3081, 3081, 3081, 3081, 3081, 3081, 3081, + 3588, 3588, 3588, 3588, 3610, 3610, 3610, 3610, + 2572, 2572, 2572, 2572, 2572, 2572, 2572, 2572, + 2572, 2572, 2572, 2572, 2572, 2572, 2572, 2572, + 3607, 3607, 3607, 3607, 3591, 3591, 3591, 3591, + 3082, 3082, 3082, 3082, 3082, 3082, 3082, 3082, + 3092, 3092, 3092, 3092, 3092, 3092, 3092, 3092, + 3589, 3589, 3589, 3589, 4098, 4098, 4608, 4609, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1039, 1039, 1039, + 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, + 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, + 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, + 2066, 2066, 2066, 2066, 2066, 2066, 2066, 2066, + 3080, 3080, 3080, 3080, 3080, 3080, 3080, 3080, + 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, + 3094, 3094, 3094, 3094, 3094, 3094, 3094, 3094, + 3078, 3078, 3078, 3078, 3078, 3078, 3078, 3078, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 1550, 1550, 1550, 1550, 1550, 1550, 1550, 1550, + 2579, 2579, 2579, 2579, 2579, 2579, 2579, 2579, + 2579, 2579, 2579, 2579, 2579, 2579, 2579, 2579, + 3612, 3612, 3612, 3612, 3587, 3587, 3587, 3587, + 3611, 3611, 3611, 3611, 4125, 4125, 4126, 4126, + 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, + 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, + 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, + 2061, 2061, 2061, 2061, 2061, 2061, 2061, 2061, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2065, 2065, 2065, 2065, 2065, 2065, 2065, 2065, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + 2571, 2571, 2571, 2571, 2571, 2571, 2571, 2571, + 3096, 3096, 3096, 3096, 3096, 3096, 3096, 3096, + 3093, 3093, 3093, 3093, 3093, 3093, 3093, 3093 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook23 = { 23, 31, 1, 31, 9, 0, gs_table_l0_23, NULL }; + + +static const short gs_table_l0_24[512] = +{ + 2587, 2587, 2587, 2587, 2587, 2587, 2587, 2587, + 2587, 2587, 2587, 2587, 2587, 2587, 2587, 2587, + 3096, 3096, 3096, 3096, 3096, 3096, 3096, 3096, + 4112, 4112, 4150, 4150, 3628, 3628, 3628, 3628, + 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077, + 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077, + 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077, + 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2077, + 4102, 4102, 4612, 4663, 3631, 3631, 3631, 3631, + 3633, 3633, 3633, 3633, 4142, 4142, 4666, 4610, + 2595, 2595, 2595, 2595, 2595, 2595, 2595, 2595, + 2595, 2595, 2595, 2595, 2595, 2595, 2595, 2595, + 3604, 3604, 3604, 3604, 4613, 4618, 4148, 4148, + 3110, 3110, 3110, 3110, 3110, 3110, 3110, 3110, + 3626, 3626, 3626, 3626, 4110, 4110, -2, 4617, + 3109, 3109, 3109, 3109, 3109, 3109, 3109, 3109, + 2594, 2594, 2594, 2594, 2594, 2594, 2594, 2594, + 2594, 2594, 2594, 2594, 2594, 2594, 2594, 2594, + 3599, 3599, 3599, 3599, 3624, 3624, 3624, 3624, + 3097, 3097, 3097, 3097, 3097, 3097, 3097, 3097, + 2588, 2588, 2588, 2588, 2588, 2588, 2588, 2588, + 2588, 2588, 2588, 2588, 2588, 2588, 2588, 2588, + 3606, 3606, 3606, 3606, 3607, 3607, 3607, 3607, + -3, 4619, 4109, 4109, 3605, 3605, 3605, 3605, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1567, 1567, 1567, 1567, 1567, 1567, 1567, 1567, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1568, 1568, 1568, 1568, 1568, 1568, 1568, 1568, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 1566, 1566, 1566, 1566, 1566, 1566, 1566, 1566, + 3113, 3113, 3113, 3113, 3113, 3113, 3113, 3113, + 3601, 3601, 3601, 3601, 3635, 3635, 3635, 3635, + 3596, 3596, 3596, 3596, 3602, 3602, 3602, 3602, + 3632, 3632, 3632, 3632, 4103, 4103, 4104, 4104, + 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, + 2596, 2596, 2596, 2596, 2596, 2596, 2596, 2596, + 2586, 2586, 2586, 2586, 2586, 2586, 2586, 2586, + 2586, 2586, 2586, 2586, 2586, 2586, 2586, 2586, + 3111, 3111, 3111, 3111, 3111, 3111, 3111, 3111, + 3603, 3603, 3603, 3603, 3627, 3627, 3627, 3627, + 4149, 4149, 4152, 4152, 3629, 3629, 3629, 3629, + 3634, 3634, 3634, 3634, 4156, 4156, -4, 4667, + 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, + 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, + 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081, + 2081, 2081, 2081, 2081, 2081, 2081, 2081, 2081 +}; + +static const short gs_table_l1_24_118[2] = +{ + 569, 574 +}; + +static const short gs_table_l1_24_184[2] = +{ + 513, 573 +}; + +static const short gs_table_l1_24_478[2] = +{ + 512, 515 +}; + +static const short* gs_table_l1_24[3] = +{ + gs_table_l1_24_118, gs_table_l1_24_184, + gs_table_l1_24_478 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook24 = { 24, 63, 1, 63, 9, 1, gs_table_l0_24, gs_table_l1_24 }; + + +static const short gs_table_l0_25[512] = +{ + 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, + 2627, 2627, 2627, 2627, 2627, 2627, 2627, 2627, + 4133, 4133, 4186, 4186, 3662, 3662, 3662, 3662, + 3634, 3634, 3634, 3634, 3664, 3664, 3664, 3664, + 2620, 2620, 2620, 2620, 2620, 2620, 2620, 2620, + 2620, 2620, 2620, 2620, 2620, 2620, 2620, 2620, + 4195, 4195, 4702, 4710, 3629, 3629, 3629, 3629, + 4117, 4117, 4132, 4132, 4648, 4700, 4626, 4627, + 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110, + 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110, + 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110, + 2110, 2110, 2110, 2110, 2110, 2110, 2110, 2110, + 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, + 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, + 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, + 2112, 2112, 2112, 2112, 2112, 2112, 2112, 2112, + 4180, 4180, 4201, 4201, 4134, 4134, 4175, 4175, + 3128, 3128, 3128, 3128, 3128, 3128, 3128, 3128, + 4723, -2, 4124, 4124, 4178, 4178, 4182, 4182, + 4137, 4137, 4177, 4177, 3636, 3636, 3636, 3636, + 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, + 2626, 2626, 2626, 2626, 2626, 2626, 2626, 2626, + 4191, 4191, 4711, 4714, 4140, 4140, 4142, 4142, + 3129, 3129, 3129, 3129, 3129, 3129, 3129, 3129, + 3635, 3635, 3635, 3635, 3656, 3656, 3656, 3656, + 4640, 4641, 4633, 4639, 4699, 4709, 4693, 4697, + -3, -4, -5, -6, -7, 4630, -8, -9, + 3130, 3130, 3130, 3130, 3130, 3130, 3130, 3130, + 2621, 2621, 2621, 2621, 2621, 2621, 2621, 2621, + 2621, 2621, 2621, 2621, 2621, 2621, 2621, 2621, + 4192, 4192, 4722, -10, 3659, 3659, 3659, 3659, + 3141, 3141, 3141, 3141, 3141, 3141, 3141, 3141, + 3143, 3143, 3143, 3143, 3143, 3143, 3143, 3143, + 3126, 3126, 3126, 3126, 3126, 3126, 3126, 3126, + 2628, 2628, 2628, 2628, 2628, 2628, 2628, 2628, + 2628, 2628, 2628, 2628, 2628, 2628, 2628, 2628, + 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, + 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, + 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, + 2113, 2113, 2113, 2113, 2113, 2113, 2113, 2113, + 2630, 2630, 2630, 2630, 2630, 2630, 2630, 2630, + 2630, 2630, 2630, 2630, 2630, 2630, 2630, 2630, + 3146, 3146, 3146, 3146, 3146, 3146, 3146, 3146, + 3627, 3627, 3627, 3627, 3660, 3660, 3660, 3660, + 3125, 3125, 3125, 3125, 3125, 3125, 3125, 3125, + 3145, 3145, 3145, 3145, 3145, 3145, 3145, 3145, + 4135, 4135, 4138, 4138, 4122, 4122, 4123, 4123, + 4194, 4194, 4203, 4203, 4179, 4179, 4184, 4184, + 2619, 2619, 2619, 2619, 2619, 2619, 2619, 2619, + 2619, 2619, 2619, 2619, 2619, 2619, 2619, 2619, + 3127, 3127, 3127, 3127, 3127, 3127, 3127, 3127, + 3632, 3632, 3632, 3632, 4130, 4130, 4183, 4183, + -11, 4613, -12, -13, 4717, 4721, 4619, 4623, + 4120, 4120, 4125, 4125, -14, -15, -16, -17, + 3631, 3631, 3631, 3631, 3633, 3633, 3633, 3633, + 3661, 3661, 3661, 3661, 4193, 4193, 4126, 4126, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599, + 1599, 1599, 1599, 1599, 1599, 1599, 1599, 1599 +}; + +static const short gs_table_l1_25_145[8] = +{ + 637, 637, 637, 637, 1148, 1148, 1548, 1657 +}; + +static const short gs_table_l1_25_208[8] = +{ + 535, 535, 535, 535, 547, 547, 547, 547 +}; + +static const short gs_table_l1_25_209[8] = +{ + 528, 528, 528, 528, 532, 532, 532, 532 +}; + +static const short gs_table_l1_25_210[8] = +{ + 622, 622, 622, 622, 635, 635, 635, 635 +}; + +static const short gs_table_l1_25_211[8] = +{ + 605, 605, 605, 605, 616, 616, 616, 616 +}; + +static const short gs_table_l1_25_212[8] = +{ + 512, 512, 512, 512, 513, 513, 513, 513 +}; + +static const short gs_table_l1_25_214[8] = +{ + 525, 525, 525, 525, 526, 526, 526, 526 +}; + +static const short gs_table_l1_25_215[8] = +{ + 519, 519, 519, 519, 520, 520, 520, 520 +}; + +static const short gs_table_l1_25_243[8] = +{ + 638, 638, 638, 638, 1144, 1144, 1146, 1146 +}; + +static const short gs_table_l1_25_416[8] = +{ + 1028, 1028, 1033, 1033, 514, 514, 514, 514 +}; + +static const short gs_table_l1_25_418[8] = +{ + 522, 522, 522, 522, 529, 529, 529, 529 +}; + +static const short gs_table_l1_25_419[8] = +{ + 515, 515, 515, 515, 518, 518, 518, 518 +}; + +static const short gs_table_l1_25_428[8] = +{ + 623, 623, 623, 623, 624, 624, 624, 624 +}; + +static const short gs_table_l1_25_429[8] = +{ + 612, 612, 612, 612, 620, 620, 620, 620 +}; + +static const short gs_table_l1_25_430[8] = +{ + 630, 630, 630, 630, 631, 631, 631, 631 +}; + +static const short gs_table_l1_25_431[8] = +{ + 628, 628, 628, 628, 629, 629, 629, 629 +}; + +static const short* gs_table_l1_25[16] = +{ + gs_table_l1_25_145, gs_table_l1_25_208, + gs_table_l1_25_209, gs_table_l1_25_210, + gs_table_l1_25_211, gs_table_l1_25_212, + gs_table_l1_25_214, gs_table_l1_25_215, + gs_table_l1_25_243, gs_table_l1_25_416, + gs_table_l1_25_418, gs_table_l1_25_419, + gs_table_l1_25_428, gs_table_l1_25_429, + gs_table_l1_25_430, gs_table_l1_25_431 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook25 = { 25, 127, 1, 127, 9, 3, gs_table_l0_25, gs_table_l1_25 }; + + +static const short gs_table_l0_26[512] = +{ + 4797, 4807, 4784, 4789, 4813, 4816, 4808, 4810, + 4767, 4768, 4695, 4709, 4779, 4780, 4774, 4777, + 4860, 4862, 4848, 4853, 3650, 3650, 3650, 3650, + 4823, 4828, 4819, 4820, 4831, 4841, 4829, 4830, + 4634, 4639, 4626, 4631, 4651, 4652, 4648, 4649, + -2, -3, -4, -5, 4622, 4623, 4609, 4620, + 4681, 4685, 4675, 4678, 4691, 4693, 4686, 4690, + 4661, 4663, 4653, 4656, 4672, 4673, 4664, 4667, + 3720, 3720, 3720, 3720, 3730, 3730, 3730, 3730, + 3698, 3698, 3698, 3698, 3700, 3700, 3700, 3700, + 3197, 3197, 3197, 3197, 3197, 3197, 3197, 3197, + 3201, 3201, 3201, 3201, 3201, 3201, 3201, 3201, + 2175, 2175, 2175, 2175, 2175, 2175, 2175, 2175, + 2175, 2175, 2175, 2175, 2175, 2175, 2175, 2175, + 2175, 2175, 2175, 2175, 2175, 2175, 2175, 2175, + 2175, 2175, 2175, 2175, 2175, 2175, 2175, 2175, + 3192, 3192, 3192, 3192, 3192, 3192, 3192, 3192, + 3202, 3202, 3202, 3202, 3202, 3202, 3202, 3202, + 3690, 3690, 3690, 3690, 3691, 3691, 3691, 3691, + 4299, 4299, 4158, 4158, 3687, 3687, 3687, 3687, + 3715, 3715, 3715, 3715, 3725, 3725, 3725, 3725, + 3705, 3705, 3705, 3705, 3706, 3706, 3706, 3706, + 3206, 3206, 3206, 3206, 3206, 3206, 3206, 3206, + 4193, 4193, 4238, 4238, 4184, 4184, 4186, 4186, + 4248, 4248, 4252, 4252, 4240, 4240, 4244, 4244, + 3693, 3693, 3693, 3693, 4279, 4279, 4833, 4859, + 3717, 3717, 3717, 3717, 3722, 3722, 3722, 3722, + 3692, 3692, 3692, 3692, 3701, 3701, 3701, 3701, + 3196, 3196, 3196, 3196, 3196, 3196, 3196, 3196, + 3724, 3724, 3724, 3724, 4250, 4250, 4270, 4270, + 4176, 4176, 4194, 4194, 4638, 4643, 4157, 4157, + 4200, 4200, 4209, 4209, 4196, 4196, 4198, 4198, + 4177, 4177, 4180, 4180, 4167, 4167, 4175, 4175, + 4191, 4191, 4192, 4192, 4185, 4185, 4189, 4189, + 4145, 4145, 4147, 4147, 4132, 4132, 4142, 4142, + 4154, 4154, 4159, 4159, 4150, 4150, 4153, 4153, + 4288, 4288, 4294, 4294, 4278, 4278, 4281, 4281, + 4302, 4302, 4315, 4315, 4297, 4297, 4300, 4300, + 4253, 4253, 4257, 4257, 4195, 4195, 4207, 4207, + 4264, 4264, 4276, 4276, 4258, 4258, 4260, 4260, + 3729, 3729, 3729, 3729, 3734, 3734, 3734, 3734, + 3719, 3719, 3719, 3719, 3727, 3727, 3727, 3727, + 2683, 2683, 2683, 2683, 2683, 2683, 2683, 2683, + 2683, 2683, 2683, 2683, 2683, 2683, 2683, 2683, + 2176, 2176, 2176, 2176, 2176, 2176, 2176, 2176, + 2176, 2176, 2176, 2176, 2176, 2176, 2176, 2176, + 2176, 2176, 2176, 2176, 2176, 2176, 2176, 2176, + 2176, 2176, 2176, 2176, 2176, 2176, 2176, 2176, + 3191, 3191, 3191, 3191, 3191, 3191, 3191, 3191, + 3204, 3204, 3204, 3204, 3204, 3204, 3204, 3204, + 3721, 3721, 3721, 3721, 3733, 3733, 3733, 3733, + 3699, 3699, 3699, 3699, 3702, 3702, 3702, 3702, + 2686, 2686, 2686, 2686, 2686, 2686, 2686, 2686, + 2686, 2686, 2686, 2686, 2686, 2686, 2686, 2686, + 4266, 4266, 4273, 4273, 4251, 4251, 4254, 4254, + 4292, 4292, 4293, 4293, 4275, 4275, 4287, 4287, + -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, -32, -33, -34, -35, -36, -37, + 4206, 4206, 4208, 4208, 4190, 4190, 4201, 4201, + 4247, 4247, 4249, 4249, 4235, 4235, 4243, 4243, + -38, -39, 4134, 4134, -40, -41, -42, -43, + 4171, 4171, 4187, 4187, 4148, 4148, 4168, 4168 +}; + +static const short gs_table_l1_26_40[2] = +{ + 515, 516 +}; + +static const short gs_table_l1_26_41[2] = +{ + 512, 514 +}; + +static const short gs_table_l1_26_42[2] = +{ + 519, 520 +}; + +static const short gs_table_l1_26_43[2] = +{ + 517, 518 +}; + +static const short gs_table_l1_26_448[2] = +{ + 706, 707 +}; + +static const short gs_table_l1_26_449[2] = +{ + 702, 705 +}; + +static const short gs_table_l1_26_450[2] = +{ + 722, 725 +}; + +static const short gs_table_l1_26_451[2] = +{ + 719, 721 +}; + +static const short gs_table_l1_26_452[2] = +{ + 687, 690 +}; + +static const short gs_table_l1_26_453[2] = +{ + 679, 685 +}; + +static const short gs_table_l1_26_454[2] = +{ + 699, 700 +}; + +static const short gs_table_l1_26_455[2] = +{ + 696, 698 +}; + +static const short gs_table_l1_26_456[2] = +{ + 743, 744 +}; + +static const short gs_table_l1_26_457[2] = +{ + 741, 742 +}; + +static const short gs_table_l1_26_458[2] = +{ + 748, 749 +}; + +static const short gs_table_l1_26_459[2] = +{ + 746, 747 +}; + +static const short gs_table_l1_26_460[2] = +{ + 729, 730 +}; + +static const short gs_table_l1_26_461[2] = +{ + 726, 728 +}; + +static const short gs_table_l1_26_462[2] = +{ + 739, 740 +}; + +static const short gs_table_l1_26_463[2] = +{ + 736, 738 +}; + +static const short gs_table_l1_26_464[2] = +{ + 536, 537 +}; + +static const short gs_table_l1_26_465[2] = +{ + 533, 534 +}; + +static const short gs_table_l1_26_466[2] = +{ + 541, 544 +}; + +static const short gs_table_l1_26_467[2] = +{ + 539, 540 +}; + +static const short gs_table_l1_26_468[2] = +{ + 523, 525 +}; + +static const short gs_table_l1_26_469[2] = +{ + 521, 522 +}; + +static const short gs_table_l1_26_470[2] = +{ + 531, 532 +}; + +static const short gs_table_l1_26_471[2] = +{ + 528, 529 +}; + +static const short gs_table_l1_26_472[2] = +{ + 586, 588 +}; + +static const short gs_table_l1_26_473[2] = +{ + 580, 581 +}; + +static const short gs_table_l1_26_474[2] = +{ + 675, 677 +}; + +static const short gs_table_l1_26_475[2] = +{ + 598, 604 +}; + +static const short gs_table_l1_26_476[2] = +{ + 549, 551 +}; + +static const short gs_table_l1_26_477[2] = +{ + 545, 546 +}; + +static const short gs_table_l1_26_478[2] = +{ + 562, 572 +}; + +static const short gs_table_l1_26_479[2] = +{ + 554, 559 +}; + +static const short gs_table_l1_26_496[2] = +{ + 762, 765 +}; + +static const short gs_table_l1_26_497[2] = +{ + 760, 761 +}; + +static const short gs_table_l1_26_500[2] = +{ + 753, 754 +}; + +static const short gs_table_l1_26_501[2] = +{ + 750, 751 +}; + +static const short gs_table_l1_26_502[2] = +{ + 758, 759 +}; + +static const short gs_table_l1_26_503[2] = +{ + 755, 756 +}; + +static const short* gs_table_l1_26[42] = +{ + gs_table_l1_26_40, gs_table_l1_26_41, + gs_table_l1_26_42, gs_table_l1_26_43, + gs_table_l1_26_448, gs_table_l1_26_449, + gs_table_l1_26_450, gs_table_l1_26_451, + gs_table_l1_26_452, gs_table_l1_26_453, + gs_table_l1_26_454, gs_table_l1_26_455, + gs_table_l1_26_456, gs_table_l1_26_457, + gs_table_l1_26_458, gs_table_l1_26_459, + gs_table_l1_26_460, gs_table_l1_26_461, + gs_table_l1_26_462, gs_table_l1_26_463, + gs_table_l1_26_464, gs_table_l1_26_465, + gs_table_l1_26_466, gs_table_l1_26_467, + gs_table_l1_26_468, gs_table_l1_26_469, + gs_table_l1_26_470, gs_table_l1_26_471, + gs_table_l1_26_472, gs_table_l1_26_473, + gs_table_l1_26_474, gs_table_l1_26_475, + gs_table_l1_26_476, gs_table_l1_26_477, + gs_table_l1_26_478, gs_table_l1_26_479, + gs_table_l1_26_496, gs_table_l1_26_497, + gs_table_l1_26_500, gs_table_l1_26_501, + gs_table_l1_26_502, gs_table_l1_26_503 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook26 = { 26, 255, 1, 255, 9, 1, gs_table_l0_26, gs_table_l1_26 }; + + +static const short gs_table_l0_27[512] = +{ + 4278, 4278, 4281, 4281, 4276, 4276, 4277, 4277, + 4294, 4294, 4299, 4299, 4284, 4284, 4285, 4285, + 4247, 4247, 4254, 4254, 4240, 4240, 4241, 4241, + 4272, 4272, 4273, 4273, 4260, 4260, 4267, 4267, + 4345, 4345, 4346, 4346, 4342, 4342, 4343, 4343, + 3758, 3758, 3758, 3758, 4347, 4347, 4862, -2, + 2560, 2560, 2560, 2560, 2560, 2560, 2560, 2560, + 2560, 2560, 2560, 2560, 2560, 2560, 2560, 2560, + 3075, 3075, 3075, 3075, 3075, 3075, 3075, 3075, + 3079, 3079, 3079, 3079, 3079, 3079, 3079, 3079, + 3590, 3590, 3590, 3590, 3593, 3593, 3593, 3593, + 3076, 3076, 3076, 3076, 3076, 3076, 3076, 3076, + 3617, 3617, 3617, 3617, 3642, 3642, 3642, 3642, + 3598, 3598, 3598, 3598, 3613, 3613, 3613, 3613, + 4207, 4207, 4222, 4222, 4190, 4190, 4195, 4195, + 4232, 4232, 4242, 4242, 4227, 4227, 4229, 4229, + 3595, 3595, 3595, 3595, 3596, 3596, 3596, 3596, + 4120, 4120, 4122, 4122, 3589, 3589, 3589, 3589, + 3607, 3607, 3607, 3607, 3609, 3609, 3609, 3609, + 3597, 3597, 3597, 3597, 3603, 3603, 3603, 3603, + 4162, 4162, 4168, 4168, 4155, 4155, 4158, 4158, + 4181, 4181, 4187, 4187, 4173, 4173, 4176, 4176, + 4132, 4132, 4134, 4134, 4124, 4124, 4130, 4130, + 4142, 4142, 4143, 4143, 4135, 4135, 4140, 4140, + 4318, 4318, 4344, 4344, 4251, 4251, 4257, 4257, + 3619, 3619, 3619, 3619, 3592, 3592, 3592, 3592, + 3074, 3074, 3074, 3074, 3074, 3074, 3074, 3074, + 3594, 3594, 3594, 3594, 3600, 3600, 3600, 3600, + 2815, 2815, 2815, 2815, 2815, 2815, 2815, 2815, + 2815, 2815, 2815, 2815, 2815, 2815, 2815, 2815, + 2561, 2561, 2561, 2561, 2561, 2561, 2561, 2561, + 2561, 2561, 2561, 2561, 2561, 2561, 2561, 2561, + 3094, 3094, 3094, 3094, 3094, 3094, 3094, 3094, + 3700, 3700, 3700, 3700, 3716, 3716, 3716, 3716, + 4310, 4310, 4314, 4314, 4301, 4301, 4308, 4308, + 4329, 4329, 4333, 4333, 4315, 4315, 4323, 4323, + 3605, 3605, 3605, 3605, 3614, 3614, 3614, 3614, + 3601, 3601, 3601, 3601, 3602, 3602, 3602, 3602, + 3632, 3632, 3632, 3632, 3676, 3676, 3676, 3676, + 3616, 3616, 3616, 3616, 3621, 3621, 3621, 3621, + 4161, 4161, 4163, 4163, 4157, 4157, 4160, 4160, + 4167, 4167, 4177, 4177, 4165, 4165, 4166, 4166, + 4138, 4138, 4139, 4139, 4123, 4123, 4136, 4136, + 4147, 4147, 4151, 4151, 4141, 4141, 4145, 4145, + 4214, 4214, 4219, 4219, 4202, 4202, 4209, 4209, + 4231, 4231, 4237, 4237, 4221, 4221, 4226, 4226, + 4185, 4185, 4189, 4189, 4178, 4178, 4179, 4179, + 4196, 4196, 4199, 4199, 4193, 4193, 4194, 4194, + 4729, 4730, 4727, 4728, 4736, 4737, 4732, 4735, + 4717, 4718, 4715, 4716, 4723, 4725, 4720, 4722, + 4758, 4760, 4756, 4757, 4764, 4765, 4761, 4762, + 4746, 4747, 4742, 4745, 4751, 4755, 4748, 4750, + 4664, 4665, 4661, 4662, 4676, 4681, 4668, 4671, + 4111, 4111, 4116, 4116, 4658, 4660, 4639, 4649, + 4703, 4704, 4696, 4698, 4712, 4713, 4709, 4710, + 4684, 4686, 4682, 4683, 4694, 4695, 4687, 4692, + 4828, 4829, 4824, 4825, 4833, 4834, 4831, 4832, + 4816, 4817, 4814, 4815, 4821, 4823, 4818, 4819, + 4848, 4849, 4846, 4847, 4852, 4853, 4850, 4851, + 4838, 4839, 4836, 4837, 4843, 4844, 4840, 4842, + 4780, 4781, 4777, 4778, 4787, 4791, 4783, 4786, + 4770, 4771, 4767, 4768, 4775, 4776, 4773, 4774, + 4805, 4807, 4803, 4804, 4810, 4812, 4808, 4809, + 4795, 4798, 4792, 4794, 4801, 4802, 4799, 4800 +}; + +static const short gs_table_l1_27_47[2] = +{ + 764, 765 +}; + +static const short* gs_table_l1_27[1] = +{ + gs_table_l1_27_47 +}; + +static const DRAHuffmanCodebook g_stHuffmanCodebook27 = { 27, 256, 1, 256, 9, 1, gs_table_l0_27, gs_table_l1_27 }; + +static const DRAHuffmanCodebook* g_stHuffmanCodebookLTables[] = +{ + &g_stHuffmanCodebook10, &g_stHuffmanCodebook11, &g_stHuffmanCodebook12, &g_stHuffmanCodebook13, &g_stHuffmanCodebook14, + &g_stHuffmanCodebook15, &g_stHuffmanCodebook16, &g_stHuffmanCodebook17, &g_stHuffmanCodebook18 + +}; + +static const DRAHuffmanCodebook* g_stHuffmanCodebookSTables[] = +{ + &g_stHuffmanCodebook19, &g_stHuffmanCodebook20, &g_stHuffmanCodebook21, &g_stHuffmanCodebook22, &g_stHuffmanCodebook23, + &g_stHuffmanCodebook24, &g_stHuffmanCodebook25, &g_stHuffmanCodebook26, &g_stHuffmanCodebook27 + +}; + +static int DRAHuffmanDecode(DRABitstream* bs, const DRAHuffmanCodebook* pBook) +{ + int nIndex0 = ShowBits(bs, pBook->l0); + int nResult = pBook->l0_items[nIndex0]; + if (nResult == -1) + { + return -1; + } + else if (nResult < -1) + { + ClearBits(bs, pBook->l0); + int nIndex1 = ShowBits(bs, pBook->l1); + int t = nResult + 2; + nResult = pBook->l1_items[-t][nIndex1]; + if (nResult == -1) + { + return -1; + } + } + ClearBits(bs, nResult >> DRA_S_BIT); + nResult = nResult & DRA_S_BIT_MASK; + return nResult; +} + +static int DRAHuffmanDecodeDiff(DRABitstream* bs, const DRAHuffmanCodebook* pBook, int nIndex) +{ + int nDiff = DRAHuffmanDecode(bs, pBook); + if (nDiff < 0) + { + return -1; + } + return (nIndex + nDiff) % pBook->size; +} + +static int DRAHuffmanDecodeRecursive(DRABitstream* bs, const DRAHuffmanCodebook* pBook) +{ + int k = -1; + int nIndex = -1; + do + { + k++; + nIndex = DRAHuffmanDecode(bs, pBook); + if (nIndex < 0) + { + return -1; + } + } while (nIndex == pBook->size - 1); + nIndex = k * (pBook->size - 1) + nIndex; + + return nIndex; +} + +///FreqBand + +typedef struct DRAFreqBand +{ + int num; + double width; +}DRAFreqBand; + +typedef struct DRAFreqBandTable +{ + int num; + const DRAFreqBand* table; +}DRAFreqBandTable; + + +typedef struct DRAFreqBandEdgeTable +{ + int num; + const unsigned short* table; +}DRAFreqBandEdgeTable; + + +//8000 +static const unsigned short g_stDRAFreqBandLEdge00[] = +{ + 0, 26, 53, 80, 108, 138, 170, 204, 241, 282, 328, 381, 443, 517, 606, 715, 848, 1010, 1024 +}; +//11025 +static const unsigned short g_stDRAFreqBandLEdge01[] = +{ + 0, 19, 39, 59, 80, 102, 125, 150, 177, 207, 241, 280, 326, 380, 446, 526, 625, 745, 888, 1024 +}; +//12000 +static const unsigned short g_stDRAFreqBandLEdge02[] = +{ + 0, 18, 36, 54, 73, 93, 114, 137, 162, 190, 221, 257, 299, 349, 409, 483, 574, 684, 815, 968, 1024 +}; +//16000 +static const unsigned short g_stDRAFreqBandLEdge03[] = +{ + 0, 13, 27, 41, 55, 70, 86, 103, 122, 143, 167, 194, 226, 264, 310, 366, 435, 519, 618, 734, 870, 1024 +}; +//22050 +static const unsigned short g_stDRAFreqBandLEdge04[] = +{ + 0, 10, 20, 30, 41, 52, 64, 77, 91, 107, 125, 146, 170, 199, 234, 277, 330, 394, 469, 557, 661, 790, 968, 1024 +}; +//24000 +static const unsigned short g_stDRAFreqBandLEdge05[] = +{ + 0, 9, 18, 27, 37, 47, 58, 70, 83, 97, 113, 132, 154, 180, 212, 251, 299, 357, 425, 505, 599, 716, 875, 1024 +}; +//32000 +static const unsigned short g_stDRAFreqBandLEdge06[] = +{ + 0, 7, 14, 21, 28, 36, 44, 53, 63, 74, 86, 100, 117, 137, 161, 191, 227, 271, 323, 384, 456, 545, 668, 868, 1024 +}; +//441000 +static const unsigned short g_stDRAFreqBandLEdge07[] = +{ + 0, 5, 10, 15, 21, 27, 33, 40, 47, 55, 64, 75, 88, 103, 122, 145, 173, 207, 247, 293, 348, 418, 519, 695, 1024 +}; +//48000 +static const unsigned short g_stDRAFreqBandLEdge08[] = +{ + 0, 5, 10, 15, 20, 25, 31, 37, 44, 52, 61, 71, 83, 98, 116, 138, 165, 197, 235, 279, 332, 401, 503, 692, 1024 +}; +//88200 +static const unsigned short g_stDRAFreqBandLEdge09[] = +{ + 0, 4, 8, 12, 16, 20, 24, 28, 33, 39, 46, 54, 64, 76, 91, 109, 130, 155, 185, 224, 283, 397, 799, 1024 +}; +//96000 +static const unsigned short g_stDRAFreqBandLEdge10[] = +{ + 0, 4, 8, 12, 16, 20, 24, 28, 33, 39, 46, 55, 66, 79, 95, 113, 134, 160, 193, 240, 323, 546, 1024 +}; +//176400 +static const unsigned short g_stDRAFreqBandLEdge11[] = +{ + 0, 4, 8, 12, 16, 20, 24, 29, 35, 42, 51, 61, 73, 87, 105, 130, 174, 288, 1024 +}; +//192000 +static const unsigned short g_stDRAFreqBandLEdge12[] = +{ + 0, 4, 8, 12, 16, 20, 24, 29, 35, 42, 51, 61, 73, 87, 106, 136, 197, 465, 1024 +}; + +DRAFreqBandEdgeTable g_stDRAFreqBandLEdgeTable[] = +{ + {19, g_stDRAFreqBandLEdge00}, + {20, g_stDRAFreqBandLEdge01}, + {21, g_stDRAFreqBandLEdge02}, + {22, g_stDRAFreqBandLEdge03}, + {24, g_stDRAFreqBandLEdge04}, + {24, g_stDRAFreqBandLEdge05}, + {25, g_stDRAFreqBandLEdge06}, + {25, g_stDRAFreqBandLEdge07}, + {25, g_stDRAFreqBandLEdge08}, + {24, g_stDRAFreqBandLEdge09}, + {23, g_stDRAFreqBandLEdge10}, + {19, g_stDRAFreqBandLEdge11}, + {19, g_stDRAFreqBandLEdge12} +}; + + + + + + + + + +//8000 +static const unsigned short g_stDRAFreqBandSEdge00[] = +{ + 0,4,8,12,16,20,25,30,36,42,49,57,67,79,94,112,128 +}; +//11025 +static const unsigned short g_stDRAFreqBandSEdge01[] = +{ + 0,4,8,12,16,20,24,28,33,39,46,54,64,76,91,109,128 +}; +//12000 +static const unsigned short g_stDRAFreqBandSEdge02[] = +{ + 0,4,8,12,16,20,24,28,33,39,46,55,66,79,95,113,128 +}; +//16000 +static const unsigned short g_stDRAFreqBandSEdge03[] = +{ + 0,4,8,12,16,20,24,28,33,39,47,56,67,80,95,113,128 +}; +//22050 +static const unsigned short g_stDRAFreqBandSEdge04[] = +{ + 0,4,8,12,16,20,24,29,35,42,51,61,73,87,105,128 +}; +//24000 +static const unsigned short g_stDRAFreqBandSEdge05[] = +{ + 0,4,8,12,16,20,24,29,35,42,51,61,73,87,106,128 +}; +//32000 +static const unsigned short g_stDRAFreqBandSEdge06[] = +{ + 0,4,8,12,16,20,24,29,35,42,50,60,73,91,123,128 +}; +//44100 +static const unsigned short g_stDRAFreqBandSEdge07[] = +{ + 0,4,8,12,16,20,24,29,35,42,51,63,84,128 +}; +//48000 +static const unsigned short g_stDRAFreqBandSEdge08[] = +{ + 0,4,8,12,16,20,24,29,35,42,51,65,92,128 +}; +//88200 +static const unsigned short g_stDRAFreqBandSEdge09[] = +{ + 0,4,8,12,16,20,24,30,39,59,128 +}; +//96000 +static const unsigned short g_stDRAFreqBandSEdge10[] = +{ + 0,4,8,12,16,20,25,32,45,89,128 +}; +//176400 +static const unsigned short g_stDRAFreqBandSEdge11[] = +{ + 0,4,8,12,16,22,37,128 +}; +//192000 +static const unsigned short g_stDRAFreqBandSEdge12[] = +{ + 0,4,8,12,16,23,47,128 +}; + +DRAFreqBandEdgeTable g_stDRAFreqBandSEdgeTable[] = +{ + {17, g_stDRAFreqBandSEdge00}, + {17, g_stDRAFreqBandSEdge01}, + {17, g_stDRAFreqBandSEdge02}, + {17, g_stDRAFreqBandSEdge03}, + {16, g_stDRAFreqBandSEdge04}, + {16, g_stDRAFreqBandSEdge05}, + {16, g_stDRAFreqBandSEdge06}, + {14, g_stDRAFreqBandSEdge07}, + {14, g_stDRAFreqBandSEdge08}, + {11, g_stDRAFreqBandSEdge09}, + {11, g_stDRAFreqBandSEdge10}, + {8, g_stDRAFreqBandSEdge11}, + {8, g_stDRAFreqBandSEdge12} +}; + +///QStep + +float g_fQStepTable[] = +{ + 1.1920928955078100E-07F, + 1.1920928955078100E-07F, + 1.1920928955078100E-07F, + 2.3841857910156200E-07F, + 2.3841857910156200E-07F, + 2.3841857910156200E-07F, + 2.3841857910156200E-07F, + 3.5762786865234300E-07F, + 3.5762786865234300E-07F, + 3.5762786865234300E-07F, + 4.7683715820312500E-07F, + 5.9604644775390600E-07F, + 8.9604644775390600E-07F, + 7.1525573730468700E-07F, + 8.3446502685546800E-07F, + 9.5367431640625000E-07F, + 1.0728836059570300E-06F, + 1.3113021850585900E-06F, + 1.4305114746093700E-06F, + 1.6689300537109300E-06F, + 1.9073486328125000E-06F, + 2.1457872119140600E-06F, + 2.5033950806664000E-06F, + 2.8610229492187500E-06F, + 3.3378601074218700E-06F, + 3.8146972656250000E-06F, + 4.4107437133789000E-06F, + 5.0067901811328100E-06F, + 5.8412551879882800E-06F, + 6.6757202148437500E-06F, + 7.6293945312500000E-06F, + 8.8214874267578100E-06F, + 1.0013580322265600E-05F, + 1.1563301086425700E-05F, + 1.3232231140136700E-05F, + 1.5258789062500000E-05F, + 1.7523765563964800E-05F, + 2.0146369934082000E-05F, + 2.3126602172851500E-05F, + 2.6583671569824200E-05F, + 3.0517578125000000E-05F, + 3.5047531127929600E-05F, + 4.0292739868164000E-05F, + 4.6253204345703100E-05F, + 5.3167343139648400E-05F, + 6.1035156250000000E-05F, + 7.0095062255859300E-05F, + 8.0585479736328100E-05F, + 9.2506408691406200E-05F, + 1.0621547698974600E-04F, + 1.2207031250000000E-04F, + 1.4019012451171800E-04F, + 1.6105175018310500E-04F, + 1.8501281738281200E-04F, + 2.1255016326904200E-04F, + 2.4414062500000000E-04F, + 2.8049945831298800E-04F, + 3.2210350036621000E-04F, + 3.7002563476562500E-04F, + 4.2510032653808500E-04F, + 4.8828125000000000E-04F, + 5.6087970733642500E-04F, + 6.4432621002197200E-04F, + 7.4005126953125000E-04F, + 8.5020065307617100E-04F, + 9.7656250000000000E-04F, + 1.1217594146728500E-03F, + 1.2885332107543900E-03F, + 1.4802217483520500E-03F, + 1.7002820968627900E-03F, + 1.9531250000000000E-03F, + 2.2435188293457000E-03F, + 2.5771856307983300E-03F, + 2.9604434967041000E-03F, + 3.4005641937255800E-03F, + 3.9062500000000000E-03F, + 4.4871568679809500E-03F, + 5.1543712615966700E-03F, + 5.9207677841186500E-03F, + 6.8011283874511700E-03F, + 7.8125000000000000E-03F, + 8.9741945266723600E-03F, + 1.0308623313903800E-02F, + 1.1841535568237300E-02F, + 1.3602375984191800E-02F, + 1.5625000000000000E-02F, + 1.7948389053344700E-02F, + 2.0617365837097100E-02F, + 2.3683071136474600E-02F, + 2.7204751968383700E-02F, + 3.1250000000000000E-02F, + 3.5896778106689400E-02F, + 4.1234612464904700E-02F, + 4.7366142272949200E-02F, + 5.4409384727478000E-02F, + 6.2500000000000000E-02F, + 7.1793675422668400E-02F, + 8.2469224929809500E-02F, + 9.4732284545898400E-02F, + 1.0881876945495600E-01F, + 1.2500000000000000E-01F, + 1.4358735084533600E-01F, + 1.6493844985961900E-01F, + 1.8946456909179600E-01F, + 2.1763765811920100E-01F, + 2.5000000000000000E-01F, + 2.8717458248138400E-01F, + 3.2987701892852700E-01F, + 3.7892913818359300E-01F, + 4.3527531623840300E-01F, + 5.0000000000000000E-01F, + 5.7434916496276800E-01F, + 6.5975391864776600E-01F, + 7.5785827636718700E-01F, + 8.7055051326751700E-01F, + 9.9999988079071000E-01F +}; + + +float g_fQStepTableJic[] = +{ + 0.0003700962F, + 0.0003700962F, + 0.0003700962F, + 0.0007401925F, + 0.0007401925F, + 0.0007401925F, + 0.0007401925F, + 0.0011102887F, + 0.0011102887F, + 0.0011102887F, + 0.0014803849F, + 0.0018504811F, + 0.0027818588F, + 0.0022205774F, + 0.0025906736F, + 0.0029607698F, + 0.0033308660F, + 0.0040710585F, + 0.0044411547F, + 0.0051813472F, + 0.0059215396F, + 0.0066617942F, + 0.0077720207F, + 0.0088823094F, + 0.0103626943F, + 0.0118430792F, + 0.0136935603F, + 0.0155440415F, + 0.0181347150F, + 0.0207253886F, + 0.0236861584F, + 0.0273871207F, + 0.0310880829F, + 0.0358993338F, + 0.0410806810F, + 0.0473723168F, + 0.0544041451F, + 0.0625462620F, + 0.0717986677F, + 0.0825314582F, + 0.0947446336F, + 0.1088082902F, + 0.1250925241F, + 0.1435973353F, + 0.1650629164F, + 0.1894892672F, + 0.2176165803F, + 0.2501850481F, + 0.2871946706F, + 0.3297557365F, + 0.3789785344F, + 0.4352331606F, + 0.5000000000F, + 0.5743893412F, + 0.6598815692F, + 0.7579570688F, + 0.8708364175F, + 1.0000000000F, + 1.1487786825F, + 1.3197631384F, + 1.5159141377F, + 1.7413027387F, + 2.0003700962F, + 2.2975573649F, + 2.6395262768F, + 3.0318282754F, + 3.4826054774F, + 4.0003700962F, + 4.5954848261F, + 5.2786824574F, + 6.0636565507F, + 6.9652109548F, + 8.0011102887F, + 9.1909696521F, + 10.5573649149F, + 12.1273131014F, + 13.9307920059F, + 16.0022205774F, + 18.3815692080F, + 21.1147298298F, + 24.2546262028F, + 27.8612139156F, + 32.0040710585F, + 36.7631384160F, + 42.2298297557F, + 48.5092524056F, + 55.7224278312F, + 64.0085122132F, + 73.5262768320F, + 84.4596595115F, + 97.0185048113F, + 111.4448556625F, + 128.0166543301F, + 147.0525536640F, + 168.9189489267F, + 194.0370096225F, + 222.8900814212F, + 256.0333086603F, + 294.1051073279F, + 337.8378978534F, + 388.0740192450F, + 445.7801628423F, + 512.0666173205F, + 588.2102146558F, + 675.6761658031F, + 776.1480384900F, + 891.5599555885F, + 1024.1336047372F, + 1176.4204293116F, + 1351.3523316062F, + 1552.2960769800F, + 1783.1199111769F, + 2048.2668393782F, + 2352.8408586232F, + 2702.7042931162F, + 3104.5917838638F +}; + +///WinTables + +static float g_fWinCoeffesLongLong2Long[2048] = +{ + 35.5430603027f, 106.6290893555f, 177.7148895264f, 248.8002624512f, + 319.8850097656f, 390.9691162109f, 462.0521850586f, 533.1341552734f, + 604.2149658203f, 675.2943115234f, 746.3720703125f, 817.4480590820f, + 888.5220947266f, 959.5941162109f, 1030.6638183594f, 1101.7310791016f, + 1172.7958984375f, 1243.8579101563f, 1314.9168701172f, 1385.9727783203f, + 1457.0253906250f, 1528.0747070313f, 1599.1203613281f, 1670.1622314453f, + 1741.2001953125f, 1812.2340087891f, 1883.2635498047f, 1954.2888183594f, + 2025.3093261719f, 2096.3251953125f, 2167.3361816406f, 2238.3417968750f, + 2309.3422851563f, 2380.3371582031f, 2451.3269042969f, 2522.3105468750f, + 2593.2880859375f, 2664.2597656250f, 2735.2250976563f, 2806.1840820313f, + 2877.1364746094f, 2948.0820312500f, 3019.0207519531f, 3089.9523925781f, + 3160.8764648438f, 3231.7934570313f, 3302.7026367188f, 3373.6042480469f, + 3444.4975585938f, 3515.3825683594f, 3586.2600097656f, 3657.1286621094f, + 3727.9890136719f, 3798.8403320313f, 3869.6826171875f, 3940.5158691406f, + 4011.3395996094f, 4082.1542968750f, 4152.9594726563f, 4223.7543945313f, + 4294.5395507813f, 4365.3144531250f, 4436.0800781250f, 4506.8339843750f, + 4577.5781250000f, 4648.3110351563f, 4719.0332031250f, 4789.7441406250f, + 4860.4438476563f, 4931.1323242188f, 5001.8085937500f, 5072.4741210938f, + 5143.1269531250f, 5213.7680664063f, 5284.3964843750f, 5355.0122070313f, + 5425.6162109375f, 5496.2070312500f, 5566.7851562500f, 5637.3496093750f, + 5707.9008789063f, 5778.4389648438f, 5848.9633789063f, 5919.4746093750f, + 5989.9716796875f, 6060.4541015625f, 6130.9223632813f, 6201.3769531250f, + 6271.8154296875f, 6342.2402343750f, 6412.6503906250f, 6483.0449218750f, + 6553.4243164063f, 6623.7880859375f, 6694.1372070313f, 6764.4692382813f, + 6834.7856445313f, 6905.0869140625f, 6975.3715820313f, 7045.6386718750f, + 7115.8901367188f, 7186.1250000000f, 7256.3427734375f, 7326.5429687500f, + 7396.7270507813f, 7466.8935546875f, 7537.0415039063f, 7607.1718750000f, + 7677.2851562500f, 7747.3793945313f, 7817.4560546875f, 7887.5141601563f, + 7957.5537109375f, 8027.5747070313f, 8097.5766601563f, 8167.5595703125f, + 8237.5234375000f, 8307.4677734375f, 8377.3925781250f, 8447.2968750000f, + 8517.1826171875f, 8587.0478515625f, 8656.8925781250f, 8726.7167968750f, + 8796.5205078125f, 8866.3046875000f, 8936.0664062500f, 9005.8076171875f, + 9075.5283203125f, 9145.2275390625f, 9214.9042968750f, 9284.5605468750f, + 9354.1943359375f, 9423.8056640625f, 9493.3955078125f, 9562.9628906250f, + 9632.5078125000f, 9702.0292968750f, 9771.5292968750f, 9841.0058593750f, + 9910.4580078125f, 9979.8876953125f, 10049.2949218750f, 10118.6777343750f, + 10188.0361328125f, 10257.3710937500f, 10326.6816406250f, 10395.9677734375f, + 10465.2304687500f, 10534.4677734375f, 10603.6796875000f, 10672.8681640625f, + 10742.0302734375f, 10811.1679687500f, 10880.2792968750f, 10949.3662109375f, + 11018.4267578125f, 11087.4599609375f, 11156.4687500000f, 11225.4511718750f, + 11294.4072265625f, 11363.3359375000f, 11432.2382812500f, 11501.1132812500f, + 11569.9628906250f, 11638.7841796875f, 11707.5781250000f, 11776.3437500000f, + 11845.0839843750f, 11913.7949218750f, 11982.4755859375f, 12051.1308593750f, + 12119.7558593750f, 12188.3554687500f, 12256.9238281250f, 12325.4638671875f, + 12393.9736328125f, 12462.4560546875f, 12530.9082031250f, 12599.3320312500f, + 12667.7255859375f, 12736.0898437500f, 12804.4228515625f, 12872.7255859375f, + 12941.0000000000f, 13009.2421875000f, 13077.4550781250f, 13145.6367187500f, + 13213.7871093750f, 13281.9072265625f, 13349.9931640625f, 13418.0507812500f, + 13486.0751953125f, 13554.0693359375f, 13622.0322265625f, 13689.9609375000f, + 13757.8583984375f, 13825.7226562500f, 13893.5556640625f, 13961.3544921875f, + 14029.1230468750f, 14096.8554687500f, 14164.5566406250f, 14232.2236328125f, + 14299.8574218750f, 14367.4580078125f, 14435.0244140625f, 14502.5566406250f, + 14570.0546875000f, 14637.5185546875f, 14704.9492187500f, 14772.3427734375f, + 14839.7031250000f, 14907.0283203125f, 14974.3183593750f, 15041.5742187500f, + 15108.7949218750f, 15175.9775390625f, 15243.1250000000f, 15310.2382812500f, + 15377.3144531250f, 15444.3554687500f, 15511.3593750000f, 15578.3261718750f, + 15645.2578125000f, 15712.1503906250f, 15779.0078125000f, 15845.8281250000f, + 15912.6103515625f, 15979.3544921875f, 16046.0634765625f, 16112.7324218750f, + 16179.3642578125f, 16245.9580078125f, 16312.5126953125f, 16379.0302734375f, + 16445.5097656250f, 16511.9492187500f, 16578.3496093750f, 16644.7128906250f, + 16711.0351562500f, 16777.3183593750f, 16843.5625000000f, 16909.7656250000f, + 16975.9316406250f, 17042.0566406250f, 17108.1406250000f, 17174.1835937500f, + 17240.1875000000f, 17306.1523437500f, 17372.0742187500f, 17437.9570312500f, + 17503.7968750000f, 17569.5957031250f, 17635.3554687500f, 17701.0722656250f, + 17766.7460937500f, 17832.3789062500f, 17897.9707031250f, 17963.5195312500f, + 18029.0273437500f, 18094.4902343750f, 18159.9140625000f, 18225.2910156250f, + 18290.6289062500f, 18355.9218750000f, 18421.1718750000f, 18486.3789062500f, + 18551.5410156250f, 18616.6621093750f, 18681.7382812500f, 18746.7695312500f, + 18811.7558593750f, 18876.6992187500f, 18941.5976562500f, 19006.4531250000f, + 19071.2617187500f, 19136.0273437500f, 19200.7460937500f, 19265.4218750000f, + 19330.0488281250f, 19394.6328125000f, 19459.1718750000f, 19523.6640625000f, + 19588.1113281250f, 19652.5117187500f, 19716.8652343750f, 19781.1718750000f, + 19845.4335937500f, 19909.6484375000f, 19973.8164062500f, 20037.9355468750f, + 20102.0097656250f, 20166.0351562500f, 20230.0136718750f, 20293.9453125000f, + 20357.8281250000f, 20421.6640625000f, 20485.4511718750f, 20549.1914062500f, + 20612.8828125000f, 20676.5234375000f, 20740.1171875000f, 20803.6621093750f, + 20867.1582031250f, 20930.6054687500f, 20994.0019531250f, 21057.3515625000f, + 21120.6484375000f, 21183.8984375000f, 21247.0976562500f, 21310.2460937500f, + 21373.3457031250f, 21436.3925781250f, 21499.3925781250f, 21562.3378906250f, + 21625.2343750000f, 21688.0820312500f, 21750.8769531250f, 21813.6210937500f, + 21876.3125000000f, 21938.9550781250f, 22001.5429687500f, 22064.0800781250f, + 22126.5644531250f, 22189.0000000000f, 22251.3789062500f, 22313.7089843750f, + 22375.9843750000f, 22438.2089843750f, 22500.3808593750f, 22562.4980468750f, + 22624.5625000000f, 22686.5761718750f, 22748.5332031250f, 22810.4394531250f, + 22872.2890625000f, 22934.0878906250f, 22995.8320312500f, 23057.5175781250f, + 23119.1523437500f, 23180.7324218750f, 23242.2597656250f, 23303.7304687500f, + 23365.1464843750f, 23426.5117187500f, 23487.8164062500f, 23549.0664062500f, + 23610.2636718750f, 23671.4042968750f, 23732.4882812500f, 23793.5175781250f, + 23854.4902343750f, 23915.4023437500f, 23976.2636718750f, 24037.0703125000f, + 24097.8183593750f, 24158.5078125000f, 24219.1406250000f, 24279.7187500000f, + 24340.2363281250f, 24400.6992187500f, 24461.1054687500f, 24521.4511718750f, + 24581.7402343750f, 24641.9746093750f, 24702.1484375000f, 24762.2597656250f, + 24822.3183593750f, 24882.3164062500f, 24942.2578125000f, 25002.1406250000f, + 25061.9628906250f, 25121.7265625000f, 25181.4316406250f, 25241.0800781250f, + 25300.6640625000f, 25360.1914062500f, 25419.6562500000f, 25479.0644531250f, + 25538.4121093750f, 25597.6992187500f, 25656.9238281250f, 25716.0917968750f, + 25775.1972656250f, 25834.2421875000f, 25893.2285156250f, 25952.1523437500f, + 26011.0136718750f, 26069.8164062500f, 26128.5566406250f, 26187.2343750000f, + 26245.8496093750f, 26304.4082031250f, 26362.8984375000f, 26421.3281250000f, + 26479.6992187500f, 26538.0039062500f, 26596.2500000000f, 26654.4316406250f, + 26712.5488281250f, 26770.6074218750f, 26828.5996093750f, 26886.5312500000f, + 26944.3964843750f, 27002.2011718750f, 27059.9394531250f, 27117.6171875000f, + 27175.2265625000f, 27232.7753906250f, 27290.2578125000f, 27347.6796875000f, + 27405.0351562500f, 27462.3261718750f, 27519.5546875000f, 27576.7167968750f, + 27633.8125000000f, 27690.8457031250f, 27747.8105468750f, 27804.7148437500f, + 27861.5488281250f, 27918.3203125000f, 27975.0214843750f, 28031.6621093750f, + 28088.2343750000f, 28144.7421875000f, 28201.1835937500f, 28257.5585937500f, + 28313.8652343750f, 28370.1074218750f, 28426.2812500000f, 28482.3886718750f, + 28538.4277343750f, 28594.4042968750f, 28650.3085937500f, 28706.1484375000f, + 28761.9160156250f, 28817.6191406250f, 28873.2539062500f, 28928.8242187500f, + 28984.3222656250f, 29039.7539062500f, 29095.1171875000f, 29150.4121093750f, + 29205.6386718750f, 29260.7968750000f, 29315.8847656250f, 29370.9023437500f, + 29425.8554687500f, 29480.7363281250f, 29535.5468750000f, 29590.2890625000f, + 29644.9628906250f, 29699.5644531250f, 29754.0976562500f, 29808.5605468750f, + 29862.9531250000f, 29917.2753906250f, 29971.5273437500f, 30025.7089843750f, + 30079.8222656250f, 30133.8613281250f, 30187.8300781250f, 30241.7304687500f, + 30295.5527343750f, 30349.3105468750f, 30402.9941406250f, 30456.6074218750f, + 30510.1484375000f, 30563.6191406250f, 30617.0156250000f, 30670.3417968750f, + 30723.5957031250f, 30776.7753906250f, 30829.8847656250f, 30882.9218750000f, + 30935.8828125000f, 30988.7714843750f, 31041.5898437500f, 31094.3359375000f, + 31147.0058593750f, 31199.6035156250f, 31252.1269531250f, 31304.5800781250f, + 31356.9589843750f, 31409.2636718750f, 31461.4921875000f, 31513.6464843750f, + 31565.7304687500f, 31617.7382812500f, 31669.6679687500f, 31721.5253906250f, + 31773.3105468750f, 31825.0195312500f, 31876.6523437500f, 31928.2128906250f, + 31979.6972656250f, 32031.1054687500f, 32082.4394531250f, 32133.6972656250f, + 32184.8789062500f, 32235.9863281250f, 32287.0175781250f, 32337.9707031250f, + 32388.8496093750f, 32439.6503906250f, 32490.3769531250f, 32541.0253906250f, + 32591.5976562500f, 32642.0957031250f, 32692.5156250000f, 32742.8574218750f, + 32793.1250000000f, 32843.3125000000f, 32893.4218750000f, 32943.4570312500f, + 32993.4140625000f, 33043.2929687500f, 33093.0898437500f, 33142.8125000000f, + 33192.4609375000f, 33242.0273437500f, 33291.5156250000f, 33340.9257812500f, + 33390.2539062500f, 33439.5117187500f, 33488.6835937500f, 33537.7812500000f, + 33586.7968750000f, 33635.7343750000f, 33684.5937500000f, 33733.3750000000f, + 33782.0742187500f, 33830.6914062500f, 33879.2343750000f, 33927.6914062500f, + 33976.0742187500f, 34024.3750000000f, 34072.5976562500f, 34120.7382812500f, + 34168.8007812500f, 34216.7812500000f, 34264.6796875000f, 34312.5000000000f, + 34360.2421875000f, 34407.8945312500f, 34455.4726562500f, 34502.9687500000f, + 34550.3828125000f, 34597.7148437500f, 34644.9687500000f, 34692.1367187500f, + 34739.2265625000f, 34786.2343750000f, 34833.1601562500f, 34880.0039062500f, + 34926.7617187500f, 34973.4414062500f, 35020.0390625000f, 35066.5507812500f, + 35112.9843750000f, 35159.3320312500f, 35205.5976562500f, 35251.7812500000f, + 35297.8789062500f, 35343.8984375000f, 35389.8320312500f, 35435.6835937500f, + 35481.4531250000f, 35527.1367187500f, 35572.7343750000f, 35618.2539062500f, + 35663.6875000000f, 35709.0351562500f, 35754.2968750000f, 35799.4804687500f, + 35844.5781250000f, 35889.5898437500f, 35934.5156250000f, 35979.3593750000f, + 36024.1171875000f, 36068.7929687500f, 36113.3828125000f, 36157.8867187500f, + 36202.3046875000f, 36246.6367187500f, 36290.8867187500f, 36335.0468750000f, + 36379.1250000000f, 36423.1171875000f, 36467.0234375000f, 36510.8437500000f, + 36554.5781250000f, 36598.2265625000f, 36641.7890625000f, 36685.2656250000f, + 36728.6562500000f, 36771.9570312500f, 36815.1757812500f, 36858.3046875000f, + 36901.3515625000f, 36944.3085937500f, 36987.1757812500f, 37029.9570312500f, + 37072.6523437500f, 37115.2617187500f, 37157.7812500000f, 37200.2148437500f, + 37242.5625000000f, 37284.8203125000f, 37326.9921875000f, 37369.0742187500f, + 37411.0703125000f, 37452.9765625000f, 37494.7968750000f, 37536.5234375000f, + 37578.1640625000f, 37619.7226562500f, 37661.1875000000f, 37702.5625000000f, + 37743.8476562500f, 37785.0468750000f, 37826.1601562500f, 37867.1796875000f, + 37908.1132812500f, 37948.9531250000f, 37989.7070312500f, 38030.3750000000f, + 38070.9453125000f, 38111.4335937500f, 38151.8281250000f, 38192.1328125000f, + 38232.3476562500f, 38272.4726562500f, 38312.5078125000f, 38352.4531250000f, + 38392.3085937500f, 38432.0742187500f, 38471.7500000000f, 38511.3320312500f, + 38550.8281250000f, 38590.2304687500f, 38629.5429687500f, 38668.7617187500f, + 38707.8906250000f, 38746.9335937500f, 38785.8789062500f, 38824.7343750000f, + 38863.5000000000f, 38902.1757812500f, 38940.7578125000f, 38979.2460937500f, + 39017.6445312500f, 39055.9531250000f, 39094.1640625000f, 39132.2890625000f, + 39170.3203125000f, 39208.2578125000f, 39246.1054687500f, 39283.8593750000f, + 39321.5234375000f, 39359.0898437500f, 39396.5664062500f, 39433.9531250000f, + 39471.2421875000f, 39508.4414062500f, 39545.5468750000f, 39582.5585937500f, + 39619.4765625000f, 39656.3046875000f, 39693.0351562500f, 39729.6757812500f, + 39766.2226562500f, 39802.6718750000f, 39839.0312500000f, 39875.2929687500f, + 39911.4687500000f, 39947.5429687500f, 39983.5234375000f, 40019.4101562500f, + 40055.2070312500f, 40090.9062500000f, 40126.5156250000f, 40162.0273437500f, + 40197.4414062500f, 40232.7656250000f, 40267.9921875000f, 40303.1289062500f, + 40338.1640625000f, 40373.1093750000f, 40407.9570312500f, 40442.7109375000f, + 40477.3671875000f, 40511.9296875000f, 40546.3984375000f, 40580.7734375000f, + 40615.0468750000f, 40649.2304687500f, 40683.3125000000f, 40717.3046875000f, + 40751.1992187500f, 40784.9960937500f, 40818.6953125000f, 40852.3046875000f, + 40885.8125000000f, 40919.2265625000f, 40952.5429687500f, 40985.7617187500f, + 41018.8867187500f, 41051.9140625000f, 41084.8476562500f, 41117.6796875000f, + 41150.4179687500f, 41183.0625000000f, 41215.6054687500f, 41248.0507812500f, + 41280.4023437500f, 41312.6562500000f, 41344.8125000000f, 41376.8671875000f, + 41408.8281250000f, 41440.6953125000f, 41472.4609375000f, 41504.1289062500f, + 41535.6992187500f, 41567.1757812500f, 41598.5507812500f, 41629.8281250000f, + 41661.0078125000f, 41692.0898437500f, 41723.0742187500f, 41753.9570312500f, + 41784.7460937500f, 41815.4296875000f, 41846.0195312500f, 41876.5117187500f, + 41906.9062500000f, 41937.2031250000f, 41967.3984375000f, 41997.4921875000f, + 42027.4921875000f, 42057.3945312500f, 42087.1953125000f, 42116.8945312500f, + 42146.4960937500f, 42176.0000000000f, 42205.4062500000f, 42234.7070312500f, + 42263.9140625000f, 42293.0195312500f, 42322.0234375000f, 42350.9335937500f, + 42379.7382812500f, 42408.4453125000f, 42437.0546875000f, 42465.5625000000f, + 42493.9726562500f, 42522.2773437500f, 42550.4882812500f, 42578.5937500000f, + 42606.6015625000f, 42634.5039062500f, 42662.3125000000f, 42690.0195312500f, + 42717.6250000000f, 42745.1328125000f, 42772.5351562500f, 42799.8398437500f, + 42827.0429687500f, 42854.1484375000f, 42881.1484375000f, 42908.0507812500f, + 42934.8476562500f, 42961.5468750000f, 42988.1484375000f, 43014.6445312500f, + 43041.0390625000f, 43067.3320312500f, 43093.5273437500f, 43119.6171875000f, + 43145.6093750000f, 43171.4960937500f, 43197.2812500000f, 43222.9687500000f, + 43248.5546875000f, 43274.0351562500f, 43299.4140625000f, 43324.6914062500f, + 43349.8671875000f, 43374.9414062500f, 43399.9140625000f, 43424.7812500000f, + 43449.5507812500f, 43474.2187500000f, 43498.7812500000f, 43523.2382812500f, + 43547.5976562500f, 43571.8554687500f, 43596.0078125000f, 43620.0585937500f, + 43644.0078125000f, 43667.8554687500f, 43691.5976562500f, 43715.2343750000f, + 43738.7734375000f, 43762.2070312500f, 43785.5390625000f, 43808.7656250000f, + 43831.8906250000f, 43854.9140625000f, 43877.8320312500f, 43900.6484375000f, + 43923.3593750000f, 43945.9687500000f, 43968.4726562500f, 43990.8789062500f, + 44013.1718750000f, 44035.3671875000f, 44057.4570312500f, 44079.4492187500f, + 44101.3320312500f, 44123.1132812500f, 44144.7851562500f, 44166.3593750000f, + 44187.8281250000f, 44209.1953125000f, 44230.4531250000f, 44251.6093750000f, + 44272.6601562500f, 44293.6093750000f, 44314.4531250000f, 44335.1953125000f, + 44355.8281250000f, 44376.3593750000f, 44396.7851562500f, 44417.1093750000f, + 44437.3281250000f, 44457.4375000000f, 44477.4453125000f, 44497.3515625000f, + 44517.1484375000f, 44536.8437500000f, 44556.4335937500f, 44575.9179687500f, + 44595.2968750000f, 44614.5703125000f, 44633.7382812500f, 44652.8046875000f, + 44671.7656250000f, 44690.6210937500f, 44709.3710937500f, 44728.0117187500f, + 44746.5507812500f, 44764.9843750000f, 44783.3125000000f, 44801.5351562500f, + 44819.6523437500f, 44837.6640625000f, 44855.5703125000f, 44873.3750000000f, + 44891.0664062500f, 44908.6562500000f, 44926.1406250000f, 44943.5195312500f, + 44960.7929687500f, 44977.9609375000f, 44995.0195312500f, 45011.9765625000f, + 45028.8242187500f, 45045.5664062500f, 45062.2031250000f, 45078.7343750000f, + 45095.1601562500f, 45111.4765625000f, 45127.6914062500f, 45143.7968750000f, + 45159.8007812500f, 45175.6914062500f, 45191.4804687500f, 45207.1601562500f, + 45222.7382812500f, 45238.2070312500f, 45253.5664062500f, 45268.8242187500f, + 45283.9726562500f, 45299.0156250000f, 45313.9531250000f, 45328.7812500000f, + 45343.5039062500f, 45358.1210937500f, 45372.6289062500f, 45387.0312500000f, + 45401.3281250000f, 45415.5195312500f, 45429.5976562500f, 45443.5742187500f, + 45457.4414062500f, 45471.2031250000f, 45484.8593750000f, 45498.4023437500f, + 45511.8437500000f, 45525.1757812500f, 45538.4023437500f, 45551.5234375000f, + 45564.5351562500f, 45577.4414062500f, 45590.2382812500f, 45602.9257812500f, + 45615.5078125000f, 45627.9843750000f, 45640.3515625000f, 45652.6093750000f, + 45664.7656250000f, 45676.8085937500f, 45688.7500000000f, 45700.5781250000f, + 45712.3007812500f, 45723.9179687500f, 45735.4257812500f, 45746.8242187500f, + 45758.1210937500f, 45769.3046875000f, 45780.3789062500f, 45791.3515625000f, + 45802.2109375000f, 45812.9687500000f, 45823.6132812500f, 45834.1484375000f, + 45844.5781250000f, 45854.9023437500f, 45865.1171875000f, 45875.2265625000f, + 45885.2226562500f, 45895.1132812500f, 45904.8945312500f, 45914.5703125000f, + 45924.1367187500f, 45933.5976562500f, 45942.9492187500f, 45952.1914062500f, + 45961.3242187500f, 45970.3515625000f, 45979.2695312500f, 45988.0820312500f, + 45996.7812500000f, 46005.3750000000f, 46013.8593750000f, 46022.2382812500f, + 46030.5039062500f, 46038.6679687500f, 46046.7187500000f, 46054.6640625000f, + 46062.5000000000f, 46070.2226562500f, 46077.8437500000f, 46085.3515625000f, + 46092.7539062500f, 46100.0468750000f, 46107.2304687500f, 46114.3085937500f, + 46121.2734375000f, 46128.1367187500f, 46134.8867187500f, 46141.5273437500f, + 46148.0625000000f, 46154.4843750000f, 46160.8007812500f, 46167.0078125000f, + 46173.1093750000f, 46179.0976562500f, 46184.9804687500f, 46190.7539062500f, + 46196.4179687500f, 46201.9726562500f, 46207.4179687500f, 46212.7578125000f, + 46217.9882812500f, 46223.1093750000f, 46228.1210937500f, 46233.0234375000f, + 46237.8164062500f, 46242.5039062500f, 46247.0820312500f, 46251.5468750000f, + 46255.9062500000f, 46260.1562500000f, 46264.2968750000f, 46268.3281250000f, + 46272.2539062500f, 46276.0703125000f, 46279.7773437500f, 46283.3710937500f, + 46286.8593750000f, 46290.2382812500f, 46293.5078125000f, 46296.6679687500f, + 46299.7226562500f, 46302.6679687500f, 46305.5000000000f, 46308.2265625000f, + 46310.8437500000f, 46313.3515625000f, 46315.7460937500f, 46318.0390625000f, + 46320.2187500000f, 46322.2890625000f, 46324.2539062500f, 46326.1054687500f, + 46327.8515625000f, 46329.4882812500f, 46331.0156250000f, 46332.4296875000f, + 46333.7382812500f, 46334.9375000000f, 46336.0312500000f, 46337.0117187500f, + 46337.8828125000f, 46338.6445312500f, 46339.3007812500f, 46339.8437500000f, + 46340.2812500000f, 46340.6093750000f, 46340.8281250000f, 46340.9335937500f, + 46340.9335937500f, 46340.8281250000f, 46340.6093750000f, 46340.2812500000f, + 46339.8437500000f, 46339.3007812500f, 46338.6445312500f, 46337.8828125000f, + 46337.0117187500f, 46336.0312500000f, 46334.9375000000f, 46333.7382812500f, + 46332.4296875000f, 46331.0156250000f, 46329.4882812500f, 46327.8515625000f, + 46326.1054687500f, 46324.2539062500f, 46322.2890625000f, 46320.2187500000f, + 46318.0390625000f, 46315.7460937500f, 46313.3515625000f, 46310.8437500000f, + 46308.2265625000f, 46305.5000000000f, 46302.6679687500f, 46299.7226562500f, + 46296.6679687500f, 46293.5078125000f, 46290.2382812500f, 46286.8593750000f, + 46283.3710937500f, 46279.7734375000f, 46276.0703125000f, 46272.2539062500f, + 46268.3281250000f, 46264.2968750000f, 46260.1562500000f, 46255.9062500000f, + 46251.5468750000f, 46247.0820312500f, 46242.5039062500f, 46237.8164062500f, + 46233.0234375000f, 46228.1171875000f, 46223.1093750000f, 46217.9882812500f, + 46212.7578125000f, 46207.4179687500f, 46201.9726562500f, 46196.4179687500f, + 46190.7539062500f, 46184.9804687500f, 46179.0976562500f, 46173.1093750000f, + 46167.0078125000f, 46160.8007812500f, 46154.4843750000f, 46148.0625000000f, + 46141.5273437500f, 46134.8867187500f, 46128.1367187500f, 46121.2734375000f, + 46114.3085937500f, 46107.2304687500f, 46100.0468750000f, 46092.7539062500f, + 46085.3515625000f, 46077.8437500000f, 46070.2226562500f, 46062.4960937500f, + 46054.6640625000f, 46046.7187500000f, 46038.6679687500f, 46030.5039062500f, + 46022.2382812500f, 46013.8593750000f, 46005.3750000000f, 45996.7812500000f, + 45988.0781250000f, 45979.2695312500f, 45970.3515625000f, 45961.3242187500f, + 45952.1914062500f, 45942.9492187500f, 45933.5976562500f, 45924.1367187500f, + 45914.5703125000f, 45904.8945312500f, 45895.1132812500f, 45885.2226562500f, + 45875.2226562500f, 45865.1171875000f, 45854.9023437500f, 45844.5781250000f, + 45834.1484375000f, 45823.6132812500f, 45812.9648437500f, 45802.2109375000f, + 45791.3515625000f, 45780.3789062500f, 45769.3046875000f, 45758.1171875000f, + 45746.8242187500f, 45735.4257812500f, 45723.9140625000f, 45712.3007812500f, + 45700.5781250000f, 45688.7500000000f, 45676.8085937500f, 45664.7656250000f, + 45652.6093750000f, 45640.3515625000f, 45627.9804687500f, 45615.5078125000f, + 45602.9257812500f, 45590.2343750000f, 45577.4375000000f, 45564.5312500000f, + 45551.5234375000f, 45538.4023437500f, 45525.1757812500f, 45511.8437500000f, + 45498.4023437500f, 45484.8593750000f, 45471.2031250000f, 45457.4414062500f, + 45443.5742187500f, 45429.5976562500f, 45415.5156250000f, 45401.3242187500f, + 45387.0312500000f, 45372.6289062500f, 45358.1210937500f, 45343.5039062500f, + 45328.7812500000f, 45313.9531250000f, 45299.0117187500f, 45283.9726562500f, + 45268.8242187500f, 45253.5664062500f, 45238.2070312500f, 45222.7382812500f, + 45207.1601562500f, 45191.4804687500f, 45175.6914062500f, 45159.8007812500f, + 45143.7968750000f, 45127.6914062500f, 45111.4765625000f, 45095.1601562500f, + 45078.7343750000f, 45062.2031250000f, 45045.5664062500f, 45028.8242187500f, + 45011.9765625000f, 44995.0195312500f, 44977.9609375000f, 44960.7929687500f, + 44943.5195312500f, 44926.1406250000f, 44908.6562500000f, 44891.0664062500f, + 44873.3710937500f, 44855.5703125000f, 44837.6640625000f, 44819.6523437500f, + 44801.5351562500f, 44783.3125000000f, 44764.9843750000f, 44746.5507812500f, + 44728.0117187500f, 44709.3671875000f, 44690.6171875000f, 44671.7617187500f, + 44652.8046875000f, 44633.7382812500f, 44614.5703125000f, 44595.2929687500f, + 44575.9179687500f, 44556.4335937500f, 44536.8437500000f, 44517.1484375000f, + 44497.3515625000f, 44477.4453125000f, 44457.4375000000f, 44437.3242187500f, + 44417.1093750000f, 44396.7851562500f, 44376.3593750000f, 44355.8281250000f, + 44335.1914062500f, 44314.4531250000f, 44293.6093750000f, 44272.6601562500f, + 44251.6093750000f, 44230.4492187500f, 44209.1914062500f, 44187.8242187500f, + 44166.3593750000f, 44144.7851562500f, 44123.1093750000f, 44101.3281250000f, + 44079.4453125000f, 44057.4570312500f, 44035.3671875000f, 44013.1718750000f, + 43990.8750000000f, 43968.4726562500f, 43945.9687500000f, 43923.3593750000f, + 43900.6445312500f, 43877.8320312500f, 43854.9101562500f, 43831.8906250000f, + 43808.7656250000f, 43785.5390625000f, 43762.2070312500f, 43738.7695312500f, + 43715.2343750000f, 43691.5937500000f, 43667.8515625000f, 43644.0039062500f, + 43620.0585937500f, 43596.0078125000f, 43571.8515625000f, 43547.5976562500f, + 43523.2382812500f, 43498.7773437500f, 43474.2148437500f, 43449.5468750000f, + 43424.7812500000f, 43399.9140625000f, 43374.9414062500f, 43349.8671875000f, + 43324.6914062500f, 43299.4140625000f, 43274.0351562500f, 43248.5507812500f, + 43222.9687500000f, 43197.2812500000f, 43171.4960937500f, 43145.6054687500f, + 43119.6171875000f, 43093.5273437500f, 43067.3320312500f, 43041.0351562500f, + 43014.6406250000f, 42988.1445312500f, 42961.5468750000f, 42934.8476562500f, + 42908.0468750000f, 42881.1484375000f, 42854.1445312500f, 42827.0429687500f, + 42799.8398437500f, 42772.5351562500f, 42745.1289062500f, 42717.6250000000f, + 42690.0195312500f, 42662.3125000000f, 42634.5039062500f, 42606.5976562500f, + 42578.5898437500f, 42550.4843750000f, 42522.2773437500f, 42493.9687500000f, + 42465.5625000000f, 42437.0546875000f, 42408.4453125000f, 42379.7382812500f, + 42350.9296875000f, 42322.0234375000f, 42293.0156250000f, 42263.9140625000f, + 42234.7070312500f, 42205.4023437500f, 42176.0000000000f, 42146.4921875000f, + 42116.8945312500f, 42087.1953125000f, 42057.3945312500f, 42027.4921875000f, + 41997.4921875000f, 41967.3984375000f, 41937.2031250000f, 41906.9062500000f, + 41876.5117187500f, 41846.0195312500f, 41815.4296875000f, 41784.7421875000f, + 41753.9570312500f, 41723.0703125000f, 41692.0859375000f, 41661.0039062500f, + 41629.8242187500f, 41598.5468750000f, 41567.1718750000f, 41535.6992187500f, + 41504.1289062500f, 41472.4570312500f, 41440.6953125000f, 41408.8281250000f, + 41376.8671875000f, 41344.8085937500f, 41312.6562500000f, 41280.4023437500f, + 41248.0507812500f, 41215.6015625000f, 41183.0585937500f, 41150.4179687500f, + 41117.6796875000f, 41084.8437500000f, 41051.9140625000f, 41018.8867187500f, + 40985.7617187500f, 40952.5390625000f, 40919.2226562500f, 40885.8085937500f, + 40852.2968750000f, 40818.6953125000f, 40784.9921875000f, 40751.1914062500f, + 40717.2968750000f, 40683.3085937500f, 40649.2226562500f, 40615.0429687500f, + 40580.7656250000f, 40546.3945312500f, 40511.9257812500f, 40477.3632812500f, + 40442.7109375000f, 40407.9570312500f, 40373.1093750000f, 40338.1640625000f, + 40303.1289062500f, 40267.9921875000f, 40232.7656250000f, 40197.4414062500f, + 40162.0273437500f, 40126.5156250000f, 40090.9101562500f, 40055.2109375000f, + 40019.4140625000f, 39983.5234375000f, 39947.5429687500f, 39911.4648437500f, + 39875.2929687500f, 39839.0273437500f, 39802.6679687500f, 39766.2187500000f, + 39729.6718750000f, 39693.0312500000f, 39656.3007812500f, 39619.4726562500f, + 39582.5546875000f, 39545.5429687500f, 39508.4375000000f, 39471.2421875000f, + 39433.9492187500f, 39396.5625000000f, 39359.0859375000f, 39321.5195312500f, + 39283.8593750000f, 39246.1015625000f, 39208.2539062500f, 39170.3164062500f, + 39132.2851562500f, 39094.1640625000f, 39055.9492187500f, 39017.6406250000f, + 38979.2421875000f, 38940.7500000000f, 38902.1679687500f, 38863.4960937500f, + 38824.7304687500f, 38785.8750000000f, 38746.9257812500f, 38707.8906250000f, + 38668.7578125000f, 38629.5351562500f, 38590.2265625000f, 38550.8242187500f, + 38511.3281250000f, 38471.7460937500f, 38432.0703125000f, 38392.3125000000f, + 38352.4531250000f, 38312.5117187500f, 38272.4726562500f, 38232.3476562500f, + 38192.1328125000f, 38151.8281250000f, 38111.4296875000f, 38070.9453125000f, + 38030.3750000000f, 37989.7070312500f, 37948.9531250000f, 37908.1132812500f, + 37867.1796875000f, 37826.1562500000f, 37785.0468750000f, 37743.8476562500f, + 37702.5585937500f, 37661.1835937500f, 37619.7187500000f, 37578.1640625000f, + 37536.5234375000f, 37494.7929687500f, 37452.9726562500f, 37411.0664062500f, + 37369.0703125000f, 37326.9882812500f, 37284.8164062500f, 37242.5585937500f, + 37200.2148437500f, 37157.7812500000f, 37115.2578125000f, 37072.6484375000f, + 37029.9570312500f, 36987.1718750000f, 36944.3007812500f, 36901.3437500000f, + 36858.3007812500f, 36815.1718750000f, 36771.9531250000f, 36728.6484375000f, + 36685.2617187500f, 36641.7851562500f, 36598.2226562500f, 36554.5742187500f, + 36510.8398437500f, 36467.0195312500f, 36423.1132812500f, 36379.1210937500f, + 36335.0429687500f, 36290.8789062500f, 36246.6328125000f, 36202.2968750000f, + 36157.8789062500f, 36113.3750000000f, 36068.7851562500f, 36024.1171875000f, + 35979.3593750000f, 35934.5156250000f, 35889.5898437500f, 35844.5781250000f, + 35799.4804687500f, 35754.2968750000f, 35709.0351562500f, 35663.6835937500f, + 35618.2539062500f, 35572.7343750000f, 35527.1367187500f, 35481.4531250000f, + 35435.6835937500f, 35389.8320312500f, 35343.8984375000f, 35297.8789062500f, + 35251.7812500000f, 35205.5976562500f, 35159.3281250000f, 35112.9804687500f, + 35066.5507812500f, 35020.0351562500f, 34973.4414062500f, 34926.7617187500f, + 34880.0000000000f, 34833.1562500000f, 34786.2304687500f, 34739.2265625000f, + 34692.1367187500f, 34644.9648437500f, 34597.7109375000f, 34550.3789062500f, + 34502.9648437500f, 34455.4687500000f, 34407.8945312500f, 34360.2343750000f, + 34312.4960937500f, 34264.6757812500f, 34216.7734375000f, 34168.7968750000f, + 34120.7343750000f, 34072.5937500000f, 34024.3710937500f, 33976.0703125000f, + 33927.6914062500f, 33879.2265625000f, 33830.6875000000f, 33782.0664062500f, + 33733.3671875000f, 33684.5859375000f, 33635.7304687500f, 33586.7890625000f, + 33537.7734375000f, 33488.6796875000f, 33439.5117187500f, 33390.2578125000f, + 33340.9257812500f, 33291.5156250000f, 33242.0273437500f, 33192.4609375000f, + 33142.8164062500f, 33093.0898437500f, 33043.2890625000f, 32993.4101562500f, + 32943.4570312500f, 32893.4218750000f, 32843.3125000000f, 32793.1250000000f, + 32742.8574218750f, 32692.5156250000f, 32642.0957031250f, 32591.5976562500f, + 32541.0253906250f, 32490.3769531250f, 32439.6503906250f, 32388.8457031250f, + 32337.9667968750f, 32287.0136718750f, 32235.9843750000f, 32184.8769531250f, + 32133.6933593750f, 32082.4375000000f, 32031.1015625000f, 31979.6933593750f, + 31928.2109375000f, 31876.6484375000f, 31825.0175781250f, 31773.3066406250f, + 31721.5214843750f, 31669.6640625000f, 31617.7324218750f, 31565.7246093750f, + 31513.6406250000f, 31461.4863281250f, 31409.2578125000f, 31356.9531250000f, + 31304.5742187500f, 31252.1250000000f, 31199.5996093750f, 31147.0000000000f, + 31094.3300781250f, 31041.5839843750f, 30988.7656250000f, 30935.8769531250f, + 30882.9121093750f, 30829.8769531250f, 30776.7695312500f, 30723.5878906250f, + 30670.3339843750f, 30617.0078125000f, 30563.6191406250f, 30510.1484375000f, + 30456.6074218750f, 30402.9941406250f, 30349.3105468750f, 30295.5566406250f, + 30241.7265625000f, 30187.8300781250f, 30133.8613281250f, 30079.8183593750f, + 30025.7089843750f, 29971.5273437500f, 29917.2753906250f, 29862.9531250000f, + 29808.5585937500f, 29754.0976562500f, 29699.5644531250f, 29644.9589843750f, + 29590.2890625000f, 29535.5468750000f, 29480.7343750000f, 29425.8535156250f, + 29370.9003906250f, 29315.8808593750f, 29260.7929687500f, 29205.6367187500f, + 29150.4101562500f, 29095.1152343750f, 29039.7500000000f, 28984.3203125000f, + 28928.8203125000f, 28873.2519531250f, 28817.6171875000f, 28761.9140625000f, + 28706.1425781250f, 28650.3027343750f, 28594.3984375000f, 28538.4238281250f, + 28482.3828125000f, 28426.2753906250f, 28370.1015625000f, 28313.8593750000f, + 28257.5527343750f, 28201.1777343750f, 28144.7363281250f, 28088.2285156250f, + 28031.6562500000f, 27975.0156250000f, 27918.3125000000f, 27861.5429687500f, + 27804.7050781250f, 27747.8027343750f, 27690.8378906250f, 27633.8046875000f, + 27576.7089843750f, 27519.5546875000f, 27462.3281250000f, 27405.0351562500f, + 27347.6796875000f, 27290.2617187500f, 27232.7753906250f, 27175.2285156250f, + 27117.6171875000f, 27059.9394531250f, 27002.1972656250f, 26944.3945312500f, + 26886.5273437500f, 26828.5976562500f, 26770.6074218750f, 26712.5488281250f, + 26654.4316406250f, 26596.2500000000f, 26538.0039062500f, 26479.6992187500f, + 26421.3281250000f, 26362.8964843750f, 26304.4023437500f, 26245.8476562500f, + 26187.2304687500f, 26128.5527343750f, 26069.8105468750f, 26011.0117187500f, + 25952.1464843750f, 25893.2246093750f, 25834.2402343750f, 25775.1933593750f, + 25716.0898437500f, 25656.9218750000f, 25597.6933593750f, 25538.4062500000f, + 25479.0585937500f, 25419.6523437500f, 25360.1855468750f, 25300.6582031250f, + 25241.0703125000f, 25181.4257812500f, 25121.7226562500f, 25061.9570312500f, + 25002.1347656250f, 24942.2519531250f, 24882.3105468750f, 24822.3125000000f, + 24762.2539062500f, 24702.1406250000f, 24641.9667968750f, 24581.7324218750f, + 24521.4433593750f, 24461.0957031250f, 24400.6914062500f, 24340.2285156250f, + 24279.7187500000f, 24219.1406250000f, 24158.5078125000f, 24097.8183593750f, + 24037.0703125000f, 23976.2675781250f, 23915.4062500000f, 23854.4902343750f, + 23793.5156250000f, 23732.4863281250f, 23671.4023437500f, 23610.2617187500f, + 23549.0664062500f, 23487.8164062500f, 23426.5078125000f, 23365.1464843750f, + 23303.7304687500f, 23242.2597656250f, 23180.7324218750f, 23119.1523437500f, + 23057.5175781250f, 22995.8281250000f, 22934.0839843750f, 22872.2871093750f, + 22810.4355468750f, 22748.5312500000f, 22686.5722656250f, 22624.5605468750f, + 22562.4960937500f, 22500.3769531250f, 22438.2070312500f, 22375.9824218750f, + 22313.7050781250f, 22251.3769531250f, 22188.9960937500f, 22126.5605468750f, + 22064.0742187500f, 22001.5371093750f, 21938.9472656250f, 21876.3066406250f, + 21813.6132812500f, 21750.8710937500f, 21688.0742187500f, 21625.2285156250f, + 21562.3320312500f, 21499.3847656250f, 21436.3867187500f, 21373.3378906250f, + 21310.2382812500f, 21247.0898437500f, 21183.8906250000f, 21120.6406250000f, + 21057.3417968750f, 20993.9941406250f, 20930.5957031250f, 20867.1503906250f, + 20803.6640625000f, 20740.1191406250f, 20676.5234375000f, 20612.8828125000f, + 20549.1914062500f, 20485.4511718750f, 20421.6640625000f, 20357.8281250000f, + 20293.9453125000f, 20230.0136718750f, 20166.0351562500f, 20102.0097656250f, + 20037.9355468750f, 19973.8144531250f, 19909.6484375000f, 19845.4316406250f, + 19781.1718750000f, 19716.8632812500f, 19652.5097656250f, 19588.1093750000f, + 19523.6621093750f, 19459.1699218750f, 19394.6308593750f, 19330.0488281250f, + 19265.4179687500f, 19200.7441406250f, 19136.0234375000f, 19071.2578125000f, + 19006.4492187500f, 18941.5937500000f, 18876.6953125000f, 18811.7519531250f, + 18746.7636718750f, 18681.7324218750f, 18616.6562500000f, 18551.5351562500f, + 18486.3730468750f, 18421.1660156250f, 18355.9160156250f, 18290.6210937500f, + 18225.2851562500f, 18159.9062500000f, 18094.4843750000f, 18029.0195312500f, + 17963.5136718750f, 17897.9628906250f, 17832.3730468750f, 17766.7382812500f, + 17701.0625000000f, 17635.3457031250f, 17569.5878906250f, 17503.7890625000f, + 17437.9472656250f, 17372.0664062500f, 17306.1425781250f, 17240.1894531250f, + 17174.1855468750f, 17108.1425781250f, 17042.0566406250f, 16975.9316406250f, + 16909.7656250000f, 16843.5625000000f, 16777.3183593750f, 16711.0351562500f, + 16644.7128906250f, 16578.3496093750f, 16511.9492187500f, 16445.5078125000f, + 16379.0292968750f, 16312.5107421875f, 16245.9560546875f, 16179.3623046875f, + 16112.7304687500f, 16046.0605468750f, 15979.3525390625f, 15912.6074218750f, + 15845.8251953125f, 15779.0048828125f, 15712.1474609375f, 15645.2539062500f, + 15578.3232421875f, 15511.3554687500f, 15444.3515625000f, 15377.3095703125f, + 15310.2343750000f, 15243.1210937500f, 15175.9726562500f, 15108.7890625000f, + 15041.5683593750f, 14974.3144531250f, 14907.0234375000f, 14839.6972656250f, + 14772.3369140625f, 14704.9423828125f, 14637.5136718750f, 14570.0478515625f, + 14502.5498046875f, 14435.0166015625f, 14367.4511718750f, 14299.8505859375f, + 14232.2167968750f, 14164.5488281250f, 14096.8486328125f, 14029.1142578125f, + 13961.3466796875f, 13893.5468750000f, 13825.7148437500f, 13757.8486328125f, + 13689.9511718750f, 13622.0224609375f, 13554.0712890625f, 13486.0771484375f, + 13418.0527343750f, 13349.9951171875f, 13281.9072265625f, 13213.7871093750f, + 13145.6367187500f, 13077.4550781250f, 13009.2421875000f, 12941.0000000000f, + 12872.7265625000f, 12804.4218750000f, 12736.0878906250f, 12667.7255859375f, + 12599.3310546875f, 12530.9072265625f, 12462.4541015625f, 12393.9726562500f, + 12325.4619140625f, 12256.9208984375f, 12188.3525390625f, 12119.7548828125f, + 12051.1279296875f, 11982.4726562500f, 11913.7910156250f, 11845.0800781250f, + 11776.3398437500f, 11707.5732421875f, 11638.7802734375f, 11569.9589843750f, + 11501.1093750000f, 11432.2343750000f, 11363.3310546875f, 11294.4023437500f, + 11225.4462890625f, 11156.4638671875f, 11087.4550781250f, 11018.4199218750f, + 10949.3593750000f, 10880.2734375000f, 10811.1611328125f, 10742.0244140625f, + 10672.8613281250f, 10603.6738281250f, 10534.4609375000f, 10465.2226562500f, + 10395.9609375000f, 10326.6738281250f, 10257.3632812500f, 10188.0283203125f, + 10118.6689453125f, 10049.2861328125f, 9979.8798828125f, 9910.4492187500f, + 9840.9960937500f, 9771.5195312500f, 9702.0312500000f, 9632.5087890625f, + 9562.9638671875f, 9493.3955078125f, 9423.8066406250f, 9354.1943359375f, + 9284.5605468750f, 9214.9042968750f, 9145.2275390625f, 9075.5283203125f, + 9005.8076171875f, 8936.0664062500f, 8866.3037109375f, 8796.5205078125f, + 8726.7158203125f, 8656.8906250000f, 8587.0458984375f, 8517.1806640625f, + 8447.2949218750f, 8377.3896484375f, 8307.4648437500f, 8237.5205078125f, + 8167.5561523438f, 8097.5732421875f, 8027.5712890625f, 7957.5502929688f, + 7887.5102539063f, 7817.4521484375f, 7747.3754882813f, 7677.2807617188f, + 7607.1669921875f, 7537.0366210938f, 7466.8881835938f, 7396.7211914063f, + 7326.5380859375f, 7256.3374023438f, 7186.1191406250f, 7115.8847656250f, + 7045.6323242188f, 6975.3647460938f, 6905.0800781250f, 6834.7792968750f, + 6764.4624023438f, 6694.1293945313f, 6623.7807617188f, 6553.4165039063f, + 6483.0371093750f, 6412.6420898438f, 6342.2324218750f, 6271.8071289063f, + 6201.3676757813f, 6130.9130859375f, 6060.4448242188f, 5989.9624023438f, + 5919.4648437500f, 5848.9648437500f, 5778.4404296875f, 5707.9023437500f, + 5637.3505859375f, 5566.7851562500f, 5496.2075195313f, 5425.6162109375f, + 5355.0122070313f, 5284.3959960938f, 5213.7670898438f, 5143.1264648438f, + 5072.4726562500f, 5001.8076171875f, 4931.1308593750f, 4860.4423828125f, + 4789.7426757813f, 4719.0312500000f, 4648.3090820313f, 4577.5756835938f, + 4506.8315429688f, 4436.0771484375f, 4365.3120117188f, 4294.5366210938f, + 4223.7514648438f, 4152.9555664063f, 4082.1508789063f, 4011.3359375000f, + 3940.5119628906f, 3869.6784667969f, 3798.8359375000f, 3727.9843750000f, + 3657.1240234375f, 3586.2548828125f, 3515.3779296875f, 3444.4921875000f, + 3373.5983886719f, 3302.6967773438f, 3231.7873535156f, 3160.8706054688f, + 3089.9458007813f, 3019.0141601563f, 2948.0751953125f, 2877.1296386719f, + 2806.1770019531f, 2735.2177734375f, 2664.2521972656f, 2593.2805175781f, + 2522.3024902344f, 2451.3186035156f, 2380.3288574219f, 2309.3337402344f, + 2238.3330078125f, 2167.3269042969f, 2096.3159179688f, 2025.3000488281f, + 1954.2901611328f, 1883.2647705078f, 1812.2351074219f, 1741.2010498047f, + 1670.1628417969f, 1599.1207275391f, 1528.0749511719f, 1457.0253906250f, + 1385.9726562500f, 1314.9165039063f, 1243.8572998047f, 1172.7950439453f, + 1101.7302246094f, 1030.6627197266f, 959.5927124023f, 888.5205688477f, + 817.4463500977f, 746.3701171875f, 675.2921142578f, 604.2125854492f, + 533.1316528320f, 462.0494384766f, 390.9661254883f, 319.8818969727f, + 248.7969055176f, 177.7113342285f, 106.6253509521f, 35.5391082764f +}; + +static float g_fWinCoeffesLongLong2Short[2048] = +{ + 35.5430603027f, 106.6290893555f, 177.7148895264f, 248.8002624512f, + 319.8850097656f, 390.9691162109f, 462.0521850586f, 533.1341552734f, + 604.2149658203f, 675.2943115234f, 746.3720703125f, 817.4480590820f, + 888.5220947266f, 959.5941162109f, 1030.6638183594f, 1101.7310791016f, + 1172.7958984375f, 1243.8579101563f, 1314.9168701172f, 1385.9727783203f, + 1457.0253906250f, 1528.0747070313f, 1599.1203613281f, 1670.1622314453f, + 1741.2001953125f, 1812.2340087891f, 1883.2635498047f, 1954.2888183594f, + 2025.3093261719f, 2096.3251953125f, 2167.3361816406f, 2238.3417968750f, + 2309.3422851563f, 2380.3371582031f, 2451.3269042969f, 2522.3105468750f, + 2593.2880859375f, 2664.2597656250f, 2735.2250976563f, 2806.1840820313f, + 2877.1364746094f, 2948.0820312500f, 3019.0207519531f, 3089.9523925781f, + 3160.8764648438f, 3231.7934570313f, 3302.7026367188f, 3373.6042480469f, + 3444.4975585938f, 3515.3825683594f, 3586.2600097656f, 3657.1286621094f, + 3727.9890136719f, 3798.8403320313f, 3869.6826171875f, 3940.5158691406f, + 4011.3395996094f, 4082.1542968750f, 4152.9594726563f, 4223.7543945313f, + 4294.5395507813f, 4365.3144531250f, 4436.0800781250f, 4506.8339843750f, + 4577.5781250000f, 4648.3110351563f, 4719.0332031250f, 4789.7441406250f, + 4860.4438476563f, 4931.1323242188f, 5001.8085937500f, 5072.4741210938f, + 5143.1269531250f, 5213.7680664063f, 5284.3964843750f, 5355.0122070313f, + 5425.6162109375f, 5496.2070312500f, 5566.7851562500f, 5637.3496093750f, + 5707.9008789063f, 5778.4389648438f, 5848.9633789063f, 5919.4746093750f, + 5989.9716796875f, 6060.4541015625f, 6130.9223632813f, 6201.3769531250f, + 6271.8154296875f, 6342.2402343750f, 6412.6503906250f, 6483.0449218750f, + 6553.4243164063f, 6623.7880859375f, 6694.1372070313f, 6764.4692382813f, + 6834.7856445313f, 6905.0869140625f, 6975.3715820313f, 7045.6386718750f, + 7115.8901367188f, 7186.1250000000f, 7256.3427734375f, 7326.5429687500f, + 7396.7270507813f, 7466.8935546875f, 7537.0415039063f, 7607.1718750000f, + 7677.2851562500f, 7747.3793945313f, 7817.4560546875f, 7887.5141601563f, + 7957.5537109375f, 8027.5747070313f, 8097.5766601563f, 8167.5595703125f, + 8237.5234375000f, 8307.4677734375f, 8377.3925781250f, 8447.2968750000f, + 8517.1826171875f, 8587.0478515625f, 8656.8925781250f, 8726.7167968750f, + 8796.5205078125f, 8866.3046875000f, 8936.0664062500f, 9005.8076171875f, + 9075.5283203125f, 9145.2275390625f, 9214.9042968750f, 9284.5605468750f, + 9354.1943359375f, 9423.8056640625f, 9493.3955078125f, 9562.9628906250f, + 9632.5078125000f, 9702.0292968750f, 9771.5292968750f, 9841.0058593750f, + 9910.4580078125f, 9979.8876953125f, 10049.2949218750f, 10118.6777343750f, + 10188.0361328125f, 10257.3710937500f, 10326.6816406250f, 10395.9677734375f, + 10465.2304687500f, 10534.4677734375f, 10603.6796875000f, 10672.8681640625f, + 10742.0302734375f, 10811.1679687500f, 10880.2792968750f, 10949.3662109375f, + 11018.4267578125f, 11087.4599609375f, 11156.4687500000f, 11225.4511718750f, + 11294.4072265625f, 11363.3359375000f, 11432.2382812500f, 11501.1132812500f, + 11569.9628906250f, 11638.7841796875f, 11707.5781250000f, 11776.3437500000f, + 11845.0839843750f, 11913.7949218750f, 11982.4755859375f, 12051.1308593750f, + 12119.7558593750f, 12188.3554687500f, 12256.9238281250f, 12325.4638671875f, + 12393.9736328125f, 12462.4560546875f, 12530.9082031250f, 12599.3320312500f, + 12667.7255859375f, 12736.0898437500f, 12804.4228515625f, 12872.7255859375f, + 12941.0000000000f, 13009.2421875000f, 13077.4550781250f, 13145.6367187500f, + 13213.7871093750f, 13281.9072265625f, 13349.9931640625f, 13418.0507812500f, + 13486.0751953125f, 13554.0693359375f, 13622.0322265625f, 13689.9609375000f, + 13757.8583984375f, 13825.7226562500f, 13893.5556640625f, 13961.3544921875f, + 14029.1230468750f, 14096.8554687500f, 14164.5566406250f, 14232.2236328125f, + 14299.8574218750f, 14367.4580078125f, 14435.0244140625f, 14502.5566406250f, + 14570.0546875000f, 14637.5185546875f, 14704.9492187500f, 14772.3427734375f, + 14839.7031250000f, 14907.0283203125f, 14974.3183593750f, 15041.5742187500f, + 15108.7949218750f, 15175.9775390625f, 15243.1250000000f, 15310.2382812500f, + 15377.3144531250f, 15444.3554687500f, 15511.3593750000f, 15578.3261718750f, + 15645.2578125000f, 15712.1503906250f, 15779.0078125000f, 15845.8281250000f, + 15912.6103515625f, 15979.3544921875f, 16046.0634765625f, 16112.7324218750f, + 16179.3642578125f, 16245.9580078125f, 16312.5126953125f, 16379.0302734375f, + 16445.5097656250f, 16511.9492187500f, 16578.3496093750f, 16644.7128906250f, + 16711.0351562500f, 16777.3183593750f, 16843.5625000000f, 16909.7656250000f, + 16975.9316406250f, 17042.0566406250f, 17108.1406250000f, 17174.1835937500f, + 17240.1875000000f, 17306.1523437500f, 17372.0742187500f, 17437.9570312500f, + 17503.7968750000f, 17569.5957031250f, 17635.3554687500f, 17701.0722656250f, + 17766.7460937500f, 17832.3789062500f, 17897.9707031250f, 17963.5195312500f, + 18029.0273437500f, 18094.4902343750f, 18159.9140625000f, 18225.2910156250f, + 18290.6289062500f, 18355.9218750000f, 18421.1718750000f, 18486.3789062500f, + 18551.5410156250f, 18616.6621093750f, 18681.7382812500f, 18746.7695312500f, + 18811.7558593750f, 18876.6992187500f, 18941.5976562500f, 19006.4531250000f, + 19071.2617187500f, 19136.0273437500f, 19200.7460937500f, 19265.4218750000f, + 19330.0488281250f, 19394.6328125000f, 19459.1718750000f, 19523.6640625000f, + 19588.1113281250f, 19652.5117187500f, 19716.8652343750f, 19781.1718750000f, + 19845.4335937500f, 19909.6484375000f, 19973.8164062500f, 20037.9355468750f, + 20102.0097656250f, 20166.0351562500f, 20230.0136718750f, 20293.9453125000f, + 20357.8281250000f, 20421.6640625000f, 20485.4511718750f, 20549.1914062500f, + 20612.8828125000f, 20676.5234375000f, 20740.1171875000f, 20803.6621093750f, + 20867.1582031250f, 20930.6054687500f, 20994.0019531250f, 21057.3515625000f, + 21120.6484375000f, 21183.8984375000f, 21247.0976562500f, 21310.2460937500f, + 21373.3457031250f, 21436.3925781250f, 21499.3925781250f, 21562.3378906250f, + 21625.2343750000f, 21688.0820312500f, 21750.8769531250f, 21813.6210937500f, + 21876.3125000000f, 21938.9550781250f, 22001.5429687500f, 22064.0800781250f, + 22126.5644531250f, 22189.0000000000f, 22251.3789062500f, 22313.7089843750f, + 22375.9843750000f, 22438.2089843750f, 22500.3808593750f, 22562.4980468750f, + 22624.5625000000f, 22686.5761718750f, 22748.5332031250f, 22810.4394531250f, + 22872.2890625000f, 22934.0878906250f, 22995.8320312500f, 23057.5175781250f, + 23119.1523437500f, 23180.7324218750f, 23242.2597656250f, 23303.7304687500f, + 23365.1464843750f, 23426.5117187500f, 23487.8164062500f, 23549.0664062500f, + 23610.2636718750f, 23671.4042968750f, 23732.4882812500f, 23793.5175781250f, + 23854.4902343750f, 23915.4023437500f, 23976.2636718750f, 24037.0703125000f, + 24097.8183593750f, 24158.5078125000f, 24219.1406250000f, 24279.7187500000f, + 24340.2363281250f, 24400.6992187500f, 24461.1054687500f, 24521.4511718750f, + 24581.7402343750f, 24641.9746093750f, 24702.1484375000f, 24762.2597656250f, + 24822.3183593750f, 24882.3164062500f, 24942.2578125000f, 25002.1406250000f, + 25061.9628906250f, 25121.7265625000f, 25181.4316406250f, 25241.0800781250f, + 25300.6640625000f, 25360.1914062500f, 25419.6562500000f, 25479.0644531250f, + 25538.4121093750f, 25597.6992187500f, 25656.9238281250f, 25716.0917968750f, + 25775.1972656250f, 25834.2421875000f, 25893.2285156250f, 25952.1523437500f, + 26011.0136718750f, 26069.8164062500f, 26128.5566406250f, 26187.2343750000f, + 26245.8496093750f, 26304.4082031250f, 26362.8984375000f, 26421.3281250000f, + 26479.6992187500f, 26538.0039062500f, 26596.2500000000f, 26654.4316406250f, + 26712.5488281250f, 26770.6074218750f, 26828.5996093750f, 26886.5312500000f, + 26944.3964843750f, 27002.2011718750f, 27059.9394531250f, 27117.6171875000f, + 27175.2265625000f, 27232.7753906250f, 27290.2578125000f, 27347.6796875000f, + 27405.0351562500f, 27462.3261718750f, 27519.5546875000f, 27576.7167968750f, + 27633.8125000000f, 27690.8457031250f, 27747.8105468750f, 27804.7148437500f, + 27861.5488281250f, 27918.3203125000f, 27975.0214843750f, 28031.6621093750f, + 28088.2343750000f, 28144.7421875000f, 28201.1835937500f, 28257.5585937500f, + 28313.8652343750f, 28370.1074218750f, 28426.2812500000f, 28482.3886718750f, + 28538.4277343750f, 28594.4042968750f, 28650.3085937500f, 28706.1484375000f, + 28761.9160156250f, 28817.6191406250f, 28873.2539062500f, 28928.8242187500f, + 28984.3222656250f, 29039.7539062500f, 29095.1171875000f, 29150.4121093750f, + 29205.6386718750f, 29260.7968750000f, 29315.8847656250f, 29370.9023437500f, + 29425.8554687500f, 29480.7363281250f, 29535.5468750000f, 29590.2890625000f, + 29644.9628906250f, 29699.5644531250f, 29754.0976562500f, 29808.5605468750f, + 29862.9531250000f, 29917.2753906250f, 29971.5273437500f, 30025.7089843750f, + 30079.8222656250f, 30133.8613281250f, 30187.8300781250f, 30241.7304687500f, + 30295.5527343750f, 30349.3105468750f, 30402.9941406250f, 30456.6074218750f, + 30510.1484375000f, 30563.6191406250f, 30617.0156250000f, 30670.3417968750f, + 30723.5957031250f, 30776.7753906250f, 30829.8847656250f, 30882.9218750000f, + 30935.8828125000f, 30988.7714843750f, 31041.5898437500f, 31094.3359375000f, + 31147.0058593750f, 31199.6035156250f, 31252.1269531250f, 31304.5800781250f, + 31356.9589843750f, 31409.2636718750f, 31461.4921875000f, 31513.6464843750f, + 31565.7304687500f, 31617.7382812500f, 31669.6679687500f, 31721.5253906250f, + 31773.3105468750f, 31825.0195312500f, 31876.6523437500f, 31928.2128906250f, + 31979.6972656250f, 32031.1054687500f, 32082.4394531250f, 32133.6972656250f, + 32184.8789062500f, 32235.9863281250f, 32287.0175781250f, 32337.9707031250f, + 32388.8496093750f, 32439.6503906250f, 32490.3769531250f, 32541.0253906250f, + 32591.5976562500f, 32642.0957031250f, 32692.5156250000f, 32742.8574218750f, + 32793.1250000000f, 32843.3125000000f, 32893.4218750000f, 32943.4570312500f, + 32993.4140625000f, 33043.2929687500f, 33093.0898437500f, 33142.8125000000f, + 33192.4609375000f, 33242.0273437500f, 33291.5156250000f, 33340.9257812500f, + 33390.2539062500f, 33439.5117187500f, 33488.6835937500f, 33537.7812500000f, + 33586.7968750000f, 33635.7343750000f, 33684.5937500000f, 33733.3750000000f, + 33782.0742187500f, 33830.6914062500f, 33879.2343750000f, 33927.6914062500f, + 33976.0742187500f, 34024.3750000000f, 34072.5976562500f, 34120.7382812500f, + 34168.8007812500f, 34216.7812500000f, 34264.6796875000f, 34312.5000000000f, + 34360.2421875000f, 34407.8945312500f, 34455.4726562500f, 34502.9687500000f, + 34550.3828125000f, 34597.7148437500f, 34644.9687500000f, 34692.1367187500f, + 34739.2265625000f, 34786.2343750000f, 34833.1601562500f, 34880.0039062500f, + 34926.7617187500f, 34973.4414062500f, 35020.0390625000f, 35066.5507812500f, + 35112.9843750000f, 35159.3320312500f, 35205.5976562500f, 35251.7812500000f, + 35297.8789062500f, 35343.8984375000f, 35389.8320312500f, 35435.6835937500f, + 35481.4531250000f, 35527.1367187500f, 35572.7343750000f, 35618.2539062500f, + 35663.6875000000f, 35709.0351562500f, 35754.2968750000f, 35799.4804687500f, + 35844.5781250000f, 35889.5898437500f, 35934.5156250000f, 35979.3593750000f, + 36024.1171875000f, 36068.7929687500f, 36113.3828125000f, 36157.8867187500f, + 36202.3046875000f, 36246.6367187500f, 36290.8867187500f, 36335.0468750000f, + 36379.1250000000f, 36423.1171875000f, 36467.0234375000f, 36510.8437500000f, + 36554.5781250000f, 36598.2265625000f, 36641.7890625000f, 36685.2656250000f, + 36728.6562500000f, 36771.9570312500f, 36815.1757812500f, 36858.3046875000f, + 36901.3515625000f, 36944.3085937500f, 36987.1757812500f, 37029.9570312500f, + 37072.6523437500f, 37115.2617187500f, 37157.7812500000f, 37200.2148437500f, + 37242.5625000000f, 37284.8203125000f, 37326.9921875000f, 37369.0742187500f, + 37411.0703125000f, 37452.9765625000f, 37494.7968750000f, 37536.5234375000f, + 37578.1640625000f, 37619.7226562500f, 37661.1875000000f, 37702.5625000000f, + 37743.8476562500f, 37785.0468750000f, 37826.1601562500f, 37867.1796875000f, + 37908.1132812500f, 37948.9531250000f, 37989.7070312500f, 38030.3750000000f, + 38070.9453125000f, 38111.4335937500f, 38151.8281250000f, 38192.1328125000f, + 38232.3476562500f, 38272.4726562500f, 38312.5078125000f, 38352.4531250000f, + 38392.3085937500f, 38432.0742187500f, 38471.7500000000f, 38511.3320312500f, + 38550.8281250000f, 38590.2304687500f, 38629.5429687500f, 38668.7617187500f, + 38707.8906250000f, 38746.9335937500f, 38785.8789062500f, 38824.7343750000f, + 38863.5000000000f, 38902.1757812500f, 38940.7578125000f, 38979.2460937500f, + 39017.6445312500f, 39055.9531250000f, 39094.1640625000f, 39132.2890625000f, + 39170.3203125000f, 39208.2578125000f, 39246.1054687500f, 39283.8593750000f, + 39321.5234375000f, 39359.0898437500f, 39396.5664062500f, 39433.9531250000f, + 39471.2421875000f, 39508.4414062500f, 39545.5468750000f, 39582.5585937500f, + 39619.4765625000f, 39656.3046875000f, 39693.0351562500f, 39729.6757812500f, + 39766.2226562500f, 39802.6718750000f, 39839.0312500000f, 39875.2929687500f, + 39911.4687500000f, 39947.5429687500f, 39983.5234375000f, 40019.4101562500f, + 40055.2070312500f, 40090.9062500000f, 40126.5156250000f, 40162.0273437500f, + 40197.4414062500f, 40232.7656250000f, 40267.9921875000f, 40303.1289062500f, + 40338.1640625000f, 40373.1093750000f, 40407.9570312500f, 40442.7109375000f, + 40477.3671875000f, 40511.9296875000f, 40546.3984375000f, 40580.7734375000f, + 40615.0468750000f, 40649.2304687500f, 40683.3125000000f, 40717.3046875000f, + 40751.1992187500f, 40784.9960937500f, 40818.6953125000f, 40852.3046875000f, + 40885.8125000000f, 40919.2265625000f, 40952.5429687500f, 40985.7617187500f, + 41018.8867187500f, 41051.9140625000f, 41084.8476562500f, 41117.6796875000f, + 41150.4179687500f, 41183.0625000000f, 41215.6054687500f, 41248.0507812500f, + 41280.4023437500f, 41312.6562500000f, 41344.8125000000f, 41376.8671875000f, + 41408.8281250000f, 41440.6953125000f, 41472.4609375000f, 41504.1289062500f, + 41535.6992187500f, 41567.1757812500f, 41598.5507812500f, 41629.8281250000f, + 41661.0078125000f, 41692.0898437500f, 41723.0742187500f, 41753.9570312500f, + 41784.7460937500f, 41815.4296875000f, 41846.0195312500f, 41876.5117187500f, + 41906.9062500000f, 41937.2031250000f, 41967.3984375000f, 41997.4921875000f, + 42027.4921875000f, 42057.3945312500f, 42087.1953125000f, 42116.8945312500f, + 42146.4960937500f, 42176.0000000000f, 42205.4062500000f, 42234.7070312500f, + 42263.9140625000f, 42293.0195312500f, 42322.0234375000f, 42350.9335937500f, + 42379.7382812500f, 42408.4453125000f, 42437.0546875000f, 42465.5625000000f, + 42493.9726562500f, 42522.2773437500f, 42550.4882812500f, 42578.5937500000f, + 42606.6015625000f, 42634.5039062500f, 42662.3125000000f, 42690.0195312500f, + 42717.6250000000f, 42745.1328125000f, 42772.5351562500f, 42799.8398437500f, + 42827.0429687500f, 42854.1484375000f, 42881.1484375000f, 42908.0507812500f, + 42934.8476562500f, 42961.5468750000f, 42988.1484375000f, 43014.6445312500f, + 43041.0390625000f, 43067.3320312500f, 43093.5273437500f, 43119.6171875000f, + 43145.6093750000f, 43171.4960937500f, 43197.2812500000f, 43222.9687500000f, + 43248.5546875000f, 43274.0351562500f, 43299.4140625000f, 43324.6914062500f, + 43349.8671875000f, 43374.9414062500f, 43399.9140625000f, 43424.7812500000f, + 43449.5507812500f, 43474.2187500000f, 43498.7812500000f, 43523.2382812500f, + 43547.5976562500f, 43571.8554687500f, 43596.0078125000f, 43620.0585937500f, + 43644.0078125000f, 43667.8554687500f, 43691.5976562500f, 43715.2343750000f, + 43738.7734375000f, 43762.2070312500f, 43785.5390625000f, 43808.7656250000f, + 43831.8906250000f, 43854.9140625000f, 43877.8320312500f, 43900.6484375000f, + 43923.3593750000f, 43945.9687500000f, 43968.4726562500f, 43990.8789062500f, + 44013.1718750000f, 44035.3671875000f, 44057.4570312500f, 44079.4492187500f, + 44101.3320312500f, 44123.1132812500f, 44144.7851562500f, 44166.3593750000f, + 44187.8281250000f, 44209.1953125000f, 44230.4531250000f, 44251.6093750000f, + 44272.6601562500f, 44293.6093750000f, 44314.4531250000f, 44335.1953125000f, + 44355.8281250000f, 44376.3593750000f, 44396.7851562500f, 44417.1093750000f, + 44437.3281250000f, 44457.4375000000f, 44477.4453125000f, 44497.3515625000f, + 44517.1484375000f, 44536.8437500000f, 44556.4335937500f, 44575.9179687500f, + 44595.2968750000f, 44614.5703125000f, 44633.7382812500f, 44652.8046875000f, + 44671.7656250000f, 44690.6210937500f, 44709.3710937500f, 44728.0117187500f, + 44746.5507812500f, 44764.9843750000f, 44783.3125000000f, 44801.5351562500f, + 44819.6523437500f, 44837.6640625000f, 44855.5703125000f, 44873.3750000000f, + 44891.0664062500f, 44908.6562500000f, 44926.1406250000f, 44943.5195312500f, + 44960.7929687500f, 44977.9609375000f, 44995.0195312500f, 45011.9765625000f, + 45028.8242187500f, 45045.5664062500f, 45062.2031250000f, 45078.7343750000f, + 45095.1601562500f, 45111.4765625000f, 45127.6914062500f, 45143.7968750000f, + 45159.8007812500f, 45175.6914062500f, 45191.4804687500f, 45207.1601562500f, + 45222.7382812500f, 45238.2070312500f, 45253.5664062500f, 45268.8242187500f, + 45283.9726562500f, 45299.0156250000f, 45313.9531250000f, 45328.7812500000f, + 45343.5039062500f, 45358.1210937500f, 45372.6289062500f, 45387.0312500000f, + 45401.3281250000f, 45415.5195312500f, 45429.5976562500f, 45443.5742187500f, + 45457.4414062500f, 45471.2031250000f, 45484.8593750000f, 45498.4023437500f, + 45511.8437500000f, 45525.1757812500f, 45538.4023437500f, 45551.5234375000f, + 45564.5351562500f, 45577.4414062500f, 45590.2382812500f, 45602.9257812500f, + 45615.5078125000f, 45627.9843750000f, 45640.3515625000f, 45652.6093750000f, + 45664.7656250000f, 45676.8085937500f, 45688.7500000000f, 45700.5781250000f, + 45712.3007812500f, 45723.9179687500f, 45735.4257812500f, 45746.8242187500f, + 45758.1210937500f, 45769.3046875000f, 45780.3789062500f, 45791.3515625000f, + 45802.2109375000f, 45812.9687500000f, 45823.6132812500f, 45834.1484375000f, + 45844.5781250000f, 45854.9023437500f, 45865.1171875000f, 45875.2265625000f, + 45885.2226562500f, 45895.1132812500f, 45904.8945312500f, 45914.5703125000f, + 45924.1367187500f, 45933.5976562500f, 45942.9492187500f, 45952.1914062500f, + 45961.3242187500f, 45970.3515625000f, 45979.2695312500f, 45988.0820312500f, + 45996.7812500000f, 46005.3750000000f, 46013.8593750000f, 46022.2382812500f, + 46030.5039062500f, 46038.6679687500f, 46046.7187500000f, 46054.6640625000f, + 46062.5000000000f, 46070.2226562500f, 46077.8437500000f, 46085.3515625000f, + 46092.7539062500f, 46100.0468750000f, 46107.2304687500f, 46114.3085937500f, + 46121.2734375000f, 46128.1367187500f, 46134.8867187500f, 46141.5273437500f, + 46148.0625000000f, 46154.4843750000f, 46160.8007812500f, 46167.0078125000f, + 46173.1093750000f, 46179.0976562500f, 46184.9804687500f, 46190.7539062500f, + 46196.4179687500f, 46201.9726562500f, 46207.4179687500f, 46212.7578125000f, + 46217.9882812500f, 46223.1093750000f, 46228.1210937500f, 46233.0234375000f, + 46237.8164062500f, 46242.5039062500f, 46247.0820312500f, 46251.5468750000f, + 46255.9062500000f, 46260.1562500000f, 46264.2968750000f, 46268.3281250000f, + 46272.2539062500f, 46276.0703125000f, 46279.7773437500f, 46283.3710937500f, + 46286.8593750000f, 46290.2382812500f, 46293.5078125000f, 46296.6679687500f, + 46299.7226562500f, 46302.6679687500f, 46305.5000000000f, 46308.2265625000f, + 46310.8437500000f, 46313.3515625000f, 46315.7460937500f, 46318.0390625000f, + 46320.2187500000f, 46322.2890625000f, 46324.2539062500f, 46326.1054687500f, + 46327.8515625000f, 46329.4882812500f, 46331.0156250000f, 46332.4296875000f, + 46333.7382812500f, 46334.9375000000f, 46336.0312500000f, 46337.0117187500f, + 46337.8828125000f, 46338.6445312500f, 46339.3007812500f, 46339.8437500000f, + 46340.2812500000f, 46340.6093750000f, 46340.8281250000f, 46340.9335937500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.0781250000f, 46333.0976562500f, 46319.1406250000f, 46298.2109375000f, + 46270.3046875000f, 46235.4335937500f, 46193.5976562500f, 46144.8085937500f, + 46089.0664062500f, 46026.3828125000f, 45956.7734375000f, 45880.2343750000f, + 45796.7929687500f, 45706.4531250000f, 45609.2304687500f, 45505.1367187500f, + 45394.1914062500f, 45276.4101562500f, 45151.8125000000f, 45020.4140625000f, + 44882.2304687500f, 44737.2929687500f, 44585.6210937500f, 44427.2265625000f, + 44262.1445312500f, 44090.3984375000f, 43912.0156250000f, 43727.0156250000f, + 43535.4296875000f, 43337.2929687500f, 43132.6250000000f, 42921.4609375000f, + 42703.8320312500f, 42479.7773437500f, 42249.3242187500f, 42012.5039062500f, + 41769.3593750000f, 41519.9257812500f, 41264.2382812500f, 41002.3359375000f, + 40734.2578125000f, 40460.0468750000f, 40179.7460937500f, 39893.3906250000f, + 39601.0273437500f, 39302.7031250000f, 38998.4531250000f, 38688.3320312500f, + 38372.3945312500f, 38050.6679687500f, 37723.2148437500f, 37390.0781250000f, + 37051.3164062500f, 36706.9687500000f, 36357.0937500000f, 36001.7500000000f, + 35640.9804687500f, 35274.8398437500f, 34903.3906250000f, 34526.6796875000f, + 34144.7734375000f, 33757.7265625000f, 33365.6015625000f, 32968.4453125000f, + 32566.3222656250f, 32159.2929687500f, 31747.4257812500f, 31330.7734375000f, + 30909.4042968750f, 30483.3867187500f, 30052.7714843750f, 29617.6308593750f, + 29178.0312500000f, 28734.0351562500f, 28285.7128906250f, 27833.1308593750f, + 27376.3671875000f, 26915.4687500000f, 26450.5195312500f, 25981.5859375000f, + 25508.7421875000f, 25032.0546875000f, 24551.5957031250f, 24067.4511718750f, + 23579.6718750000f, 23088.3417968750f, 22593.5351562500f, 22095.3242187500f, + 21593.7871093750f, 21088.9980468750f, 20581.0429687500f, 20069.9785156250f, + 19555.8906250000f, 19038.8593750000f, 18518.9609375000f, 17996.2714843750f, + 17470.8730468750f, 16942.8535156250f, 16412.2734375000f, 15879.2207031250f, + 15343.7763671875f, 14806.0214843750f, 14266.0380859375f, 13723.9052734375f, + 13179.7158203125f, 12633.5312500000f, 12085.4453125000f, 11535.5371093750f, + 10983.8935546875f, 10430.5947265625f, 9875.7255859375f, 9319.3798828125f, + 8761.6201171875f, 8202.5410156250f, 7642.2260742188f, 7080.7607421875f, + 6518.2290039063f, 5954.7153320313f, 5390.3159179688f, 4825.0937500000f, + 4259.1455078125f, 3692.5549316406f, 3125.4091796875f, 2557.7922363281f, + 1989.7901611328f, 1421.4993896484f, 852.9837036133f, 284.3394775391f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f +}; + +static float g_fWinCoeffesLongShort2Long[2048] = +{ + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 284.3427124023f, 852.9853515625f, 1421.4995117188f, 1989.7996826172f, + 2557.8000488281f, 3125.4152832031f, 3692.5598144531f, 4259.1479492188f, + 4825.0957031250f, 5390.3159179688f, 5954.7250976563f, 6518.2363281250f, + 7080.7670898438f, 7642.2309570313f, 8202.5439453125f, 8761.6210937500f, + 9319.3798828125f, 9875.7353515625f, 10430.6025390625f, 10983.8994140625f, + 11535.5419921875f, 12085.4472656250f, 12633.5332031250f, 13179.7158203125f, + 13723.9130859375f, 14266.0458984375f, 14806.0273437500f, 15343.7802734375f, + 15879.2236328125f, 16412.2734375000f, 16942.8535156250f, 17470.8828125000f, + 17996.2773437500f, 18518.9648437500f, 19038.8632812500f, 19555.8945312500f, + 20069.9804687500f, 20581.0429687500f, 21089.0058593750f, 21593.7929687500f, + 22095.3300781250f, 22593.5371093750f, 23088.3417968750f, 23579.6738281250f, + 24067.4511718750f, 24551.6035156250f, 25032.0605468750f, 25508.7460937500f, + 25981.5917968750f, 26450.5214843750f, 26915.4726562500f, 27376.3652343750f, + 27833.1386718750f, 28285.7187500000f, 28734.0410156250f, 29178.0351562500f, + 29617.6347656250f, 30052.7753906250f, 30483.3867187500f, 30909.4101562500f, + 31330.7792968750f, 31747.4277343750f, 32159.2968750000f, 32566.3222656250f, + 32968.4453125000f, 33365.6015625000f, 33757.7343750000f, 34144.7812500000f, + 34526.6835937500f, 34903.3906250000f, 35274.8398437500f, 35640.9804687500f, + 36001.7500000000f, 36357.0976562500f, 36706.9687500000f, 37051.3164062500f, + 37390.0820312500f, 37723.2148437500f, 38050.6718750000f, 38372.3945312500f, + 38688.3398437500f, 38998.4531250000f, 39302.7031250000f, 39601.0273437500f, + 39893.3906250000f, 40179.7460937500f, 40460.0507812500f, 40734.2656250000f, + 41002.3359375000f, 41264.2421875000f, 41519.9296875000f, 41769.3632812500f, + 42012.5039062500f, 42249.3242187500f, 42479.7773437500f, 42703.8359375000f, + 42921.4609375000f, 43132.6250000000f, 43337.2929687500f, 43535.4296875000f, + 43727.0156250000f, 43912.0195312500f, 44090.4023437500f, 44262.1484375000f, + 44427.2304687500f, 44585.6210937500f, 44737.2929687500f, 44882.2343750000f, + 45020.4140625000f, 45151.8125000000f, 45276.4101562500f, 45394.1953125000f, + 45505.1367187500f, 45609.2304687500f, 45706.4531250000f, 45796.7929687500f, + 45880.2343750000f, 45956.7734375000f, 46026.3867187500f, 46089.0664062500f, + 46144.8085937500f, 46193.6015625000f, 46235.4335937500f, 46270.3046875000f, + 46298.2109375000f, 46319.1406250000f, 46333.0976562500f, 46340.0781250000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9335937500f, 46340.8281250000f, 46340.6093750000f, 46340.2812500000f, + 46339.8437500000f, 46339.3007812500f, 46338.6445312500f, 46337.8828125000f, + 46337.0117187500f, 46336.0312500000f, 46334.9375000000f, 46333.7382812500f, + 46332.4296875000f, 46331.0156250000f, 46329.4882812500f, 46327.8515625000f, + 46326.1054687500f, 46324.2539062500f, 46322.2890625000f, 46320.2187500000f, + 46318.0390625000f, 46315.7460937500f, 46313.3515625000f, 46310.8437500000f, + 46308.2265625000f, 46305.5000000000f, 46302.6679687500f, 46299.7226562500f, + 46296.6679687500f, 46293.5078125000f, 46290.2382812500f, 46286.8593750000f, + 46283.3710937500f, 46279.7734375000f, 46276.0703125000f, 46272.2539062500f, + 46268.3281250000f, 46264.2968750000f, 46260.1562500000f, 46255.9062500000f, + 46251.5468750000f, 46247.0820312500f, 46242.5039062500f, 46237.8164062500f, + 46233.0234375000f, 46228.1171875000f, 46223.1093750000f, 46217.9882812500f, + 46212.7578125000f, 46207.4179687500f, 46201.9726562500f, 46196.4179687500f, + 46190.7539062500f, 46184.9804687500f, 46179.0976562500f, 46173.1093750000f, + 46167.0078125000f, 46160.8007812500f, 46154.4843750000f, 46148.0625000000f, + 46141.5273437500f, 46134.8867187500f, 46128.1367187500f, 46121.2734375000f, + 46114.3085937500f, 46107.2304687500f, 46100.0468750000f, 46092.7539062500f, + 46085.3515625000f, 46077.8437500000f, 46070.2226562500f, 46062.4960937500f, + 46054.6640625000f, 46046.7187500000f, 46038.6679687500f, 46030.5039062500f, + 46022.2382812500f, 46013.8593750000f, 46005.3750000000f, 45996.7812500000f, + 45988.0781250000f, 45979.2695312500f, 45970.3515625000f, 45961.3242187500f, + 45952.1914062500f, 45942.9492187500f, 45933.5976562500f, 45924.1367187500f, + 45914.5703125000f, 45904.8945312500f, 45895.1132812500f, 45885.2226562500f, + 45875.2226562500f, 45865.1171875000f, 45854.9023437500f, 45844.5781250000f, + 45834.1484375000f, 45823.6132812500f, 45812.9648437500f, 45802.2109375000f, + 45791.3515625000f, 45780.3789062500f, 45769.3046875000f, 45758.1171875000f, + 45746.8242187500f, 45735.4257812500f, 45723.9140625000f, 45712.3007812500f, + 45700.5781250000f, 45688.7500000000f, 45676.8085937500f, 45664.7656250000f, + 45652.6093750000f, 45640.3515625000f, 45627.9804687500f, 45615.5078125000f, + 45602.9257812500f, 45590.2343750000f, 45577.4375000000f, 45564.5312500000f, + 45551.5234375000f, 45538.4023437500f, 45525.1757812500f, 45511.8437500000f, + 45498.4023437500f, 45484.8593750000f, 45471.2031250000f, 45457.4414062500f, + 45443.5742187500f, 45429.5976562500f, 45415.5156250000f, 45401.3242187500f, + 45387.0312500000f, 45372.6289062500f, 45358.1210937500f, 45343.5039062500f, + 45328.7812500000f, 45313.9531250000f, 45299.0117187500f, 45283.9726562500f, + 45268.8242187500f, 45253.5664062500f, 45238.2070312500f, 45222.7382812500f, + 45207.1601562500f, 45191.4804687500f, 45175.6914062500f, 45159.8007812500f, + 45143.7968750000f, 45127.6914062500f, 45111.4765625000f, 45095.1601562500f, + 45078.7343750000f, 45062.2031250000f, 45045.5664062500f, 45028.8242187500f, + 45011.9765625000f, 44995.0195312500f, 44977.9609375000f, 44960.7929687500f, + 44943.5195312500f, 44926.1406250000f, 44908.6562500000f, 44891.0664062500f, + 44873.3710937500f, 44855.5703125000f, 44837.6640625000f, 44819.6523437500f, + 44801.5351562500f, 44783.3125000000f, 44764.9843750000f, 44746.5507812500f, + 44728.0117187500f, 44709.3671875000f, 44690.6171875000f, 44671.7617187500f, + 44652.8046875000f, 44633.7382812500f, 44614.5703125000f, 44595.2929687500f, + 44575.9179687500f, 44556.4335937500f, 44536.8437500000f, 44517.1484375000f, + 44497.3515625000f, 44477.4453125000f, 44457.4375000000f, 44437.3242187500f, + 44417.1093750000f, 44396.7851562500f, 44376.3593750000f, 44355.8281250000f, + 44335.1914062500f, 44314.4531250000f, 44293.6093750000f, 44272.6601562500f, + 44251.6093750000f, 44230.4492187500f, 44209.1914062500f, 44187.8242187500f, + 44166.3593750000f, 44144.7851562500f, 44123.1093750000f, 44101.3281250000f, + 44079.4453125000f, 44057.4570312500f, 44035.3671875000f, 44013.1718750000f, + 43990.8750000000f, 43968.4726562500f, 43945.9687500000f, 43923.3593750000f, + 43900.6445312500f, 43877.8320312500f, 43854.9101562500f, 43831.8906250000f, + 43808.7656250000f, 43785.5390625000f, 43762.2070312500f, 43738.7695312500f, + 43715.2343750000f, 43691.5937500000f, 43667.8515625000f, 43644.0039062500f, + 43620.0585937500f, 43596.0078125000f, 43571.8515625000f, 43547.5976562500f, + 43523.2382812500f, 43498.7773437500f, 43474.2148437500f, 43449.5468750000f, + 43424.7812500000f, 43399.9140625000f, 43374.9414062500f, 43349.8671875000f, + 43324.6914062500f, 43299.4140625000f, 43274.0351562500f, 43248.5507812500f, + 43222.9687500000f, 43197.2812500000f, 43171.4960937500f, 43145.6054687500f, + 43119.6171875000f, 43093.5273437500f, 43067.3320312500f, 43041.0351562500f, + 43014.6406250000f, 42988.1445312500f, 42961.5468750000f, 42934.8476562500f, + 42908.0468750000f, 42881.1484375000f, 42854.1445312500f, 42827.0429687500f, + 42799.8398437500f, 42772.5351562500f, 42745.1289062500f, 42717.6250000000f, + 42690.0195312500f, 42662.3125000000f, 42634.5039062500f, 42606.5976562500f, + 42578.5898437500f, 42550.4843750000f, 42522.2773437500f, 42493.9687500000f, + 42465.5625000000f, 42437.0546875000f, 42408.4453125000f, 42379.7382812500f, + 42350.9296875000f, 42322.0234375000f, 42293.0156250000f, 42263.9140625000f, + 42234.7070312500f, 42205.4023437500f, 42176.0000000000f, 42146.4921875000f, + 42116.8945312500f, 42087.1953125000f, 42057.3945312500f, 42027.4921875000f, + 41997.4921875000f, 41967.3984375000f, 41937.2031250000f, 41906.9062500000f, + 41876.5117187500f, 41846.0195312500f, 41815.4296875000f, 41784.7421875000f, + 41753.9570312500f, 41723.0703125000f, 41692.0859375000f, 41661.0039062500f, + 41629.8242187500f, 41598.5468750000f, 41567.1718750000f, 41535.6992187500f, + 41504.1289062500f, 41472.4570312500f, 41440.6953125000f, 41408.8281250000f, + 41376.8671875000f, 41344.8085937500f, 41312.6562500000f, 41280.4023437500f, + 41248.0507812500f, 41215.6015625000f, 41183.0585937500f, 41150.4179687500f, + 41117.6796875000f, 41084.8437500000f, 41051.9140625000f, 41018.8867187500f, + 40985.7617187500f, 40952.5390625000f, 40919.2226562500f, 40885.8085937500f, + 40852.2968750000f, 40818.6953125000f, 40784.9921875000f, 40751.1914062500f, + 40717.2968750000f, 40683.3085937500f, 40649.2226562500f, 40615.0429687500f, + 40580.7656250000f, 40546.3945312500f, 40511.9257812500f, 40477.3632812500f, + 40442.7109375000f, 40407.9570312500f, 40373.1093750000f, 40338.1640625000f, + 40303.1289062500f, 40267.9921875000f, 40232.7656250000f, 40197.4414062500f, + 40162.0273437500f, 40126.5156250000f, 40090.9101562500f, 40055.2109375000f, + 40019.4140625000f, 39983.5234375000f, 39947.5429687500f, 39911.4648437500f, + 39875.2929687500f, 39839.0273437500f, 39802.6679687500f, 39766.2187500000f, + 39729.6718750000f, 39693.0312500000f, 39656.3007812500f, 39619.4726562500f, + 39582.5546875000f, 39545.5429687500f, 39508.4375000000f, 39471.2421875000f, + 39433.9492187500f, 39396.5625000000f, 39359.0859375000f, 39321.5195312500f, + 39283.8593750000f, 39246.1015625000f, 39208.2539062500f, 39170.3164062500f, + 39132.2851562500f, 39094.1640625000f, 39055.9492187500f, 39017.6406250000f, + 38979.2421875000f, 38940.7500000000f, 38902.1679687500f, 38863.4960937500f, + 38824.7304687500f, 38785.8750000000f, 38746.9257812500f, 38707.8906250000f, + 38668.7578125000f, 38629.5351562500f, 38590.2265625000f, 38550.8242187500f, + 38511.3281250000f, 38471.7460937500f, 38432.0703125000f, 38392.3125000000f, + 38352.4531250000f, 38312.5117187500f, 38272.4726562500f, 38232.3476562500f, + 38192.1328125000f, 38151.8281250000f, 38111.4296875000f, 38070.9453125000f, + 38030.3750000000f, 37989.7070312500f, 37948.9531250000f, 37908.1132812500f, + 37867.1796875000f, 37826.1562500000f, 37785.0468750000f, 37743.8476562500f, + 37702.5585937500f, 37661.1835937500f, 37619.7187500000f, 37578.1640625000f, + 37536.5234375000f, 37494.7929687500f, 37452.9726562500f, 37411.0664062500f, + 37369.0703125000f, 37326.9882812500f, 37284.8164062500f, 37242.5585937500f, + 37200.2148437500f, 37157.7812500000f, 37115.2578125000f, 37072.6484375000f, + 37029.9570312500f, 36987.1718750000f, 36944.3007812500f, 36901.3437500000f, + 36858.3007812500f, 36815.1718750000f, 36771.9531250000f, 36728.6484375000f, + 36685.2617187500f, 36641.7851562500f, 36598.2226562500f, 36554.5742187500f, + 36510.8398437500f, 36467.0195312500f, 36423.1132812500f, 36379.1210937500f, + 36335.0429687500f, 36290.8789062500f, 36246.6328125000f, 36202.2968750000f, + 36157.8789062500f, 36113.3750000000f, 36068.7851562500f, 36024.1171875000f, + 35979.3593750000f, 35934.5156250000f, 35889.5898437500f, 35844.5781250000f, + 35799.4804687500f, 35754.2968750000f, 35709.0351562500f, 35663.6835937500f, + 35618.2539062500f, 35572.7343750000f, 35527.1367187500f, 35481.4531250000f, + 35435.6835937500f, 35389.8320312500f, 35343.8984375000f, 35297.8789062500f, + 35251.7812500000f, 35205.5976562500f, 35159.3281250000f, 35112.9804687500f, + 35066.5507812500f, 35020.0351562500f, 34973.4414062500f, 34926.7617187500f, + 34880.0000000000f, 34833.1562500000f, 34786.2304687500f, 34739.2265625000f, + 34692.1367187500f, 34644.9648437500f, 34597.7109375000f, 34550.3789062500f, + 34502.9648437500f, 34455.4687500000f, 34407.8945312500f, 34360.2343750000f, + 34312.4960937500f, 34264.6757812500f, 34216.7734375000f, 34168.7968750000f, + 34120.7343750000f, 34072.5937500000f, 34024.3710937500f, 33976.0703125000f, + 33927.6914062500f, 33879.2265625000f, 33830.6875000000f, 33782.0664062500f, + 33733.3671875000f, 33684.5859375000f, 33635.7304687500f, 33586.7890625000f, + 33537.7734375000f, 33488.6796875000f, 33439.5117187500f, 33390.2578125000f, + 33340.9257812500f, 33291.5156250000f, 33242.0273437500f, 33192.4609375000f, + 33142.8164062500f, 33093.0898437500f, 33043.2890625000f, 32993.4101562500f, + 32943.4570312500f, 32893.4218750000f, 32843.3125000000f, 32793.1250000000f, + 32742.8574218750f, 32692.5156250000f, 32642.0957031250f, 32591.5976562500f, + 32541.0253906250f, 32490.3769531250f, 32439.6503906250f, 32388.8457031250f, + 32337.9667968750f, 32287.0136718750f, 32235.9843750000f, 32184.8769531250f, + 32133.6933593750f, 32082.4375000000f, 32031.1015625000f, 31979.6933593750f, + 31928.2109375000f, 31876.6484375000f, 31825.0175781250f, 31773.3066406250f, + 31721.5214843750f, 31669.6640625000f, 31617.7324218750f, 31565.7246093750f, + 31513.6406250000f, 31461.4863281250f, 31409.2578125000f, 31356.9531250000f, + 31304.5742187500f, 31252.1250000000f, 31199.5996093750f, 31147.0000000000f, + 31094.3300781250f, 31041.5839843750f, 30988.7656250000f, 30935.8769531250f, + 30882.9121093750f, 30829.8769531250f, 30776.7695312500f, 30723.5878906250f, + 30670.3339843750f, 30617.0078125000f, 30563.6191406250f, 30510.1484375000f, + 30456.6074218750f, 30402.9941406250f, 30349.3105468750f, 30295.5566406250f, + 30241.7265625000f, 30187.8300781250f, 30133.8613281250f, 30079.8183593750f, + 30025.7089843750f, 29971.5273437500f, 29917.2753906250f, 29862.9531250000f, + 29808.5585937500f, 29754.0976562500f, 29699.5644531250f, 29644.9589843750f, + 29590.2890625000f, 29535.5468750000f, 29480.7343750000f, 29425.8535156250f, + 29370.9003906250f, 29315.8808593750f, 29260.7929687500f, 29205.6367187500f, + 29150.4101562500f, 29095.1152343750f, 29039.7500000000f, 28984.3203125000f, + 28928.8203125000f, 28873.2519531250f, 28817.6171875000f, 28761.9140625000f, + 28706.1425781250f, 28650.3027343750f, 28594.3984375000f, 28538.4238281250f, + 28482.3828125000f, 28426.2753906250f, 28370.1015625000f, 28313.8593750000f, + 28257.5527343750f, 28201.1777343750f, 28144.7363281250f, 28088.2285156250f, + 28031.6562500000f, 27975.0156250000f, 27918.3125000000f, 27861.5429687500f, + 27804.7050781250f, 27747.8027343750f, 27690.8378906250f, 27633.8046875000f, + 27576.7089843750f, 27519.5546875000f, 27462.3281250000f, 27405.0351562500f, + 27347.6796875000f, 27290.2617187500f, 27232.7753906250f, 27175.2285156250f, + 27117.6171875000f, 27059.9394531250f, 27002.1972656250f, 26944.3945312500f, + 26886.5273437500f, 26828.5976562500f, 26770.6074218750f, 26712.5488281250f, + 26654.4316406250f, 26596.2500000000f, 26538.0039062500f, 26479.6992187500f, + 26421.3281250000f, 26362.8964843750f, 26304.4023437500f, 26245.8476562500f, + 26187.2304687500f, 26128.5527343750f, 26069.8105468750f, 26011.0117187500f, + 25952.1464843750f, 25893.2246093750f, 25834.2402343750f, 25775.1933593750f, + 25716.0898437500f, 25656.9218750000f, 25597.6933593750f, 25538.4062500000f, + 25479.0585937500f, 25419.6523437500f, 25360.1855468750f, 25300.6582031250f, + 25241.0703125000f, 25181.4257812500f, 25121.7226562500f, 25061.9570312500f, + 25002.1347656250f, 24942.2519531250f, 24882.3105468750f, 24822.3125000000f, + 24762.2539062500f, 24702.1406250000f, 24641.9667968750f, 24581.7324218750f, + 24521.4433593750f, 24461.0957031250f, 24400.6914062500f, 24340.2285156250f, + 24279.7187500000f, 24219.1406250000f, 24158.5078125000f, 24097.8183593750f, + 24037.0703125000f, 23976.2675781250f, 23915.4062500000f, 23854.4902343750f, + 23793.5156250000f, 23732.4863281250f, 23671.4023437500f, 23610.2617187500f, + 23549.0664062500f, 23487.8164062500f, 23426.5078125000f, 23365.1464843750f, + 23303.7304687500f, 23242.2597656250f, 23180.7324218750f, 23119.1523437500f, + 23057.5175781250f, 22995.8281250000f, 22934.0839843750f, 22872.2871093750f, + 22810.4355468750f, 22748.5312500000f, 22686.5722656250f, 22624.5605468750f, + 22562.4960937500f, 22500.3769531250f, 22438.2070312500f, 22375.9824218750f, + 22313.7050781250f, 22251.3769531250f, 22188.9960937500f, 22126.5605468750f, + 22064.0742187500f, 22001.5371093750f, 21938.9472656250f, 21876.3066406250f, + 21813.6132812500f, 21750.8710937500f, 21688.0742187500f, 21625.2285156250f, + 21562.3320312500f, 21499.3847656250f, 21436.3867187500f, 21373.3378906250f, + 21310.2382812500f, 21247.0898437500f, 21183.8906250000f, 21120.6406250000f, + 21057.3417968750f, 20993.9941406250f, 20930.5957031250f, 20867.1503906250f, + 20803.6640625000f, 20740.1191406250f, 20676.5234375000f, 20612.8828125000f, + 20549.1914062500f, 20485.4511718750f, 20421.6640625000f, 20357.8281250000f, + 20293.9453125000f, 20230.0136718750f, 20166.0351562500f, 20102.0097656250f, + 20037.9355468750f, 19973.8144531250f, 19909.6484375000f, 19845.4316406250f, + 19781.1718750000f, 19716.8632812500f, 19652.5097656250f, 19588.1093750000f, + 19523.6621093750f, 19459.1699218750f, 19394.6308593750f, 19330.0488281250f, + 19265.4179687500f, 19200.7441406250f, 19136.0234375000f, 19071.2578125000f, + 19006.4492187500f, 18941.5937500000f, 18876.6953125000f, 18811.7519531250f, + 18746.7636718750f, 18681.7324218750f, 18616.6562500000f, 18551.5351562500f, + 18486.3730468750f, 18421.1660156250f, 18355.9160156250f, 18290.6210937500f, + 18225.2851562500f, 18159.9062500000f, 18094.4843750000f, 18029.0195312500f, + 17963.5136718750f, 17897.9628906250f, 17832.3730468750f, 17766.7382812500f, + 17701.0625000000f, 17635.3457031250f, 17569.5878906250f, 17503.7890625000f, + 17437.9472656250f, 17372.0664062500f, 17306.1425781250f, 17240.1894531250f, + 17174.1855468750f, 17108.1425781250f, 17042.0566406250f, 16975.9316406250f, + 16909.7656250000f, 16843.5625000000f, 16777.3183593750f, 16711.0351562500f, + 16644.7128906250f, 16578.3496093750f, 16511.9492187500f, 16445.5078125000f, + 16379.0292968750f, 16312.5107421875f, 16245.9560546875f, 16179.3623046875f, + 16112.7304687500f, 16046.0605468750f, 15979.3525390625f, 15912.6074218750f, + 15845.8251953125f, 15779.0048828125f, 15712.1474609375f, 15645.2539062500f, + 15578.3232421875f, 15511.3554687500f, 15444.3515625000f, 15377.3095703125f, + 15310.2343750000f, 15243.1210937500f, 15175.9726562500f, 15108.7890625000f, + 15041.5683593750f, 14974.3144531250f, 14907.0234375000f, 14839.6972656250f, + 14772.3369140625f, 14704.9423828125f, 14637.5136718750f, 14570.0478515625f, + 14502.5498046875f, 14435.0166015625f, 14367.4511718750f, 14299.8505859375f, + 14232.2167968750f, 14164.5488281250f, 14096.8486328125f, 14029.1142578125f, + 13961.3466796875f, 13893.5468750000f, 13825.7148437500f, 13757.8486328125f, + 13689.9511718750f, 13622.0224609375f, 13554.0712890625f, 13486.0771484375f, + 13418.0527343750f, 13349.9951171875f, 13281.9072265625f, 13213.7871093750f, + 13145.6367187500f, 13077.4550781250f, 13009.2421875000f, 12941.0000000000f, + 12872.7265625000f, 12804.4218750000f, 12736.0878906250f, 12667.7255859375f, + 12599.3310546875f, 12530.9072265625f, 12462.4541015625f, 12393.9726562500f, + 12325.4619140625f, 12256.9208984375f, 12188.3525390625f, 12119.7548828125f, + 12051.1279296875f, 11982.4726562500f, 11913.7910156250f, 11845.0800781250f, + 11776.3398437500f, 11707.5732421875f, 11638.7802734375f, 11569.9589843750f, + 11501.1093750000f, 11432.2343750000f, 11363.3310546875f, 11294.4023437500f, + 11225.4462890625f, 11156.4638671875f, 11087.4550781250f, 11018.4199218750f, + 10949.3593750000f, 10880.2734375000f, 10811.1611328125f, 10742.0244140625f, + 10672.8613281250f, 10603.6738281250f, 10534.4609375000f, 10465.2226562500f, + 10395.9609375000f, 10326.6738281250f, 10257.3632812500f, 10188.0283203125f, + 10118.6689453125f, 10049.2861328125f, 9979.8798828125f, 9910.4492187500f, + 9840.9960937500f, 9771.5195312500f, 9702.0312500000f, 9632.5087890625f, + 9562.9638671875f, 9493.3955078125f, 9423.8066406250f, 9354.1943359375f, + 9284.5605468750f, 9214.9042968750f, 9145.2275390625f, 9075.5283203125f, + 9005.8076171875f, 8936.0664062500f, 8866.3037109375f, 8796.5205078125f, + 8726.7158203125f, 8656.8906250000f, 8587.0458984375f, 8517.1806640625f, + 8447.2949218750f, 8377.3896484375f, 8307.4648437500f, 8237.5205078125f, + 8167.5561523438f, 8097.5732421875f, 8027.5712890625f, 7957.5502929688f, + 7887.5102539063f, 7817.4521484375f, 7747.3754882813f, 7677.2807617188f, + 7607.1669921875f, 7537.0366210938f, 7466.8881835938f, 7396.7211914063f, + 7326.5380859375f, 7256.3374023438f, 7186.1191406250f, 7115.8847656250f, + 7045.6323242188f, 6975.3647460938f, 6905.0800781250f, 6834.7792968750f, + 6764.4624023438f, 6694.1293945313f, 6623.7807617188f, 6553.4165039063f, + 6483.0371093750f, 6412.6420898438f, 6342.2324218750f, 6271.8071289063f, + 6201.3676757813f, 6130.9130859375f, 6060.4448242188f, 5989.9624023438f, + 5919.4648437500f, 5848.9648437500f, 5778.4404296875f, 5707.9023437500f, + 5637.3505859375f, 5566.7851562500f, 5496.2075195313f, 5425.6162109375f, + 5355.0122070313f, 5284.3959960938f, 5213.7670898438f, 5143.1264648438f, + 5072.4726562500f, 5001.8076171875f, 4931.1308593750f, 4860.4423828125f, + 4789.7426757813f, 4719.0312500000f, 4648.3090820313f, 4577.5756835938f, + 4506.8315429688f, 4436.0771484375f, 4365.3120117188f, 4294.5366210938f, + 4223.7514648438f, 4152.9555664063f, 4082.1508789063f, 4011.3359375000f, + 3940.5119628906f, 3869.6784667969f, 3798.8359375000f, 3727.9843750000f, + 3657.1240234375f, 3586.2548828125f, 3515.3779296875f, 3444.4921875000f, + 3373.5983886719f, 3302.6967773438f, 3231.7873535156f, 3160.8706054688f, + 3089.9458007813f, 3019.0141601563f, 2948.0751953125f, 2877.1296386719f, + 2806.1770019531f, 2735.2177734375f, 2664.2521972656f, 2593.2805175781f, + 2522.3024902344f, 2451.3186035156f, 2380.3288574219f, 2309.3337402344f, + 2238.3330078125f, 2167.3269042969f, 2096.3159179688f, 2025.3000488281f, + 1954.2901611328f, 1883.2647705078f, 1812.2351074219f, 1741.2010498047f, + 1670.1628417969f, 1599.1207275391f, 1528.0749511719f, 1457.0253906250f, + 1385.9726562500f, 1314.9165039063f, 1243.8572998047f, 1172.7950439453f, + 1101.7302246094f, 1030.6627197266f, 959.5927124023f, 888.5205688477f, + 817.4463500977f, 746.3701171875f, 675.2921142578f, 604.2125854492f, + 533.1316528320f, 462.0494384766f, 390.9661254883f, 319.8818969727f, + 248.7969055176f, 177.7113342285f, 106.6253509521f, 35.5391082764f +}; + +static float g_fWinCoeffesLongShort2Short[2048] = +{ + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 284.3427124023f, 852.9853515625f, 1421.4995117188f, 1989.7996826172f, + 2557.8000488281f, 3125.4152832031f, 3692.5598144531f, 4259.1479492188f, + 4825.0957031250f, 5390.3159179688f, 5954.7250976563f, 6518.2363281250f, + 7080.7670898438f, 7642.2309570313f, 8202.5439453125f, 8761.6210937500f, + 9319.3798828125f, 9875.7353515625f, 10430.6025390625f, 10983.8994140625f, + 11535.5419921875f, 12085.4472656250f, 12633.5332031250f, 13179.7158203125f, + 13723.9130859375f, 14266.0458984375f, 14806.0273437500f, 15343.7802734375f, + 15879.2236328125f, 16412.2734375000f, 16942.8535156250f, 17470.8828125000f, + 17996.2773437500f, 18518.9648437500f, 19038.8632812500f, 19555.8945312500f, + 20069.9804687500f, 20581.0429687500f, 21089.0058593750f, 21593.7929687500f, + 22095.3300781250f, 22593.5371093750f, 23088.3417968750f, 23579.6738281250f, + 24067.4511718750f, 24551.6035156250f, 25032.0605468750f, 25508.7460937500f, + 25981.5917968750f, 26450.5214843750f, 26915.4726562500f, 27376.3652343750f, + 27833.1386718750f, 28285.7187500000f, 28734.0410156250f, 29178.0351562500f, + 29617.6347656250f, 30052.7753906250f, 30483.3867187500f, 30909.4101562500f, + 31330.7792968750f, 31747.4277343750f, 32159.2968750000f, 32566.3222656250f, + 32968.4453125000f, 33365.6015625000f, 33757.7343750000f, 34144.7812500000f, + 34526.6835937500f, 34903.3906250000f, 35274.8398437500f, 35640.9804687500f, + 36001.7500000000f, 36357.0976562500f, 36706.9687500000f, 37051.3164062500f, + 37390.0820312500f, 37723.2148437500f, 38050.6718750000f, 38372.3945312500f, + 38688.3398437500f, 38998.4531250000f, 39302.7031250000f, 39601.0273437500f, + 39893.3906250000f, 40179.7460937500f, 40460.0507812500f, 40734.2656250000f, + 41002.3359375000f, 41264.2421875000f, 41519.9296875000f, 41769.3632812500f, + 42012.5039062500f, 42249.3242187500f, 42479.7773437500f, 42703.8359375000f, + 42921.4609375000f, 43132.6250000000f, 43337.2929687500f, 43535.4296875000f, + 43727.0156250000f, 43912.0195312500f, 44090.4023437500f, 44262.1484375000f, + 44427.2304687500f, 44585.6210937500f, 44737.2929687500f, 44882.2343750000f, + 45020.4140625000f, 45151.8125000000f, 45276.4101562500f, 45394.1953125000f, + 45505.1367187500f, 45609.2304687500f, 45706.4531250000f, 45796.7929687500f, + 45880.2343750000f, 45956.7734375000f, 46026.3867187500f, 46089.0664062500f, + 46144.8085937500f, 46193.6015625000f, 46235.4335937500f, 46270.3046875000f, + 46298.2109375000f, 46319.1406250000f, 46333.0976562500f, 46340.0781250000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.0781250000f, 46333.0976562500f, 46319.1406250000f, 46298.2109375000f, + 46270.3046875000f, 46235.4335937500f, 46193.5976562500f, 46144.8085937500f, + 46089.0664062500f, 46026.3828125000f, 45956.7734375000f, 45880.2343750000f, + 45796.7929687500f, 45706.4531250000f, 45609.2304687500f, 45505.1367187500f, + 45394.1914062500f, 45276.4101562500f, 45151.8125000000f, 45020.4140625000f, + 44882.2304687500f, 44737.2929687500f, 44585.6210937500f, 44427.2265625000f, + 44262.1445312500f, 44090.3984375000f, 43912.0156250000f, 43727.0156250000f, + 43535.4296875000f, 43337.2929687500f, 43132.6250000000f, 42921.4609375000f, + 42703.8320312500f, 42479.7773437500f, 42249.3242187500f, 42012.5039062500f, + 41769.3593750000f, 41519.9257812500f, 41264.2382812500f, 41002.3359375000f, + 40734.2578125000f, 40460.0468750000f, 40179.7460937500f, 39893.3906250000f, + 39601.0273437500f, 39302.7031250000f, 38998.4531250000f, 38688.3320312500f, + 38372.3945312500f, 38050.6679687500f, 37723.2148437500f, 37390.0781250000f, + 37051.3164062500f, 36706.9687500000f, 36357.0937500000f, 36001.7500000000f, + 35640.9804687500f, 35274.8398437500f, 34903.3906250000f, 34526.6796875000f, + 34144.7734375000f, 33757.7265625000f, 33365.6015625000f, 32968.4453125000f, + 32566.3222656250f, 32159.2929687500f, 31747.4257812500f, 31330.7734375000f, + 30909.4042968750f, 30483.3867187500f, 30052.7714843750f, 29617.6308593750f, + 29178.0312500000f, 28734.0351562500f, 28285.7128906250f, 27833.1308593750f, + 27376.3671875000f, 26915.4687500000f, 26450.5195312500f, 25981.5859375000f, + 25508.7421875000f, 25032.0546875000f, 24551.5957031250f, 24067.4511718750f, + 23579.6718750000f, 23088.3417968750f, 22593.5351562500f, 22095.3242187500f, + 21593.7871093750f, 21088.9980468750f, 20581.0429687500f, 20069.9785156250f, + 19555.8906250000f, 19038.8593750000f, 18518.9609375000f, 17996.2714843750f, + 17470.8730468750f, 16942.8535156250f, 16412.2734375000f, 15879.2207031250f, + 15343.7763671875f, 14806.0214843750f, 14266.0380859375f, 13723.9052734375f, + 13179.7158203125f, 12633.5312500000f, 12085.4453125000f, 11535.5371093750f, + 10983.8935546875f, 10430.5947265625f, 9875.7255859375f, 9319.3798828125f, + 8761.6201171875f, 8202.5410156250f, 7642.2260742188f, 7080.7607421875f, + 6518.2290039063f, 5954.7153320313f, 5390.3159179688f, 4825.0937500000f, + 4259.1455078125f, 3692.5549316406f, 3125.4091796875f, 2557.7922363281f, + 1989.7901611328f, 1421.4993896484f, 852.9837036133f, 284.3394775391f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f +}; + +static float g_fWinCoeffesLongLong2Brief[2048] = +{ + 35.5430603027f, 106.6290893555f, 177.7148895264f, 248.8002624512f, + 319.8850097656f, 390.9691162109f, 462.0521850586f, 533.1341552734f, + 604.2149658203f, 675.2943115234f, 746.3720703125f, 817.4480590820f, + 888.5220947266f, 959.5941162109f, 1030.6638183594f, 1101.7310791016f, + 1172.7958984375f, 1243.8579101563f, 1314.9168701172f, 1385.9727783203f, + 1457.0253906250f, 1528.0747070313f, 1599.1203613281f, 1670.1622314453f, + 1741.2001953125f, 1812.2340087891f, 1883.2635498047f, 1954.2888183594f, + 2025.3093261719f, 2096.3251953125f, 2167.3361816406f, 2238.3417968750f, + 2309.3422851563f, 2380.3371582031f, 2451.3269042969f, 2522.3105468750f, + 2593.2880859375f, 2664.2597656250f, 2735.2250976563f, 2806.1840820313f, + 2877.1364746094f, 2948.0820312500f, 3019.0207519531f, 3089.9523925781f, + 3160.8764648438f, 3231.7934570313f, 3302.7026367188f, 3373.6042480469f, + 3444.4975585938f, 3515.3825683594f, 3586.2600097656f, 3657.1286621094f, + 3727.9890136719f, 3798.8403320313f, 3869.6826171875f, 3940.5158691406f, + 4011.3395996094f, 4082.1542968750f, 4152.9594726563f, 4223.7543945313f, + 4294.5395507813f, 4365.3144531250f, 4436.0800781250f, 4506.8339843750f, + 4577.5781250000f, 4648.3110351563f, 4719.0332031250f, 4789.7441406250f, + 4860.4438476563f, 4931.1323242188f, 5001.8085937500f, 5072.4741210938f, + 5143.1269531250f, 5213.7680664063f, 5284.3964843750f, 5355.0122070313f, + 5425.6162109375f, 5496.2070312500f, 5566.7851562500f, 5637.3496093750f, + 5707.9008789063f, 5778.4389648438f, 5848.9633789063f, 5919.4746093750f, + 5989.9716796875f, 6060.4541015625f, 6130.9223632813f, 6201.3769531250f, + 6271.8154296875f, 6342.2402343750f, 6412.6503906250f, 6483.0449218750f, + 6553.4243164063f, 6623.7880859375f, 6694.1372070313f, 6764.4692382813f, + 6834.7856445313f, 6905.0869140625f, 6975.3715820313f, 7045.6386718750f, + 7115.8901367188f, 7186.1250000000f, 7256.3427734375f, 7326.5429687500f, + 7396.7270507813f, 7466.8935546875f, 7537.0415039063f, 7607.1718750000f, + 7677.2851562500f, 7747.3793945313f, 7817.4560546875f, 7887.5141601563f, + 7957.5537109375f, 8027.5747070313f, 8097.5766601563f, 8167.5595703125f, + 8237.5234375000f, 8307.4677734375f, 8377.3925781250f, 8447.2968750000f, + 8517.1826171875f, 8587.0478515625f, 8656.8925781250f, 8726.7167968750f, + 8796.5205078125f, 8866.3046875000f, 8936.0664062500f, 9005.8076171875f, + 9075.5283203125f, 9145.2275390625f, 9214.9042968750f, 9284.5605468750f, + 9354.1943359375f, 9423.8056640625f, 9493.3955078125f, 9562.9628906250f, + 9632.5078125000f, 9702.0292968750f, 9771.5292968750f, 9841.0058593750f, + 9910.4580078125f, 9979.8876953125f, 10049.2949218750f, 10118.6777343750f, + 10188.0361328125f, 10257.3710937500f, 10326.6816406250f, 10395.9677734375f, + 10465.2304687500f, 10534.4677734375f, 10603.6796875000f, 10672.8681640625f, + 10742.0302734375f, 10811.1679687500f, 10880.2792968750f, 10949.3662109375f, + 11018.4267578125f, 11087.4599609375f, 11156.4687500000f, 11225.4511718750f, + 11294.4072265625f, 11363.3359375000f, 11432.2382812500f, 11501.1132812500f, + 11569.9628906250f, 11638.7841796875f, 11707.5781250000f, 11776.3437500000f, + 11845.0839843750f, 11913.7949218750f, 11982.4755859375f, 12051.1308593750f, + 12119.7558593750f, 12188.3554687500f, 12256.9238281250f, 12325.4638671875f, + 12393.9736328125f, 12462.4560546875f, 12530.9082031250f, 12599.3320312500f, + 12667.7255859375f, 12736.0898437500f, 12804.4228515625f, 12872.7255859375f, + 12941.0000000000f, 13009.2421875000f, 13077.4550781250f, 13145.6367187500f, + 13213.7871093750f, 13281.9072265625f, 13349.9931640625f, 13418.0507812500f, + 13486.0751953125f, 13554.0693359375f, 13622.0322265625f, 13689.9609375000f, + 13757.8583984375f, 13825.7226562500f, 13893.5556640625f, 13961.3544921875f, + 14029.1230468750f, 14096.8554687500f, 14164.5566406250f, 14232.2236328125f, + 14299.8574218750f, 14367.4580078125f, 14435.0244140625f, 14502.5566406250f, + 14570.0546875000f, 14637.5185546875f, 14704.9492187500f, 14772.3427734375f, + 14839.7031250000f, 14907.0283203125f, 14974.3183593750f, 15041.5742187500f, + 15108.7949218750f, 15175.9775390625f, 15243.1250000000f, 15310.2382812500f, + 15377.3144531250f, 15444.3554687500f, 15511.3593750000f, 15578.3261718750f, + 15645.2578125000f, 15712.1503906250f, 15779.0078125000f, 15845.8281250000f, + 15912.6103515625f, 15979.3544921875f, 16046.0634765625f, 16112.7324218750f, + 16179.3642578125f, 16245.9580078125f, 16312.5126953125f, 16379.0302734375f, + 16445.5097656250f, 16511.9492187500f, 16578.3496093750f, 16644.7128906250f, + 16711.0351562500f, 16777.3183593750f, 16843.5625000000f, 16909.7656250000f, + 16975.9316406250f, 17042.0566406250f, 17108.1406250000f, 17174.1835937500f, + 17240.1875000000f, 17306.1523437500f, 17372.0742187500f, 17437.9570312500f, + 17503.7968750000f, 17569.5957031250f, 17635.3554687500f, 17701.0722656250f, + 17766.7460937500f, 17832.3789062500f, 17897.9707031250f, 17963.5195312500f, + 18029.0273437500f, 18094.4902343750f, 18159.9140625000f, 18225.2910156250f, + 18290.6289062500f, 18355.9218750000f, 18421.1718750000f, 18486.3789062500f, + 18551.5410156250f, 18616.6621093750f, 18681.7382812500f, 18746.7695312500f, + 18811.7558593750f, 18876.6992187500f, 18941.5976562500f, 19006.4531250000f, + 19071.2617187500f, 19136.0273437500f, 19200.7460937500f, 19265.4218750000f, + 19330.0488281250f, 19394.6328125000f, 19459.1718750000f, 19523.6640625000f, + 19588.1113281250f, 19652.5117187500f, 19716.8652343750f, 19781.1718750000f, + 19845.4335937500f, 19909.6484375000f, 19973.8164062500f, 20037.9355468750f, + 20102.0097656250f, 20166.0351562500f, 20230.0136718750f, 20293.9453125000f, + 20357.8281250000f, 20421.6640625000f, 20485.4511718750f, 20549.1914062500f, + 20612.8828125000f, 20676.5234375000f, 20740.1171875000f, 20803.6621093750f, + 20867.1582031250f, 20930.6054687500f, 20994.0019531250f, 21057.3515625000f, + 21120.6484375000f, 21183.8984375000f, 21247.0976562500f, 21310.2460937500f, + 21373.3457031250f, 21436.3925781250f, 21499.3925781250f, 21562.3378906250f, + 21625.2343750000f, 21688.0820312500f, 21750.8769531250f, 21813.6210937500f, + 21876.3125000000f, 21938.9550781250f, 22001.5429687500f, 22064.0800781250f, + 22126.5644531250f, 22189.0000000000f, 22251.3789062500f, 22313.7089843750f, + 22375.9843750000f, 22438.2089843750f, 22500.3808593750f, 22562.4980468750f, + 22624.5625000000f, 22686.5761718750f, 22748.5332031250f, 22810.4394531250f, + 22872.2890625000f, 22934.0878906250f, 22995.8320312500f, 23057.5175781250f, + 23119.1523437500f, 23180.7324218750f, 23242.2597656250f, 23303.7304687500f, + 23365.1464843750f, 23426.5117187500f, 23487.8164062500f, 23549.0664062500f, + 23610.2636718750f, 23671.4042968750f, 23732.4882812500f, 23793.5175781250f, + 23854.4902343750f, 23915.4023437500f, 23976.2636718750f, 24037.0703125000f, + 24097.8183593750f, 24158.5078125000f, 24219.1406250000f, 24279.7187500000f, + 24340.2363281250f, 24400.6992187500f, 24461.1054687500f, 24521.4511718750f, + 24581.7402343750f, 24641.9746093750f, 24702.1484375000f, 24762.2597656250f, + 24822.3183593750f, 24882.3164062500f, 24942.2578125000f, 25002.1406250000f, + 25061.9628906250f, 25121.7265625000f, 25181.4316406250f, 25241.0800781250f, + 25300.6640625000f, 25360.1914062500f, 25419.6562500000f, 25479.0644531250f, + 25538.4121093750f, 25597.6992187500f, 25656.9238281250f, 25716.0917968750f, + 25775.1972656250f, 25834.2421875000f, 25893.2285156250f, 25952.1523437500f, + 26011.0136718750f, 26069.8164062500f, 26128.5566406250f, 26187.2343750000f, + 26245.8496093750f, 26304.4082031250f, 26362.8984375000f, 26421.3281250000f, + 26479.6992187500f, 26538.0039062500f, 26596.2500000000f, 26654.4316406250f, + 26712.5488281250f, 26770.6074218750f, 26828.5996093750f, 26886.5312500000f, + 26944.3964843750f, 27002.2011718750f, 27059.9394531250f, 27117.6171875000f, + 27175.2265625000f, 27232.7753906250f, 27290.2578125000f, 27347.6796875000f, + 27405.0351562500f, 27462.3261718750f, 27519.5546875000f, 27576.7167968750f, + 27633.8125000000f, 27690.8457031250f, 27747.8105468750f, 27804.7148437500f, + 27861.5488281250f, 27918.3203125000f, 27975.0214843750f, 28031.6621093750f, + 28088.2343750000f, 28144.7421875000f, 28201.1835937500f, 28257.5585937500f, + 28313.8652343750f, 28370.1074218750f, 28426.2812500000f, 28482.3886718750f, + 28538.4277343750f, 28594.4042968750f, 28650.3085937500f, 28706.1484375000f, + 28761.9160156250f, 28817.6191406250f, 28873.2539062500f, 28928.8242187500f, + 28984.3222656250f, 29039.7539062500f, 29095.1171875000f, 29150.4121093750f, + 29205.6386718750f, 29260.7968750000f, 29315.8847656250f, 29370.9023437500f, + 29425.8554687500f, 29480.7363281250f, 29535.5468750000f, 29590.2890625000f, + 29644.9628906250f, 29699.5644531250f, 29754.0976562500f, 29808.5605468750f, + 29862.9531250000f, 29917.2753906250f, 29971.5273437500f, 30025.7089843750f, + 30079.8222656250f, 30133.8613281250f, 30187.8300781250f, 30241.7304687500f, + 30295.5527343750f, 30349.3105468750f, 30402.9941406250f, 30456.6074218750f, + 30510.1484375000f, 30563.6191406250f, 30617.0156250000f, 30670.3417968750f, + 30723.5957031250f, 30776.7753906250f, 30829.8847656250f, 30882.9218750000f, + 30935.8828125000f, 30988.7714843750f, 31041.5898437500f, 31094.3359375000f, + 31147.0058593750f, 31199.6035156250f, 31252.1269531250f, 31304.5800781250f, + 31356.9589843750f, 31409.2636718750f, 31461.4921875000f, 31513.6464843750f, + 31565.7304687500f, 31617.7382812500f, 31669.6679687500f, 31721.5253906250f, + 31773.3105468750f, 31825.0195312500f, 31876.6523437500f, 31928.2128906250f, + 31979.6972656250f, 32031.1054687500f, 32082.4394531250f, 32133.6972656250f, + 32184.8789062500f, 32235.9863281250f, 32287.0175781250f, 32337.9707031250f, + 32388.8496093750f, 32439.6503906250f, 32490.3769531250f, 32541.0253906250f, + 32591.5976562500f, 32642.0957031250f, 32692.5156250000f, 32742.8574218750f, + 32793.1250000000f, 32843.3125000000f, 32893.4218750000f, 32943.4570312500f, + 32993.4140625000f, 33043.2929687500f, 33093.0898437500f, 33142.8125000000f, + 33192.4609375000f, 33242.0273437500f, 33291.5156250000f, 33340.9257812500f, + 33390.2539062500f, 33439.5117187500f, 33488.6835937500f, 33537.7812500000f, + 33586.7968750000f, 33635.7343750000f, 33684.5937500000f, 33733.3750000000f, + 33782.0742187500f, 33830.6914062500f, 33879.2343750000f, 33927.6914062500f, + 33976.0742187500f, 34024.3750000000f, 34072.5976562500f, 34120.7382812500f, + 34168.8007812500f, 34216.7812500000f, 34264.6796875000f, 34312.5000000000f, + 34360.2421875000f, 34407.8945312500f, 34455.4726562500f, 34502.9687500000f, + 34550.3828125000f, 34597.7148437500f, 34644.9687500000f, 34692.1367187500f, + 34739.2265625000f, 34786.2343750000f, 34833.1601562500f, 34880.0039062500f, + 34926.7617187500f, 34973.4414062500f, 35020.0390625000f, 35066.5507812500f, + 35112.9843750000f, 35159.3320312500f, 35205.5976562500f, 35251.7812500000f, + 35297.8789062500f, 35343.8984375000f, 35389.8320312500f, 35435.6835937500f, + 35481.4531250000f, 35527.1367187500f, 35572.7343750000f, 35618.2539062500f, + 35663.6875000000f, 35709.0351562500f, 35754.2968750000f, 35799.4804687500f, + 35844.5781250000f, 35889.5898437500f, 35934.5156250000f, 35979.3593750000f, + 36024.1171875000f, 36068.7929687500f, 36113.3828125000f, 36157.8867187500f, + 36202.3046875000f, 36246.6367187500f, 36290.8867187500f, 36335.0468750000f, + 36379.1250000000f, 36423.1171875000f, 36467.0234375000f, 36510.8437500000f, + 36554.5781250000f, 36598.2265625000f, 36641.7890625000f, 36685.2656250000f, + 36728.6562500000f, 36771.9570312500f, 36815.1757812500f, 36858.3046875000f, + 36901.3515625000f, 36944.3085937500f, 36987.1757812500f, 37029.9570312500f, + 37072.6523437500f, 37115.2617187500f, 37157.7812500000f, 37200.2148437500f, + 37242.5625000000f, 37284.8203125000f, 37326.9921875000f, 37369.0742187500f, + 37411.0703125000f, 37452.9765625000f, 37494.7968750000f, 37536.5234375000f, + 37578.1640625000f, 37619.7226562500f, 37661.1875000000f, 37702.5625000000f, + 37743.8476562500f, 37785.0468750000f, 37826.1601562500f, 37867.1796875000f, + 37908.1132812500f, 37948.9531250000f, 37989.7070312500f, 38030.3750000000f, + 38070.9453125000f, 38111.4335937500f, 38151.8281250000f, 38192.1328125000f, + 38232.3476562500f, 38272.4726562500f, 38312.5078125000f, 38352.4531250000f, + 38392.3085937500f, 38432.0742187500f, 38471.7500000000f, 38511.3320312500f, + 38550.8281250000f, 38590.2304687500f, 38629.5429687500f, 38668.7617187500f, + 38707.8906250000f, 38746.9335937500f, 38785.8789062500f, 38824.7343750000f, + 38863.5000000000f, 38902.1757812500f, 38940.7578125000f, 38979.2460937500f, + 39017.6445312500f, 39055.9531250000f, 39094.1640625000f, 39132.2890625000f, + 39170.3203125000f, 39208.2578125000f, 39246.1054687500f, 39283.8593750000f, + 39321.5234375000f, 39359.0898437500f, 39396.5664062500f, 39433.9531250000f, + 39471.2421875000f, 39508.4414062500f, 39545.5468750000f, 39582.5585937500f, + 39619.4765625000f, 39656.3046875000f, 39693.0351562500f, 39729.6757812500f, + 39766.2226562500f, 39802.6718750000f, 39839.0312500000f, 39875.2929687500f, + 39911.4687500000f, 39947.5429687500f, 39983.5234375000f, 40019.4101562500f, + 40055.2070312500f, 40090.9062500000f, 40126.5156250000f, 40162.0273437500f, + 40197.4414062500f, 40232.7656250000f, 40267.9921875000f, 40303.1289062500f, + 40338.1640625000f, 40373.1093750000f, 40407.9570312500f, 40442.7109375000f, + 40477.3671875000f, 40511.9296875000f, 40546.3984375000f, 40580.7734375000f, + 40615.0468750000f, 40649.2304687500f, 40683.3125000000f, 40717.3046875000f, + 40751.1992187500f, 40784.9960937500f, 40818.6953125000f, 40852.3046875000f, + 40885.8125000000f, 40919.2265625000f, 40952.5429687500f, 40985.7617187500f, + 41018.8867187500f, 41051.9140625000f, 41084.8476562500f, 41117.6796875000f, + 41150.4179687500f, 41183.0625000000f, 41215.6054687500f, 41248.0507812500f, + 41280.4023437500f, 41312.6562500000f, 41344.8125000000f, 41376.8671875000f, + 41408.8281250000f, 41440.6953125000f, 41472.4609375000f, 41504.1289062500f, + 41535.6992187500f, 41567.1757812500f, 41598.5507812500f, 41629.8281250000f, + 41661.0078125000f, 41692.0898437500f, 41723.0742187500f, 41753.9570312500f, + 41784.7460937500f, 41815.4296875000f, 41846.0195312500f, 41876.5117187500f, + 41906.9062500000f, 41937.2031250000f, 41967.3984375000f, 41997.4921875000f, + 42027.4921875000f, 42057.3945312500f, 42087.1953125000f, 42116.8945312500f, + 42146.4960937500f, 42176.0000000000f, 42205.4062500000f, 42234.7070312500f, + 42263.9140625000f, 42293.0195312500f, 42322.0234375000f, 42350.9335937500f, + 42379.7382812500f, 42408.4453125000f, 42437.0546875000f, 42465.5625000000f, + 42493.9726562500f, 42522.2773437500f, 42550.4882812500f, 42578.5937500000f, + 42606.6015625000f, 42634.5039062500f, 42662.3125000000f, 42690.0195312500f, + 42717.6250000000f, 42745.1328125000f, 42772.5351562500f, 42799.8398437500f, + 42827.0429687500f, 42854.1484375000f, 42881.1484375000f, 42908.0507812500f, + 42934.8476562500f, 42961.5468750000f, 42988.1484375000f, 43014.6445312500f, + 43041.0390625000f, 43067.3320312500f, 43093.5273437500f, 43119.6171875000f, + 43145.6093750000f, 43171.4960937500f, 43197.2812500000f, 43222.9687500000f, + 43248.5546875000f, 43274.0351562500f, 43299.4140625000f, 43324.6914062500f, + 43349.8671875000f, 43374.9414062500f, 43399.9140625000f, 43424.7812500000f, + 43449.5507812500f, 43474.2187500000f, 43498.7812500000f, 43523.2382812500f, + 43547.5976562500f, 43571.8554687500f, 43596.0078125000f, 43620.0585937500f, + 43644.0078125000f, 43667.8554687500f, 43691.5976562500f, 43715.2343750000f, + 43738.7734375000f, 43762.2070312500f, 43785.5390625000f, 43808.7656250000f, + 43831.8906250000f, 43854.9140625000f, 43877.8320312500f, 43900.6484375000f, + 43923.3593750000f, 43945.9687500000f, 43968.4726562500f, 43990.8789062500f, + 44013.1718750000f, 44035.3671875000f, 44057.4570312500f, 44079.4492187500f, + 44101.3320312500f, 44123.1132812500f, 44144.7851562500f, 44166.3593750000f, + 44187.8281250000f, 44209.1953125000f, 44230.4531250000f, 44251.6093750000f, + 44272.6601562500f, 44293.6093750000f, 44314.4531250000f, 44335.1953125000f, + 44355.8281250000f, 44376.3593750000f, 44396.7851562500f, 44417.1093750000f, + 44437.3281250000f, 44457.4375000000f, 44477.4453125000f, 44497.3515625000f, + 44517.1484375000f, 44536.8437500000f, 44556.4335937500f, 44575.9179687500f, + 44595.2968750000f, 44614.5703125000f, 44633.7382812500f, 44652.8046875000f, + 44671.7656250000f, 44690.6210937500f, 44709.3710937500f, 44728.0117187500f, + 44746.5507812500f, 44764.9843750000f, 44783.3125000000f, 44801.5351562500f, + 44819.6523437500f, 44837.6640625000f, 44855.5703125000f, 44873.3750000000f, + 44891.0664062500f, 44908.6562500000f, 44926.1406250000f, 44943.5195312500f, + 44960.7929687500f, 44977.9609375000f, 44995.0195312500f, 45011.9765625000f, + 45028.8242187500f, 45045.5664062500f, 45062.2031250000f, 45078.7343750000f, + 45095.1601562500f, 45111.4765625000f, 45127.6914062500f, 45143.7968750000f, + 45159.8007812500f, 45175.6914062500f, 45191.4804687500f, 45207.1601562500f, + 45222.7382812500f, 45238.2070312500f, 45253.5664062500f, 45268.8242187500f, + 45283.9726562500f, 45299.0156250000f, 45313.9531250000f, 45328.7812500000f, + 45343.5039062500f, 45358.1210937500f, 45372.6289062500f, 45387.0312500000f, + 45401.3281250000f, 45415.5195312500f, 45429.5976562500f, 45443.5742187500f, + 45457.4414062500f, 45471.2031250000f, 45484.8593750000f, 45498.4023437500f, + 45511.8437500000f, 45525.1757812500f, 45538.4023437500f, 45551.5234375000f, + 45564.5351562500f, 45577.4414062500f, 45590.2382812500f, 45602.9257812500f, + 45615.5078125000f, 45627.9843750000f, 45640.3515625000f, 45652.6093750000f, + 45664.7656250000f, 45676.8085937500f, 45688.7500000000f, 45700.5781250000f, + 45712.3007812500f, 45723.9179687500f, 45735.4257812500f, 45746.8242187500f, + 45758.1210937500f, 45769.3046875000f, 45780.3789062500f, 45791.3515625000f, + 45802.2109375000f, 45812.9687500000f, 45823.6132812500f, 45834.1484375000f, + 45844.5781250000f, 45854.9023437500f, 45865.1171875000f, 45875.2265625000f, + 45885.2226562500f, 45895.1132812500f, 45904.8945312500f, 45914.5703125000f, + 45924.1367187500f, 45933.5976562500f, 45942.9492187500f, 45952.1914062500f, + 45961.3242187500f, 45970.3515625000f, 45979.2695312500f, 45988.0820312500f, + 45996.7812500000f, 46005.3750000000f, 46013.8593750000f, 46022.2382812500f, + 46030.5039062500f, 46038.6679687500f, 46046.7187500000f, 46054.6640625000f, + 46062.5000000000f, 46070.2226562500f, 46077.8437500000f, 46085.3515625000f, + 46092.7539062500f, 46100.0468750000f, 46107.2304687500f, 46114.3085937500f, + 46121.2734375000f, 46128.1367187500f, 46134.8867187500f, 46141.5273437500f, + 46148.0625000000f, 46154.4843750000f, 46160.8007812500f, 46167.0078125000f, + 46173.1093750000f, 46179.0976562500f, 46184.9804687500f, 46190.7539062500f, + 46196.4179687500f, 46201.9726562500f, 46207.4179687500f, 46212.7578125000f, + 46217.9882812500f, 46223.1093750000f, 46228.1210937500f, 46233.0234375000f, + 46237.8164062500f, 46242.5039062500f, 46247.0820312500f, 46251.5468750000f, + 46255.9062500000f, 46260.1562500000f, 46264.2968750000f, 46268.3281250000f, + 46272.2539062500f, 46276.0703125000f, 46279.7773437500f, 46283.3710937500f, + 46286.8593750000f, 46290.2382812500f, 46293.5078125000f, 46296.6679687500f, + 46299.7226562500f, 46302.6679687500f, 46305.5000000000f, 46308.2265625000f, + 46310.8437500000f, 46313.3515625000f, 46315.7460937500f, 46318.0390625000f, + 46320.2187500000f, 46322.2890625000f, 46324.2539062500f, 46326.1054687500f, + 46327.8515625000f, 46329.4882812500f, 46331.0156250000f, 46332.4296875000f, + 46333.7382812500f, 46334.9375000000f, 46336.0312500000f, 46337.0117187500f, + 46337.8828125000f, 46338.6445312500f, 46339.3007812500f, 46339.8437500000f, + 46340.2812500000f, 46340.6093750000f, 46340.8281250000f, 46340.9335937500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46326.9921875000f, 46215.3867187500f, 45992.4414062500f, 45658.7031250000f, + 45214.9609375000f, 44662.2968750000f, 44002.0351562500f, 43235.7734375000f, + 42365.3476562500f, 41392.8632812500f, 40320.6601562500f, 39151.3125000000f, + 37887.6562500000f, 36532.7187500000f, 35089.7773437500f, 33562.2929687500f, + 31953.9609375000f, 30268.6503906250f, 28510.4121093750f, 26683.4960937500f, + 24792.2910156250f, 22841.3671875000f, 20835.4179687500f, 18779.2636718750f, + 16677.8789062500f, 14536.3027343750f, 12359.7207031250f, 10153.3515625000f, + 7922.5327148438f, 5672.6279296875f, 3409.0463867188f, 1137.2629394531f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f +}; + +static float g_fWinCoeffesLongBrief2Long[2048] = +{ + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 1137.2637939453f, 3409.0517578125f, 5672.6269531250f, 7922.5366210938f, + 10153.3593750000f, 12359.7236328125f, 14536.3105468750f, 16677.8789062500f, + 18779.2675781250f, 20835.4160156250f, 22841.3710937500f, 24792.2988281250f, + 26683.5000000000f, 28510.4179687500f, 30268.6503906250f, 31953.9648437500f, + 33562.2968750000f, 35089.7773437500f, 36532.7226562500f, 37887.6562500000f, + 39151.3164062500f, 40320.6562500000f, 41392.8632812500f, 42365.3476562500f, + 43235.7734375000f, 44002.0390625000f, 44662.2968750000f, 45214.9609375000f, + 45658.7031250000f, 45992.4453125000f, 46215.3867187500f, 46326.9921875000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9335937500f, 46340.8281250000f, 46340.6093750000f, 46340.2812500000f, + 46339.8437500000f, 46339.3007812500f, 46338.6445312500f, 46337.8828125000f, + 46337.0117187500f, 46336.0312500000f, 46334.9375000000f, 46333.7382812500f, + 46332.4296875000f, 46331.0156250000f, 46329.4882812500f, 46327.8515625000f, + 46326.1054687500f, 46324.2539062500f, 46322.2890625000f, 46320.2187500000f, + 46318.0390625000f, 46315.7460937500f, 46313.3515625000f, 46310.8437500000f, + 46308.2265625000f, 46305.5000000000f, 46302.6679687500f, 46299.7226562500f, + 46296.6679687500f, 46293.5078125000f, 46290.2382812500f, 46286.8593750000f, + 46283.3710937500f, 46279.7734375000f, 46276.0703125000f, 46272.2539062500f, + 46268.3281250000f, 46264.2968750000f, 46260.1562500000f, 46255.9062500000f, + 46251.5468750000f, 46247.0820312500f, 46242.5039062500f, 46237.8164062500f, + 46233.0234375000f, 46228.1171875000f, 46223.1093750000f, 46217.9882812500f, + 46212.7578125000f, 46207.4179687500f, 46201.9726562500f, 46196.4179687500f, + 46190.7539062500f, 46184.9804687500f, 46179.0976562500f, 46173.1093750000f, + 46167.0078125000f, 46160.8007812500f, 46154.4843750000f, 46148.0625000000f, + 46141.5273437500f, 46134.8867187500f, 46128.1367187500f, 46121.2734375000f, + 46114.3085937500f, 46107.2304687500f, 46100.0468750000f, 46092.7539062500f, + 46085.3515625000f, 46077.8437500000f, 46070.2226562500f, 46062.4960937500f, + 46054.6640625000f, 46046.7187500000f, 46038.6679687500f, 46030.5039062500f, + 46022.2382812500f, 46013.8593750000f, 46005.3750000000f, 45996.7812500000f, + 45988.0781250000f, 45979.2695312500f, 45970.3515625000f, 45961.3242187500f, + 45952.1914062500f, 45942.9492187500f, 45933.5976562500f, 45924.1367187500f, + 45914.5703125000f, 45904.8945312500f, 45895.1132812500f, 45885.2226562500f, + 45875.2226562500f, 45865.1171875000f, 45854.9023437500f, 45844.5781250000f, + 45834.1484375000f, 45823.6132812500f, 45812.9648437500f, 45802.2109375000f, + 45791.3515625000f, 45780.3789062500f, 45769.3046875000f, 45758.1171875000f, + 45746.8242187500f, 45735.4257812500f, 45723.9140625000f, 45712.3007812500f, + 45700.5781250000f, 45688.7500000000f, 45676.8085937500f, 45664.7656250000f, + 45652.6093750000f, 45640.3515625000f, 45627.9804687500f, 45615.5078125000f, + 45602.9257812500f, 45590.2343750000f, 45577.4375000000f, 45564.5312500000f, + 45551.5234375000f, 45538.4023437500f, 45525.1757812500f, 45511.8437500000f, + 45498.4023437500f, 45484.8593750000f, 45471.2031250000f, 45457.4414062500f, + 45443.5742187500f, 45429.5976562500f, 45415.5156250000f, 45401.3242187500f, + 45387.0312500000f, 45372.6289062500f, 45358.1210937500f, 45343.5039062500f, + 45328.7812500000f, 45313.9531250000f, 45299.0117187500f, 45283.9726562500f, + 45268.8242187500f, 45253.5664062500f, 45238.2070312500f, 45222.7382812500f, + 45207.1601562500f, 45191.4804687500f, 45175.6914062500f, 45159.8007812500f, + 45143.7968750000f, 45127.6914062500f, 45111.4765625000f, 45095.1601562500f, + 45078.7343750000f, 45062.2031250000f, 45045.5664062500f, 45028.8242187500f, + 45011.9765625000f, 44995.0195312500f, 44977.9609375000f, 44960.7929687500f, + 44943.5195312500f, 44926.1406250000f, 44908.6562500000f, 44891.0664062500f, + 44873.3710937500f, 44855.5703125000f, 44837.6640625000f, 44819.6523437500f, + 44801.5351562500f, 44783.3125000000f, 44764.9843750000f, 44746.5507812500f, + 44728.0117187500f, 44709.3671875000f, 44690.6171875000f, 44671.7617187500f, + 44652.8046875000f, 44633.7382812500f, 44614.5703125000f, 44595.2929687500f, + 44575.9179687500f, 44556.4335937500f, 44536.8437500000f, 44517.1484375000f, + 44497.3515625000f, 44477.4453125000f, 44457.4375000000f, 44437.3242187500f, + 44417.1093750000f, 44396.7851562500f, 44376.3593750000f, 44355.8281250000f, + 44335.1914062500f, 44314.4531250000f, 44293.6093750000f, 44272.6601562500f, + 44251.6093750000f, 44230.4492187500f, 44209.1914062500f, 44187.8242187500f, + 44166.3593750000f, 44144.7851562500f, 44123.1093750000f, 44101.3281250000f, + 44079.4453125000f, 44057.4570312500f, 44035.3671875000f, 44013.1718750000f, + 43990.8750000000f, 43968.4726562500f, 43945.9687500000f, 43923.3593750000f, + 43900.6445312500f, 43877.8320312500f, 43854.9101562500f, 43831.8906250000f, + 43808.7656250000f, 43785.5390625000f, 43762.2070312500f, 43738.7695312500f, + 43715.2343750000f, 43691.5937500000f, 43667.8515625000f, 43644.0039062500f, + 43620.0585937500f, 43596.0078125000f, 43571.8515625000f, 43547.5976562500f, + 43523.2382812500f, 43498.7773437500f, 43474.2148437500f, 43449.5468750000f, + 43424.7812500000f, 43399.9140625000f, 43374.9414062500f, 43349.8671875000f, + 43324.6914062500f, 43299.4140625000f, 43274.0351562500f, 43248.5507812500f, + 43222.9687500000f, 43197.2812500000f, 43171.4960937500f, 43145.6054687500f, + 43119.6171875000f, 43093.5273437500f, 43067.3320312500f, 43041.0351562500f, + 43014.6406250000f, 42988.1445312500f, 42961.5468750000f, 42934.8476562500f, + 42908.0468750000f, 42881.1484375000f, 42854.1445312500f, 42827.0429687500f, + 42799.8398437500f, 42772.5351562500f, 42745.1289062500f, 42717.6250000000f, + 42690.0195312500f, 42662.3125000000f, 42634.5039062500f, 42606.5976562500f, + 42578.5898437500f, 42550.4843750000f, 42522.2773437500f, 42493.9687500000f, + 42465.5625000000f, 42437.0546875000f, 42408.4453125000f, 42379.7382812500f, + 42350.9296875000f, 42322.0234375000f, 42293.0156250000f, 42263.9140625000f, + 42234.7070312500f, 42205.4023437500f, 42176.0000000000f, 42146.4921875000f, + 42116.8945312500f, 42087.1953125000f, 42057.3945312500f, 42027.4921875000f, + 41997.4921875000f, 41967.3984375000f, 41937.2031250000f, 41906.9062500000f, + 41876.5117187500f, 41846.0195312500f, 41815.4296875000f, 41784.7421875000f, + 41753.9570312500f, 41723.0703125000f, 41692.0859375000f, 41661.0039062500f, + 41629.8242187500f, 41598.5468750000f, 41567.1718750000f, 41535.6992187500f, + 41504.1289062500f, 41472.4570312500f, 41440.6953125000f, 41408.8281250000f, + 41376.8671875000f, 41344.8085937500f, 41312.6562500000f, 41280.4023437500f, + 41248.0507812500f, 41215.6015625000f, 41183.0585937500f, 41150.4179687500f, + 41117.6796875000f, 41084.8437500000f, 41051.9140625000f, 41018.8867187500f, + 40985.7617187500f, 40952.5390625000f, 40919.2226562500f, 40885.8085937500f, + 40852.2968750000f, 40818.6953125000f, 40784.9921875000f, 40751.1914062500f, + 40717.2968750000f, 40683.3085937500f, 40649.2226562500f, 40615.0429687500f, + 40580.7656250000f, 40546.3945312500f, 40511.9257812500f, 40477.3632812500f, + 40442.7109375000f, 40407.9570312500f, 40373.1093750000f, 40338.1640625000f, + 40303.1289062500f, 40267.9921875000f, 40232.7656250000f, 40197.4414062500f, + 40162.0273437500f, 40126.5156250000f, 40090.9101562500f, 40055.2109375000f, + 40019.4140625000f, 39983.5234375000f, 39947.5429687500f, 39911.4648437500f, + 39875.2929687500f, 39839.0273437500f, 39802.6679687500f, 39766.2187500000f, + 39729.6718750000f, 39693.0312500000f, 39656.3007812500f, 39619.4726562500f, + 39582.5546875000f, 39545.5429687500f, 39508.4375000000f, 39471.2421875000f, + 39433.9492187500f, 39396.5625000000f, 39359.0859375000f, 39321.5195312500f, + 39283.8593750000f, 39246.1015625000f, 39208.2539062500f, 39170.3164062500f, + 39132.2851562500f, 39094.1640625000f, 39055.9492187500f, 39017.6406250000f, + 38979.2421875000f, 38940.7500000000f, 38902.1679687500f, 38863.4960937500f, + 38824.7304687500f, 38785.8750000000f, 38746.9257812500f, 38707.8906250000f, + 38668.7578125000f, 38629.5351562500f, 38590.2265625000f, 38550.8242187500f, + 38511.3281250000f, 38471.7460937500f, 38432.0703125000f, 38392.3125000000f, + 38352.4531250000f, 38312.5117187500f, 38272.4726562500f, 38232.3476562500f, + 38192.1328125000f, 38151.8281250000f, 38111.4296875000f, 38070.9453125000f, + 38030.3750000000f, 37989.7070312500f, 37948.9531250000f, 37908.1132812500f, + 37867.1796875000f, 37826.1562500000f, 37785.0468750000f, 37743.8476562500f, + 37702.5585937500f, 37661.1835937500f, 37619.7187500000f, 37578.1640625000f, + 37536.5234375000f, 37494.7929687500f, 37452.9726562500f, 37411.0664062500f, + 37369.0703125000f, 37326.9882812500f, 37284.8164062500f, 37242.5585937500f, + 37200.2148437500f, 37157.7812500000f, 37115.2578125000f, 37072.6484375000f, + 37029.9570312500f, 36987.1718750000f, 36944.3007812500f, 36901.3437500000f, + 36858.3007812500f, 36815.1718750000f, 36771.9531250000f, 36728.6484375000f, + 36685.2617187500f, 36641.7851562500f, 36598.2226562500f, 36554.5742187500f, + 36510.8398437500f, 36467.0195312500f, 36423.1132812500f, 36379.1210937500f, + 36335.0429687500f, 36290.8789062500f, 36246.6328125000f, 36202.2968750000f, + 36157.8789062500f, 36113.3750000000f, 36068.7851562500f, 36024.1171875000f, + 35979.3593750000f, 35934.5156250000f, 35889.5898437500f, 35844.5781250000f, + 35799.4804687500f, 35754.2968750000f, 35709.0351562500f, 35663.6835937500f, + 35618.2539062500f, 35572.7343750000f, 35527.1367187500f, 35481.4531250000f, + 35435.6835937500f, 35389.8320312500f, 35343.8984375000f, 35297.8789062500f, + 35251.7812500000f, 35205.5976562500f, 35159.3281250000f, 35112.9804687500f, + 35066.5507812500f, 35020.0351562500f, 34973.4414062500f, 34926.7617187500f, + 34880.0000000000f, 34833.1562500000f, 34786.2304687500f, 34739.2265625000f, + 34692.1367187500f, 34644.9648437500f, 34597.7109375000f, 34550.3789062500f, + 34502.9648437500f, 34455.4687500000f, 34407.8945312500f, 34360.2343750000f, + 34312.4960937500f, 34264.6757812500f, 34216.7734375000f, 34168.7968750000f, + 34120.7343750000f, 34072.5937500000f, 34024.3710937500f, 33976.0703125000f, + 33927.6914062500f, 33879.2265625000f, 33830.6875000000f, 33782.0664062500f, + 33733.3671875000f, 33684.5859375000f, 33635.7304687500f, 33586.7890625000f, + 33537.7734375000f, 33488.6796875000f, 33439.5117187500f, 33390.2578125000f, + 33340.9257812500f, 33291.5156250000f, 33242.0273437500f, 33192.4609375000f, + 33142.8164062500f, 33093.0898437500f, 33043.2890625000f, 32993.4101562500f, + 32943.4570312500f, 32893.4218750000f, 32843.3125000000f, 32793.1250000000f, + 32742.8574218750f, 32692.5156250000f, 32642.0957031250f, 32591.5976562500f, + 32541.0253906250f, 32490.3769531250f, 32439.6503906250f, 32388.8457031250f, + 32337.9667968750f, 32287.0136718750f, 32235.9843750000f, 32184.8769531250f, + 32133.6933593750f, 32082.4375000000f, 32031.1015625000f, 31979.6933593750f, + 31928.2109375000f, 31876.6484375000f, 31825.0175781250f, 31773.3066406250f, + 31721.5214843750f, 31669.6640625000f, 31617.7324218750f, 31565.7246093750f, + 31513.6406250000f, 31461.4863281250f, 31409.2578125000f, 31356.9531250000f, + 31304.5742187500f, 31252.1250000000f, 31199.5996093750f, 31147.0000000000f, + 31094.3300781250f, 31041.5839843750f, 30988.7656250000f, 30935.8769531250f, + 30882.9121093750f, 30829.8769531250f, 30776.7695312500f, 30723.5878906250f, + 30670.3339843750f, 30617.0078125000f, 30563.6191406250f, 30510.1484375000f, + 30456.6074218750f, 30402.9941406250f, 30349.3105468750f, 30295.5566406250f, + 30241.7265625000f, 30187.8300781250f, 30133.8613281250f, 30079.8183593750f, + 30025.7089843750f, 29971.5273437500f, 29917.2753906250f, 29862.9531250000f, + 29808.5585937500f, 29754.0976562500f, 29699.5644531250f, 29644.9589843750f, + 29590.2890625000f, 29535.5468750000f, 29480.7343750000f, 29425.8535156250f, + 29370.9003906250f, 29315.8808593750f, 29260.7929687500f, 29205.6367187500f, + 29150.4101562500f, 29095.1152343750f, 29039.7500000000f, 28984.3203125000f, + 28928.8203125000f, 28873.2519531250f, 28817.6171875000f, 28761.9140625000f, + 28706.1425781250f, 28650.3027343750f, 28594.3984375000f, 28538.4238281250f, + 28482.3828125000f, 28426.2753906250f, 28370.1015625000f, 28313.8593750000f, + 28257.5527343750f, 28201.1777343750f, 28144.7363281250f, 28088.2285156250f, + 28031.6562500000f, 27975.0156250000f, 27918.3125000000f, 27861.5429687500f, + 27804.7050781250f, 27747.8027343750f, 27690.8378906250f, 27633.8046875000f, + 27576.7089843750f, 27519.5546875000f, 27462.3281250000f, 27405.0351562500f, + 27347.6796875000f, 27290.2617187500f, 27232.7753906250f, 27175.2285156250f, + 27117.6171875000f, 27059.9394531250f, 27002.1972656250f, 26944.3945312500f, + 26886.5273437500f, 26828.5976562500f, 26770.6074218750f, 26712.5488281250f, + 26654.4316406250f, 26596.2500000000f, 26538.0039062500f, 26479.6992187500f, + 26421.3281250000f, 26362.8964843750f, 26304.4023437500f, 26245.8476562500f, + 26187.2304687500f, 26128.5527343750f, 26069.8105468750f, 26011.0117187500f, + 25952.1464843750f, 25893.2246093750f, 25834.2402343750f, 25775.1933593750f, + 25716.0898437500f, 25656.9218750000f, 25597.6933593750f, 25538.4062500000f, + 25479.0585937500f, 25419.6523437500f, 25360.1855468750f, 25300.6582031250f, + 25241.0703125000f, 25181.4257812500f, 25121.7226562500f, 25061.9570312500f, + 25002.1347656250f, 24942.2519531250f, 24882.3105468750f, 24822.3125000000f, + 24762.2539062500f, 24702.1406250000f, 24641.9667968750f, 24581.7324218750f, + 24521.4433593750f, 24461.0957031250f, 24400.6914062500f, 24340.2285156250f, + 24279.7187500000f, 24219.1406250000f, 24158.5078125000f, 24097.8183593750f, + 24037.0703125000f, 23976.2675781250f, 23915.4062500000f, 23854.4902343750f, + 23793.5156250000f, 23732.4863281250f, 23671.4023437500f, 23610.2617187500f, + 23549.0664062500f, 23487.8164062500f, 23426.5078125000f, 23365.1464843750f, + 23303.7304687500f, 23242.2597656250f, 23180.7324218750f, 23119.1523437500f, + 23057.5175781250f, 22995.8281250000f, 22934.0839843750f, 22872.2871093750f, + 22810.4355468750f, 22748.5312500000f, 22686.5722656250f, 22624.5605468750f, + 22562.4960937500f, 22500.3769531250f, 22438.2070312500f, 22375.9824218750f, + 22313.7050781250f, 22251.3769531250f, 22188.9960937500f, 22126.5605468750f, + 22064.0742187500f, 22001.5371093750f, 21938.9472656250f, 21876.3066406250f, + 21813.6132812500f, 21750.8710937500f, 21688.0742187500f, 21625.2285156250f, + 21562.3320312500f, 21499.3847656250f, 21436.3867187500f, 21373.3378906250f, + 21310.2382812500f, 21247.0898437500f, 21183.8906250000f, 21120.6406250000f, + 21057.3417968750f, 20993.9941406250f, 20930.5957031250f, 20867.1503906250f, + 20803.6640625000f, 20740.1191406250f, 20676.5234375000f, 20612.8828125000f, + 20549.1914062500f, 20485.4511718750f, 20421.6640625000f, 20357.8281250000f, + 20293.9453125000f, 20230.0136718750f, 20166.0351562500f, 20102.0097656250f, + 20037.9355468750f, 19973.8144531250f, 19909.6484375000f, 19845.4316406250f, + 19781.1718750000f, 19716.8632812500f, 19652.5097656250f, 19588.1093750000f, + 19523.6621093750f, 19459.1699218750f, 19394.6308593750f, 19330.0488281250f, + 19265.4179687500f, 19200.7441406250f, 19136.0234375000f, 19071.2578125000f, + 19006.4492187500f, 18941.5937500000f, 18876.6953125000f, 18811.7519531250f, + 18746.7636718750f, 18681.7324218750f, 18616.6562500000f, 18551.5351562500f, + 18486.3730468750f, 18421.1660156250f, 18355.9160156250f, 18290.6210937500f, + 18225.2851562500f, 18159.9062500000f, 18094.4843750000f, 18029.0195312500f, + 17963.5136718750f, 17897.9628906250f, 17832.3730468750f, 17766.7382812500f, + 17701.0625000000f, 17635.3457031250f, 17569.5878906250f, 17503.7890625000f, + 17437.9472656250f, 17372.0664062500f, 17306.1425781250f, 17240.1894531250f, + 17174.1855468750f, 17108.1425781250f, 17042.0566406250f, 16975.9316406250f, + 16909.7656250000f, 16843.5625000000f, 16777.3183593750f, 16711.0351562500f, + 16644.7128906250f, 16578.3496093750f, 16511.9492187500f, 16445.5078125000f, + 16379.0292968750f, 16312.5107421875f, 16245.9560546875f, 16179.3623046875f, + 16112.7304687500f, 16046.0605468750f, 15979.3525390625f, 15912.6074218750f, + 15845.8251953125f, 15779.0048828125f, 15712.1474609375f, 15645.2539062500f, + 15578.3232421875f, 15511.3554687500f, 15444.3515625000f, 15377.3095703125f, + 15310.2343750000f, 15243.1210937500f, 15175.9726562500f, 15108.7890625000f, + 15041.5683593750f, 14974.3144531250f, 14907.0234375000f, 14839.6972656250f, + 14772.3369140625f, 14704.9423828125f, 14637.5136718750f, 14570.0478515625f, + 14502.5498046875f, 14435.0166015625f, 14367.4511718750f, 14299.8505859375f, + 14232.2167968750f, 14164.5488281250f, 14096.8486328125f, 14029.1142578125f, + 13961.3466796875f, 13893.5468750000f, 13825.7148437500f, 13757.8486328125f, + 13689.9511718750f, 13622.0224609375f, 13554.0712890625f, 13486.0771484375f, + 13418.0527343750f, 13349.9951171875f, 13281.9072265625f, 13213.7871093750f, + 13145.6367187500f, 13077.4550781250f, 13009.2421875000f, 12941.0000000000f, + 12872.7265625000f, 12804.4218750000f, 12736.0878906250f, 12667.7255859375f, + 12599.3310546875f, 12530.9072265625f, 12462.4541015625f, 12393.9726562500f, + 12325.4619140625f, 12256.9208984375f, 12188.3525390625f, 12119.7548828125f, + 12051.1279296875f, 11982.4726562500f, 11913.7910156250f, 11845.0800781250f, + 11776.3398437500f, 11707.5732421875f, 11638.7802734375f, 11569.9589843750f, + 11501.1093750000f, 11432.2343750000f, 11363.3310546875f, 11294.4023437500f, + 11225.4462890625f, 11156.4638671875f, 11087.4550781250f, 11018.4199218750f, + 10949.3593750000f, 10880.2734375000f, 10811.1611328125f, 10742.0244140625f, + 10672.8613281250f, 10603.6738281250f, 10534.4609375000f, 10465.2226562500f, + 10395.9609375000f, 10326.6738281250f, 10257.3632812500f, 10188.0283203125f, + 10118.6689453125f, 10049.2861328125f, 9979.8798828125f, 9910.4492187500f, + 9840.9960937500f, 9771.5195312500f, 9702.0312500000f, 9632.5087890625f, + 9562.9638671875f, 9493.3955078125f, 9423.8066406250f, 9354.1943359375f, + 9284.5605468750f, 9214.9042968750f, 9145.2275390625f, 9075.5283203125f, + 9005.8076171875f, 8936.0664062500f, 8866.3037109375f, 8796.5205078125f, + 8726.7158203125f, 8656.8906250000f, 8587.0458984375f, 8517.1806640625f, + 8447.2949218750f, 8377.3896484375f, 8307.4648437500f, 8237.5205078125f, + 8167.5561523438f, 8097.5732421875f, 8027.5712890625f, 7957.5502929688f, + 7887.5102539063f, 7817.4521484375f, 7747.3754882813f, 7677.2807617188f, + 7607.1669921875f, 7537.0366210938f, 7466.8881835938f, 7396.7211914063f, + 7326.5380859375f, 7256.3374023438f, 7186.1191406250f, 7115.8847656250f, + 7045.6323242188f, 6975.3647460938f, 6905.0800781250f, 6834.7792968750f, + 6764.4624023438f, 6694.1293945313f, 6623.7807617188f, 6553.4165039063f, + 6483.0371093750f, 6412.6420898438f, 6342.2324218750f, 6271.8071289063f, + 6201.3676757813f, 6130.9130859375f, 6060.4448242188f, 5989.9624023438f, + 5919.4648437500f, 5848.9648437500f, 5778.4404296875f, 5707.9023437500f, + 5637.3505859375f, 5566.7851562500f, 5496.2075195313f, 5425.6162109375f, + 5355.0122070313f, 5284.3959960938f, 5213.7670898438f, 5143.1264648438f, + 5072.4726562500f, 5001.8076171875f, 4931.1308593750f, 4860.4423828125f, + 4789.7426757813f, 4719.0312500000f, 4648.3090820313f, 4577.5756835938f, + 4506.8315429688f, 4436.0771484375f, 4365.3120117188f, 4294.5366210938f, + 4223.7514648438f, 4152.9555664063f, 4082.1508789063f, 4011.3359375000f, + 3940.5119628906f, 3869.6784667969f, 3798.8359375000f, 3727.9843750000f, + 3657.1240234375f, 3586.2548828125f, 3515.3779296875f, 3444.4921875000f, + 3373.5983886719f, 3302.6967773438f, 3231.7873535156f, 3160.8706054688f, + 3089.9458007813f, 3019.0141601563f, 2948.0751953125f, 2877.1296386719f, + 2806.1770019531f, 2735.2177734375f, 2664.2521972656f, 2593.2805175781f, + 2522.3024902344f, 2451.3186035156f, 2380.3288574219f, 2309.3337402344f, + 2238.3330078125f, 2167.3269042969f, 2096.3159179688f, 2025.3000488281f, + 1954.2901611328f, 1883.2647705078f, 1812.2351074219f, 1741.2010498047f, + 1670.1628417969f, 1599.1207275391f, 1528.0749511719f, 1457.0253906250f, + 1385.9726562500f, 1314.9165039063f, 1243.8572998047f, 1172.7950439453f, + 1101.7302246094f, 1030.6627197266f, 959.5927124023f, 888.5205688477f, + 817.4463500977f, 746.3701171875f, 675.2921142578f, 604.2125854492f, + 533.1316528320f, 462.0494384766f, 390.9661254883f, 319.8818969727f, + 248.7969055176f, 177.7113342285f, 106.6253509521f, 35.5391082764f +}; + +static float g_fWinCoeffesLongBrief2Brief[2048] = +{ + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 1137.2637939453f, 3409.0517578125f, 5672.6269531250f, 7922.5366210938f, + 10153.3593750000f, 12359.7236328125f, 14536.3105468750f, 16677.8789062500f, + 18779.2675781250f, 20835.4160156250f, 22841.3710937500f, 24792.2988281250f, + 26683.5000000000f, 28510.4179687500f, 30268.6503906250f, 31953.9648437500f, + 33562.2968750000f, 35089.7773437500f, 36532.7226562500f, 37887.6562500000f, + 39151.3164062500f, 40320.6562500000f, 41392.8632812500f, 42365.3476562500f, + 43235.7734375000f, 44002.0390625000f, 44662.2968750000f, 45214.9609375000f, + 45658.7031250000f, 45992.4453125000f, 46215.3867187500f, 46326.9921875000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46326.9921875000f, 46215.3867187500f, 45992.4414062500f, 45658.7031250000f, + 45214.9609375000f, 44662.2968750000f, 44002.0351562500f, 43235.7734375000f, + 42365.3476562500f, 41392.8632812500f, 40320.6601562500f, 39151.3125000000f, + 37887.6562500000f, 36532.7187500000f, 35089.7773437500f, 33562.2929687500f, + 31953.9609375000f, 30268.6503906250f, 28510.4121093750f, 26683.4960937500f, + 24792.2910156250f, 22841.3671875000f, 20835.4179687500f, 18779.2636718750f, + 16677.8789062500f, 14536.3027343750f, 12359.7207031250f, 10153.3515625000f, + 7922.5327148438f, 5672.6279296875f, 3409.0463867188f, 1137.2629394531f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f +}; + +static float g_fWinCoeffesLongShort2Brief[2048] = +{ + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 284.3427124023f, 852.9853515625f, 1421.4995117188f, 1989.7996826172f, + 2557.8000488281f, 3125.4152832031f, 3692.5598144531f, 4259.1479492188f, + 4825.0957031250f, 5390.3159179688f, 5954.7250976563f, 6518.2363281250f, + 7080.7670898438f, 7642.2309570313f, 8202.5439453125f, 8761.6210937500f, + 9319.3798828125f, 9875.7353515625f, 10430.6025390625f, 10983.8994140625f, + 11535.5419921875f, 12085.4472656250f, 12633.5332031250f, 13179.7158203125f, + 13723.9130859375f, 14266.0458984375f, 14806.0273437500f, 15343.7802734375f, + 15879.2236328125f, 16412.2734375000f, 16942.8535156250f, 17470.8828125000f, + 17996.2773437500f, 18518.9648437500f, 19038.8632812500f, 19555.8945312500f, + 20069.9804687500f, 20581.0429687500f, 21089.0058593750f, 21593.7929687500f, + 22095.3300781250f, 22593.5371093750f, 23088.3417968750f, 23579.6738281250f, + 24067.4511718750f, 24551.6035156250f, 25032.0605468750f, 25508.7460937500f, + 25981.5917968750f, 26450.5214843750f, 26915.4726562500f, 27376.3652343750f, + 27833.1386718750f, 28285.7187500000f, 28734.0410156250f, 29178.0351562500f, + 29617.6347656250f, 30052.7753906250f, 30483.3867187500f, 30909.4101562500f, + 31330.7792968750f, 31747.4277343750f, 32159.2968750000f, 32566.3222656250f, + 32968.4453125000f, 33365.6015625000f, 33757.7343750000f, 34144.7812500000f, + 34526.6835937500f, 34903.3906250000f, 35274.8398437500f, 35640.9804687500f, + 36001.7500000000f, 36357.0976562500f, 36706.9687500000f, 37051.3164062500f, + 37390.0820312500f, 37723.2148437500f, 38050.6718750000f, 38372.3945312500f, + 38688.3398437500f, 38998.4531250000f, 39302.7031250000f, 39601.0273437500f, + 39893.3906250000f, 40179.7460937500f, 40460.0507812500f, 40734.2656250000f, + 41002.3359375000f, 41264.2421875000f, 41519.9296875000f, 41769.3632812500f, + 42012.5039062500f, 42249.3242187500f, 42479.7773437500f, 42703.8359375000f, + 42921.4609375000f, 43132.6250000000f, 43337.2929687500f, 43535.4296875000f, + 43727.0156250000f, 43912.0195312500f, 44090.4023437500f, 44262.1484375000f, + 44427.2304687500f, 44585.6210937500f, 44737.2929687500f, 44882.2343750000f, + 45020.4140625000f, 45151.8125000000f, 45276.4101562500f, 45394.1953125000f, + 45505.1367187500f, 45609.2304687500f, 45706.4531250000f, 45796.7929687500f, + 45880.2343750000f, 45956.7734375000f, 46026.3867187500f, 46089.0664062500f, + 46144.8085937500f, 46193.6015625000f, 46235.4335937500f, 46270.3046875000f, + 46298.2109375000f, 46319.1406250000f, 46333.0976562500f, 46340.0781250000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46326.9921875000f, 46215.3867187500f, 45992.4414062500f, 45658.7031250000f, + 45214.9609375000f, 44662.2968750000f, 44002.0351562500f, 43235.7734375000f, + 42365.3476562500f, 41392.8632812500f, 40320.6601562500f, 39151.3125000000f, + 37887.6562500000f, 36532.7187500000f, 35089.7773437500f, 33562.2929687500f, + 31953.9609375000f, 30268.6503906250f, 28510.4121093750f, 26683.4960937500f, + 24792.2910156250f, 22841.3671875000f, 20835.4179687500f, 18779.2636718750f, + 16677.8789062500f, 14536.3027343750f, 12359.7207031250f, 10153.3515625000f, + 7922.5327148438f, 5672.6279296875f, 3409.0463867188f, 1137.2629394531f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f +}; + +static float g_fWinCoeffesLongBrief2Short[2048] = +{ + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 1137.2637939453f, 3409.0517578125f, 5672.6269531250f, 7922.5366210938f, + 10153.3593750000f, 12359.7236328125f, 14536.3105468750f, 16677.8789062500f, + 18779.2675781250f, 20835.4160156250f, 22841.3710937500f, 24792.2988281250f, + 26683.5000000000f, 28510.4179687500f, 30268.6503906250f, 31953.9648437500f, + 33562.2968750000f, 35089.7773437500f, 36532.7226562500f, 37887.6562500000f, + 39151.3164062500f, 40320.6562500000f, 41392.8632812500f, 42365.3476562500f, + 43235.7734375000f, 44002.0390625000f, 44662.2968750000f, 45214.9609375000f, + 45658.7031250000f, 45992.4453125000f, 46215.3867187500f, 46326.9921875000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.0781250000f, 46333.0976562500f, 46319.1406250000f, 46298.2109375000f, + 46270.3046875000f, 46235.4335937500f, 46193.5976562500f, 46144.8085937500f, + 46089.0664062500f, 46026.3828125000f, 45956.7734375000f, 45880.2343750000f, + 45796.7929687500f, 45706.4531250000f, 45609.2304687500f, 45505.1367187500f, + 45394.1914062500f, 45276.4101562500f, 45151.8125000000f, 45020.4140625000f, + 44882.2304687500f, 44737.2929687500f, 44585.6210937500f, 44427.2265625000f, + 44262.1445312500f, 44090.3984375000f, 43912.0156250000f, 43727.0156250000f, + 43535.4296875000f, 43337.2929687500f, 43132.6250000000f, 42921.4609375000f, + 42703.8320312500f, 42479.7773437500f, 42249.3242187500f, 42012.5039062500f, + 41769.3593750000f, 41519.9257812500f, 41264.2382812500f, 41002.3359375000f, + 40734.2578125000f, 40460.0468750000f, 40179.7460937500f, 39893.3906250000f, + 39601.0273437500f, 39302.7031250000f, 38998.4531250000f, 38688.3320312500f, + 38372.3945312500f, 38050.6679687500f, 37723.2148437500f, 37390.0781250000f, + 37051.3164062500f, 36706.9687500000f, 36357.0937500000f, 36001.7500000000f, + 35640.9804687500f, 35274.8398437500f, 34903.3906250000f, 34526.6796875000f, + 34144.7734375000f, 33757.7265625000f, 33365.6015625000f, 32968.4453125000f, + 32566.3222656250f, 32159.2929687500f, 31747.4257812500f, 31330.7734375000f, + 30909.4042968750f, 30483.3867187500f, 30052.7714843750f, 29617.6308593750f, + 29178.0312500000f, 28734.0351562500f, 28285.7128906250f, 27833.1308593750f, + 27376.3671875000f, 26915.4687500000f, 26450.5195312500f, 25981.5859375000f, + 25508.7421875000f, 25032.0546875000f, 24551.5957031250f, 24067.4511718750f, + 23579.6718750000f, 23088.3417968750f, 22593.5351562500f, 22095.3242187500f, + 21593.7871093750f, 21088.9980468750f, 20581.0429687500f, 20069.9785156250f, + 19555.8906250000f, 19038.8593750000f, 18518.9609375000f, 17996.2714843750f, + 17470.8730468750f, 16942.8535156250f, 16412.2734375000f, 15879.2207031250f, + 15343.7763671875f, 14806.0214843750f, 14266.0380859375f, 13723.9052734375f, + 13179.7158203125f, 12633.5312500000f, 12085.4453125000f, 11535.5371093750f, + 10983.8935546875f, 10430.5947265625f, 9875.7255859375f, 9319.3798828125f, + 8761.6201171875f, 8202.5410156250f, 7642.2260742188f, 7080.7607421875f, + 6518.2290039063f, 5954.7153320313f, 5390.3159179688f, 4825.0937500000f, + 4259.1455078125f, 3692.5549316406f, 3125.4091796875f, 2557.7922363281f, + 1989.7901611328f, 1421.4993896484f, 852.9837036133f, 284.3394775391f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f +}; + +static float g_fWinCoeffesShortShort2Short[256] = +{ + 284.3427124023f, 852.9853515625f, 1421.4995117188f, 1989.7996826172f, + 2557.8000488281f, 3125.4152832031f, 3692.5598144531f, 4259.1479492188f, + 4825.0957031250f, 5390.3159179688f, 5954.7250976563f, 6518.2363281250f, + 7080.7670898438f, 7642.2309570313f, 8202.5439453125f, 8761.6210937500f, + 9319.3798828125f, 9875.7353515625f, 10430.6025390625f, 10983.8994140625f, + 11535.5419921875f, 12085.4472656250f, 12633.5332031250f, 13179.7158203125f, + 13723.9130859375f, 14266.0458984375f, 14806.0273437500f, 15343.7802734375f, + 15879.2236328125f, 16412.2734375000f, 16942.8535156250f, 17470.8828125000f, + 17996.2773437500f, 18518.9648437500f, 19038.8632812500f, 19555.8945312500f, + 20069.9804687500f, 20581.0429687500f, 21089.0058593750f, 21593.7929687500f, + 22095.3300781250f, 22593.5371093750f, 23088.3417968750f, 23579.6738281250f, + 24067.4511718750f, 24551.6035156250f, 25032.0605468750f, 25508.7460937500f, + 25981.5917968750f, 26450.5214843750f, 26915.4726562500f, 27376.3652343750f, + 27833.1386718750f, 28285.7187500000f, 28734.0410156250f, 29178.0351562500f, + 29617.6347656250f, 30052.7753906250f, 30483.3867187500f, 30909.4101562500f, + 31330.7792968750f, 31747.4277343750f, 32159.2968750000f, 32566.3222656250f, + 32968.4453125000f, 33365.6015625000f, 33757.7343750000f, 34144.7812500000f, + 34526.6835937500f, 34903.3906250000f, 35274.8398437500f, 35640.9804687500f, + 36001.7500000000f, 36357.0976562500f, 36706.9687500000f, 37051.3164062500f, + 37390.0820312500f, 37723.2148437500f, 38050.6718750000f, 38372.3945312500f, + 38688.3398437500f, 38998.4531250000f, 39302.7031250000f, 39601.0273437500f, + 39893.3906250000f, 40179.7460937500f, 40460.0507812500f, 40734.2656250000f, + 41002.3359375000f, 41264.2421875000f, 41519.9296875000f, 41769.3632812500f, + 42012.5039062500f, 42249.3242187500f, 42479.7773437500f, 42703.8359375000f, + 42921.4609375000f, 43132.6250000000f, 43337.2929687500f, 43535.4296875000f, + 43727.0156250000f, 43912.0195312500f, 44090.4023437500f, 44262.1484375000f, + 44427.2304687500f, 44585.6210937500f, 44737.2929687500f, 44882.2343750000f, + 45020.4140625000f, 45151.8125000000f, 45276.4101562500f, 45394.1953125000f, + 45505.1367187500f, 45609.2304687500f, 45706.4531250000f, 45796.7929687500f, + 45880.2343750000f, 45956.7734375000f, 46026.3867187500f, 46089.0664062500f, + 46144.8085937500f, 46193.6015625000f, 46235.4335937500f, 46270.3046875000f, + 46298.2109375000f, 46319.1406250000f, 46333.0976562500f, 46340.0781250000f, + 46340.0781250000f, 46333.0976562500f, 46319.1406250000f, 46298.2109375000f, + 46270.3046875000f, 46235.4335937500f, 46193.5976562500f, 46144.8085937500f, + 46089.0664062500f, 46026.3828125000f, 45956.7734375000f, 45880.2343750000f, + 45796.7929687500f, 45706.4531250000f, 45609.2304687500f, 45505.1367187500f, + 45394.1914062500f, 45276.4101562500f, 45151.8125000000f, 45020.4140625000f, + 44882.2304687500f, 44737.2929687500f, 44585.6210937500f, 44427.2265625000f, + 44262.1445312500f, 44090.3984375000f, 43912.0156250000f, 43727.0156250000f, + 43535.4296875000f, 43337.2929687500f, 43132.6250000000f, 42921.4609375000f, + 42703.8320312500f, 42479.7773437500f, 42249.3242187500f, 42012.5039062500f, + 41769.3593750000f, 41519.9257812500f, 41264.2382812500f, 41002.3359375000f, + 40734.2578125000f, 40460.0468750000f, 40179.7460937500f, 39893.3906250000f, + 39601.0273437500f, 39302.7031250000f, 38998.4531250000f, 38688.3320312500f, + 38372.3945312500f, 38050.6679687500f, 37723.2148437500f, 37390.0781250000f, + 37051.3164062500f, 36706.9687500000f, 36357.0937500000f, 36001.7500000000f, + 35640.9804687500f, 35274.8398437500f, 34903.3906250000f, 34526.6796875000f, + 34144.7734375000f, 33757.7265625000f, 33365.6015625000f, 32968.4453125000f, + 32566.3222656250f, 32159.2929687500f, 31747.4257812500f, 31330.7734375000f, + 30909.4042968750f, 30483.3867187500f, 30052.7714843750f, 29617.6308593750f, + 29178.0312500000f, 28734.0351562500f, 28285.7128906250f, 27833.1308593750f, + 27376.3671875000f, 26915.4687500000f, 26450.5195312500f, 25981.5859375000f, + 25508.7421875000f, 25032.0546875000f, 24551.5957031250f, 24067.4511718750f, + 23579.6718750000f, 23088.3417968750f, 22593.5351562500f, 22095.3242187500f, + 21593.7871093750f, 21088.9980468750f, 20581.0429687500f, 20069.9785156250f, + 19555.8906250000f, 19038.8593750000f, 18518.9609375000f, 17996.2714843750f, + 17470.8730468750f, 16942.8535156250f, 16412.2734375000f, 15879.2207031250f, + 15343.7763671875f, 14806.0214843750f, 14266.0380859375f, 13723.9052734375f, + 13179.7158203125f, 12633.5312500000f, 12085.4453125000f, 11535.5371093750f, + 10983.8935546875f, 10430.5947265625f, 9875.7255859375f, 9319.3798828125f, + 8761.6201171875f, 8202.5410156250f, 7642.2260742188f, 7080.7607421875f, + 6518.2290039063f, 5954.7153320313f, 5390.3159179688f, 4825.0937500000f, + 4259.1455078125f, 3692.5549316406f, 3125.4091796875f, 2557.7922363281f, + 1989.7901611328f, 1421.4993896484f, 852.9837036133f, 284.3394775391f +}; + +static float g_fWinCoeffesShortBrief2Brief[256] = +{ + 284.3427124023f, 852.9853515625f, 1421.4995117188f, 1989.7996826172f, + 2557.8000488281f, 3125.4152832031f, 3692.5598144531f, 4259.1479492188f, + 4825.0957031250f, 5390.3159179688f, 5954.7250976563f, 6518.2363281250f, + 7080.7670898438f, 7642.2309570313f, 8202.5439453125f, 8761.6210937500f, + 9319.3798828125f, 9875.7353515625f, 10430.6025390625f, 10983.8994140625f, + 11535.5419921875f, 12085.4472656250f, 12633.5332031250f, 13179.7158203125f, + 13723.9130859375f, 14266.0458984375f, 14806.0273437500f, 15343.7802734375f, + 15879.2236328125f, 16412.2734375000f, 16942.8535156250f, 17470.8828125000f, + 17996.2773437500f, 18518.9648437500f, 19038.8632812500f, 19555.8945312500f, + 20069.9804687500f, 20581.0429687500f, 21089.0058593750f, 21593.7929687500f, + 22095.3300781250f, 22593.5371093750f, 23088.3417968750f, 23579.6738281250f, + 24067.4511718750f, 24551.6035156250f, 25032.0605468750f, 25508.7460937500f, + 25981.5917968750f, 26450.5214843750f, 26915.4726562500f, 27376.3652343750f, + 27833.1386718750f, 28285.7187500000f, 28734.0410156250f, 29178.0351562500f, + 29617.6347656250f, 30052.7753906250f, 30483.3867187500f, 30909.4101562500f, + 31330.7792968750f, 31747.4277343750f, 32159.2968750000f, 32566.3222656250f, + 32968.4453125000f, 33365.6015625000f, 33757.7343750000f, 34144.7812500000f, + 34526.6835937500f, 34903.3906250000f, 35274.8398437500f, 35640.9804687500f, + 36001.7500000000f, 36357.0976562500f, 36706.9687500000f, 37051.3164062500f, + 37390.0820312500f, 37723.2148437500f, 38050.6718750000f, 38372.3945312500f, + 38688.3398437500f, 38998.4531250000f, 39302.7031250000f, 39601.0273437500f, + 39893.3906250000f, 40179.7460937500f, 40460.0507812500f, 40734.2656250000f, + 41002.3359375000f, 41264.2421875000f, 41519.9296875000f, 41769.3632812500f, + 42012.5039062500f, 42249.3242187500f, 42479.7773437500f, 42703.8359375000f, + 42921.4609375000f, 43132.6250000000f, 43337.2929687500f, 43535.4296875000f, + 43727.0156250000f, 43912.0195312500f, 44090.4023437500f, 44262.1484375000f, + 44427.2304687500f, 44585.6210937500f, 44737.2929687500f, 44882.2343750000f, + 45020.4140625000f, 45151.8125000000f, 45276.4101562500f, 45394.1953125000f, + 45505.1367187500f, 45609.2304687500f, 45706.4531250000f, 45796.7929687500f, + 45880.2343750000f, 45956.7734375000f, 46026.3867187500f, 46089.0664062500f, + 46144.8085937500f, 46193.6015625000f, 46235.4335937500f, 46270.3046875000f, + 46298.2109375000f, 46319.1406250000f, 46333.0976562500f, 46340.0781250000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46326.9921875000f, 46215.3867187500f, 45992.4414062500f, 45658.7031250000f, + 45214.9609375000f, 44662.2968750000f, 44002.0351562500f, 43235.7734375000f, + 42365.3476562500f, 41392.8632812500f, 40320.6601562500f, 39151.3125000000f, + 37887.6562500000f, 36532.7187500000f, 35089.7773437500f, 33562.2929687500f, + 31953.9609375000f, 30268.6503906250f, 28510.4121093750f, 26683.4960937500f, + 24792.2910156250f, 22841.3671875000f, 20835.4179687500f, 18779.2636718750f, + 16677.8789062500f, 14536.3027343750f, 12359.7207031250f, 10153.3515625000f, + 7922.5327148438f, 5672.6279296875f, 3409.0463867188f, 1137.2629394531f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f +}; + +static float g_fWinCoeffesShortShort2Brief[256] = +{ + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 1137.2637939453f, 3409.0517578125f, 5672.6269531250f, 7922.5366210938f, + 10153.3593750000f, 12359.7236328125f, 14536.3105468750f, 16677.8789062500f, + 18779.2675781250f, 20835.4160156250f, 22841.3710937500f, 24792.2988281250f, + 26683.5000000000f, 28510.4179687500f, 30268.6503906250f, 31953.9648437500f, + 33562.2968750000f, 35089.7773437500f, 36532.7226562500f, 37887.6562500000f, + 39151.3164062500f, 40320.6562500000f, 41392.8632812500f, 42365.3476562500f, + 43235.7734375000f, 44002.0390625000f, 44662.2968750000f, 45214.9609375000f, + 45658.7031250000f, 45992.4453125000f, 46215.3867187500f, 46326.9921875000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46326.9921875000f, 46215.3867187500f, 45992.4414062500f, 45658.7031250000f, + 45214.9609375000f, 44662.2968750000f, 44002.0351562500f, 43235.7734375000f, + 42365.3476562500f, 41392.8632812500f, 40320.6601562500f, 39151.3125000000f, + 37887.6562500000f, 36532.7187500000f, 35089.7773437500f, 33562.2929687500f, + 31953.9609375000f, 30268.6503906250f, 28510.4121093750f, 26683.4960937500f, + 24792.2910156250f, 22841.3671875000f, 20835.4179687500f, 18779.2636718750f, + 16677.8789062500f, 14536.3027343750f, 12359.7207031250f, 10153.3515625000f, + 7922.5327148438f, 5672.6279296875f, 3409.0463867188f, 1137.2629394531f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f +}; + +static float g_fWinCoeffesShortBrief2Short[256] = +{ + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 0.0000000000f, 0.0000000000f, 0.0000000000f, 0.0000000000f, + 1137.2637939453f, 3409.0517578125f, 5672.6269531250f, 7922.5366210938f, + 10153.3593750000f, 12359.7236328125f, 14536.3105468750f, 16677.8789062500f, + 18779.2675781250f, 20835.4160156250f, 22841.3710937500f, 24792.2988281250f, + 26683.5000000000f, 28510.4179687500f, 30268.6503906250f, 31953.9648437500f, + 33562.2968750000f, 35089.7773437500f, 36532.7226562500f, 37887.6562500000f, + 39151.3164062500f, 40320.6562500000f, 41392.8632812500f, 42365.3476562500f, + 43235.7734375000f, 44002.0390625000f, 44662.2968750000f, 45214.9609375000f, + 45658.7031250000f, 45992.4453125000f, 46215.3867187500f, 46326.9921875000f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, 46340.9492187500f, + 46340.0781250000f, 46333.0976562500f, 46319.1406250000f, 46298.2109375000f, + 46270.3046875000f, 46235.4335937500f, 46193.5976562500f, 46144.8085937500f, + 46089.0664062500f, 46026.3828125000f, 45956.7734375000f, 45880.2343750000f, + 45796.7929687500f, 45706.4531250000f, 45609.2304687500f, 45505.1367187500f, + 45394.1914062500f, 45276.4101562500f, 45151.8125000000f, 45020.4140625000f, + 44882.2304687500f, 44737.2929687500f, 44585.6210937500f, 44427.2265625000f, + 44262.1445312500f, 44090.3984375000f, 43912.0156250000f, 43727.0156250000f, + 43535.4296875000f, 43337.2929687500f, 43132.6250000000f, 42921.4609375000f, + 42703.8320312500f, 42479.7773437500f, 42249.3242187500f, 42012.5039062500f, + 41769.3593750000f, 41519.9257812500f, 41264.2382812500f, 41002.3359375000f, + 40734.2578125000f, 40460.0468750000f, 40179.7460937500f, 39893.3906250000f, + 39601.0273437500f, 39302.7031250000f, 38998.4531250000f, 38688.3320312500f, + 38372.3945312500f, 38050.6679687500f, 37723.2148437500f, 37390.0781250000f, + 37051.3164062500f, 36706.9687500000f, 36357.0937500000f, 36001.7500000000f, + 35640.9804687500f, 35274.8398437500f, 34903.3906250000f, 34526.6796875000f, + 34144.7734375000f, 33757.7265625000f, 33365.6015625000f, 32968.4453125000f, + 32566.3222656250f, 32159.2929687500f, 31747.4257812500f, 31330.7734375000f, + 30909.4042968750f, 30483.3867187500f, 30052.7714843750f, 29617.6308593750f, + 29178.0312500000f, 28734.0351562500f, 28285.7128906250f, 27833.1308593750f, + 27376.3671875000f, 26915.4687500000f, 26450.5195312500f, 25981.5859375000f, + 25508.7421875000f, 25032.0546875000f, 24551.5957031250f, 24067.4511718750f, + 23579.6718750000f, 23088.3417968750f, 22593.5351562500f, 22095.3242187500f, + 21593.7871093750f, 21088.9980468750f, 20581.0429687500f, 20069.9785156250f, + 19555.8906250000f, 19038.8593750000f, 18518.9609375000f, 17996.2714843750f, + 17470.8730468750f, 16942.8535156250f, 16412.2734375000f, 15879.2207031250f, + 15343.7763671875f, 14806.0214843750f, 14266.0380859375f, 13723.9052734375f, + 13179.7158203125f, 12633.5312500000f, 12085.4453125000f, 11535.5371093750f, + 10983.8935546875f, 10430.5947265625f, 9875.7255859375f, 9319.3798828125f, + 8761.6201171875f, 8202.5410156250f, 7642.2260742188f, 7080.7607421875f, + 6518.2290039063f, 5954.7153320313f, 5390.3159179688f, 4825.0937500000f, + 4259.1455078125f, 3692.5549316406f, 3125.4091796875f, 2557.7922363281f, + 1989.7901611328f, 1421.4993896484f, 852.9837036133f, 284.3394775391f +}; + +float* g_pDRAWinCoeffesTables[13] = +{ + g_fWinCoeffesLongLong2Long, + g_fWinCoeffesLongLong2Short, + g_fWinCoeffesLongShort2Long, + g_fWinCoeffesLongShort2Short, + g_fWinCoeffesLongLong2Brief, + g_fWinCoeffesLongBrief2Long, + g_fWinCoeffesLongBrief2Brief, + g_fWinCoeffesLongShort2Brief, + g_fWinCoeffesLongBrief2Short, + + g_fWinCoeffesShortShort2Short, + g_fWinCoeffesShortShort2Brief, + g_fWinCoeffesShortBrief2Brief, + g_fWinCoeffesShortBrief2Short, +}; + +///Decoder + +#define DRA_MAX_BAND_NUM 32 +#define DRA_MAX_BLOCK_NUM 8 +#define DRA_MAX_CLUSTER_NUM 4 +#define DRA_FACTOR_NUM 1024 +#define DRA_MAX_CHANNEL_NUM 8 + +#define WIN_LONG_LONG2LONG 0 +#define WIN_LONG_LONG2SHORT 1 +#define WIN_LONG_SHORT2LONG 2 +#define WIN_LONG_SHORT2SHORT 3 +#define WIN_LONG_LONG2BRIEF 4 +#define WIN_LONG_BRIEF2LONG 5 +#define WIN_LONG_BRIEF2BRIEF 6 +#define WIN_LONG_SHORT2BRIEF 7 +#define WIN_LONG_BRIEF2SHORT 8 +#define WIN_SHORT_SHORT2SHORT 9 +#define WIN_SHORT_SHORT2BRIEF 10 +#define WIN_SHORT_BRIEF2BRIEF 11 +#define WIN_SHORT_BRIEF2SHORT 12 + +#define IS_SHORT_WIN(nWinType) (nWinType > WIN_LONG_BRIEF2SHORT) + +#define DRA_MAX(a, b) (a > b ? a : b) +#define DRA_MIN(a, b) (a < b ? a : b) + +#define DRA_CLIP(sample, max, min) \ +if (sample > max) sample = max; \ +else if (sample < min) sample = min; +#define DRA_CLIP_32768(x) DRA_CLIP(x ,32767.0f, -32768.0f) + +#define ID_EXT 0x0 +#define ID_SBR 0x1 +#define ID_LAYERED 0x2 +#define ID_CRC 0x3 +#define ID_FILL 0xf + +typedef struct DRAFrameHeader +{ + int nFrameHeaderType; + int nNumWord; + int nNumBlockPerFrame; + int nSampleRateIndex; + int nNumNormalChannel; + int nNumLfeChannel; + int nAuxData; + int nUseSumDiff; + int nUseJic; + int nJicCB; +}DRAFrameHeader; + +typedef struct DRADecoderBand +{ + int nEdge; + int nIndex; + int nSumDiffOn; + int nJicStepIndex; +}DRADecoderBand; + +typedef struct DRADecoderCluster +{ + int nBlockNum; + int nBin0; + int nNumBand; + DRADecoderBand stBands[DRA_MAX_BAND_NUM]; + int nMaxActCB; + int nQstepIndex[DRA_MAX_BAND_NUM]; + int nSumDiffAllOff; +}DRADecoderCluster; + +typedef struct DRADecoderBlock +{ + int nWinType; +}DRADecoderBlock; + +typedef struct DRADecoderNormalChannel +{ + int nWinType; + int nLastWinType; + int nNumCluster; + DRADecoderBlock stBlocks[DRA_MAX_BLOCK_NUM]; + DRADecoderCluster stClusters[DRA_MAX_CLUSTER_NUM]; + float fOverlay[DRA_FACTOR_NUM]; + float fSamples[DRA_FACTOR_NUM]; + + float fFactor[DRA_FACTOR_NUM]; + float fDeinterlaceFactor[DRA_FACTOR_NUM]; +}DRADecoderNormalChannel; + +typedef struct DRADecoder +{ + int nFrameCount; + void* pMDCT256; + void* pMDCT2048; + + DRAFrameHeader stHeader; + DRADecoderNormalChannel stChannels[DRA_MAX_CHANNEL_NUM]; + + int nBins[DRA_FACTOR_NUM]; + float fOut[DRA_FACTOR_NUM * 2]; + + short sOutputPCMData[DRA_FACTOR_NUM * DRA_MAX_CHANNEL_NUM]; + + unsigned char* pDataBuffer; + int nDataBufLen; + int nDataBufSize; + int nDataBufPos; + +}DRADecoder; + +const static int SAMPLERATE_TABLE[16] = +{ + 8000, 12000, 11025, 16000, + 22100, 24000, 32000, 44100, + 48000, 88200, 96000, 176400, + 192000, +}; + +static int DRANextSyncWord(unsigned char* pBuffer, int nLen) +{ + for (int i = 0; i < nLen - 1; i++) + { + if (((pBuffer[i] << 0x8) | pBuffer[i + 1]) == 0x7FFF) + { + return i; + } + } + return -1; +} + +static int DRAParseHeaderBitStream(DRABitstream* bs, DRAFrameHeader* pHeader) +{ + if (pHeader == NULL) + { + return -1; + } + + memset(pHeader, 0, sizeof(DRAFrameHeader)); + pHeader->nFrameHeaderType = GetBits1(bs); + pHeader->nNumWord = GetBits(bs, pHeader->nFrameHeaderType == 0 ? 10 : 13); + pHeader->nNumBlockPerFrame = 1 << GetBits(bs, 2); + pHeader->nSampleRateIndex = GetBits(bs, 4); + pHeader->nNumNormalChannel = GetBits(bs, pHeader->nFrameHeaderType == 0 ? 3 : 6) + 1; + pHeader->nNumLfeChannel = GetBits(bs, pHeader->nFrameHeaderType == 0 ? 1 : 2); + pHeader->nAuxData = GetBits1(bs); + if (pHeader->nFrameHeaderType == 0) + { + if (pHeader->nNumNormalChannel > 1) + { + pHeader->nUseSumDiff = GetBits1(bs); + pHeader->nUseJic = GetBits1(bs); + } + else + { + pHeader->nUseSumDiff = 0; + pHeader->nUseJic = 0; + } + + if (pHeader->nUseJic) + { + pHeader->nJicCB = GetBits(bs, 5) + 1; + } + } + else + { + pHeader->nUseSumDiff = 0; + pHeader->nUseJic = 0; + pHeader->nJicCB = 0; + } + if (pHeader->nSampleRateIndex < 0 || pHeader->nSampleRateIndex > 12) + { + return -1; + } + + int nSampleRate = SAMPLERATE_TABLE[pHeader->nSampleRateIndex]; + + if (pHeader->nNumWord < 1) + { + return -1; + } + + return 0; +} + +static int DRAParseHeader(unsigned char* pBuffer, int nLen, DRAFrameHeader* header) +{ + DRABitstream bs; + if (pBuffer == NULL || nLen < 6) + { + return -1; + } + if (pBuffer[0] != 0x7F || pBuffer[1] != 0xFF) + { + return -1; + } + InitGetBits(&bs, pBuffer + 2, nLen - 2); + return DRAParseHeaderBitStream(&bs, header); +} + +static int DRAParseWinSequence(DRADecoder* pDRADecoder, DRABitstream* bs, int ch) +{ + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + if (ch == 0 || (pDRADecoder->stHeader.nUseSumDiff == 0 && pDRADecoder->stHeader.nUseJic == 0)) + { + pChannel->nWinType = GetBits(bs, 4); + if (IS_SHORT_WIN(pChannel->nWinType)) + { + int nNumCluster = GetBits(bs, 2) + 1; + if (nNumCluster >= DRA_MAX_CLUSTER_NUM) + { + return -1; + } + pChannel->nNumCluster = nNumCluster; + + int nNum = 0; + int cl = 0; + for (cl = 0; cl < nNumCluster - 1; cl++) + { + int k = DRAHuffmanDecode(bs, &g_stHuffmanCodebook1); + if (k < 0) + { + return -1; + } + k++; + pChannel->stClusters[cl].nBin0 = nNum * 128; + pChannel->stClusters[cl].nBlockNum = k; + nNum += k; + } + if (nNum > pDRADecoder->stHeader.nNumBlockPerFrame - 1) + { + return -1; + } + pChannel->stClusters[cl].nBin0 = nNum * 128; + pChannel->stClusters[cl].nBlockNum = pDRADecoder->stHeader.nNumBlockPerFrame - nNum; + } + else + { + pChannel->nNumCluster = 1; + pChannel->stClusters[0].nBin0 = 0; + pChannel->stClusters[0].nBlockNum = 1; + } + } + else + { + pChannel->nWinType = pDRADecoder->stChannels[0].nWinType; + pChannel->nNumCluster = pDRADecoder->stChannels[0].nNumCluster; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + pChannel->stClusters[cl].nBin0 = pDRADecoder->stChannels[0].stClusters[cl].nBin0; + pChannel->stClusters[cl].nBlockNum = pDRADecoder->stChannels[0].stClusters[cl].nBlockNum; + } + } + + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + pCluster->nSumDiffAllOff = 1; + } + + return 0; +} + +static int DRAParseCodeBook(DRADecoder* pDRADecoder, DRABitstream* bs, int ch) +{ + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + + const DRAHuffmanCodebook* pBook = IS_SHORT_WIN(pChannel->nWinType) ? &g_stHuffmanCodebook3 : &g_stHuffmanCodebook2; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + pCluster->nNumBand = GetBits(bs, 5); + int last = 0; + for (int ba = 0; ba < pCluster->nNumBand; ba++) + { + + int k = DRAHuffmanDecodeRecursive(bs, pBook); + if (k < 0) + { + return -1; + } + k += last + 1; + pCluster->stBands[ba].nEdge = k; + last = k; + } + } + + pBook = IS_SHORT_WIN(pChannel->nWinType) ? &g_stHuffmanCodebook5 : &g_stHuffmanCodebook4; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + if (pCluster->nNumBand > 0) + { + int nLast = GetBits(bs, 4); + pCluster->stBands[0].nIndex = nLast; + for (int ba = 1; ba < pCluster->nNumBand; ba++) + { + int k = DRAHuffmanDecode(bs, pBook); + if (k < 0) + { + return -1; + } + k -= k > 8 ? 8 : 9; + k += nLast; + pCluster->stBands[ba].nIndex = k; + nLast = k; + + } + } + } + + return 0; +} + +static int DRAGetActCB(DRADecoder* pDRADecoder, int ch) +{ + int nHuffmanIndex = 0; + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + + DRAFreqBandEdgeTable* pFreqBandEdgeTable = &(IS_SHORT_WIN(pChannel->nWinType) ? g_stDRAFreqBandSEdgeTable : g_stDRAFreqBandLEdgeTable)[pDRADecoder->stHeader.nSampleRateIndex]; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + int nMaxBand = pCluster->nNumBand; + if (pCluster->nNumBand == 0) + { + pCluster->nMaxActCB = 0; + continue; + } + int nMaxBin = pCluster->stBands[nMaxBand - 1].nEdge * 4; + int nNum = (nMaxBin + pCluster->nBlockNum - 1) / pCluster->nBlockNum; + int nMaxNum = pFreqBandEdgeTable->table[pFreqBandEdgeTable->num - 1]; + if (nNum > nMaxNum) + { + return -1; + } + + int cb = 0; + while (pFreqBandEdgeTable->table[cb + 1] < nNum) + { + cb++; + } + + pCluster->nMaxActCB = cb + 1; + + } + return 0; +} + +#if 0 +static int DRAParseQIndex(DRADecoder* pDRADecoder, DRABitstream* bs, int ch) +{ + int nHuffmanDiffIndex = 0; + + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + const DRAHuffmanCodebook** ppBookTables = IS_SHORT_WIN(pChannel->nWinType) ? g_stHuffmanCodebookSTables : g_stHuffmanCodebookLTables; + const DRAHuffmanCodebook* pQuotientBook = IS_SHORT_WIN(pChannel->nWinType) ? &g_stHuffmanCodebook9 : &g_stHuffmanCodebook8; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + int nStart = pCluster->nBin0; + for (int ba = 0; ba < pCluster->nNumBand; ba++) + { + int nEnd = pCluster->nBin0 + pCluster->stBands[ba].nEdge * 4; + int nSelect = pCluster->stBands[ba].nIndex; + if (nSelect == 0) + { + for (int bin = nStart; bin < nEnd; bin++) + { + pDRADecoder->nBins[bin] = 0; + } + } + else + { + nSelect--; + if (nSelect < 0 || nSelect > 8) + { + return -1; + } + DRAHuffmanCodebook* pBook = ppBookTables[nSelect]; + if (nSelect == 8) + { + int nMaxIndex = pBook->num_codes - 1; + int ctrl = 0; + for (int bin = nStart; bin < nEnd; bin++) + { + int k = DRAHuffmanDecode(bs, pBook); + if (k < 0) + { + return -1; + } + + if (k == nMaxIndex) + { + ctrl++; + } + pDRADecoder->nBins[bin] = k; + } + + if (ctrl > 0) + { + nHuffmanDiffIndex = DRAHuffmanDecodeDiff(bs, pQuotientBook, nHuffmanDiffIndex); + if (nHuffmanDiffIndex < 0) + { + return -1; + } + + int nQuotientWidth = nHuffmanDiffIndex + 1; + for (int bin = nStart; bin < nEnd; bin++) + { + if (pDRADecoder->nBins[bin] == nMaxIndex) + { + pDRADecoder->nBins[bin] *= (GetBits(bs, nQuotientWidth) + 1); + int k = DRAHuffmanDecode(bs, pBook); + if (k < 0) + { + return -1; + } + pDRADecoder->nBins[bin] = pDRADecoder->nBins[bin] + k; + } + } + } + } + else + { + if (pBook->dim > 1) + { + for (int bin = nStart; bin < nEnd; bin += pBook->dim) + { + int nQIndex = DRAHuffmanDecode(bs, pBook); + if (nQIndex < 0) + { + return -1; + } + for (int k = 0; k < pBook->dim; k++) + { + pDRADecoder->nBins[bin + k] = nQIndex % pBook->num_codes; + nQIndex = nQIndex / pBook->num_codes; + } + } + } + else + { + for (int bin = nStart; bin < nEnd; bin++) + { + int k = DRAHuffmanDecode(bs, pBook); + if (k < 0) + { + return -1; + } + pDRADecoder->nBins[bin] = k; + } + } + } + if (pBook->size != 256) + { + int nMaxIndex2 = pBook->num_codes / 2; + for (int bin = nStart; bin < nEnd; bin++) + { + pDRADecoder->nBins[bin] -= nMaxIndex2; + } + } + else + { + for (int bin = nStart; bin < nEnd; bin++) + { + if (pDRADecoder->nBins[bin] != 0) + { + int sign = GetBits(bs, 1); + if (sign == 0) + { + pDRADecoder->nBins[bin] = -pDRADecoder->nBins[bin]; + } + } + } + } + } + nStart = nEnd; + } + } + + return 0; +} +#else +static int DRAParseQIndex(DRADecoder* pDRADecoder, DRABitstream* bs, int ch) +{ + int nHuffmanDiffIndex = 0; + + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + const DRAHuffmanCodebook** ppBookTables = IS_SHORT_WIN(pChannel->nWinType) ? g_stHuffmanCodebookSTables : g_stHuffmanCodebookLTables; + const DRAHuffmanCodebook* pQuotientBook = IS_SHORT_WIN(pChannel->nWinType) ? &g_stHuffmanCodebook9 : &g_stHuffmanCodebook8; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + int nStart = pCluster->nBin0; + for (int ba = 0; ba < pCluster->nNumBand; ba++) + { + int nEnd = pCluster->nBin0 + pCluster->stBands[ba].nEdge * 4; + int nSelect = pCluster->stBands[ba].nIndex; + if (nSelect == 0) + { + for (int bin = nStart; bin < nEnd; bin++) + { + pDRADecoder->nBins[bin] = 0; + } + } + else + { + nSelect--; + if (nSelect < 0 || nSelect > 8) + { + return -1; + } + const DRAHuffmanCodebook* pBook = ppBookTables[nSelect]; + if (nSelect == 8) + { + int nMaxIndex = pBook->num_codes - 1; + int ctrl = 0; + for (int bin = nStart; bin < nEnd; bin++) + { + int k = DRAHuffmanDecode(bs, pBook); + if (k < 0) + { + return -1; + } + + if (k == nMaxIndex) + { + ctrl++; + } + pDRADecoder->nBins[bin] = k; + } + + if (ctrl > 0) + { + nHuffmanDiffIndex = DRAHuffmanDecodeDiff(bs, pQuotientBook, nHuffmanDiffIndex); + if (nHuffmanDiffIndex < 0) + { + return -1; + } + + int nQuotientWidth = nHuffmanDiffIndex + 1; + for (int bin = nStart; bin < nEnd; bin++) + { + if (pDRADecoder->nBins[bin] == nMaxIndex) + { + pDRADecoder->nBins[bin] *= (GetBits(bs, nQuotientWidth) + 1); + int k = DRAHuffmanDecode(bs, pBook); + if (k < 0) + { + return -1; + } + pDRADecoder->nBins[bin] = pDRADecoder->nBins[bin] + k; + } + } + } + } + else + { + if (pBook->dim > 1) + { + for (int bin = nStart; bin < nEnd; bin += pBook->dim) + { + int nQIndex = DRAHuffmanDecode(bs, pBook); + if (nQIndex < 0) + { + return -1; + } + for (int k = 0; k < pBook->dim; k++) + { + pDRADecoder->nBins[bin + k] = nQIndex % pBook->num_codes; + nQIndex = nQIndex / pBook->num_codes; + } + } + } + else + { + for (int bin = nStart; bin < nEnd; bin++) + { + int k = DRAHuffmanDecode(bs, pBook); + if (k < 0) + { + return -1; + } + pDRADecoder->nBins[bin] = k; + } + } + } + if (pBook->size != 256) + { + int nMaxIndex2 = pBook->num_codes / 2; + for (int bin = nStart; bin < nEnd; bin++) + { + pDRADecoder->nBins[bin] -= nMaxIndex2; + } + } + else + { + for (int bin = nStart; bin < nEnd; bin++) + { + if (pDRADecoder->nBins[bin] != 0) + { + int sign = GetBits(bs, 1); + if (sign == 0) + { + pDRADecoder->nBins[bin] = -pDRADecoder->nBins[bin]; + } + } + } + } + + } + nStart = nEnd; + } + } + + return 0; +} +#endif + +static int DRAParseQStepIndex(DRADecoder* pDRADecoder, DRABitstream* bs, int ch) +{ + int nHuffmanDiffIndex = 0; + + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + + const DRAHuffmanCodebook* pBook = IS_SHORT_WIN(pChannel->nWinType) ? &g_stHuffmanCodebook7 : &g_stHuffmanCodebook6; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + for (int ba = 0; ba < pCluster->nMaxActCB; ba++) + { + nHuffmanDiffIndex = DRAHuffmanDecodeDiff(bs, pBook, nHuffmanDiffIndex); + if (nHuffmanDiffIndex < 0) + { + return -1; + } + pCluster->nQstepIndex[ba] = nHuffmanDiffIndex; + } + } + return 0; +} + +static int DRAInverseQuant(DRADecoder* pDRADecoder, int ch) +{ + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + + DRAFreqBandEdgeTable* pFreqBandEdgeTable = &(IS_SHORT_WIN(pChannel->nWinType) ? g_stDRAFreqBandSEdgeTable : g_stDRAFreqBandLEdgeTable)[pDRADecoder->stHeader.nSampleRateIndex]; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + for (int ba = 0; ba < pCluster->nMaxActCB; ba++) + { + int nStart = pCluster->nBin0 + pCluster->nBlockNum * pFreqBandEdgeTable->table[ba]; + int nEnd = pCluster->nBin0 + pCluster->nBlockNum * pFreqBandEdgeTable->table[ba + 1]; + if (nStart >= DRA_FACTOR_NUM || nEnd > DRA_FACTOR_NUM) + { + return -1; + } + float fStep = g_fQStepTable[pCluster->nQstepIndex[ba]]; + for (int bin = nStart; bin < nEnd; bin++) + { + pChannel->fFactor[bin] = (pDRADecoder->nBins[bin] * fStep); + } + } + } + + return 0; +} + +static int DRAParseSumDiff(DRADecoder* pDRADecoder, DRABitstream* bs, int ch) +{ + int nHuffmanIndex = 0; + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + + const DRAHuffmanCodebook* pBook = IS_SHORT_WIN(pChannel->nWinType) ? &g_stHuffmanCodebook7 : &g_stHuffmanCodebook6; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + + int nMaxActCBSum = pDRADecoder->stChannels[ch & 2].stClusters[cl].nMaxActCB; + int nMaxCB = DRA_MAX(nMaxActCBSum, pCluster->nMaxActCB); + if (pDRADecoder->stHeader.nJicCB > 0) + { + nMaxCB = DRA_MIN(nMaxCB, pDRADecoder->stHeader.nJicCB); + } + if (nMaxCB > 0) + { + pCluster->nSumDiffAllOff = GetBits(bs, 1); + if (pCluster->nSumDiffAllOff == 0) + { + for (int ba = 0; ba < nMaxCB; ba++) + { + pCluster->stBands[ba].nSumDiffOn = GetBits(bs, 1);; + } + } + else + { + for (int ba = 0; ba < nMaxCB; ba++) + { + pCluster->stBands[ba].nSumDiffOn = 0; + } + } + } + } + + return 0; +} + +static int DRAParseJicScale(DRADecoder* pDRADecoder, DRABitstream* bs, int ch) +{ + int nHuffDiffIndex = 57; + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + DRADecoderNormalChannel* pSrcChannel = &pDRADecoder->stChannels[0]; + const DRAHuffmanCodebook* pBook = IS_SHORT_WIN(pChannel->nWinType) ? &g_stHuffmanCodebook7 : &g_stHuffmanCodebook6; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + int nMaxActCB = pSrcChannel->stClusters[cl].nMaxActCB; + for (int ba = pDRADecoder->stHeader.nJicCB; ba < nMaxActCB; ba++) + { + nHuffDiffIndex = DRAHuffmanDecodeDiff(bs, pBook, nHuffDiffIndex); + if (nHuffDiffIndex < 0) + { + return -1; + } + pCluster->stBands[ba].nJicStepIndex = nHuffDiffIndex; + } + } + + return 0; +} + +static void DRAParseJic(DRADecoder* pDRADecoder, int ch) +{ + if (ch == 0) + { + return; + } + + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + DRADecoderNormalChannel* pSrcChannel = &pDRADecoder->stChannels[0]; + + DRAFreqBandEdgeTable* pFreqBandEdgeTable = &(IS_SHORT_WIN(pChannel->nWinType) ? g_stDRAFreqBandSEdgeTable : g_stDRAFreqBandLEdgeTable)[pDRADecoder->stHeader.nSampleRateIndex]; + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + int nBin0 = pCluster->nBin0; + int nMaxActCB = pSrcChannel->stClusters[cl].nMaxActCB; + for (int ba = pDRADecoder->stHeader.nJicCB; ba < nMaxActCB; ba++) + { + int nStart = pCluster->nBin0 + pCluster->nBlockNum * pFreqBandEdgeTable->table[ba]; + int nEnd = pCluster->nBin0 + pCluster->nBlockNum * pFreqBandEdgeTable->table[ba + 1]; + float fStep = g_fQStepTableJic[ba]; + for (int bin = nStart; bin < nEnd; bin++) + { + pChannel->fFactor[bin] = (pSrcChannel->fFactor[bin] * fStep); + } + } + } +} + +static void DRASumDiff(DRADecoder* pDRADecoder, int ch) +{ + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + DRADecoderNormalChannel* pSumChannel = &pDRADecoder->stChannels[ch - 1]; + + DRAFreqBandEdgeTable* pFreqBandEdgeTable = &(IS_SHORT_WIN(pChannel->nWinType) ? g_stDRAFreqBandSEdgeTable : g_stDRAFreqBandLEdgeTable)[pDRADecoder->stHeader.nSampleRateIndex]; + + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + int nMaxActCBSum = pSumChannel->stClusters[cl].nMaxActCB; + int nMaxActCB = DRA_MAX(nMaxActCBSum, pCluster->nMaxActCB); + if (pDRADecoder->stHeader.nJicCB > 0) + { + nMaxActCB = DRA_MIN(nMaxActCB, pDRADecoder->stHeader.nJicCB); + } + if (pCluster->nSumDiffAllOff == 0) + { + for (int ba = 0; ba < nMaxActCB; ba++) + { + if (pCluster->stBands[ba].nSumDiffOn) + { + int nStart = pCluster->nBin0 + pCluster->nBlockNum * pFreqBandEdgeTable->table[ba]; + int nEnd = pCluster->nBin0 + pCluster->nBlockNum * pFreqBandEdgeTable->table[ba + 1]; + for (int bin = nStart; bin < nEnd; bin++) + { + float fSum = pSumChannel->fFactor[bin] + pChannel->fFactor[bin]; + float fDiff = pSumChannel->fFactor[bin] - pChannel->fFactor[bin]; + pSumChannel->fFactor[bin] = fSum; + pChannel->fFactor[bin] = fDiff; + } + } + } + } + } +} + +static void DRADeinterlaceFactor(DRADecoder* pDRADecoder, int ch) +{ + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + if (!IS_SHORT_WIN(pChannel->nWinType)) + { + return; + } + for (int cl = 0; cl < pChannel->nNumCluster; cl++) + { + DRADecoderCluster* pCluster = &pChannel->stClusters[cl]; + for (int bl = 0; bl < pCluster->nBlockNum; bl++) + { + int q = pCluster->nBin0 + bl; + float* pFactor = pChannel->fDeinterlaceFactor + pCluster->nBin0 + bl * 128; + for (int n = 0; n < 128; n++, q += pCluster->nBlockNum) + { + pFactor[n] = pChannel->fFactor[q]; + } + } + } +} + +static int DRAGetShortWindowType(DRADecoder* pDRADecoder, int ch) +{ + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + if (!IS_SHORT_WIN(pChannel->nWinType)) + { + pChannel->stBlocks[0].nWinType = pChannel->nWinType; + + return 0; + } + + + if (pChannel->nWinType == WIN_SHORT_SHORT2SHORT + || pChannel->nWinType == WIN_SHORT_SHORT2BRIEF) + { + pChannel->stBlocks[0].nWinType = WIN_SHORT_SHORT2SHORT; + switch (pChannel->nLastWinType) + { + case WIN_SHORT_BRIEF2BRIEF: + pChannel->stBlocks[0].nWinType = WIN_SHORT_BRIEF2SHORT; + break; + case WIN_LONG_LONG2SHORT: + case WIN_LONG_SHORT2SHORT: + case WIN_LONG_BRIEF2SHORT: + case WIN_SHORT_SHORT2SHORT: + case WIN_SHORT_BRIEF2SHORT: + break; + default: + break; + return -1; + } + } + else + { + pChannel->stBlocks[0].nWinType = WIN_SHORT_BRIEF2BRIEF; + switch (pChannel->nLastWinType) + { + case WIN_SHORT_BRIEF2BRIEF: + case WIN_SHORT_SHORT2BRIEF: + case WIN_LONG_LONG2BRIEF: + case WIN_LONG_BRIEF2BRIEF: + case WIN_LONG_SHORT2BRIEF: + break; + default: + break; + return -1; + } + } + + int bl; + for (bl = 1; bl < pDRADecoder->stHeader.nNumBlockPerFrame; bl++) + { + pChannel->stBlocks[bl].nWinType = WIN_SHORT_SHORT2SHORT; + } + bl = 0; + for (int cl = 0; cl < pChannel->nNumCluster - 1; cl++) + { + bl += pChannel->stClusters[cl].nBlockNum; + pChannel->stBlocks[bl].nWinType = WIN_SHORT_BRIEF2BRIEF; + } + + for (bl = 0; bl < pDRADecoder->stHeader.nNumBlockPerFrame; bl++) + { + if (pChannel->stBlocks[bl].nWinType == WIN_SHORT_BRIEF2BRIEF) + { + if (bl > 0) + { + if (pChannel->stBlocks[bl - 1].nWinType == WIN_SHORT_SHORT2SHORT) + { + pChannel->stBlocks[bl - 1].nWinType = WIN_SHORT_SHORT2BRIEF; + } + + if (pChannel->stBlocks[bl - 1].nWinType == WIN_SHORT_BRIEF2SHORT) + { + pChannel->stBlocks[bl - 1].nWinType = WIN_SHORT_BRIEF2BRIEF; + } + + } + if (bl < pDRADecoder->stHeader.nNumBlockPerFrame - 1) + { + if (pChannel->stBlocks[bl + 1].nWinType == WIN_SHORT_SHORT2SHORT) + { + pChannel->stBlocks[bl + 1].nWinType = WIN_SHORT_BRIEF2SHORT; + } + } + } + } + bl = pDRADecoder->stHeader.nNumBlockPerFrame - 1; + switch (pChannel->stBlocks[bl].nWinType) + { + case WIN_SHORT_SHORT2SHORT: + if (pChannel->nWinType == WIN_SHORT_SHORT2BRIEF + || pChannel->nWinType == WIN_SHORT_BRIEF2BRIEF) + { + pChannel->stBlocks[bl].nWinType = WIN_SHORT_SHORT2BRIEF; + } + break; + case WIN_SHORT_BRIEF2SHORT: + if (pChannel->nWinType == WIN_SHORT_SHORT2BRIEF + || pChannel->nWinType == WIN_SHORT_BRIEF2BRIEF) + { + pChannel->stBlocks[bl].nWinType = WIN_SHORT_BRIEF2BRIEF; + } + break; + default: + break; + return -1; + } + + return 0; +} + +static int DRAReconstructChannel(DRADecoder* pDRADecoder, int ch) +{ + int i, j; + float* pIn, * pOut, * pSamples, * pOverlay; + DRADecoderNormalChannel* pChannel = &pDRADecoder->stChannels[ch]; + if (!IS_SHORT_WIN(pChannel->nWinType)) + { + float* pWinTable = g_pDRAWinCoeffesTables[pChannel->nWinType]; + pIn = pChannel->fFactor; + pOut = pDRADecoder->fOut; + pSamples = pChannel->fSamples; + pOverlay = pChannel->fOverlay; + + DRAMDCTIMDCT(pDRADecoder->pMDCT2048, pIn, pOut); + + for (int i = 0; i < DRA_FACTOR_NUM; i++) + { + pSamples[i] = pOut[i] * pWinTable[i] + pOverlay[i]; + } + pOut += DRA_FACTOR_NUM; + pWinTable += DRA_FACTOR_NUM; + for (int i = 0; i < DRA_FACTOR_NUM; i++) + { + pOverlay[i] = pOut[i] * pWinTable[i]; + } + + pChannel->nLastWinType = pChannel->nWinType; + } + else + { + int N = pDRADecoder->stHeader.nNumBlockPerFrame; + int N2 = (N >> 1); + int nShortLen = DRA_FACTOR_NUM / N; + int nShortLen2 = nShortLen >> 1; + int nPos = (DRA_FACTOR_NUM - nShortLen) >> 1; + + float* pOutLast = NULL; + float* pWinTable = g_pDRAWinCoeffesTables[pChannel->stBlocks[0].nWinType]; + float* pWinTableLast = NULL; + pIn = pChannel->fDeinterlaceFactor; + + pOut = pDRADecoder->fOut; + pSamples = pChannel->fSamples; + pOverlay = pChannel->fOverlay; + memcpy(pSamples, pOverlay, nPos * sizeof(pSamples[0])); + for (i = 0; i < N; i++) + { + int k = i & 1; + pWinTableLast = pWinTable + nShortLen; + pWinTable = g_pDRAWinCoeffesTables[pChannel->stBlocks[i].nWinType]; + + DRAMDCTIMDCT(pDRADecoder->pMDCT256, pIn, pOut); + pOutLast = pOut - nShortLen; + if (i < N2) + { + if (i == 0) + { + pSamples = pChannel->fSamples + nPos; + pOverlay = pChannel->fOverlay + nPos; + for (j = 0; j < nShortLen; j++) + { + pSamples[j] = pOverlay[j] + pOut[j] * pWinTable[j]; + } + } + else + { + + for (j = 0; j < nShortLen; j++) + { + pSamples[j] = pOutLast[j] * pWinTableLast[j] + pOut[j] * pWinTable[j]; + } + } + } + else if (i == N2) + { + for (j = 0; j < nShortLen2; j++) + { + pSamples[j] = pOutLast[j] * pWinTableLast[j] + pOut[j] * pWinTable[j]; + } + pOverlay = pChannel->fOverlay - nShortLen2; + for (; j < nShortLen; j++) + { + pOverlay[j] = pOutLast[j] * pWinTableLast[j] + pOut[j] * pWinTable[j]; + } + } + else + { + for (j = 0; j < nShortLen; j++) + { + pOverlay[j] = pOutLast[j] * pWinTableLast[j] + pOut[j] * pWinTable[j]; + } + + if (i == N - 1) + { + pOut += nShortLen; + pOverlay += nShortLen; + pWinTable += nShortLen; + for (j = 0; j < nShortLen; j++) + { + pOverlay[j] = pOut[j] * pWinTable[j]; + } + pOverlay += nShortLen; + int nLen = (DRA_FACTOR_NUM - (pOverlay - pChannel->fOverlay)) * sizeof(pOverlay[0]); + memset(pOverlay, 0, nLen); + pChannel->nLastWinType = pChannel->stBlocks[i].nWinType; + } + + } + + pIn += nShortLen; + pSamples += nShortLen; + pOut += (nShortLen << 1); + pOverlay += nShortLen; + } + } + + return 0; +} + +static int DRADecodeFrame(void* pDecoder, unsigned char* pFrame, int nFrameLen) +{ + DRADecoder* pDRADecoder = (DRADecoder*)pDecoder; + if (pDRADecoder == NULL) + { + return -1; + } + + if (pFrame[0] != 0x7F || pFrame[1] != 0xFF) + { + return -1; + } + + DRAFrameHeader stHeader; + + DRABitstream bs; + InitGetBits(&bs, pFrame + 2, nFrameLen - 2); + if (DRAParseHeaderBitStream(&bs, &stHeader) < 0) + { + return -1; + } + + if (nFrameLen < stHeader.nNumWord * 4) + { + return -1; + } + + if (stHeader.nNumNormalChannel + stHeader.nNumLfeChannel > DRA_MAX_CHANNEL_NUM + || stHeader.nNumBlockPerFrame != DRA_MAX_BLOCK_NUM) + { + return -1; + } + + memcpy(&pDRADecoder->stHeader, &stHeader, sizeof(DRAFrameHeader)); + int nIsOK = 1; + for (int ch = 0; ch < pDRADecoder->stHeader.nNumNormalChannel; ch++) + { + memset(pDRADecoder->nBins, 0, sizeof(int) * DRA_FACTOR_NUM); + memset(pDRADecoder->stChannels[ch].fFactor, 0, sizeof(pDRADecoder->stChannels[ch].fFactor[0]) * DRA_FACTOR_NUM); + if (DRAParseWinSequence(pDRADecoder, &bs, ch) < 0) + { + nIsOK = 0; + break; + } + + if (DRAParseCodeBook(pDRADecoder, &bs, ch) < 0) + { + nIsOK = 0; + break; + } + if (DRAGetActCB(pDRADecoder, ch) < 0) + { + nIsOK = 0; + break; + } + if (DRAParseQIndex(pDRADecoder, &bs, ch) < 0) + { + nIsOK = 0; + break; + } + + if (DRAParseQStepIndex(pDRADecoder, &bs, ch) < 0) + { + nIsOK = 0; + break; + } + if (pDRADecoder->stHeader.nUseSumDiff && (ch & 1) == 1) + { + if (DRAParseSumDiff(pDRADecoder, &bs, ch) < 0) + { + nIsOK = 0; + break; + } + } + + if (DRAInverseQuant(pDRADecoder, ch) < 0) + { + nIsOK = 0; + break; + } + if (pDRADecoder->stHeader.nUseJic && ch != 0) + { + if (DRAParseJicScale(pDRADecoder, &bs, ch) < 0) + { + nIsOK = 0; + break; + } + DRAParseJic(pDRADecoder, ch); + } + else + { + DRAInverseQuant(pDRADecoder, ch); + } + + if (pDRADecoder->stHeader.nUseSumDiff && (ch & 1) == 1) + { + DRASumDiff(pDRADecoder, ch); + DRADeinterlaceFactor(pDRADecoder, ch - 1); + DRADeinterlaceFactor(pDRADecoder, ch); + } + else + { + DRADeinterlaceFactor(pDRADecoder, ch); + } + DRAGetShortWindowType(pDRADecoder, ch); + + if (pDRADecoder->stHeader.nUseSumDiff) + { + if ((ch & 1) == 1) + { + DRAReconstructChannel(pDRADecoder, ch - 1); + DRAReconstructChannel(pDRADecoder, ch); + } + + } + else + { + DRAReconstructChannel(pDRADecoder, ch); + } + } + + if (nIsOK) + { + for (int ch = pDRADecoder->stHeader.nNumNormalChannel; + ch < pDRADecoder->stHeader.nNumNormalChannel + pDRADecoder->stHeader.nNumLfeChannel; ch++) + { + memset(pDRADecoder->nBins, 0, sizeof(int) * DRA_FACTOR_NUM); + memset(pDRADecoder->stChannels[ch].fFactor, 0, sizeof(pDRADecoder->stChannels[ch].fFactor[0]) * DRA_FACTOR_NUM); + if (pDRADecoder->stHeader.nNumBlockPerFrame == 8) + { + pDRADecoder->stChannels[ch].nWinType = WIN_LONG_LONG2LONG; + pDRADecoder->stChannels[ch].nNumCluster = 1; + pDRADecoder->stChannels[ch].stClusters[0].nBlockNum = 1; + } + else + { + pDRADecoder->stChannels[ch].nWinType = WIN_SHORT_SHORT2SHORT; + pDRADecoder->stChannels[ch].nNumCluster = 1; + pDRADecoder->stChannels[ch].stClusters[0].nBlockNum = pDRADecoder->stHeader.nNumBlockPerFrame; + } + + if (DRAParseCodeBook(pDRADecoder, &bs, ch) < 0) + { + break; + } + DRAGetActCB(pDRADecoder, ch); + if (DRAParseQIndex(pDRADecoder, &bs, ch) < 0) + { + break; + } + if (DRAParseQStepIndex(pDRADecoder, &bs, ch) < 0) + { + break; + } + if (DRAInverseQuant(pDRADecoder, ch) < 0) + { + nIsOK = 0; + break; + } + + DRAGetShortWindowType(pDRADecoder, ch); + DRADeinterlaceFactor(pDRADecoder, ch); + DRAReconstructChannel(pDRADecoder, ch); + + } + } + + if (nIsOK) + { + pDRADecoder->nFrameCount++; + + return 0; + } + else + { + for (int ch = 0; ch < pDRADecoder->stHeader.nNumNormalChannel; ch++) + { + int nSize = sizeof(pDRADecoder->stChannels[ch].fOverlay); + memset(pDRADecoder->stChannels[ch].fOverlay, 0, nSize); + pDRADecoder->stChannels[ch].nLastWinType = 0; + } + return -1; + } + + return 0; +} + +/////////////////////////////////////////////////////////////// +void* DRADecCreate(void) +{ + DRADecoder* pDRADecoder = (DRADecoder*)malloc(sizeof(DRADecoder)); + if (pDRADecoder == NULL) + { + return NULL; + } + + memset(pDRADecoder, 0, sizeof(DRADecoder)); + pDRADecoder->pMDCT256 = DRAMDCTCreate(256); + pDRADecoder->pMDCT2048 = DRAMDCTCreate(2048); + if (pDRADecoder->pMDCT256 == NULL || pDRADecoder->pMDCT2048 == NULL) + { + DRADecDestroy(pDRADecoder); + return NULL; + } + + return pDRADecoder; +} + +void DRADecDestroy(void* pDecoder) +{ + DRADecoder* pDRADecoder = (DRADecoder*)pDecoder; + if (pDRADecoder == NULL) + { + return; + } + if (pDRADecoder->pMDCT256) + { + DRAMDCTDestroy(pDRADecoder->pMDCT256); + pDRADecoder->pMDCT256 = NULL; + } + + if (pDRADecoder->pMDCT2048) + { + DRAMDCTDestroy(pDRADecoder->pMDCT2048); + pDRADecoder->pMDCT2048 = NULL; + } + if (pDRADecoder->pDataBuffer) + { + free(pDRADecoder->pDataBuffer); + pDRADecoder->pDataBuffer = NULL; + } + + free(pDRADecoder); +} + +int DRADecGetFrameInfo(void* pDecoder, DRAFrameInfo* pDRAFrameInfo) +{ + DRADecoder* pDRADecoder = (DRADecoder*)pDecoder; + if (pDRADecoder == NULL) + { + return -1; + } + + pDRAFrameInfo->nChannels = pDRADecoder->stHeader.nNumNormalChannel + pDRADecoder->stHeader.nNumLfeChannel; + pDRAFrameInfo->nSampleRate = SAMPLERATE_TABLE[pDRADecoder->stHeader.nSampleRateIndex]; + pDRAFrameInfo->nFrameSize = 0; + + if (pDRADecoder->stHeader.nAuxData) + { + pDRAFrameInfo->nChannels *= 2; + pDRAFrameInfo->nSampleRate *= 2; + } + + return 0; +} + +int DRADecSendData(void* pDecoder, unsigned char* pData, int nLen) +{ + DRADecoder* pDRADecoder = (DRADecoder*)pDecoder; + if (pDRADecoder == NULL) + { + return -1; + } + + unsigned char* pTemp = pDRADecoder->pDataBuffer; + int nLeft = pDRADecoder->nDataBufLen - pDRADecoder->nDataBufPos; + int nTotal = nLen + nLeft; + if (nTotal > pDRADecoder->nDataBufSize) + { + int nSize = (nTotal + 4095) / 4096 * 4096; + pTemp = (unsigned char*)malloc(nSize); + if (pTemp == NULL) + { + return -1; + } + pDRADecoder->nDataBufSize = nSize; + if (pDRADecoder->pDataBuffer) + { + if (nLen > 0) + { + memcpy(pTemp, pDRADecoder->pDataBuffer + pDRADecoder->nDataBufPos, nLeft); + } + free(pDRADecoder->pDataBuffer); + } + pDRADecoder->pDataBuffer = pTemp; + } + else + { + if (pDRADecoder->nDataBufPos > 0) + { + memcpy(pTemp, pTemp + pDRADecoder->nDataBufPos, nLeft); + } + } + memcpy(pTemp + nLeft, pData, nLen); + pDRADecoder->nDataBufPos = 0; + pDRADecoder->nDataBufLen = nTotal; + + return 0; +} + +static int DRAGetChannelS16(void* pDecoder, int nChannels, short sPCMBuffer[1024]) +{ + DRADecoder* pDRADecoder = (DRADecoder*)pDecoder; + if (pDRADecoder == NULL) + { + return -1; + } + + if (pDRADecoder->nFrameCount < 1) + { + return -1; + } + + for (int i = 0; i < 1024; i++) + { + float fSample = pDRADecoder->stChannels[nChannels].fSamples[i]; + DRA_CLIP_32768(fSample); + + sPCMBuffer[i] = (short)(fSample); + } + + return 1024; +} + +static int DRAGetSteroS16(void* pDecoder, short sPCMBuffer[2048]) +{ + DRADecoder* pDRADecoder = (DRADecoder*)pDecoder; + if (pDRADecoder == NULL) + { + return -1; + } + + if (pDRADecoder->nFrameCount < 1) + { + return -1; + } + + int nChannelNum = pDRADecoder->stHeader.nNumNormalChannel + pDRADecoder->stHeader.nNumLfeChannel; + if (nChannelNum < 2) + { + for (int i = 0; i < 1024; i++) + { + float fSample = pDRADecoder->stChannels[0].fSamples[i]; + DRA_CLIP_32768(fSample); + sPCMBuffer[i * 2 + 1] = sPCMBuffer[i * 2 + 0] = (short)(fSample); + } + } + else + { + for (int i = 0; i < 1024; i++) + { + float fSample0 = pDRADecoder->stChannels[0].fSamples[i]; + DRA_CLIP_32768(fSample0); + float fSample1 = pDRADecoder->stChannels[1].fSamples[i]; + DRA_CLIP_32768(fSample1); + + sPCMBuffer[i * 2 + 0] = (short)(fSample0); + sPCMBuffer[i * 2 + 1] = (short)(fSample1); + } + } + + return 2048; +} + +int DRADecRecvFrame(void* pDecoder, unsigned char** ppPCMData, int* nPCMLen) +{ + DRADecoder* pDRADecoder = (DRADecoder*)pDecoder; + if (pDRADecoder == NULL) + { + return -1; + } + + DRAFrameHeader stHeader; + unsigned char* pDecodeBuffer = pDRADecoder->pDataBuffer + pDRADecoder->nDataBufPos; + int nDecodeBufLen = pDRADecoder->nDataBufLen - pDRADecoder->nDataBufPos; + while (1) + { + int nPos = DRANextSyncWord(pDecodeBuffer, nDecodeBufLen); + if (nPos < 0) + { + pDRADecoder->nDataBufLen = 0; + pDRADecoder->nDataBufPos = 0; + return -1; + } + else + { + pDecodeBuffer += nPos; + nDecodeBufLen -= nPos; + pDRADecoder->nDataBufPos = (int)(pDecodeBuffer - pDRADecoder->pDataBuffer); + if (nDecodeBufLen - nPos < 6) + { + return -1; + } + + if (DRAParseHeader(pDecodeBuffer, nDecodeBufLen, &stHeader) < 0) + { + pDRADecoder->nDataBufPos += 2; + pDecodeBuffer += 2; + nDecodeBufLen -= 2; + continue; + } + if (pDRADecoder->stHeader.nNumWord != 0) + { + if (pDRADecoder->stHeader.nSampleRateIndex != stHeader.nSampleRateIndex + || pDRADecoder->stHeader.nNumLfeChannel != stHeader.nNumLfeChannel + || pDRADecoder->stHeader.nNumNormalChannel != stHeader.nNumNormalChannel) + { + if (pDRADecoder->nFrameCount > 3) + { + pDRADecoder->stHeader = stHeader; + pDRADecoder->nDataBufPos += 2; + pDecodeBuffer += 2; + nDecodeBufLen -= 2; + continue; + } + else + { + pDRADecoder->stHeader.nNumWord = 0; + pDRADecoder->nFrameCount = 0; + } + + } + + } + int nFrameSize = stHeader.nNumWord * 4; + if (nFrameSize > nDecodeBufLen) + { + return -1; + } + + pDRADecoder->nDataBufPos += nFrameSize; + pDecodeBuffer += nFrameSize; + nDecodeBufLen -= nFrameSize; + if (DRADecodeFrame(pDRADecoder, pDecodeBuffer - nFrameSize, nFrameSize) < 0) + { + continue; + } + + int nChannels = pDRADecoder->stHeader.nNumNormalChannel + pDRADecoder->stHeader.nNumLfeChannel; + if (pDRADecoder->stHeader.nAuxData) + { + nChannels *= 2; + } + + if (nPCMLen && ppPCMData) + { + if (nChannels < 2) + { + DRAGetChannelS16(pDRADecoder, 0, pDRADecoder->sOutputPCMData); + } + else + { + DRAGetSteroS16(pDRADecoder, pDRADecoder->sOutputPCMData); + } + + *nPCMLen = 1024 * 2 * nChannels; + *ppPCMData = (unsigned char*)&pDRADecoder->sOutputPCMData; + } + + return 0; + } + } + + return 0; +} diff -Naur ./ffmpeg-7.1.2/libavcodec/dradec.h ./ffmpeg-7.1.2_cavs_dra/libavcodec/dradec.h --- ./ffmpeg-7.1.2/libavcodec/dradec.h 1970-01-01 08:00:00.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/dradec.h 2025-11-19 11:51:28.000000000 +0800 @@ -0,0 +1,24 @@ +#pragma once + + +#ifdef __cplusplus +extern "C" +{ +#endif + +typedef struct DRAFrameInfo +{ + int nChannels; + int nSampleRate; + int nFrameSize; +}DRAFrameInfo; + +void* DRADecCreate(void); +void DRADecDestroy(void* pDecoder); +int DRADecGetFrameInfo(void* pDecoder, DRAFrameInfo* pDRAFrameInfo); +int DRADecSendData(void* pDecoder, unsigned char* pData, int nLen); +int DRADecRecvFrame(void* pDecoder, unsigned char** ppPCMData, int* nPCMLen); + +#ifdef __cplusplus +} +#endif diff -Naur ./ffmpeg-7.1.2/libavcodec/libcavs.c ./ffmpeg-7.1.2_cavs_dra/libavcodec/libcavs.c --- ./ffmpeg-7.1.2/libavcodec/libcavs.c 1970-01-01 08:00:00.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/libcavs.c 2026-01-22 20:40:35.252135500 +0800 @@ -0,0 +1,18562 @@ +#include "config.h" +#ifdef _WIN32 +#define SYS_WINDOWS 1 +#define SYS_LINUX 0 +#else +#define SYS_WINDOWS 0 +#define SYS_LINUX 1 +#endif + +#include "libcavs.h" + +#ifdef _WIN32 +#include +#include +#else +#define __USE_GNU +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +int cavs_cpu_num_processors (void); + +#define DECLARE_ALIGNED( var, n ) var __attribute__((aligned(n))) + +#define DECLARE_ALIGNED_16( var ) DECLARE_ALIGNED( var, 16 ) +#define DECLARE_ALIGNED_8( var ) DECLARE_ALIGNED( var, 8 ) +#define DECLARE_ALIGNED_4( var ) DECLARE_ALIGNED( var, 4 ) + +#define ALIGNED_16( var ) DECLARE_ALIGNED( var, 16 ) +#define ALIGNED_ARRAY_16( type, name, sub1, ... )\ + ALIGNED_16( type name sub1 __VA_ARGS__ ) + +#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) +#define UNUSED __attribute__((unused)) +#define ALWAYS_INLINE __attribute__((always_inline)) inline +#define NOINLINE __attribute__((noinline)) +#define cavs_constant_p(x) __builtin_constant_p(x) +#else +#define UNUSED +#define ALWAYS_INLINE inline +#define NOINLINE +#define cavs_constant_p(x) 0 +#endif + +#define cavs_pthread_t pthread_t +#define cavs_pthread_create pthread_create +#define cavs_pthread_join pthread_join +#define cavs_pthread_mutex_t pthread_mutex_t +#define cavs_pthread_mutex_init pthread_mutex_init +#define cavs_pthread_mutex_destroy pthread_mutex_destroy +#define cavs_pthread_mutex_lock pthread_mutex_lock +#define cavs_pthread_mutex_unlock pthread_mutex_unlock +#define cavs_pthread_cond_t pthread_cond_t +#define cavs_pthread_cond_init pthread_cond_init +#define cavs_pthread_cond_destroy pthread_cond_destroy +#define cavs_pthread_cond_broadcast pthread_cond_broadcast +#define cavs_pthread_cond_wait pthread_cond_wait +#define cavs_pthread_attr_t pthread_attr_t +#define cavs_pthread_attr_init pthread_attr_init +#define cavs_pthread_attr_destroy pthread_attr_destroy +#define WORD_SIZE sizeof(void*) + +#if HAVE_BIGENDIAN +#define endian_fix(x) (x) +#define endian_fix64(x) (x) +#define endian_fix32(x) (x) +#define endian_fix16(x) (x) +#else +static ALWAYS_INLINE uint32_t endian_fix32( uint32_t x ) +{ + return (x<<24) + ((x<<8)&0xff0000) + ((x>>8)&0xff00) + (x>>24); +} +static ALWAYS_INLINE uint64_t endian_fix64( uint64_t x ) +{ + return endian_fix32((uint32_t)(x>>32)) + ((uint64_t)endian_fix32((uint32_t)x)<<32); +} +static ALWAYS_INLINE intptr_t endian_fix( intptr_t x ) +{ + return WORD_SIZE == 8 ? endian_fix64(x) : endian_fix32((uint32_t)x); +} +static ALWAYS_INLINE uint16_t endian_fix16( uint16_t x ) +{ + return (x<<8)|(x>>8); +} +#endif + +#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 3) +#define cavs_clz(x) __builtin_clz(x) +#else +static int ALWAYS_INLINE + cavs_clz (uint32_t x) +{ + static uint8_t lut[16] = { 4, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }; + int y, z = ((x - 0x10000) >> 27) & 16; + x >>= z ^ 16; + z += y = ((x - 0x100) >> 28) & 8; + x >>= y ^ 8; + z += y = ((x - 0x10) >> 29) & 4; + x >>= y ^ 4; + return z + lut[x]; +} +#endif + +#if SYS_WINDOWS +#define cavs_lower_thread_priority(p)\ +{\ + cavs_pthread_t handle = pthread_self();\ +struct sched_param sp;\ + int policy = SCHED_OTHER;\ + pthread_getschedparam( handle, &policy, &sp );\ + sp.sched_priority -= p;\ + pthread_setschedparam( handle, policy, &sp );\ +} +#else +#define cavs_lower_thread_priority(p) { UNUSED int nice_ret = nice(p); } +#endif /* SYS_WINDOWS */ + + +typedef struct cavs_threadpool_t cavs_threadpool_t; + +int cavs_threadpool_init( cavs_threadpool_t **p_pool, int threads, + void (*init_func)(void *), void *init_arg ); +void cavs_threadpool_run( cavs_threadpool_t *pool, void *(*func)(void *), void *arg ); +void *cavs_threadpool_wait( cavs_threadpool_t *pool, void *arg ); +void cavs_threadpool_delete( cavs_threadpool_t *pool ); + +///////////////////////////////////////////////////////// +#define SVA_STREAM_BUF_SIZE 1024 + +#define I_PICTURE_START_CODE 0xB3 +#define PB_PICTURE_START_CODE 0xB6 +#define SLICE_START_CODE_MIN 0x00 +#define SLICE_START_CODE_MAX 0xAF +#define USER_DATA_START_CODE 0xB2 +#define SEQUENCE_HEADER_CODE 0xB0 +#define EXTENSION_START_CODE 0xB5 +#define SEQUENCE_END_CODE 0xB1 +#define VIDEO_EDIT_CODE 0xB7 + +#define MIN2(a,b) ( (a)<(b) ? (a) : (b) ) + +typedef struct { + unsigned char *f; /* save stream address */ + unsigned char *f_end; + unsigned char buf[SVA_STREAM_BUF_SIZE]; //流缓冲区,size must be large than 3 bytes + unsigned int uClearBits; //不含填充位的位缓冲,32位,初始值是0xFFFFFFFF + unsigned int uPre3Bytes; //含填充位的位缓冲,32位,初始值是0x00000000 + int iBytePosition; //当前字节位置 + int iBufBytesNum; //最近一次读入缓冲区的字节数 + int iClearBitsNum; //不含填充位的位的个数 + int iStuffBitsNum; //已剔除的填充位的个数,遇到开始码时置0 + int iBitsCount; //码流总位数 + + int demulate_enable; +} InputStream; + +int cavs_init_bitstream( InputStream *p , unsigned char *rawstream, unsigned int i_len ); +unsigned int cavs_get_one_nal ( InputStream* p, unsigned char *buf, int *length ); + +////////////////////////////////////////////////////////// + +#define MAX_CODED_FRAME_SIZE 4000000 //!< bytes for one frame + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; +typedef unsigned short uint16_t; +typedef int int32_t; +typedef unsigned int uint32_t; +typedef short DCTELEM; +#define unaligned16(a) (*(const uint16_t*)(a)) +#define unaligned32(a) (*(const uint32_t*)(a)) +#define unaligned64(a) (*(const uint64_t*)(a)) + +enum profile_e +{ + PROFILE_JIZHUN = 0x20, + PROFILE_SHENZHAN = 0x24, + PROFILE_YIDONG = 0x34, + PROFILE_GUANGDIAN = 0x48, + PROFILE_JIAQIANG = 0x88, +}; + +//Tech. of GuangDian Profile +#define PSKIP_REF p->ph.b_pb_field_enhanced +#define NEW_DIRECT p->ph.b_pb_field_enhanced + +#define CAVS_EDGE 16 +#define CAVS_MB_SIZE 16 +#define CAVS_MB4x4_SIZE 8 + +#define CAVS_I_PICTURE 0 +#define CAVS_P_PICTURE 1 +#define CAVS_B_PICTURE 2 +#define BACKGROUND_IMG 3 +#define BP_IMG 4 + +#define MAX_NEG_CROP 1024//384 + +#define CAVS_MIN(a,b) ( (a)<(b) ? (a) : (b) ) +#define CAVS_MAX(a,b) ( (a)>(b) ? (a) : (b) ) +#define CAVS_MIN3(a,b,c) CAVS_MIN((a),CAVS_MIN((b),(c))) +#define CAVS_MAX3(a,b,c) CAVS_MAX((a),CAVS_MAX((b),(c))) +#define CAVS_MIN4(a,b,c,d) CAVS_MIN((a),CAVS_MIN3((b),(c),(d))) +#define CAVS_MAX4(a,b,c,d) CAVS_MAX((a),CAVS_MAX3((b),(c),(d))) +#define CAVS_XCHG(type,a,b) { type t = a; a = b; b = t; } +#define CAVS_FIX8(f) ((int)(f*(1<<8)+.5)) +#define CAVS_SAFE_FREE(p) if(p){cavs_free(p);p=0;} +#define LEFT_ADAPT_INDEX_L 0 +#define TOP_ADAPT_INDEX_L 1 +#define LEFT_ADAPT_INDEX_C 2 +#define TOP_ADAPT_INDEX_C 3 +#define CAVS_THREAD_MAX 128 +#define CAVS_BFRAME_MAX 16 + +enum cavs_intra_lum_4x4_pred_mode +{ + I_PRED_4x4_V = 8, + I_PRED_4x4_H = 9, + I_PRED_4x4_DC = 10, + I_PRED_4x4_DDL= 11, + I_PRED_4x4_DDR= 12, + I_PRED_4x4_HD = 13, + I_PRED_4x4_VL = 14, + I_PRED_4x4_HU = 15, + I_PRED_4x4_VR = 16, + + I_PRED_4x4_DC_LEFT = 17, + I_PRED_4x4_DC_TOP = 18, + I_PRED_4x4_DC_128 = 19, +}; +enum cavs_intra_lum_pred_mode { + INTRA_L_VERT=0, + INTRA_L_HORIZ, + INTRA_L_LP, + INTRA_L_DOWN_LEFT, + INTRA_L_DOWN_RIGHT, + INTRA_L_LP_LEFT, + NTRA_L_LP_TOP, + INTRA_L_DC_128 +}; +enum cavs_intra_chrom_pred_mode { + INTRA_C_DC=0, + INTRA_C_HORIZ, + INTRA_C_VERT, + INTRA_C_PLANE, + INTRA_C_DC_LEFT, + INTRA_C_DC_TOP, + INTRA_C_DC_128, +}; + +static const int cavs_mb_pred_mode8x8c[7] = { + INTRA_C_DC, INTRA_C_HORIZ, INTRA_C_VERT, INTRA_C_PLANE, + INTRA_C_DC, INTRA_C_DC, INTRA_C_DC +}; + +#define NO_INTRA_PMODE 8 +# define INTRA_PMODE_4x4 8 +static const int8_t pred4x4[10][10] = { + {2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, + {2, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // mdou new 3 + {2, 1, 1, 1, 1, 1, 1, 1, 1, 1}, + {2, 0, 1, 2, 3, 4, 5, 6, 7, 8}, + {2, 0, 0, 0, 3, 3, 3, 3, 3, 3}, + {2, 0, 1, 4, 4, 4, 4, 4, 4, 4}, + {2, 0, 1, 5, 5, 5, 5, 5, 5, 5}, + {2, 0, 0, 0, 0, 0, 0, 6, 0, 0}, + {2, 0, 1, 7, 7, 7, 7, 7, 7, 7}, + {2, 0, 0, 0, 0, 4, 5, 6, 7, 8}//*/ +}; +static const char pred_4x4to8x8[9] = +{ + 0,1,2,3,4,1,0,1,0 +}; + +#define NO_INTRA_8x8_MODE 8 +#define IS_INTRA_4x4_PRED_MODE(mode) ((mode)>=NO_INTRA_8x8_MODE) +#define cavs_mb_pred_mode(t) cavs_mb_pred_mode[(t)+1] +static const int cavs_mb_pred_mode[21] = { + -1, INTRA_L_VERT, INTRA_L_HORIZ, INTRA_L_LP, + INTRA_L_DOWN_LEFT, INTRA_L_DOWN_RIGHT, INTRA_L_LP, + INTRA_L_LP, INTRA_L_LP, + I_PRED_4x4_V-NO_INTRA_8x8_MODE, I_PRED_4x4_H-NO_INTRA_8x8_MODE, I_PRED_4x4_DC-NO_INTRA_8x8_MODE, + I_PRED_4x4_DDL-NO_INTRA_8x8_MODE, I_PRED_4x4_DDR-NO_INTRA_8x8_MODE, I_PRED_4x4_HD-NO_INTRA_8x8_MODE, + I_PRED_4x4_VL-NO_INTRA_8x8_MODE, I_PRED_4x4_HU-NO_INTRA_8x8_MODE, I_PRED_4x4_VR-NO_INTRA_8x8_MODE, + I_PRED_4x4_DC-NO_INTRA_8x8_MODE, I_PRED_4x4_DC-NO_INTRA_8x8_MODE, I_PRED_4x4_DC-NO_INTRA_8x8_MODE +}; + +static const int8_t cavs_pred_mode_8x8to4x4[5] = +{ + 0, 1, 2, 3, 4 +}; +static const int8_t cavs_pred_mode_4x4to8x8[9] = +{ + 0, 1, 2, 3, 4, 1, 0, 1, 0 +}; + + + +#define ESCAPE_CODE_PART1 39 +#define ESCAPE_CODE_PART2 71 +#define ESCAPE_CODE 59 +#define FWD0 0x01 +#define FWD1 0x02 +#define BWD0 0x04 +#define BWD1 0x08 +#define SYM0 0x10 +#define SYM1 0x20 +#define SPLITH 0x40 +#define SPLITV 0x80 + + +#define MV_BWD_OFFS 12 +#define MV_STRIDE 4 + +enum cavs_mb_type +{ + I_8X8=0 , + P_SKIP, + P_16X16, + P_16X8, + P_8X16, + P_8X8, + B_SKIP, + B_DIRECT, + B_FWD_16X16, + B_BWD_16X16, + B_SYM_16X16, + B_8X8 = 29 +}; + +enum cavs_mb_sub_type { + B_SUB_DIRECT, + B_SUB_FWD, + B_SUB_BWD, + B_SUB_SYM +}; +enum cavs_block_size{ + BLK_16X16, + BLK_16X8, + BLK_8X16, + BLK_8X8, + BLK_4X4 +}; +enum cavs_mv_intra_mode_location { +INTRA_MODE_D3 =0, +INTRA_MODE_B2, +INTRA_MODE_B3, +INTRA_MODE_A1, +INTRA_MODE_X0, +INTRA_MODE_X1, +INTRA_MODE_A3, +INTRA_MODE_X2, +INTRA_MODE_X3 +}; + +enum cavs_mv_pred { +MV_PRED_MEDIAN, +MV_PRED_LEFT, +MV_PRED_TOP, +MV_PRED_TOPRIGHT, +MV_PRED_PSKIP, +MV_PRED_BSKIP +}; + +enum cavs_mv_block_location { +MV_FWD_D3 = 0, +MV_FWD_B2, +MV_FWD_B3, +MV_FWD_C2, +MV_FWD_A1, +MV_FWD_X0, +MV_FWD_X1, +MV_FWD_A3 = 8, +MV_FWD_X2, +MV_FWD_X3, +MV_BWD_D3 = MV_BWD_OFFS, +MV_BWD_B2, +MV_BWD_B3, +MV_BWD_C2, +MV_BWD_A1, +MV_BWD_X0, +MV_BWD_X1, +MV_BWD_A3 = MV_BWD_OFFS+8, +MV_BWD_X2, +MV_BWD_X3 +}; + +#define A_AVAIL 1 +#define B_AVAIL 2 +#define C_AVAIL 4 +#define D_AVAIL 8 +#define NOT_AVAIL -1 +#define REF_INTRA -2 +#define REF_DIR -3 + +#define CAVS_ICACHE_STRIDE 5 +#define CAVS_ICACHE_START 6 + + +#define CAVS_SEQUENCE_DISPLAY_EXTENTION 0x00000002 +#define CAVS_COPYRIGHT_EXTENTION 0x00000004 +#define CAVS_PICTURE_DISPLAY_EXTENTION 0x00000007 +#define CAVS_CAMERA_PARAMETERS_EXTENTION 0x0000000B +#define CAVS_SLICE_MIN_START_CODE 0x00000100 +#define CAVS_SLICE_MAX_START_CODE 0x000001AF +#define CAVS_VIDEO_SEQUENCE_START_CODE 0x000001B0 +#define CAVS_VIDEO_SEQUENCE_END_CODE 0x000001B1 +#define CAVS_USER_DATA_CODE 0x000001B2 +#define CAVS_I_PICUTRE_START_CODE 0x000001B3 +#define CAVS_EXTENSION_START_CODE 0x000001B5 +#define CAVS_PB_PICUTRE_START_CODE 0x000001B6 +#define CAVS_VIDEO_EDIT_CODE 0x000001B7 +#define CAVS_VIDEO_TIME_CODE 0x000001E0 + +#define pixel uint8_t +/* Unions for type-punning. + * Mn: load or store n bits, aligned, native-endian + * CPn: copy n bits, aligned, native-endian + * we don't use memcpy for CPn because memcpy's args aren't assumed to be aligned */ +typedef union { uint16_t i; uint8_t c[2]; } cavs_union16_t; +typedef union { uint32_t i; uint16_t b[2]; uint8_t c[4]; } cavs_union32_t; +typedef union { uint64_t i; uint32_t a[2]; uint16_t b[4]; uint8_t c[8]; } cavs_union64_t; +typedef struct { uint64_t i[2]; } cavs_uint128_t; +typedef union { cavs_uint128_t i; uint64_t a[2]; uint32_t b[4]; uint16_t c[8]; uint8_t d[16]; } cavs_union128_t; +#define M16(src) (((cavs_union16_t*)(src))->i) +#define M32(src) (((cavs_union32_t*)(src))->i) +#define M64(src) (((cavs_union64_t*)(src))->i) +#define M128(src) (((cavs_union128_t*)(src))->i) +#define M128_ZERO ((cavs_uint128_t){{0,0}}) +#define CP16(dst,src) M16(dst) = M16(src) +#define CP32(dst,src) M32(dst) = M32(src) +#define CP64(dst,src) M64(dst) = M64(src) +#define CP128(dst,src) M128(dst) = M128(src) + +#define MPIXEL_X4(src) M32(src) +#define PIXEL_SPLAT_X4(x) ((x)*0x01010101U) +#define CPPIXEL_X4(dst,src) MPIXEL_X4(dst) = MPIXEL_X4(src) + +#define PACK8TO16(a, b) (a + ((b)<<8)) + +//#define DECLARE_ALIGNED( var, n ) __declspec(align(n)) var +#define DECLARE_ALIGNED_16( var ) DECLARE_ALIGNED( var, 16 ) +#define DECLARE_ALIGNED_8( var ) DECLARE_ALIGNED( var, 8 ) +#define DECLARE_ALIGNED_4( var ) DECLARE_ALIGNED( var, 4 ) + +/* + 0 1 4 5 + 2 3 6 7 + 8 9 12 13 + 10 11 14 15 +*/ +static const int offset_block4x4[16][2] = { + {0,0}, {1,0}, {0,1}, {1,1}, + {2,0}, {3,0}, {2,1}, {3,1}, + {0,2}, {1,2}, {0,3}, {1,3}, + {2,2}, {3,2}, {2,3}, {3,3} +}; + +typedef struct tagcavs_video_sequence_header +{ + /************************************************************************/ + /* jizhun_profile and yidong_profile 0x34 */ + /************************************************************************/ + uint8_t i_profile_id;/*8bits u(8)*/ + uint8_t i_level_id;/*8bits u(8)*/ + uint8_t b_progressive_sequence;/*1bit u(1)*/ + uint32_t i_horizontal_size;/*14bits u(14)*/ + uint32_t i_vertical_size;/*14bits u(14)*/ + uint8_t i_chroma_format;/*2bits u(2)*/ + uint8_t i_sample_precision;/*3bits u(3)*/ + uint8_t i_aspect_ratio;/*4bits u(4)*/ + uint8_t i_frame_rate_code;/*4bits u(4)*/ + uint32_t i_bit_rate; + /*30bits u(30) 分两部分获得 + 18bits bit_rate_lower; + 12bits bit_rate_upper。 + 其间有1bit的marker_bit防止起始码的竞争*/ + uint8_t b_low_delay;/*1bit u(1)*/ + //这里有1bit的marker_bit + uint32_t i_bbv_buffer_size;/*18bits u(18)*/ + //还有3bits的reserved_bits,固定为'000' + /************************************************************************/ + /* yidong_profile 0x34 */ + /************************************************************************/ + + uint32_t weighting_quant_flag; + uint32_t mb_adapt_wq_disable; + uint32_t chroma_quant_param_disable; + uint8_t chroma_quant_param_delta_u; + uint8_t chroma_quant_param_delta_v; + uint8_t weighting_quant_param_index; + uint8_t weighting_quant_param_delta1[6]; + uint8_t weighting_quant_param_delta2[6]; + uint32_t scene_adapt_disable; + uint32_t scene_model_update_flag; + uint32_t weighting_quant_model; + uint32_t vbs_enable; + uint32_t vbs_qp_shift; + uint32_t asi_enable; + uint32_t limitDC_refresh_frame; + + uint8_t b_interlaced; + + uint8_t b_flag_aec; /* used for check stream change */ + uint32_t b_aec_enable; /* backup aec enable */ +}cavs_video_sequence_header; + +typedef struct tagcavs_picture_header +{ + uint16_t i_bbv_delay;/*16bits u(16)*/ + + uint8_t i_picture_coding_type;/*2bits u(2) pb_piture_header专有*/ + uint8_t b_time_code_flag;/*1bit u(1) i_piture_header专有*/ + uint32_t i_time_code;/*24bits u(24) i_piture_header专有*/ + uint8_t i_picture_distance;/*8bits u(8)*/ + uint32_t i_bbv_check_times;/*ue(v)*/ + uint8_t b_progressive_frame;/*1bit u(1)*/ + uint8_t b_picture_structure;/*1bit u(1)*/ + uint8_t b_advanced_pred_mode_disable;/*1bit u(1) pb_piture_header专有*/ + uint8_t b_top_field_first;/*1bit u(1)*/ + uint8_t b_repeat_first_field;/*1bit u(1)*/ + uint8_t b_fixed_picture_qp;/*1bit u(1)*/ + uint8_t i_picture_qp;/*6bits u(6)*/ + uint8_t b_picture_reference_flag;/*1bit u(1) pb_piture_header专有*/ + /*4bits保留字节reserved_bits固定为'0000'*/ + uint8_t b_no_forward_reference_flag; + uint8_t b_skip_mode_flag;/*1bit u(1)*/ + uint8_t b_loop_filter_disable;/*1bit u(1)*/ + uint8_t b_loop_filter_parameter_flag;/*1bit u(1)*/ + uint32_t i_alpha_c_offset;/*se(v)*/ + uint32_t i_beta_offset;/*se(v)*/ + + /************************************************************************/ + /* yidong_profile 0x34 */ + /************************************************************************/ + + uint32_t weighting_quant_flag; + uint32_t mb_adapt_wq_disable; + uint32_t chroma_quant_param_disable; + uint8_t chroma_quant_param_delta_u; + uint8_t chroma_quant_param_delta_v; + uint8_t weighting_quant_param_index; + uint8_t weighting_quant_param_delta1[6]; + uint8_t weighting_quant_param_delta2[6]; + + uint8_t weighting_quant_param_undetail[6]; + uint8_t weighting_quant_param_detail[6]; + + uint32_t scene_adapt_disable; + uint32_t scene_model_update_flag; + uint32_t weighting_quant_model; + uint32_t vbs_enable; + uint32_t vbs_qp_shift; + uint32_t asi_enable; + uint32_t limitDC_refresh_frame; + + /************************************************************************/ + /* guangdian profile 0x48 add by jcma */ + /************************************************************************/ + uint32_t b_aec_enable; + uint32_t b_pb_field_enhanced; +}cavs_picture_header; + +typedef struct tagcavs_slice_header +{ + uint8_t i_slice_vertical_position_extension;/*3bits u(3)*/ + uint8_t i_slice_horizontal_position_extension;/*2bits u(2)*/ + uint8_t i_slice_horizontal_position;/*8bits u(8)*/ + uint8_t b_fixed_slice_qp;/*1bit u(1)*/ + uint8_t i_slice_qp;/*6bits u(6)*/ + uint8_t b_slice_weighting_flag;/*1bit u(1)*/ + uint32_t i_luma_scale[4];/*8bits u(8)*/ + int32_t i_luma_shift[4];/*8bits i(8)*/ + uint32_t i_chroma_scale[4];/*8bits u(8)*/ + int32_t i_chroma_shift[4];/*8bits i(8)*/ + uint8_t b_mb_weighting_flag;/*1bit u(1)*/ + uint32_t i_mb_skip_run;/*ue(v)*/ + uint32_t i_profile_id; + uint8_t i_number_of_reference; + uint32_t quant_coff_pred_flag; +}cavs_slice_header; + +typedef struct tagcavs_sequence_display_extension +{ + uint8_t i_video_format;/*3bits u(3)*/ + uint8_t b_sample_range;/*1bit u(1)*/ + uint8_t b_colour_description;/*1bit u(1)*/ + uint8_t i_colour_primaries;/*8bits u(8)*/ + uint8_t i_transfer_characteristics;/*8bits u(8)*/ + uint8_t i_matrix_coefficients;/*8bits u(8)*/ + uint32_t i_display_horizontal_size;/*14bits u(14)*/ + uint32_t i_display_vertical_size;/*14bits u(14)*/ + //还有2bits的reserved_bits, + uint8_t i_stereo_packing_mode; +}cavs_sequence_display_extension; + +typedef struct tagcavs_copyright_extension +{ + uint8_t b_copyright_flag;/*1bit u(1)*/ + uint8_t i_copyright_id;/*8bits u(8)*/ + uint8_t b_original_or_copy;/*1bit u(1)*/ + //这里有保留7bits的reserved_bits + uint64_t i_copyright_number; + /*64bits u(64)分三个部分出现, + 20bits copyright_number_1; + 22bits copyright_number_2; + 22bits copyright_number_3 + 其间分别嵌入2个1bit的marker_bit*/ +}cavs_copyright_extension; + +typedef struct tagcavs_camera_parameters_extension +{ + //1bit的reserved_bits + uint8_t i_camera_id;/*7bits u(7)*/ + //这里有1bit的marker_bit + uint32_t i_height_of_image_device;/*22bits u(22)*/ + //这里有1bit的marker_bit + uint32_t i_focal_length;/*22bits u(22)*/ + //这里有1bit的marker_bit + uint32_t i_f_number;/*22bits u(22)*/ + //这里有1bit的marker_bit + uint32_t i_vertical_angle_of_view;/*22bits u(22)*/ + //这里有1bit的marker_bit + int32_t i_camera_position_x; + /*32bits i(32) 分两部分获得 + 16bits camera_position_x_upper; + 16bits camera_position_x_lower; + 其间有1bit的marker_bit防止起始码的竞争*/ + int32_t i_camera_position_y; + /*32bits i(32) 分两部分获得 + 16bits camera_position_x_upper; + 16bits camera_position_x_lower; + 其间有1bit的marker_bit防止起始码的竞争*/ + int32_t i_camera_position_z; + /*32bits i(32) 分两部分获得 + 16bits camera_position_x_upper; + 16bits camera_position_x_lower; + 其间有1bit的marker_bit防止起始码的竞争*/ + //这里有1bit的marker_bit + int32_t i_camera_direction_x;/*22bits i(22)*/ + //这里有1bit的marker_bit + int32_t i_camera_direction_y;/*22bits i(22)*/ + //这里有1bit的marker_bit + int32_t i_camera_direction_z;/*22bits i(22)*/ + + //这里有1bit的marker_bit + int32_t i_image_plane_vertical_x;/*22bits i(22)*/ + //这里有1bit的marker_bit + int32_t i_image_plane_vertical_y;/*22bits i(22)*/ + //这里有1bit的marker_bit + int32_t i_image_plane_vertical_z;/*22bits i(22)*/ + //这里有1bit的marker_bit + //还有32bits的reserved_bits, +}cavs_camera_parameters_extension; + +typedef struct tagcavs_picture_display_extension +{ + uint32_t i_number_of_frame_centre_offsets; + /*元素个数,由语法派生获得cavs_sequence_display_extension,不占用bits*/ + uint32_t i_frame_centre_horizontal_offset[4];/*16bits i(16)*/ + uint32_t i_frame_centre_vertical_offset[4];/*16bits i(16)*/ +}cavs_picture_display_extension; + typedef struct tagcavs_vector +{ + int16_t x; + int16_t y; + int16_t dist; + int16_t ref; +} cavs_vector; + +typedef struct tagcavs_vlc +{ + int8_t rltab[59][3]; + int8_t level_add[27]; + int8_t golomb_order; + int inc_limit; + int8_t max_run; + +} cavs_vlc; + +typedef struct tagcavs_image +{ + uint32_t i_colorspace; + uint32_t i_width; + uint32_t i_height; + uint8_t *p_data[4]; + uint32_t i_stride[4]; + uint32_t i_distance_index; + uint32_t i_code_type; + uint32_t b_top_field_first; + uint32_t i_ref_distance[2]; /* two ref-frames at most */ + uint32_t b_picture_structure; + +}cavs_image; + +typedef struct tagcavs_bitstream +{ + uint8_t *p_start; + uint8_t *p; + uint8_t *p_end; + int i_left; + uint32_t i_startcode; +}cavs_bitstream; + +static inline void cavs_bitstream_init( cavs_bitstream *s, void *p_data, int i_data ) +{ + s->p_start = (uint8_t *)p_data; + s->p = (uint8_t *)p_data; + s->p_end = s->p + i_data; + s->i_left = 8; + s->i_startcode=*s->p; +} + +static inline int cavs_bitstream_pos( cavs_bitstream *s ) +{ + return (int)( 8 * ( s->p - s->p_start ) + 8 - s->i_left ); +} + +static inline int cavs_bitstream_eof( cavs_bitstream *s ) +{ + return( s->p >= s->p_end -1? 1: 0 ) && (*(s->p-1) & ((1<i_left)-1)) == (1<<(s->i_left-1)); +} + +static inline void cavs_bitstream_align(cavs_bitstream *s) +{ + if (s->i_left < 8) + { + s->p++; + s->i_left = 8; + } +} + +static inline void cavs_bitstream_next_byte( cavs_bitstream *s) +{ + s->p++; + s->i_startcode = (s->i_startcode << 8) + *s->p; + s->i_left = 8; +} + +static inline uint32_t cavs_bitstream_get_bits( cavs_bitstream *s, int i_count ) +{ + static uint32_t i_mask[33] ={0x00, + 0x01, 0x03, 0x07, 0x0f, + 0x1f, 0x3f, 0x7f, 0xff, + 0x1ff, 0x3ff, 0x7ff, 0xfff, + 0x1fff, 0x3fff, 0x7fff, 0xffff, + 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, + 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, + 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, + 0x1fffffff,0x3fffffff,0x7fffffff,0xffffffff}; + int i_shr; + uint32_t i_result = 0; + + while( i_count > 0 ) + { + if( s->p >= s->p_end ) + { + break; + } + if( ( i_shr = s->i_left - i_count ) >= 0 ) + { + i_result |= ( *s->p >> i_shr )&i_mask[i_count]; + s->i_left -= i_count; + if( s->i_left == 0 ) + { + cavs_bitstream_next_byte(s); + } + + return( i_result ); + } + else + { + i_result |= (*s->p&i_mask[s->i_left]) << -i_shr; + i_count -= s->i_left; + cavs_bitstream_next_byte(s); + } + } + + return( i_result ); +} + +static inline uint32_t cavs_bitstream_get_bit1( cavs_bitstream *s ) +{ + if( s->p < s->p_end ) + { + uint32_t i_result; + + s->i_left--; + i_result = ( *s->p >> s->i_left )&0x01; + if( s->i_left == 0 ) + { + cavs_bitstream_next_byte(s); + } + + return i_result; + } + + return 0; +} + + + +static inline int32_t cavs_bitstream_get_int( cavs_bitstream *s, int i_count ) +{ + uint32_t i_temp=1<<(i_count-1); + uint32_t i_result=cavs_bitstream_get_bits(s,i_count); + + if(i_result&i_temp) + { + return 0-(int)((~i_result+1)<<( 32 - i_count)>>(32 - i_count)); + } + else + { + return i_result; + } +} + +static inline void cavs_bitstream_clear_bits( cavs_bitstream *s, int i_count ) +{ + while( i_count > 0 ) + { + if( s->p >= s->p_end ) + { + break; + } + if( ( s->i_left - i_count ) >= 0 ) + { + s->i_left -= i_count; + if( s->i_left == 0 ) + { + cavs_bitstream_next_byte(s); + } + break; + } + else + { + i_count -= s->i_left; + cavs_bitstream_next_byte(s); + } + } +} + +static inline int cavs_bitstream_get_ue( cavs_bitstream *s ) +{ + int i = 0; + int temp; + + while( cavs_bitstream_get_bit1(s) == 0 && s->p < s->p_end && i < 32) + { + i++; + } + temp=( ( 1 << i) - 1 + cavs_bitstream_get_bits( s, i) ); + + return( temp ); +} + +static inline int cavs_bitstream_get_se( cavs_bitstream *s) +{ + int val = cavs_bitstream_get_ue( s); + int temp=val&0x01 ? (val+1)/2 : -(val/2); + + return temp; +} + +static inline int cavs_bitstream_get_ue_k( cavs_bitstream *s, int k) +{ + int i = 0; + int temp; + + while( cavs_bitstream_get_bit1( s ) == 0 && s->p < s->p_end && i < 32) + { + i++; + } + temp = ( 1 << (i+k)) - (1< 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) +#define UNUSED __attribute__((unused)) +#else +#define UNUSED +#endif + +typedef struct +{ + uint16_t lg_pmps; /* 10 bits */ + uint8_t mps; /* 1 bit */ + uint8_t cycno; /* 2 bits */ +} bi_ctx_t; + +typedef struct +{ + /* state */ + uint16_t s1, t1; /*unsigned int*/ + uint16_t value_s, value_t; /*unsigned int*/ + uint8_t buffer; + char bits_to_go; + int dec_bypass; + + cavs_bitstream bs; + + bi_ctx_t mb_type_contexts [3][NUM_MB_TYPE_CTX]; + bi_ctx_t b8_type_contexts [2][NUM_B8_TYPE_CTX]; + bi_ctx_t mv_res_contexts [2][NUM_MV_RES_CTX]; + bi_ctx_t ref_no_contexts [2][NUM_REF_NO_CTX]; + bi_ctx_t delta_qp_contexts [NUM_DELTA_QP_CTX]; + bi_ctx_t mb_aff_contexts [NUM_MB_AFF_CTX]; + bi_ctx_t ipr_contexts [NUM_IPR_CTX]; + bi_ctx_t cipr_contexts[NUM_CIPR_CTX]; + bi_ctx_t cbp_contexts [3][NUM_CBP_CTX]; + bi_ctx_t bcbp_contexts[NUM_BLOCK_TYPES][NUM_BCBP_CTX]; + bi_ctx_t one_contexts [NUM_BLOCK_TYPES][NUM_ONE_CTX]; + bi_ctx_t abs_contexts [NUM_BLOCK_TYPES][NUM_ABS_CTX]; + bi_ctx_t fld_map_contexts [NUM_BLOCK_TYPES][NUM_MAP_CTX]; + bi_ctx_t fld_last_contexts[NUM_BLOCK_TYPES][NUM_LAST_CTX]; + bi_ctx_t map_contexts [NUM_BLOCK_TYPES][NUM_MAP_CTX]; + bi_ctx_t last_contexts[NUM_BLOCK_TYPES][NUM_LAST_CTX]; + + bi_ctx_t mb_weighting_pred; + + char b_cabac_error; +} cavs_cabac_t; + +static UNUSED const uint16_t lg_pmps_tab[6][1024] = { +{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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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}, +{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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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}, +{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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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}, +{197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216, +217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236, +237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256, +257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276, +277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296, +297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316, +317,318,319,320,321,322,323,324, +325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344, +345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364, +365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384, +385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404, +405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424, +425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444, +445,446,447,448,449,450,451,452, +453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472, +473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492, +493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512, +513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532, +533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552, +553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572, +573,574,575,576,577,578,579,580, +581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600, +601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620, +621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640, +641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660, +661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680, +681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700, +701,702,703,704,705,706,707,708, +709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728, +729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748, +749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768, +769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788, +789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808, +809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828, +829,830,831,832,833,834,835,836, +837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856, +857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876, +877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896, +897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916, +917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936, +937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956, +957,958,959,960,961,962,963,964, +965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984, +985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003, +1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019, +1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035, +1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051, +1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067, +1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083, +1084,1085,1086,1087,1088,1089,1090,1091,1092, +1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108, +1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124, +1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140, +1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156, +1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172, +1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188, +1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200,1201,1202,1203,1204, +1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218,1219,1220}, /* cwr=3 +197 */ +{95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116, +117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136, +137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156, +157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176, +177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196, +197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216, +217,218,219,220,221,222, +223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242, +243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262, +263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282, +283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302, +303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322, +323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342, +343,344,345,346,347,348,349,350, +351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370, +371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388,389,390, +391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410, +411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430, +431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450, +451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470, +471,472,473,474,475,476,477,478, +479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498, +499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518, +519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538, +539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558, +559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578, +579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598, +599,600,601,602,603,604,605,606, +607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626, +627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646, +647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666, +667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686, +687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706, +707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726, +727,728,729,730,731,732,733,734, +735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754, +755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774, +775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794, +795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814, +815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834, +835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854, +855,856,857,858,859,860,861,862, +863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882, +883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902, +903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922, +923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942, +943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962, +963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982, +983,984,985,986,987,988,989,990, +991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008 +,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024 +,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040 +,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056 +,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072 +,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088 +,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104 +,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118}, /* cwr=4 +95 */ +{46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72 +,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99, +100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119, +120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139, +140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, +160,161,162,163,164,165,166,167,168,169,170,171,172,173, +174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193, +194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213, +214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233, +234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253, +254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273, +274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293, +294,295,296,297,298,299,300,301, +302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321, +322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341, +342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361, +362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381, +382,383,384,385,386,387,388,389,390,391,392,393,394,395,396,397,398,399,400,401, +402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421, +422,423,424,425,426,427,428,429, +430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449, +450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469, +470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489, +490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509, +510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529, +530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549, +550,551,552,553,554,555,556,557, +558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577, +578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597, +598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617, +618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637, +638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657, +658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677, +678,679,680,681,682,683,684,685, +686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705, +706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725, +726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745, +746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765, +766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785, +786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805, +806,807,808,809,810,811,812,813, +814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833, +834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853, +854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873, +874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893, +894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913, +914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933, +934,935,936,937,938,939,940,941, +942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961, +962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981, +982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001, +1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017, +1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033, +1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049, +1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065, +1066,1067,1068,1069} /* cwr=5 +46 */ +}; + +/* cycno = (cycno<=1)?3:(cycno==2)?4:5 */ +static UNUSED uint8_t cwr_trans[4] ={ + 3, /*cycno = 0*/ + 3, /*cycno = 1*/ + 4, /*cycno = 2*/ + 5 /*cycno = 3*/ +}; + +static UNUSED uint8_t cycno_trans1[4] ={ + 1, /*cycno = 0*/ + 1, /*cycno = 1*/ + 2, /*cycno = 2*/ + 3 /*cycno = 3*/ +}; + +static UNUSED uint8_t cycno_trans2[4] ={ + 1, /*cycno = 0*/ + 2, /*cycno = 1*/ + 3, /*cycno = 2*/ + 3 /*cycno = 3*/ +}; + +static UNUSED uint8_t cycno_trans_2d[2][4]= +{ + {1, 1, 2, 3}, /*cycno_trans1*/ + {1, 2, 3, 3} /*cycno_trans2*/ +}; + +static UNUSED const uint16_t lg_pmps_tab_mps[6][1024] ={ +{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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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}, +{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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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}, +{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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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, +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,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,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,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}, +{ +0,1,2,3,4,5,6,7,7,8,9,10,11,12,13,14,14,15,16,17,18,19,20,21,21,22,23,24,25,26,27, +28,27,28,29,30,31,32,33,34,34,35,36,37,38,39,40,41,41,42,43,44,45,46,47,48,48, +49,50,51,52,53,54,55,54,55,56,57,58,59,60,61,61,62,63,64,65,66,67,68,68,69,70,71 +,72,73,74,75,75,76,77,78,79,80,81,82,81,82,83,84,85,86,87,88,88,89,90,91,92,93,94, +95,95,96,97,98,99,100,101,102,102,103,104,105,106,107,108,109, +108,109,110,111,112,113,114,115,115,116,117,118,119,120,121,122,122,123,124,125, +126,127,128,129,129,130,131,132,133,134,135,136,135,136,137,138,139,140,141,142, +142,143,144,145,146,147,148,149,149,150,151,152,153,154,155,156,156,157,158,159, +160,161,162,163,162,163,164,165,166,167,168,169,169,170,171,172,173,174,175,176, +176,177,178,179,180,181,182,183,183,184,185,186,187,188,189,190,189,190,191,192, +193,194,195,196,196,197,198,199,200,201,202,203,203,204,205,206,207,208,209,210, +210,211,212,213,214,215,216,217, +216,217,218,219,220,221,222,223,223,224,225,226,227,228,229,230,230,231,232,233, +234,235,236,237,237,238,239,240,241,242,243,244,243,244,245,246,247,248,249,250, +250,251,252,253,254,255,256,257,257,258,259,260,261,262,263,264,264,265,266,267, +268,269,270,271,270,271,272,273,274,275,276,277,277,278,279,280,281,282,283,284, +284,285,286,287,288,289,290,291,291,292,293,294,295,296,297,298,297,298,299,300, +301,302,303,304,304,305,306,307,308,309,310,311,311,312,313,314,315,316,317,318, +318,319,320,321,322,323,324,325, +324,325,326,327,328,329,330,331,331,332,333,334,335,336,337,338,338,339,340,341, +342,343,344,345,345,346,347,348,349,350,351,352,351,352,353,354,355,356,357,358, +358,359,360,361,362,363,364,365,365,366,367,368,369,370,371,372,372,373,374,375, +376,377,378,379,378,379,380,381,382,383,384,385,385,386,387,388,389,390,391,392, +392,393,394,395,396,397,398,399,399,400,401,402,403,404,405,406,405,406,407,408, +409,410,411,412,412,413,414,415,416,417,418,419,419,420,421,422,423,424,425,426, +426,427,428,429,430,431,432,433, +432,433,434,435,436,437,438,439,439,440,441,442,443,444,445,446,446,447,448,449, +450,451,452,453,453,454,455,456,457,458,459,460,459,460,461,462,463,464,465,466, +466,467,468,469,470,471,472,473,473,474,475,476,477,478,479,480,480,481,482,483, +484,485,486,487,486,487,488,489,490,491,492,493,493,494,495,496,497,498,499,500, +500,501,502,503,504,505,506,507,507,508,509,510,511,512,513,514,513,514,515,516, +517,518,519,520,520,521,522,523,524,525,526,527,527,528,529,530,531,532,533,534, +534,535,536,537,538,539,540,541, +540,541,542,543,544,545,546,547,547,548,549,550,551,552,553,554,554,555,556,557, +558,559,560,561,561,562,563,564,565,566,567,568,567,568,569,570,571,572,573,574, +574,575,576,577,578,579,580,581,581,582,583,584,585,586,587,588,588,589,590,591, +592,593,594,595,594,595,596,597,598,599,600,601,601,602,603,604,605,606,607,608, +608,609,610,611,612,613,614,615,615,616,617,618,619,620,621,622,621,622,623,624, +625,626,627,628,628,629,630,631,632,633,634,635,635,636,637,638,639,640,641,642, +642,643,644,645,646,647,648,649, +648,649,650,651,652,653,654,655,655,656,657,658,659,660,661,662,662,663,664,665, +666,667,668,669,669,670,671,672,673,674,675,676,675,676,677,678,679,680,681,682, +682,683,684,685,686,687,688,689,689,690,691,692,693,694,695,696,696,697,698,699, +700,701,702,703,702,703,704,705,706,707,708,709,709,710,711,712,713,714,715,716, +716,717,718,719,720,721,722,723,723,724,725,726,727,728,729,730,729,730,731,732, +733,734,735,736,736,737,738,739,740,741,742,743,743,744,745,746,747,748,749,750, +750,751,752,753,754,755,756,757, +756,757,758,759,760,761,762,763,763,764,765,766,767,768,769,770,770,771,772,773, +774,775,776,777,777,778,779,780,781,782,783,784,783,784,785,786,787,788,789,790, +790,791,792,793,794,795,796,797,797,798,799,800,801,802,803,804,804,805,806,807, +808,809,810,811,810,811,812,813,814,815,816,817,817,818,819,820,821,822,823,824, +824,825,826,827,828,829,830,831,831,832,833,834,835,836,837,838,837,838,839,840, +841,842,843,844,844,845,846,847,848,849,850,851,851,852,853,854,855,856,857,858, +858,859,860,861,862,863,864,865 +}, /* cwr=3 */ +{ +0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15,16,17,18,19,20,21,22,23,24,25,26,27,28, +29,30,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,45,46,47,48,49,50,51,52,53 +,54,55,56,57,58,59,60,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,74,75,76,77, +78,79,80,81,82,83,84,85,86,87,88,89,89,90,91,92,93,94,95,96,97,98,99,100,101,102, +103,104,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119, +118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,133,134,135,136, +137,138,139,140,141,142,143,144,145,146,147,148,148,149,150,151,152,153,154,155, +156,157,158,159,160,161,162,163,163,164,165,166,167,168,169,170,171,172,173,174, +175,176,177,178,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192, +192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,207,208,209,210, +211,212,213,214,215,216,217,218,219,220,221,222,222,223,224,225,226,227,228,229, +230,231,232,233,234,235,236,237, +236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,251,252,253,254, +255,256,257,258,259,260,261,262,263,264,265,266,266,267,268,269,270,271,272,273, +274,275,276,277,278,279,280,281,281,282,283,284,285,286,287,288,289,290,291,292, +293,294,295,296,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310, +310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,325,326,327,328, +329,330,331,332,333,334,335,336,337,338,339,340,340,341,342,343,344,345,346,347, +348,349,350,351,352,353,354,355, +354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,369,370,371,372, +373,374,375,376,377,378,379,380,381,382,383,384,384,385,386,387,388,389,390,391, +392,393,394,395,396,397,398,399,399,400,401,402,403,404,405,406,407,408,409,410, +411,412,413,414,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428, +428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,443,444,445,446, +447,448,449,450,451,452,453,454,455,456,457,458,458,459,460,461,462,463,464,465, +466,467,468,469,470,471,472,473, +472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,487,488,489,490, +491,492,493,494,495,496,497,498,499,500,501,502,502,503,504,505,506,507,508,509, +510,511,512,513,514,515,516,517,517,518,519,520,521,522,523,524,525,526,527,528, +529,530,531,532,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546, +546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,561,562,563,564, +565,566,567,568,569,570,571,572,573,574,575,576,576,577,578,579,580,581,582,583, +584,585,586,587,588,589,590,591, +590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,605,606,607,608, +609,610,611,612,613,614,615,616,617,618,619,620,620,621,622,623,624,625,626,627, +628,629,630,631,632,633,634,635,635,636,637,638,639,640,641,642,643,644,645,646, +647,648,649,650,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664, +664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,679,680,681,682, +683,684,685,686,687,688,689,690,691,692,693,694,694,695,696,697,698,699,700,701, +702,703,704,705,706,707,708,709, +708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,723,724,725,726, +727,728,729,730,731,732,733,734,735,736,737,738,738,739,740,741,742,743,744,745, +746,747,748,749,750,751,752,753,753,754,755,756,757,758,759,760,761,762,763,764, +765,766,767,768,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782, +782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,797,798,799,800, +801,802,803,804,805,806,807,808,809,810,811,812,812,813,814,815,816,817,818,819, +820,821,822,823,824,825,826,827, +826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,841,842,843,844, +845,846,847,848,849,850,851,852,853,854,855,856,856,857,858,859,860,861,862,863, +864,865,866,867,868,869,870,871,871,872,873,874,875,876,877,878,879,880,881,882, +883,884,885,886,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900, +900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,915,916,917,918, +919,920,921,922,923,924,925,926,927,928,929,930,930,931,932,933,934,935,936,937, +938,939,940,941,942,943,944,945 +}, /* cwr=4 */ +{ +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,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55 +,56,57,58,59,60,61,62,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81, +82,83,84,85,86,87,88,89,90,91,92,93,93,94,95,96,97,98,99,100,101,102,103,104,105, +106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124, +123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142, +143,144,145,146,147,148,149,150,151,152,153,154,154,155,156,157,158,159,160,161, +162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181, +182,183,184,185,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200, +201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,216,217,218,219, +220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, +240,241,242,243,244,245,246,247, +246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265, +266,267,268,269,270,271,272,273,274,275,276,277,277,278,279,280,281,282,283,284, +285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304, +305,306,307,308,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323, +324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,339,340,341,342, +343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362, +363,364,365,366,367,368,369,370, +369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,384,385,386,387,388, +389,390,391,392,393,394,395,396,397,398,399,400,400,401,402,403,404,405,406,407, +408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427, +428,429,430,431,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446, +447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,462,463,464,465, +466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485, +486,487,488,489,490,491,492,493, +492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511, +512,513,514,515,516,517,518,519,520,521,522,523,523,524,525,526,527,528,529,530, +531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550, +551,552,553,554,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569, +570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,585,586,587,588, +589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608, +609,610,611,612,613,614,615,616, +615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634, +635,636,637,638,639,640,641,642,643,644,645,646,646,647,648,649,650,651,652,653, +654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673, +674,675,676,677,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692, +693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,708,709,710,711, +712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731, +732,733,734,735,736,737,738,739, +738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757, +758,759,760,761,762,763,764,765,766,767,768,769,769,770,771,772,773,774,775,776, +777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796, +797,798,799,800,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815, +816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,831,832,833,834, +835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854, +855,856,857,858,859,860,861,862, +861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880, +881,882,883,884,885,886,887,888,889,890,891,892,892,893,894,895,896,897,898,899, +900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919, +920,921,922,923,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938, +939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,954,955,956,957, +958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977, +978,979,980,981,982,983,984,985 +} /*cwr = 5*/ +}; + +static UNUSED const uint8_t lg_pmps_shift2[1024] ={ /* lg_pmps>>2 */ +0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9, +10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16 +,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23, +23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29, +30,30,30,30,31,31,31,31, +32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38 +,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45, +45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51, +52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58 +,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63, +64,64,64,64,65,65,65,65,66,66,66,66,67,67,67,67,68,68,68,68,69,69,69,69,70,70,70 +,70,71,71,71,71,72,72,72,72,73,73,73,73,74,74,74,74,75,75,75,75,76,76,76,76,77,77, +77,77,78,78,78,78,79,79,79,79,80,80,80,80,81,81,81,81,82,82,82,82,83,83,83,83, +84,84,84,84,85,85,85,85,86,86,86,86,87,87,87,87,88,88,88,88,89,89,89,89,90,90,90 +,90,91,91,91,91,92,92,92,92,93,93,93,93,94,94,94,94,95,95,95,95, +96,96,96,96,97,97,97,97,98,98,98,98,99,99,99,99,100,100,100,100,101,101,101,101, +102,102,102,102,103,103,103,103,104,104,104,104,105,105,105,105,106,106,106,106, +107,107,107,107,108,108,108,108,109,109,109,109,110,110,110,110,111,111,111,111, +112,112,112,112,113,113,113,113,114,114,114,114,115,115,115,115,116,116,116,116, +117,117,117,117,118,118,118,118,119,119,119,119,120,120,120,120,121,121,121,121, +122,122,122,122,123,123,123,123,124,124,124,124,125,125,125,125,126,126,126,126, +127,127,127,127, +128,128,128,128,129,129,129,129,130,130,130,130,131,131,131,131,132,132,132,132, +133,133,133,133,134,134,134,134,135,135,135,135,136,136,136,136,137,137,137,137, +138,138,138,138,139,139,139,139,140,140,140,140,141,141,141,141,142,142,142,142, +143,143,143,143,144,144,144,144,145,145,145,145,146,146,146,146,147,147,147,147, +148,148,148,148,149,149,149,149,150,150,150,150,151,151,151,151,152,152,152,152, +153,153,153,153,154,154,154,154,155,155,155,155,156,156,156,156,157,157,157,157, +158,158,158,158,159,159,159,159, +160,160,160,160,161,161,161,161,162,162,162,162,163,163,163,163,164,164,164,164, +165,165,165,165,166,166,166,166,167,167,167,167,168,168,168,168,169,169,169,169, +170,170,170,170,171,171,171,171,172,172,172,172,173,173,173,173,174,174,174,174, +175,175,175,175,176,176,176,176,177,177,177,177,178,178,178,178,179,179,179,179, +180,180,180,180,181,181,181,181,182,182,182,182,183,183,183,183,184,184,184,184, +185,185,185,185,186,186,186,186,187,187,187,187,188,188,188,188,189,189,189,189, +190,190,190,190,191,191,191,191, +192,192,192,192,193,193,193,193,194,194,194,194,195,195,195,195,196,196,196,196, +197,197,197,197,198,198,198,198,199,199,199,199,200,200,200,200,201,201,201,201, +202,202,202,202,203,203,203,203,204,204,204,204,205,205,205,205,206,206,206,206, +207,207,207,207,208,208,208,208,209,209,209,209,210,210,210,210,211,211,211,211, +212,212,212,212,213,213,213,213,214,214,214,214,215,215,215,215,216,216,216,216, +217,217,217,217,218,218,218,218,219,219,219,219,220,220,220,220,221,221,221,221, +222,222,222,222,223,223,223,223, +224,224,224,224,225,225,225,225,226,226,226,226,227,227,227,227,228,228,228,228, +229,229,229,229,230,230,230,230,231,231,231,231,232,232,232,232,233,233,233,233, +234,234,234,234,235,235,235,235,236,236,236,236,237,237,237,237,238,238,238,238, +239,239,239,239,240,240,240,240,241,241,241,241,242,242,242,242,243,243,243,243, +244,244,244,244,245,245,245,245,246,246,246,246,247,247,247,247,248,248,248,248, +249,249,249,249,250,250,250,250,251,251,251,251,252,252,252,252,253,253,253,253, +254,254,254,254,255,255,255,255, +}; + +static UNUSED uint8_t t_rlps_shift[512]= { +0,8,7,7,6,6,6,6,5,5,5,5,5,5,5,5,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,3,3,3,3,3,3,3,3,3, +3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, +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, +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, +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, +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,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, +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,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, +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,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, +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,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 +}; + +/* init the contexts given i_slice_type, the quantif and the model */ +void cavs_cabac_context_init( cavs_decoder *h/*, cavs_cabac_t *cb, int i_slice_type, int i_qp, int i_model*/ ); +int cavs_cabac_start_decoding(cavs_cabac_t * cb, cavs_bitstream *s); +int cavs_cabac_get_skip(cavs_decoder *p); +int cavs_cabac_get_mb_type_p(cavs_decoder *p); +int cavs_cabac_get_mb_type_b(cavs_decoder *p); +int cavs_cabac_get_intra_luma_pred_mode(cavs_decoder *p); +int cavs_cabac_get_intra_chroma_pred_mode(cavs_decoder *p); +int cavs_cabac_get_cbp(cavs_decoder *p); +int cavs_cabac_get_dqp(cavs_decoder *p); +int cavs_cabac_get_mvd(cavs_decoder *p, int i_list, int mvd_scan_idx, int xy_idx); +int cavs_cabac_get_ref_p(cavs_decoder *p, int ref_scan_idx); +int cavs_cabac_get_ref_b(cavs_decoder *p, int i_list, int ref_scan_idx); +int cavs_cabac_get_mb_part_type(cavs_decoder *p); +int cavs_cabac_get_coeffs(cavs_decoder *p, const cavs_vlc *p_vlc_table, int i_escape_order, int b_chroma); +int cavs_biari_decode_stuffing_bit(cavs_cabac_t *cb); +int cavs_cabac_get_mb_weighting_prediction(cavs_decoder *p); + +////////////////////////////////////////////////////////////////// + +typedef struct +{ + uint8_t *p_ori; + unsigned char buf[SVA_STREAM_BUF_SIZE]; + unsigned int uClearBits; //不含填充位的位缓冲,32位,初始值是0xFFFFFFFF + unsigned int uPre3Bytes; //含填充位的位缓冲,32位,初始值是0x00000000 + int iBytePosition; //当前字节位置 + int iBufBytesNum; //最近一次读入缓冲区的字节数 + int iClearBitsNum; //不含填充位的位的个数 + int iStuffBitsNum; //已剔除的填充位的个数,遇到开始码时置0 + int iBitsCount; //码流总位数 + int demulate_enable; + + int64_t min_length; +}bitstream_backup; + +typedef struct +{ + uint32_t i_startcode; + uint8_t *p_start; /* exclude startcode */ + int i_len; + +}cavs_slice_t; + +#define CAVS_MAX_SLICE_SIZE 64 /* decoder support max size of slice in one frame */ + +typedef struct +{ + unsigned char m_buf[MAX_CODED_FRAME_SIZE]; + + uint8_t *p_start; //当前帧的输入流起始地址 + uint8_t *p_cur; + uint8_t *p_end; + + int i_len; //帧包总字节数 + int frame_num; //当前帧的解码序号 + int slice_num; //当前帧的slice数 + int max_frame_size; + + uint32_t i_startcode_type; /* frametype */ + + bitstream_backup bits; + + cavs_slice_t slice[CAVS_MAX_SLICE_SIZE]; + + int i_mb_end[2]; /*0:top 1:bot mb row end of top or bot field */ + int b_bottom; /* 0 : top 1: bot */ +} frame_pack; + +/* frame */ +uint32_t cavs_frame_pack( InputStream *p, frame_pack *frame ); + +/* decode packed frame */ +int decode_one_frame(void *p_decoder,frame_pack *, cavs_param * ); + +/* top field */ +uint32_t cavs_topfield_pack( InputStream *p, frame_pack *field ); +int decode_top_field(void *p_decoder,frame_pack *, cavs_param * ); + +/* bot field */ +uint32_t cavs_botfield_pack( InputStream *p, frame_pack *field ); +int decode_bot_field(void *p_decoder,frame_pack *, cavs_param * ); + +/* multi-threads */ +/* synchronized frame list */ +typedef struct +{ + cavs_decoder **list; + int i_max_size; + int i_size; + cavs_pthread_mutex_t mutex; + cavs_pthread_cond_t cv_fill; /* event signaling that the list became fuller */ + cavs_pthread_cond_t cv_empty; /* event signaling that the list became emptier */ +} cavs_synch_frame_list_t; + +cavs_decoder * cavs_frame_get (cavs_decoder ** list); + +int cavs_synch_frame_list_init( cavs_synch_frame_list_t *slist, int size ); +void cavs_synch_frame_list_delete( cavs_synch_frame_list_t *slist ); +void cavs_synch_frame_list_push( cavs_synch_frame_list_t *slist, cavs_decoder *frame ); +cavs_decoder *cavs_synch_frame_list_pop( cavs_synch_frame_list_t *slist ); +void cavs_frame_cond_broadcast( cavs_image *frame, int i_lines_completed, int b_bot_field ); +void cavs_frame_cond_wait( cavs_image *frame, int i_lines_completed, int b_bot_field ); + + +#define CHECKED_MALLOC( var, size )\ + do {\ + var = cavs_malloc( size );\ + if( !var )\ + goto fail;\ + } while( 0 ) + +#define CHECKED_MALLOCZERO( var, size )\ + do {\ + CHECKED_MALLOC( var, size );\ + memset( var, 0, size );\ + } while( 0 ) + +////////////////////////////////////////////////////////////////////////////////////// +#define B_MB_WEIGHTING 1 /* mb weighting prediction */ + +#define B4_SIZE 4 +extern uint8_t crop_table[]; +static const cavs_vector MV_NOT_AVAIL = {0,0,1,NOT_AVAIL}; +static const cavs_vector MV_REF_DIR = {0,0,1,REF_DIR}; +static const cavs_vector MV_INTRA = {0,0,1,REF_INTRA}; +#define EOB 0,0,0 + +typedef int (*cavs_bitstream_get_t) (cavs_decoder *p); +typedef int (*cavs_bitstream_get_coeffs_t) (cavs_decoder *p, const cavs_vlc *p_vlc_table, int i_escape_order, int b_chroma); +typedef int (*cavs_bitstream_get_mvd_t)(cavs_decoder *p, int i_list, int mvd_scan_idx, int xy_idx); +typedef int (*cavs_bitstream_get_ref_p_t)(cavs_decoder *p, int ref_scan_idx); +typedef int (*cavs_bitstream_get_ref_b_t)(cavs_decoder *p, int i_list, int ref_scan_idx); + +enum syntax_element +{ + SYNTAX_SKIP_RUN, + SYNTAX_MBTYPE_P, + SYNTAX_MBTYPE_B, + SYNTAX_INTRA_LUMA_PRED_MODE, + SYNTAX_INTRA_CHROMA_PRED_MODE, + SYNTAX_INTRA_CBP, + SYNTAX_INTER_CBP, + SYNTAX_DQP, + SYNTAX_REF_P, + SYNTAX_REF_B, + SYNTAX_MB_PART_TYPE +}; + +enum macroblock_position_e +{ + MB_LEFT = 0x01, + MB_TOP = 0x02, + MB_TOPRIGHT = 0x04, + MB_TOPLEFT = 0x08, + MB_DOWNLEFT = 0x10, + + //MB_PRIVATE = 0x10, + ALL_NEIGHBORS = 0x1f, +}; + +#if B_MB_WEIGHTING +typedef void (*cavs_avg_func)( uint8_t *dst, int i_dst, uint8_t *src, int i_src ); +#endif + +typedef void (*cavs_luma_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride); +typedef void (*cavs_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y); + +typedef void (*cavs_intra_pred_luma)(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top, uint8_t *p_left); +typedef void (*cavs_intra_pred_chroma)(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left); +typedef void (*cavs_filter_lv)(cavs_decoder *p,uint8_t *d, int stride, /*int alpha, int beta, int tc,*/int i_qp, int bs1, int bs2) ; +typedef void (*cavs_filter_lh)(cavs_decoder *p,uint8_t *d, int stride, /*int alpha, int beta, int tc,*/int i_qp, int bs1, int bs2) ; +typedef void (*cavs_filter_cv)(cavs_decoder *p,uint8_t *d, int stride, /*int alpha, int beta, int tc,*/int i_qp, int bs1, int bs2) ; +typedef void (*cavs_filter_ch)(cavs_decoder *p,uint8_t *d, int stride, /*int alpha, int beta, int tc,*/int i_qp, int bs1, int bs2) ; + +struct tagcavs_decoder +{ + cavs_bitstream s; + cavs_video_sequence_header vsh; + cavs_video_sequence_header old; + cavs_picture_header ph; + cavs_slice_header sh; + uint8_t user_data; + cavs_sequence_display_extension sde; + cavs_copyright_extension ce; + cavs_camera_parameters_extension cpe; + cavs_picture_display_extension pde; + uint8_t b_extention_flag; + + uint8_t i_video_edit_code_flag; + + uint32_t i_frame_num; + + uint8_t b_get_video_sequence_header; + uint8_t b_get_i_picture_header; + uint8_t b_have_pred; + uint32_t i_mb_width, i_mb_height, i_mb_num, i_mb_num_half; + uint32_t i_mb_x, i_mb_y, i_mb_index, i_mb_offset; + uint32_t b_complete; /* finish decoding one frame */ + uint32_t i_mb_flags; + uint32_t b_first_line; + uint32_t i_slice_mb_end; + uint32_t i_slice_mb_end_fld[2]; + + uint32_t i_neighbour4[16]; + + cavs_image image[3]; /* alloc 3 frame memory for yuv */ + cavs_image ref[4]; /* reference field or frame, not alloc memory */ + + cavs_image *p_save[3];/* backup point , not alloc memory */ + cavs_image cur; /* current decode frame */ + + /* add for aec moudle */ + cavs_image image_aec[3]; /* alloc 3 frame memory for yuv */ + cavs_image ref_aec[4]; /* reference field or frame, not alloc memory */ + cavs_image *p_save_aec[3];/* backup point , not alloc memory */ + cavs_image cur_aec; /* current decode frame */ + + cavs_image *last_delayed_pframe; + int i_luma_offset[4];//四个块相对于X0的地址偏移 + + int b_bottom; + + int copy_flag3; + + ///以下数据结构 部分来源于ffmpeg + //这些都是计算运动矢量的系数,用于加快速度 + int i_sym_factor; ///<用于B块的对称模式 + int i_direct_den[4]; ///< 用于B块的直接模式 + int i_scale_den[4]; ///< 用于临近块的预测运动矢量的计算 + int i_ref_distance[4]; /* four ref-field at most */ + + uint8_t *p_y, *p_cb, *p_cr, *p_edge; + +#if B_MB_WEIGHTING + uint8_t *p_back_y, *p_back_cb, *p_back_cr; +#endif + + int i_mb_type; //当前宏块的类型 + int i_cbp_code; + int i_left_qp; + uint8_t *p_top_qp;//用于宏块的环路滤波 + int i_qp;//当前使用的qp, + int b_fixed_qp;//固定qp标志,可以在slice中改变 + int i_cbp;//当前宏块的cbp + int b_low_delay; + +#if B_MB_WEIGHTING + int weighting_prediction; /* MB weighting prediction flag */ + uint8_t *mb_line_buffer[3]; /* temp buffer for backward mc */ +#endif + + /** + 0: D3 B2 B3 C2 + 4: A1 X0 X1 - + 8: A3 X2 X3 - */ + //24个保存前向后向各块运动矢量 + cavs_vector mv[24]; /*mv context of current block*/ + cavs_vector *p_top_mv[2]; + cavs_vector *p_col_mv; /*mv buffer of colocated ref frame(for direct mode)*/ + + /** luma pred mode cache + 0: D B1 B2 B3 B4 + 5: A1 X0 X1 X2 X3 + 10: A2 X4 X5 X6 X7 + 15: A3 X8 X9 X10 X11 + 20: A4 X12 X13 X14 X15 + */ + int i_intra_pred_mode_y[25]; // + int *p_top_intra_pred_mode_y;//保存上面一行的亮度预测模式 + int i_pred_mode_chroma; //当前色度宏块的预测模式 + + //for CABAC + int8_t i_mb_type_left; //左边宏块的类型 + int8_t *p_mb_type_top; //上边行宏块的类型 + int8_t i_chroma_pred_mode_left; + int8_t *p_chroma_pred_mode_top; + int8_t i_cbp_left; + int8_t *p_cbp_top; + int i_last_dqp; + /** mvd cache + 0: A1 X0 X1 + 3: A3 X2 X3 */ + int16_t p_mvd[2][6][2]; //[FWD/BWD][pos][x/y] + int8_t (*p_ref_top)[2][2]; //[FWD/BWD][b8_pos] + /** ref cache + 0: D3 B2 B3 + 3: A1 X0 X1 + 6: A3 X2 X3 */ + int8_t p_ref[2][9]; //[FWD/BWD][pos] + + //这里宏块内不同的块对应的边缘不一样甚至用到刚解码的数据,或者由于有些右边块并未解码所以限制了一些预测模式的是使用 + //所有的这些都笔削在deblock前保存下来 + //用于保存帧内预测的当前宏块临近的上面行的y样本标准中c[0~16] + uint8_t *p_top_border_y,*p_top_border_cb,*p_top_border_cr; + //用于保存帧内预测的当前宏块临近的左边行的y样本 + uint8_t i_left_border_y[26],i_left_border_cb[10],i_left_border_cr[10]; + //用于中间边界样本的保存,用于X1,X3的预测 + uint8_t i_internal_border_y[26]; + uint8_t i_topleft_border_y,i_topleft_border_cb,i_topleft_border_cr;//保存标准中的c[0]或r[0] + uint8_t *p_col_type_base; + //用于保存宏块的类型,事实只有B_SKIP和B_Direct会用到,所以只需要保存P帧的就可以了 + uint8_t *p_col_type;//当前宏块类型的偏移地址 + //保存残差数据 + DCTELEM *p_block; + int level_buf[64]; + int run_buf[64]; + + int protect_array[64]; /* FIXIT */ + + /* run and level coeffs */ + int (*level_buf_tab)[6][64];/*[block][coeff]*/ + int (*run_buf_tab)[6][64]; + int (*num_buf_tab)[6]; + + /* mb type */ + int *i_mb_type_tab; + + /* mb qp */ + int *i_qp_tab; + + /* cbp */ + int *i_cbp_tab; + + /* mv */ + cavs_vector (*mv_tab)[24]; + + /* luma pred mode */ + int (*i_intra_pred_mode_y_tab)[25]; + + /* chroma pred mode */ + int *i_pred_mode_chroma_tab; + + /* mvd */ + int16_t (*p_mvd_tab)[2][6][2]; + + /* refer index */ + int8_t (*p_ref_tab)[2][9]; + + /* weighting prediction */ +#if B_MB_WEIGHTING + int *weighting_prediction_tab; + + /* keep this for accelerate mode of field */ + uint8_t b_slice_weighting_flag[2]; /*[top/bot]*/ + uint32_t i_luma_scale[2][4]; /*[top/bot][refnum]*/ + int32_t i_luma_shift[2][4]; /*[top/bot][refnum]*/ + uint32_t i_chroma_scale[2][4]; /*[top/bot][refnum]*/ + int32_t i_chroma_shift[2][4]; /*[top/bot][refnum]*/ + uint8_t b_mb_weighting_flag[2]; /*[top/bot]*/ +#endif + + /*2 for 1/4 subpel, 3 for 1/8 subpel...*/ + int i_subpel_precision; + /*4 for 1/4 subpel, 8 for 1/8 subpel...*/ + int i_uint_length; + int vbs_mb_intra_pred_flag ; + int vbs_mb_part_intra_pred_flag[4] ; + int vbs_mb_part_transform_4x4_flag[4]; + int quant_coeff_pred_flag; + int pred_mode_4x4_flag[4]; + int intra_luma_pred_mode_4x4[4]; + int pred_mode_flag; + int i_cbp_4x4[4]; + int i_cbp_part[4]; + + //aec for guangdian profile + cavs_cabac_t cabac; + + struct + { + unsigned int i_neighbour; + unsigned int i_neighbour8[4]; /* neighbours of each 8x8 or 4x4 block that are available */ + }mb; + + int copy_flag1; + + /* MC */ + cavs_luma_mc_func put_cavs_qpel_pixels_tab[2][16]; + cavs_luma_mc_func avg_cavs_qpel_pixels_tab[2][16]; + cavs_chroma_mc_func put_h264_chroma_pixels_tab[3]; + cavs_chroma_mc_func avg_h264_chroma_pixels_tab[3]; + + /* intra predict */ + cavs_intra_pred_luma cavs_intra_luma[8]; + cavs_intra_pred_chroma cavs_intra_chroma[7]; + +#if B_MB_WEIGHTING + /* weighting prediction avg */ + cavs_avg_func cavs_avg_pixels_tab[3]; /* 0 :16x16 1: 8x8 2: 4x4 */ +#endif + + /*deblock*/ + cavs_filter_lv filter_lv; + cavs_filter_lh filter_lh; + cavs_filter_cv filter_cv; + cavs_filter_ch filter_ch; + +#define SYNTAX_NUM 11 + cavs_bitstream_get_t bs_read[SYNTAX_NUM]; + cavs_bitstream_get_coeffs_t bs_read_coeffs; + cavs_bitstream_get_mvd_t bs_read_mvd; + cavs_bitstream_get_ref_p_t bs_read_ref_p; + cavs_bitstream_get_ref_b_t bs_read_ref_b; + + cavs_param param; + + int b_skip_first; + + frame_pack *Frame; /* used for frame pack of multi-slice */ + + InputStream *p_stream; /* locate stream */ + + /* thread */ + int b_thread_flag; + cavs_decoder *thread[CAVS_THREAD_MAX]; + int b_threadpool_flag; + cavs_threadpool_t *threadpool; + + cavs_pthread_mutex_t mutex; + cavs_pthread_cond_t cv; + int i_thread_idx; + int b_thread_active; + cavs_pthread_t id; + + /*add for error detect*/ + int b_error_flag; /* set to 1 when error detected , default 0 */ + + /* add for weighting quant */ + int b_weight_quant_enable; + short UseDefaultScalingMatrixFlag[2]; + short cur_wq_matrix[64]; + short wq_matrix[2][64]; + short wq_param[2][6]; + + int i_frame_decoded; /* add for debug */ + + /* AEC and REC thread */ + int b_accelerate_flag; + cavs_decoder *unused[2]; /* for AEC decode */ + cavs_decoder *unused_backup[2]; /* for handle free */ + cavs_decoder *current[2]; /* for REC recon */ + + int i_mb_y_start; /* backup start value of AEC thread */ + int i_mb_index_start; /* */ + int i_mb_y_start_fld[2]; /* backup start value of AEC thread */ + int i_mb_index_start_fld[2]; /* */ + cavs_decoder *p_m; + frame_pack *fld; + int slice_count; + int field_count; +}; + +static UNUSED int hd; +static UNUSED int hu; +static UNUSED int vr; + +static const unsigned char LEVRUN_INTRA[7][16]= +{ + { 4, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, + { 6, 4, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 6, 4, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 8, 5, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {10, 5, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {12, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {15, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + +static const unsigned char LEVRUN_INTER[7][16]= +{ + { 4, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}, + { 5, 3, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, + { 5, 3, 3, 2, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}, + { 6, 4, 3, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 7, 4, 3, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 9, 5, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {13, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} +}; + +static const char VLC_GC_Order_INTRA[7][2] = //[tableindex][grad/maxlevel] +{ + {1,22}, {0,22}, {1,22}, {1,22}, {0,22}, {1,22}, {0,22} +}; + +static const char VLC_GC_Order_INTER[7][2] = //[tableindex][grad/maxlevel] +{ + {1,22}, {0,22}, {0,22}, {0,22}, {0,22}, {0,22}, {0,22} +}; + +static const uint8_t dequant_shift[64] = + { + 14,14,14,14,14,14,14,14, + 13,13,13,13,13,13,13,13, + 13,12,12,12,12,12,12,12, + 11,11,11,11,11,11,11,11, + 11,10,10,10,10,10,10,10, + 10, 9, 9, 9, 9, 9, 9, 9, + 9, 8, 8, 8, 8, 8, 8, 8, + 7, 7, 7, 7, 7, 7, 7, 7 + }; + + static const uint16_t dequant_mul[64] = + { + 32768,36061,38968,42495,46341,50535,55437,60424, + 32932,35734,38968,42495,46177,50535,55109,59933, + 65535,35734,38968,42577,46341,50617,55027,60097, + 32809,35734,38968,42454,46382,50576,55109,60056, + 65535,35734,38968,42495,46320,50515,55109,60076, + 65535,35744,38968,42495,46341,50535,55099,60087, + 65535,35734,38973,42500,46341,50535,55109,60097, + 32771,35734,38965,42497,46341,50535,55109,60099 + }; + static const uint8_t zigzag_progressive_4x4[16]=//图35 + { + 0, 1,4, 8, + 5, 2, 3, 6, + 9, 12 ,13, 10, + 7, 11, 14, 15, + }; + static const uint8_t zigzag_progressive[64]=//图33 + { + 0, 1, 8, 16, 9, 2, 3, 10, + 17, 24, 32, 25, 18, 11, 4, 5, + 12, 19, 26, 33, 40, 48, 41, 34, + 27, 20, 13, 6, 7, 14, 21, 28, + 35, 42, 49, 56, 57, 50, 43, 36, + 29, 22, 15, 23, 30, 37, 44, 51, + 58, 59, 52, 45, 38, 31, 39, 46, + 53, 60, 61, 54, 47, 55, 62, 63 + }; + + static const uint8_t zigzag_field[64]=//图34 + { + 0, 8, 16, 1, 24, 32, 9, 17, + 40, 48, 25, 2, 10, 56, 33, 18, + 3, 41, 49, 26, 11, 19, 4, 57, + 34, 12, 42, 27, 20, 50, 35, 28, + 5, 13, 58, 43, 36, 21, 6, 29, + 51, 44, 14, 22, 37, 59, 52, 30, + 45, 60, 38, 53, 46, 61, 54, 7, + 62, 15, 23, 31, 39, 47, 55, 63 + }; + +static const uint8_t chroma_qp[64] = +{ + 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, + 32,33,34,35,36,37,38,39,40,41,42,42,43,43,44,44, + 45,45,46,46,47,47,48,48,48,49,49,49,50,50,50,51 +}; +static const char intra_2dvlc_4x4[7][16][16]= +{ + { + { 0, 8, 16, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 2, 18, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 4, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 6, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 12, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 10, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 22, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 28, -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, -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} + }, + { + { 0, 1, 5, 9, 15, 27, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 3, 13, 23, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 7, 19, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 11, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 17, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 29, -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, -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, -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} + }, + { + //AVSM-1498 + { 0/*2*/, 1 /*0*/, 3, 9, 15, 23, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 5, 11, 19, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 7, 17, 27, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 13, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 21, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 29, -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, -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, -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} + }, + { + { 0, 1, 3, 5, 9, 13, 23, 25, 31, -1, -1, -1, -1, -1, -1, -1}, + { -1, 7, 11, 17, 27, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 15, 19, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 21, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 29, -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, -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, -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} + }, + { + { 0, 1, 3, 5, 7, 11, 15, 17, 23, 31, 35, -1, -1, -1, -1, -1}, + { -1, 9, 13, 19, 27, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 21, 25, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 29, -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, -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, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1} + }, + { + { 0, 1, 3, 5, 7, 9, 11, 13, 19, 21, 25, 31, 35, -1, -1, -1}, + { -1, 15, 17, 23, 29, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 27, 37, -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, -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, -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, -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} + }, + { + { 0, 3, 1, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 31, 29, 33}, + { -1, 25, 27, 35, 37, -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, -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, -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, -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} + } +}; +static const char inter_2dvlc_4x4[7][16][14] = +{ + { + { 0, 10, 22, 36, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 2, 20, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 4, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 6, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 8, 34, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 12, 30, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 14, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 16, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { 28, -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, -1, -1, -1, -1, -1}, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1} + }, + { + { 0, 1, 7, 15, 27, 37, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 3, 17, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 5, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 9, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 11, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 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, -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} + }, + { + { 0, 1, 9, 17, 23, 37, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 3, 15, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 5, 19, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 7, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 11, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 13, 35, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 25, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 29, -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, -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} + }, + { + { 0, 1, 7, 11, 21, 27, 35, -1, -1, -1, -1, -1, -1, -1}, + { -1, 3, 13, 25, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 5, 17, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 9, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 15, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 23, 33, -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, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1} + }, + { + { 0, 1, 3, 7, 13, 21, 27, 35, -1, -1, -1, -1, -1, -1}, + { -1, 5, 11, 19, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 9, 17, 33, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 15, 29, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 23, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 25, -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, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1} + }, + { + { 0, 1, 3, 5, 9, 11, 17, 21, 29, 33, -1, -1, -1, -1}, + { -1, 7, 13, 19, 25, 35, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 15, 23, 31, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 27, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 37, -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, -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, -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} + }, + { + { 0, 1, 3, 5, 7, 9, 11, 13, 17, 21, 23, 27, 33, 37}, + { -1, 15, 19, 25, 29, 35, -1, -1, -1, -1, -1, -1, -1, -1}, + { -1, 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, -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, -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, -1, -1} + } +}; +static const cavs_vlc intra_2dvlc[7] = +{ + { + { //level / run / table_inc + { 1, 1, 1},{ -1, 1, 1},{ 1, 2, 1},{ -1, 2, 1},{ 1, 3, 1},{ -1, 3, 1}, + { 1, 4, 1},{ -1, 4, 1},{ 1, 5, 1},{ -1, 5, 1},{ 1, 6, 1},{ -1, 6, 1}, + { 1, 7, 1},{ -1, 7, 1},{ 1, 8, 1},{ -1, 8, 1},{ 1, 9, 1},{ -1, 9, 1}, + { 1,10, 1},{ -1,10, 1},{ 1,11, 1},{ -1,11, 1},{ 2, 1, 2},{ -2, 1, 2}, + { 1,12, 1},{ -1,12, 1},{ 1,13, 1},{ -1,13, 1},{ 1,14, 1},{ -1,14, 1}, + { 1,15, 1},{ -1,15, 1},{ 2, 2, 2},{ -2, 2, 2},{ 1,16, 1},{ -1,16, 1}, + { 1,17, 1},{ -1,17, 1},{ 3, 1, 3},{ -3, 1, 3},{ 1,18, 1},{ -1,18, 1}, + { 1,19, 1},{ -1,19, 1},{ 2, 3, 2},{ -2, 3, 2},{ 1,20, 1},{ -1,20, 1}, + { 1,21, 1},{ -1,21, 1},{ 2, 4, 2},{ -2, 4, 2},{ 1,22, 1},{ -1,22, 1}, + { 2, 5, 2},{ -2, 5, 2},{ 1,23, 1},{ -1,23, 1},{ EOB } + }, + //level_add + { 0, 4, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2,-1,-1,-1}, + 2, //golomb_order + 0, //inc_limit 和8.3.1对应 + 23, //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 2, 1, 1},{ -2, 1, 1}, + { 1, 3, 0},{ -1, 3, 0},{ EOB },{ 1, 4, 0},{ -1, 4, 0},{ 1, 5, 0}, + { -1, 5, 0},{ 1, 6, 0},{ -1, 6, 0},{ 3, 1, 2},{ -3, 1, 2},{ 2, 2, 1}, + { -2, 2, 1},{ 1, 7, 0},{ -1, 7, 0},{ 1, 8, 0},{ -1, 8, 0},{ 1, 9, 0}, + { -1, 9, 0},{ 2, 3, 1},{ -2, 3, 1},{ 4, 1, 2},{ -4, 1, 2},{ 1,10, 0}, + { -1,10, 0},{ 1,11, 0},{ -1,11, 0},{ 2, 4, 1},{ -2, 4, 1},{ 3, 2, 2}, + { -3, 2, 2},{ 1,12, 0},{ -1,12, 0},{ 2, 5, 1},{ -2, 5, 1},{ 5, 1, 3}, + { -5, 1, 3},{ 1,13, 0},{ -1,13, 0},{ 2, 6, 1},{ -2, 6, 1},{ 1,14, 0}, + { -1,14, 0},{ 2, 7, 1},{ -2, 7, 1},{ 2, 8, 1},{ -2, 8, 1},{ 3, 3, 2}, + { -3, 3, 2},{ 6, 1, 3},{ -6, 1, 3},{ 1,15, 0},{ -1,15, 0} + }, + //level_add + { 0, 7, 4, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 1, //inc_limit + 15, //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 1, 2, 0},{ -1, 2, 0}, + { 3, 1, 1},{ -3, 1, 1},{ EOB },{ 1, 3, 0},{ -1, 3, 0},{ 2, 2, 0}, + { -2, 2, 0},{ 4, 1, 1},{ -4, 1, 1},{ 1, 4, 0},{ -1, 4, 0},{ 5, 1, 2}, + { -5, 1, 2},{ 1, 5, 0},{ -1, 5, 0},{ 3, 2, 1},{ -3, 2, 1},{ 2, 3, 0}, + { -2, 3, 0},{ 1, 6, 0},{ -1, 6, 0},{ 6, 1, 2},{ -6, 1, 2},{ 2, 4, 0}, + { -2, 4, 0},{ 1, 7, 0},{ -1, 7, 0},{ 4, 2, 1},{ -4, 2, 1},{ 7, 1, 2}, + { -7, 1, 2},{ 3, 3, 1},{ -3, 3, 1},{ 2, 5, 0},{ -2, 5, 0},{ 1, 8, 0}, + { -1, 8, 0},{ 2, 6, 0},{ -2, 6, 0},{ 8, 1, 3},{ -8, 1, 3},{ 1, 9, 0}, + { -1, 9, 0},{ 5, 2, 2},{ -5, 2, 2},{ 3, 4, 1},{ -3, 4, 1},{ 2, 7, 0}, + { -2, 7, 0},{ 9, 1, 3},{ -9, 1, 3},{ 1,10, 0},{ -1,10, 0} + }, + //level_add + { 0,10, 6, 4, 4, 3, 3, 3, 2, 2, 2,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 2, //inc_limit + 10, //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},{ -3, 1, 0}, + { 1, 2, 0},{ -1, 2, 0},{ EOB },{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 1}, + { -5, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 1, 3, 0},{ -1, 3, 0},{ 6, 1, 1}, + { -6, 1, 1},{ 3, 2, 0},{ -3, 2, 0},{ 7, 1, 1},{ -7, 1, 1},{ 1, 4, 0}, + { -1, 4, 0},{ 8, 1, 2},{ -8, 1, 2},{ 2, 3, 0},{ -2, 3, 0},{ 4, 2, 0}, + { -4, 2, 0},{ 1, 5, 0},{ -1, 5, 0},{ 9, 1, 2},{ -9, 1, 2},{ 5, 2, 1}, + { -5, 2, 1},{ 2, 4, 0},{ -2, 4, 0},{ 10, 1, 2},{-10, 1, 2},{ 3, 3, 0}, + { -3, 3, 0},{ 1, 6, 0},{ -1, 6, 0},{ 11, 1, 3},{-11, 1, 3},{ 6, 2, 1}, + { -6, 2, 1},{ 1, 7, 0},{ -1, 7, 0},{ 2, 5, 0},{ -2, 5, 0},{ 3, 4, 0}, + { -3, 4, 0},{ 12, 1, 3},{-12, 1, 3},{ 4, 3, 0},{ -4, 3, 0} + }, + //level_add + { 0,13, 7, 5, 4, 3, 2, 2,-1,-1,-1 -1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 4, //inc_limit + 7, //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0},{ -3, 1, 0}, + { EOB },{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0}, + { -6, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 1}, + { -8, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 9, 1, 1},{ -9, 1, 1},{ 10, 1, 1}, + {-10, 1, 1},{ 1, 3, 0},{ -1, 3, 0},{ 3, 2, 0},{ -3, 2, 0},{ 11, 1, 2}, + {-11, 1, 2},{ 4, 2, 0},{ -4, 2, 0},{ 12, 1, 2},{-12, 1, 2},{ 13, 1, 2}, + {-13, 1, 2},{ 5, 2, 0},{ -5, 2, 0},{ 1, 4, 0},{ -1, 4, 0},{ 2, 3, 0}, + { -2, 3, 0},{ 14, 1, 2},{-14, 1, 2},{ 6, 2, 0},{ -6, 2, 0},{ 15, 1, 2}, + {-15, 1, 2},{ 16, 1, 2},{-16, 1, 2},{ 3, 3, 0},{ -3, 3, 0},{ 1, 5, 0}, + { -1, 5, 0},{ 7, 2, 0},{ -7, 2, 0},{ 17, 1, 2},{-17, 1, 2} + }, + //level_add + { 0,18, 8, 4, 2, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 7, //inc_limit + 5, //max_run + }, + { + { //level / run + { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0}, + { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0}, + { -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 0},{ -8, 1, 0},{ 9, 1, 0}, + { -9, 1, 0},{ 10, 1, 0},{-10, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 11, 1, 1}, + {-11, 1, 1},{ 12, 1, 1},{-12, 1, 1},{ 13, 1, 1},{-13, 1, 1},{ 2, 2, 0}, + { -2, 2, 0},{ 14, 1, 1},{-14, 1, 1},{ 15, 1, 1},{-15, 1, 1},{ 3, 2, 0}, + { -3, 2, 0},{ 16, 1, 1},{-16, 1, 1},{ 1, 3, 0},{ -1, 3, 0},{ 17, 1, 1}, + {-17, 1, 1},{ 4, 2, 0},{ -4, 2, 0},{ 18, 1, 1},{-18, 1, 1},{ 5, 2, 0}, + { -5, 2, 0},{ 19, 1, 1},{-19, 1, 1},{ 20, 1, 1},{-20, 1, 1},{ 6, 2, 0}, + { -6, 2, 0},{ 21, 1, 1},{-21, 1, 1},{ 2, 3, 0},{ -2, 3, 0} + }, + //level_add + { 0,22, 7, 3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 10, //inc_limit + 3, //max_run + }, + { + { //level / run + { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0}, + { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0}, + { -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 0},{ -8, 1, 0},{ 9, 1, 0}, + { -9, 1, 0},{ 10, 1, 0},{-10, 1, 0},{ 11, 1, 0},{-11, 1, 0},{ 12, 1, 0}, + {-12, 1, 0},{ 13, 1, 0},{-13, 1, 0},{ 14, 1, 0},{-14, 1, 0},{ 15, 1, 0}, + {-15, 1, 0},{ 16, 1, 0},{-16, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 17, 1, 0}, + {-17, 1, 0},{ 18, 1, 0},{-18, 1, 0},{ 19, 1, 0},{-19, 1, 0},{ 20, 1, 0}, + {-20, 1, 0},{ 21, 1, 0},{-21, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 22, 1, 0}, + {-22, 1, 0},{ 23, 1, 0},{-23, 1, 0},{ 24, 1, 0},{-24, 1, 0},{ 25, 1, 0}, + {-25, 1, 0},{ 3, 2, 0},{ -3, 2, 0},{ 26, 1, 0},{-26, 1, 0} + }, + //level_add + { 0,27, 4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + INT_MAX, //inc_limit + 2, //max_run + } +}; + +static const cavs_vlc inter_2dvlc[7] = +{ + { + { //level / run + { 1, 1, 1},{ -1, 1, 1},{ 1, 2, 1},{ -1, 2, 1},{ 1, 3, 1},{ -1, 3, 1}, + { 1, 4, 1},{ -1, 4, 1},{ 1, 5, 1},{ -1, 5, 1},{ 1, 6, 1},{ -1, 6, 1}, + { 1, 7, 1},{ -1, 7, 1},{ 1, 8, 1},{ -1, 8, 1},{ 1, 9, 1},{ -1, 9, 1}, + { 1,10, 1},{ -1,10, 1},{ 1,11, 1},{ -1,11, 1},{ 1,12, 1},{ -1,12, 1}, + { 1,13, 1},{ -1,13, 1},{ 2, 1, 2},{ -2, 1, 2},{ 1,14, 1},{ -1,14, 1}, + { 1,15, 1},{ -1,15, 1},{ 1,16, 1},{ -1,16, 1},{ 1,17, 1},{ -1,17, 1}, + { 1,18, 1},{ -1,18, 1},{ 1,19, 1},{ -1,19, 1},{ 3, 1, 3},{ -3, 1, 3}, + { 1,20, 1},{ -1,20, 1},{ 1,21, 1},{ -1,21, 1},{ 2, 2, 2},{ -2, 2, 2}, + { 1,22, 1},{ -1,22, 1},{ 1,23, 1},{ -1,23, 1},{ 1,24, 1},{ -1,24, 1}, + { 1,25, 1},{ -1,25, 1},{ 1,26, 1},{ -1,26, 1},{ EOB } + }, + //level_add + { 0, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, + 3, //golomb_order + 0, //inc_limit + 26 //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 1, 2, 0},{ -1, 2, 0},{ 1, 3, 0}, + { -1, 3, 0},{ 1, 4, 0},{ -1, 4, 0},{ 1, 5, 0},{ -1, 5, 0},{ 1, 6, 0}, + { -1, 6, 0},{ 2, 1, 1},{ -2, 1, 1},{ 1, 7, 0},{ -1, 7, 0},{ 1, 8, 0}, + { -1, 8, 0},{ 1, 9, 0},{ -1, 9, 0},{ 1,10, 0},{ -1,10, 0},{ 2, 2, 1}, + { -2, 2, 1},{ 1,11, 0},{ -1,11, 0},{ 1,12, 0},{ -1,12, 0},{ 3, 1, 2}, + { -3, 1, 2},{ 1,13, 0},{ -1,13, 0},{ 1,14, 0},{ -1,14, 0},{ 2, 3, 1}, + { -2, 3, 1},{ 1,15, 0},{ -1,15, 0},{ 2, 4, 1},{ -2, 4, 1},{ 1,16, 0}, + { -1,16, 0},{ 2, 5, 1},{ -2, 5, 1},{ 1,17, 0},{ -1,17, 0},{ 4, 1, 3}, + { -4, 1, 3},{ 2, 6, 1},{ -2, 6, 1},{ 1,18, 0},{ -1,18, 0},{ 1,19, 0}, + { -1,19, 0},{ 2, 7, 1},{ -2, 7, 1},{ 3, 2, 2},{ -3, 2, 2} + }, + //level_add + { 0, 5, 4, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 1, //inc_limit + 19 //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 1, 2, 0},{ -1, 2, 0},{ 2, 1, 0}, + { -2, 1, 0},{ 1, 3, 0},{ -1, 3, 0},{ 1, 4, 0},{ -1, 4, 0},{ 3, 1, 1}, + { -3, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 1, 5, 0},{ -1, 5, 0},{ 1, 6, 0}, + { -1, 6, 0},{ 1, 7, 0},{ -1, 7, 0},{ 2, 3, 0},{ -2, 3, 0},{ 4, 1, 2}, + { -4, 1, 2},{ 1, 8, 0},{ -1, 8, 0},{ 3, 2, 1},{ -3, 2, 1},{ 2, 4, 0}, + { -2, 4, 0},{ 1, 9, 0},{ -1, 9, 0},{ 1,10, 0},{ -1,10, 0},{ 5, 1, 2}, + { -5, 1, 2},{ 2, 5, 0},{ -2, 5, 0},{ 1,11, 0},{ -1,11, 0},{ 2, 6, 0}, + { -2, 6, 0},{ 1,12, 0},{ -1,12, 0},{ 3, 3, 1},{ -3, 3, 1},{ 6, 1, 2}, + { -6, 1, 2},{ 4, 2, 2},{ -4, 2, 2},{ 1,13, 0},{ -1,13, 0},{ 2, 7, 0}, + { -2, 7, 0},{ 3, 4, 1},{ -3, 4, 1},{ 1,14, 0},{ -1,14, 0} + }, + //level_add + { 0, 7, 5, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 2, //inc_limit + 14 //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 2, 1, 0},{ -2, 1, 0},{ 1, 2, 0}, + { -1, 2, 0},{ 3, 1, 0},{ -3, 1, 0},{ 1, 3, 0},{ -1, 3, 0},{ 2, 2, 0}, + { -2, 2, 0},{ 4, 1, 1},{ -4, 1, 1},{ 1, 4, 0},{ -1, 4, 0},{ 5, 1, 1}, + { -5, 1, 1},{ 1, 5, 0},{ -1, 5, 0},{ 3, 2, 0},{ -3, 2, 0},{ 2, 3, 0}, + { -2, 3, 0},{ 1, 6, 0},{ -1, 6, 0},{ 6, 1, 1},{ -6, 1, 1},{ 2, 4, 0}, + { -2, 4, 0},{ 1, 7, 0},{ -1, 7, 0},{ 4, 2, 1},{ -4, 2, 1},{ 7, 1, 2}, + { -7, 1, 2},{ 3, 3, 0},{ -3, 3, 0},{ 1, 8, 0},{ -1, 8, 0},{ 2, 5, 0}, + { -2, 5, 0},{ 8, 1, 2},{ -8, 1, 2},{ 1, 9, 0},{ -1, 9, 0},{ 3, 4, 0}, + { -3, 4, 0},{ 2, 6, 0},{ -2, 6, 0},{ 5, 2, 1},{ -5, 2, 1},{ 1,10, 0}, + { -1,10, 0},{ 9, 1, 2},{ -9, 1, 2},{ 4, 3, 1},{ -4, 3, 1} + }, + //level_add + { 0,10, 6, 5, 4, 3, 3, 2, 2, 2, 2,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 3, //inc_limit + 10 //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0}, + { -3, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0}, + { -5, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 1, 3, 0},{ -1, 3, 0},{ 6, 1, 0}, + { -6, 1, 0},{ 3, 2, 0},{ -3, 2, 0},{ 7, 1, 1},{ -7, 1, 1},{ 1, 4, 0}, + { -1, 4, 0},{ 8, 1, 1},{ -8, 1, 1},{ 2, 3, 0},{ -2, 3, 0},{ 4, 2, 0}, + { -4, 2, 0},{ 1, 5, 0},{ -1, 5, 0},{ 9, 1, 1},{ -9, 1, 1},{ 5, 2, 0}, + { -5, 2, 0},{ 2, 4, 0},{ -2, 4, 0},{ 1, 6, 0},{ -1, 6, 0},{ 10, 1, 2}, + {-10, 1, 2},{ 3, 3, 0},{ -3, 3, 0},{ 11, 1, 2},{-11, 1, 2},{ 1, 7, 0}, + { -1, 7, 0},{ 6, 2, 0},{ -6, 2, 0},{ 3, 4, 0},{ -3, 4, 0},{ 2, 5, 0}, + { -2, 5, 0},{ 12, 1, 2},{-12, 1, 2},{ 4, 3, 0},{ -4, 3, 0} + }, + //level_add + { 0,13, 7, 5, 4, 3, 2, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 6, //inc_limit + 7 //max_run + }, + { + { //level / run + { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0}, + { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 1, 2, 0}, + { -1, 2, 0},{ 6, 1, 0},{ -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 0}, + { -8, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 9, 1, 0},{ -9, 1, 0},{ 1, 3, 0}, + { -1, 3, 0},{ 10, 1, 1},{-10, 1, 1},{ 3, 2, 0},{ -3, 2, 0},{ 11, 1, 1}, + {-11, 1, 1},{ 4, 2, 0},{ -4, 2, 0},{ 12, 1, 1},{-12, 1, 1},{ 1, 4, 0}, + { -1, 4, 0},{ 2, 3, 0},{ -2, 3, 0},{ 13, 1, 1},{-13, 1, 1},{ 5, 2, 0}, + { -5, 2, 0},{ 14, 1, 1},{-14, 1, 1},{ 6, 2, 0},{ -6, 2, 0},{ 1, 5, 0}, + { -1, 5, 0},{ 15, 1, 1},{-15, 1, 1},{ 3, 3, 0},{ -3, 3, 0},{ 16, 1, 1}, + {-16, 1, 1},{ 2, 4, 0},{ -2, 4, 0},{ 7, 2, 0},{ -7, 2, 0} + }, + //level_add + { 0,17, 8, 4, 3, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + 9, //inc_limit + 5 //max_run + }, + { + { //level / run + { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0}, + { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0}, + { -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 8, 1, 0}, + { -8, 1, 0},{ 9, 1, 0},{ -9, 1, 0},{ 10, 1, 0},{-10, 1, 0},{ 11, 1, 0}, + {-11, 1, 0},{ 12, 1, 0},{-12, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 13, 1, 0}, + {-13, 1, 0},{ 1, 3, 0},{ -1, 3, 0},{ 14, 1, 0},{-14, 1, 0},{ 15, 1, 0}, + {-15, 1, 0},{ 3, 2, 0},{ -3, 2, 0},{ 16, 1, 0},{-16, 1, 0},{ 17, 1, 0}, + {-17, 1, 0},{ 18, 1, 0},{-18, 1, 0},{ 4, 2, 0},{ -4, 2, 0},{ 19, 1, 0}, + {-19, 1, 0},{ 20, 1, 0},{-20, 1, 0},{ 2, 3, 0},{ -2, 3, 0},{ 1, 4, 0}, + { -1, 4, 0},{ 5, 2, 0},{ -5, 2, 0},{ 21, 1, 0},{-21, 1, 0} + }, + //level_add + { 0,22, 6, 3, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 2, //golomb_order + INT_MAX, //inc_limit + 4 //max_run + } +}; + +static const cavs_vlc chroma_2dvlc[5] = +{ + { + { //level / run + { 1, 1, 1},{ -1, 1, 1},{ 1, 2, 1},{ -1, 2, 1},{ 1, 3, 1},{ -1, 3, 1}, + { 1, 4, 1},{ -1, 4, 1},{ 1, 5, 1},{ -1, 5, 1},{ 1, 6, 1},{ -1, 6, 1}, + { 1, 7, 1},{ -1, 7, 1},{ 2, 1, 2},{ -2, 1, 2},{ 1, 8, 1},{ -1, 8, 1}, + { 1, 9, 1},{ -1, 9, 1},{ 1,10, 1},{ -1,10, 1},{ 1,11, 1},{ -1,11, 1}, + { 1,12, 1},{ -1,12, 1},{ 1,13, 1},{ -1,13, 1},{ 1,14, 1},{ -1,14, 1}, + { 1,15, 1},{ -1,15, 1},{ 3, 1, 3},{ -3, 1, 3},{ 1,16, 1},{ -1,16, 1}, + { 1,17, 1},{ -1,17, 1},{ 1,18, 1},{ -1,18, 1},{ 1,19, 1},{ -1,19, 1}, + { 1,20, 1},{ -1,20, 1},{ 1,21, 1},{ -1,21, 1},{ 1,22, 1},{ -1,22, 1}, + { 2, 2, 2},{ -2, 2, 2},{ 1,23, 1},{ -1,23, 1},{ 1,24, 1},{ -1,24, 1}, + { 1,25, 1},{ -1,25, 1},{ 4, 1, 3},{ -4, 1, 3},{ EOB } + }, + //level_add + { 0, 5, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2,-1}, + 2, //golomb_order + 0, //inc_limit + 25 //max_run + }, + { + { //level / run + { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 2, 1, 1}, + { -2, 1, 1},{ 1, 3, 0},{ -1, 3, 0},{ 1, 4, 0},{ -1, 4, 0},{ 1, 5, 0}, + { -1, 5, 0},{ 1, 6, 0},{ -1, 6, 0},{ 3, 1, 2},{ -3, 1, 2},{ 1, 7, 0}, + { -1, 7, 0},{ 1, 8, 0},{ -1, 8, 0},{ 2, 2, 1},{ -2, 2, 1},{ 1, 9, 0}, + { -1, 9, 0},{ 1,10, 0},{ -1,10, 0},{ 1,11, 0},{ -1,11, 0},{ 4, 1, 2}, + { -4, 1, 2},{ 1,12, 0},{ -1,12, 0},{ 1,13, 0},{ -1,13, 0},{ 1,14, 0}, + { -1,14, 0},{ 2, 3, 1},{ -2, 3, 1},{ 1,15, 0},{ -1,15, 0},{ 2, 4, 1}, + { -2, 4, 1},{ 5, 1, 3},{ -5, 1, 3},{ 3, 2, 2},{ -3, 2, 2},{ 1,16, 0}, + { -1,16, 0},{ 1,17, 0},{ -1,17, 0},{ 1,18, 0},{ -1,18, 0},{ 2, 5, 1}, + { -2, 5, 1},{ 1,19, 0},{ -1,19, 0},{ 1,20, 0},{ -1,20, 0} + }, + //level_add + { 0, 6, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2,-1,-1,-1,-1,-1,-1}, + 0, //golomb_order + 1, //inc_limit + 20 //max_run + }, + { + { //level / run + { 1, 1, 0},{ -1, 1, 0},{ EOB },{ 2, 1, 0},{ -2, 1, 0},{ 1, 2, 0}, + { -1, 2, 0},{ 3, 1, 1},{ -3, 1, 1},{ 1, 3, 0},{ -1, 3, 0},{ 4, 1, 1}, + { -4, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 1, 4, 0},{ -1, 4, 0},{ 5, 1, 2}, + { -5, 1, 2},{ 1, 5, 0},{ -1, 5, 0},{ 3, 2, 1},{ -3, 2, 1},{ 2, 3, 0}, + { -2, 3, 0},{ 1, 6, 0},{ -1, 6, 0},{ 6, 1, 2},{ -6, 1, 2},{ 1, 7, 0}, + { -1, 7, 0},{ 2, 4, 0},{ -2, 4, 0},{ 7, 1, 2},{ -7, 1, 2},{ 1, 8, 0}, + { -1, 8, 0},{ 4, 2, 1},{ -4, 2, 1},{ 1, 9, 0},{ -1, 9, 0},{ 3, 3, 1}, + { -3, 3, 1},{ 2, 5, 0},{ -2, 5, 0},{ 2, 6, 0},{ -2, 6, 0},{ 8, 1, 2}, + { -8, 1, 2},{ 1,10, 0},{ -1,10, 0},{ 1,11, 0},{ -1,11, 0},{ 9, 1, 2}, + { -9, 1, 2},{ 5, 2, 2},{ -5, 2, 2},{ 3, 4, 1},{ -3, 4, 1}, + }, + //level_add + { 0,10, 6, 4, 4, 3, 3, 2, 2, 2, 2, 2,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 1, //golomb_order + 2, //inc_limit + 11 //max_run + }, + { + { //level / run + { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0}, + { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 1, 2, 0},{ -1, 2, 0},{ 5, 1, 1}, + { -5, 1, 1},{ 2, 2, 0},{ -2, 2, 0},{ 6, 1, 1},{ -6, 1, 1},{ 1, 3, 0}, + { -1, 3, 0},{ 7, 1, 1},{ -7, 1, 1},{ 3, 2, 0},{ -3, 2, 0},{ 8, 1, 1}, + { -8, 1, 1},{ 1, 4, 0},{ -1, 4, 0},{ 2, 3, 0},{ -2, 3, 0},{ 9, 1, 1}, + { -9, 1, 1},{ 4, 2, 0},{ -4, 2, 0},{ 1, 5, 0},{ -1, 5, 0},{ 10, 1, 1}, + {-10, 1, 1},{ 3, 3, 0},{ -3, 3, 0},{ 5, 2, 1},{ -5, 2, 1},{ 2, 4, 0}, + { -2, 4, 0},{ 11, 1, 1},{-11, 1, 1},{ 1, 6, 0},{ -1, 6, 0},{ 12, 1, 1}, + {-12, 1, 1},{ 1, 7, 0},{ -1, 7, 0},{ 6, 2, 1},{ -6, 2, 1},{ 13, 1, 1}, + {-13, 1, 1},{ 2, 5, 0},{ -2, 5, 0},{ 1, 8, 0},{ -1, 8, 0}, + }, + //level_add + { 0,14, 7, 4, 3, 3, 2, 2, 2,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 1, //golomb_order + 4, //inc_limit + 8 //max_run + }, + { + { //level / run + { EOB },{ 1, 1, 0},{ -1, 1, 0},{ 2, 1, 0},{ -2, 1, 0},{ 3, 1, 0}, + { -3, 1, 0},{ 4, 1, 0},{ -4, 1, 0},{ 5, 1, 0},{ -5, 1, 0},{ 6, 1, 0}, + { -6, 1, 0},{ 7, 1, 0},{ -7, 1, 0},{ 8, 1, 0},{ -8, 1, 0},{ 1, 2, 0}, + { -1, 2, 0},{ 9, 1, 0},{ -9, 1, 0},{ 10, 1, 0},{-10, 1, 0},{ 11, 1, 0}, + {-11, 1, 0},{ 2, 2, 0},{ -2, 2, 0},{ 12, 1, 0},{-12, 1, 0},{ 13, 1, 0}, + {-13, 1, 0},{ 3, 2, 0},{ -3, 2, 0},{ 14, 1, 0},{-14, 1, 0},{ 1, 3, 0}, + { -1, 3, 0},{ 15, 1, 0},{-15, 1, 0},{ 4, 2, 0},{ -4, 2, 0},{ 16, 1, 0}, + {-16, 1, 0},{ 17, 1, 0},{-17, 1, 0},{ 5, 2, 0},{ -5, 2, 0},{ 1, 4, 0}, + { -1, 4, 0},{ 2, 3, 0},{ -2, 3, 0},{ 18, 1, 0},{-18, 1, 0},{ 6, 2, 0}, + { -6, 2, 0},{ 19, 1, 0},{-19, 1, 0},{ 1, 5, 0},{ -1, 5, 0}, + }, + //level_add + { 0,20, 7, 3, 2, 2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1}, + 0, //golomb_order + INT_MAX, //inc_limit + 5, //max_run + } +}; +#undef EOB + +static const uint8_t partition_flags[30] = { + 0, //I_8X8 + 0, //P_SKIP + 0, //P_16X16 + SPLITH, //P_16X8 + SPLITV, //P_8X16 + SPLITH|SPLITV, //P_8X8 + SPLITH|SPLITV, //B_SKIP + SPLITH|SPLITV, //B_DIRECT + 0, //B_FWD_16X16 + 0, //B_BWD_16X16 + 0, //B_SYM_16X16 + FWD0|FWD1 |SPLITH, + FWD0|FWD1 |SPLITV, + BWD0|BWD1 |SPLITH, + BWD0|BWD1 |SPLITV, + FWD0|BWD1 |SPLITH, + FWD0|BWD1 |SPLITV, + BWD0|FWD1 |SPLITH, + BWD0|FWD1 |SPLITV, + FWD0|FWD1 |SYM1|SPLITH, + FWD0|FWD1 |SYM1 |SPLITV, + BWD0|FWD1 |SYM1|SPLITH, + BWD0|FWD1 |SYM1 |SPLITV, + FWD0|FWD1|SYM0 |SPLITH, + FWD0|FWD1|SYM0 |SPLITV, + FWD0|BWD1|SYM0 |SPLITH, + FWD0|BWD1|SYM0 |SPLITV, + FWD0|FWD1|SYM0|SYM1|SPLITH, + FWD0|FWD1|SYM0|SYM1 |SPLITV, + SPLITH|SPLITV, //B_8X8 = 29 + }; + +static const int frame_rate_tab[][2] = { + { 0, 0}, + {24000, 1001}, + { 24, 1}, + { 25, 1}, + {30000, 1001}, + { 30, 1}, + { 50, 1}, + {60000, 1001}, + { 60, 1}, + + { 15, 1}, + + { 5, 1}, + { 10, 1}, + { 12, 1}, + { 15, 1}, + { 0, 0}, +}; + + +static inline int cavs_clip(int a, int amin, int amax) +{ + if (a < amin) return amin; + else if (a > amax) return amax; + else return a; +} +static inline uint8_t cavs_clip_uint8(int a) +{ + if (a&(~255)) return (-a)>>31; + else return a; +} + + + +static inline int clip3_int( int v, int i_min, int i_max ) +{ + return ( (v < i_min) ? i_min : (v > i_max) ? i_max : v ); +} + +static inline float clip3_float( float v, float f_min, float f_max ) +{ + return ( (v < f_min) ? f_min : (v > f_max) ? f_max : v ); +} +static inline int median( int a, int b, int c ) +{ + int min = a, max =a; + if( b < min ) + min = b; + else + max = b; + + if( c < min ) + min = c; + else if( c > max ) + max = c; + + return a + b + c - min - max; +} + + +#define LOWPASS_4x4(ARRAY,INDEX) \ + ( ARRAY[(INDEX)-1] + 2*ARRAY[(INDEX)] + ARRAY[(INDEX)+1] ) +#define LOWPASS(ARRAY,INDEX) \ + (( ARRAY[(INDEX)-1] + 2*ARRAY[(INDEX)] + ARRAY[(INDEX)+1] + 2) >> 2) + +/**************************************************************************** + * * 4x4亮度块帧内预测 + ****************************************************************************/ + +/**************************************************************************** + * * cavs_intra_4x4_pred_vertical:帧内预测模式之垂直 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_vertical(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int y; + uint64_t i_value = unaligned64(&p_top[1]); + for(y=0;y<4;y++) + { + *((uint64_t *)(p_dest+y*i_stride)) = i_value; + } +} +/**************************************************************************** + * * cavs_intra_4x4_pred_horizontal:帧内预测模式之水平 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_horizontal(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int y; + uint64_t i_value; + for(y=0;y<4;y++) + { + i_value = p_left[y+1] * (uint64_t)0x0101010101010101; + *((uint64_t *)(p_dest+y*i_stride)) = i_value; + } +} +/**************************************************************************** + * * cavs_intra_4x4_pred_dc_128:帧内预测模式之直流,顶块和左块不能得到的情况下处理 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_dc_128(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + + int y; + uint64_t i_value = 128; + for(y=0;y<4;y++) + *((uint64_t *)(p_dest+y*i_stride)) = i_value; +} +/**************************************************************************** + * * cavs_intra_4x4_pred_dc_lp:帧内预测模式之直流,顶块和左块都能得到的情况下处理 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_dc_lp(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + p_dest[y*i_stride+x] = (LOWPASS_4x4(p_top,x+1)+LOWPASS_4x4(p_left,y+1)+4) >> 3; +} + +/**************************************************************************** + * * cavs_intra_4x4_pred_dc_lp_left:帧内预测模式之直流,顶块不能得到的情况下处理 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_dc_lp_left(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + p_dest[y*i_stride+x] = LOWPASS(p_left,y+1); +} +/**************************************************************************** + * * cavs_intra_4x4_pred_dc_lp_top:帧内预测模式之直流,左块不能得到的情况下处理 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_dc_lp_top(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + p_dest[y*i_stride+x] = LOWPASS(p_top,x+1); +} +/**************************************************************************** + * * cavs_intra_4x4_pred_down_left:帧内预测模式之左下 均可用 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_down_left(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + { + if (x==3&&y==3) + p_dest[y*i_stride+x]=(p_top[7]+p_top[8]+p_left[7]+p_left[8]+2)>>2; + else + p_dest[y*i_stride+x] = ((LOWPASS_4x4(p_top,x+y+2) + LOWPASS_4x4(p_left,x+y+2)) +4) >> 3; + } +} +/**************************************************************************** + * * cavs_intra_4x4_pred_down_left:帧内预测模式之右下 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_down_right(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + if(x==y) + p_dest[y*i_stride+x] = (p_left[1]+2*p_top[0]+p_top[1]+2)>>2; + else if(x>y) + p_dest[y*i_stride+x] = LOWPASS(p_top,x-y); + else + p_dest[y*i_stride+x] = LOWPASS(p_left,y-x); +} +/**************************************************************************** + * * cavs_intra_4x4_pred_vertical_left:帧内预测模式之垂直左 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_vertical_left(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + { + if(y==0||y==2) + p_dest[y*i_stride+x] = (p_top[x+y/2+1]+p_top[x+y/2+2]+1)>>1; + else + p_dest[y*i_stride+x] = LOWPASS(p_top,x+y/2+2); + } +} +/**************************************************************************** + * * cavs_intra_4x4_pred_horizontal_down:帧内预测模式之水平下 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_horizontal_down(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + { + hd=2*y-x; + if(hd==0||hd==2||hd==4||hd==6) + p_dest[y*i_stride+x] =(p_left[y-x/2]+p_left[y-x/2+1]+1)>>1; + else if(hd==1||hd==3||hd==5) + p_dest[y*i_stride+x] = LOWPASS(p_left,(y-x/2)); + else if(hd==-1) + p_dest[y*i_stride+x] =(p_top[1]+2*p_top[0]+p_left[1]+2)>>2; + else + p_dest[y*i_stride+x]=LOWPASS(p_top,x-1); + } +} +/**************************************************************************** + * * cavs_intra_4x4_pred_vertical_right:帧内预测模式之垂直右 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_vertical_right(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + { + vr=2*x-y; + if(vr==0||vr==2||vr==4) + p_dest[y*i_stride+x] =(p_top[x-y/2]+p_top[x-y/2+1]+1)>>1; + else if(vr==1||vr==3||vr==5) + p_dest[y*i_stride+x] = LOWPASS(p_top,(x-y/2)); + else if(vr==-1) + p_dest[y*i_stride+x] =LOWPASS(p_left,0); + else + p_dest[y*i_stride+x]=LOWPASS(p_left,y-1); + } +} +/**************************************************************************** + * * cavs_intra_4x4_pred_horizontal_up:帧内预测模式之水平上 + ****************************************************************************/ +static UNUSED void cavs_intra_4x4_pred_horizontal_up(uint8_t *p_dest,uint8_t *p_top,uint8_t *p_left,int i_stride) +{ + int x,y; + for(y=0; y<4; y++) + for(x=0; x<4; x++) + { + hu=x+2*y; + if(hu==0||hu==2||hu==4) + p_dest[y*i_stride+x] =(p_left[y+x/2+1]+p_left[y+x/2+2]+1)>>1; + else if(hu==1||hu==3) + p_dest[y*i_stride+x] = LOWPASS(p_left,(y+x/2+2)); + else if(hd==5) + p_dest[y*i_stride+x] =(p_left[3]+3*p_left[4]+2)>>2; + else + p_dest[y*i_stride+x]=p_left[4]; + } +} + +/**************************************************************************** + * * luma 8x8 intra + ****************************************************************************/ +/**************************************************************************** + * * cavs_intra_pred_dc_128: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_dc_128(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left ) +{ + + int y; + uint64_t i_value = 0x8080808080808080; + for(y=0;y<8;y++) + *((uint64_t *)(p_dest+y*i_stride)) = i_value; +} +/**************************************************************************** + * * cavs_intra_pred_dc_lp: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_dc_lp(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int x,y; + for(y=0; y<8; y++) + for(x=0; x<8; x++) + p_dest[y*i_stride+x] = (LOWPASS(p_top,x+1) + LOWPASS(p_left,y+1)) >> 1; +} + +/**************************************************************************** + * * cavs_intra_pred_dc_lp_left: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_dc_lp_left(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int x,y; + for(y=0; y<8; y++) + for(x=0; x<8; x++) + p_dest[y*i_stride+x] = LOWPASS(p_left,y+1); +} +/**************************************************************************** + * * cavs_intra_pred_dc_lp_top: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_dc_lp_top(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int x,y; + for(y=0; y<8; y++) + for(x=0; x<8; x++) + p_dest[y*i_stride+x] = LOWPASS(p_top,x+1); +} +/**************************************************************************** + * * cavs_intra_pred_horizontal: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_horizontal(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + uint64_t i_value; + for(int y=0;y<8;y++) + { + i_value = p_left[y+1] * 0x0101010101010101ULL; + *((uint64_t *)(p_dest+y*i_stride)) = i_value; + } +} +/**************************************************************************** + * * cavs_intra_pred_vertical: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_vertical(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + uint64_t i_value = unaligned64(&p_top[1]); + for(int y=0;y<8;y++) + { + *((uint64_t *)(p_dest+y*i_stride)) = i_value; + } +} +/**************************************************************************** + * * cavs_intra_pred_down_left: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_down_left(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + for(int y=0; y<8; y++) + for(int x=0; x<8; x++) + p_dest[y*i_stride+x] = (LOWPASS(p_top,x+y+2) + LOWPASS(p_left,x+y+2)) >> 1; +} +/**************************************************************************** + * * cavs_intra_pred_down_left: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_down_right(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + for(int y=0; y<8; y++) + for(int x=0; x<8; x++) + if(x==y) + p_dest[y*i_stride+x] = (p_left[1]+2*p_top[0]+p_top[1]+2)>>2; + else if(x>y) + p_dest[y*i_stride+x] = LOWPASS(p_top,x-y); + else + p_dest[y*i_stride+x] = LOWPASS(p_left,y-x); +} + +/**************************************************************************** + * * cavs_intra_pred_plane: + ****************************************************************************/ +static UNUSED void cavs_intra_pred_plane(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int x,y,i_value; + int i_h = 0; + int i_v = 0; + uint8_t *p_crop = crop_table + MAX_NEG_CROP; + + for(x=0; x<4; x++) + { + i_h += (x+1)*(p_top[5+x]-p_top[3-x]); + i_v += (x+1)*(p_left[5+x]-p_left[3-x]); + } + i_value = (p_top[8]+p_left[8])<<4; + i_h = (17*i_h+16)>>5; + i_v = (17*i_v+16)>>5; + for(y=0; y<8; y++) + { + for(x=0; x<8; x++) + { + p_dest[y*i_stride+x] = p_crop[(i_value+(x-3)*i_h+(y-3)*i_v+16)>>5]; + } + } +} + + + +/* intra chroma predict */ +static UNUSED void cavs_intra_pred_chroma_dc_128(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left ) +{ + + int y; + uint64_t i_value = 0x8080808080808080; + for(y=0;y<8;y++) + *((uint64_t *)(p_dest+y*i_stride)) = i_value; +} + +static UNUSED void cavs_intra_pred_chroma_dc_lp(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int x,y; + for(y=0; y<8; y++) + for(x=0; x<8; x++) + p_dest[y*i_stride+x] = (LOWPASS(p_top,x+1) + LOWPASS(p_left,y+1)) >> 1; +} + +static UNUSED void cavs_intra_pred_chroma_dc_lp_left(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int x,y; + for(y=0; y<8; y++) + for(x=0; x<8; x++) + p_dest[y*i_stride+x] = LOWPASS(p_left,y+1); +} + +static UNUSED void cavs_intra_pred_chroma_dc_lp_top(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int x,y; + for(y=0; y<8; y++) + for(x=0; x<8; x++) + p_dest[y*i_stride+x] = LOWPASS(p_top,x+1); +} + +static UNUSED void cavs_intra_pred_chroma_horizontal(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int y; + uint64_t i_value; + for(y=0;y<8;y++) + { + i_value = p_left[y+1] * 0x0101010101010101ULL; + *((uint64_t *)(p_dest+y*i_stride)) = i_value; + } +} + +static UNUSED void cavs_intra_pred_chroma_vertical(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int y; + uint64_t i_value = unaligned64(&p_top[1]); + for(y=0;y<8;y++) + { + *((uint64_t *)(p_dest+y*i_stride)) = i_value; + } +} + +static UNUSED void cavs_intra_pred_chroma_plane(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left) +{ + int x,y,i_value; + int i_h = 0; + int i_v = 0; + uint8_t *p_crop = crop_table + MAX_NEG_CROP; + + for(x=0; x<4; x++) + { + i_h += (x+1)*(p_top[5+x]-p_top[3-x]); + i_v += (x+1)*(p_left[5+x]-p_left[3-x]); + } + i_value = (p_top[8]+p_left[8])<<4; + i_h = (17*i_h+16)>>5; + i_v = (17*i_v+16)>>5; + for(y=0; y<8; y++) + { + for(x=0; x<8; x++) + { + p_dest[y*i_stride+x] = p_crop[(i_value+(x-3)*i_h+(y-3)*i_v+16)>>5]; + } + } +} + +#undef LOWPASS + + + + +/**************************************************************************** + * 4x4 prediction for intra luma block + ****************************************************************************/ +#define F1(a,b) (((a)+(b)+1)>>1) +#define F2(a,b,c) (((a)+((b)<<1)+(c)+2)>>2) +#define F2_MID(a,b,c) ((a)+((b)<<1)+(c)) +#define F4(a1,b1,c1,a2,b2,c2) (((a1)+(c1)+(a2)+(c2)+((b1+b2)<<1)+4)>>3) + +#define SRC(x,y) src[(x) + (y)*i_stride] +#define SRC_X4(x,y) MPIXEL_X4( &SRC(x,y) ) +#define PREDICT_4x4_DC(v)\ + SRC_X4(0,0) = SRC_X4(0,1) = SRC_X4(0,2) = SRC_X4(0,3) = v; + +#define EP (edge+8) + +static UNUSED void +predict_4x4_dc_128(uint8_t * src, uint8_t edge[17], int i_stride) +{ + PREDICT_4x4_DC(0x80808080); +} + +static UNUSED void +predict_4x4_dc_top(uint8_t *src, uint8_t edge[17], int i_stride) +{ + uint32_t top_edge[4]; + top_edge[0] = F2(EP[0],EP[1],EP[2]); + top_edge[1] = F2(EP[1],EP[2],EP[3]); + top_edge[2] = F2(EP[2],EP[3],EP[4]); + top_edge[3] = F2(EP[3],EP[4],EP[5]); + PREDICT_4x4_DC(MPIXEL_X4(&top_edge[0])); +} +static UNUSED void +predict_4x4_dc_left(uint8_t *src, uint8_t edge[17], int i_stride) +{ + SRC_X4(0, 0) = PIXEL_SPLAT_X4(F2(EP[0],EP[-1],EP[-2])); + SRC_X4(0, 1) = PIXEL_SPLAT_X4(F2(EP[-1],EP[-2],EP[-3])); + SRC_X4(0, 2) = PIXEL_SPLAT_X4(F2(EP[-2],EP[-3],EP[-4])); + SRC_X4(0, 3) = PIXEL_SPLAT_X4(F2(EP[-3],EP[-4],EP[-5])); +} + +static UNUSED void +predict_4x4_dc(uint8_t *src, uint8_t edge[17], int i_stride) +{ + int t0 = F2_MID(EP[0], EP[1], EP[2]); + int t1 = F2_MID(EP[1], EP[2], EP[3]); + int t2 = F2_MID(EP[2], EP[3], EP[4]); + int t3 = F2_MID(EP[3], EP[4], EP[5]); + int l0 = F2_MID(EP[0], EP[-1], EP[-2]); + int l1 = F2_MID(EP[-1], EP[-2], EP[-3]); + int l2 = F2_MID(EP[-2], EP[-3], EP[-4]); + int l3 = F2_MID(EP[-3], EP[-4], EP[-5]); + src[0] = (l0+t0+4)>>3; + src[1] = (l0+t1+4)>>3; + src[2] = (l0+t2+4)>>3; + src[3] = (l0+t3+4)>>3; + src += i_stride; + src[0] = (l1+t0+4)>>3; + src[1] = (l1+t1+4)>>3; + src[2] = (l1+t2+4)>>3; + src[3] = (l1+t3+4)>>3; + src += i_stride; + src[0] = (l2+t0+4)>>3; + src[1] = (l2+t1+4)>>3; + src[2] = (l2+t2+4)>>3; + src[3] = (l2+t3+4)>>3; + src += i_stride; + src[0] = (l3+t0+4)>>3; + src[1] = (l3+t1+4)>>3; + src[2] = (l3+t2+4)>>3; + src[3] = (l3+t3+4)>>3; +} + +static UNUSED void predict_4x4_h( pixel *src, uint8_t edge[17], int i_stride) +{ + SRC_X4(0,0) = PIXEL_SPLAT_X4( EP[-1] ); + SRC_X4(0,1) = PIXEL_SPLAT_X4( EP[-2] ); + SRC_X4(0,2) = PIXEL_SPLAT_X4( EP[-3] ); + SRC_X4(0,3) = PIXEL_SPLAT_X4( EP[-4] ); +} +static UNUSED void predict_4x4_v( pixel *src, uint8_t edge[17], int i_stride) +{ + PREDICT_4x4_DC(MPIXEL_X4(&EP[1])); +} + +static UNUSED void predict_4x4_ddl( pixel *src, uint8_t edge[17], int i_stride) +{ + SRC(0,0)= F4(EP[1],EP[2],EP[3],EP[-1],EP[-2],EP[-3]); + SRC(1,0)=SRC(0,1)= F4(EP[2],EP[3],EP[4],EP[-2],EP[-3],EP[-4]); + SRC(2,0)=SRC(1,1)=SRC(0,2)= F4(EP[3],EP[4],EP[5],EP[-3],EP[-4],EP[-5]); + SRC(3,0)=SRC(2,1)=SRC(1,2)=SRC(0,3)= F4(EP[4],EP[5],EP[6],EP[-4],EP[-5],EP[-6]); + SRC(3,1)=SRC(2,2)=SRC(1,3)= F4(EP[5],EP[6],EP[7],EP[-5],EP[-6],EP[-7]); + SRC(3,2)=SRC(2,3)= F4(EP[6],EP[7],EP[8],EP[-6],EP[-7],EP[-8]); + SRC(3,3)= (EP[7]+EP[8]+EP[-7]+EP[-8]+2)>>2; +} +static UNUSED void predict_4x4_ddr( pixel *src, uint8_t edge[17], int i_stride) +{ + SRC(3,0)= F2(EP[4],EP[3],EP[2]); + SRC(2,0)=SRC(3,1)= F2(EP[3],EP[2],EP[1]); + SRC(1,0)=SRC(2,1)=SRC(3,2)= F2(EP[2],EP[1],EP[0]); + SRC(0,0)=SRC(1,1)=SRC(2,2)=SRC(3,3)= F2(EP[1],EP[0],EP[-1]); + SRC(0,1)=SRC(1,2)=SRC(2,3)= F2(EP[0],EP[-1],EP[-2]); + SRC(0,2)=SRC(1,3)= F2(EP[-1],EP[-2],EP[-3]); + SRC(0,3)= F2(EP[-2],EP[-3],EP[-4]); +} + +static UNUSED void predict_4x4_vr( pixel *src, uint8_t edge[17], int i_stride ) +{ + SRC(0,3)= F2(EP[-3],EP[-2],EP[-1]); + SRC(0,2)= F2(EP[-2],EP[-1],EP[0]); + SRC(0,1)=SRC(1,3)= F2(EP[-1],EP[0],EP[1]); + SRC(0,0)=SRC(1,2)= F1(EP[0],EP[1]); + SRC(1,1)=SRC(2,3)= F2(EP[0],EP[1],EP[2]); + SRC(1,0)=SRC(2,2)= F1(EP[1],EP[2]); + SRC(2,1)=SRC(3,3)= F2(EP[1],EP[2],EP[3]); + SRC(2,0)=SRC(3,2)= F1(EP[2],EP[3]); + SRC(3,1)= F2(EP[2],EP[3],EP[4]); + SRC(3,0)= F1(EP[3],EP[4]); +} + +static UNUSED void predict_4x4_hd( pixel *src, uint8_t edge[17], int i_stride) +{ + SRC(0,3)= F1(EP[-3],EP[-4]); + SRC(1,3)= F2(EP[-2],EP[-3],EP[-4]); + SRC(0,2)=SRC(2,3)= F1(EP[-2],EP[-3]); + SRC(1,2)=SRC(3,3)= F2(EP[-1],EP[-2],EP[-3]); + SRC(0,1)=SRC(2,2)= F1(EP[-1],EP[-2]); + SRC(1,1)=SRC(3,2)= F2(EP[0],EP[-1],EP[-2]); + SRC(0,0)=SRC(2,1)= F1(EP[0],EP[-1]); + SRC(1,0)=SRC(3,1)= F2(EP[1],EP[0],EP[-1]); + SRC(2,0)= F2(EP[2],EP[1],EP[0]); + SRC(3,0)= F2(EP[3],EP[2],EP[1]); +} + +static UNUSED void predict_4x4_vl( pixel *src, uint8_t edge[17], int i_stride) +{ + SRC(0,0)= F1(EP[1],EP[2]); + SRC(0,1)= F2(EP[1],EP[2],EP[3]); + SRC(1,0)=SRC(0,2)= F1(EP[2],EP[3]); + SRC(1,1)=SRC(0,3)= F2(EP[2],EP[3],EP[4]); + SRC(2,0)=SRC(1,2)= F1(EP[3],EP[4]); + SRC(2,1)=SRC(1,3)= F2(EP[3],EP[4],EP[5]); + SRC(3,0)=SRC(2,2)= F1(EP[4],EP[5]); + SRC(3,1)=SRC(2,3)= F2(EP[4],EP[5],EP[6]); + SRC(3,2)= F1(EP[5],EP[6]); + SRC(3,3)= F2(EP[5],EP[6],EP[7]); +} + +static UNUSED void predict_4x4_hu( pixel *src, uint8_t edge[17], int i_stride) +{ + SRC(0,0)= F1(EP[-1],EP[-2]); + SRC(1,0)= F2(EP[-1],EP[-2],EP[-3]); + SRC(2,0)=SRC(0,1)= F1(EP[-2],EP[-3]); + SRC(3,0)=SRC(1,1)= F2(EP[-2],EP[-3],EP[-4]); + SRC(2,1)=SRC(0,2)= F1(EP[-3],EP[-4]); + SRC(3,1)=SRC(1,2)= F2(EP[-3],EP[-4],EP[-4]); + SRC(3,2)=SRC(1,3)=SRC(0,3)= + SRC(2,2)=SRC(2,3)=SRC(3,3)= EP[-4]; +} +#undef SRC +#undef EP + +static UNUSED void inv_transform_B4(int curr_blk1[B4_SIZE][B4_SIZE])//xuyan1118 short->int +{ + short int xx,yy; + short int tmp[B4_SIZE]; + short int t; + short int curr_blk[B4_SIZE][B4_SIZE]; + + int c = 3; + + for(yy=0; yy> 5; + curr_blk[t][xx]=(tmp[yy]-tmp[t]+16) >> 5; + } + } + + for(xx=0;xx>5);\ + DST(3, (a0-a3+16)>>5);\ + DST(1, (a1+a2+16)>>5);\ + DST(2, (a1-a2+16)>>5);\ +} + +static void add4x4_idct(uint8_t *dst, DCTELEM *dct/*[4][4]*/, int i_dst_stride) +{ + int i; +#define SRC(x) dct[i*8 + x] +#define DST(x,rhs) dct[i*8 + x] = (rhs) + for (i = 0; i < 4; i++) + IDCT4_Horizontal_1D +#undef SRC +#undef DST +#define SRC(x) dct[x*8 + i] +#define DST(x,rhs) dst[x*i_dst_stride + i] = cavs_clip_uint8( dst[x*i_dst_stride + i] + (rhs) ); + for (i = 0; i < 4; i++) + IDCT4_Vertical_1D +#undef SRC +#undef DST +} + +static UNUSED void cavs_idct4_add_c(uint8_t *dst, DCTELEM *block, int stride) +{ + int i; + + for( i = 0; i < 4; i++ ) + { + add4x4_idct(dst + (i>>1)*stride*4 + (i&1)*4, block + (i>>1)*8*4 + (i&1)*4, stride); + } + memset(block,0,64*sizeof(DCTELEM)); +} + +#define Clip3(min,max,val) (((val)<(min))?(min):(((val)>(max))?(max):(val))) + +static UNUSED void cavs_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride) +{ + int i; + DCTELEM (*src)[8] = (DCTELEM(*)[8])block; + uint8_t *cm = crop_table + MAX_NEG_CROP; + + int clip1, clip2; + + clip1=0-(1<<(8+7)); + clip2=(1<<(8+7))-1; + + for( i = 0; i < 8; i++ ) { + const int a0 = 3*src[i][1] - (src[i][7]<<1); + const int a1 = 3*src[i][3] + (src[i][5]<<1); + const int a2 = (src[i][3]<<1) - 3*src[i][5]; + const int a3 = (src[i][1]<<1) + 3*src[i][7]; + + const int b4 = ((a0 + a1 + a3)<<1) + a1; + const int b5 = ((a0 - a1 + a2)<<1) + a0; + const int b6 = ((a3 - a2 - a1)<<1) + a3; + const int b7 = ((a0 - a2 - a3)<<1) - a2; + + const int a7 = (src[i][2]<<2) - 10*src[i][6]; + const int a6 = (src[i][6]<<2) + 10*src[i][2]; + const int a5 = ((src[i][0] - src[i][4]) << 3) /*+ 4*/; + const int a4 = ((src[i][0] + src[i][4]) << 3)/* + 4*/; + + const int b0 = a4 + a6; + const int b1 = a5 + a7; + const int b2 = a5 - a7; + const int b3 = a4 - a6; + + src[i][0]=((Clip3(clip1,clip2,((b0+b4)+(1<<2))))>>3); //dailiang 10bits + src[i][1]=((Clip3(clip1,clip2,((b1+b5)+(1<<2))))>>3); + src[i][2]=((Clip3(clip1,clip2,((b2+b6)+(1<<2))))>>3); + src[i][3]=((Clip3(clip1,clip2,((b3+b7)+(1<<2))))>>3); + src[i][7]=((Clip3(clip1,clip2,((b0-b4)+(1<<2))))>>3); + src[i][6]=((Clip3(clip1,clip2,((b1-b5)+(1<<2))))>>3); + src[i][5]=((Clip3(clip1,clip2,((b2-b6)+(1<<2))))>>3); + src[i][4]=((Clip3(clip1,clip2,((b3-b7)+(1<<2))))>>3); + } + for( i = 0; i < 8; i++ ) { + const int a0 = 3*src[1][i] - (src[7][i]<<1); + const int a1 = 3*src[3][i] + (src[5][i]<<1); + const int a2 = (src[3][i]<<1) - 3*src[5][i]; + const int a3 = (src[1][i]<<1) + 3*src[7][i]; + + const int b4 = ((a0 + a1 + a3)<<1) + a1; + const int b5 = ((a0 - a1 + a2)<<1) + a0; + const int b6 = ((a3 - a2 - a1)<<1) + a3; + const int b7 = ((a0 - a2 - a3)<<1) - a2; + + const int a7 = (src[2][i]<<2) - 10*src[6][i]; + const int a6 = (src[6][i]<<2) + 10*src[2][i]; + const int a5 = (src[0][i] - src[4][i]) << 3; + const int a4 = (src[0][i] + src[4][i]) << 3; + + const int b0 = a4 + a6; + const int b1 = a5 + a7; + const int b2 = a5 - a7; + const int b3 = a4 - a6; + + dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((Clip3(clip1,clip2,(b0+b4)+64))>>7)]; + dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((Clip3(clip1,clip2,(b1+b5)+64))>>7)]; + dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((Clip3(clip1,clip2,(b2+b6)+64))>>7)]; + dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((Clip3(clip1,clip2,(b3+b7)+64))>>7)]; + dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((Clip3(clip1,clip2,(b3-b7)+64))>>7)]; + dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((Clip3(clip1,clip2,(b2-b6)+64))>>7)]; + dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((Clip3(clip1,clip2,(b1-b5)+64))>>7)]; + dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((Clip3(clip1,clip2,(b0-b4)+64))>>7)]; + } + memset(block,0,64*sizeof(DCTELEM)); +} + + +#define P2 p0_p[-3*stride] +#define P1 p0_p[-2*stride] +#define P0 p0_p[-1*stride] +#define Q0 p0_p[ 0*stride] +#define Q1 p0_p[ 1*stride] +#define Q2 p0_p[ 2*stride] + +static inline void loop_filter_l2(uint8_t *p0_p,int stride,int alpha, int beta) +{ + int p0 = P0; + int q0 = Q0; + + if(abs(p0-q0)>2) + 2; + if(abs(P2-p0) < beta && abs(p0-q0) < alpha) + { + P0 = (P1 + p0 + s) >> 2; + P1 = (2*P1 + s) >> 2; + } + else + { + P0 = (2*P1 + s) >> 2; + } + if(abs(Q2-q0) < beta && abs(q0-p0) < alpha) + { + Q0 = (Q1 + q0 + s) >> 2; + Q1 = (2*Q1 + s) >> 2; + } + else + { + Q0 = (2*Q1 + s) >> 2; + } + } +} + +static inline void loop_filter_l1(uint8_t *p0_p, int stride, int alpha, int beta, int tc) +{ + int p0 = P0; + int q0 = Q0; + + if(abs(p0-q0)>3,-tc, tc); + P0 = cavs_clip_uint8(p0+delta); + Q0 = cavs_clip_uint8(q0-delta); + + if(abs(P2-p0)>3, -tc, tc); + P1 = cavs_clip_uint8(P1+delta); + } + if(abs(Q2-q0)>3, -tc, tc); + Q1 = cavs_clip_uint8(Q1-delta); + } + } +} + +static inline void loop_filter_c2(uint8_t *p0_p,int stride,int alpha, int beta) +{ + int p0 = P0; + int q0 = Q0; + + if(abs(p0-q0)>2) + 2; + + if(abs(P2-p0) < beta && abs(p0-q0) < alpha) + { + P0 = (P1 + p0 + s) >> 2; + } + else + { + P0 = (2*P1 + s) >> 2; + } + + if(abs(Q2-q0) < beta && abs(q0-p0) < alpha) + { + Q0 = (Q1 + q0 + s) >> 2; + } + else + { + Q0 = (2*Q1 + s) >> 2; + } + } +} + +static inline void loop_filter_c1(uint8_t *p0_p,int stride,int alpha, int beta,int tc) +{ + if(abs(P0-Q0)>3, -tc, tc); + + P0 = cavs_clip_uint8(P0+delta); + Q0 = cavs_clip_uint8(Q0-delta); + } +} + +#undef P0 +#undef P1 +#undef P2 +#undef Q0 +#undef Q1 +#undef Q2 + +void cavs_qpel16_put_mc10_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc20_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc30_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc01_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc11_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc21_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc31_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc02_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc12_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc22_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc32_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc03_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc13_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc23_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc33_c(uint8_t *dst, uint8_t *src, int stride); + +void cavs_qpel8_put_mc10_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc20_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc30_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc01_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc11_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc21_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc31_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc02_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc12_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc22_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc32_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc03_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc13_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc23_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_put_mc33_c(uint8_t *dst, uint8_t *src, int stride); + +void cavs_qpel8_put_mc00_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_put_mc00_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc00_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc00_c(uint8_t *dst, uint8_t *src, int stride); + +void cavs_qpel16_avg_mc10_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc20_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc30_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc01_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc11_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc21_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc31_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc02_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc12_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc22_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc32_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc03_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc13_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc23_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel16_avg_mc33_c(uint8_t *dst, uint8_t *src, int stride); + +void cavs_qpel8_avg_mc10_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc20_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc30_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc01_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc11_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc21_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc31_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc02_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc12_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc22_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc32_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc03_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc13_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc23_c(uint8_t *dst, uint8_t *src, int stride); +void cavs_qpel8_avg_mc33_c(uint8_t *dst, uint8_t *src, int stride); + +////////////////////////////////////////////////////////////////////////////////////////////////// +int +cavs_cpu_num_processors (void) +{ +#if SYS_WINDOWS + return pthread_num_processors_np (); + +#elif SYS_LINUX + unsigned int bit; + int np; + cpu_set_t p_aff; + memset (&p_aff, 0, sizeof (p_aff)); + sched_getaffinity (0, sizeof (p_aff), &p_aff); + for (np = 0, bit = 0; bit < sizeof (p_aff); bit++) + np += (((unsigned char *) & p_aff)[bit / 8] >> (bit % 8)) & 1; + return np; + +#else + return 1; +#endif +} + +//////////////////////////////////////////////////////////////////////////////// +typedef struct +{ + void *(*func)(void *); + void *arg; + void *ret; +} cavs_threadpool_job_t; + +struct cavs_threadpool_t +{ + int exit; + int threads; + cavs_pthread_t *thread_handle; + void (*init_func)(void *); + void *init_arg; + + /* requires a synchronized list structure and associated methods, + so use what is already implemented for frames */ + cavs_synch_frame_list_t uninit; /* list of jobs that are awaiting use */ + cavs_synch_frame_list_t run; /* list of jobs that are queued for processing by the pool */ + cavs_synch_frame_list_t done; /* list of jobs that have finished processing */ +}; + +static void cavs_threadpool_thread( cavs_threadpool_t *pool ) +{ + if( pool->init_func ) + pool->init_func( pool->init_arg ); + + while( !pool->exit ) + { + cavs_threadpool_job_t *job = NULL; + cavs_pthread_mutex_lock( &pool->run.mutex ); + while( !pool->exit && !pool->run.i_size ) + cavs_pthread_cond_wait( &pool->run.cv_fill, &pool->run.mutex ); + if( pool->run.i_size ) + { + job = (void*)cavs_frame_get( pool->run.list ); + pool->run.i_size--; + } + cavs_pthread_mutex_unlock( &pool->run.mutex ); + if( !job ) + continue; + job->ret = job->func( job->arg ); /* execute the function */ + cavs_synch_frame_list_push( &pool->done, (void*)job ); + } +} + +int cavs_threadpool_init( cavs_threadpool_t **p_pool, int threads, + void (*init_func)(void *), void *init_arg) +{ + int i; + cavs_threadpool_t *pool = NULL; + if( threads <= 0 ) + return -1; + + CHECKED_MALLOCZERO( pool, sizeof(cavs_threadpool_t) ); + *p_pool = pool; + + pool->init_func = init_func; + pool->init_arg = init_arg; + pool->threads = CAVS_MIN( threads, CAVS_THREAD_MAX ); + + CHECKED_MALLOC( pool->thread_handle, pool->threads * sizeof(cavs_pthread_t) ); + + if( cavs_synch_frame_list_init( &pool->uninit, pool->threads ) || + cavs_synch_frame_list_init( &pool->run, pool->threads ) || + cavs_synch_frame_list_init( &pool->done, pool->threads ) ) + goto fail; + + for( i = 0; i < pool->threads; i++ ) + { + cavs_decoder *job = NULL; + CHECKED_MALLOC( job, sizeof(cavs_decoder) ); + cavs_synch_frame_list_push( &pool->uninit, (void*)job ); + } + for( i = 0; i < pool->threads; i++ ) + if( cavs_pthread_create( &pool->thread_handle[i], NULL, (void*)cavs_threadpool_thread, pool ) ) + goto fail; + + return 0; +fail: + return -1; +} + +void cavs_threadpool_run( cavs_threadpool_t *pool, void *(*func)(void *), void *arg ) +{ + cavs_threadpool_job_t *job = (void*)cavs_synch_frame_list_pop( &pool->uninit ); + job->func = func; + job->arg = arg; + cavs_synch_frame_list_push( &pool->run, (void*)job ); +} + +void *cavs_threadpool_wait( cavs_threadpool_t *pool, void *arg ) +{ + cavs_threadpool_job_t *job = NULL; + int i; + void *ret; + + cavs_pthread_mutex_lock( &pool->done.mutex ); + while( !job ) + { + for( i = 0; i < pool->done.i_size; i++ ) + { + cavs_threadpool_job_t *t = (void*)pool->done.list[i]; + if( t->arg == arg ) + { + job = (void*)cavs_frame_get( pool->done.list+i ); + pool->done.i_size--; + } + } + if( !job ) + cavs_pthread_cond_wait( &pool->done.cv_fill, &pool->done.mutex ); + } + cavs_pthread_mutex_unlock( &pool->done.mutex ); + + ret = job->ret; + cavs_synch_frame_list_push( &pool->uninit, (void*)job ); + return ret; +} + +static void cavs_threadpool_list_delete( cavs_synch_frame_list_t *slist ) +{ + int i; + for( i = 0; slist->list[i]; i++ ) + { + cavs_free( slist->list[i] ); + slist->list[i] = NULL; + } + cavs_synch_frame_list_delete( slist ); +} + +void cavs_threadpool_delete( cavs_threadpool_t *pool ) +{ + int i; + if (!pool) + return; + cavs_pthread_mutex_lock( &pool->run.mutex ); + pool->exit = 1; + cavs_pthread_cond_broadcast( &pool->run.cv_fill ); + cavs_pthread_mutex_unlock( &pool->run.mutex ); + for( i = 0; i < pool->threads; i++ ) + cavs_pthread_join( pool->thread_handle[i], NULL ); + + cavs_threadpool_list_delete( &pool->uninit ); + cavs_threadpool_list_delete( &pool->run ); + cavs_threadpool_list_delete( &pool->done ); + cavs_free( pool->thread_handle ); + cavs_free( pool ); +} +//////////////////////////////////////////////////////////////////////////////// +int cavs_init_bitstream( InputStream *p , unsigned char *rawstream, unsigned int i_len ) +{ + p->f = rawstream; + p->f_end = rawstream + i_len; + p->uClearBits = 0xffffffff; + p->iBytePosition = 0; + p->iBufBytesNum = 0; + p->iClearBitsNum = 0; + p->iStuffBitsNum = 0; + p->iBitsCount = 0; + p->uPre3Bytes = 0; + + return 0; +} + +static int ClearNextByte(InputStream *p) +{ + int i = 0, k = 0; + unsigned char temp[3]; + i = p->iBytePosition; + k = p->iBufBytesNum - i; + if(k < 3) + { + int last_len = 0; + + for(int j=0;jbuf[i+j]; + + if( p->f < p->f_end ) + { + last_len = (int)(p->f_end - p->f); + p->iBufBytesNum = MIN2(SVA_STREAM_BUF_SIZE - k, last_len); + memcpy( p->buf+k, p->f, p->iBufBytesNum ); + p->f += p->iBufBytesNum; + } + else + p->iBufBytesNum = 0; + + if(p->iBufBytesNum == 0) + { + if(k>0) + { + while(k>0) + { + p->uPre3Bytes = ((p->uPre3Bytes<<8) | p->buf[i]) & 0x00ffffff; + if(p->uPre3Bytes < 4 && p->demulate_enable) //modified by X ZHENG, 20080515 + { + p->uClearBits = (p->uClearBits << 6) | (p->buf[i] >> 2); + p->iClearBitsNum += 6; + } + else + { + p->uClearBits = (p->uClearBits << 8) | p->buf[i]; + p->iClearBitsNum += 8; + } + p->iBytePosition++; + k--; + i++; + } + return 0; + } + else + { + return -1;//arrive at stream end + } + } + else + { + for(int j=0;jbuf[j] = temp[j]; + p->iBufBytesNum += k; + i = p->iBytePosition = 0; + } + } + if(p->buf[i]==0 && p->buf[i+1]==0 && p->buf[i+2]==1) return -2;// meet another start code + p->uPre3Bytes = ((p->uPre3Bytes<<8) | p->buf[i]) & 0x00ffffff; + if(p->uPre3Bytes < 4 && p->demulate_enable) //modified by XZHENG, 20080515 + { + p->uClearBits = (p->uClearBits << 6) | (p->buf[i] >> 2); + p->iClearBitsNum += 6; + } + else + { + p->uClearBits = (p->uClearBits << 8) | p->buf[i]; + p->iClearBitsNum += 8; + } + p->iBytePosition++; + + return 0; +} + +static int read_n_bit(InputStream *p,int n,int *v) +{ + int r; + unsigned int t; + while(n > p->iClearBitsNum) + { + r = ClearNextByte( p ); + if(r) + { + if(r==-1) + { + if(p->iBufBytesNum - p->iBytePosition > 0) + break; + } + return r; + } + } + t = p->uClearBits; + r = 32 - p->iClearBitsNum; + *v = (t << r) >> (32 - n); + p->iClearBitsNum -= n; + return 0; +} + +static int NextStartCode(InputStream *p) +{ + int i, m; + unsigned char a = '\0', b = '\0'; // a b 0 1 2 3 4 ... M-3 M-2 M-1 + m=0; // cjw 20060323 for linux envi + + while(1) + { + if(p->iBytePosition >= p->iBufBytesNum - 2) //if all bytes in buffer has been searched + { + int last_len = 0; + + m = p->iBufBytesNum - p->iBytePosition; + if(m <0) + { + return 254; // current stream end // FIXIT + } + if(m==1) b=p->buf[p->iBytePosition+1]; + if(m==2) + { + b = p->buf[p->iBytePosition + 1]; + a = p->buf[p->iBytePosition]; + } + + if( p->f < p->f_end ) + { + last_len = (int)(p->f_end - p->f); + p->iBufBytesNum = MIN2(SVA_STREAM_BUF_SIZE, last_len); + memcpy( p->buf, p->f, p->iBufBytesNum ); + p->f += p->iBufBytesNum; + } + else + p->iBufBytesNum = 0; + + p->iBytePosition = 0; + } + + if(p->iBufBytesNum + m < 3) + return -1; //arrive at stream end and start code is not found + + if(m==1 && b==0 && p->buf[0]==0 && p->buf[1]==1) + { + p->iBytePosition = 2; + p->iClearBitsNum = 0; + p->iStuffBitsNum = 0; + p->iBitsCount += 24; + p->uPre3Bytes = 1; + return 0; + } + + if(m==2 && b==0 && a==0 && p->buf[0]==1) + { + p->iBytePosition = 1; + p->iClearBitsNum = 0; + p->iStuffBitsNum = 0; + p->iBitsCount += 24; + p->uPre3Bytes = 1; + return 0; + } + + if(m==2 && b==0 && p->buf[0]==0 && p->buf[1]==1) + { + p->iBytePosition = 2; + p->iClearBitsNum = 0; + p->iStuffBitsNum = 0; + p->iBitsCount += 24; + p->uPre3Bytes = 1; + return 0; + } + + for(i = p->iBytePosition; i < p->iBufBytesNum - 2; i++) + { + if(p->buf[i]==0 && p->buf[i+1]==0 && p->buf[i+2]==1) + { + p->iBytePosition = i+3; + p->iClearBitsNum = 0; + p->iStuffBitsNum = 0; + p->iBitsCount += 24; + p->uPre3Bytes = 1; + return 0; + } + p->iBitsCount += 8; + } + p->iBytePosition = i; + } +} + +static void CheckType(InputStream* p, int startcode) +{ + startcode = startcode&0x000000ff; + switch(startcode) + { + case 0xb0: + case 0xb2: + case 0xb5: + p->demulate_enable = 0; + break; + default: + p->demulate_enable = 1; + break; + } +} + +unsigned int cavs_get_one_nal (InputStream* p, unsigned char *buf, int *length) +{ + InputStream* pIRABS = p; + int i,k, j = 0; + unsigned int i_startcode; + int i_tmp = 0; + + i = NextStartCode(pIRABS); + i_tmp = i; + if(i!=0) + { + i_tmp = i; + if( i == -1 ) + { + i_tmp = 254; + i_startcode = 4; + return i_startcode; + } + } + buf[0] = 0; + buf[1] = 0; + buf[2] = 1; + //*startcodepos = 3; + i = read_n_bit( pIRABS, 8, &j ); + buf[3] = j; + CheckType( pIRABS, buf[3] ); //X ZHENG, 20080515, for demulation + + /* get startcode */ + i_startcode = buf[0]; + i_startcode = (i_startcode << 8) | buf[1]; + i_startcode = (i_startcode << 8) | buf[2]; + i_startcode = (i_startcode << 8) | buf[3]; + + if((unsigned char)buf[3]==SEQUENCE_END_CODE) + { + *length = 4; + return i_startcode; + } + k = 4; + while(1) + { + i = read_n_bit(pIRABS,8,&j); + if(i<0) break; + buf[k++] = /*(char)*/j; + } + if(pIRABS->iClearBitsNum>0) + { + int shift; + shift = 8 - pIRABS->iClearBitsNum; + i = read_n_bit(pIRABS,pIRABS->iClearBitsNum,&j); + + if(j!=0) + buf[k++] = /*(char)*/(j< 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0) +#else +#pragma warning(disable:4996) +#endif + +/**************************************************************************** + * * cavs_malloc: + ****************************************************************************/ +void *cavs_malloc( int i_size ) +{ + uint8_t * buf; + uint8_t * align_buf = NULL; + + buf = (uint8_t *) malloc( i_size + CACHE_LINE_MASK + sizeof( void ** )); + if( buf ) + { + //memset(buf, 0, i_size + CACHE_LINE_MASK + sizeof(void **)); + align_buf = buf + CACHE_LINE_MASK + sizeof( void ** ); + align_buf -= (uintptr_t)align_buf & CACHE_LINE_MASK; + *( (void **) ( align_buf - sizeof( void ** ) ) ) = buf; + } + + return align_buf; +} + +/**************************************************************************** + * * cavs_free: + ****************************************************************************/ +void cavs_free( void *p ) +{ + if( p ) + { + free( *( ( ( void **) p ) - 1 ) ); + } +} + +/**************************************************************************** + * cavs_realloc: + ****************************************************************************/ +void *cavs_realloc( void *p, int i_size ) +{ + int i_old_size = 0; + uint8_t * p_new; + if( p ) + { + i_old_size = *( (int*) ( (uint8_t*) p - sizeof( void ** ) - + sizeof( int ) ) ); + } + p_new = (uint8_t *)cavs_malloc( i_size ); + if( i_old_size > 0 && i_size > 0 ) + { + memcpy( p_new, p, ( i_old_size < i_size ) ? i_old_size : i_size ); + } + cavs_free( p ); + + return p_new; +} + + +int cavs_get_sequence_display_extension(cavs_bitstream *s, cavs_sequence_display_extension *e) +{ + e->i_video_format = cavs_bitstream_get_bits(s, 3); + e->b_sample_range = cavs_bitstream_get_bits(s, 1); + e->b_colour_description = cavs_bitstream_get_bit1(s); + if(e->b_colour_description) + { + e->i_colour_primaries = cavs_bitstream_get_bits(s, 8); + e->i_transfer_characteristics = cavs_bitstream_get_bits(s, 8); + e->i_matrix_coefficients = cavs_bitstream_get_bits(s, 8); + } + e->i_display_horizontal_size = cavs_bitstream_get_bits(s, 14); + cavs_bitstream_clear_bits(s, 1); + e->i_display_vertical_size=cavs_bitstream_get_bits(s, 14); + e->i_stereo_packing_mode = cavs_bitstream_get_bits(s, 2); + + return 0; +} + +int cavs_get_copyright_extension(cavs_bitstream *s,cavs_copyright_extension *e) +{ + e->b_copyright_flag = cavs_bitstream_get_bit1(s); + e->i_copyright_id = cavs_bitstream_get_bits(s, 8); + e->b_original_or_copy = cavs_bitstream_get_bit1(s); + cavs_bitstream_clear_bits(s, 7); + cavs_bitstream_clear_bits(s, 1); + e->i_copyright_number = cavs_bitstream_get_bits(s, 20); + e->i_copyright_number <<= 22; + cavs_bitstream_clear_bits(s, 1); + e->i_copyright_number += cavs_bitstream_get_bits(s, 22); + e->i_copyright_number <<= 22; + cavs_bitstream_clear_bits(s, 1); + e->i_copyright_number += cavs_bitstream_get_bits(s, 22); + + return 0; +} + +int cavs_get_camera_parameters_extension(cavs_bitstream *s,cavs_camera_parameters_extension *e) +{ + uint32_t i_value; + + cavs_bitstream_clear_bits(s, 1); + e->i_camera_id = cavs_bitstream_get_bits(s, 7); + cavs_bitstream_clear_bits(s, 1); + e->i_height_of_image_device = cavs_bitstream_get_bits(s, 22); + cavs_bitstream_clear_bits(s, 1); + e->i_focal_length = cavs_bitstream_get_bits(s, 22); + cavs_bitstream_clear_bits(s, 1); + e->i_f_number = cavs_bitstream_get_bits(s, 22); + cavs_bitstream_clear_bits(s, 1); + e->i_vertical_angle_of_view = cavs_bitstream_get_bits(s, 22); + cavs_bitstream_clear_bits(s, 1); + + i_value = cavs_bitstream_get_bits(s, 16); + i_value <<= 16; + cavs_bitstream_clear_bits(s, 1); + i_value += cavs_bitstream_get_bits(s, 16); + cavs_bitstream_clear_bits(s, 1); + e->i_camera_position_x = (int32_t)i_value; + + i_value = cavs_bitstream_get_bits(s, 16); + i_value <<= 16; + cavs_bitstream_clear_bits(s, 1); + i_value += cavs_bitstream_get_bits(s, 16); + cavs_bitstream_clear_bits(s, 1); + e->i_camera_position_y = (int32_t)i_value; + + i_value = cavs_bitstream_get_bits(s, 16); + i_value <<= 16; + cavs_bitstream_clear_bits(s, 1); + i_value += cavs_bitstream_get_bits(s, 16); + cavs_bitstream_clear_bits(s, 1); + e->i_camera_position_z = (int32_t)i_value; + + e->i_camera_direction_x = cavs_bitstream_get_int(s, 22); + cavs_bitstream_clear_bits(s, 1); + e->i_camera_direction_y = cavs_bitstream_get_int(s, 22); + cavs_bitstream_clear_bits(s, 1); + e->i_camera_direction_z = cavs_bitstream_get_int(s, 22); + cavs_bitstream_clear_bits(s, 1); + + e->i_image_plane_vertical_x = cavs_bitstream_get_int(s, 22); + cavs_bitstream_clear_bits(s, 1); + e->i_image_plane_vertical_y = cavs_bitstream_get_int(s, 22); + cavs_bitstream_clear_bits(s, 1); + e->i_image_plane_vertical_z = cavs_bitstream_get_int(s, 22); + cavs_bitstream_clear_bits(s, 1); + + return 0; +} + +int cavs_get_user_data(cavs_bitstream *s, uint8_t *user_data) +{ + while (((*(uint32_t*)(s->p)) & 0x00ffffff) != 0x000001/*0x00010000*/&& s->p < s->p_end) + *user_data = cavs_bitstream_get_bits(s, 8); + + return 0; +} + +static int cavs_check_level_id( uint8_t level_id ) +{ + if( level_id != 0x10 + && level_id != 0x12 + && level_id != 0x14 + && level_id != 0x20 + && level_id != 0x22 + && level_id != 0x2A + && level_id != 0x40 + && level_id != 0x41 + && level_id != 0x42 + && level_id != 0x44 + && level_id != 0x46 + ) + { + return -1; + } + + + return 0; +} + +static int validResu[][2] = +{ + {128,96}, //0 + {176,144}, //1 + {320,240}, //2 + {640,480}, //3 + {720,480}, //4 + {720,576}, //6 + {800,480}, //7 + {1280,720}, //8 + {1440,1080}, //9 + {1440,1080}, //10 + {1920,1080}, //11 + {1920,1088}, //12 + {960,1080},//13 + {960,1088}, //14 + {544, 576}, //15 + {528, 576}, //16 + {480, 576}, //17 + {704, 576}, + {-1,-1} +}; +static int cavs_check_resolution(int width, int height) +{ + int i = 0; + for(i=0; i<32; i++) + { + if (validResu[i][0] < 0) { + break; + } + if(validResu[i][0]==width && validResu[i][1]==height) + return 0; + } + return -1; +} + +int cavs_get_video_sequence_header(cavs_bitstream *s,cavs_video_sequence_header *h) +{ + uint32_t width, height; + + h->i_profile_id = cavs_bitstream_get_bits(s, 8); + + if((h->i_profile_id!=PROFILE_JIZHUN) && (h->i_profile_id!=PROFILE_GUANGDIAN) ) + { + return -1; + } + + h->i_level_id = cavs_bitstream_get_bits(s, 8); + if(cavs_check_level_id(h->i_level_id)) + { + return -1; + } + h->b_progressive_sequence = cavs_bitstream_get_bit1(s); + + width = cavs_bitstream_get_bits(s, 14); + if( width < 176 || width > 1920) + { + return -1; + } + height = cavs_bitstream_get_bits(s, 14); + if( height < 128 || height > 1088) + { + return -1; + } + if(cavs_check_resolution(width, height)) + { + return -1; + } + + h->i_chroma_format = cavs_bitstream_get_bits(s, 2); + if( h->i_chroma_format != 1 ) + { + return -1; + } + h->i_sample_precision = cavs_bitstream_get_bits(s, 3); + if( h->i_sample_precision != 1) + { + return -1; + } + h->i_aspect_ratio = cavs_bitstream_get_bits(s, 4); + if( h->i_aspect_ratio != 0x1 + && h->i_aspect_ratio != 0x2 + && h->i_aspect_ratio != 0x3 + && h->i_aspect_ratio != 0x4 ) + { + return -1; + } + h->i_frame_rate_code = cavs_bitstream_get_bits(s, 4); + if( h->i_frame_rate_code != 0x1 + && h->i_frame_rate_code != 0x2 + && h->i_frame_rate_code != 0x3 + && h->i_frame_rate_code != 0x4 + && h->i_frame_rate_code != 0x5 + && h->i_frame_rate_code != 0x6 + && h->i_frame_rate_code != 0x7 + && h->i_frame_rate_code != 0x8 ) + { + return -1; + } + + h->i_bit_rate = cavs_bitstream_get_bits(s, 18);//bit_rate_lower + h->i_bit_rate <<= 12; + cavs_bitstream_clear_bits(s, 1); //marker_bit + h->i_bit_rate += cavs_bitstream_get_bits(s, 12); + h->b_low_delay = cavs_bitstream_get_bit1(s); + + cavs_bitstream_clear_bits(s, 1); //marker_bit + h->i_bbv_buffer_size = cavs_bitstream_get_bits(s, 18); + + if(cavs_bitstream_get_bits(s,3)!=0) //reserved bits + {/* 3bitsµÄ'000' */ + } + + h->i_horizontal_size = width; + h->i_vertical_size = height; + + return 0; +} + +short wq_param_default[2][6]= +{ + {135,143,143,160,160,213}, + {128, 98,106,116,116,128} +}; + +int cavs_get_i_picture_header(cavs_bitstream *s,cavs_picture_header *h,cavs_video_sequence_header *sh) +{ + h->i_picture_coding_type = CAVS_I_PICTURE; + h->b_picture_reference_flag = 1; + h->b_advanced_pred_mode_disable = 1; + h->i_bbv_delay = cavs_bitstream_get_bits(s, 16); + + if (sh->i_profile_id == PROFILE_GUANGDIAN) + { + cavs_bitstream_get_bit1(s); //marker bit + cavs_bitstream_get_bits(s, 7); //bbv_delay extension + } + + h->b_time_code_flag = cavs_bitstream_get_bit1(s); + if(h->b_time_code_flag) + { + h->i_time_code = cavs_bitstream_get_bits(s, 24); + } + cavs_bitstream_get_bit1(s); + h->i_picture_distance = cavs_bitstream_get_bits(s, 8); + + if(sh->b_low_delay) + { + //ue + h->i_bbv_check_times = cavs_bitstream_get_ue(s); + } + h->b_progressive_frame = cavs_bitstream_get_bit1(s); + if(h->b_progressive_frame==0) + { + h->b_picture_structure = cavs_bitstream_get_bit1(s); + } + else + { + h->b_picture_structure=1; + } + sh->b_interlaced = !h->b_picture_structure; + h->b_top_field_first = cavs_bitstream_get_bit1(s); + h->b_top_field_first = !h->b_picture_structure; // FIXIT:not support 0 + h->b_repeat_first_field = cavs_bitstream_get_bit1(s); + h->b_fixed_picture_qp = cavs_bitstream_get_bit1(s); + h->i_picture_qp = cavs_bitstream_get_bits(s, 6); + + if( h->b_progressive_frame == 0 && h->b_picture_structure == 0 ) + { + h->b_skip_mode_flag = cavs_bitstream_get_bit1(s); + } + else + { + h->b_skip_mode_flag=0; + } + if(cavs_bitstream_get_bits(s,4)!=0) + { + } + + h->b_loop_filter_disable = cavs_bitstream_get_bit1(s); + + if(!h->b_loop_filter_disable) + { + h->b_loop_filter_parameter_flag = cavs_bitstream_get_bit1(s); + if(h->b_loop_filter_parameter_flag) + { + //se + h->i_alpha_c_offset = cavs_bitstream_get_se(s); + h->i_beta_offset = cavs_bitstream_get_se(s); + } + else + { + h->i_alpha_c_offset = 0; + h->i_beta_offset = 0; + } + } + + if(sh->i_profile_id != PROFILE_JIZHUN) + { + h->weighting_quant_flag = cavs_bitstream_get_bit1(s); + if (h->weighting_quant_flag) + { + h->mb_adapt_wq_disable = cavs_bitstream_get_bit1(s); + h->chroma_quant_param_disable = cavs_bitstream_get_bit1(s); + if (! h->chroma_quant_param_disable) + { + h->chroma_quant_param_delta_u = cavs_bitstream_get_se(s); + h->chroma_quant_param_delta_v = cavs_bitstream_get_se(s); + } + h->weighting_quant_param_index = cavs_bitstream_get_bits(s, 2); + h->weighting_quant_model = cavs_bitstream_get_bits(s, 2); + } + if((h->weighting_quant_param_index == 1)||(/*(!h->mb_adapt_wq_disable)&&*/(h->weighting_quant_param_index == 3))) + { + for(int i=0;i<6;i++) + h->weighting_quant_param_undetail[i]=(uint8_t)cavs_bitstream_get_se(s) + wq_param_default[0][i]; + + } + if((h->weighting_quant_param_index == 2)||(/*(!h->mb_adapt_wq_disable)&&*/(h->weighting_quant_param_index == 3))) + { + for(int i=0;i<6;i++) + h->weighting_quant_param_detail[i]=(uint8_t)cavs_bitstream_get_se(s) + wq_param_default[1][i];//? + } + } + else + { + h->weighting_quant_flag=0; + h->mb_adapt_wq_disable=1; + h->chroma_quant_param_delta_u=0; + h->chroma_quant_param_delta_v=0; + } + + //YiDong related + if (sh->i_profile_id == PROFILE_YIDONG) + { + h->vbs_enable=cavs_bitstream_get_bit1(s); + if (h->vbs_enable) + { + h->vbs_qp_shift=cavs_bitstream_get_bits(s,4); + } + h->asi_enable=cavs_bitstream_get_bit1(s); + } + else + { + h->vbs_enable = 0; + h->asi_enable = 0; + } + + //GuangDian related + if (sh->i_profile_id == PROFILE_GUANGDIAN) + h->b_aec_enable = cavs_bitstream_get_bit1(s); + else + h->b_aec_enable = 0; + + /* NOTE : just process once to get status of AEC */ + if( !sh->b_flag_aec ) + { + sh->b_flag_aec = 1; + sh->b_aec_enable = h->b_aec_enable; + } + + h->b_pb_field_enhanced = 0; + + return 0; +} + +int cavs_get_pb_picture_header(cavs_bitstream *s,cavs_picture_header *h,cavs_video_sequence_header *sh) +{ + h->i_bbv_delay = cavs_bitstream_get_bits(s, 16); + + if (sh->i_profile_id == PROFILE_GUANGDIAN) + { + cavs_bitstream_get_bit1(s); //marker bit + cavs_bitstream_get_bits(s, 7); //bbv_delay extension + } + + h->i_picture_coding_type = cavs_bitstream_get_bits(s, 2); + if( h->i_picture_coding_type != 1 && h->i_picture_coding_type != 2 ) + { + return -1; + } + h->i_picture_distance = cavs_bitstream_get_bits(s, 8); + + if(sh->b_low_delay) + { + h->i_bbv_check_times = cavs_bitstream_get_ue(s); + } + h->b_progressive_frame = cavs_bitstream_get_bit1(s); + + if(h->b_progressive_frame==0) + { + h->b_picture_structure = cavs_bitstream_get_bit1(s); + + if(h->b_picture_structure==0) + { + h->b_advanced_pred_mode_disable = cavs_bitstream_get_bit1(s); + if(h->b_advanced_pred_mode_disable != 1) + { + return -1; + } + } + } + else + { + h->b_picture_structure = 1; + } + sh->b_interlaced = !h->b_picture_structure; + h->b_top_field_first = cavs_bitstream_get_bit1(s); + h->b_top_field_first = !h->b_picture_structure;// FIXIT:not support 0 + h->b_repeat_first_field = cavs_bitstream_get_bit1(s); + h->b_fixed_picture_qp = cavs_bitstream_get_bit1(s); + h->i_picture_qp = cavs_bitstream_get_bits(s, 6); + + if(!(h->i_picture_coding_type==CAVS_B_PICTURE&&h->b_picture_structure==1)) + { + h->b_picture_reference_flag = cavs_bitstream_get_bit1(s); + } + + h->b_no_forward_reference_flag = cavs_bitstream_get_bit1(s); + if (sh->i_profile_id == PROFILE_GUANGDIAN) + { + h->b_pb_field_enhanced = cavs_bitstream_get_bit1(s); //pb_field_enhanced_flag + cavs_bitstream_get_bits(s, 2); //reserved bits + } + else + { + h->b_pb_field_enhanced = 0; + if(cavs_bitstream_get_bits(s,3)!=0) + ;//return -1; + } + h->b_skip_mode_flag = cavs_bitstream_get_bit1(s); + h->b_loop_filter_disable = cavs_bitstream_get_bit1(s); + + if(!h->b_loop_filter_disable) + { + h->b_loop_filter_parameter_flag = cavs_bitstream_get_bit1(s); + if(h->b_loop_filter_parameter_flag) + { + //se + h->i_alpha_c_offset = cavs_bitstream_get_se(s); + h->i_beta_offset = cavs_bitstream_get_se(s); + } + else + { + h->i_alpha_c_offset = 0; + h->i_beta_offset = 0; + } + } + + if(sh->i_profile_id != PROFILE_JIZHUN) + { + h->weighting_quant_flag = cavs_bitstream_get_bit1(s); + if (h->weighting_quant_flag) + { + uint32_t scene_adapt_disable = 0; + uint32_t scene_model_update_flag = 0; + + h->mb_adapt_wq_disable = cavs_bitstream_get_bit1(s); + h->chroma_quant_param_disable = cavs_bitstream_get_bit1(s); + if (! h->chroma_quant_param_disable) + { + h->chroma_quant_param_delta_u = cavs_bitstream_get_se(s); + h->chroma_quant_param_delta_v = cavs_bitstream_get_se(s); + } + h->weighting_quant_param_index = cavs_bitstream_get_bits(s, 2); + + if (scene_adapt_disable==0&&scene_model_update_flag==0) + { + h->weighting_quant_model = cavs_bitstream_get_bits(s, 2); + } + else + { + h->weighting_quant_model = 3; + } + if((h->weighting_quant_param_index == 1)||(/*(!h->mb_adapt_wq_disable)&&*/(h->weighting_quant_param_index == 3))) + { + int i; + for( i = 0; i < 6; i++) + h->weighting_quant_param_undetail[i] = (uint8_t)cavs_bitstream_get_se(s) + wq_param_default[0][i]; + } + if((h->weighting_quant_param_index == 2)||(/*(!h->mb_adapt_wq_disable)&&*/(h->weighting_quant_param_index == 3))) + { + int i; + for( i = 0; i < 6; i++) + h->weighting_quant_param_detail[i] = (uint8_t)cavs_bitstream_get_se(s) + wq_param_default[1][i]; + } + } + } + + if (sh->i_profile_id == PROFILE_YIDONG) + { + if(h->i_picture_coding_type==CAVS_P_PICTURE) + { + h->limitDC_refresh_frame = cavs_bitstream_get_bit1(s); + } + } + + if (sh->i_profile_id == PROFILE_YIDONG) + { + h->vbs_enable = cavs_bitstream_get_bit1(s); + if (h->vbs_enable) + { + h->vbs_qp_shift = cavs_bitstream_get_bits(s, 4); + } + h->asi_enable = cavs_bitstream_get_bit1(s); + } + else + { + h->vbs_enable = 0; + h->asi_enable = 0; + } + + if (sh->i_profile_id == PROFILE_GUANGDIAN) + h->b_aec_enable = cavs_bitstream_get_bit1(s); + else + h->b_aec_enable = 0; + + return 0; +} + +int cavs_cavlc_get_ue(cavs_decoder *p) +{ + return cavs_bitstream_get_ue(&p->s); +} + +int cavs_cavlc_get_se(cavs_decoder *p) +{ + return cavs_bitstream_get_se(&p->s); +} + +int cavs_cavlc_get_mb_type_p(cavs_decoder *p) +{ + const int i_mb_type = cavs_bitstream_get_ue(&p->s) + P_SKIP + p->ph.b_skip_mode_flag; + + if (i_mb_type > P_8X8) + { + p->i_cbp_code = i_mb_type - P_8X8 - 1; + return I_8X8; + } + + return i_mb_type; +} + +int cavs_cavlc_get_mb_type_b(cavs_decoder *p) +{ + const int i_mb_type = cavs_bitstream_get_ue(&p->s) + B_SKIP + p->ph.b_skip_mode_flag; + + if (i_mb_type > B_8X8) + { + p->i_cbp_code = i_mb_type - B_8X8 - 1; + return I_8X8; + } + + return i_mb_type; +} + +int cavs_cavlc_get_intra_luma_pred_mode(cavs_decoder *p) +{ + p->pred_mode_flag = cavs_bitstream_get_bit1(&p->s); + + if(!p->pred_mode_flag) + { + return cavs_bitstream_get_bits(&p->s, 2); + } + else + return -1; +} + +static const uint8_t cbp_tab[64][2] = /*[cbp_code][inter]*/ +{ + {63, 0},{15,15},{31,63},{47,31},{ 0,16},{14,32},{13,47},{11,13}, + { 7,14},{ 5,11},{10,12},{ 8, 5},{12,10},{61, 7},{ 4,48},{55, 3}, + { 1, 2},{ 2, 8},{59, 4},{ 3, 1},{62,61},{ 9,55},{ 6,59},{29,62}, + {45,29},{51,27},{23,23},{39,19},{27,30},{46,28},{53, 9},{30, 6}, + {43,60},{37,21},{60,44},{16,26},{21,51},{28,35},{19,18},{35,20}, + {42,24},{26,53},{44,17},{32,37},{58,39},{24,45},{20,58},{17,43}, + {18,42},{48,46},{22,36},{33,33},{25,34},{49,40},{40,52},{36,49}, + {34,50},{50,56},{52,25},{54,22},{41,54},{56,57},{38,41},{57,38} +}; + +int cavs_cavlc_get_intra_cbp(cavs_decoder *p) +{ + if (!p->b_have_pred) + { + p->i_cbp_code = cavs_bitstream_get_ue(&p->s); + } + if(p->i_cbp_code > 63 || p->i_cbp_code < 0) + { + p->b_error_flag = 1; + + return -1; + } + return cbp_tab[p->i_cbp_code][0]; +} + +int cavs_cavlc_get_inter_cbp(cavs_decoder *p) +{ + p->i_cbp_code = cavs_bitstream_get_ue(&p->s); + if(p->i_cbp_code > 63 || p->i_cbp_code < 0) + { + p->b_error_flag = 1; + + return -1; + } + return cbp_tab[p->i_cbp_code][1]; +} + +int cavs_cavlc_get_ref_p(cavs_decoder *p, int ref_scan_idx) +{ + if(p->ph.b_picture_reference_flag ) + return 0; + else + { + if(p->ph.b_picture_structure==0 /*&& p->ph.i_picture_coding_type==CAVS_P_PICTURE*/) + return cavs_bitstream_get_bits(&p->s,2); + else + return cavs_bitstream_get_bit1(&p->s); + } +} + +int cavs_cavlc_get_ref_b(cavs_decoder *p, int i_list, int ref_scan_idx) +{ + if(p->ph.b_picture_structure == 0 && p->ph.b_picture_reference_flag ==0) + return cavs_bitstream_get_bit1(&p->s); //mb_reference_index + else + return 0; +} + +int cavs_cavlc_get_mb_part_type(cavs_decoder *p) +{ + return cavs_bitstream_get_bits(&p->s, 2); +} + +//i_list, i_down and xy_idx is not used here(just for cabac) +int cavs_cavlc_get_mvd(cavs_decoder *p, int i_list, int i_down, int xy_idx) +{ + return cavs_bitstream_get_se(&p->s); +} + +int cavs_cavlc_get_coeffs(cavs_decoder *p, const cavs_vlc *p_vlc_table, int i_escape_order, int b_chroma) +{ + int level_code, esc_code, level, run, mask; + int *level_buf = p->level_buf; + int *run_buf = p->run_buf; + int i; + + for( i = 0; i < 65; i++ ) + { + level_code = cavs_bitstream_get_ue_k(&p->s,p_vlc_table->golomb_order); + if(level_code >= ESCAPE_CODE) + { + run = ((level_code - ESCAPE_CODE) >> 1) + 1; + esc_code = cavs_bitstream_get_ue_k(&p->s,i_escape_order); + + level = esc_code + (run > p_vlc_table->max_run ? 1 : p_vlc_table->level_add[run]); + while(level > p_vlc_table->inc_limit) + p_vlc_table++; + mask = -(level_code & 1); + level = (level^mask) - mask; + } + else + { + level = p_vlc_table->rltab[level_code][0]; + if(!level) //end of block signal + break; + run = p_vlc_table->rltab[level_code][1]; + p_vlc_table += p_vlc_table->rltab[level_code][2]; + } + level_buf[i] = level; + run_buf[i] = run; + } + + return i; +} +//////////////////////////////////////////////////////////////////////////////// + +#define TEST_CABAC 0 + +static const uint8_t sub_mb_type_b_to_golomb[13] = { + 10, 4, 5, 1, 11, 6, 7, 2, 12, 8, 9, 3, 0 +}; + +static const uint8_t mb_type_b_to_golomb[3][9] = { + {4, 8, 12, 10, 6, 14, 16, 18, 20}, /* D_16x8 */ + {5, 9, 13, 11, 7, 15, 17, 19, 21}, /* D_8x16 */ + {1, -1, -1, -1, 2, -1, -1, -1, 3} /* D_16x16 */ +}; + + +#define BIARI_CTX_INIT1_LOG(jj,ctx)\ +{\ + for (j=0; jbs.p > cb->bs.p_end )\ + {\ + cb->b_cabac_error = 1;\ + return 0; \ + }\ + cb->buffer = *(cb->bs.p++); \ + cb->bits_to_go = 7; \ +} + +static void biari_init_context_logac (bi_ctx_t* ctx) +{ + ctx->lg_pmps = (QUARTER<mps = 0; + ctx->cycno = 0; +} + +/***************************************************************************** +* +*****************************************************************************/ +void cavs_cabac_context_init( cavs_decoder * h) +{ + int i, j; + + //--- motion coding contexts --- + BIARI_CTX_INIT2_LOG (3, NUM_MB_TYPE_CTX, h->cabac.mb_type_contexts); + BIARI_CTX_INIT2_LOG (2, NUM_B8_TYPE_CTX, h->cabac.b8_type_contexts); + BIARI_CTX_INIT2_LOG (2, NUM_MV_RES_CTX, h->cabac.mv_res_contexts); + BIARI_CTX_INIT2_LOG (2, NUM_REF_NO_CTX, h->cabac.ref_no_contexts); + BIARI_CTX_INIT1_LOG ( NUM_DELTA_QP_CTX, h->cabac.delta_qp_contexts); + BIARI_CTX_INIT1_LOG ( NUM_MB_AFF_CTX, h->cabac.mb_aff_contexts); + + //--- texture coding contexts --- + BIARI_CTX_INIT1_LOG ( NUM_IPR_CTX, h->cabac.ipr_contexts); + BIARI_CTX_INIT1_LOG ( NUM_CIPR_CTX, h->cabac.cipr_contexts); + BIARI_CTX_INIT2_LOG (3, NUM_CBP_CTX, h->cabac.cbp_contexts); + BIARI_CTX_INIT2_LOG (NUM_BLOCK_TYPES, NUM_BCBP_CTX, h->cabac.bcbp_contexts); + BIARI_CTX_INIT2_LOG (NUM_BLOCK_TYPES, NUM_ONE_CTX, h->cabac.one_contexts); + BIARI_CTX_INIT2_LOG (NUM_BLOCK_TYPES, NUM_ABS_CTX, h->cabac.abs_contexts); + BIARI_CTX_INIT2_LOG (NUM_BLOCK_TYPES, NUM_MAP_CTX, h->cabac.fld_map_contexts); + BIARI_CTX_INIT2_LOG (NUM_BLOCK_TYPES, NUM_LAST_CTX, h->cabac.fld_last_contexts); + BIARI_CTX_INIT2_LOG (NUM_BLOCK_TYPES, NUM_MAP_CTX, h->cabac.map_contexts); + BIARI_CTX_INIT2_LOG (NUM_BLOCK_TYPES, NUM_LAST_CTX, h->cabac.last_contexts); + +#if B_MB_WEIGHTING + biari_init_context_logac( &h->cabac.mb_weighting_pred); +#endif +} + +int cavs_cabac_start_decoding(cavs_cabac_t * cb, cavs_bitstream *s) +{ + int i; + + cb->bs = *s; + cb->s1 = 0; + cb->t1 = 0xFF; + cb->value_s = cb->value_t = 0; + cb->bits_to_go = 0; + for (i = 0; i< B_BITS - 1; i++) + { + if (--cb->bits_to_go < 0) + get_byte(); + cb->value_t = (cb->value_t<<1) | ((cb->buffer >> cb->bits_to_go) & 0x01); + } + + while (cb->value_t < QUARTER) + { + if (--cb->bits_to_go < 0) + get_byte(); + // Shift in next bit and add to value + cb->value_t = (cb->value_t << 1) | ((cb->buffer >> cb->bits_to_go) & 0x01); + cb->value_s++; + } + cb->value_t = cb->value_t & 0xff; + + cb->dec_bypass = 0; + cb->b_cabac_error = 0; + + return 0; +} + +static inline unsigned int cavs_biari_decode_symbol(cavs_cabac_t *cb, bi_ctx_t *bi_ct) +{ + unsigned char bit; + unsigned char s_flag, is_LPS = 0; + unsigned char cwr, cycno = bi_ct->cycno; + unsigned int lg_pmps = bi_ct->lg_pmps; + unsigned int t_rlps; + unsigned int s2, t2; + bit = bi_ct->mps; + +#if TEST_CABAC + cwr = cwr_trans[cycno]; + t1_d = cb->t1 - lg_pmps_shift2[lg_pmps]; + if ( t1_d >= 0 ) + { + s2 = cb->s1; + t2 = t1_d; + s_flag = 0; + } + else + { + s2 = cb->s1+1; + t2 = 256 + t1_d; + s_flag = 1; + } +#else + cwr = (cycno<=1)?3:(cycno==2)?4:5; + + if (cb->t1 >= (lg_pmps>>LG_PMPS_SHIFTNO)) + { + s2 = cb->s1; + t2 = cb->t1 - (lg_pmps>>LG_PMPS_SHIFTNO); + s_flag = 0; + } + else + { + s2 = cb->s1+1; + t2 = 256 + cb->t1 - (lg_pmps>>LG_PMPS_SHIFTNO); + s_flag = 1; + } +#endif + + if( s2 > cb->value_s || ( s2 == cb->value_s && cb->value_t >= t2)) //LPS + { + is_LPS = 1; + bit=!bit;//LPS + +#if TEST_CABAC + t_rlps = (s_flag==0)? lg_pmps_shift2[lg_pmps] + :(cb->t1 + lg_pmps_shift2[lg_pmps]); +#else + t_rlps = (s_flag==0)? (lg_pmps>>LG_PMPS_SHIFTNO) + :(cb->t1 + (lg_pmps>>LG_PMPS_SHIFTNO)); +#endif + + if (s2==cb->value_s) + cb->value_t = (cb->value_t-t2); + else + { + if (--cb->bits_to_go < 0) + get_byte(); + // Shift in next bit and add to value + cb->value_t = (cb->value_t << 1) | ((cb->buffer >> cb->bits_to_go) & 0x01); + cb->value_t = 256 + cb->value_t - t2; + } + + //restore range + while (t_rlps < QUARTER){ + t_rlps=t_rlps<<1; + if (--cb->bits_to_go < 0) + get_byte(); + // Shift in next bit and add to value + cb->value_t = (cb->value_t << 1) | ((cb->buffer >> cb->bits_to_go) & 0x01); + } + + cb->s1 = 0; + cb->t1 = t_rlps & 0xff; + + //restore value + cb->value_s = 0; + while (cb->value_tbits_to_go < 0) + get_byte(); + j=(cb->buffer >> cb->bits_to_go) & 0x01; + // Shift in next bit and add to value + + cb->value_t = (cb->value_t << 1) | j; + cb->value_s++; + } + cb->value_t = cb->value_t & 0xff; + } + else //MPS + { + cb->s1 = s2; + cb->t1 = t2; + } + + if (cb->dec_bypass) return(bit); + + //update other parameters + if (is_LPS) + { +#if TEST_CABAC + cycno = cycno_trans2[cycno]; +#else + cycno=(cycno<=2)?(cycno+1):3; +#endif + } + else if (cycno==0) + cycno =1; + bi_ct->cycno=cycno; + + /* update probability estimation */ +#if TEST_CABAC + if (is_LPS) + { + + lg_pmps = lg_pmps_tab[cwr][lg_pmps]; + if (lg_pmps >= 1024) + { + lg_pmps = 2047 - lg_pmps; + bi_ct->mps = !(bi_ct->mps); + } + } + else + { + lg_pmps = lg_pmps_tab_mps[cwr][lg_pmps]; + } + +#else + if (is_LPS) + { + switch(cwr) { + case 3: lg_pmps = lg_pmps + 197; + break; + case 4: lg_pmps = lg_pmps + 95; + break; + default:lg_pmps = lg_pmps + 46; + } + + if (lg_pmps>=(256<mps = !(bi_ct->mps); + } + } + else + { + lg_pmps = lg_pmps - (unsigned int)(lg_pmps>>cwr) - (unsigned int)(lg_pmps>>(cwr+2)); + } +#endif + + + bi_ct->lg_pmps = lg_pmps; + + return(bit); + +} + +static inline unsigned int cavs_biari_decode_symbol_bypass(cavs_cabac_t *cb) +{ + bi_ctx_t ctx; + uint32_t bit; + ctx.cycno = 0; // added by xun + ctx.lg_pmps = (QUARTER << LG_PMPS_SHIFTNO) - 1; + ctx.mps = 0; + cb->dec_bypass = 1; + bit = cavs_biari_decode_symbol(cb, &ctx); + cb->dec_bypass = 0; + return bit; +} + +int cavs_biari_decode_stuffing_bit(cavs_cabac_t *cb) +{ + bi_ctx_t ctx; + uint32_t bit; + ctx.cycno = 0; + ctx.lg_pmps = 1 << LG_PMPS_SHIFTNO; + ctx.mps = 0; + bit = cavs_biari_decode_symbol(cb, &ctx); + + return bit; +} + +static int cavs_biari_decode_symbol_w(cavs_cabac_t *cb, bi_ctx_t *bi_ct1 ,bi_ctx_t *bi_ct2 ) +{ + uint8_t bit1,bit2; + uint8_t pred_MPS,bit; + uint32_t lg_pmps; + uint8_t cwr1,cycno1=bi_ct1->cycno; + uint8_t cwr2,cycno2=bi_ct2->cycno; + uint32_t lg_pmps1= bi_ct1->lg_pmps,lg_pmps2= bi_ct2->lg_pmps; + uint32_t t_rlps; + uint8_t s_flag,is_LPS=0; + uint32_t s2,t2; + bit1 = bi_ct1->mps; + bit2 = bi_ct2->mps; + +#if TEST_CABAC + if( cycno1 > 3 ) + { + return -1; + } + cwr1 = cwr_trans[cycno1]; + if( cycno2 > 3 ) + { + return -1; + } + cwr2 = cwr_trans[cycno2]; +#else + cwr1 = (cycno1<=1)?3:(cycno1==2)?4:5; + cwr2 = (cycno2<=1)?3:(cycno2==2)?4:5; +#endif + + if (bit1 == bit2) + { + pred_MPS = bit1; + lg_pmps = (lg_pmps1 + lg_pmps2)/2; + } + else + { + if (lg_pmps1>1); + } + else { + pred_MPS = bit2; + lg_pmps = 1023 - ((lg_pmps1 - lg_pmps2)>>1); + } + } + +#if TEST_CABAC + if(lg_pmps>1023) + { + return -1; + } + t1_d = cb->t1 - lg_pmps_shift2[lg_pmps]; + if ( t1_d >= 0 ) + { + s2 = cb->s1; + t2 = t1_d; + s_flag = 0; + } + else + { + s2 = cb->s1 + 1; + t2 = 256 + t1_d; + s_flag = 1; + } +#else + if (cb->t1>=(lg_pmps>>LG_PMPS_SHIFTNO)) + { + s2 = cb->s1; + t2 = cb->t1 - (lg_pmps>>LG_PMPS_SHIFTNO); + s_flag = 0; + } + else + { + s2 = cb->s1 + 1; + t2 = 256 + cb->t1 - (lg_pmps>>LG_PMPS_SHIFTNO); + s_flag = 1; + } +#endif + + bit = pred_MPS; + if(s2 > cb->value_s || (s2 == cb->value_s && cb->value_t >= t2))//LPS + { + is_LPS = 1; + bit=!bit;//LPS + +#if TEST_CABAC + t_rlps = (s_flag==0)? lg_pmps_shift2[lg_pmps]:(cb->t1 + lg_pmps_shift2[lg_pmps]); +#else + t_rlps = (s_flag==0)? (lg_pmps>>LG_PMPS_SHIFTNO):(cb->t1 + (lg_pmps>>LG_PMPS_SHIFTNO)); +#endif + + if (s2 == cb->value_s) + cb->value_t = (cb->value_t-t2); + else + { + if (--cb->bits_to_go < 0) + get_byte(); + // Shift in next bit and add to value + cb->value_t = (cb->value_t << 1) | ((cb->buffer >> cb->bits_to_go) & 0x01); + cb->value_t = 256 + cb->value_t - t2; + } + + //restore range + while (t_rlps < QUARTER){ + t_rlps=t_rlps<<1; + if (--cb->bits_to_go < 0) + get_byte(); + // Shift in next bit and add to value + cb->value_t = (cb->value_t << 1) | ((cb->buffer >> cb->bits_to_go) & 0x01); + } + cb->s1 = 0; + cb->t1 = t_rlps & 0xff; + + //restore value + cb->value_s = 0; + while (cb->value_tbits_to_go < 0) + get_byte(); + j=(cb->buffer >> cb->bits_to_go) & 0x01; + // Shift in next bit and add to value + + cb->value_t = (cb->value_t << 1) | j; + cb->value_s++; + } + cb->value_t = cb->value_t & 0xff; + }//--LPS + else //MPS + { + cb->s1 = s2; + cb->t1 = t2; + } + +#if TEST_CABAC + cycno1 = cycno_trans_2d[bit!=bit1][cycno1]; + cycno2 = cycno_trans_2d[bit!=bit2][cycno2]; +#else + if (bit!=bit1) + { + cycno1 = (cycno1<=2)?(cycno1+1):3;//LPS occurs + } + else{ + if (cycno1==0) cycno1 =1; + } + + if (bit !=bit2) + { + cycno2 = (cycno2<=2)?(cycno2+1):3;//LPS occurs + } + else + { + if (cycno2==0) cycno2 =1; + } +#endif + + bi_ct1->cycno = cycno1; + bi_ct2->cycno = cycno2; + + //update probability estimation +#if TEST_CABAC + //bi_ct1 + if( lg_pmps1 > 1023 || cwr1 > 5 ) + { + return -1; + } + + if (bit==bit1) + { + lg_pmps1 = lg_pmps_tab_mps[cwr1][lg_pmps1]; + } + else + { + lg_pmps1 = lg_pmps_tab[cwr1][lg_pmps1]; + if (lg_pmps1 >= 1024) + { + lg_pmps1 = 2047 - lg_pmps1; + bi_ct1->mps = !(bi_ct1->mps); + } + } + bi_ct1->lg_pmps = lg_pmps1; + + //bi_ct2 + if( lg_pmps2 > 1023 || cwr2 > 5 ) + { + return -1; + } + + if (bit==bit2) + { + lg_pmps2 = lg_pmps_tab_mps[cwr2][lg_pmps2]; + } + else + { + lg_pmps2 = lg_pmps_tab[cwr2][lg_pmps2]; + if (lg_pmps2 >= 1024) + { + lg_pmps2 = 2047 - lg_pmps2; + bi_ct2->mps = !(bi_ct2->mps); + } + } + bi_ct2->lg_pmps = lg_pmps2; + + +#else + //bi_ct1 + if (bit==bit1) + { + lg_pmps1 = lg_pmps1 - (unsigned int)(lg_pmps1>>cwr1) - (unsigned int)(lg_pmps1>>(cwr1+2)); + } + else + { + switch(cwr1) { + case 3: lg_pmps1 = lg_pmps1 + 197; + break; + case 4: lg_pmps1 = lg_pmps1 + 95; + break; + default:lg_pmps1 = lg_pmps1 + 46; + } + + if (lg_pmps1>=(256<mps = !(bi_ct1->mps); + } + } + bi_ct1->lg_pmps = lg_pmps1; + + //bi_ct2 + if (bit==bit2) + { + lg_pmps2 = lg_pmps2 - (unsigned int)(lg_pmps2>>cwr2) - (unsigned int)(lg_pmps2>>(cwr2+2)); + } + else + { + switch(cwr2) { + case 3: lg_pmps2 = lg_pmps2 + 197; + break; + case 4: lg_pmps2 = lg_pmps2 + 95; + break; + default:lg_pmps2 = lg_pmps2 + 46; + } + + if (lg_pmps2>=(256<mps = !(bi_ct2->mps); + } + } + bi_ct2->lg_pmps = lg_pmps2; +#endif + + return(bit); +} + +int cavs_cabac_get_skip(cavs_decoder *p) +{ + int i = 0, symbol = 0; + bi_ctx_t * ctx = p->cabac.one_contexts[0]; + + while( cavs_biari_decode_symbol(&p->cabac, ctx+i)==0 ) { + symbol += 1; + i ++; + if( i >= 3 ) i=3; + + if( symbol > (int)(p->i_mb_num>>p->param.b_interlaced) ) /* NOTE : remove endless loop */ + { + p->b_error_flag = 1; + return -1; + } + } + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + if( p->b_error_flag ) + { + return -1; + } + + return symbol; +} + +int cavs_cabac_get_mb_type_p(cavs_decoder *p) +{ + bi_ctx_t * ctx = p->cabac.mb_type_contexts[1]; + int symbol = 0, i = 0; + + const int DMapSkip[5] = {4,0,1,2,3}; + const int DMapNonSkip[6] = {5,0, 1,2,3,4}; + + while( cavs_biari_decode_symbol (&p->cabac, ctx+i)==0 ) { + symbol++; + i++; + if( i>=4 ) i=4; + + if(symbol > 5) /* NOTE : remove endless loop */ + { + p->b_error_flag = 1; + return -1; + } + } + + if( p->ph.b_skip_mode_flag ) + { + if(symbol > 4) + { + p->b_error_flag = 1; + return -1; + } + symbol = DMapSkip[symbol]; + } + else + { + if(symbol > 5) + { + p->b_error_flag = 1; + return -1; + } + symbol = DMapNonSkip[symbol]; + } + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + + if( symbol + p->ph.b_skip_mode_flag == 5 ) + return I_8X8; + else + { + return symbol + P_SKIP + p->ph.b_skip_mode_flag; + } +} + +int cavs_cabac_get_mb_type_b(cavs_decoder *p) +{ + const int i_mb_type_left = p->i_mb_type_left; + const int i_mb_type_top = p->p_mb_type_top[p->i_mb_x]; + int i = (i_mb_type_left != -1 && i_mb_type_left != B_SKIP && i_mb_type_left != B_DIRECT) + + (i_mb_type_top != -1 && i_mb_type_top != B_SKIP && i_mb_type_top != B_DIRECT); + + bi_ctx_t * ctx = p->cabac.mb_type_contexts[2]; + int symbol; + + if( cavs_biari_decode_symbol(&p->cabac, ctx + i)==0 ) { + symbol = 0; + } + else + { + symbol = 1; + i = 4; + while( cavs_biari_decode_symbol (&p->cabac, ctx + i)==0 ) + { + ++symbol; + ++i; + if( i>=10 ) i=10; + + if( symbol > 29 ) /* NOTE : remove endless loop */ + { + p->b_error_flag = 1; + return -1; + } + } + } + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + if( p->b_error_flag ) + { + return -1; + } + + if (symbol + p->ph.b_skip_mode_flag == 24 ) + return I_8X8; + else + return symbol + B_SKIP + p->ph.b_skip_mode_flag; +} + +static const int map_intra_pred_mode[5] = {-1, 1, 2, 3, 0}; +int cavs_cabac_get_intra_luma_pred_mode(cavs_decoder *p) +{ + bi_ctx_t * ctx = p->cabac.one_contexts[1]; + int i = 0; + int symbol = 0; + + while (cavs_biari_decode_symbol(&p->cabac, ctx + i) == 0) + { + ++symbol; + ++i; + if (i>=3) i = 3; + if (symbol == 4) break; + } + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + p->pred_mode_flag = !symbol; + + return map_intra_pred_mode[symbol]; +} + +int cavs_cabac_get_intra_chroma_pred_mode(cavs_decoder *p) +{ + bi_ctx_t * ctx = p->cabac.cipr_contexts; + /* 0 for chroma DC and -1 for not available(outside of slice or not intra) */ + int i = (cavs_mb_pred_mode8x8c[p->i_chroma_pred_mode_left] > 0) + + (cavs_mb_pred_mode8x8c[p->p_chroma_pred_mode_top[p->i_mb_x]] > 0); + + int symbol; + int bit; + + bit = cavs_biari_decode_symbol(&p->cabac, ctx + i); + + if (!bit) + symbol = 0; + else + { + bit = cavs_biari_decode_symbol(&p->cabac, ctx+3); + if (!bit) symbol = 1; + else + { + bit = cavs_biari_decode_symbol(&p->cabac, ctx+3); + /*if (!tempval) symbol = 2; + else symbol = 3;*/ + symbol = 2 + bit; + } + } + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + + return symbol; +} + +int cavs_cabac_get_cbp(cavs_decoder *p) +{ + bi_ctx_t * ctx = p->cabac.cbp_contexts[0]; + int bit, a, b; + int symbol = 0; + + /* -1 for cbp not available(outside of slice) */ + /* block 0 */ + a = !(p->i_cbp_left & (1<<1)); + b = !(p->p_cbp_top[p->i_mb_x] & (1<<2)); + bit = cavs_biari_decode_symbol(&p->cabac, ctx + a + 2*b); + symbol |= bit; + + /* block 1 */ + a = !bit; /*we just get the zero count of left block*/ + b = !(p->p_cbp_top[p->i_mb_x] & (1<<3)); + bit = cavs_biari_decode_symbol(&p->cabac, ctx + a + 2*b); + symbol |= (bit<<1); + + /* block 2 */ + a = !(p->i_cbp_left & (1<<3)); + b = !(symbol & 1); + bit = cavs_biari_decode_symbol(&p->cabac, ctx + a + 2*b); + symbol |= (bit<<2); + + /* block 3 */ + a = !bit; + b = !(symbol & (1<<1)); + bit = cavs_biari_decode_symbol(&p->cabac, ctx + a + 2*b); + symbol |= (bit<<3); + + ctx = p->cabac.cbp_contexts[1]; + bit = cavs_biari_decode_symbol(&p->cabac, ctx); + if (bit) + { + bit = cavs_biari_decode_symbol(&p->cabac, ctx + 1); + if (bit) + symbol |= (3<<4); + else + { + bit = cavs_biari_decode_symbol(&p->cabac, ctx + 1); + symbol |= 1 << (4 + bit); + } + } + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + if( p->b_error_flag ) + { + return -1; + } + + return symbol; +} + +int cavs_cabac_get_dqp(cavs_decoder *p) +{ + bi_ctx_t * ctx = p->cabac.delta_qp_contexts; + int i = !!p->i_last_dqp; + + int dquant, l; + int symbol = 1 - cavs_biari_decode_symbol(&p->cabac, ctx + i); + + if (symbol) + { + symbol = 1 - cavs_biari_decode_symbol(&p->cabac, ctx + 2); + if (symbol) + { + symbol = 0; + do { + l = 1 - cavs_biari_decode_symbol(&p->cabac, ctx + 3); + ++symbol; + + if( symbol > 126 ) /* NOTE : qp_delta can not exceed 63 */ + { + p->b_error_flag = 1; + return 0; + } + } while (l); + } + ++symbol; + } + + dquant = (symbol+1)>>1; + if((symbol & 0x01)==0) + dquant = -dquant; + + p->i_last_dqp = dquant; + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + + return dquant; +} + +int cavs_cabac_get_mvd(cavs_decoder *p, int i_list, int mvd_scan_idx, int xy_idx) +{ + const int mda = abs(p->p_mvd[i_list][mvd_scan_idx-1][xy_idx]); + + int i = mda < 2 ? 0 : mda < 16 ? 1 : 2; + bi_ctx_t * ctx = p->cabac.mv_res_contexts[xy_idx]; + int symbol, l, golomb_order = 0, bit = 0; + + if (!cavs_biari_decode_symbol(&p->cabac, ctx + i)) + symbol = 0; + else if (!cavs_biari_decode_symbol(&p->cabac, ctx + 3)) + symbol = 1; + else if (!cavs_biari_decode_symbol(&p->cabac, ctx + 4)) + symbol = 2; + else if (!cavs_biari_decode_symbol(&p->cabac, ctx + 5)) + { + symbol = 0; + do { + l = cavs_biari_decode_symbol_bypass(&p->cabac); + if (!l) + { + symbol += (1< 4096) /*remove endless loop*/ + { + p->b_error_flag = 1; + return -1; + } + } + + if( l!=0 && l!=1 ) + { + p->b_error_flag = 1; + return -1; + } + } while(l!=1); + while (golomb_order--) + {//next binary part + l = cavs_biari_decode_symbol_bypass(&p->cabac); + if (l == 1) + bit |= (1<b_error_flag = 1; + // return; + //} + } + symbol += bit; + symbol = 3 + symbol*2; + } + else + { + symbol = 0; + do + { + l = cavs_biari_decode_symbol_bypass(&p->cabac); + if (!l) + { + symbol += (1< 4096) /*remove endless loop*/ + { + p->b_error_flag = 1; + return -1; + } + } + + if( l!=0 && l!=1 ) + { + p->b_error_flag = 1; + return -1; + } + } while (l!=1); + while (golomb_order--) + {//next binary part + l = cavs_biari_decode_symbol_bypass(&p->cabac); + if (l == 1) + bit |= (1<b_error_flag = 1; + // return; + //} + } + symbol += bit; + symbol = 4 + symbol*2; + } + if (symbol) + { + if (cavs_biari_decode_symbol_bypass(&p->cabac)) + symbol = -symbol; + } + + p->p_mvd[i_list][mvd_scan_idx][xy_idx] = symbol; + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + + return symbol; +} + +int cavs_cabac_get_ref_p(cavs_decoder *p, int ref_scan_idx) +{ + const int a = p->p_ref[0][ref_scan_idx-1] > 0; + const int b = p->p_ref[0][ref_scan_idx-3] > 0; + + int i = a + (b<<1), symbol; + bi_ctx_t * ctx = p->cabac.ref_no_contexts[0]; + + if(p->ph.b_picture_reference_flag ) + { + return 0; + } + + if (cavs_biari_decode_symbol(&p->cabac, ctx + i)) + symbol = 0; + else + { + symbol = 1; + i = 4; + while (!cavs_biari_decode_symbol(&p->cabac, ctx + i)) + { + symbol++; + i++; + if (i >= 5) i = 5; + + if( symbol > 3 ) /* remove endless loop */ + { + p->b_error_flag = 1; + return -1; + } + } + } + + p->p_ref[0][ref_scan_idx] = symbol; + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + + return symbol; +} + +static inline int cavs_cabac_get_ref_b_core(cavs_decoder *p, int i_list, int ref_scan_idx) +{ + const int a = p->p_ref[i_list][ref_scan_idx-1] > 0; + const int b = p->p_ref[i_list][ref_scan_idx-3] > 0; + + int i = a + (b<<1); + bi_ctx_t * ctx = p->cabac.ref_no_contexts[0]; + int symbol = !cavs_biari_decode_symbol(&p->cabac, ctx + i); + + p->p_ref[i_list][ref_scan_idx] = symbol; + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + + return symbol; +} + +int cavs_cabac_get_ref_b(cavs_decoder *p, int i_list, int ref_scan_idx) +{ + if(p->ph.b_picture_structure == 0 && p->ph.b_picture_reference_flag ==0) + return cavs_cabac_get_ref_b_core(p, i_list, ref_scan_idx); + return 0; +} + + +int cavs_cabac_get_mb_part_type(cavs_decoder *p) +{ + bi_ctx_t * ctx = p->cabac.b8_type_contexts[0]; + int i, symbol; + + if (cavs_biari_decode_symbol(&p->cabac, ctx + 0)) + { + symbol = 2; + i = 2; + } + else + { + symbol = 0; + i = 1; + } + + if (cavs_biari_decode_symbol(&p->cabac, ctx + i)) + ++symbol; + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + + return symbol; +} + +static const int t_chr[5] = { 0,1,2,4,3000}; +int cavs_cabac_get_coeffs(cavs_decoder *p, const cavs_vlc *p_vlc_table, int i_escape_order, int b_chroma) +{ + int pairs, rank, pos; + int run, level, abslevel, symbol; + int *run_buf = p->run_buf, *level_buf = p->level_buf; + + /* read coefficients for whole block */ + bi_ctx_t (*primary)[NUM_MAP_CTX]; + bi_ctx_t *p_ctx; + bi_ctx_t *p_ctx2; + int ctx, ctx2, offset; + int i_ret = 0; + + if( !b_chroma ) + { + if( p->ph.b_picture_structure == 0 ) + { + primary = p->cabac.fld_map_contexts; + } + else + { + primary = p->cabac.map_contexts; + } + } + else + { + if( p->ph.b_picture_structure == 0 ) + { + primary = p->cabac.fld_last_contexts; + } + else + { + primary = p->cabac.last_contexts; + } + } + + //! Decode + rank = 0; + pos = 0; + for( pairs=0; pairs<65; pairs++ ) { + p_ctx = primary[rank]; + //! EOB + if( rank>0) { + p_ctx2 = primary[5+(pos>>5)]; + ctx2 = (pos>>1)&0x0f; + /* note : can't cross border of array */ + if( pos < 0 || pos > 63 ) + { + return -1; + } + ctx = 0; + i_ret = cavs_biari_decode_symbol_w(&p->cabac, p_ctx+ctx, p_ctx2+ctx2); + if( i_ret == -1) + { + p->b_error_flag = 1; + return -1; + } + else if(i_ret!= 0 ) + { + break; + } + } + //! Level + ctx = 1; + symbol = 0; + while( cavs_biari_decode_symbol(&p->cabac, p_ctx+ctx)==0 ) { + ++symbol; + ++ctx; + if( ctx>=2 ) ctx =2; + + if( symbol > (1<<15) ) /* remove endless loop */ + { + p->b_error_flag = 1; + return -1; + } + } + abslevel = symbol + 1; + //! Sign + if( cavs_biari_decode_symbol_bypass(&p->cabac) ) { + level = - abslevel; + } + else { + level = abslevel; + } + + //! Run + if( abslevel==1 ) { + offset = 4; + } + else { + offset = 6; + } + symbol = 0; + ctx = 0; + while( cavs_biari_decode_symbol(&p->cabac, p_ctx+ctx+offset)==0 ) { + ++symbol; + ++ctx; + if( ctx>=1 ) ctx =1; + + if( symbol > 63 ) /* remove endless loop */ + { + p->b_error_flag = 1; + return -1; + } + } + run = symbol; + + level_buf[pairs] = level; + run_buf[pairs] = run + 1; + + if( abslevel>t_chr[rank] ) { + if( abslevel <= 2 ) + rank = abslevel; + else if( abslevel<=4 ) + rank = 3; + else + rank = 4; + } + pos += (run+1); + if( pos>=64 ) pos = 63; + } + + p->b_error_flag = (&(p->cabac))->b_cabac_error; + + return pairs; +} + +#if B_MB_WEIGHTING +int cavs_cabac_get_mb_weighting_prediction(cavs_decoder *p) +{ + bi_ctx_t * ctx = &p->cabac.mb_weighting_pred; + int ret = 0; + + ret = cavs_biari_decode_symbol (&p->cabac, ctx); + + return ret; +} +#endif +//////////////////////////////////////////////////////////////////////////////// + +cavs_decoder * cavs_frame_get (cavs_decoder ** list) +{ + cavs_decoder *frame = list[0]; + int i; + for (i = 0; list[i]; i++) + list[i] = list[i + 1]; + return frame; +} + + +int cavs_synch_frame_list_init( cavs_synch_frame_list_t *slist, int max_size ) +{ + if( max_size < 0 ) + return -1; + slist->i_max_size = max_size; + slist->i_size = 0; + CHECKED_MALLOCZERO( slist->list, (max_size+1) * sizeof(cavs_decoder *) ); + if( cavs_pthread_mutex_init( &slist->mutex, NULL ) || + cavs_pthread_cond_init( &slist->cv_fill, NULL ) || + cavs_pthread_cond_init( &slist->cv_empty, NULL ) ) + return -1; + return 0; +fail: + return -1; +} + +void cavs_synch_frame_list_delete( cavs_synch_frame_list_t *slist ) +{ + int i; + if (!slist) + return; + + cavs_pthread_mutex_destroy( &slist->mutex ); + cavs_pthread_cond_destroy( &slist->cv_fill ); + cavs_pthread_cond_destroy( &slist->cv_empty ); + + for (i = 0; i < slist->i_max_size; i++) + { + if (slist->list[i]) + cavs_decoder_destroy(slist->list[i]); + } + cavs_free(slist->list); +} + +void cavs_synch_frame_list_push( cavs_synch_frame_list_t *slist, cavs_decoder *frame ) +{ + cavs_pthread_mutex_lock( &slist->mutex ); + while( slist->i_size == slist->i_max_size ) + cavs_pthread_cond_wait( &slist->cv_empty, &slist->mutex ); + slist->list[ slist->i_size++ ] = frame; + cavs_pthread_mutex_unlock( &slist->mutex ); + cavs_pthread_cond_broadcast( &slist->cv_fill ); +} + +cavs_decoder *cavs_synch_frame_list_pop( cavs_synch_frame_list_t *slist ) +{ + cavs_decoder *frame; + cavs_pthread_mutex_lock( &slist->mutex ); + while( !slist->i_size ) + cavs_pthread_cond_wait( &slist->cv_fill, &slist->mutex ); + frame = slist->list[ --slist->i_size ]; + slist->list[ slist->i_size ] = NULL; + cavs_pthread_cond_broadcast( &slist->cv_empty ); + cavs_pthread_mutex_unlock( &slist->mutex ); + return frame; +} +//////////////////////////////////////////////////////////////////////////////// +#define AH -1 +#define BH -2 +#define CH 96 +#define DH 42 +#define EH -7 +#define FH 0 +#define AV 0 +#define BV -1 +#define CV 5 +#define DV 5 +#define EV -1 +#define FV 0 +#define MC_W 8 +#define MC_H 8 +/************************************************************************ +D a b c E +d e f g +h i j k m +n p q r +************************************************************************/ + +#define put(a, b) a = cm[((b)+512)>>10] + +static void cavs_put_filt8_hv_ik(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + + tmp = temp+2; + for(j=0;j>10] +static void cavs_put_filt8_hv_ki(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{//k + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp+2; + for(j=0;j>10] +static void cavs_put_filt8_hv_fq(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + //f=-xx-2aa'+96b'+42s'-7dd' + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp; + src1-=2*srcStride; + for(j=-2;j>10] +static void cavs_put_filt8_hv_qf(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + //q + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp; + src1-=2*srcStride; + for(j=-2;j>6] +static void cavs_put_filt8_hv_j(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + //j + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp+2; + for(j=0;j>7] +static void cavs_put_filt8_h_ac(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + //a + + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>7] +static void cavs_put_filt8_h_ca(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + //c + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>3] +static void cavs_put_filt8_h_b(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ //b -1 5 5 -1 + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>3] +static void cavs_put_filt8_v_h(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ //h + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>7] +static void cavs_put_filt8_v_dn(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{//d + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>7] +static void cavs_put_filt8_v_nd(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{//n + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>7] +static void cavs_put_filt8_hv_egpr(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{//e¡¢g¡¢p¡¢r + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp+2; + for(j=0;jj+D)/2 + + } + src2+=dstStride; + dst+=dstStride; + tmp+=13; + } +} +#undef put + +#define avg(a, b) a = ((a)+cm[((b)+512)>>10]+1)>>1 +static void cavs_avg_filt8_hv_ik(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp+2; + for(j=0;j>10]+1)>>1 +static void cavs_avg_filt8_hv_ki(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp+2; + for(j=0;j>10]+1)>>1 +static void cavs_avg_filt8_hv_fq(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + //f=-xx-2aa'+96b'+42s'-7dd' + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp; + src1-=2*srcStride; + for(j=-2;j>10]+1)>>1 +static void cavs_avg_filt8_hv_qf(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ + //f=-xx-2aa'+96b'+42s'-7dd' + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp; + src1-=2*srcStride; + for(j=-2;j>6] +1)>>1 +static void cavs_avg_filt8_hv_j(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ //j + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp+2; + for(j=0;j>7] +1)>>1 +static void cavs_avg_filt8_h_ac(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ //a + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>7] +1)>>1 +static void cavs_avg_filt8_h_ca(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ //c + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>3] +1)>>1 +static void cavs_avg_filt8_h_b(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ //b + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>3] +1)>>1 +static void cavs_avg_filt8_v_h(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ //h + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>7] +1)>>1 +static void cavs_avg_filt8_v_dn(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{//dst+src1:d + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>7] +1)>>1 +static void cavs_avg_filt8_v_nd(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{//n + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + for(j=0; j>7] +1)>>1 +static void cavs_avg_filt8_hv_egpr(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride) +{ //error + int32_t temp[8*(8+5)]; + int32_t *tmp = temp; + uint8_t *cm = crop_table + MAX_NEG_CROP; + int i,j; + tmp = temp+2; + for(j=0;j> 1); +} + +#define LD32(a) (*((uint32_t*)(a))) +#define PUT_PIX(OPNAME,OP) \ +static void OPNAME ## _pixels8_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\ + int i;\ + for(i=0; i> 1; + src += i_src; + dst += i_dst; + } +} + +static void pixel_avg_16x16_c( uint8_t *dst, int i_dst, uint8_t *src, int i_src ) +{ + pixel_avg_wxh( dst, i_dst, src, i_src, 16, 16 ); +} + +static void pixel_avg_8x8_c( uint8_t *dst, int i_dst, uint8_t *src, int i_src ) +{ + pixel_avg_wxh( dst, i_dst, src, i_src, 8, 8 ); +} + +static void pixel_avg_4x4_c( uint8_t *dst, int i_dst, uint8_t *src, int i_src ) +{ + pixel_avg_wxh( dst, i_dst, src, i_src, 4, 4 ); +} +#endif + +void init_crop_table() +{ + int i; + + for( i = 0; i < 256; i++ ) + { + crop_table[i + MAX_NEG_CROP] = i; + } + + memset(crop_table, 0, MAX_NEG_CROP*sizeof(uint8_t)); + memset(crop_table + MAX_NEG_CROP + 256, 255, MAX_NEG_CROP*sizeof(uint8_t)); +} + +void (*cavs_idct4_add)(uint8_t *dst, DCTELEM *block, int stride); +void (*cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride); + +void (*intra_pred_lum[8])(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top, uint8_t *p_left); +void (*intra_pred_lum_asm[8])(uint8_t *p_dest, uint8_t edge[33], int i_stride, uint8_t *p_top, uint8_t *p_left); + +void (*intra_pred_lum_4x4[20])(uint8_t * src, uint8_t edge[17], int i_stride); +void (*intra_pred_chroma[7])(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left); +void (*intra_pred_chroma_asm[7])(uint8_t *p_dest, int neighbor, int i_stride, uint8_t *p_top,uint8_t *p_left); + +static const uint8_t alpha_tab[64] = +{ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, + 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 18, 20, + 22, 24, 26, 28, 30, 33, 33, 35, 35, 36, 37, 37, 39, 39, 42, 44, + 46, 48, 50, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 +}; + +static const uint8_t beta_tab[64] = +{ + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, + 6, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 23, 24, 24, 25, 25, 26, 27 +}; +static const uint8_t tc_tab[64] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, + 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9 +}; + +static void cavs_filter_lv_c(cavs_decoder *p, uint8_t *d, int stride, int i_qp, + int bs1, int bs2) +{ + int i; + int alpha, beta, tc; + int index_a, index_b; + + index_a = cavs_clip(i_qp + p->ph.i_alpha_c_offset,0,63); + index_b = cavs_clip(i_qp + p->ph.i_beta_offset, 0,63); + alpha = alpha_tab[index_a]; + beta = beta_tab[index_b]; + tc = tc_tab[index_a]; + + if(bs1==2) + for(i=0;i<16;i++) + loop_filter_l2(d + i*stride,1,alpha,beta); + else + { + if(bs1) + for(i=0;i<8;i++) + loop_filter_l1(d + i*stride,1,alpha,beta,tc); + if (bs2) + for(i=8;i<16;i++) + loop_filter_l1(d + i*stride,1,alpha,beta,tc); + } +} + +static void cavs_filter_lh_c(cavs_decoder *p, uint8_t *d, int stride, int i_qp, + int bs1, int bs2) +{ + int i; + int alpha, beta, tc; + int index_a, index_b; + + index_a = cavs_clip(i_qp + p->ph.i_alpha_c_offset,0,63); + index_b = cavs_clip(i_qp + p->ph.i_beta_offset, 0,63); + alpha = alpha_tab[index_a]; + beta = beta_tab[index_b]; + tc = tc_tab[index_a]; + + if(bs1==2) + for(i=0;i<16;i++) + loop_filter_l2(d + i,stride,alpha,beta); + else { + if(bs1) + for(i=0;i<8;i++) + loop_filter_l1(d + i,stride,alpha,beta,tc); + if (bs2) + for(i=8;i<16;i++) + loop_filter_l1(d + i,stride,alpha,beta,tc); + } +} + +static void cavs_filter_cv_c(cavs_decoder *p, uint8_t *d, int stride, int i_qp, + int bs1, int bs2) +{ + int i; + int alpha, beta, tc; + int index_a, index_b; + + index_a = cavs_clip(i_qp + p->ph.i_alpha_c_offset,0,63); + index_b = cavs_clip(i_qp + p->ph.i_beta_offset, 0,63); + alpha = alpha_tab[index_a]; + beta = beta_tab[index_b]; + tc = tc_tab[index_a]; + + if(bs1==2) + for(i=0;i<8;i++) + loop_filter_c2(d + i*stride,1,alpha,beta); + else + { + if(bs1) + for(i=0;i<4;i++) + loop_filter_c1(d + i*stride,1,alpha,beta,tc); + if (bs2) + for(i=4;i<8;i++) + loop_filter_c1(d + i*stride,1,alpha,beta,tc); + } +} + +static void cavs_filter_ch_c(cavs_decoder *p, uint8_t *d, int stride, int i_qp, + int bs1, int bs2) +{ + int i; + int alpha, beta, tc; + int index_a, index_b; + + index_a = cavs_clip(i_qp + p->ph.i_alpha_c_offset,0,63); + index_b = cavs_clip(i_qp + p->ph.i_beta_offset, 0,63); + alpha = alpha_tab[index_a]; + beta = beta_tab[index_b]; + tc = tc_tab[index_a]; + + if(bs1==2) + for(i=0;i<8;i++) + loop_filter_c2(d + i,stride,alpha,beta); + else + { + if(bs1) + for(i=0;i<4;i++) + loop_filter_c1(d + i,stride,alpha,beta,tc); + if (bs2) + for(i=4;i<8;i++) + loop_filter_c1(d + i,stride,alpha,beta,tc); + } +} + +static inline int get_cbp_4x4(int i_cbp_code) +{ + static const uint8_t cbp_tab_4x4[16] = + { + 15,0,13,12,11,7,14,3,10,5,4,1,2,8,9,6 + }; + return cbp_tab_4x4[i_cbp_code]; +} + +#define UNDETAILED 0 +#define DETAILED 1 + +static const unsigned char WeightQuantModel[4][64]={ +// l a b c d h +// 0 1 2 3 4 5 + { + // Mode 0 + 0,0,0,4,4,4,5,5, + 0,0,3,3,3,3,5,5, + 0,3,2,2,1,1,5,5, + 4,3,2,2,1,5,5,5, + 4,3,1,1,5,5,5,5, + 4,3,1,5,5,5,5,5, + 5,5,5,5,5,5,5,5, + 5,5,5,5,5,5,5,5}, + { + // Mode 1 + 0,0,0,4,4,4,5,5, + 0,0,4,4,4,4,5,5, + 0,3,2,2,2,1,5,5, + 3,3,2,2,1,5,5,5, + 3,3,2,1,5,5,5,5, + 3,3,1,5,5,5,5,5, + 5,5,5,5,5,5,5,5, + 5,5,5,5,5,5,5,5}, + { + // Mode 2 + 0,0,0,4,4,3,5,5, + 0,0,4,4,3,2,5,5, + 0,4,4,3,2,1,5,5, + 4,4,3,2,1,5,5,5, + 4,3,2,1,5,5,5,5, + 3,2,1,5,5,5,5,5, + 5,5,5,5,5,5,5,5, + 5,5,5,5,5,5,5,5}, + { + // Mode 3 + 0,0,0,3,2,1,5,5, + 0,0,4,3,2,1,5,5, + 0,4,4,3,2,1,5,5, + 3,3,3,3,2,5,5,5, + 2,2,2,2,5,5,5,5, + 1,1,1,5,5,5,5,5, + 5,5,5,5,5,5,5,5, + 5,5,5,5,5,5,5,5} +}; + +short cavs_wq_param_default[2][6]= +{ + {135,143,143,160,160,213}, + {128, 98,106,116,116,128} +}; + +static void cavs_init_frame_quant_param( cavs_decoder *p ) +{ + int i, j, k; + + if( p->ph.weighting_quant_flag ) + p->b_weight_quant_enable = 1; + else + p->b_weight_quant_enable = 0; + + if( p->b_weight_quant_enable ) + { + p->UseDefaultScalingMatrixFlag[0] = p->UseDefaultScalingMatrixFlag[1] = 0; // use weighed scaling matrix + } + else + { + p->UseDefaultScalingMatrixFlag[0] = p->UseDefaultScalingMatrixFlag[1] = 1; // use default scaling matrix + } + + /* Patch the Weighting Parameters */ + if( !p->ph.mb_adapt_wq_disable ) //MBAWQ + { + // Use default weighted parameters, + for( i = 0; i < 2; i++ ) + for( j = 0; j < 6; j++ ) + p->wq_param[i][j] = cavs_wq_param_default[i][j]; + + if(p->ph.weighting_quant_param_index != 0 ) + { + if(p->ph.weighting_quant_param_index == 1 ) + { + for( i = 0; i < 6; i++) + p->wq_param[UNDETAILED][i] = p->ph.weighting_quant_param_undetail[i]; + } + else if( p->ph.weighting_quant_param_index == 2 ) + { + for( i = 0; i < 6; i++) + p->wq_param[DETAILED][i] = p->ph.weighting_quant_param_detail[i]; + } + else if( p->ph.weighting_quant_param_index == 3 ) + { + for( i = 0; i < 6; i++ ) + p->wq_param[UNDETAILED][i] = p->ph.weighting_quant_param_undetail[i]; + for(i=0;i<6;i++) + p->wq_param[DETAILED][i] = p->ph.weighting_quant_param_detail[i]; + } + } + } + else // PAWQ + { + for(i=0;i<2;i++) + for(j=0;j<6;j++) + p->wq_param[i][j]=128; + + if(p->ph.weighting_quant_param_index==0) + { + for(i=0;i<6;i++) + p->wq_param[DETAILED][i]=cavs_wq_param_default[DETAILED][i]; + } + else if(p->ph.weighting_quant_param_index==1) + { + for(i=0;i<6;i++) + p->wq_param[UNDETAILED][i] = p->ph.weighting_quant_param_undetail[i]; + } + if(p->ph.weighting_quant_param_index==2) + { + for(i=0;i<6;i++) + p->wq_param[DETAILED][i] = p->ph.weighting_quant_param_detail[i]; + } + + } + + for (i=0;i<64;i++) + p->cur_wq_matrix[i]=1<<7; + + /* Reconstruct the Weighting matrix */ + if( !p->b_weight_quant_enable ) + { + for(k=0;k<2;k++) + for(j=0;j<8;j++) + for (i=0;i<8;i++) + p->wq_matrix[k][j*8+i]=1<<7; + } + else + { + for(k=0;k<2;k++) + for(j=0;j<8;j++) + for(i=0;i<8;i++) + p->wq_matrix[k][j*8+i]=(p->wq_param[k][WeightQuantModel[p->ph.weighting_quant_model/*CurrentSceneModel*/][j*8+i]]); + } +} + +static void cavs_frame_update_wq_matrix( cavs_decoder *p ) +{ + int i; + + if( p->ph.weighting_quant_param_index == 0 ) + { + for( i = 0; i < 64; i++ ) + p->cur_wq_matrix[i] = p->wq_matrix[DETAILED][i]; // Detailed weighted matrix + } + else if( p->ph.weighting_quant_param_index == 1 ) + { + for( i = 0; i < 64; i++ ) + p->cur_wq_matrix[i] = p->wq_matrix[UNDETAILED][i]; // unDetailed weighted matrix + } + + if( p->ph.weighting_quant_param_index == 2 ) + { + for( i = 0; i < 64; i++ ) + p->cur_wq_matrix[i] = p->wq_matrix[DETAILED][i]; // Detailed weighted matrix + } +} + +static int cavs_free_resource(cavs_decoder *p) +{ + int i, i_edge; + + CAVS_SAFE_FREE(p->p_top_qp); + CAVS_SAFE_FREE(p->p_top_mv[0]); + CAVS_SAFE_FREE(p->p_top_mv[1]); + CAVS_SAFE_FREE(p->p_top_intra_pred_mode_y); + CAVS_SAFE_FREE(p->p_mb_type_top); + CAVS_SAFE_FREE(p->p_chroma_pred_mode_top); + CAVS_SAFE_FREE(p->p_cbp_top); + CAVS_SAFE_FREE(p->p_ref_top); + CAVS_SAFE_FREE(p->p_top_border_y); + CAVS_SAFE_FREE(p->p_top_border_cb); + CAVS_SAFE_FREE(p->p_top_border_cr); + CAVS_SAFE_FREE(p->p_col_mv); + CAVS_SAFE_FREE(p->p_col_type_base); + CAVS_SAFE_FREE(p->p_block); + + if( p->param.b_accelerate ) + { + CAVS_SAFE_FREE(p->level_buf_tab); + CAVS_SAFE_FREE(p->run_buf_tab); + CAVS_SAFE_FREE(p->num_buf_tab); + + CAVS_SAFE_FREE(p->i_mb_type_tab); + CAVS_SAFE_FREE(p->i_qp_tab); + CAVS_SAFE_FREE(p->i_cbp_tab); + CAVS_SAFE_FREE(p->mv_tab); + + CAVS_SAFE_FREE(p->i_intra_pred_mode_y_tab); + CAVS_SAFE_FREE(p->i_pred_mode_chroma_tab); + CAVS_SAFE_FREE(p->p_mvd_tab); + CAVS_SAFE_FREE(p->p_ref_tab); + +#if B_MB_WEIGHTING + CAVS_SAFE_FREE(p->weighting_prediction_tab); +#endif + } + + i_edge = (p->i_mb_width*CAVS_MB_SIZE + CAVS_EDGE*2)*2*17*2*2; + if(p->p_edge) + { + p->p_edge -= i_edge/2; + CAVS_SAFE_FREE(p->p_edge); + + } + + for( i = 0; i < 3; i++ ) + { + if(p->image[i].p_data[0]) + { + p->image[i].p_data[0]-=p->image[i].i_stride[0]*CAVS_EDGE+CAVS_EDGE; + CAVS_SAFE_FREE(p->image[i].p_data[0]); + } + + if(p->image[i].p_data[1]) + { + p->image[i].p_data[1]-=p->image[i].i_stride[1]*CAVS_EDGE/2+CAVS_EDGE/2; + CAVS_SAFE_FREE(p->image[i].p_data[1]); + } + + if(p->image[i].p_data[2]) + { + p->image[i].p_data[2]-=p->image[i].i_stride[2]*CAVS_EDGE/2+CAVS_EDGE/2; + CAVS_SAFE_FREE(p->image[i].p_data[2]); + } + + memset(&p->image[i], 0, sizeof(cavs_image)); + } + + for (i = 0; i < 3; i++) + { + if (p->image_aec[i].p_data[0]) + { + p->image_aec[i].p_data[0] -= p->image_aec[i].i_stride[0] * CAVS_EDGE + CAVS_EDGE; + CAVS_SAFE_FREE(p->image_aec[i].p_data[0]); + } + + if (p->image_aec[i].p_data[1]) + { + p->image_aec[i].p_data[1] -= p->image_aec[i].i_stride[1] * CAVS_EDGE / 2 + CAVS_EDGE / 2; + CAVS_SAFE_FREE(p->image_aec[i].p_data[1]); + } + + if (p->image_aec[i].p_data[2]) + { + p->image_aec[i].p_data[2] -= p->image_aec[i].i_stride[2] * CAVS_EDGE / 2 + CAVS_EDGE / 2; + CAVS_SAFE_FREE(p->image_aec[i].p_data[2]); + } + + memset(&p->image_aec[i], 0, sizeof(cavs_image)); + } + + return 0; +} + +static int cavs_alloc_resource( cavs_decoder *p ) +{ + uint32_t i; + uint32_t i_mb_width, i_mb_height, i_edge; + int b_interlaced = p->param.b_interlaced; + + i_mb_width = (p->vsh.i_horizontal_size+15)>>4; + if ( p->vsh.b_progressive_sequence ) + i_mb_height = (p->vsh.i_vertical_size+15)>>4; + else + i_mb_height = ((p->vsh.i_vertical_size+31) & 0xffffffe0)>>4; + + if( i_mb_width == p->i_mb_width && i_mb_height == p->i_mb_height && p->p_block ) /* when p_block is NULL, can't return directly */ + { + p->last_delayed_pframe = p->p_save[1]; /* for output delay frame */ + + return 0; + } + else + { + if(p->i_mb_width != 0 && p->i_mb_height != 0) // resolution change is not allowed. + { + memcpy(&p->vsh, &p->old, offsetof(cavs_video_sequence_header, b_flag_aec) - offsetof(cavs_video_sequence_header, i_profile_id)); /*NOTE : don't change aec flag and enable */ + if(p->p_block) + return -1; + } + else + { + memcpy(&p->old, &p->vsh, sizeof(cavs_video_sequence_header)); + } + + /* need this */ + i_mb_width = (p->vsh.i_horizontal_size+15)>>4; + if ( p->vsh.b_progressive_sequence ) + i_mb_height = (p->vsh.i_vertical_size+15)>>4; + else + i_mb_height = ((p->vsh.i_vertical_size+31) & 0xffffffe0)>>4; + } + + cavs_free_resource(p); + + p->i_mb_width = i_mb_width; + p->i_mb_height = i_mb_height; + p->i_mb_num = i_mb_width*i_mb_height; + p->i_mb_num_half = p->i_mb_num>>1; + p->p_top_qp = (uint8_t *)cavs_malloc( p->i_mb_width); + p->b_low_delay = p->vsh.b_low_delay; + + p->p_top_mv[0] = (cavs_vector *)cavs_malloc((p->i_mb_width*2+1)*sizeof(cavs_vector)); + p->p_top_mv[1] = (cavs_vector *)cavs_malloc((p->i_mb_width*2+1)*sizeof(cavs_vector)); + p->p_top_intra_pred_mode_y = (int *)cavs_malloc( p->i_mb_width*4*sizeof(*p->p_top_intra_pred_mode_y)); + p->p_mb_type_top = (int8_t *)cavs_malloc(p->i_mb_width*sizeof(int8_t)); + p->p_chroma_pred_mode_top = (int8_t *)cavs_malloc(p->i_mb_width*sizeof(int8_t)); + p->p_cbp_top = (int8_t *)cavs_malloc(p->i_mb_width*sizeof(int8_t)); + p->p_ref_top = (int8_t (*)[2][2])cavs_malloc(p->i_mb_width*2*2*sizeof(int8_t)); + p->p_top_border_y = (uint8_t *)cavs_malloc((p->i_mb_width+1)*CAVS_MB_SIZE); + p->p_top_border_cb = (uint8_t *)cavs_malloc((p->i_mb_width)*10); + p->p_top_border_cr = (uint8_t *)cavs_malloc((p->i_mb_width)*10); + + p->p_col_mv = (cavs_vector *)cavs_malloc( p->i_mb_width*(p->i_mb_height)*4*sizeof(cavs_vector)); + p->p_col_type_base = (uint8_t *)cavs_malloc(p->i_mb_width*(p->i_mb_height)); + p->p_block = (DCTELEM *)cavs_malloc(64*sizeof(DCTELEM)); + + if( p->param.b_accelerate ) + { + p->level_buf_tab = (int (*)[6][64])cavs_malloc(p->i_mb_num*6*64*sizeof(int)); + p->run_buf_tab = (int (*)[6][64])cavs_malloc(p->i_mb_num*6*64*sizeof(int)); + p->num_buf_tab = (int (*)[6])cavs_malloc(p->i_mb_num*6*sizeof(int)); + + p->i_mb_type_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); + p->i_qp_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); + p->i_cbp_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); + p->mv_tab = (cavs_vector (*)[24])cavs_malloc( p->i_mb_num*24*sizeof(cavs_vector)); + + p->i_intra_pred_mode_y_tab = (int (*)[25])cavs_malloc(p->i_mb_num*25*sizeof(int)); + p->i_pred_mode_chroma_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); + p->p_mvd_tab = (int16_t (*)[2][6][2])cavs_malloc(p->i_mb_num*2*6*2*sizeof(int16_t)); + p->p_ref_tab = (int8_t (*)[2][9])cavs_malloc(p->i_mb_num*2*9*sizeof(int8_t)); + +#if B_MB_WEIGHTING + p->weighting_prediction_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); +#endif + } + + i_edge = ( p->i_mb_width*CAVS_MB_SIZE + CAVS_EDGE*2 )*2*17*2*2; + p->p_edge = (uint8_t *)cavs_malloc(i_edge); + if( p->p_edge ) + { + memset(p->p_edge, 0, i_edge); + } + p->p_edge += i_edge/2; + + if( !p->p_top_qp ||!p->p_top_mv[0] ||!p->p_top_mv[1] + ||!p->p_top_intra_pred_mode_y ||!p->p_top_border_y ||!p->p_top_border_cb + ||!p->p_top_border_cr ||!p->p_col_mv ||!p->p_col_type_base + ||!p->p_block ||!p->p_edge ||!p->p_mb_type_top + ||!p->p_chroma_pred_mode_top ||!p->p_cbp_top ||!p->p_ref_top) + { + return -1; + } + + memset(p->p_block, 0, 64*sizeof(DCTELEM)); + + if( p->param.b_accelerate ) + { + for( i = 0; i < 3; i++ ) + { + p->image_aec[i].i_colorspace = CAVS_CS_YUV420; + p->image_aec[i].i_width = p->i_mb_width*CAVS_MB_SIZE; + p->image_aec[i].i_height = p->i_mb_height*CAVS_MB_SIZE; + + if( !b_interlaced ) + { + p->image_aec[i].i_stride[0] = p->image_aec[i].i_width + CAVS_EDGE*2; + p->image_aec[i].i_stride[1] = p->image_aec[i].i_width/2 + CAVS_EDGE; + p->image_aec[i].i_stride[2] = p->image_aec[i].i_width/2 + CAVS_EDGE; + + p->image_aec[i].p_data[0] = (uint8_t *)cavs_malloc(p->image_aec[i].i_stride[0]*(p->image_aec[i].i_height+CAVS_EDGE*2)); + p->image_aec[i].p_data[0] += p->image_aec[i].i_stride[0]*CAVS_EDGE + CAVS_EDGE; + + p->image_aec[i].p_data[1] = (uint8_t *)cavs_malloc(p->image_aec[i].i_stride[1]*(p->image_aec[i].i_height/2+CAVS_EDGE)); + p->image_aec[i].p_data[1] += p->image_aec[i].i_stride[1]*CAVS_EDGE/2 + CAVS_EDGE/2; + + p->image_aec[i].p_data[2] = (uint8_t *)cavs_malloc(p->image_aec[i].i_stride[2]*(p->image_aec[i].i_height/2+CAVS_EDGE)); + p->image_aec[i].p_data[2] += p->image_aec[i].i_stride[2]*CAVS_EDGE/2 + CAVS_EDGE/2; + } + else + { + p->image_aec[i].i_stride[0] = (p->image_aec[i].i_width + CAVS_EDGE*2)<image_aec[i].i_stride[1] = (p->image_aec[i].i_width/2 + CAVS_EDGE)<image_aec[i].i_stride[2] = (p->image_aec[i].i_width/2 + CAVS_EDGE)<image_aec[i].p_data[0] = (uint8_t *)cavs_malloc( (p->image_aec[i].i_stride[0]>>b_interlaced)*(p->image_aec[i].i_height+((CAVS_EDGE*2)<image_aec[i].p_data[0] += p->image_aec[i].i_stride[0]*CAVS_EDGE + CAVS_EDGE; + + /*U*/ + p->image_aec[i].p_data[1] = (uint8_t *)cavs_malloc( (p->image_aec[i].i_stride[1]>>b_interlaced)*(p->image_aec[i].i_height/2+(CAVS_EDGE<image_aec[i].p_data[1] += (p->image_aec[i].i_stride[1]*CAVS_EDGE/2) + CAVS_EDGE/2; + + /*V*/ + p->image_aec[i].p_data[2] = (uint8_t *)cavs_malloc( (p->image_aec[i].i_stride[2]>>b_interlaced)*(p->image_aec[i].i_height/2+(CAVS_EDGE<image_aec[i].p_data[2] += (p->image_aec[i].i_stride[2]*CAVS_EDGE/2) + CAVS_EDGE/2; + } + + if( !p->image_aec[i].p_data[0] || !p->image_aec[i].p_data[1] || !p->image_aec[i].p_data[2] ) + { + return -1; + } + } + + p->p_save_aec[0] = &p->image_aec[0]; + } + + for( i = 0; i < 3; i++ ) + { + p->image[i].i_colorspace = CAVS_CS_YUV420; + p->image[i].i_width = p->i_mb_width*CAVS_MB_SIZE; + p->image[i].i_height = p->i_mb_height*CAVS_MB_SIZE; + + if( !b_interlaced ) + { + p->image[i].i_stride[0] = p->image[i].i_width + CAVS_EDGE*2; + p->image[i].i_stride[1] = p->image[i].i_width/2 + CAVS_EDGE; + p->image[i].i_stride[2] = p->image[i].i_width/2 + CAVS_EDGE; + + p->image[i].p_data[0] = (uint8_t *)cavs_malloc(p->image[i].i_stride[0]*(p->image[i].i_height+CAVS_EDGE*2)); + p->image[i].p_data[0] += p->image[i].i_stride[0]*CAVS_EDGE + CAVS_EDGE; + + p->image[i].p_data[1] = (uint8_t *)cavs_malloc(p->image[i].i_stride[1]*(p->image[i].i_height/2+CAVS_EDGE)); + p->image[i].p_data[1] += p->image[i].i_stride[1]*CAVS_EDGE/2 + CAVS_EDGE/2; + + p->image[i].p_data[2] = (uint8_t *)cavs_malloc(p->image[i].i_stride[2]*(p->image[i].i_height/2+CAVS_EDGE)); + p->image[i].p_data[2] += p->image[i].i_stride[2]*CAVS_EDGE/2 + CAVS_EDGE/2; + } + else + { + p->image[i].i_stride[0] = (p->image[i].i_width + CAVS_EDGE*2)<image[i].i_stride[1] = (p->image[i].i_width/2 + CAVS_EDGE)<image[i].i_stride[2] = (p->image[i].i_width/2 + CAVS_EDGE)<image[i].p_data[0] = (uint8_t *)cavs_malloc( (p->image[i].i_stride[0]>>b_interlaced)*(p->image[i].i_height+((CAVS_EDGE*2)<image[i].p_data[0] += p->image[i].i_stride[0]*CAVS_EDGE + CAVS_EDGE; + + /*U*/ + p->image[i].p_data[1] = (uint8_t *)cavs_malloc( (p->image[i].i_stride[1]>>b_interlaced)*(p->image[i].i_height/2+(CAVS_EDGE<image[i].p_data[1] += (p->image[i].i_stride[1]*CAVS_EDGE/2) + CAVS_EDGE/2; + + /*V*/ + p->image[i].p_data[2] = (uint8_t *)cavs_malloc( (p->image[i].i_stride[2]>>b_interlaced)*(p->image[i].i_height/2+(CAVS_EDGE<image[i].p_data[2] += (p->image[i].i_stride[2]*CAVS_EDGE/2) + CAVS_EDGE/2; + } + + if( !p->image[i].p_data[0] || !p->image[i].p_data[1] || !p->image[i].p_data[2] ) + { + return -1; + } + } + + p->p_save[0] = &p->image[0]; + + + /* + 0: D3 B2 B3 C2 + 4: A1 X0 X1 - + 8: A3 X2 X3 - + */ + p->mv[ 7] = MV_NOT_AVAIL; + p->mv[19] = MV_NOT_AVAIL; + + if( p->param.b_accelerate ) + { + for( i = 0;i < p->i_mb_num; i++) + { + p->mv_tab[i][ 7] = MV_NOT_AVAIL; + p->mv_tab[i][19] = MV_NOT_AVAIL; + } + } + +#if B_MB_WEIGHTING + /*creat a temp buffer for weighting prediction */ + if( !b_interlaced ) + { + p->mb_line_buffer[0] = (uint8_t *)cavs_malloc(p->image[0].i_stride[0]*(p->image[0].i_height+CAVS_EDGE*2)); + p->mb_line_buffer[0] += p->image[0].i_stride[0]*CAVS_EDGE + CAVS_EDGE; + + p->mb_line_buffer[1] = (uint8_t *)cavs_malloc(p->image[0].i_stride[1]*(p->image[0].i_height/2+CAVS_EDGE)); + p->mb_line_buffer[1] += p->image[0].i_stride[1]*CAVS_EDGE/2 + CAVS_EDGE/2; + + p->mb_line_buffer[2] = (uint8_t *)cavs_malloc(p->image[0].i_stride[2]*(p->image[0].i_height/2+CAVS_EDGE)); + p->mb_line_buffer[2] += p->image[0].i_stride[2]*CAVS_EDGE/2 + CAVS_EDGE/2; + } + else + { + /*Y*/ + p->mb_line_buffer[0] = (uint8_t *)cavs_malloc( (p->image[0].i_stride[0]>>b_interlaced)*(p->image[0].i_height+((CAVS_EDGE*2)<mb_line_buffer[0] += p->image[0].i_stride[0]*CAVS_EDGE + CAVS_EDGE; + + /*U*/ + p->mb_line_buffer[1] = (uint8_t *)cavs_malloc( (p->image[0].i_stride[1]>>b_interlaced)*(p->image[0].i_height/2+(CAVS_EDGE<mb_line_buffer[1] += (p->image[0].i_stride[1]*CAVS_EDGE/2) + CAVS_EDGE/2; + + /*V*/ + p->mb_line_buffer[2] = (uint8_t *)cavs_malloc( (p->image[0].i_stride[2]>>b_interlaced)*(p->image[0].i_height/2+(CAVS_EDGE<mb_line_buffer[2] += (p->image[0].i_stride[2]*CAVS_EDGE/2) + CAVS_EDGE/2; + } +#endif + + /* use to reset for different seq header */ + cavs_decoder_reset(p); + + return 0; +} + + +static void copy_mvs(cavs_vector *mv, enum cavs_block_size size) +{ + switch(size) + { + case BLK_16X16: + mv[MV_STRIDE ] = mv[0]; + mv[MV_STRIDE+1] = mv[0]; + case BLK_16X8: + mv[1] = mv[0]; + break; + case BLK_8X16: + mv[MV_STRIDE] = mv[0]; + break; + default: + break; + } +} + +static void cavs_image_frame_to_field(cavs_image *p_dst, cavs_image *p_src, uint32_t b_bottom, uint32_t b_next_field) +{ + memcpy(p_dst, p_src, sizeof(cavs_image)); + if( b_bottom ) + { + p_dst->p_data[0] += (p_dst->i_stride[0]>>1); + p_dst->p_data[1] += (p_dst->i_stride[1]>>1); + p_dst->p_data[2] += (p_dst->i_stride[2]>>1); + } + + p_dst->i_distance_index = p_src->i_distance_index + b_next_field; +} + +static void init_ref_list_for_aec(cavs_decoder *p,uint32_t b_next_field) +{ + int i; + uint32_t b_top_field_first = p->ph.b_top_field_first; + uint32_t b_bottom = (b_top_field_first && b_next_field) || ( !b_top_field_first && !b_next_field); + + for( i = 0; i < 4; i++ ) + { + p->i_ref_distance[0] = 0; + memset(&p->ref_aec[i], 0, sizeof(cavs_image)); + } + + p->p_save_aec[0]->b_picture_structure = p->ph.b_picture_structure; + if(p->p_save_aec[1]) + { + p->p_save_aec[0]->i_ref_distance[0] = p->p_save_aec[1]->i_distance_index; + } + if(p->p_save_aec[2]) + { + p->p_save_aec[0]->i_ref_distance[1] = p->p_save_aec[2]->i_distance_index; + } + + if(p->ph.b_picture_structure != 0) /* frame */ + { + /* NOTE : use p->p_save[0] to init p->cur, especially, point to image memory */ + memcpy(&p->cur_aec, p->p_save_aec[0], sizeof(cavs_image)); + + if( p->p_save_aec[1] ) + { + memcpy(&p->ref_aec[0], p->p_save_aec[1], sizeof(cavs_image)); + } + + if( p->p_save_aec[2] ) + { + memcpy(&p->ref_aec[1], p->p_save_aec[2], sizeof(cavs_image)); + } + + if( p->ref_aec[0].p_data[0] ) + { + p->i_ref_distance[0] = p->ph.i_picture_coding_type !=CAVS_B_PICTURE + ?(p->cur_aec.i_distance_index - p->ref_aec[0].i_distance_index + 512) % 512 + :(p->ref_aec[0].i_distance_index - p->cur_aec.i_distance_index + 512) % 512; + } + + if( p->ref_aec[1].p_data[0] ) + p->i_ref_distance[1] = (p->cur_aec.i_distance_index - p->ref_aec[1].i_distance_index + 512) % 512; + } + else /* field */ + { + /* init p_cur */ + cavs_image_frame_to_field(&p->cur_aec, p->p_save_aec[0], b_bottom, b_next_field); + if( p->cur_aec.i_code_type == CAVS_I_PICTURE && b_next_field ) + { + cavs_image_frame_to_field(&p->ref_aec[0], p->p_save_aec[0], !b_bottom, 0); + } + else if( p->cur_aec.i_code_type == CAVS_P_PICTURE && p->p_save_aec[1] ) + { + /* for P frame */ + if(b_next_field) + { + cavs_image_frame_to_field( &p->ref_aec[0], p->p_save_aec[0], !b_bottom, 0); + cavs_image_frame_to_field( &p->ref_aec[1], p->p_save_aec[1], p->p_save_aec[1]->b_top_field_first, 1); + cavs_image_frame_to_field(&p->ref_aec[2], p->p_save_aec[1], !p->p_save_aec[1]->b_top_field_first, 0); + + if(p->p_save_aec[2]) + { + cavs_image_frame_to_field( &p->ref_aec[3], p->p_save_aec[2],p->p_save_aec[2]->b_top_field_first, 1); + } + } + else + { + cavs_image_frame_to_field( &p->ref_aec[0], p->p_save_aec[1], p->p_save_aec[1]->b_top_field_first, 1); + cavs_image_frame_to_field( &p->ref_aec[1], p->p_save_aec[1], !p->p_save_aec[1]->b_top_field_first, 0); + if(p->p_save_aec[2]) + { + cavs_image_frame_to_field( &p->ref_aec[2], p->p_save_aec[2],p->p_save_aec[2]->b_top_field_first, 1); + cavs_image_frame_to_field( &p->ref_aec[3], p->p_save_aec[2], !p->p_save_aec[2]->b_top_field_first, 0); + } + } + } + else if(p->cur_aec.i_code_type == CAVS_B_PICTURE && p->p_save_aec[2] && p->p_save_aec[1]) + { + cavs_image_frame_to_field( &p->ref_aec[0], p->p_save_aec[1], !p->p_save_aec[1]->b_top_field_first, 0); + cavs_image_frame_to_field( &p->ref_aec[1], p->p_save_aec[1], p->p_save_aec[1]->b_top_field_first, 1); + + cavs_image_frame_to_field( &p->ref_aec[2], p->p_save_aec[2], p->p_save_aec[2]->b_top_field_first, 1); + cavs_image_frame_to_field( &p->ref_aec[3], p->p_save_aec[2], !p->p_save_aec[2]->b_top_field_first, 0); + } + for( i = 0; i < 2; i++ ) + { + if(p->ref_aec[i].p_data[0]) + { + p->i_ref_distance[i] = p->ph.i_picture_coding_type != CAVS_B_PICTURE + ?(p->cur_aec.i_distance_index - p->ref_aec[i].i_distance_index + 512) % 512 + :(p->ref_aec[i].i_distance_index - p->cur_aec.i_distance_index + 512) % 512; + } + } + for( i = 0; i < 2; i++) + { + if(p->ref_aec[2+i].p_data[0]) + { + p->i_ref_distance[2+i] = (p->cur_aec.i_distance_index - p->ref_aec[2+i].i_distance_index + 512) % 512; + } + } + } + + for( i = 0; i < 4; i++) + { + p->i_scale_den[i] = p->i_ref_distance[i] ? 512/p->i_ref_distance[i] : 0; + if(p->ph.i_picture_coding_type != CAVS_B_PICTURE) + p->i_direct_den[i] = p->i_ref_distance[i] ? 16384/p->i_ref_distance[i] : 0; + } + + if( p->ph.i_picture_coding_type == CAVS_B_PICTURE) + { + p->i_sym_factor = p->i_ref_distance[0]*p->i_scale_den[1]; + } +} + +static void init_ref_list(cavs_decoder *p,uint32_t b_next_field) +{ + int i; + uint32_t b_top_field_first = p->ph.b_top_field_first; + uint32_t b_bottom = (b_top_field_first && b_next_field) || ( !b_top_field_first && !b_next_field); + + for( i = 0; i < 4; i++ ) + { + p->i_ref_distance[0] = 0; + memset(&p->ref[i], 0, sizeof(cavs_image)); + } + + p->p_save[0]->b_picture_structure = p->ph.b_picture_structure; + if(p->p_save[1]) + { + p->p_save[0]->i_ref_distance[0] = p->p_save[1]->i_distance_index; + } + if(p->p_save[2]) + { + p->p_save[0]->i_ref_distance[1] = p->p_save[2]->i_distance_index; + } + + if(p->ph.b_picture_structure != 0) /* frame */ + { + /* NOTE : use p->p_save[0] to init p->cur, especially, point to image memory */ + memcpy(&p->cur, p->p_save[0], sizeof(cavs_image)); + + if( p->p_save[1] ) + { + memcpy(&p->ref[0], p->p_save[1], sizeof(cavs_image)); + } + + if( p->p_save[2] ) + { + memcpy(&p->ref[1], p->p_save[2], sizeof(cavs_image)); + } + + if( p->ref[0].p_data[0] ) + { + p->i_ref_distance[0] = p->ph.i_picture_coding_type !=CAVS_B_PICTURE + ?(p->cur.i_distance_index - p->ref[0].i_distance_index + 512) % 512 + :(p->ref[0].i_distance_index - p->cur.i_distance_index + 512) % 512; + } + + if( p->ref[1].p_data[0] ) + p->i_ref_distance[1] = (p->cur.i_distance_index - p->ref[1].i_distance_index + 512) % 512; + } + else /* field */ + { + /* init p_cur */ + cavs_image_frame_to_field(&p->cur, p->p_save[0], b_bottom, b_next_field); + if( p->cur.i_code_type == CAVS_I_PICTURE && b_next_field ) + { + cavs_image_frame_to_field(&p->ref[0], p->p_save[0], !b_bottom, 0); + } + else if( p->cur.i_code_type == CAVS_P_PICTURE && p->p_save[1] ) + { + /* for P frame */ + if(b_next_field) + { + cavs_image_frame_to_field( &p->ref[0], p->p_save[0], !b_bottom, 0); + cavs_image_frame_to_field( &p->ref[1], p->p_save[1], p->p_save[1]->b_top_field_first, 1); + cavs_image_frame_to_field(&p->ref[2], p->p_save[1], !p->p_save[1]->b_top_field_first, 0); + if(p->p_save[2]) + { + cavs_image_frame_to_field( &p->ref[3], p->p_save[2],p->p_save[2]->b_top_field_first, 1); + } + } + else + { + cavs_image_frame_to_field( &p->ref[0], p->p_save[1], p->p_save[1]->b_top_field_first, 1); + cavs_image_frame_to_field( &p->ref[1], p->p_save[1], !p->p_save[1]->b_top_field_first, 0); + if(p->p_save[2]) + { + cavs_image_frame_to_field( &p->ref[2], p->p_save[2],p->p_save[2]->b_top_field_first, 1); + cavs_image_frame_to_field( &p->ref[3], p->p_save[2], !p->p_save[2]->b_top_field_first, 0); + } + } + } + else if(p->cur.i_code_type == CAVS_B_PICTURE && p->p_save[2] && p->p_save[1]) + { + cavs_image_frame_to_field( &p->ref[0], p->p_save[1], !p->p_save[1]->b_top_field_first, 0); + cavs_image_frame_to_field( &p->ref[1], p->p_save[1], p->p_save[1]->b_top_field_first, 1); + + cavs_image_frame_to_field( &p->ref[2], p->p_save[2], p->p_save[2]->b_top_field_first, 1); + cavs_image_frame_to_field( &p->ref[3], p->p_save[2], !p->p_save[2]->b_top_field_first, 0); + } + for( i = 0; i < 2; i++ ) + { + if(p->ref[i].p_data[0]) + { + p->i_ref_distance[i] = p->ph.i_picture_coding_type != CAVS_B_PICTURE + ?(p->cur.i_distance_index - p->ref[i].i_distance_index + 512) % 512 + :(p->ref[i].i_distance_index - p->cur.i_distance_index + 512) % 512; + } + } + for( i = 0; i < 2; i++) + { + if(p->ref[2+i].p_data[0]) + { + p->i_ref_distance[2+i] = (p->cur.i_distance_index - p->ref[2+i].i_distance_index + 512) % 512; + } + } + } + + for( i = 0; i < 4; i++) + { + p->i_scale_den[i] = p->i_ref_distance[i] ? 512/p->i_ref_distance[i] : 0; + if(p->ph.i_picture_coding_type != CAVS_B_PICTURE) + p->i_direct_den[i] = p->i_ref_distance[i] ? 16384/p->i_ref_distance[i] : 0; + } + + if( p->ph.i_picture_coding_type == CAVS_B_PICTURE) + { + p->i_sym_factor = p->i_ref_distance[0]*p->i_scale_den[1]; + } + p->i_luma_offset[0] = 0; + p->i_luma_offset[1] = 8; + p->i_luma_offset[2] = 8*p->cur.i_stride[0]; + p->i_luma_offset[3] = p->i_luma_offset[2]+8; +} + +static int cavs_init_picture(cavs_decoder *p) +{ + int i; + //int b_interlaced = p->param.b_interlaced; + int b_bottom = p->b_bottom; + + for( i = 0; i <= 20; i += 4 ) + p->mv[i] = MV_NOT_AVAIL; + p->mv[MV_FWD_X0]=p->mv[MV_BWD_X0] = MV_REF_DIR; + copy_mvs(&p->mv[MV_BWD_X0], BLK_16X16); + copy_mvs(&p->mv[MV_FWD_X0], BLK_16X16); + + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + + p->i_mb_x = p->i_mb_y = 0; + p->i_mb_flags = 0; + p->i_mb_index = 0; + + p->p_save[0]->i_distance_index = p->ph.i_picture_distance*2; + p->p_save[0]->b_top_field_first = p->ph.b_top_field_first; + p->p_save[0]->i_code_type = p->ph.i_picture_coding_type; + + init_ref_list(p, b_bottom); + + p->b_fixed_qp = p->ph.b_fixed_picture_qp; + p->i_qp = p->ph.i_picture_qp; + + if (p->ph.asi_enable) + { + p->i_subpel_precision = 3; + p->i_uint_length = 8; + } + else + { + p->i_subpel_precision = 2; + p->i_uint_length = 4; + } + + if (p->ph.b_aec_enable) + { + p->bs_read[SYNTAX_SKIP_RUN] = cavs_cabac_get_skip; + p->bs_read[SYNTAX_MBTYPE_P] = cavs_cabac_get_mb_type_p; + p->bs_read[SYNTAX_MBTYPE_B] = cavs_cabac_get_mb_type_b; + p->bs_read[SYNTAX_INTRA_LUMA_PRED_MODE] = cavs_cabac_get_intra_luma_pred_mode; + p->bs_read[SYNTAX_INTRA_CHROMA_PRED_MODE] = cavs_cabac_get_intra_chroma_pred_mode; + p->bs_read[SYNTAX_INTRA_CBP] = cavs_cabac_get_cbp; + p->bs_read[SYNTAX_INTER_CBP] = cavs_cabac_get_cbp; + p->bs_read[SYNTAX_DQP] = cavs_cabac_get_dqp; + p->bs_read[SYNTAX_MB_PART_TYPE] = cavs_cabac_get_mb_part_type; + p->bs_read_mvd = cavs_cabac_get_mvd; + p->bs_read_ref_p = cavs_cabac_get_ref_p; + p->bs_read_ref_b = cavs_cabac_get_ref_b; + p->bs_read_coeffs = cavs_cabac_get_coeffs; + } + else + { + p->bs_read[SYNTAX_SKIP_RUN] = cavs_cavlc_get_ue; + p->bs_read[SYNTAX_MBTYPE_P] = cavs_cavlc_get_mb_type_p; + p->bs_read[SYNTAX_MBTYPE_B] = cavs_cavlc_get_mb_type_b; + p->bs_read[SYNTAX_INTRA_LUMA_PRED_MODE] = cavs_cavlc_get_intra_luma_pred_mode; + p->bs_read[SYNTAX_INTRA_CHROMA_PRED_MODE] = cavs_cavlc_get_ue; + p->bs_read[SYNTAX_INTRA_CBP] = cavs_cavlc_get_intra_cbp; + p->bs_read[SYNTAX_INTER_CBP] = cavs_cavlc_get_inter_cbp; + p->bs_read[SYNTAX_DQP] = cavs_cavlc_get_se; + p->bs_read[SYNTAX_MB_PART_TYPE] = cavs_cavlc_get_mb_part_type; + p->bs_read_mvd = cavs_cavlc_get_mvd; + p->bs_read_ref_p = cavs_cavlc_get_ref_p; + p->bs_read_ref_b = cavs_cavlc_get_ref_b; + p->bs_read_coeffs = cavs_cavlc_get_coeffs; + } + + return 0; +} + +static int cavs_init_picture_context( cavs_decoder *p ) +{ + int i; + int b_interlaced = p->param.b_interlaced; + int b_bottom = p->b_bottom; + + uint32_t k; + + for( k = (b_interlaced && b_bottom) ? p->i_mb_num_half : 0 ; k < p->i_mb_num; k++ ) /*when field, only init bottom.top has occupied by data yet*/ + { + for( i = 0; i <= 20; i += 4 ) + p->mv_tab[k][i] = MV_NOT_AVAIL; + p->mv_tab[k][MV_FWD_X0]=p->mv_tab[k][MV_BWD_X0] = MV_REF_DIR; + copy_mvs(&p->mv_tab[k][MV_BWD_X0], BLK_16X16); + copy_mvs(&p->mv_tab[k][MV_FWD_X0], BLK_16X16); + + p->i_intra_pred_mode_y_tab[k][5] = p->i_intra_pred_mode_y_tab[k][10] = + p->i_intra_pred_mode_y_tab[k][15] = p->i_intra_pred_mode_y_tab[k][20] = NOT_AVAIL; + } + + for( i = 0; i <= 20; i += 4 ) + p->mv[i] = MV_NOT_AVAIL; + p->mv[MV_FWD_X0]=p->mv[MV_BWD_X0] = MV_REF_DIR; + copy_mvs(&p->mv[MV_BWD_X0], BLK_16X16); + copy_mvs(&p->mv[MV_FWD_X0], BLK_16X16); + + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + + + + p->i_mb_x = p->i_mb_y = 0; + p->i_mb_flags = 0; + p->i_mb_index = 0; + + if( p->p_save_aec[0] == NULL ) + return CAVS_ERROR; + p->p_save_aec[0]->i_distance_index = p->ph.i_picture_distance*2; + p->p_save_aec[0]->b_top_field_first = p->ph.b_top_field_first; + p->p_save_aec[0]->i_code_type = p->ph.i_picture_coding_type; + + p->b_fixed_qp = p->ph.b_fixed_picture_qp; + p->i_qp = p->ph.i_picture_qp; + + if (p->ph.asi_enable) + { + p->i_subpel_precision = 3; + p->i_uint_length = 8; + } + else + { + p->i_subpel_precision = 2; + p->i_uint_length = 4; + } + + if (p->ph.b_aec_enable) + { + p->bs_read[SYNTAX_SKIP_RUN] = cavs_cabac_get_skip; + p->bs_read[SYNTAX_MBTYPE_P] = cavs_cabac_get_mb_type_p; + p->bs_read[SYNTAX_MBTYPE_B] = cavs_cabac_get_mb_type_b; + p->bs_read[SYNTAX_INTRA_LUMA_PRED_MODE] = cavs_cabac_get_intra_luma_pred_mode; + p->bs_read[SYNTAX_INTRA_CHROMA_PRED_MODE] = cavs_cabac_get_intra_chroma_pred_mode; + p->bs_read[SYNTAX_INTRA_CBP] = cavs_cabac_get_cbp; + p->bs_read[SYNTAX_INTER_CBP] = cavs_cabac_get_cbp; + p->bs_read[SYNTAX_DQP] = cavs_cabac_get_dqp; + p->bs_read[SYNTAX_MB_PART_TYPE] = cavs_cabac_get_mb_part_type; + p->bs_read_mvd = cavs_cabac_get_mvd; + p->bs_read_ref_p = cavs_cabac_get_ref_p; + p->bs_read_ref_b = cavs_cabac_get_ref_b; + p->bs_read_coeffs = cavs_cabac_get_coeffs; + } + else + { + p->bs_read[SYNTAX_SKIP_RUN] = cavs_cavlc_get_ue; + p->bs_read[SYNTAX_MBTYPE_P] = cavs_cavlc_get_mb_type_p; + p->bs_read[SYNTAX_MBTYPE_B] = cavs_cavlc_get_mb_type_b; + p->bs_read[SYNTAX_INTRA_LUMA_PRED_MODE] = cavs_cavlc_get_intra_luma_pred_mode; + p->bs_read[SYNTAX_INTRA_CHROMA_PRED_MODE] = cavs_cavlc_get_ue; + p->bs_read[SYNTAX_INTRA_CBP] = cavs_cavlc_get_intra_cbp; + p->bs_read[SYNTAX_INTER_CBP] = cavs_cavlc_get_inter_cbp; + p->bs_read[SYNTAX_DQP] = cavs_cavlc_get_se; + p->bs_read[SYNTAX_MB_PART_TYPE] = cavs_cavlc_get_mb_part_type; + p->bs_read_mvd = cavs_cavlc_get_mvd; + p->bs_read_ref_p = cavs_cavlc_get_ref_p; + p->bs_read_ref_b = cavs_cavlc_get_ref_b; + p->bs_read_coeffs = cavs_cavlc_get_coeffs; + } + + return 0; +} + +static int cavs_init_picture_context_frame( cavs_decoder *p ) +{ + p->p_save[0]->i_distance_index = p->ph.i_picture_distance*2; + p->p_save[0]->b_top_field_first = p->ph.b_top_field_first; + p->p_save[0]->i_code_type = p->ph.i_picture_coding_type; + p->i_mb_x = p->i_mb_y = 0; + p->i_mb_flags = 0; + p->i_mb_index = 0; + + return 0; +} + +static int cavs_init_picture_context_fld( cavs_decoder *p ) +{ + p->p_save[0]->i_distance_index = p->ph.i_picture_distance*2; + p->p_save[0]->b_top_field_first = p->ph.b_top_field_first; + p->p_save[0]->i_code_type = p->ph.i_picture_coding_type; + p->i_mb_x = p->i_mb_y = 0; + p->i_mb_flags = 0; + p->i_mb_index = 0; + + return 0; +} + +static int cavs_init_picture_ref_list( cavs_decoder *p ) +{ + int b_bottom = p->b_bottom; + + init_ref_list(p, b_bottom); + + return 0; +} + +static int cavs_init_picture_ref_list_for_aec( cavs_decoder *p ) +{ + //int b_interlaced = p->param.b_interlaced; + int b_bottom = p->b_bottom; + + init_ref_list_for_aec(p, b_bottom); + + return 0; +} + + +static int cavs_init_slice(cavs_decoder *p) +{ + int i_y; + + p->i_mb_offset = ( !p->ph.b_picture_structure && p->i_mb_index >= p->i_mb_num_half ) ? (p->i_mb_height>>1) : 0; + i_y = p->i_mb_y - p->i_mb_offset; + if( p->i_mb_offset ) + { + init_ref_list(p, 1); /* init ref list of bottom-field */ + } + + memset( p->p_top_intra_pred_mode_y, NOT_AVAIL, p->i_mb_width*4*sizeof(*p->p_top_intra_pred_mode_y) ); + p->p_y = p->cur.p_data[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_cb = p->cur.p_data[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_cr = p->cur.p_data[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; + +#if B_MB_WEIGHTING + p->p_back_y = p->mb_line_buffer[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_back_cb = p->mb_line_buffer[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_back_cr = p->mb_line_buffer[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; +#endif + + p->i_mb_flags = 0; + p->i_mb_x = 0; + p->b_first_line = 1; + p->b_error_flag = 0; +#if B_MB_WEIGHTING + p->weighting_prediction = 0; +#endif + + if (p->ph.b_aec_enable) + { + cavs_bitstream_align(&p->s); + cavs_cabac_context_init(p); + cavs_cabac_start_decoding(&p->cabac, &p->s); + + /*syntax context init*/ + memset(p->p_mb_type_top, NOT_AVAIL, p->i_mb_width*sizeof(int8_t)); + memset(p->p_chroma_pred_mode_top, 0, p->i_mb_width*sizeof(int8_t)); + memset(p->p_cbp_top, -1, p->i_mb_width*sizeof(int8_t)); + memset(p->p_ref_top, NOT_AVAIL, p->i_mb_width*2*2*sizeof(int8_t)); + p->i_last_dqp = 0; + p->i_mb_type_left = -1; + } + + return 0; +} + +static int cavs_init_slice_for_aec(cavs_decoder *p) +{ + int i_y; + + p->i_mb_offset = ( !p->ph.b_picture_structure && p->i_mb_index >= p->i_mb_num_half ) ? (p->i_mb_height>>1) : 0; + i_y = p->i_mb_y - p->i_mb_offset; + + memset( p->p_top_intra_pred_mode_y, NOT_AVAIL, p->i_mb_width*4*sizeof(*p->p_top_intra_pred_mode_y) ); + p->p_y = p->cur.p_data[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_cb = p->cur.p_data[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_cr = p->cur.p_data[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; + +#if B_MB_WEIGHTING + p->p_back_y = p->mb_line_buffer[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_back_cb = p->mb_line_buffer[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_back_cr = p->mb_line_buffer[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; +#endif + + p->i_mb_flags = 0; + p->i_mb_x = 0; + p->b_first_line = 1; + p->b_error_flag = 0; +#if B_MB_WEIGHTING + p->weighting_prediction = 0; +#endif + + if (p->ph.b_aec_enable) + { + cavs_bitstream_align(&p->s); + cavs_cabac_context_init(p); + cavs_cabac_start_decoding(&p->cabac, &p->s); + + /*syntax context init*/ + memset(p->p_mb_type_top, NOT_AVAIL, p->i_mb_width*sizeof(int8_t)); + memset(p->p_chroma_pred_mode_top, 0, p->i_mb_width*sizeof(int8_t)); + memset(p->p_cbp_top, -1, p->i_mb_width*sizeof(int8_t)); + memset(p->p_ref_top, NOT_AVAIL, p->i_mb_width*2*2*sizeof(int8_t)); + p->i_last_dqp = 0; + p->i_mb_type_left = -1; + } + + return 0; +} + +static int cavs_init_slice_for_rec(cavs_decoder *p) +{ + int i_y; + + p->i_mb_offset = ( !p->ph.b_picture_structure && p->i_mb_index >= p->i_mb_num_half ) ? (p->i_mb_height>>1) : 0; + i_y = p->i_mb_y - p->i_mb_offset; + + memset( p->p_top_intra_pred_mode_y, NOT_AVAIL, p->i_mb_width*4*sizeof(*p->p_top_intra_pred_mode_y) ); + p->p_y = p->cur.p_data[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_cb = p->cur.p_data[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_cr = p->cur.p_data[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; + +#if B_MB_WEIGHTING + p->p_back_y = p->mb_line_buffer[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_back_cb = p->mb_line_buffer[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_back_cr = p->mb_line_buffer[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; +#endif + + p->i_mb_flags = 0; + p->i_mb_x = 0; + p->b_first_line = 1; + p->b_error_flag = 0; + + return 0; +} + +/** + * in-loop deblocking filter for a single macroblock + * + * boundary strength (bs) mapping: + * + * --4---5-- + * 0 2 | + * | 6 | 7 | + * 1 3 | + * --------- + * + */ +static inline int get_bs(cavs_vector *mvP, cavs_vector *mvQ, int b, int i_unit_length) +{ + if((mvP->ref == REF_INTRA) || (mvQ->ref == REF_INTRA)) + return 2; + if( mvP->ref != mvQ->ref || (abs(mvP->x - mvQ->x) >= i_unit_length) || (abs(mvP->y - mvQ->y) >= i_unit_length) ) + return 1; + if(b) + { + mvP += MV_BWD_OFFS; + mvQ += MV_BWD_OFFS; + if( mvP->ref != mvQ->ref || (abs(mvP->x - mvQ->x) >= i_unit_length) || (abs(mvP->y - mvQ->y) >= i_unit_length) ) + return 1; + }/*else{ + if(mvP->ref != mvQ->ref) + return 1; + }*/ + return 0; +} + +static void filter_mb(cavs_decoder *p, int i_mb_type) +{ + uint8_t bs[8]; + int qp_avg; + int qp_avg_c; + int i; + int qp_avg_cb, qp_avg_cr; + + /* save c[0] or r[0] */ + p->i_topleft_border_y = p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE+CAVS_MB_SIZE-1];//0~15 + p->i_topleft_border_cb = p->p_top_border_cb[p->i_mb_x*10+8];//0~9 + p->i_topleft_border_cr = p->p_top_border_cr[p->i_mb_x*10+8]; + memcpy(&p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE], p->p_y + 15* p->cur.i_stride[0], 16); + + /* point 0 decided by topleft_border */ + memcpy(&p->p_top_border_cb[p->i_mb_x*10+1], p->p_cb + 7* p->cur.i_stride[1], 8); + memcpy(&p->p_top_border_cr[p->i_mb_x*10+1], p->p_cr + 7* p->cur.i_stride[2], 8); + for(i=0;i<8;i++) + { + p->i_left_border_y[i*2+1] = *(p->p_y + 15 + (i*2+0)*p->cur.i_stride[0]); + p->i_left_border_y[i*2+2] = *(p->p_y + 15 + (i*2+1)*p->cur.i_stride[0]); + p->i_left_border_cb[i+1] = *(p->p_cb + 7 + i*p->cur.i_stride[1]); + p->i_left_border_cr[i+1] = *(p->p_cr + 7 + i*p->cur.i_stride[2]); + } + memset(&p->i_left_border_y[17], p->i_left_border_y[16], 9); + + if( p->param.b_accelerate ) + { + if(!p->ph.b_loop_filter_disable) + { + /* determine bs */ + if(i_mb_type == I_8X8) + { + *((uint64_t *)bs) = 0x0202020202020202; + } + else + { + /** mv motion vector cache + 0: D3 B2 B3 C2 + 4: A1 X0 X1 - + 8: A3 X2 X3 - + i_mb_type > P_8X8即表示B帧 + bs[8]一共8个元素分别表示最多以4个8*8的块分割的4个垂直边界和4个水平边界,每个边界是8个象素 + 对于16*8或者8*16应该考虑其是否具有中间分割的两个水平和垂直边界 + 0,1,4,5应该是宏块边界上的2个水平和垂直边界 + 而2,3是宏块内垂直边界而,6,7是宏块内水平边界 + */ + *((uint64_t *)bs) = 0; + if(partition_flags[i_mb_type] & SPLITV) + { + bs[2] = get_bs(&p->mv[MV_FWD_X0], &p->mv[MV_FWD_X1], i_mb_type > P_8X8, p->i_uint_length); + bs[3] = get_bs(&p->mv[MV_FWD_X2], &p->mv[MV_FWD_X3], i_mb_type > P_8X8, p->i_uint_length); + } + if(partition_flags[i_mb_type] & SPLITH) + { + bs[6] = get_bs(&p->mv[MV_FWD_X0], &p->mv[MV_FWD_X2], i_mb_type > P_8X8, p->i_uint_length); + bs[7] = get_bs(&p->mv[MV_FWD_X1], &p->mv[MV_FWD_X3], i_mb_type > P_8X8, p->i_uint_length); + } + bs[0] = get_bs(&p->mv[MV_FWD_A1], &p->mv[MV_FWD_X0], i_mb_type > P_8X8, p->i_uint_length); + bs[1] = get_bs(&p->mv[MV_FWD_A3], &p->mv[MV_FWD_X2], i_mb_type > P_8X8, p->i_uint_length); + bs[4] = get_bs(&p->mv[MV_FWD_B2], &p->mv[MV_FWD_X0], i_mb_type > P_8X8, p->i_uint_length); + bs[5] = get_bs(&p->mv[MV_FWD_B3], &p->mv[MV_FWD_X1], i_mb_type > P_8X8, p->i_uint_length); + } + if( *((uint64_t *)bs) ) + { + if(p->i_mb_flags & A_AVAIL) + { + /* MB verticl edge */ + qp_avg = (p->i_qp_tab[p->i_mb_index] + p->i_left_qp + 1) >> 1; + + /* FIXIT : weighting quant qp for chroma + NOTE : not modify p->i_qp directly + */ + if( p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ) + { + qp_avg_cb = (chroma_qp[clip3_int(p->i_qp_tab[p->i_mb_index] + p->ph.chroma_quant_param_delta_u, 0, 63 )] + + chroma_qp[clip3_int(p->i_left_qp + p->ph.chroma_quant_param_delta_u, 0, 63)] + 1) >>1; + qp_avg_cr = (chroma_qp[clip3_int( p->i_qp_tab[p->i_mb_index] + p->ph.chroma_quant_param_delta_v, 0, 63 )] + + chroma_qp[clip3_int( p->i_left_qp + p->ph.chroma_quant_param_delta_v, 0, 63)] + 1) >> 1; + + p->filter_lv(p, p->p_y, p->cur.i_stride[0], qp_avg, bs[0], bs[1]); + p->filter_cv(p, p->p_cb, p->cur.i_stride[1], qp_avg_cb, bs[0], bs[1]); + p->filter_cv(p, p->p_cr, p->cur.i_stride[2], qp_avg_cr, bs[0], bs[1]); + } + else + { + qp_avg_c = (chroma_qp[p->i_qp_tab[p->i_mb_index]] + chroma_qp[p->i_left_qp] + 1) >> 1; + + p->filter_lv(p, p->p_y, p->cur.i_stride[0], qp_avg, bs[0], bs[1]); + p->filter_cv(p, p->p_cb, p->cur.i_stride[1], qp_avg_c, bs[0], bs[1]); + p->filter_cv(p, p->p_cr, p->cur.i_stride[2], qp_avg_c, bs[0], bs[1]); + } + } + qp_avg = p->i_qp_tab[p->i_mb_index]; + + p->filter_lv(p, p->p_y + 8, p->cur.i_stride[0], qp_avg, bs[2], bs[3]); + p->filter_lh(p, p->p_y + 8*p->cur.i_stride[0], p->cur.i_stride[0], qp_avg, bs[6], bs[7]); + + if(p->i_mb_flags & B_AVAIL) + { + /* MB horizontal edge */ + qp_avg = (p->i_qp_tab[p->i_mb_index] + p->p_top_qp[p->i_mb_x] + 1) >> 1; + if( p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ) + { + qp_avg_cb = (chroma_qp[clip3_int( p->i_qp_tab[p->i_mb_index] + p->ph.chroma_quant_param_delta_u,0, 63 )] + + chroma_qp[clip3_int( p->p_top_qp[p->i_mb_x] + p->ph.chroma_quant_param_delta_u, 0, 63 )] + 1) >>1; + qp_avg_cr = (chroma_qp[clip3_int(p->i_qp_tab[p->i_mb_index] + p->ph.chroma_quant_param_delta_v ,0, 63 )] + + chroma_qp[clip3_int( p->p_top_qp[p->i_mb_x] + p->ph.chroma_quant_param_delta_v, 0, 63 )] + 1) >> 1; + + p->filter_lh(p, p->p_y, p->cur.i_stride[0], qp_avg, bs[4], bs[5]); + p->filter_ch(p, p->p_cb, p->cur.i_stride[1], qp_avg_cb, bs[4], bs[5]); + p->filter_ch(p, p->p_cr, p->cur.i_stride[2], qp_avg_cr, bs[4], bs[5]); + } + else + { + qp_avg_c = (chroma_qp[p->i_qp_tab[p->i_mb_index]] + chroma_qp[p->p_top_qp[p->i_mb_x]] + 1) >> 1; + + p->filter_lh(p, p->p_y, p->cur.i_stride[0], qp_avg, bs[4], bs[5]); + p->filter_ch(p, p->p_cb, p->cur.i_stride[1], qp_avg_c, bs[4], bs[5]); + p->filter_ch(p, p->p_cr, p->cur.i_stride[2], qp_avg_c, bs[4], bs[5]); + } + } + } + } + + p->i_left_qp = p->i_qp_tab[p->i_mb_index]; + p->p_top_qp[p->i_mb_x] = p->i_qp_tab[p->i_mb_index]; + } + else + { + if(!p->ph.b_loop_filter_disable) + { + /* determine bs */ + if(i_mb_type == I_8X8) + { + *((uint64_t *)bs) = 0x0202020202020202; + } + else + { + /** mv motion vector cache + 0: D3 B2 B3 C2 + 4: A1 X0 X1 - + 8: A3 X2 X3 - + i_mb_type > P_8X8即表示B帧 + bs[8]一共8个元素分别表示最多以4个8*8的块分割的4个垂直边界和4个水平边界,每个边界是8个象素 + 对于16*8或者8*16应该考虑其是否具有中间分割的两个水平和垂直边界 + 0,1,4,5应该是宏块边界上的2个水平和垂直边界 + 而2,3是宏块内垂直边界而,6,7是宏块内水平边界 + */ + *((uint64_t *)bs) = 0; + if(partition_flags[i_mb_type] & SPLITV) + { + bs[2] = get_bs(&p->mv[MV_FWD_X0], &p->mv[MV_FWD_X1], i_mb_type > P_8X8, p->i_uint_length); + bs[3] = get_bs(&p->mv[MV_FWD_X2], &p->mv[MV_FWD_X3], i_mb_type > P_8X8, p->i_uint_length); + } + if(partition_flags[i_mb_type] & SPLITH) + { + bs[6] = get_bs(&p->mv[MV_FWD_X0], &p->mv[MV_FWD_X2], i_mb_type > P_8X8, p->i_uint_length); + bs[7] = get_bs(&p->mv[MV_FWD_X1], &p->mv[MV_FWD_X3], i_mb_type > P_8X8, p->i_uint_length); + } + bs[0] = get_bs(&p->mv[MV_FWD_A1], &p->mv[MV_FWD_X0], i_mb_type > P_8X8, p->i_uint_length); + bs[1] = get_bs(&p->mv[MV_FWD_A3], &p->mv[MV_FWD_X2], i_mb_type > P_8X8, p->i_uint_length); + bs[4] = get_bs(&p->mv[MV_FWD_B2], &p->mv[MV_FWD_X0], i_mb_type > P_8X8, p->i_uint_length); + bs[5] = get_bs(&p->mv[MV_FWD_B3], &p->mv[MV_FWD_X1], i_mb_type > P_8X8, p->i_uint_length); + } + if( *((uint64_t *)bs) ) + { + if(p->i_mb_flags & A_AVAIL) + { + /* MB verticl edge */ + qp_avg = (p->i_qp + p->i_left_qp + 1) >> 1; + + /* FIXIT : weighting quant qp for chroma + NOTE : not modify p->i_qp directly + */ + if( p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ) + { + qp_avg_cb = (chroma_qp[clip3_int(p->i_qp + p->ph.chroma_quant_param_delta_u, 0, 63 )] + + chroma_qp[clip3_int(p->i_left_qp + p->ph.chroma_quant_param_delta_u, 0, 63)] + 1) >>1; + qp_avg_cr = (chroma_qp[clip3_int( p->i_qp + p->ph.chroma_quant_param_delta_v, 0, 63 )] + + chroma_qp[clip3_int( p->i_left_qp + p->ph.chroma_quant_param_delta_v, 0, 63)] + 1) >> 1; + + p->filter_lv(p, p->p_y, p->cur.i_stride[0], qp_avg, bs[0], bs[1]); + p->filter_cv(p, p->p_cb, p->cur.i_stride[1], qp_avg_cb, bs[0], bs[1]); + p->filter_cv(p, p->p_cr, p->cur.i_stride[2], qp_avg_cr, bs[0], bs[1]); + } + else + { + qp_avg_c = (chroma_qp[p->i_qp] + chroma_qp[p->i_left_qp] + 1) >> 1; + + p->filter_lv(p, p->p_y, p->cur.i_stride[0], qp_avg, bs[0], bs[1]); + p->filter_cv(p, p->p_cb, p->cur.i_stride[1], qp_avg_c, bs[0], bs[1]); + p->filter_cv(p, p->p_cr, p->cur.i_stride[2], qp_avg_c, bs[0], bs[1]); + } + } + qp_avg = p->i_qp; + + p->filter_lv(p, p->p_y + 8, p->cur.i_stride[0], qp_avg, bs[2], bs[3]); + p->filter_lh(p, p->p_y + 8*p->cur.i_stride[0], p->cur.i_stride[0], qp_avg, bs[6], bs[7]); + + if(p->i_mb_flags & B_AVAIL) + { + /* MB horizontal edge */ + qp_avg = (p->i_qp + p->p_top_qp[p->i_mb_x] + 1) >> 1; + if( p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ) + { + qp_avg_cb = (chroma_qp[clip3_int( p->i_qp + p->ph.chroma_quant_param_delta_u,0, 63 )] + + chroma_qp[clip3_int( p->p_top_qp[p->i_mb_x] + p->ph.chroma_quant_param_delta_u, 0, 63 )] + 1) >>1; + qp_avg_cr = (chroma_qp[clip3_int(p->i_qp + p->ph.chroma_quant_param_delta_v ,0, 63 )] + + chroma_qp[clip3_int( p->p_top_qp[p->i_mb_x] + p->ph.chroma_quant_param_delta_v, 0, 63 )] + 1) >> 1; + + p->filter_lh(p, p->p_y, p->cur.i_stride[0], qp_avg, bs[4], bs[5]); + p->filter_ch(p, p->p_cb, p->cur.i_stride[1], qp_avg_cb, bs[4], bs[5]); + p->filter_ch(p, p->p_cr, p->cur.i_stride[2], qp_avg_cr, bs[4], bs[5]); + } + else + { + qp_avg_c = (chroma_qp[p->i_qp] + chroma_qp[p->p_top_qp[p->i_mb_x]] + 1) >> 1; + + p->filter_lh(p, p->p_y, p->cur.i_stride[0], qp_avg, bs[4], bs[5]); + p->filter_ch(p, p->p_cb, p->cur.i_stride[1], qp_avg_c, bs[4], bs[5]); + p->filter_ch(p, p->p_cr, p->cur.i_stride[2], qp_avg_c, bs[4], bs[5]); + } + + + } + } + } + + p->i_left_qp = p->i_qp; + p->p_top_qp[p->i_mb_x] = p->i_qp; + + } + +} + + +#define CAVS_CHROMA_MC(OPNAME, OP,L)\ +static UNUSED void cavs_chroma_mc2_## OPNAME ##_c(uint8_t *dst, uint8_t *src, int stride, int h, int x, int y){\ + const int A=(L-x)*(L-y);\ + const int B=( x)*(L-y);\ + const int C=(L-x)*( y);\ + const int D=( x)*( y);\ + int i;\ + \ +\ + for(i=0; i>6)+1)>>1) +#define op_put(a, b) a = (((b) + 32)>>6) +#define op_avg16(a, b) a = (((a)+(((b) + 128)>>8)+1)>>1) +#define op_put16(a, b) a = (((b) + 128)>>8) + +CAVS_CHROMA_MC(put , op_put,8) +CAVS_CHROMA_MC(avg , op_avg,8) +CAVS_CHROMA_MC(16put , op_put16,16) +CAVS_CHROMA_MC(16avg , op_avg16,16) +#undef op_avg +#undef op_put +#undef op_avg16 +#undef op_put16 + +static void cavs_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize, int block_w, int block_h, + int src_x, int src_y, int w, int h) +{ + int x, y; + int start_y, start_x, end_y, end_x; + + if(src_y>= h){ + src+= (h-1-src_y)*linesize; + src_y=h-1; + }else if(src_y<=-block_h){ + src+= (1-block_h-src_y)*linesize; + src_y=1-block_h; + } + if(src_x>= w){ + src+= (w-1-src_x); + src_x=w-1; + }else if(src_x<=-block_w){ + src+= (1-block_w-src_x); + src_x=1-block_w; + } + + start_y= CAVS_MAX(0, -src_y); + start_x= CAVS_MAX(0, -src_x); + end_y= CAVS_MIN(block_h, h-src_y); + end_x= CAVS_MIN(block_w, w-src_x); + + + // copy existing part + for(y=start_y; yx + (src_x_offset<<3)); + const int my =(mv->y + (src_y_offset<<3)); + const int luma_xy = ( (mx&3) + ((my&3)<<2) ); + uint8_t * src_y,* src_cb,* src_cr; + int extra_width = 0; //(s->flags&CODEC_FLAG_EMU_EDGE) ? 0 : 16; + int extra_height = extra_width; + int emu = 0; + const int full_mx = mx>>2; + const int full_my = my>>2; + const int pic_width = p->i_mb_width<<4; + const int pic_height = ( p->ph.b_picture_structure==0?(p->i_mb_height>>1):p->i_mb_height)<<4; + + { + src_y = ref->p_data[0] + (mx>>2) + (my>>2)*(int)ref->i_stride[0]; // NOTE : unsigned sign must trans to sign + src_cb= ref->p_data[1] + (mx>>3) + (my>>3)*(int)ref->i_stride[1]; + src_cr= ref->p_data[2] + (mx>>3) + (my>>3)*(int)ref->i_stride[2]; + } + + if(!ref->p_data[0]) + return; + + if(mx&15) extra_width -= 3; + if(my&15) extra_height -= 3; + + + if( full_mx < 0-extra_width + || full_my < 0-extra_height + || full_mx + 16 > pic_width + extra_width + || full_my + 16 > pic_height + extra_height) + { + cavs_emulated_edge_mc(p->p_edge, src_y - 2 - 2*(int)ref->i_stride[0], ref->i_stride[0], + 16+9, 16+9, full_mx-2, full_my-2, pic_width, pic_height); + src_y = p->p_edge + 2 + 2*(int)ref->i_stride[0]; + emu = 1; + } + + luma[luma_xy](dest_y, src_y, ref->i_stride[0]); + + if(emu) + { + { + cavs_emulated_edge_mc(p->p_edge, src_cb, ref->i_stride[1], + 9, 9, (mx>>3), (my>>3), pic_width>>1, pic_height>>1); + } + + src_cb= p->p_edge; + } + + chroma(dest_cb, src_cb, ref->i_stride[1], chroma_height, mx&7, my&7); + + if(emu) + { + { + cavs_emulated_edge_mc(p->p_edge, src_cr, ref->i_stride[2], + 9, 9, (mx>>3), (my>>3), pic_width>>1, pic_height>>1); + } + src_cr= p->p_edge; + } + + chroma(dest_cr, src_cr, ref->i_stride[2], chroma_height, mx&7, my&7); +} + +static inline void mc_part_std(cavs_decoder *p,int chroma_height, + uint8_t *dest_y,uint8_t *dest_cb,uint8_t *dest_cr, + int x_offset, int y_offset,cavs_vector *mv, + cavs_luma_mc_func *luma_put,cavs_chroma_mc_func chroma_put, + cavs_luma_mc_func *luma_avg,cavs_chroma_mc_func chroma_avg) +{ + cavs_luma_mc_func *lum= luma_put; + cavs_chroma_mc_func chroma= chroma_put; + +#if B_MB_WEIGHTING + int i_dir = 0; + uint8_t *dst_back_y, *dst_back_cb, *dst_back_cr; + int x_offset_back = x_offset; + int y_offset_back = y_offset; + int fw_luma_scale, fw_chroma_scale; + int fw_luma_shift, fw_chroma_shift; + int ii, jj; + int i_first_field = p->i_mb_index < p->i_mb_num_half ? 1 : 0; /* 0 is bottom */ + +#endif + + dest_y += (x_offset<<1) + ((y_offset*p->cur.i_stride[0])<<1); + dest_cb += x_offset + y_offset*p->cur.i_stride[1]; + dest_cr += x_offset + y_offset*p->cur.i_stride[2]; + x_offset += (p->i_mb_x)<<3; + y_offset += 8*(p->i_mb_y-p->i_mb_offset); + +#if B_MB_WEIGHTING + /* get temp buffer for dest_y, dest_cb, dest_cr */ + dst_back_y = p->p_back_y; + dst_back_cb = p->p_back_cb; + dst_back_cr = p->p_back_cr; + + dst_back_y += (2*x_offset_back) + (2*y_offset_back*p->cur.i_stride[0]); /* set buffer address */ + dst_back_cb += x_offset_back + y_offset_back*p->cur.i_stride[1]; + dst_back_cr += x_offset_back + y_offset_back*p->cur.i_stride[2]; + + x_offset_back += 8*p->i_mb_x; + y_offset_back += 8*(p->i_mb_y-p->i_mb_offset); +#endif + +#if B_MB_WEIGHTING + /* forward */ + if(mv->ref >= 0) + { + cavs_image *ref= &p->ref[mv->ref]; + + mc_dir_part(p, ref, chroma_height, 0, dest_y, dest_cb, dest_cr, x_offset, y_offset, + lum, chroma, mv); + i_dir = 1; /* forward flag */ + + /* weighting prediction */ + if( ((p->sh.b_slice_weighting_flag == 1) + && (p->sh.b_mb_weighting_flag == 1) && (p->weighting_prediction == 1)) + || ((p->sh.b_slice_weighting_flag == 1) && (p->sh.b_mb_weighting_flag == 0))) + { + if((p->ph.i_picture_coding_type == 1) || (i_first_field == 0 && p->ph.i_picture_coding_type == 0)) /* P-slice */ + { + /* scale shift */ + fw_luma_scale = p->sh.i_luma_scale[mv->ref]; + fw_luma_shift = p->sh.i_luma_shift[mv->ref]; + + /* luma */ + for( ii = 0; ii < chroma_height<<1; ii++ ) + { + for( jj = 0; jj < chroma_height<<1; jj++ ) + { + *(dest_y + ii*p->cur.i_stride[0]+ jj) = + cavs_clip_uint8((( (*(dest_y + ii*p->cur.i_stride[0]+ jj)) *fw_luma_scale+16)>>5) + fw_luma_shift); + } + } + + /* scale shift */ + fw_chroma_scale = p->sh.i_chroma_scale[mv->ref]; + fw_chroma_shift = p->sh.i_chroma_shift[mv->ref]; + + /* cb */ + for( ii = 0; ii < chroma_height; ii++ ) + { + for( jj = 0; jj < chroma_height; jj++ ) + { + *(dest_cb + ii*p->cur.i_stride[1]+ jj) = + cavs_clip_uint8((( (*(dest_cb + ii*p->cur.i_stride[1]+ jj)) *fw_chroma_scale+16)>>5) + fw_chroma_shift); + } + } + + /* cr */ + for( ii = 0; ii < chroma_height; ii++ ) + { + for( jj = 0; jj < chroma_height; jj++ ) + { + *(dest_cr + ii*p->cur.i_stride[2]+ jj) = + cavs_clip_uint8((( (*(dest_cr + ii*p->cur.i_stride[2]+ jj)) *fw_chroma_scale+16)>>5) + fw_chroma_shift); + } + } + + } + else if(p->ph.i_picture_coding_type == 2)/* B-frame */ + { + int refframe; + int i_ref_offset = p->ph.b_picture_structure == 0 ? 2 : 1; + + refframe = mv->ref - i_ref_offset; + + refframe= (!p->param.b_interlaced )?(refframe):(2*refframe); + + /* scale shift */ + fw_luma_scale = p->sh.i_luma_scale[refframe]; + fw_luma_shift = p->sh.i_luma_shift[refframe]; + + /* luma */ + for( ii = 0; ii < chroma_height<<1; ii++ ) + { + for( jj = 0; jj < chroma_height<<1; jj++ ) + { + *(dest_y + ii*p->cur.i_stride[0]+ jj) = + cavs_clip_uint8((( (*(dest_y + ii*p->cur.i_stride[0]+ jj)) *fw_luma_scale+16)>>5) + fw_luma_shift); + } + } + + /* cb */ + fw_chroma_scale = p->sh.i_chroma_scale[refframe]; + fw_chroma_shift = p->sh.i_chroma_shift[refframe]; + + for( ii = 0; ii < chroma_height; ii++ ) + { + for( jj = 0; jj < chroma_height; jj++ ) + { + *(dest_cb + ii*p->cur.i_stride[1]+ jj) = + cavs_clip_uint8((( (*(dest_cb + ii*p->cur.i_stride[1]+ jj)) *fw_chroma_scale+16)>>5) + fw_chroma_shift); + } + } + + /* cr */ + for( ii = 0; ii < chroma_height; ii++ ) + { + for( jj = 0; jj < chroma_height; jj++ ) + { + *(dest_cr + ii*p->cur.i_stride[2]+ jj) = + cavs_clip_uint8((( (*(dest_cr + ii*p->cur.i_stride[2]+ jj)) *fw_chroma_scale+16)>>5) + fw_chroma_shift); + } + } + + } + + } + + } + + /* backward */ + if((mv+MV_BWD_OFFS)->ref >= 0) + { + cavs_image *ref= &p->ref[(mv+MV_BWD_OFFS)->ref]; + + if( i_dir == 0 )/* has no forward */ + { + mc_dir_part(p, ref, chroma_height, 1, + dest_y, dest_cb, dest_cr, x_offset, y_offset, + lum, chroma, mv+MV_BWD_OFFS); + + /* weighting prediction */ + if( ((p->sh.b_slice_weighting_flag == 1) + && (p->sh.b_mb_weighting_flag == 1) && (p->weighting_prediction == 1)) + || ((p->sh.b_slice_weighting_flag == 1) && (p->sh.b_mb_weighting_flag == 0))) + { + int refframe; + + refframe = (mv+MV_BWD_OFFS)->ref; + + refframe= (!p->param.b_interlaced )?(refframe+1):(2*refframe+1); + + /* scale shift */ + fw_luma_scale = p->sh.i_luma_scale[refframe]; + fw_luma_shift = p->sh.i_luma_shift[refframe]; + + /* luma */ + for( ii = 0; ii < chroma_height<<1; ii++ ) + { + for( jj = 0; jj < chroma_height<<1; jj++ ) + { + *(dest_y + ii*p->cur.i_stride[0]+ jj) = + cavs_clip_uint8((( (*(dest_y + ii*p->cur.i_stride[0]+ jj)) *fw_luma_scale+16)>>5) + fw_luma_shift); + } + } + + /* cb */ + fw_chroma_scale = p->sh.i_chroma_scale[refframe]; + fw_chroma_shift = p->sh.i_chroma_shift[refframe]; + + for( ii = 0; ii < chroma_height; ii++ ) + { + for( jj = 0; jj < chroma_height; jj++ ) + { + *(dest_cb + ii*p->cur.i_stride[1]+ jj) = + cavs_clip_uint8((( (*(dest_cb + ii*p->cur.i_stride[1]+ jj)) *fw_chroma_scale+16)>>5) + fw_chroma_shift); + } + } + + /* cr */ + for( ii = 0; ii < chroma_height; ii++ ) + { + for( jj = 0; jj < chroma_height; jj++ ) + { + *(dest_cr + ii*p->cur.i_stride[2]+ jj) = + cavs_clip_uint8((( (*(dest_cr + ii*p->cur.i_stride[2]+ jj)) *fw_chroma_scale+16)>>5) + fw_chroma_shift); + } + } + } + + } + else/* already has forward */ + { + mc_dir_part(p, ref, chroma_height, 1, + dst_back_y, dst_back_cb, dst_back_cr, x_offset_back, y_offset_back, + lum, chroma, mv+MV_BWD_OFFS); + + /* weighting prediction */ + if( ((p->sh.b_slice_weighting_flag == 1) + && (p->sh.b_mb_weighting_flag == 1) && (p->weighting_prediction == 1)) + || ((p->sh.b_slice_weighting_flag == 1) && (p->sh.b_mb_weighting_flag == 0))) + { + int refframe; + + refframe = (mv+MV_BWD_OFFS)->ref; + + refframe= (!p->param.b_interlaced )?(refframe+1):(2*refframe+1); + + /* scale shift */ + fw_luma_scale = p->sh.i_luma_scale[refframe]; + fw_luma_shift = p->sh.i_luma_shift[refframe]; + + /* luma */ + for( ii = 0; ii < chroma_height<<1; ii++ ) + { + for( jj = 0; jj < chroma_height<<1; jj++ ) + { + *(dst_back_y + ii*p->cur.i_stride[0]+ jj) = + cavs_clip_uint8((( (*(dst_back_y + ii*p->cur.i_stride[0]+ jj)) *fw_luma_scale+16)>>5) + fw_luma_shift); + } + } + + /* cb */ + fw_chroma_scale = p->sh.i_chroma_scale[refframe]; + fw_chroma_shift = p->sh.i_chroma_shift[refframe]; + + for( ii = 0; ii < chroma_height; ii++ ) + { + for( jj = 0; jj < chroma_height; jj++ ) + { + *(dst_back_cb + ii*p->cur.i_stride[1]+ jj) = + cavs_clip_uint8((( (*(dst_back_cb + ii*p->cur.i_stride[1]+ jj)) *fw_chroma_scale+16)>>5) + fw_chroma_shift); + } + } + + /* cr */ + for( ii = 0; ii < chroma_height; ii++ ) + { + for( jj = 0; jj < chroma_height; jj++ ) + { + *(dst_back_cr + ii*p->cur.i_stride[2]+ jj) = + cavs_clip_uint8((( (*(dst_back_cr + ii*p->cur.i_stride[2]+ jj)) *fw_chroma_scale+16)>>5) + fw_chroma_shift); + } + } + } + } + + i_dir = i_dir|2; /* backward flag */ + } + + /* avg */ + if( i_dir == 3 ) + { + /* luma */ + p->cavs_avg_pixels_tab[!(chroma_height==8)]( dest_y, p->cur.i_stride[0], dst_back_y, p->cur.i_stride[0] ); + + /* cb */ + p->cavs_avg_pixels_tab[(!(chroma_height==8)) + 1]( dest_cb, p->cur.i_stride[1], dst_back_cb, p->cur.i_stride[1] ); + + /* cr */ + p->cavs_avg_pixels_tab[(!(chroma_height==8)) + 1]( dest_cr, p->cur.i_stride[2], dst_back_cr, p->cur.i_stride[2] ); + } + +#else + if(mv->ref >= 0) + { + cavs_image *ref= &p->ref[mv->ref]; + + mc_dir_part(p, ref,chroma_height,0,dest_y, dest_cb, dest_cr, x_offset, y_offset, + lum, chroma, mv); + + lum= luma_avg; + chroma= chroma_avg; + } + + if((mv+MV_BWD_OFFS)->ref >= 0) + { + cavs_image *ref= &p->ref[(mv+MV_BWD_OFFS)->ref]; + + mc_dir_part(p, ref, chroma_height, 1, + dest_y, dest_cb, dest_cr, x_offset, y_offset, + lum, chroma, mv+MV_BWD_OFFS); + } +#endif + +} + +static void inter_pred(cavs_decoder *p, int i_mb_type) +{ + int y_16, c_16; + + y_16 = c_16 = 0; + //if(p->ph.asi_enable == 1) + //{ + // y_16=2; + // c_16=3; + //} + + if(partition_flags[i_mb_type] == 0) + { + /* 16x16 */ + mc_part_std(p, 8, p->p_y, p->p_cb, p->p_cr, + 0, 0,&p->mv[MV_FWD_X0], + p->put_cavs_qpel_pixels_tab[0+y_16],p->put_h264_chroma_pixels_tab[0+c_16], + p->avg_cavs_qpel_pixels_tab[0+y_16],p->avg_h264_chroma_pixels_tab[0+c_16]); + } + else + { + mc_part_std(p, 4, p->p_y, p->p_cb, p->p_cr, + 0, 0,&p->mv[MV_FWD_X0], + p->put_cavs_qpel_pixels_tab[1+y_16],p->put_h264_chroma_pixels_tab[1+c_16], + p->avg_cavs_qpel_pixels_tab[1+y_16],p->avg_h264_chroma_pixels_tab[1+c_16]); + + mc_part_std(p, 4, p->p_y, p->p_cb, p->p_cr, + 4, 0,&p->mv[MV_FWD_X1], + p->put_cavs_qpel_pixels_tab[1+y_16],p->put_h264_chroma_pixels_tab[1+c_16], + p->avg_cavs_qpel_pixels_tab[1+y_16],p->avg_h264_chroma_pixels_tab[1+c_16]); + + mc_part_std(p, 4, p->p_y, p->p_cb, p->p_cr, + 0, 4,&p->mv[MV_FWD_X2], + p->put_cavs_qpel_pixels_tab[1+y_16],p->put_h264_chroma_pixels_tab[1+c_16], + p->avg_cavs_qpel_pixels_tab[1+y_16],p->avg_h264_chroma_pixels_tab[1+c_16]); + + mc_part_std(p, 4, p->p_y, p->p_cb, p->p_cr, + 4, 4,&p->mv[MV_FWD_X3], + p->put_cavs_qpel_pixels_tab[1+y_16],p->put_h264_chroma_pixels_tab[1+c_16], + p->avg_cavs_qpel_pixels_tab[1+y_16],p->avg_h264_chroma_pixels_tab[1+c_16]); + } + + /* set intra prediction modes to default values */ + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + + p->p_top_intra_pred_mode_y[(p->i_mb_x<<2)+0] = p->p_top_intra_pred_mode_y[(p->i_mb_x<<2)+1] = + p->p_top_intra_pred_mode_y[(p->i_mb_x<<2)+2] = p->p_top_intra_pred_mode_y[(p->i_mb_x<<2)+3] = NOT_AVAIL; +} + + +static inline int next_mb( cavs_decoder *p ) +{ + int i, i_y; + int i_offset = p->i_mb_x<<1; + + p->i_mb_flags |= A_AVAIL; + p->p_y += 16; + p->p_cb += 8; + p->p_cr += 8; + + if( p->param.b_accelerate ) + { + for( i = 0; i <= 20; i += 4 ) + {//原来B3,X1,X3的运动矢量成为右边新的宏块的预测运动矢量左边的候选子即D2,A1,A3 + p->mv[i] = p->mv[i+2]; + } + + //保存X2,X3作为下面宏块的预测运动矢量的候选子即B2,B3 + p->mv[MV_FWD_D3] = p->p_top_mv[0][i_offset+1]; + p->mv[MV_BWD_D3] = p->p_top_mv[1][i_offset+1];//修改前先保存到D3; + p->p_top_mv[0][i_offset+0] = p->mv[MV_FWD_X2]; + p->p_top_mv[0][i_offset+1] = p->mv[MV_FWD_X3]; + p->p_top_mv[1][i_offset+0] = p->mv[MV_BWD_X2]; + p->p_top_mv[1][i_offset+1] = p->mv[MV_BWD_X3]; + + /* for AEC */ + if (p->ph.b_aec_enable) + { + p->p_mb_type_top[p->i_mb_x] = p->i_mb_type_tab[p->i_mb_index]; + if( p->ph.i_picture_coding_type == 0 && p->b_bottom == 0 ) + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = p->i_pred_mode_chroma_tab[p->i_mb_index]; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = p->i_cbp; + } + else + { + if( p->i_mb_type_tab[p->i_mb_index] != P_SKIP && p->i_mb_type_tab[p->i_mb_index] != B_SKIP ) + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = p->i_pred_mode_chroma_tab[p->i_mb_index]; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = p->i_cbp;//p->i_cbp_tab[p->i_mb_index]; + } + else + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = 0; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = 0; /* skip has not cbp */ + p->i_last_dqp = 0; + } + } + + CP16(p->p_ref_top[p->i_mb_x][0], &p->p_ref[0][7]); + CP16(p->p_ref_top[p->i_mb_x][1], &p->p_ref[1][7]); + } + + /*Move to next MB*/ + p->i_mb_x++; + if(p->i_mb_x == p->i_mb_width) + { + //下一行宏块 + p->i_mb_flags = B_AVAIL|C_AVAIL;//如果i_mb_width=1;则C_AVAIL不可得到 + /* 清除左边块预测模式A1,A3*/ + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + + p->i_intra_pred_mode_y_tab[p->i_mb_index][5] = p->i_intra_pred_mode_y_tab[p->i_mb_index][10] = + p->i_intra_pred_mode_y_tab[p->i_mb_index][15] = p->i_intra_pred_mode_y_tab[p->i_mb_index][20] = NOT_AVAIL; + + /* 清除左边块运动矢量C2,A1,A3 */ + for( i = 0; i <= 20; i += 4 ) + { + p->mv[i] = MV_NOT_AVAIL; + } + p->i_mb_x = 0; + p->i_mb_y++; + i_y = p->i_mb_y - p->i_mb_offset; + p->p_y = p->cur.p_data[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_cb = p->cur.p_data[1] + i_y*CAVS_MB_SIZE/2*p->cur.i_stride[1]; + p->p_cr = p->cur.p_data[2] + i_y*CAVS_MB_SIZE/2*p->cur.i_stride[2]; + +#if B_MB_WEIGHTING + p->p_back_y = p->mb_line_buffer[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_back_cb = p->mb_line_buffer[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_back_cr = p->mb_line_buffer[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; +#endif + + p->b_first_line = 0; + + /* for AEC */ + p->i_mb_type_left = -1; + } + else + { + /* for AEC */ + p->i_mb_type_left = p->i_mb_type_tab[p->i_mb_index]; + } + + if( p->i_mb_x == p->i_mb_width-1 ) + { + p->i_mb_flags &= ~C_AVAIL; + } + + if( p->i_mb_x && p->i_mb_y && p->b_first_line==0 ) + { + p->i_mb_flags |= D_AVAIL; + } + } + else + { + for( i = 0; i <= 20; i += 4 ) + {//原来B3,X1,X3的运动矢量成为右边新的宏块的预测运动矢量左边的候选子即D2,A1,A3 + p->mv[i] = p->mv[i+2]; + } + //保存X2,X3作为下面宏块的预测运动矢量的候选子即B2,B3 + p->mv[MV_FWD_D3] = p->p_top_mv[0][i_offset+1]; + p->mv[MV_BWD_D3] = p->p_top_mv[1][i_offset+1];//修改前先保存到D3; + p->p_top_mv[0][i_offset+0] = p->mv[MV_FWD_X2]; + p->p_top_mv[0][i_offset+1] = p->mv[MV_FWD_X3]; + p->p_top_mv[1][i_offset+0] = p->mv[MV_BWD_X2]; + p->p_top_mv[1][i_offset+1] = p->mv[MV_BWD_X3]; + + /* for AEC */ + if (p->ph.b_aec_enable) + { + p->p_mb_type_top[p->i_mb_x] = p->i_mb_type; + if(p->ph.i_picture_coding_type == 0 && p->b_bottom == 0)/* frame or field-top is I-slice */ + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = p->i_pred_mode_chroma; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = p->i_cbp; + } + else + { + if( p->i_mb_type != P_SKIP && p->i_mb_type != B_SKIP ) + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = p->i_pred_mode_chroma; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = p->i_cbp; + } + else + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = 0; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = 0; /* skip has not cbp */ + p->i_last_dqp = 0; + } + } + + CP16(p->p_ref_top[p->i_mb_x][0], &p->p_ref[0][7]); + CP16(p->p_ref_top[p->i_mb_x][1], &p->p_ref[1][7]); + } + + /*Move to next MB*/ + p->i_mb_x++; + if(p->i_mb_x == p->i_mb_width) + { + //下一行宏块 + p->i_mb_flags = B_AVAIL|C_AVAIL;//如果i_mb_width=1;则C_AVAIL不可得到 + /* 清除左边块预测模式A1,A3*/ + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + + /* 清除左边块运动矢量C2,A1,A3 */ + for( i = 0; i <= 20; i += 4 ) + { + p->mv[i] = MV_NOT_AVAIL; + } + p->i_mb_x = 0; + p->i_mb_y++; + i_y = p->i_mb_y - p->i_mb_offset; + p->p_y = p->cur.p_data[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_cb = p->cur.p_data[1] + i_y*CAVS_MB_SIZE/2*p->cur.i_stride[1]; + p->p_cr = p->cur.p_data[2] + i_y*CAVS_MB_SIZE/2*p->cur.i_stride[2]; + +#if B_MB_WEIGHTING + p->p_back_y = p->mb_line_buffer[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_back_cb = p->mb_line_buffer[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_back_cr = p->mb_line_buffer[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; +#endif + + p->b_first_line = 0; + + /* for AEC */ + p->i_mb_type_left = -1; + } + else + { + /* for AEC */ + p->i_mb_type_left = p->i_mb_type; + } + + if( p->i_mb_x == p->i_mb_width-1 ) + { + p->i_mb_flags &= ~C_AVAIL; + } + + if( p->i_mb_x && p->i_mb_y && p->b_first_line==0 ) + { + p->i_mb_flags |= D_AVAIL; + } + } + + return 0; +} + +static inline void init_mb(cavs_decoder *p) +{ + //int i = 0; + int i_offset = p->i_mb_x<<1; + int i_offset_b4 = p->i_mb_x<<2; + + if( p->param.b_accelerate ) + { + if(!(p->i_mb_flags & A_AVAIL)) + { + p->mv[MV_FWD_A1] = MV_NOT_AVAIL; + p->mv[MV_FWD_A3] = MV_NOT_AVAIL; + p->mv[MV_BWD_A1] = MV_NOT_AVAIL; + p->mv[MV_BWD_A3] = MV_NOT_AVAIL; + + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + + p->i_intra_pred_mode_y_tab[p->i_mb_index][5] = p->i_intra_pred_mode_y_tab[p->i_mb_index][10] = + p->i_intra_pred_mode_y_tab[p->i_mb_index][15] = p->i_intra_pred_mode_y_tab[p->i_mb_index][20] = NOT_AVAIL; + } + + if(p->i_mb_flags & B_AVAIL) + { + p->mv[MV_FWD_B2] = p->p_top_mv[0][i_offset]; + p->mv[MV_BWD_B2] = p->p_top_mv[1][i_offset]; + p->mv[MV_FWD_B3] = p->p_top_mv[0][i_offset+1]; + p->mv[MV_BWD_B3] = p->p_top_mv[1][i_offset+1]; + + p->i_intra_pred_mode_y[1] = p->p_top_intra_pred_mode_y[i_offset_b4]; + p->i_intra_pred_mode_y[2] = p->p_top_intra_pred_mode_y[i_offset_b4+1]; + p->i_intra_pred_mode_y[3] = p->p_top_intra_pred_mode_y[i_offset_b4+2]; + p->i_intra_pred_mode_y[4] = p->p_top_intra_pred_mode_y[i_offset_b4+3]; + + p->i_intra_pred_mode_y_tab[p->i_mb_index][1] = p->p_top_intra_pred_mode_y[i_offset_b4]; + p->i_intra_pred_mode_y_tab[p->i_mb_index][2] = p->p_top_intra_pred_mode_y[i_offset_b4+1]; + p->i_intra_pred_mode_y_tab[p->i_mb_index][3] = p->p_top_intra_pred_mode_y[i_offset_b4+2]; + p->i_intra_pred_mode_y_tab[p->i_mb_index][4] = p->p_top_intra_pred_mode_y[i_offset_b4+3]; + } + else + { + p->mv[MV_FWD_B2] = MV_NOT_AVAIL; + p->mv[MV_FWD_B3] = MV_NOT_AVAIL; + p->mv[MV_BWD_B2] = MV_NOT_AVAIL; + p->mv[MV_BWD_B3] = MV_NOT_AVAIL; + + p->i_intra_pred_mode_y[1] = p->i_intra_pred_mode_y[2] = + p->i_intra_pred_mode_y[3] = p->i_intra_pred_mode_y[4] = NOT_AVAIL; + + p->i_intra_pred_mode_y_tab[p->i_mb_index][1] = p->i_intra_pred_mode_y_tab[p->i_mb_index][2] = + p->i_intra_pred_mode_y_tab[p->i_mb_index][3] = p->i_intra_pred_mode_y_tab[p->i_mb_index][4] = NOT_AVAIL; + } + + if(p->i_mb_flags & C_AVAIL) + { + p->mv[MV_FWD_C2] = p->p_top_mv[0][i_offset+2]; + p->mv[MV_BWD_C2] = p->p_top_mv[1][i_offset+2]; + } + else + { + p->mv[MV_FWD_C2] = MV_NOT_AVAIL; + p->mv[MV_BWD_C2] = MV_NOT_AVAIL; + } + + if(!(p->i_mb_flags & D_AVAIL)) + { + p->mv[MV_FWD_D3] = MV_NOT_AVAIL; + p->mv[MV_BWD_D3] = MV_NOT_AVAIL; + } + + p->p_col_type = &p->p_col_type_base[p->i_mb_y*p->i_mb_width + p->i_mb_x]; + + p->vbs_mb_intra_pred_flag = 0; + p->vbs_mb_part_intra_pred_flag[0] = p->vbs_mb_part_intra_pred_flag[1] = + p->vbs_mb_part_intra_pred_flag[2] = p->vbs_mb_part_intra_pred_flag[3] = + p->vbs_mb_part_transform_4x4_flag[0] = p->vbs_mb_part_transform_4x4_flag[1] = + p->vbs_mb_part_transform_4x4_flag[2] = p->vbs_mb_part_transform_4x4_flag[3] = 0; + + if (p->ph.b_aec_enable) + { + if (!p->i_mb_x) + { + p->i_chroma_pred_mode_left = 0; + p->i_cbp_left = -1; + + M32(p->p_mvd[0][0]) + = M32(p->p_mvd[0][3]) + = M32(p->p_mvd[1][0]) + = M32(p->p_mvd[1][3]) = 0; + + p->p_ref[0][3] + = p->p_ref[0][6] + = p->p_ref[1][3] + = p->p_ref[1][6] = -1; + + } + else + { + M32(p->p_mvd[0][0]) = M32(p->p_mvd[0][2]); + M32(p->p_mvd[0][3]) = M32(p->p_mvd[0][5]); + M32(p->p_mvd[1][0]) = M32(p->p_mvd[1][2]); + M32(p->p_mvd[1][3]) = M32(p->p_mvd[1][5]); + + p->p_ref[0][3] = p->p_ref[0][5]; + p->p_ref[0][6] = p->p_ref[0][8]; + p->p_ref[1][3] = p->p_ref[1][5]; + p->p_ref[1][6] = p->p_ref[1][8]; + } + + CP16(&p->p_ref[0][1], p->p_ref_top[p->i_mb_x][0]); + CP16(&p->p_ref[1][1], p->p_ref_top[p->i_mb_x][1]); + + M64(p->p_mvd[0][1]) + = M64(p->p_mvd[1][1]) + = M64(p->p_mvd[0][4]) + = M64(p->p_mvd[1][4]) = 0; + + M16(&p->p_ref[0][4]) + = M16(&p->p_ref[0][7]) + = M16(&p->p_ref[1][4]) + = M16(&p->p_ref[1][7]) = -1; + + p->i_pred_mode_chroma_tab[p->i_mb_index] = 0; + } + + } + else + { + if(!(p->i_mb_flags & A_AVAIL)) + { + p->mv[MV_FWD_A1] = MV_NOT_AVAIL; + p->mv[MV_FWD_A3] = MV_NOT_AVAIL; + p->mv[MV_BWD_A1] = MV_NOT_AVAIL; + p->mv[MV_BWD_A3] = MV_NOT_AVAIL; + + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + } + + if(p->i_mb_flags & B_AVAIL) + { + p->mv[MV_FWD_B2] = p->p_top_mv[0][i_offset]; + p->mv[MV_BWD_B2] = p->p_top_mv[1][i_offset]; + p->mv[MV_FWD_B3] = p->p_top_mv[0][i_offset+1]; + p->mv[MV_BWD_B3] = p->p_top_mv[1][i_offset+1]; + + p->i_intra_pred_mode_y[1] = p->p_top_intra_pred_mode_y[i_offset_b4]; + p->i_intra_pred_mode_y[2] = p->p_top_intra_pred_mode_y[i_offset_b4+1]; + p->i_intra_pred_mode_y[3] = p->p_top_intra_pred_mode_y[i_offset_b4+2]; + p->i_intra_pred_mode_y[4] = p->p_top_intra_pred_mode_y[i_offset_b4+3]; + } + else + { + p->mv[MV_FWD_B2] = MV_NOT_AVAIL; + p->mv[MV_FWD_B3] = MV_NOT_AVAIL; + p->mv[MV_BWD_B2] = MV_NOT_AVAIL; + p->mv[MV_BWD_B3] = MV_NOT_AVAIL; + p->i_intra_pred_mode_y[1] = p->i_intra_pred_mode_y[2] = + p->i_intra_pred_mode_y[3] = p->i_intra_pred_mode_y[4] = NOT_AVAIL; + } + + if(p->i_mb_flags & C_AVAIL) + { + p->mv[MV_FWD_C2] = p->p_top_mv[0][i_offset+2]; + p->mv[MV_BWD_C2] = p->p_top_mv[1][i_offset+2]; + } + else + { + p->mv[MV_FWD_C2] = MV_NOT_AVAIL; + p->mv[MV_BWD_C2] = MV_NOT_AVAIL; + } + + if(!(p->i_mb_flags & D_AVAIL)) + { + p->mv[MV_FWD_D3] = MV_NOT_AVAIL; + p->mv[MV_BWD_D3] = MV_NOT_AVAIL; + } + + p->p_col_type = &p->p_col_type_base[p->i_mb_y*p->i_mb_width + p->i_mb_x]; + + p->vbs_mb_intra_pred_flag = 0; + p->vbs_mb_part_intra_pred_flag[0] = p->vbs_mb_part_intra_pred_flag[1] = + p->vbs_mb_part_intra_pred_flag[2] = p->vbs_mb_part_intra_pred_flag[3] = + p->vbs_mb_part_transform_4x4_flag[0] = p->vbs_mb_part_transform_4x4_flag[1] = + p->vbs_mb_part_transform_4x4_flag[2] = p->vbs_mb_part_transform_4x4_flag[3] = 0; + + if (p->ph.b_aec_enable) + { + if (!p->i_mb_x) + { + p->i_chroma_pred_mode_left = 0; + p->i_cbp_left = -1; + M32(p->p_mvd[0][0]) = M32(p->p_mvd[0][3]) = M32(p->p_mvd[1][0]) = M32(p->p_mvd[1][3]) = 0; + p->p_ref[0][3] = p->p_ref[0][6] = p->p_ref[1][3] = p->p_ref[1][6] = -1; + } + else + { + M32(p->p_mvd[0][0]) = M32(p->p_mvd[0][2]); + M32(p->p_mvd[0][3]) = M32(p->p_mvd[0][5]); + M32(p->p_mvd[1][0]) = M32(p->p_mvd[1][2]); + M32(p->p_mvd[1][3]) = M32(p->p_mvd[1][5]); + p->p_ref[0][3] = p->p_ref[0][5]; + p->p_ref[0][6] = p->p_ref[0][8]; + p->p_ref[1][3] = p->p_ref[1][5]; + p->p_ref[1][6] = p->p_ref[1][8]; + } + CP16(&p->p_ref[0][1], p->p_ref_top[p->i_mb_x][0]); + CP16(&p->p_ref[1][1], p->p_ref_top[p->i_mb_x][1]); + M64(p->p_mvd[0][1]) = M64(p->p_mvd[1][1]) = M64(p->p_mvd[0][4]) = M64(p->p_mvd[1][4]) = 0; + M16(&p->p_ref[0][4]) = M16(&p->p_ref[0][7]) = M16(&p->p_ref[1][4]) = M16(&p->p_ref[1][7]) = -1; + p->i_pred_mode_chroma = 0; + } + } + +} + +char AVS_2DVLC_INTRA_dec_4x4[7][40][2] = {{{-1,-1}}}; +char AVS_2DVLC_INTER_dec_4x4[7][40][2] = {{{-1,-1}}}; +const int SCAN_4x4[16][2] = +{ + {0,0},{1,0},{0,1},{0,2}, + {1,1},{2,0},{3,0},{2,1}, + {1,2},{0,3},{1,3},{2,2}, + {3,1},{3,2},{2,3},{3,3} +}; + +const int SCAN[2][64][2] = // [scan_pos][x/y] ATTENTION: the ScanPositions are (pix,lin)! +{ + { + {0,0},{0,1},{0,2},{1,0},{0,3},{0,4},{1,1},{1,2}, + {0,5},{0,6},{1,3},{2,0},{2,1},{0,7},{1,4},{2,2}, + {3,0},{1,5},{1,6},{2,3},{3,1},{3,2},{4,0},{1,7}, + {2,4},{4,1},{2,5},{3,3},{4,2},{2,6},{3,4},{4,3}, + {5,0},{5,1},{2,7},{3,5},{4,4},{5,2},{6,0},{5,3}, + {3,6},{4,5},{6,1},{6,2},{5,4},{3,7},{4,6},{6,3}, + {5,5},{4,7},{6,4},{5,6},{6,5},{5,7},{6,6},{7,0}, + {6,7},{7,1},{7,2},{7,3},{7,4},{7,5},{7,6},{7,7} + }, + { + { 0, 0}, { 1, 0}, { 0, 1}, { 0, 2}, { 1, 1}, { 2, 0}, { 3, 0}, { 2, 1}, + { 1, 2}, { 0, 3}, { 0, 4}, { 1, 3}, { 2, 2}, { 3, 1}, { 4, 0}, { 5, 0}, + { 4, 1}, { 3, 2}, { 2, 3}, { 1, 4}, { 0, 5}, { 0, 6}, { 1, 5}, { 2, 4}, + { 3, 3}, { 4, 2}, { 5, 1}, { 6, 0}, { 7, 0}, { 6, 1}, { 5, 2}, { 4, 3}, + { 3, 4}, { 2, 5}, { 1, 6}, { 0, 7}, { 1, 7}, { 2, 6}, { 3, 5}, { 4, 4}, + { 5, 3}, { 6, 2}, { 7, 1}, { 7, 2}, { 6, 3}, { 5, 4}, { 4, 5}, { 3, 6}, + { 2, 7}, { 3, 7}, { 4, 6}, { 5, 5}, { 6, 4}, { 7, 3}, { 7, 4}, { 6, 5}, + { 5, 6}, { 4, 7}, { 5, 7}, { 6, 6}, { 7, 5}, { 7, 6}, { 6, 7}, { 7, 7} + } +}; + +static UNUSED void cavs_inv_transform_B8 (int curr_blk[8][8]) +{ + int xx, yy; + int tmp[8]; + int t; + int b[8]; + int clip1, clip2; + + clip1 = 0-(1<<(8+7)); + clip2 = (1<<(8+7))-1; + + for( yy = 0; yy < 8; yy++ ) + { + /* Horizontal inverse transform */ + /* Reorder */ + tmp[0] = curr_blk[yy][0]; + tmp[1] = curr_blk[yy][4]; + tmp[2] = curr_blk[yy][2]; + tmp[3] = curr_blk[yy][6]; + tmp[4] = curr_blk[yy][1]; + tmp[5] = curr_blk[yy][3]; + tmp[6] = curr_blk[yy][5]; + tmp[7] = curr_blk[yy][7]; + + /* Downleft Butterfly */ + b[0] = ((tmp[4] - tmp[7])<<1) + tmp[4]; + b[1] = ((tmp[5] + tmp[6])<<1) + tmp[5]; + b[2] = ((tmp[5] - tmp[6])<<1) - tmp[6]; + b[3] = ((tmp[4] + tmp[7])<<1) + tmp[7]; + + b[4] = ((b[0] + b[1] + b[3])<<1) + b[1]; + b[5] = ((b[0] - b[1] + b[2])<<1) + b[0]; + b[6] = ((-b[1] - b[2] + b[3])<<1) + b[3]; + b[7] = ((b[0] - b[2] - b[3])<<1) - b[2]; + + /* Upleft Butterfly */ + t=((tmp[2]*10)+(tmp[3]<<2)); + tmp[3]=((tmp[2]<<2)-(tmp[3]*10)); + tmp[2]=t; + + t = (tmp[0]+tmp[1])<<3; + tmp[1] = (tmp[0]-tmp[1])<<3; + tmp[0] = t; + + b[0]=tmp[0]+tmp[2]; + b[1]=tmp[1]+tmp[3]; + b[2]=tmp[1]-tmp[3]; + b[3]=tmp[0]-tmp[2]; + + /* Last Butterfly */ + curr_blk[yy][0] = (int)((Clip3(clip1,clip2,((b[0]+b[4])+ 4)))>>3); + curr_blk[yy][1] = (int)((Clip3(clip1,clip2,((b[1]+b[5])+ 4)))>>3); + curr_blk[yy][2] = (int)((Clip3(clip1,clip2,((b[2]+b[6])+ 4)))>>3); + curr_blk[yy][3] = (int)((Clip3(clip1,clip2,((b[3]+b[7])+ 4)))>>3); + curr_blk[yy][7] = (int)((Clip3(clip1,clip2,((b[0]-b[4])+ 4)))>>3); + curr_blk[yy][6] = (int)((Clip3(clip1,clip2,((b[1]-b[5])+ 4)))>>3); + curr_blk[yy][5] = (int)((Clip3(clip1,clip2,((b[2]-b[6])+ 4)))>>3); + curr_blk[yy][4] = (int)((Clip3(clip1,clip2,((b[3]-b[7])+ 4)))>>3); + } + + // Vertical inverse transform + for(xx=0; xx<8; xx++) + { + /* Reorder */ + tmp[0] = curr_blk[0][xx]; + tmp[1] = curr_blk[4][xx]; + tmp[2] = curr_blk[2][xx]; + tmp[3] = curr_blk[6][xx]; + tmp[4] = curr_blk[1][xx]; + tmp[5] = curr_blk[3][xx]; + tmp[6] = curr_blk[5][xx]; + tmp[7] = curr_blk[7][xx]; + + /* Downleft Butterfly */ + b[0] = ((tmp[4] - tmp[7])<<1) + tmp[4]; + b[1] = ((tmp[5] + tmp[6])<<1) + tmp[5]; + b[2] = ((tmp[5] - tmp[6])<<1) - tmp[6]; + b[3] = ((tmp[4] + tmp[7])<<1) + tmp[7]; + + b[4] = ((b[0] + b[1] + b[3])<<1) + b[1]; + b[5] = ((b[0] - b[1] + b[2])<<1) + b[0]; + b[6] = ((-b[1] - b[2] + b[3])<<1) + b[3]; + b[7] = ((b[0] - b[2] - b[3])<<1) - b[2]; + + /* Upleft Butterfly */ + t = ((tmp[2]*10)+(tmp[3]<<2)); + tmp[3] = ((tmp[2]<<2)-(tmp[3]*10)); + tmp[2] = t; + + t = (tmp[0]+tmp[1])<<3; + tmp[1] = (tmp[0]-tmp[1])<<3; + tmp[0] = t; + + b[0] = tmp[0] + tmp[2]; + b[1] = tmp[1] + tmp[3]; + b[2] = tmp[1] - tmp[3]; + b[3] = tmp[0] - tmp[2]; + + curr_blk[0][xx]=(Clip3(clip1,clip2,(b[0]+b[4])+64))>>7; + curr_blk[1][xx]=(Clip3(clip1,clip2,(b[1]+b[5])+64))>>7; + curr_blk[2][xx]=(Clip3(clip1,clip2,(b[2]+b[6])+64))>>7; + curr_blk[3][xx]=(Clip3(clip1,clip2,(b[3]+b[7])+64))>>7; + curr_blk[7][xx]=(Clip3(clip1,clip2,(b[0]-b[4])+64))>>7; + curr_blk[6][xx]=(Clip3(clip1,clip2,(b[1]-b[5])+64))>>7; + curr_blk[5][xx]=(Clip3(clip1,clip2,(b[2]-b[6])+64))>>7; + curr_blk[4][xx]=(Clip3(clip1,clip2,(b[3]-b[7])+64))>>7; + } +} + +static UNUSED void cavs_add_c(uint8_t *dst, int idct8x8[8][8], int stride ) +{ + int i; + + uint8_t *cm = crop_table + MAX_NEG_CROP; + + for( i = 0; i < 8; i++ ) + { + dst[i + 0*stride] = cm[ dst[i + 0*stride] + idct8x8[0][i]]; + dst[i + 1*stride] = cm[ dst[i + 1*stride] + idct8x8[1][i]]; + dst[i + 2*stride] = cm[ dst[i + 2*stride] + idct8x8[2][i]]; + dst[i + 3*stride] = cm[ dst[i + 3*stride] + idct8x8[3][i]]; + dst[i + 4*stride] = cm[ dst[i + 4*stride] + idct8x8[4][i]]; + dst[i + 5*stride] = cm[ dst[i + 5*stride] + idct8x8[5][i]]; + dst[i + 6*stride] = cm[ dst[i + 6*stride] + idct8x8[6][i]]; + dst[i + 7*stride] = cm[ dst[i + 7*stride] + idct8x8[7][i]]; + } +} + +static int get_residual_block(cavs_decoder *p,const cavs_vlc *p_vlc_table, + int i_escape_order,int i_qp, uint8_t *p_dest, int i_stride, int b_chroma) +{ + int i,pos = -1; + int *level_buf = p->level_buf; + int *run_buf = p->run_buf; + int dqm = dequant_mul[i_qp]; + int dqs = dequant_shift[i_qp]; + int dqa = 1 << (dqs - 1); + const uint8_t *zigzag = p->ph.b_picture_structure==0 ? zigzag_field : zigzag_progressive; + DCTELEM *block = p->p_block; + + DECLARE_ALIGNED_16(short dct8x8[8][8]); + + memset(dct8x8, 0, 64*sizeof(int16_t)); + + i = p->bs_read_coeffs(p, p_vlc_table, i_escape_order, b_chroma); + if( i == -1 || p->b_error_flag ) + { + return -1; + } + + if( !p->b_weight_quant_enable ) + { + while(--i >= 0) + { + pos += run_buf[i]; + if(pos > 63) + { + p->b_error_flag = 1; + + return -1; + } + + block[zigzag[pos]] = (level_buf[i]*dqm + dqa) >> dqs; + } + } + else + { + int m, n; + + while(--i >= 0) + { + pos += run_buf[i]; + if(pos > 63) + { + p->b_error_flag = 1; + + return -1; + } + + m = SCAN[p->ph.b_picture_structure][pos][0]; + n = SCAN[p->ph.b_picture_structure][pos][1]; + + /* NOTE : bug will conflict with idct asm when Win32-Release, don't why now */ + block[zigzag[pos]] = (((((int)(level_buf[i]*p->cur_wq_matrix[n*8+m])>>3)*dqm)>>4) + dqa) >> dqs; + } + } + + cavs_idct8_add(p_dest, block, i_stride); + + return 0; +} + +static int get_residual_block4x4(cavs_decoder *p, int i_qp, uint8_t *p_dest4x4, int i_stride, int intra) +{ + int i,ipos; + int level, run, mask, symbol2D; + int level_buf[64]; + int run_buf[64]; + int dqm, dqs, dqa; + + static const int incLevel_intra[7]={0,1,2,3,4,6,3000}; + static const int incRun_intra[7]={-1,3,17,17,17,17,17}; + static const int incLevel_inter[7]={0,1,1,2,3,5,3000}; + static const int incRun_inter[7]={-1,3,6,17,17,17,17}; + static const int level1_inter[16]={1,1,1,1,2,2,2,3,3,3,3,3,3,3,3,3}; + static const int level1_intra[16]={1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2}; + DCTELEM *block = p->p_block; + int CurrentVLCTable=0; + int abslevel; + + int EOB_Pos_4x4[7] = {-1,0,0,0,0,0,0}; + const char (*table2D_4x4)[16]; + const char (*table2D_inter_4x4)[14]; +#define assert(_Expression) ((void)0) + + int PreviousRunCnt = 0; + int vlc_numcoef = 0; + int ii, jj; + int abs_lev_diff; + + dqm = dequant_mul[i_qp - p->ph.vbs_qp_shift]; + dqs = dequant_shift[i_qp - p->ph.vbs_qp_shift]/* - 1*/; + dqa = 1 << (dqs - 1); + + if(AVS_2DVLC_INTRA_dec_4x4[0][0][1]<0) + { + memset(AVS_2DVLC_INTRA_dec_4x4,-1,sizeof(AVS_2DVLC_INTRA_dec_4x4)); + for(i=0;i<7;i++) + { + table2D_4x4=intra_2dvlc_4x4[i]; + for(run=0;run<16;run++) + for(level=0;level<16;level++) + { + ipos=table2D_4x4[run][level]; + assert(ipos<40); + if(ipos>=0) + { + if(i==0) + { + AVS_2DVLC_INTRA_dec_4x4[i][ipos][0]=level+1; + AVS_2DVLC_INTRA_dec_4x4[i][ipos][1]=run; + + AVS_2DVLC_INTRA_dec_4x4[i][ipos+1][0]=-(level+1); + AVS_2DVLC_INTRA_dec_4x4[i][ipos+1][1]=run; + } + else + { + AVS_2DVLC_INTRA_dec_4x4[i][ipos][0]=level; + AVS_2DVLC_INTRA_dec_4x4[i][ipos][1]=run; + if(level) + { + AVS_2DVLC_INTRA_dec_4x4[i][ipos+1][0]=-(level); + AVS_2DVLC_INTRA_dec_4x4[i][ipos+1][1]=run; + } + } + } + } + } + assert(AVS_2DVLC_INTRA_dec_4x4[0][0][1]>=0); //otherwise, tables are bad. + } + if(AVS_2DVLC_INTER_dec_4x4[0][0][1]<0) // Don't need to set this every time. rewrite later. + { + memset(AVS_2DVLC_INTER_dec_4x4,-1,sizeof(AVS_2DVLC_INTER_dec_4x4)); + for(i=0;i<7;i++) + { + table2D_inter_4x4=inter_2dvlc_4x4[i]; + for(run=0;run<16;run++) + for(level=0;level<14;level++) + { + ipos=table2D_inter_4x4[run][level]; + assert(ipos<40); + if(ipos>=0) + { + if(i==0) + { + AVS_2DVLC_INTER_dec_4x4[i][ipos][0]=level+1; + AVS_2DVLC_INTER_dec_4x4[i][ipos][1]=run; + + AVS_2DVLC_INTER_dec_4x4[i][ipos+1][0]=-(level+1); + AVS_2DVLC_INTER_dec_4x4[i][ipos+1][1]=run; + } + else + { + AVS_2DVLC_INTER_dec_4x4[i][ipos][0]=level; + AVS_2DVLC_INTER_dec_4x4[i][ipos][1]=run; + + if(level) + { + AVS_2DVLC_INTER_dec_4x4[i][ipos+1][0]=-(level); + AVS_2DVLC_INTER_dec_4x4[i][ipos+1][1]=run; + } + } + } + } + } + assert(AVS_2DVLC_INTER_dec_4x4[0][0][1]>=0); //otherwise, tables are bad. + } + + if (intra) + { + CurrentVLCTable = 0; + PreviousRunCnt = 0; + for(i=0;i<17;i++) + { + symbol2D = cavs_bitstream_get_ue_k(&p->s,VLC_GC_Order_INTRA[CurrentVLCTable][0]); + if(symbol2D==EOB_Pos_4x4[CurrentVLCTable]) + { + vlc_numcoef = i; // 0~i last is "0"? rm上的 + break; + } + if(symbol2D >= ESCAPE_CODE_PART2) + { + abs_lev_diff = 2+(symbol2D-ESCAPE_CODE_PART2)/2; + mask = -(symbol2D & 1);//0或-1 + symbol2D = cavs_bitstream_get_ue_k(&p->s,0); + run = symbol2D; + if (run > 16) + { + p->b_error_flag = 1; + return -1; + } + level = abs_lev_diff + LEVRUN_INTRA[CurrentVLCTable][run]; + level = (level^mask) - mask; + } + else if (symbol2D>=ESCAPE_CODE_PART1) + { + run =((symbol2D-ESCAPE_CODE_PART1)&31)/2; + level =1+LEVRUN_INTRA[CurrentVLCTable][run]; + mask = -(symbol2D & 1);//0或-1 + level = (level^mask) - mask; + } + else + { + level = AVS_2DVLC_INTRA_dec_4x4[CurrentVLCTable][symbol2D][0]; + run = AVS_2DVLC_INTRA_dec_4x4[CurrentVLCTable][symbol2D][1]; + } + level_buf[i] = level; + run_buf[i] = run; + PreviousRunCnt += run+1; + + abslevel = abs(level); + if(abslevel>=incLevel_intra[CurrentVLCTable]) + { + if (abslevel == 1) + { + if (run > 16) + { + p->b_error_flag = 1; + return -1; + } + + CurrentVLCTable = (run > incRun_intra[CurrentVLCTable]) ? level1_intra[run] : CurrentVLCTable; + } + else if (abslevel < 4) + { + CurrentVLCTable = (abslevel + 1); + } + else if (abslevel < 6) + { + CurrentVLCTable = 5; + } + else + { + CurrentVLCTable = 6; + } + } + + if (PreviousRunCnt==16) + { + vlc_numcoef=i+1; + break; + } + + } + ipos = -1; + for (i = 0; i= 16) + { + p->b_error_flag = 1; + break; + } + ii = SCAN_4x4[ipos][0]; + jj = SCAN_4x4[ipos][1]; + + //Juncheng: It's for weighted quantization + block[jj*8 + ii] = (level_buf[vlc_numcoef-1-i]*dqm + dqa) >> dqs; + } + } + else //inter + { + CurrentVLCTable = 0; + PreviousRunCnt = 0; + + for(i=0;i<17;i++) + { + symbol2D = cavs_bitstream_get_ue_k(&p->s,VLC_GC_Order_INTER[CurrentVLCTable][0]); + if(symbol2D==EOB_Pos_4x4[CurrentVLCTable]) + { + vlc_numcoef = i; // 0~i last is "0"? rm上的 + break; + } + if(symbol2D >= ESCAPE_CODE_PART2) + { + abs_lev_diff = 2+(symbol2D-ESCAPE_CODE_PART2)/2; + mask = -(symbol2D & 1);//0或-1 + symbol2D = cavs_bitstream_get_ue_k(&p->s,0); + run = symbol2D; + if (run > 16) + { + p->b_error_flag = 1; + return -1; + } + level = abs_lev_diff + LEVRUN_INTER[CurrentVLCTable][run]; + level = (level^mask) - mask; + } + else if (symbol2D>=ESCAPE_CODE_PART1) + { + run =((symbol2D-ESCAPE_CODE_PART1)&31)/2; + level =1 + LEVRUN_INTER[CurrentVLCTable][run]; + mask = -(symbol2D & 1);//0或-1 + level = (level^mask) - mask; + } + else + { + level = AVS_2DVLC_INTER_dec_4x4[CurrentVLCTable][symbol2D][0]; + run = AVS_2DVLC_INTER_dec_4x4[CurrentVLCTable][symbol2D][1]; + } + level_buf[i] = level; + run_buf[i] = run; + PreviousRunCnt += run+1; + + abslevel = abs(level); + if(abslevel>=incLevel_inter[CurrentVLCTable]) + { + if (abslevel == 1) + { + if (run > 16) + { + p->b_error_flag = 1; + return -1; + } + + CurrentVLCTable = (run > incRun_inter[CurrentVLCTable]) ? level1_inter[run] : CurrentVLCTable; + } + else if (abslevel == 2) + { + CurrentVLCTable = 4; + } + else if (abslevel <= 4) + { + CurrentVLCTable = 5; + } + else + { + CurrentVLCTable = 6; + } + } + + if (PreviousRunCnt==16) + { + vlc_numcoef=i+1; + break; + } + + } + ipos = -1; + for (i = 0; i= 16) + { + p->b_error_flag = 1; + break; + } + ii = SCAN_4x4[ipos][0]; + jj = SCAN_4x4[ipos][1]; + block[jj*8 + ii] = (level_buf[vlc_numcoef-1-i]*dqm + dqa) >> dqs; + } + } + + add4x4_idct(p_dest4x4, block, i_stride); + memset(block, 0, 64*sizeof(DCTELEM)); + + return 0; +} + +static inline void scale_mv(cavs_decoder *p, int *d_x, int *d_y, cavs_vector *src, int distp) +{ + + int den; + + if(abs(src->ref) > 3) + { + p->b_error_flag = 1; + return; + } + + den = p->i_scale_den[src->ref]; + + *d_x = (src->x*distp*den + 256 + (src->x>>31)) >> 9; + *d_y = (src->y*distp*den + 256 + (src->y>>31)) >> 9; +} + +static inline int mid_pred(int a, int b, int c) +{ + if(a>b){ + if(c>b){ + if(c>a) b=a; + else b=c; + } + }else{ + if(b>c){ + if(c>a) b=c; + else b=a; + } + } + return b; + +} + +static inline void mv_pred_median(cavs_decoder *p, cavs_vector *mvP, cavs_vector *mvA, cavs_vector *mvB, cavs_vector *mvC) +{ + int ax, ay, bx, by, cx, cy; + int len_ab, len_bc, len_ca, len_mid; + + /* scale candidates according to their temporal span */ + scale_mv(p, &ax, &ay, mvA, mvP->dist); + if(p->b_error_flag) + return; + scale_mv(p, &bx, &by, mvB, mvP->dist); + if(p->b_error_flag) + return; + scale_mv(p, &cx, &cy, mvC, mvP->dist); + if(p->b_error_flag) + return; + + /* find the geometrical median of the three candidates */ + len_ab = abs(ax - bx) + abs(ay - by); + len_bc = abs(bx - cx) + abs(by - cy); + len_ca = abs(cx - ax) + abs(cy - ay); + len_mid = mid_pred(len_ab, len_bc, len_ca); + + if(len_mid == len_ab) + { + mvP->x = cx; + mvP->y = cy; + } + else if(len_mid == len_bc) + { + mvP->x = ax; + mvP->y = ay; + } + else + { + mvP->x = bx; + mvP->y = by; + } +} + + +static inline int get_residual_inter(cavs_decoder *p,int i_mb_type) +{ + int block; + int i_stride = p->cur.i_stride[0]; + uint8_t *p_d; + int i_qp_cb, i_qp_cr; + int i_ret = 0; + + for(block = 0; block < 4; block++) + { + if(p->i_cbp & (1<p_y + p->i_luma_offset[block]; + if (p->vbs_mb_part_transform_4x4_flag[block]) + { + int i; + + for (i = 0; i < 4; i++) + if (p->i_cbp_part[block] & (1<i_qp, p_d + (i>>1)*4*i_stride + (i&1)*4, i_stride, 0); + } + else + { + i_ret = get_residual_block(p, inter_2dvlc, 0, p->i_qp, p_d, i_stride, 0); + if(i_ret == -1) + return -1; + } + } + } + + /* FIXIT : weighting quant qp for chroma + NOTE : not modify p->i_qp directly + */ + if( p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ) + { + i_qp_cb = clip3_int( p->i_qp + p->ph.chroma_quant_param_delta_u, 0, 63 ); + i_qp_cr = clip3_int( p->i_qp + p->ph.chroma_quant_param_delta_v, 0, 63 ); + } + + if(p->i_cbp & (1<<4)) + { + i_ret = get_residual_block(p, chroma_2dvlc, 0, + chroma_qp[p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ? i_qp_cb : p->i_qp], + p->p_cb, p->cur.i_stride[1], 1); + if(i_ret == -1) + return -1; + } + if(p->i_cbp & (1<<5)) + { + i_ret = get_residual_block(p, chroma_2dvlc, 0, + chroma_qp[ p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ? i_qp_cr : p->i_qp], + p->p_cr, p->cur.i_stride[2], 1); + if(i_ret == -1) + return -1; + } + + return 0; +} + + +static inline void adapt_pred_mode(int i_num, int *p_mode) +{ + static const uint32_t adapt_tale[4][/*8*/20] = + { + { 0,-1, 6,-1,-1, 7, 6, 7, 8, 9, I_PRED_4x4_DC_TOP, 11, 12, 13, 14, 15, 16, 17, 18, 19}, + {-1, 1, 5,-1,-1, 5, 7, 7, 8, 9, I_PRED_4x4_DC_LEFT, 11, 12, 13, 14, 15, 16, 17, I_PRED_4x4_DC_128, 19}, + { 5,-1, 2,-1, 6, 5, 6,-1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}, + { 4, 1,-1,-1, 4, 6, 6,-1, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19} + }; + + *p_mode = adapt_tale[i_num][*p_mode]; + if(*p_mode < 0) + { + *p_mode = 0; + } +} + +static inline void load_intra_pred_chroma(cavs_decoder *p) +{ + int i_offset=p->i_mb_x*10; + + p->i_left_border_cb[9] = p->i_left_border_cb[8]; + p->i_left_border_cr[9] = p->i_left_border_cr[8]; + if(p->i_mb_x==p->i_mb_width-1) + { + p->p_top_border_cb[i_offset+9] = p->p_top_border_cb[i_offset+8]; + p->p_top_border_cr[i_offset+9] = p->p_top_border_cr[i_offset+8]; + } + else + { + p->p_top_border_cb[i_offset+9] = p->p_top_border_cb[i_offset+11]; + p->p_top_border_cr[i_offset+9] = p->p_top_border_cr[i_offset+11]; + } + + if(p->i_mb_x && p->i_mb_y&&p->b_first_line==0) + { + p->p_top_border_cb[i_offset] = p->i_left_border_cb[0] = p->i_topleft_border_cb; + p->p_top_border_cr[i_offset] = p->i_left_border_cr[0] = p->i_topleft_border_cr; + } + else + { + p->i_left_border_cb[0] = p->i_left_border_cb[1]; + p->i_left_border_cr[0] = p->i_left_border_cr[1]; + p->p_top_border_cb[i_offset] = p->p_top_border_cb[i_offset+1]; + p->p_top_border_cr[i_offset] = p->p_top_border_cr[i_offset+1]; + } +} + +static void load_intra_4x4_pred_luma(cavs_decoder *p ,uint8_t *src, uint8_t edge[17], int idx) +{ +#define SRC(x,y) src[(x) + (y)*i_stride] +#define EP (edge+8) + int i_stride = p->cur.i_stride[0]; + int i_neighbor = p->i_neighbour4[idx]; + int have_lt = i_neighbor & MB_TOPLEFT; + int have_tr = i_neighbor & MB_TOPRIGHT; + int have_dl = i_neighbor & MB_DOWNLEFT; + + if( i_neighbor & MB_LEFT ) + { + if (offset_block4x4[idx][0] == 0) + { + EP[-1] = p->i_left_border_y[1 + offset_block4x4[idx][1]*4 + 0]; + EP[-2] = p->i_left_border_y[1 + offset_block4x4[idx][1]*4 + 1]; + EP[-3] = p->i_left_border_y[1 + offset_block4x4[idx][1]*4 + 2]; + EP[-4] = p->i_left_border_y[1 + offset_block4x4[idx][1]*4 + 3]; + if (have_dl) + { + EP[-5] = p->i_left_border_y[1 + offset_block4x4[idx][1]*4 + 4]; + EP[-6] = p->i_left_border_y[1 + offset_block4x4[idx][1]*4 + 5]; + EP[-7] = p->i_left_border_y[1 + offset_block4x4[idx][1]*4 + 6]; + EP[-8] = p->i_left_border_y[1 + offset_block4x4[idx][1]*4 + 7]; + } + else + { + MPIXEL_X4(&EP[-8]) = PIXEL_SPLAT_X4(EP[-4]); + } + } + else + { + EP[-1] = SRC(-1, 0); + EP[-2] = SRC(-1, 1); + EP[-3] = SRC(-1, 2); + EP[-4] = SRC(-1, 3); + if (have_dl) + { + EP[-5] = SRC(-1, 4); + EP[-6] = SRC(-1, 5); + EP[-7] = SRC(-1, 6); + EP[-8] = SRC(-1, 7); + } + else + { + //EP[-5] = EP[-6] = EP[-7] = EP[-8] = EP[-4]; + MPIXEL_X4(&EP[-8]) = PIXEL_SPLAT_X4(EP[-4]); + } + } + + EP[0] = EP[-1]; + } + if (i_neighbor & MB_TOP) + { + if (offset_block4x4[idx][1] == 0) + { + MPIXEL_X4(&EP[1]) = + MPIXEL_X4(&p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE+offset_block4x4[idx][0]*4]); + if (have_tr) + { + MPIXEL_X4(&EP[5]) = + MPIXEL_X4(&p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE+offset_block4x4[idx][0]*4+4]); + } + else + { + MPIXEL_X4(&EP[5]) = + PIXEL_SPLAT_X4(p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE+offset_block4x4[idx][0]*4+3]); + } + } + else + { + MPIXEL_X4(&EP[1]) = SRC_X4(0, -1); + if (have_tr) + { + MPIXEL_X4(&EP[5]) = SRC_X4(4, -1); + } + else + { + MPIXEL_X4(&EP[5]) = PIXEL_SPLAT_X4(SRC(3, -1)); + } + } + + EP[0] = EP[1]; + } + + if (have_lt) + { + if (idx == 0) + { + EP[0] = p->i_topleft_border_y; + } + else if (offset_block4x4[idx][0] == 0) + { + EP[0] = p->i_left_border_y[/*1 + */offset_block4x4[idx][1]*4 /*- 1*/]; + } + else if (offset_block4x4[idx][1] == 0) + { + EP[0] = p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE + offset_block4x4[idx][0]*4 - 1]; + } + else + { + EP[0] = SRC(-1,-1); + } + } +#undef SRC +#undef EP +} + +static inline void load_intra_pred_luma(cavs_decoder *p, uint8_t *p_top,uint8_t **pp_left, int block) +{ + int i; + + switch( block ) + { + case 0: + *pp_left = p->i_left_border_y; + p->i_left_border_y[0] = p->i_left_border_y[1]; + //memset( &p->i_left_border_y[17], p->i_left_border_y[16], 9); + memcpy( &p_top[1], &p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE], 16); + p_top[17] = p_top[16]; + p_top[0] = p_top[1]; + if((p->i_mb_flags & A_AVAIL) && (p->i_mb_flags & B_AVAIL)) + p->i_left_border_y[0] = p_top[0] = p->i_topleft_border_y; + break; + + case 1: + *pp_left = p->i_internal_border_y; + for( i = 0; i < 8; i++) + { + p->i_internal_border_y[i+1] = *(p->p_y + 7 + i*p->cur.i_stride[0]); + } + + //由于下边块(索引为3)未解码所以9以后的象素直接用象素8的值 + //当解码1,3块的时候由于左边块c[i]只有1~8是可用的,其他的还未解码,所以不可用 + //所以不可能采用Intra_8x8_Down_Left,Intra_8x8_Down_Right模式,所以不可能采用17位的象素 + memset( &p->i_internal_border_y[9], p->i_internal_border_y[8], 9); + p->i_internal_border_y[0] = p->i_internal_border_y[1]; + memcpy( &p_top[1], &p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE+8], 8 ); + if( p->i_mb_flags & C_AVAIL ) + memcpy( &p_top[9], &p->p_top_border_y[(p->i_mb_x + 1)*CAVS_MB_SIZE], 8 ); + else + memset( &p_top[9], p_top[8], 9 ); + p_top[17] =p_top[16]; + p_top[0] = p_top[1]; + if(p->i_mb_flags & B_AVAIL) + p->i_internal_border_y[0] = p_top[0] = p->p_top_border_y[p->i_mb_x*CAVS_MB_SIZE+7]; + break; + + case 2: + *pp_left = &p->i_left_border_y[8]; + memcpy( &p_top[1], p->p_y + 7*p->cur.i_stride[0], 16); + p_top[17] = p_top[16]; + p_top[0] = p_top[1]; + if(p->i_mb_flags & A_AVAIL) + p_top[0] = p->i_left_border_y[8]; + break; + + case 3: + *pp_left = &p->i_internal_border_y[8]; + for(i=0;i<8;i++) + { + p->i_internal_border_y[i+9] = *(p->p_y + 7 + (i+8)*p->cur.i_stride[0]); + } + memset( &p->i_internal_border_y[17], p->i_internal_border_y[16], 9 ); + memcpy( &p_top[0], p->p_y + 7 + 7*p->cur.i_stride[0], 9 ); + memset( &p_top[9], p_top[8], 9 ); + break; + } +} + +static inline void mv_pred_sym(cavs_decoder *p, cavs_vector *src, enum cavs_block_size size,int i_ref) +{ + cavs_vector *dst = src + MV_BWD_OFFS; + + /* backward mv is the scaled and negated forward mv */ + if(p->ph.b_picture_structure==0) + { + int iBlockDistanceBw, iBlockDistanceFw; + + dst->ref = 1-i_ref; + + if( (abs(i_ref) > 1) + || (abs(dst->ref) > 3) ) + { + p->b_error_flag = 1; + return; + } + + if( p->param.b_accelerate ) + { + iBlockDistanceFw = (p->cur_aec.i_distance_index-p->ref_aec[i_ref+2].i_distance_index+512)%512; + iBlockDistanceBw = (p->ref_aec[dst->ref].i_distance_index-p->cur_aec.i_distance_index+512)%512; + } + else + { + iBlockDistanceFw = (p->cur.i_distance_index-p->ref[i_ref+2].i_distance_index+512)%512; + iBlockDistanceBw = (p->ref[dst->ref].i_distance_index-p->cur.i_distance_index+512)%512; + } + + if( iBlockDistanceFw == 0 ) + { + p->b_error_flag = 1; + return; + } + + dst->x = -((src->x * iBlockDistanceBw*(512/iBlockDistanceFw) + 256) >> 9); + dst->y = -((src->y * iBlockDistanceBw*(512/iBlockDistanceFw) + 256) >> 9); + } + else + { + dst->ref = i_ref; + dst->x = -((src->x * p->i_sym_factor + 256) >> 9); + dst->y = -((src->y * p->i_sym_factor + 256) >> 9); + } + + copy_mvs(dst, size); +} + +//down8x8(for mvd context of cabac only): 1 if the block index is 2 or 3, 0 if it's 0 or 1 +static void mv_pred(cavs_decoder *p, uint8_t nP,uint8_t nC, + enum cavs_mv_pred mode, enum cavs_block_size size, int ref, int mvd_scan_idx) +{ + cavs_vector *mvP = &p->mv[nP]; + cavs_vector *mvA = &p->mv[nP-1]; + cavs_vector *mvB = &p->mv[nP-4]; + cavs_vector *mvC = &p->mv[nC]; + const cavs_vector *mvP2 = NULL; + const int i_list = nP >= MV_BWD_OFFS; + + mvP->ref = ref; + mvP->dist = p->i_ref_distance[mvP->ref]; + if(mvC->ref == NOT_AVAIL) + mvC = &p->mv[nP-5]; // set to top-left (mvD) + if((mode == MV_PRED_PSKIP) && + ((mvA->ref == NOT_AVAIL) || (mvB->ref == NOT_AVAIL) || + ((mvA->x | mvA->y /*| mvA->ref*/) == 0 && mvA->ref == PSKIP_REF) || + ((mvB->x | mvB->y /*| mvB->ref*/) == 0 && mvB->ref == PSKIP_REF) )) + { + mvP2 = &MV_NOT_AVAIL; + /* if there is only one suitable candidate, take it */ + } + else if((mvA->ref >= 0) && (mvB->ref < 0) && (mvC->ref < 0)) + { + mvP2= mvA; + } + else if((mvA->ref < 0) && (mvB->ref >= 0) && (mvC->ref < 0)) + { + mvP2= mvB; + } + else if((mvA->ref < 0) && (mvB->ref < 0) && (mvC->ref >= 0)) + { + mvP2= mvC; + } + else if(mode == MV_PRED_LEFT && mvA->ref == ref) + { + mvP2= mvA; + } + else if(mode == MV_PRED_TOP && mvB->ref == ref) + { + mvP2= mvB; + } + else if(mode == MV_PRED_TOPRIGHT && mvC->ref == ref) + { + mvP2= mvC; + } + + if(mvP2) + { + mvP->x = mvP2->x; + mvP->y = mvP2->y; + } + else + { + mv_pred_median(p, mvP, mvA, mvB, mvC); + if(p->b_error_flag) + return; + } + + if(mode < MV_PRED_PSKIP) + { + mvP->x += p->bs_read_mvd(p, i_list, mvd_scan_idx, 0); + if( p->b_error_flag ) + return; + mvP->y += p->bs_read_mvd(p, i_list, mvd_scan_idx, 1); + if( p->b_error_flag ) + return; + } + copy_mvs(mvP,size); +} + +static void mv_pred_sub_direct(cavs_decoder *p,cavs_vector *mv, int i_Offset,uint8_t nP,uint8_t nC, + enum cavs_mv_pred mode, enum cavs_block_size size, int ref) +{ + cavs_vector *mvP = &p->mv[nP]; + cavs_vector *mvA = &mv[MV_FWD_A1+i_Offset]; + cavs_vector *mvB = &mv[MV_FWD_B2+i_Offset]; + cavs_vector *mvC = &mv[MV_FWD_C2+i_Offset]; + const cavs_vector *mvP2 = NULL; + + mvP->ref = ref; + mvP->dist = p->i_ref_distance[mvP->ref]; + if(mvC->ref == NOT_AVAIL) + mvC = &mv[MV_FWD_D3+i_Offset]; // set to top-left (mvD) + if((mode == MV_PRED_PSKIP) && + ((mvA->ref == NOT_AVAIL) || (mvB->ref == NOT_AVAIL) || + ((mvA->x | mvA->y | mvA->ref) == 0) || + ((mvB->x | mvB->y | mvB->ref) == 0) )) + { + mvP2 = &MV_NOT_AVAIL; + /* if there is only one suitable candidate, take it */ + } + else if((mvA->ref >= 0) && (mvB->ref < 0) && (mvC->ref < 0)) + { + mvP2= mvA; + } + else if((mvA->ref < 0) && (mvB->ref >= 0) && (mvC->ref < 0)) + { + mvP2= mvB; + } + else if((mvA->ref < 0) && (mvB->ref < 0) && (mvC->ref >= 0)) + { + mvP2= mvC; + } + else if(mode == MV_PRED_LEFT && mvA->ref == ref) + { + mvP2= mvA; + } + else if(mode == MV_PRED_TOP && mvB->ref == ref) + { + mvP2= mvB; + } + else if(mode == MV_PRED_TOPRIGHT && mvC->ref == ref) + { + mvP2= mvC; + } + if(mvP2) + { + mvP->x = mvP2->x; + mvP->y = mvP2->y; + } + else + { + mv_pred_median(p, mvP, mvA, mvB, mvC); + if(p->b_error_flag) + return; + } +} + +static inline void get_b_frame_ref(cavs_decoder *p, int *p_ref) +{ + if(p->ph.b_picture_structure==0&&p->ph.b_picture_reference_flag==0 ) + { + *p_ref = cavs_bitstream_get_bit1(&p->s); //mb_reference_index + } + else + { + *p_ref=0; + } +} + +static const uint8_t mv_scan[4] = +{ + MV_FWD_X0,MV_FWD_X1, + MV_FWD_X2,MV_FWD_X3 +}; + +static const uint8_t mvd_scan[4] = +{ + 1, 2, 4, 5 +}; + +static const uint8_t ref_scan[4] = +{ + 4, 5, 7, 8 +}; + +static inline void mv_pred_direct(cavs_decoder *p, cavs_vector *pmv_fw, cavs_vector *col_mv, + int iDistanceIndexRef, int iDistanceIndexFw, int iDistanceIndexBw, + int deltaRef, int deltaMvFw, int deltaMvBw) +{ + int iDistanceIndexCur = p->param.b_accelerate?p->cur_aec.i_distance_index:p->cur.i_distance_index; + int iBlockDistanceRef; + cavs_vector *pmv_bw = pmv_fw + MV_BWD_OFFS; + + int den; + int m = col_mv->x >> 31; + + if(abs(col_mv->ref) > 3) + { + p->b_error_flag = 1; + return; + } + + den = p->i_direct_den[col_mv->ref]; + + iBlockDistanceRef = (iDistanceIndexBw - iDistanceIndexRef + 512) % 512; + pmv_fw->dist = (iDistanceIndexCur - iDistanceIndexFw + 512) % 512; + pmv_bw->dist = (iDistanceIndexBw - iDistanceIndexCur + 512) % 512; + den = (iBlockDistanceRef == 0) ? 0 : 16384/iBlockDistanceRef; + + if(m) + { + pmv_fw->x = -((den-den*col_mv->x*pmv_fw->dist-1)>>14); + pmv_bw->x = (den-den*col_mv->x*pmv_bw->dist-1)>>14; + } + else + { + pmv_fw->x = ((den+den*col_mv->x*pmv_fw->dist-1)>>14); + pmv_bw->x = -((den+den*col_mv->x*pmv_bw->dist-1)>>14); + } + + m = (col_mv->y + deltaRef) >> 31; + if(m) + { + pmv_fw->y = -((den-den*(col_mv->y+deltaRef)*pmv_fw->dist-1)>>14) - deltaMvFw; + pmv_bw->y = ((den-den*(col_mv->y+deltaRef)*pmv_bw->dist-1)>>14) - deltaMvBw; + } + else + { + pmv_fw->y = ((den+den*(col_mv->y+deltaRef)*pmv_fw->dist-1)>>14) - deltaMvFw; + pmv_bw->y = -((den+den*(col_mv->y+deltaRef)*pmv_bw->dist-1)>>14) - deltaMvBw; + } +} + +static inline void get_col_info(cavs_decoder *p, uint8_t *p_col_type, cavs_vector **pp_mv, int block) +{ + int i_mb_offset = p->i_mb_index >= p->i_mb_num_half ? p->i_mb_num_half : 0; + int b_interlaced = p->param.b_interlaced; + + if( !b_interlaced ) + { + *pp_mv = &p->p_col_mv[(p->i_mb_index /*- NEW_DIRECT * i_mb_offset*/)*4+block]; + *p_col_type = p->p_col_type_base[(p->i_mb_index/* - NEW_DIRECT * i_mb_offset*/)]; + } + else + { + *pp_mv = &p->p_col_mv[(p->i_mb_index - NEW_DIRECT * i_mb_offset)*4+block]; + *p_col_type = p->p_col_type_base[(p->i_mb_index - NEW_DIRECT * i_mb_offset)]; + } + + if( p->param.b_accelerate ) + { + if( p->p_save_aec[1] == NULL ) + { + p->b_error_flag = 1; + return; + } + + if(p->ph.b_picture_structure && p->p_save_aec[1]->b_picture_structure == 0) + { + i_mb_offset = p->i_mb_y/2*p->i_mb_width; + *p_col_type = p->p_col_type_base[i_mb_offset + p->i_mb_x]; + *pp_mv = &p->p_col_mv[(i_mb_offset+p->i_mb_x)*4+(block%2)+2*(p->i_mb_y%2)]; + } + + if(p->ph.b_picture_structure == 0 && p->p_save_aec[1]->b_picture_structure) + { + i_mb_offset = p->i_mb_y*p->i_mb_width-i_mb_offset; + i_mb_offset *= 2; + if(block > 1) + i_mb_offset += p->i_mb_width; + *p_col_type = p->p_col_type_base[i_mb_offset + p->i_mb_x]; + *pp_mv = &p->p_col_mv[(i_mb_offset+p->i_mb_x)*4+(block%2)]; + } + } + else + { + if( p->p_save[1] == NULL ) + { + p->b_error_flag = 1; + return; + } + + if(p->ph.b_picture_structure && p->p_save[1]->b_picture_structure == 0) + { + i_mb_offset = p->i_mb_y/2*p->i_mb_width; + *p_col_type = p->p_col_type_base[i_mb_offset + p->i_mb_x]; + *pp_mv = &p->p_col_mv[(i_mb_offset+p->i_mb_x)*4+(block%2)+2*(p->i_mb_y%2)]; + } + + if(p->ph.b_picture_structure == 0 && p->p_save[1]->b_picture_structure) + { + i_mb_offset = p->i_mb_y*p->i_mb_width-i_mb_offset; + i_mb_offset *= 2; + if(block > 1) + i_mb_offset += p->i_mb_width; + *p_col_type = p->p_col_type_base[i_mb_offset + p->i_mb_x]; + *pp_mv = &p->p_col_mv[(i_mb_offset+p->i_mb_x)*4+(block%2)]; + } + } + +} + +static void get_b_direct_skip_sub_mb(cavs_decoder *p,int block,cavs_vector *p_mv) +{ + cavs_vector temp_mv; + uint32_t b_next_field = p->i_mb_index >= p->i_mb_num_half; + int iDistanceIndexFw, iDistanceIndexBw, iDistanceIndexRef; + int iDistanceIndexFw0, iDistanceIndexFw1, iDistanceIndexBw0, iDistanceIndexBw1; + int deltaRef = 0, deltaMvBw = 0, deltaMvFw = 0; + + if( p->param.b_accelerate ) + { + if( p->p_save_aec[1] == NULL + || p->p_save_aec[2] == NULL ) + { + p->b_error_flag = 1; + return; + } + + temp_mv = p_mv[0]; + if(p->ph.b_picture_structure) /* frame */ + { + /* direct prediction from co-located P MB, block-wise */ + if(p->p_save_aec[1]->b_picture_structure == 0) /* ref-field */ + { + temp_mv.y *= 2; + if( abs(temp_mv.ref)/2 > 1 ) + { + p->b_error_flag = 1; + return; + } + iDistanceIndexRef = p->p_save_aec[1]->i_ref_distance[temp_mv.ref/2]; + } + else + { + if( abs(temp_mv.ref) > 1 ) + { + p->b_error_flag = 1; + return; + } + iDistanceIndexRef = p->p_save_aec[1]->i_ref_distance[temp_mv.ref]; + } + iDistanceIndexFw = p->p_save_aec[2]->i_distance_index; + iDistanceIndexBw = p->p_save_aec[1]->i_distance_index; + p->mv[mv_scan[block]].ref = 1; + p->mv[mv_scan[block]+MV_BWD_OFFS].ref = 0; + + mv_pred_direct(p,&p->mv[mv_scan[block]], &temp_mv, + iDistanceIndexRef, iDistanceIndexFw, iDistanceIndexBw, 0, 0, 0); + if( p->b_error_flag ) + return; + } + else /* field */ + { + if(p->p_save_aec[1]->b_picture_structure == 1) /* ref-frame */ + { + temp_mv.y /= 2; + if( temp_mv.ref > 1 ) + { + p->b_error_flag = 1; + return; + } + iDistanceIndexRef = p->p_save_aec[1]->i_ref_distance[temp_mv.ref] + 1; + } + else + { + int i_ref = temp_mv.ref; + + if( (abs(temp_mv.ref)>>1) > 1 ) + { + p->b_error_flag = 1; + return; + } + + if (NEW_DIRECT) + { + iDistanceIndexRef = p->p_save_aec[1]->i_ref_distance[i_ref>>1] + !(i_ref & 1); /* NOTE : refer to reverse field */ + } + else if(b_next_field && i_ref == 0) + { + iDistanceIndexRef = p->p_save_aec[1]->i_distance_index; + } + else + { + i_ref -= b_next_field; + iDistanceIndexRef = p->p_save_aec[1]->i_ref_distance[i_ref>>1] - (i_ref&1) + 1; + } + } + + /* set as field reference list */ + iDistanceIndexFw0 = p->p_save_aec[2]->i_distance_index+1; + iDistanceIndexFw1 = p->p_save_aec[2]->i_distance_index; + iDistanceIndexBw0 = p->p_save_aec[1]->i_distance_index; + iDistanceIndexBw1 = p->p_save_aec[1]->i_distance_index+1; + + if(iDistanceIndexRef == iDistanceIndexFw0 || (NEW_DIRECT & b_next_field)) + { + iDistanceIndexFw = iDistanceIndexFw0; + p->mv[mv_scan[block]].ref = 2; + } + else + { + iDistanceIndexFw = iDistanceIndexFw1; + p->mv[mv_scan[block]].ref = 3; + } + + if(b_next_field==0 || NEW_DIRECT) + { + iDistanceIndexBw = iDistanceIndexBw0; + p->mv[mv_scan[block]+MV_BWD_OFFS].ref = 0; + } + else + { + iDistanceIndexBw = iDistanceIndexBw1; + p->mv[mv_scan[block]+MV_BWD_OFFS].ref = 1; + } + + if (NEW_DIRECT) + { + deltaRef = ((temp_mv.ref & 1) ^ 1) << 1; + deltaMvFw = (p->mv[mv_scan[block]].ref-2 == b_next_field) << 1; + deltaMvBw = b_next_field ? -2 : 0; + } + + mv_pred_direct(p,&p->mv[mv_scan[block]], &temp_mv, + iDistanceIndexRef, iDistanceIndexFw, iDistanceIndexBw, deltaRef, deltaMvFw, deltaMvBw); + if( p->b_error_flag ) + return; + } + + } + else + { + if( p->p_save[1] == NULL + || p->p_save[2] == NULL ) + { + p->b_error_flag = 1; + return; + } + + temp_mv = p_mv[0]; + if(p->ph.b_picture_structure) /* frame */ + { + /* direct prediction from co-located P MB, block-wise */ + if(p->p_save[1]->b_picture_structure == 0) /* ref-field */ + { + temp_mv.y *= 2; + if( abs(temp_mv.ref) /2 > 1 ) + { + p->b_error_flag = 1; + return; + } + iDistanceIndexRef = p->p_save[1]->i_ref_distance[temp_mv.ref/2]; + } + else + { + if( abs(temp_mv.ref) > 1 ) + { + p->b_error_flag = 1; + return; + } + iDistanceIndexRef = p->p_save[1]->i_ref_distance[temp_mv.ref]; + } + iDistanceIndexFw = p->p_save[2]->i_distance_index; + iDistanceIndexBw = p->p_save[1]->i_distance_index; + p->mv[mv_scan[block]].ref = 1; + p->mv[mv_scan[block]+MV_BWD_OFFS].ref = 0; + + mv_pred_direct(p,&p->mv[mv_scan[block]], &temp_mv, + iDistanceIndexRef, iDistanceIndexFw, iDistanceIndexBw, 0, 0, 0); + if( p->b_error_flag ) + return; + } + else /* field */ + { + if(p->p_save[1]->b_picture_structure == 1) /* ref-frame */ + { + temp_mv.y /= 2; + if( abs(temp_mv.ref) > 1 ) + { + p->b_error_flag = 1; + return; + } + iDistanceIndexRef = p->p_save[1]->i_ref_distance[temp_mv.ref] + 1; + } + else + { + int i_ref = temp_mv.ref; + + if( (abs(temp_mv.ref)>>1) > 1 ) + { + p->b_error_flag = 1; + return; + } + + if (NEW_DIRECT) + { + iDistanceIndexRef = p->p_save[1]->i_ref_distance[i_ref>>1] + !(i_ref & 1); /* NOTE : refer to reverse field */ + } + else if(b_next_field && i_ref == 0) + { + iDistanceIndexRef = p->p_save[1]->i_distance_index; + } + else + { + i_ref -= b_next_field; + iDistanceIndexRef = p->p_save[1]->i_ref_distance[i_ref>>1] - (i_ref&1) + 1; + } + } + + /* set as field reference list */ + iDistanceIndexFw0 = p->p_save[2]->i_distance_index+1; + iDistanceIndexFw1 = p->p_save[2]->i_distance_index; + iDistanceIndexBw0 = p->p_save[1]->i_distance_index; + iDistanceIndexBw1 = p->p_save[1]->i_distance_index+1; + + if(iDistanceIndexRef == iDistanceIndexFw0 || (NEW_DIRECT & b_next_field)) + { + iDistanceIndexFw = iDistanceIndexFw0; + p->mv[mv_scan[block]].ref = 2; + } + else + { + iDistanceIndexFw = iDistanceIndexFw1; + p->mv[mv_scan[block]].ref = 3; + } + + if(b_next_field==0 || NEW_DIRECT) + { + iDistanceIndexBw = iDistanceIndexBw0; + p->mv[mv_scan[block]+MV_BWD_OFFS].ref = 0; + } + else + { + iDistanceIndexBw = iDistanceIndexBw1; + p->mv[mv_scan[block]+MV_BWD_OFFS].ref = 1; + } + + if (NEW_DIRECT) + { + deltaRef = ((temp_mv.ref & 1) ^ 1) << 1; + deltaMvFw = (p->mv[mv_scan[block]].ref-2 == b_next_field) << 1; + deltaMvBw = b_next_field ? -2 : 0; + } + + mv_pred_direct(p,&p->mv[mv_scan[block]], &temp_mv, + iDistanceIndexRef, iDistanceIndexFw, iDistanceIndexBw, deltaRef, deltaMvFw, deltaMvBw); + if( p->b_error_flag ) + return; + } + } +} + +static void get_b_direct_skip_mb(cavs_decoder *p) +{ + cavs_vector mv[24]; + int block; + //uint32_t b_next_field = p->i_mb_index >= p->i_mb_num_half; + int i_ref_offset = p->ph.b_picture_structure == 0 ? 2 : 1; + uint8_t i_col_type; + cavs_vector *p_mv; + + mv[MV_FWD_A1] = p->mv[MV_FWD_A1]; + mv[MV_FWD_B2] = p->mv[MV_FWD_B2]; + mv[MV_FWD_C2] = p->mv[MV_FWD_C2]; + mv[MV_FWD_D3] = p->mv[MV_FWD_D3]; + mv[MV_BWD_A1] = p->mv[MV_BWD_A1]; + mv[MV_BWD_B2] = p->mv[MV_BWD_B2]; + mv[MV_BWD_C2] = p->mv[MV_BWD_C2]; + mv[MV_BWD_D3] = p->mv[MV_BWD_D3]; + for( block = 0; block < 4; block++ ) + { + get_col_info(p, &i_col_type, &p_mv, block); + if( !i_col_type ) /* col_type is I_8x8 */ + { + mv_pred_sub_direct(p, mv, 0, mv_scan[block], mv_scan[block]-3, + MV_PRED_BSKIP, BLK_8X8, i_ref_offset); + if(p->b_error_flag) + return; + mv_pred_sub_direct(p, mv, MV_BWD_OFFS, mv_scan[block]+MV_BWD_OFFS, + mv_scan[block]-3+MV_BWD_OFFS, + MV_PRED_BSKIP, BLK_8X8, 0); + } + else + { + get_b_direct_skip_sub_mb(p,block,p_mv); + } + + if(p->b_error_flag) + { + return; + } + } +} + +static int get_mb_b(cavs_decoder *p) +{ + int kk = 0; + cavs_vector mv[24]; + int block; + enum cavs_mb_sub_type sub_type[4]; + int flags; + int ref[4] = { 0 }; + int i_ref_offset = p->ph.b_picture_structure == 0 ? 2 : 1; + uint8_t i_col_type; + cavs_vector *p_mv; + int i_mb_type = p->i_mb_type; + int16_t (*p_mvd)[6][2] = p->p_mvd; + int8_t (*p_ref)[9] = p->p_ref; + int i_ret = 0; + + init_mb(p); + + p->mv[MV_FWD_X0] = MV_REF_DIR; + copy_mvs(&p->mv[MV_FWD_X0], BLK_16X16); + p->mv[MV_BWD_X0] = MV_REF_DIR; + copy_mvs(&p->mv[MV_BWD_X0], BLK_16X16); + +#define FWD 0 +#define BWD 1 +#define MVD_X0 1 +#define MVD_X1 2 +#define MVD_X2 4 +#define MVD_X3 5 +#define REF_X0 4 +#define REF_X1 5 +#define REF_X2 7 +#define REF_X3 8 + + /* The MVD of pos X[0-3] have been initialized as 0 + The REF of pos X[0-3] have been initialized as -1 */ + switch(i_mb_type) + { + case B_SKIP: + case B_DIRECT: + get_b_direct_skip_mb(p); + if(p->b_error_flag) + { + return -1; + } + break; + + case B_FWD_16X16: + ref[0] = p->bs_read_ref_b(p, FWD, REF_X0); + if( ref[0] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0]+i_ref_offset, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + + M32(p_mvd[FWD][MVD_X1]) = M32(p_mvd[FWD][MVD_X3]) = M32(p_mvd[FWD][MVD_X0]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X2] = p_ref[FWD][REF_X3] = p_ref[FWD][REF_X0]; + break; + + case B_SYM_16X16: + ref[0] = p->bs_read_ref_b(p, FWD, REF_X0); + if( ref[0] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0]+i_ref_offset, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + mv_pred_sym(p, &p->mv[MV_FWD_X0], BLK_16X16,ref[0]); + if(p->b_error_flag) + { + return -1; + } + + M32(p_mvd[FWD][MVD_X1]) = M32(p_mvd[FWD][MVD_X3]) = M32(p_mvd[FWD][MVD_X0]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X2] = p_ref[FWD][REF_X3] = p_ref[FWD][REF_X0]; + break; + + case B_BWD_16X16: + ref[0] = p->bs_read_ref_b(p, BWD, REF_X0); + if( ref[0] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_BWD_X0, MV_BWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + M32(p_mvd[BWD][MVD_X1]) = M32(p_mvd[BWD][MVD_X3]) = M32(p_mvd[BWD][MVD_X0]); + p_ref[BWD][REF_X1] = p_ref[BWD][REF_X2] = p_ref[BWD][REF_X3] = p_ref[BWD][REF_X0]; + break; + + case B_8X8: + mv[MV_FWD_A1] = p->mv[MV_FWD_A1]; + mv[MV_FWD_B2] = p->mv[MV_FWD_B2]; + mv[MV_FWD_C2] = p->mv[MV_FWD_C2]; + mv[MV_FWD_D3] = p->mv[MV_FWD_D3]; + mv[MV_BWD_A1] = p->mv[MV_BWD_A1]; + mv[MV_BWD_B2] = p->mv[MV_BWD_B2]; + mv[MV_BWD_C2] = p->mv[MV_BWD_C2]; + mv[MV_BWD_D3] = p->mv[MV_BWD_D3]; + + for(block = 0; block < 4; block++) + { + sub_type[block] = (enum cavs_mb_sub_type)p->bs_read[SYNTAX_MB_PART_TYPE](p); + if(sub_type[block] < 0 || sub_type[block] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + + for( block = 0; block < 4; block++) + { + if(sub_type[block] == B_SUB_DIRECT || sub_type[block] == B_SUB_BWD) + ref[block] = 0; + else + ref[block] = p->bs_read_ref_b(p, FWD, ref_scan[block]); + if( ref[block] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + + for(block = 0; block < 4; block++) + { + if(sub_type[block] == B_SUB_BWD) + { + ref[block] = p->bs_read_ref_b(p, BWD, ref_scan[block]); + } + if( ref[block] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + + for( block = 0; block < 4; block++ ) + { + switch(sub_type[block]) + { + case B_SUB_DIRECT: + get_col_info(p, &i_col_type, &p_mv, block); + if(!i_col_type) + { + mv_pred_sub_direct(p, mv, 0, mv_scan[block], mv_scan[block]-3, + MV_PRED_BSKIP, BLK_8X8, i_ref_offset); + if(p->b_error_flag) + return -1; + mv_pred_sub_direct(p, mv, MV_BWD_OFFS, mv_scan[block]+MV_BWD_OFFS, + mv_scan[block]-3+MV_BWD_OFFS, + MV_PRED_BSKIP, BLK_8X8, 0); + } + else + { + get_b_direct_skip_sub_mb(p, block, p_mv); + } + + if(p->b_error_flag) + { + return -1; + } + break; + + case B_SUB_FWD: + mv_pred(p, mv_scan[block], mv_scan[block]-3, + MV_PRED_MEDIAN, BLK_8X8, ref[block]+i_ref_offset, mvd_scan[block]); + if( p->b_error_flag ) + { + return -1; + } + break; + + case B_SUB_SYM: + mv_pred(p, mv_scan[block], mv_scan[block]-3, + MV_PRED_MEDIAN, BLK_8X8, ref[block]+i_ref_offset, mvd_scan[block]); + if( p->b_error_flag ) + { + return -1; + } + mv_pred_sym(p, &p->mv[mv_scan[block]], BLK_8X8,ref[block]); + if(p->b_error_flag) + { + return -1; + } + + break; + default: + break; + } + } + for( block = 0; block < 4; block++ ) + { + if(sub_type[block] == B_SUB_BWD) + { + mv_pred(p, mv_scan[block]+MV_BWD_OFFS, + mv_scan[block]+MV_BWD_OFFS-3, + MV_PRED_MEDIAN, BLK_8X8, ref[block], mvd_scan[block]); + if( p->b_error_flag ) + { + return -1; + } + } + } + break; + default: + flags = partition_flags[i_mb_type]; + if( i_mb_type <= B_SYM_16X16 ) + { + p->b_error_flag = 1; + + return -1; + } + if(i_mb_type & 1) /* 16x8 macroblock types */ + { + int i = 0, k = 0; + + if (flags & FWD0) + ref[i++] = p->bs_read_ref_b(p, FWD, REF_X0); + if (flags & FWD1) + ref[i++] = p->bs_read_ref_b(p, FWD, REF_X2); + if (flags & BWD0) + ref[i++] = p->bs_read_ref_b(p, BWD, REF_X0); + if (flags & BWD1) + ref[i++] = p->bs_read_ref_b(p, BWD, REF_X2); + + k = i; + for( i = 0 ; i < k; i++ ) + { + if( ref[i] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + + if(flags & FWD0) + { + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_TOP, BLK_16X8, ref[kk++]+i_ref_offset, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[FWD][MVD_X1], p_mvd[FWD][MVD_X0]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X0]; + } + + if(flags & SYM0) + { + mv_pred_sym(p, &p->mv[MV_FWD_X0], BLK_16X8,ref[kk-1]); + if(p->b_error_flag) + { + return -1; + } + } + if(flags & FWD1) + { + mv_pred(p, MV_FWD_X2, MV_FWD_A1, MV_PRED_LEFT, BLK_16X8, ref[kk++]+i_ref_offset, MVD_X2); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[FWD][MVD_X3], p_mvd[FWD][MVD_X2]); + p_ref[FWD][REF_X3] = p_ref[FWD][REF_X2]; + } + if(flags & SYM1) + { + mv_pred_sym(p, &p->mv[MV_FWD_X2], BLK_16X8,ref[kk-1]); + if(p->b_error_flag) + { + return -1; + } + } + if(flags & BWD0) + { + mv_pred(p, MV_BWD_X0, MV_BWD_C2, MV_PRED_TOP, BLK_16X8, ref[kk++], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[BWD][MVD_X1], p_mvd[BWD][MVD_X0]); + p_ref[BWD][REF_X1] = p_ref[BWD][REF_X0]; + } + if(flags & BWD1) + { + mv_pred(p, MV_BWD_X2, MV_BWD_A1, MV_PRED_LEFT, BLK_16X8, ref[kk++], MVD_X2); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[BWD][MVD_X3], p_mvd[BWD][MVD_X2]); + p_ref[BWD][REF_X3] = p_ref[BWD][REF_X2]; + } + } + else /* 8x16 macroblock types */ + { + int i = 0, k = 0; + + if (flags & FWD0) + ref[i++] = p->bs_read_ref_b(p, FWD, REF_X0); + if (flags & FWD1) + ref[i++] = p->bs_read_ref_b(p, FWD, REF_X1); + if (flags & BWD0) + ref[i++] = p->bs_read_ref_b(p, BWD, REF_X0); + if (flags & BWD1) + ref[i++] = p->bs_read_ref_b(p, BWD, REF_X1); + + k = i; + for( i = 0 ; i < k; i++ ) + { + if( ref[i] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + + if(flags & FWD0) + { + mv_pred(p, MV_FWD_X0, MV_FWD_B3, MV_PRED_LEFT, BLK_8X16, ref[kk++]+i_ref_offset, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + p_ref[FWD][REF_X2] = p_ref[FWD][REF_X0]; + } + if(flags & SYM0) + { + mv_pred_sym(p, &p->mv[MV_FWD_X0], BLK_8X16,ref[kk-1]); + if(p->b_error_flag) + { + return -1; + } + } + if(flags & FWD1) + { + mv_pred(p, MV_FWD_X1, MV_FWD_C2, MV_PRED_TOPRIGHT,BLK_8X16, ref[kk++]+i_ref_offset, MVD_X1); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[FWD][MVD_X3], p_mvd[FWD][MVD_X1]); + p_ref[FWD][REF_X3] = p_ref[FWD][REF_X1]; + } + if(flags & SYM1) + { + mv_pred_sym(p, &p->mv[MV_FWD_X1], BLK_8X16,ref[kk-1]); + if(p->b_error_flag) + { + return -1; + } + } + if(flags & BWD0) + { + mv_pred(p, MV_BWD_X0, MV_BWD_B3, MV_PRED_LEFT, BLK_8X16, ref[kk++], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + p_ref[BWD][REF_X2] = p_ref[BWD][REF_X0]; + } + if(flags & BWD1) + { + mv_pred(p, MV_BWD_X1, MV_BWD_C2, MV_PRED_TOPRIGHT,BLK_8X16, ref[kk++], MVD_X1); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[BWD][MVD_X3], p_mvd[BWD][MVD_X1]); + p_ref[BWD][REF_X3] = p_ref[BWD][REF_X1]; + } + } + } + +#undef FWD +#undef BWD +#undef MVD_X3 +#undef MVD_X2 +#undef MVD_X1 +#undef MVD_X0 +#undef REF_X3 +#undef REF_X2 +#undef REF_X1 +#undef REF_X0 + +#if B_MB_WEIGHTING + p->weighting_prediction = 0; +#endif + if (i_mb_type != B_SKIP) + { +#if B_MB_WEIGHTING + if ( p->sh.b_slice_weighting_flag && p->sh.b_mb_weighting_flag ) + { + if( p->ph.b_aec_enable ) + { + p->weighting_prediction = cavs_cabac_get_mb_weighting_prediction( p ); + } + else + p->weighting_prediction = cavs_bitstream_get_bit1(&p->s); //weighting_prediction + } +#else + if (p->sh.b_mb_weighting_flag) + { + cavs_bitstream_get_bit1(&p->s); //weighting_prediction + } +#endif + } + + inter_pred(p, i_mb_type); + + if(i_mb_type != B_SKIP) + { + /* get coded block pattern */ + p->i_cbp = p->bs_read[SYNTAX_INTER_CBP](p); + if( p->i_cbp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + /* get quantizer */ + if(p->i_cbp && !p->b_fixed_qp) + { + int delta_qp = p->bs_read[SYNTAX_DQP](p); + + p->i_qp = (p->i_qp-MIN_QP + delta_qp + (MAX_QP-MIN_QP+1))%(MAX_QP-MIN_QP+1)+MIN_QP; + + if( p->i_qp < 0 || p->i_qp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + return -1; + } + } + else + p->i_last_dqp = 0; + + i_ret = get_residual_inter(p,i_mb_type); + if(i_ret == -1) + return -1; + } + filter_mb(p, i_mb_type); + + return next_mb(p); +} + +static inline void get_p_frame_ref(cavs_decoder *p, int *p_ref) +{ + if(p->ph.b_picture_reference_flag ) + { + *p_ref=0; + } + else + { + if(p->ph.b_picture_structure==0&&p->ph.i_picture_coding_type==CAVS_P_PICTURE) + { + *p_ref=cavs_bitstream_get_bits(&p->s,2); + } + else + { + *p_ref=cavs_bitstream_get_bit1(&p->s); //mb_reference_index + } + } +} + +static int get_mb_p(cavs_decoder *p) +{ + int i; + int i_offset; + int ref[4]; + int i_mb_type = p->i_mb_type; + int16_t (*p_mvd)[6][2] = p->p_mvd; + int8_t (*p_ref)[9] = p->p_ref; + int i_ret = 0; + + init_mb(p); + +#define FWD 0 +//#define BWD 1 //no need for backward mvd in P frame +#define MVD_X0 1 +#define MVD_X1 2 +#define MVD_X2 4 +#define MVD_X3 5 +#define REF_X0 4 +#define REF_X1 5 +#define REF_X2 7 +#define REF_X3 8 + + switch(i_mb_type) + { + case P_SKIP: + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_PSKIP, BLK_16X16, PSKIP_REF, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + break; + case P_16X16: + ref[0] = p->bs_read_ref_p(p, REF_X0); + if( ref[0] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + M32(p_mvd[FWD][MVD_X1]) = M32(p_mvd[FWD][MVD_X3]) = M32(p_mvd[FWD][MVD_X0]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X2] = p_ref[FWD][REF_X3] = p_ref[FWD][REF_X0]; + break; + case P_16X8: + ref[0] = p->bs_read_ref_p(p, REF_X0); + if( ref[0] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + ref[2] = p->bs_read_ref_p(p, REF_X2); + if( ref[2] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_TOP, BLK_16X8, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X2, MV_FWD_A1, MV_PRED_LEFT, BLK_16X8, ref[2], MVD_X2); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[FWD][MVD_X1], p_mvd[FWD][MVD_X0]); + CP32(p_mvd[FWD][MVD_X3], p_mvd[FWD][MVD_X2]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X0]; + p_ref[FWD][REF_X3] = p_ref[FWD][REF_X2]; + break; + case P_8X16: + ref[0] = p->bs_read_ref_p(p, REF_X0); + if( ref[0] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + ref[1] = p->bs_read_ref_p(p, REF_X1); + if( ref[1] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_FWD_X0, MV_FWD_B3, MV_PRED_LEFT, BLK_8X16, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X1, MV_FWD_C2, MV_PRED_TOPRIGHT, BLK_8X16, ref[1], MVD_X1); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[FWD][MVD_X3], p_mvd[FWD][MVD_X1]); + p_ref[FWD][REF_X2] = p_ref[FWD][REF_X0]; + p_ref[FWD][REF_X3] = p_ref[FWD][REF_X1]; + break; + case P_8X8: + ref[0] = p->bs_read_ref_p(p, REF_X0); + if( ref[0] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + ref[1] = p->bs_read_ref_p(p, REF_X1); + if( ref[1] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + ref[2] = p->bs_read_ref_p(p, REF_X2); + if( ref[2] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + ref[3] = p->bs_read_ref_p(p, REF_X3); + if( ref[3] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_FWD_X0, MV_FWD_B3, MV_PRED_MEDIAN, BLK_8X8, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X1, MV_FWD_C2, MV_PRED_MEDIAN, BLK_8X8, ref[1], MVD_X1); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X2, MV_FWD_X1, MV_PRED_MEDIAN, BLK_8X8, ref[2], MVD_X2); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X3, MV_FWD_X0, MV_PRED_MEDIAN, BLK_8X8, ref[3], MVD_X3); + if( p->b_error_flag ) + { + return -1; + } + break; + } + +#undef FWD +//#undef BWD +#undef MVD_X3 +#undef MVD_X2 +#undef MVD_X1 +#undef MVD_X0 +#undef REF_X3 +#undef REF_X2 +#undef REF_X1 +#undef REF_X0 + +#if B_MB_WEIGHTING + p->weighting_prediction = 0; +#endif + if (i_mb_type != P_SKIP) + { +#if B_MB_WEIGHTING + if ( p->sh.b_slice_weighting_flag && p->sh.b_mb_weighting_flag ) + { + if( p->ph.b_aec_enable ) + { + p->weighting_prediction = cavs_cabac_get_mb_weighting_prediction( p ); + } + else + p->weighting_prediction = cavs_bitstream_get_bit1(&p->s); //weighting_prediction + } +#else + if (p->sh.b_mb_weighting_flag) + { + cavs_bitstream_get_bit1(&p->s); //weighting_prediction + } +#endif + } + + inter_pred(p, i_mb_type); + + i_offset = (p->i_mb_y*p->i_mb_width + p->i_mb_x)*4; + p->p_col_mv[i_offset+ 0] = p->mv[MV_FWD_X0]; + p->p_col_mv[i_offset + 1] = p->mv[MV_FWD_X1]; + p->p_col_mv[i_offset + 2] = p->mv[MV_FWD_X2]; + p->p_col_mv[i_offset + 3] = p->mv[MV_FWD_X3]; + + if (i_mb_type != P_SKIP) + { + /* get coded block pattern */ + p->i_cbp = p->bs_read[SYNTAX_INTER_CBP](p); + if( p->i_cbp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + if(p->ph.vbs_enable) + { + if(i_mb_type == P_8X8) + { + for(i=0;i<4;i++) + { + if(p->i_cbp & (1<vbs_mb_part_transform_4x4_flag[i] = cavs_bitstream_get_bit1(&p->s); + } + for(i=0;i<4;i++) + { + if(p->vbs_mb_part_transform_4x4_flag[i] && (p->i_cbp&(1<i_cbp_4x4[i] = cavs_bitstream_get_ue_k(&p->s,1); + p->i_cbp_part[i] = get_cbp_4x4(p->i_cbp_4x4[i]); + } + } + } + } + + /* get quantizer */ + if(p->i_cbp && !p->b_fixed_qp) + { + int delta_qp = p->bs_read[SYNTAX_DQP](p); + + p->i_qp = (p->i_qp-MIN_QP + delta_qp + (MAX_QP-MIN_QP+1))%(MAX_QP-MIN_QP+1)+MIN_QP; + + if( p->i_qp < 0 || p->i_qp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + return -1; + } + } + else + p->i_last_dqp = 0; + + i_ret = get_residual_inter(p,i_mb_type); + if(i_ret == -1) + return -1; + } + + filter_mb(p,i_mb_type); + + *p->p_col_type = i_mb_type; + + return next_mb(p); +} + +static int cavs_mb_predict_intra8x8_mode (cavs_decoder *p, int i_pos) +{ + const int ma = p->i_intra_pred_mode_y[i_pos-1]; + const int mb = p->i_intra_pred_mode_y[i_pos-CAVS_ICACHE_STRIDE]; + const int m = CAVS_MIN (cavs_mb_pred_mode (ma), + cavs_mb_pred_mode (mb)); + + if (m < 0) + return INTRA_L_LP; + else if (ma < NO_INTRA_8x8_MODE && mb < NO_INTRA_8x8_MODE) + return m; + else if (ma < NO_INTRA_8x8_MODE) + return cavs_mb_pred_mode(ma); + else if (mb < NO_INTRA_8x8_MODE) + return cavs_mb_pred_mode(mb); + else + return cavs_pred_mode_4x4to8x8[pred4x4[cavs_mb_pred_mode(ma)+1][cavs_mb_pred_mode(mb)+1]]; +} + +static int cavs_mb_predict_intra4x4_mode (cavs_decoder *p, int i_pos) +{ + const int ma = p->i_intra_pred_mode_y[i_pos-1]; + const int mb = p->i_intra_pred_mode_y[i_pos-CAVS_ICACHE_STRIDE]; + + return pred4x4[cavs_mb_pred_mode(ma)+1][cavs_mb_pred_mode(mb)+1]; +} + +static int get_mb_i(cavs_decoder *p) +{ + uint8_t i_top[18]; + uint8_t *p_left = NULL; + uint8_t *p_d; + + static const uint8_t scan5x5[4][4] = { + {6, 7, 11, 12}, + {8, 9, 13, 14}, + {16, 17, 21, 22}, + {18, 19, 23, 24} + }; + + int i, j; + int i_offset = p->i_mb_x<<2; + //int i_mb_type = p->i_cbp_code; + int i_rem_mode; + int i_pred_mode; + DECLARE_ALIGNED_16(uint8_t edge[33]); + DECLARE_ALIGNED_16(uint8_t edge_8x8[33]); + int i_qp_cb = 0, i_qp_cr = 0; + int i_ret = 0; + + init_mb(p); + + if (p->ph.vbs_enable) + { + p->vbs_mb_intra_pred_flag=cavs_bitstream_get_bit1(&p->s); + if(p->vbs_mb_intra_pred_flag) //vbs_mb_intra_pred_flag == '1' + { + for( j = 0; j < 4; ++j ) + { + p->vbs_mb_part_intra_pred_flag[j]=cavs_bitstream_get_bit1(&p->s); + p->vbs_mb_part_transform_4x4_flag[j]=p->vbs_mb_part_intra_pred_flag[j]; + } + } + } + + for( i = 0; i < 4; i++ ) + { + if (p->vbs_mb_part_intra_pred_flag[i]) + { + int m; + + for( m = 0; m < 4; m++ ) + { + int i_pos = scan5x5[i][m]; + + p->pred_mode_4x4_flag[m] = cavs_bitstream_get_bit1(&p->s); + if(!p->pred_mode_4x4_flag[m]) + p->intra_luma_pred_mode_4x4[m] = cavs_bitstream_get_bits(&p->s, 3); + + i_pred_mode = cavs_mb_predict_intra4x4_mode(p, i_pos); + if(!p->pred_mode_4x4_flag[m]) + { + i_pred_mode = p->intra_luma_pred_mode_4x4[m] + (p->intra_luma_pred_mode_4x4[m] >= i_pred_mode); + } + p->i_intra_pred_mode_y[i_pos] = i_pred_mode + NO_INTRA_8x8_MODE; + } + } + else + { + int i_pos = scan5x5[i][0]; + + i_rem_mode = p->bs_read[SYNTAX_INTRA_LUMA_PRED_MODE](p); + if( p->b_error_flag ) + { + return -1; + } + + i_pred_mode = cavs_mb_predict_intra8x8_mode(p, i_pos); + if(!p->pred_mode_flag) + { + i_pred_mode = i_rem_mode + (i_rem_mode >= i_pred_mode); + } + if( i_pred_mode > 4) + { + p->b_error_flag = 1; + + return -1; + } + + p->i_intra_pred_mode_y[scan5x5[i][0]] = + p->i_intra_pred_mode_y[scan5x5[i][1]] = + p->i_intra_pred_mode_y[scan5x5[i][2]] = + p->i_intra_pred_mode_y[scan5x5[i][3]] = i_pred_mode; + } + } + + p->i_pred_mode_chroma = p->bs_read[SYNTAX_INTRA_CHROMA_PRED_MODE](p); + if(p->i_pred_mode_chroma > 6 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[9]; + p->i_intra_pred_mode_y[10] = p->i_intra_pred_mode_y[14]; + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[19]; + p->i_intra_pred_mode_y[20] = p->i_intra_pred_mode_y[24]; + + p->p_top_intra_pred_mode_y[i_offset+0] = p->i_intra_pred_mode_y[21]; + p->p_top_intra_pred_mode_y[i_offset+1] = p->i_intra_pred_mode_y[22]; + p->p_top_intra_pred_mode_y[i_offset+2] = p->i_intra_pred_mode_y[23]; + p->p_top_intra_pred_mode_y[i_offset+3] = p->i_intra_pred_mode_y[24]; + + if(!(p->i_mb_flags & A_AVAIL)) + { + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[6] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[11] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[16] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[21] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_C, &p->i_pred_mode_chroma ); + } + if(!(p->i_mb_flags & B_AVAIL)) + { + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[6] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[7] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[8] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[9] ); + adapt_pred_mode(TOP_ADAPT_INDEX_C, &p->i_pred_mode_chroma ); + } + + p->i_cbp = p->bs_read[SYNTAX_INTRA_CBP](p); + if( p->i_cbp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + if(p->ph.vbs_enable) + { + for( i = 0; i < 4; i++ ) + { + if(p->vbs_mb_part_transform_4x4_flag[i]&&(p->i_cbp&(1<i_cbp_4x4[i]=cavs_bitstream_get_ue_k(&p->s,1); + p->i_cbp_part[i] = get_cbp_4x4(p->i_cbp_4x4[i]); + } + } + } + + if(p->i_cbp && !p->b_fixed_qp) + { + int delta_qp = p->bs_read[SYNTAX_DQP](p); + + p->i_qp = (p->i_qp-MIN_QP + delta_qp + (MAX_QP-MIN_QP+1))%(MAX_QP-MIN_QP+1)+MIN_QP; + + if( p->i_qp < 0 || p->i_qp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + return -1; + } + } + else + p->i_last_dqp = 0; // for cabac only + + for( i = 0; i < 4; i++ ) + { + int i_mode; + + p_d = p->p_y + p->i_luma_offset[i]; + + load_intra_pred_luma(p, i_top, &p_left, i); + + if (p->vbs_mb_part_intra_pred_flag[i]) + { + for (j = 0; j < 4; j++) + { + uint8_t *p_d_4x4 = p_d + 4*(j&1) + 4*(j>>1)*p->cur.i_stride[0]; + + i_mode = p->i_intra_pred_mode_y[scan5x5[i][j]]; + load_intra_4x4_pred_luma(p, p_d_4x4, edge, i*4+j); + intra_pred_lum_4x4[i_mode](p_d_4x4, edge, p->cur.i_stride[0]); + if ((p->i_cbp & (1<i_cbp_part[i] & (1<i_qp,p_d_4x4,p->cur.i_stride[0], 1); + } + } + } + else + { + i_mode = p->i_intra_pred_mode_y[scan5x5[i][0]]; + p->cavs_intra_luma[i_mode](p_d, edge_8x8, p->cur.i_stride[0], i_top, p_left); + + if(p->i_cbp & (1<i_qp,p_d,p->cur.i_stride[0], 0); + if(i_ret == -1) + return -1; + } + } + } + + load_intra_pred_chroma(p); + + p->cavs_intra_chroma[p->i_pred_mode_chroma](p->p_cb, p->mb.i_neighbour, p->cur.i_stride[1], &p->p_top_border_cb[p->i_mb_x*10], p->i_left_border_cb); + p->cavs_intra_chroma[p->i_pred_mode_chroma](p->p_cr, p->mb.i_neighbour, p->cur.i_stride[2], &p->p_top_border_cr[p->i_mb_x*10], p->i_left_border_cr); + + if( p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ) + { + i_qp_cb = clip3_int( p->i_qp + p->ph.chroma_quant_param_delta_u, 0, 63 ); + i_qp_cr = clip3_int( p->i_qp + p->ph.chroma_quant_param_delta_v, 0, 63 ); + } + + if(p->i_cbp & (1<<4)) + { + i_ret = get_residual_block(p,chroma_2dvlc,0, + chroma_qp[ p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable? i_qp_cb : p->i_qp], + p->p_cb,p->cur.i_stride[1], 1); + if(i_ret == -1) + return -1; + } + if(p->i_cbp & (1<<5)) + { + i_ret = get_residual_block(p,chroma_2dvlc,0, + chroma_qp[ p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable? i_qp_cr : p->i_qp], + p->p_cr,p->cur.i_stride[2], 1); + if(i_ret == -1) + return -1; + } + + filter_mb(p, I_8X8); + p->mv[MV_FWD_X0] = MV_INTRA; + copy_mvs(&p->mv[MV_FWD_X0], BLK_16X16); + p->mv[MV_BWD_X0] = MV_INTRA; + copy_mvs(&p->mv[MV_BWD_X0], BLK_16X16); + + if(p->ph.i_picture_coding_type != CAVS_B_PICTURE) + *p->p_col_type = I_8X8; + + return next_mb(p); +} + +/* decode slice only for aec */ +static int cavs_get_slice_aec( cavs_decoder *p ) +{ + int i, i_num = 0, i_result; + uint32_t i_limit, i_skip; + int i_first_field, i_skip_count = 0; + int (*get_mb_type)(cavs_decoder *p); + + int (*get_mb_pb_aec_opt)(cavs_decoder *p); + //int (*get_mb_pb_rec_opt)(cavs_decoder *p); + int i_slice_mb_y; + int i_slice_mb_index; + + + /* picture_type, picture_structure, i_first_field */ + static int8_t i_num_of_reference_table[3][2][2]={ + {{1,0}/*picture_structure=0*/,{0,0}/*picture_structure=1*/},//i_picuture + {{4,4}/*picture_structure=0*/,{2,2}/*picture_structure=1*/},//p_picuture + {{4,4}/*picture_structure=0*/,{2,2}/*picture_structure=1*/}//b_picuture + }; + + int b_interlaced = p->param.b_interlaced; + + if(p->vsh.i_vertical_size > 2800) + { + p->sh.i_slice_vertical_position_extension = cavs_bitstream_get_bits(&p->s,3); + } + else + { + p->sh.i_slice_vertical_position_extension = 0; + } + //if (p->vsh.i_profile_id == PROFILE_YIDONG) + //{ + // p->sh.i_slice_horizontal_position = cavs_bitstream_get_bits(&p->s,8); + // if(p->vsh.i_horizontal_size > 4080) + // p->sh.i_slice_vertical_position_extension = cavs_bitstream_get_bits(&p->s,2); + //} + if(p->ph.b_fixed_picture_qp == 0) + { + p->b_fixed_qp = p->sh.b_fixed_slice_qp = cavs_bitstream_get_bit1(&p->s); + p->i_qp = p->sh.i_slice_qp = cavs_bitstream_get_bits(&p->s,6); + } + else + { + p->sh.b_fixed_slice_qp = 1; + p->sh.i_slice_qp = p->i_qp; + } + p->i_mb_y += (p->sh.i_slice_vertical_position_extension<<7); + p->i_mb_index = p->i_mb_y*p->i_mb_width; + + if(b_interlaced) + { + if( !p->b_bottom ) /* top field can't exceed half num */ + { + if(p->i_mb_y >= (p->i_mb_height>>1) ) + { + p->b_error_flag = 1; + return -1; + } + + if( p->i_mb_index >= p->i_mb_num_half ) + { + p->b_error_flag = 1; + return -1; + } + } + else + { + if(p->i_mb_y < (p->i_mb_height>>1) ) + { + p->b_error_flag = 1; + return -1; + } + + if( p->i_mb_index < p->i_mb_num_half ) + { + p->b_error_flag = 1; + return -1; + } + } + } + + p->i_mb_y_start = p->i_mb_y; + p->i_mb_index_start = p->i_mb_index; + p->i_mb_y_start_fld[p->b_bottom] = p->i_mb_y; + p->i_mb_index_start_fld[p->b_bottom] = p->i_mb_index; + + i_slice_mb_y = p->i_mb_y; + i_slice_mb_index = p->i_mb_index; + + i_first_field = p->i_mb_index < p->i_mb_num_half ? 1 : 0; + i_num = i_num_of_reference_table[p->ph.i_picture_coding_type][p->ph.b_picture_structure][i_first_field]; + p->b_have_pred = (p->ph.i_picture_coding_type != CAVS_I_PICTURE) || (p->ph.b_picture_structure == 0 && i_first_field == 0); + if( p->b_have_pred ) + { + p->sh.b_slice_weighting_flag = cavs_bitstream_get_bit1(&p->s); +#if B_MB_WEIGHTING + /* copy weighting prediction info */ + p->b_slice_weighting_flag[p->b_bottom] = p->sh.b_slice_weighting_flag; +#endif + if(p->sh.b_slice_weighting_flag) + { + for(i = 0; i < i_num; i++) + { + p->sh.i_luma_scale[i] = cavs_bitstream_get_bits(&p->s, 8); + p->sh.i_luma_shift[i] = cavs_bitstream_get_int(&p->s, 8); + cavs_bitstream_clear_bits(&p->s, 1); + p->sh.i_chroma_scale[i] = cavs_bitstream_get_bits(&p->s, 8); + p->sh.i_chroma_shift[i] = cavs_bitstream_get_int(&p->s, 8); + cavs_bitstream_clear_bits(&p->s, 1); + } + p->sh.b_mb_weighting_flag = cavs_bitstream_get_bit1(&p->s); +#if B_MB_WEIGHTING + /* copy weighting prediction info */ + for(i = 0; i < i_num; i++) + { + p->i_luma_scale[p->b_bottom][i] = p->sh.i_luma_scale[i]; + p->i_luma_shift[p->b_bottom][i] = p->sh.i_luma_shift[i]; + p->i_chroma_scale[p->b_bottom][i] = p->sh.i_chroma_scale[i]; + p->i_chroma_shift[p->b_bottom][i] = p->sh.i_chroma_shift[i]; + } + p->b_mb_weighting_flag[p->b_bottom] = p->sh.b_mb_weighting_flag; +#endif + } + else + { + p->sh.b_mb_weighting_flag = 0; +#if B_MB_WEIGHTING + /* copy weighting prediction info */ + p->b_mb_weighting_flag[p->b_bottom] = 0; +#endif + } + } + else + { + p->sh.b_slice_weighting_flag = 0; + p->sh.b_mb_weighting_flag = 0; +#if B_MB_WEIGHTING + /* copy weighting prediction info */ + p->b_slice_weighting_flag[p->b_bottom] = 0; + p->b_mb_weighting_flag[p->b_bottom] = 0; +#endif + } + + //if (p->vsh.i_profile_id == PROFILE_YIDONG && p->ph.i_picture_coding_type == CAVS_P_PICTURE) + //{ + // p->quant_coeff_pred_flag = cavs_bitstream_get_bit1(&p->s); + //} + p->sh.i_number_of_reference = i_num; + + if (p->ph.i_picture_coding_type < CAVS_B_PICTURE) //p frame + { + i_skip = P_SKIP; + i_limit = P_8X8; + + get_mb_pb_aec_opt = get_mb_p_aec_opt; + + get_mb_type = p->bs_read[SYNTAX_MBTYPE_P]; + } + else //b frame + { + i_skip = B_SKIP; + i_limit = B_8X8; + + get_mb_pb_aec_opt = get_mb_b_aec_opt; + + get_mb_type = p->bs_read[SYNTAX_MBTYPE_B]; + } + + /* init slice */ + i_result = cavs_init_slice_for_aec(p); + if(i_result == -1) + goto end; + + /* MB loop */ + for(;;) + { + /* AEC loop */ + for( ; ; ) + { + if(p->b_have_pred) + { + if(p->ph.b_skip_mode_flag) + { + i_skip_count = p->bs_read[SYNTAX_SKIP_RUN](p); + if( i_skip_count == -1 || + (p->i_mb_index + i_skip_count > p->i_slice_mb_end) + || i_skip_count < -1 ) + { + i_result = -1; + goto end; + } + + if (p->ph.b_aec_enable && i_skip_count) + { + cavs_biari_decode_stuffing_bit(&p->cabac); + p->i_last_dqp = 0; + p->i_cbp = 0; + } + while(i_skip_count--) + { + p->i_mb_type_tab[p->i_mb_index] = p->i_mb_type = i_skip; + + i_result = get_mb_pb_aec_opt(p); + + if( p->b_error_flag ) + { + i_result = -1; + } + + if(i_result != 0) + { + goto end; + } + + p->i_mb_index++; + } + + if(p->i_mb_index >= p->i_slice_mb_end) /* slice finished */ + { + if( !b_interlaced ) + { + if (p->i_mb_index >= p->i_mb_num) /* frame finished */ + p->b_complete = 0; + } + else + { + if( !p->b_bottom ) + { + if (p->i_mb_index >= (p->i_mb_num>>1)) /* top-field finished */ + p->b_complete = 0; + } + else + { + if (p->i_mb_index >= p->i_mb_num) /* bot-field finished */ + p->b_complete = 0; + } + } + + i_result = 0; + goto end; + } + } + + p->i_mb_type_tab[p->i_mb_index] = p->i_mb_type = get_mb_type(p); + if( p->i_mb_type < 0 || p->i_mb_type > 29) + { + p->b_error_flag = 1; + i_result = -1; + + goto end; + } + + if( p->i_mb_type == I_8X8 ) + { + i_result = get_mb_i_aec_opt(p); + } + else + { + i_result = get_mb_pb_aec_opt(p); + } + + if( p->b_error_flag ) + { + i_result = -1; + } + + if (p->ph.b_aec_enable) + { + cavs_biari_decode_stuffing_bit(&p->cabac); + } + if(i_result!=0) + { + goto end; + } + } + else + { + p->i_mb_type_tab[p->i_mb_index] = I_8X8; /* init for I_8x8 decision */ + i_result = get_mb_i_aec_opt(p); + + if( p->b_error_flag ) + { + i_result = -1; + } + + if (p->ph.b_aec_enable) + { + cavs_biari_decode_stuffing_bit(&p->cabac); + } + + if( i_result != 0 ) + { + goto end; + } + } + + p->i_mb_index++; + + if( p->i_mb_index >= p->i_slice_mb_end ) /* slice finished */ + { + if( !b_interlaced ) + { + if (p->i_mb_index >= p->i_mb_num) /* frame finished */ + p->b_complete = 0; + } + else + { + if( !p->b_bottom ) + { + if (p->i_mb_index >= (p->i_mb_num>>1)) /* top-field finished */ + p->b_complete = 0; + } + else + { + if (p->i_mb_index >= p->i_mb_num) /* bot-field finished */ + p->b_complete = 0; + } + } + + i_result = 0; + + goto end; /* */ + } + } + } + +end: + if (p->ph.b_aec_enable) + { + p->s = p->cabac.bs; + } + + return i_result; +} + +/* only rec */ +static int cavs_get_slice_rec(cavs_decoder *p) +{ + int i_num = 0, i_result; + uint32_t i_limit, i_skip; + int i_first_field;// i_skip_count = 0; + + int (*get_mb_type)(cavs_decoder *p); + int (*get_mb_pb_rec_opt)(cavs_decoder *p); + + /* picture_type, picture_structure, i_first_field */ + static int8_t i_num_of_reference_table[3][2][2]={ + {{1,0}/*picture_structure=0*/,{0,0}/*picture_structure=1*/},//i_picuture + {{4,4}/*picture_structure=0*/,{2,2}/*picture_structure=1*/},//p_picuture + {{4,4}/*picture_structure=0*/,{2,2}/*picture_structure=1*/}//b_picuture + }; + + int b_interlaced = p->param.b_interlaced; + + if( !b_interlaced ) + { + p->i_mb_y = p->i_mb_y_start; + p->i_mb_index = p->i_mb_index_start; + } + else + { + if( !p->b_bottom ) + { + if((uint32_t)p->i_mb_y_start_fld[p->b_bottom] > (p->i_mb_height>>1) + || (uint32_t)p->i_mb_index_start_fld[p->b_bottom] > p->i_mb_num_half + || (uint32_t)p->i_slice_mb_end_fld[p->b_bottom] > p->i_mb_num_half ) + { + p->b_error_flag = 1; + return -1; + } + } + else + { + if((uint32_t)p->i_mb_y_start_fld[p->b_bottom] < (p->i_mb_height>>1) + || (uint32_t)p->i_mb_index_start_fld[p->b_bottom] < p->i_mb_num_half + || (uint32_t)p->i_slice_mb_end_fld[p->b_bottom] < p->i_mb_num_half ) + { + p->b_error_flag = 1; + return -1; + } + } + + p->i_mb_y = p->i_mb_y_start_fld[p->b_bottom]; + p->i_mb_index = p->i_mb_index_start_fld[p->b_bottom]; + p->i_slice_mb_end = p->i_slice_mb_end_fld[p->b_bottom]; + } + + i_first_field = p->i_mb_index < p->i_mb_num_half ? 1 : 0; + i_num = i_num_of_reference_table[p->ph.i_picture_coding_type][p->ph.b_picture_structure][i_first_field]; + p->b_have_pred = (p->ph.i_picture_coding_type != CAVS_I_PICTURE) || (p->ph.b_picture_structure == 0 && i_first_field == 0); + p->sh.i_number_of_reference = i_num; + + if (p->ph.i_picture_coding_type < CAVS_B_PICTURE) //p frame + { + i_skip = P_SKIP; + i_limit = P_8X8; + + get_mb_pb_rec_opt = get_mb_p_rec_opt; + + get_mb_type = p->bs_read[SYNTAX_MBTYPE_P]; + } + else //b frame + { + i_skip = B_SKIP; + i_limit = B_8X8; + + get_mb_pb_rec_opt = get_mb_b_rec_opt; + + get_mb_type = p->bs_read[SYNTAX_MBTYPE_B]; + } + + /* MB loop */ + for(;;) + { + /* REC loop */ + cavs_init_slice_for_rec( p ); + for( ; ; ) + { + if( p->b_have_pred ) + { + p->i_mb_type = p->i_mb_type_tab[p->i_mb_index]; + if(p->i_mb_type == I_8X8) + { + i_result = get_mb_i_rec_opt(p); + } + else + { + i_result = get_mb_pb_rec_opt(p); + } + + if( p->b_error_flag ) + { + i_result = -1; + } + + if(i_result!=0) + { + goto end; + } + } + else + { + p->i_mb_type_tab[p->i_mb_index] = I_8X8; + i_result = get_mb_i_rec_opt(p); + if( p->b_error_flag ) + { + i_result = -1; + } + + if( i_result != 0 ) + { + goto end; + } + } + + p->i_mb_index++; + if( p->i_mb_index >= p->i_slice_mb_end ) /* slice finished */ + { + if( !b_interlaced ) + { + if (p->i_mb_index >= p->i_mb_num) /* frame finished */ + p->b_complete = 1; + } + else + { + if( !p->b_bottom ) + { + if (p->i_mb_index >= (p->i_mb_num>>1)) /* top-field finished */ + p->b_complete = 1; + } + else + { + if (p->i_mb_index >= p->i_mb_num) /* bot-field finished */ + p->b_complete = 1; + } + } + + i_result = 0; + + goto end; + } + }/* REC loop end */ + } + +end: + + return i_result; +} + +static int cavs_get_slice_rec_threads( cavs_decoder *p ) +{ + int ret; + +#if B_MB_WEIGHTING + /* load weighting prediction info */ + { + p->sh.b_slice_weighting_flag = p->b_slice_weighting_flag[p->b_bottom]; + p->sh.b_mb_weighting_flag = p->b_mb_weighting_flag[p->b_bottom]; + for(int i = 0; i < 4; i++ ) + { + p->sh.i_luma_scale[i] = p->i_luma_scale[p->b_bottom][i]; + p->sh.i_luma_shift[i] = p->i_luma_shift[p->b_bottom][i]; + p->sh.i_chroma_scale[i] = p->i_chroma_scale[p->b_bottom][i]; + p->sh.i_chroma_shift[i] = p->i_chroma_shift[p->b_bottom][i]; + } + } +#endif + + cavs_init_picture_ref_list( p ); + ret = cavs_get_slice_rec( p ); + + return ret; +} + + + +static int cavs_get_slice(cavs_decoder *p) +{ + int i, i_num = 0, i_result; + uint32_t i_limit, i_skip; + int i_first_field, i_skip_count = 0; + int (*get_mb_pb)(cavs_decoder *p); + int (*get_mb_type)(cavs_decoder *p); + + /* picture_type, picture_structure, i_first_field */ + static int8_t i_num_of_reference_table[3][2][2]={ + {{1,0}/*picture_structure=0*/,{0,0}/*picture_structure=1*/},//i_picuture + {{4,4}/*picture_structure=0*/,{2,2}/*picture_structure=1*/},//p_picuture + {{4,4}/*picture_structure=0*/,{2,2}/*picture_structure=1*/}//b_picuture + }; + + int b_interlaced = p->param.b_interlaced; + + if(p->vsh.i_vertical_size > 2800) + { + p->sh.i_slice_vertical_position_extension = cavs_bitstream_get_bits(&p->s,3); + } + else + { + p->sh.i_slice_vertical_position_extension = 0; + } + //if (p->vsh.i_profile_id == PROFILE_YIDONG) + //{ + // p->sh.i_slice_horizontal_position = cavs_bitstream_get_bits(&p->s,8); + // if(p->vsh.i_horizontal_size > 4080) + // p->sh.i_slice_vertical_position_extension = cavs_bitstream_get_bits(&p->s,2); + //} + if(p->ph.b_fixed_picture_qp == 0) + { + p->b_fixed_qp = p->sh.b_fixed_slice_qp = cavs_bitstream_get_bit1(&p->s); + p->i_qp = p->sh.i_slice_qp = cavs_bitstream_get_bits(&p->s,6); + } + else + { + p->sh.b_fixed_slice_qp = 1; + p->sh.i_slice_qp = p->i_qp; + } + p->i_mb_y += (p->sh.i_slice_vertical_position_extension<<7); + p->i_mb_index = p->i_mb_y*p->i_mb_width; + + if(b_interlaced) + { + if( !p->b_bottom ) /* top field can't exceed half num */ + { + if( (p->i_mb_y >= (p->i_mb_height>>1)) + || ( p->i_mb_index >= p->i_mb_num_half ) ) + { + p->b_error_flag = 1; + return -1; + } + } + else + { + if( (p->i_mb_y < (p->i_mb_height>>1) ) + || ( p->i_mb_index < p->i_mb_num_half )) + { + p->b_error_flag = 1; + return -1; + } + } + } + + i_first_field = p->i_mb_index < p->i_mb_num_half ? 1 : 0; + i_num = i_num_of_reference_table[p->ph.i_picture_coding_type][p->ph.b_picture_structure][i_first_field]; + p->b_have_pred = (p->ph.i_picture_coding_type != CAVS_I_PICTURE) || (p->ph.b_picture_structure == 0 && i_first_field == 0); + if( p->b_have_pred ) + { + p->sh.b_slice_weighting_flag = cavs_bitstream_get_bit1(&p->s); + if(p->sh.b_slice_weighting_flag) + { + for(i = 0; i < i_num; i++) + { + p->sh.i_luma_scale[i] = cavs_bitstream_get_bits(&p->s, 8); + p->sh.i_luma_shift[i] = cavs_bitstream_get_int(&p->s, 8); + cavs_bitstream_clear_bits(&p->s, 1); + p->sh.i_chroma_scale[i] = cavs_bitstream_get_bits(&p->s, 8); + p->sh.i_chroma_shift[i] = cavs_bitstream_get_int(&p->s, 8); + cavs_bitstream_clear_bits(&p->s, 1); + } + p->sh.b_mb_weighting_flag = cavs_bitstream_get_bit1(&p->s); + } + else + { + p->sh.b_mb_weighting_flag = 0; + } + } + else + { + p->sh.b_slice_weighting_flag = 0; + p->sh.b_mb_weighting_flag = 0; + } + + //if (p->vsh.i_profile_id == PROFILE_YIDONG && p->ph.i_picture_coding_type == CAVS_P_PICTURE) + //{ + // p->quant_coeff_pred_flag = cavs_bitstream_get_bit1(&p->s); + //} + p->sh.i_number_of_reference = i_num; + + if (p->ph.i_picture_coding_type < CAVS_B_PICTURE) //p frame + { + i_skip = P_SKIP; + i_limit = P_8X8; + + get_mb_pb = get_mb_p; + + get_mb_type = p->bs_read[SYNTAX_MBTYPE_P]; + } + else //b frame + { + i_skip = B_SKIP; + i_limit = B_8X8; + + get_mb_pb = get_mb_b; + + get_mb_type = p->bs_read[SYNTAX_MBTYPE_B]; + } + + /* init slice */ + i_result = cavs_init_slice(p); + if(i_result == -1) + goto end; + + /* MB loop */ + for(;;) + { + if(p->b_have_pred) + { + if(p->ph.b_skip_mode_flag) + { + i_skip_count = p->bs_read[SYNTAX_SKIP_RUN](p); + if( i_skip_count == -1 || + (p->i_mb_index + i_skip_count > p->i_slice_mb_end) + || i_skip_count < -1 ) + { + i_result = -1; + goto end; + } + + if (p->ph.b_aec_enable && i_skip_count) + { + cavs_biari_decode_stuffing_bit(&p->cabac); + p->i_last_dqp = 0; + p->i_cbp = 0; + } + while(i_skip_count--) + { + p->i_mb_type = i_skip; + i_result = get_mb_pb(p); + + if( p->b_error_flag ) + { + i_result = -1; + } + + if(i_result != 0) + { + goto end; + } + + p->i_mb_index++; + } + + if(p->i_mb_index >= p->i_slice_mb_end) //slice finished + { + if( !b_interlaced ) + { + if (p->i_mb_index >= p->i_mb_num) /* frame finished */ + p->b_complete = 1; + } + else + { + if( !p->b_bottom ) + { + if (p->i_mb_index >= (p->i_mb_num>>1)) /* top-field finished */ + p->b_complete = 1; + } + else + { + if (p->i_mb_index >= p->i_mb_num) /* bot-field finished */ + p->b_complete = 1; + } + } + + i_result = 0; + goto end; + } + } + + p->i_mb_type = get_mb_type(p); + if( p->i_mb_type < 0 || p->i_mb_type > 29) + { + p->b_error_flag = 1; + i_result = -1; + goto end; + } + + if(p->i_mb_type == I_8X8) + { + i_result = get_mb_i(p); + } + else + { + i_result = get_mb_pb(p); + } + + if( p->b_error_flag ) + { + i_result = -1; + } + + if (p->ph.b_aec_enable) + { + cavs_biari_decode_stuffing_bit(&p->cabac); + } + if(i_result != 0) + { + goto end; + } + } + else + { + i_result = get_mb_i(p); + + if( p->b_error_flag ) + { + i_result = -1; + } + + if (p->ph.b_aec_enable) + { + cavs_biari_decode_stuffing_bit(&p->cabac); + } + + if( i_result != 0 ) + { + goto end; + } + } + + p->i_mb_index++; + if( p->i_mb_index >= p->i_slice_mb_end ) /* slice finished */ + { + if( !b_interlaced ) + { + if (p->i_mb_index >= p->i_mb_num) /* frame finished */ + p->b_complete = 1; + } + else + { + if( !p->b_bottom ) + { + if (p->i_mb_index >= (p->i_mb_num>>1)) /* top-field finished */ + p->b_complete = 1; + } + else + { + if (p->i_mb_index >= p->i_mb_num) /* bot-field finished */ + p->b_complete = 1; + } + } + + i_result = 0; + + goto end; + } + } + +end: + if (p->ph.b_aec_enable) + { + p->s = p->cabac.bs; + } + + return i_result; +} + +static void cavs_decoder_init( cavs_decoder *p ) +{ + init_crop_table(); + + p->i_frame_decoded = -1; + + /* intra 4x4 */ + intra_pred_lum_4x4[I_PRED_4x4_V] = predict_4x4_v; + intra_pred_lum_4x4[I_PRED_4x4_H] = predict_4x4_h; + intra_pred_lum_4x4[I_PRED_4x4_DC] = predict_4x4_dc; + intra_pred_lum_4x4[I_PRED_4x4_DDL] = predict_4x4_ddl; + intra_pred_lum_4x4[I_PRED_4x4_DDR] = predict_4x4_ddr; + intra_pred_lum_4x4[I_PRED_4x4_VR] = predict_4x4_vr; + intra_pred_lum_4x4[I_PRED_4x4_HD] = predict_4x4_hd; + intra_pred_lum_4x4[I_PRED_4x4_VL] = predict_4x4_vl; + intra_pred_lum_4x4[I_PRED_4x4_HU] = predict_4x4_hu; + intra_pred_lum_4x4[I_PRED_4x4_DC_LEFT]= predict_4x4_dc_left; + intra_pred_lum_4x4[I_PRED_4x4_DC_TOP] = predict_4x4_dc_top; + intra_pred_lum_4x4[I_PRED_4x4_DC_128] = predict_4x4_dc_128; + + p->cavs_intra_luma[INTRA_L_VERT] = cavs_intra_pred_vertical; + p->cavs_intra_luma[INTRA_L_HORIZ] = cavs_intra_pred_horizontal; + p->cavs_intra_luma[INTRA_L_LP] = cavs_intra_pred_dc_lp; + p->cavs_intra_luma[INTRA_L_DOWN_LEFT] = cavs_intra_pred_down_left; + p->cavs_intra_luma[INTRA_L_DOWN_RIGHT] = cavs_intra_pred_down_right; + p->cavs_intra_luma[INTRA_L_LP_LEFT] = cavs_intra_pred_dc_lp_left; + p->cavs_intra_luma[NTRA_L_LP_TOP] = cavs_intra_pred_dc_lp_top; + p->cavs_intra_luma[INTRA_L_DC_128] = cavs_intra_pred_dc_128; + + p->cavs_intra_chroma[INTRA_C_DC] = cavs_intra_pred_chroma_dc_lp; + p->cavs_intra_chroma[INTRA_C_HORIZ] = cavs_intra_pred_chroma_horizontal; + p->cavs_intra_chroma[INTRA_C_VERT] = cavs_intra_pred_chroma_vertical; + p->cavs_intra_chroma[INTRA_C_PLANE] = cavs_intra_pred_chroma_plane; + p->cavs_intra_chroma[INTRA_C_DC_LEFT] = cavs_intra_pred_chroma_dc_lp_left; + p->cavs_intra_chroma[INTRA_C_DC_TOP] = cavs_intra_pred_chroma_dc_lp_top; + p->cavs_intra_chroma[INTRA_C_DC_128] = cavs_intra_pred_chroma_dc_128; + + /* deblock */ + p->filter_lv = cavs_filter_lv_c; + p->filter_lh = cavs_filter_lh_c; + p->filter_cv = cavs_filter_cv_c; + p->filter_ch = cavs_filter_ch_c; + + cavs_idct8_add = cavs_idct8_add_c; + cavs_idct4_add = cavs_idct4_add_c; + + p->put_h264_chroma_pixels_tab[0] = cavs_chroma_mc8_put_c; + p->put_h264_chroma_pixels_tab[1] = cavs_chroma_mc4_put_c; + p->put_h264_chroma_pixels_tab[2] = cavs_chroma_mc2_put_c; + + p->avg_h264_chroma_pixels_tab[0] = cavs_chroma_mc8_avg_c; + p->avg_h264_chroma_pixels_tab[1] = cavs_chroma_mc4_avg_c; + p->avg_h264_chroma_pixels_tab[2] = cavs_chroma_mc2_avg_c; + + p->put_h264_chroma_pixels_tab[2] = cavs_chroma_mc2_put_c; + p->avg_h264_chroma_pixels_tab[2] = cavs_chroma_mc2_avg_c; + + p->put_cavs_qpel_pixels_tab[0][0] = cavs_qpel16_put_mc00_c; + p->put_cavs_qpel_pixels_tab[0][ 1] = cavs_qpel16_put_mc10_c; + p->put_cavs_qpel_pixels_tab[0][ 2] = cavs_qpel16_put_mc20_c; + p->put_cavs_qpel_pixels_tab[0][ 3] = cavs_qpel16_put_mc30_c; + p->put_cavs_qpel_pixels_tab[0][ 4] = cavs_qpel16_put_mc01_c; + p->put_cavs_qpel_pixels_tab[0][ 5] = cavs_qpel16_put_mc11_c; + p->put_cavs_qpel_pixels_tab[0][ 6] = cavs_qpel16_put_mc21_c; + p->put_cavs_qpel_pixels_tab[0][ 7] = cavs_qpel16_put_mc31_c; + p->put_cavs_qpel_pixels_tab[0][ 8] = cavs_qpel16_put_mc02_c; + p->put_cavs_qpel_pixels_tab[0][ 9] = cavs_qpel16_put_mc12_c; + p->put_cavs_qpel_pixels_tab[0][10] = cavs_qpel16_put_mc22_c; + p->put_cavs_qpel_pixels_tab[0][11] = cavs_qpel16_put_mc32_c; + p->put_cavs_qpel_pixels_tab[0][12] = cavs_qpel16_put_mc03_c; + p->put_cavs_qpel_pixels_tab[0][13] = cavs_qpel16_put_mc13_c; + p->put_cavs_qpel_pixels_tab[0][14] = cavs_qpel16_put_mc23_c; + p->put_cavs_qpel_pixels_tab[0][15] = cavs_qpel16_put_mc33_c; + p->put_cavs_qpel_pixels_tab[1][ 0] = cavs_qpel8_put_mc00_c; + p->put_cavs_qpel_pixels_tab[1][ 1] = cavs_qpel8_put_mc10_c; + p->put_cavs_qpel_pixels_tab[1][ 2] = cavs_qpel8_put_mc20_c; + p->put_cavs_qpel_pixels_tab[1][ 3] = cavs_qpel8_put_mc30_c; + p->put_cavs_qpel_pixels_tab[1][ 4] = cavs_qpel8_put_mc01_c; + p->put_cavs_qpel_pixels_tab[1][ 5] = cavs_qpel8_put_mc11_c; + p->put_cavs_qpel_pixels_tab[1][ 6] = cavs_qpel8_put_mc21_c; + p->put_cavs_qpel_pixels_tab[1][ 7] = cavs_qpel8_put_mc31_c; + p->put_cavs_qpel_pixels_tab[1][ 8] = cavs_qpel8_put_mc02_c; + p->put_cavs_qpel_pixels_tab[1][ 9] = cavs_qpel8_put_mc12_c; + p->put_cavs_qpel_pixels_tab[1][10] = cavs_qpel8_put_mc22_c; + p->put_cavs_qpel_pixels_tab[1][11] = cavs_qpel8_put_mc32_c; + p->put_cavs_qpel_pixels_tab[1][12] = cavs_qpel8_put_mc03_c; + p->put_cavs_qpel_pixels_tab[1][13] = cavs_qpel8_put_mc13_c; + p->put_cavs_qpel_pixels_tab[1][14] = cavs_qpel8_put_mc23_c; + p->put_cavs_qpel_pixels_tab[1][15] = cavs_qpel8_put_mc33_c; + + p->avg_cavs_qpel_pixels_tab[0][ 0] = cavs_qpel16_avg_mc00_c; + p->avg_cavs_qpel_pixels_tab[0][ 1] = cavs_qpel16_avg_mc10_c; + p->avg_cavs_qpel_pixels_tab[0][ 2] = cavs_qpel16_avg_mc20_c; + p->avg_cavs_qpel_pixels_tab[0][ 3] = cavs_qpel16_avg_mc30_c; + p->avg_cavs_qpel_pixels_tab[0][ 4] = cavs_qpel16_avg_mc01_c; + p->avg_cavs_qpel_pixels_tab[0][ 5] = cavs_qpel16_avg_mc11_c; + p->avg_cavs_qpel_pixels_tab[0][ 6] = cavs_qpel16_avg_mc21_c; + p->avg_cavs_qpel_pixels_tab[0][ 7] = cavs_qpel16_avg_mc31_c; + p->avg_cavs_qpel_pixels_tab[0][ 8] = cavs_qpel16_avg_mc02_c; + p->avg_cavs_qpel_pixels_tab[0][ 9] = cavs_qpel16_avg_mc12_c; + p->avg_cavs_qpel_pixels_tab[0][10] = cavs_qpel16_avg_mc22_c; + p->avg_cavs_qpel_pixels_tab[0][11] = cavs_qpel16_avg_mc32_c; + p->avg_cavs_qpel_pixels_tab[0][12] = cavs_qpel16_avg_mc03_c; + p->avg_cavs_qpel_pixels_tab[0][13] = cavs_qpel16_avg_mc13_c; + p->avg_cavs_qpel_pixels_tab[0][14] = cavs_qpel16_avg_mc23_c; + p->avg_cavs_qpel_pixels_tab[0][15] = cavs_qpel16_avg_mc33_c; + + p->avg_cavs_qpel_pixels_tab[1][ 0] = cavs_qpel8_avg_mc00_c; + p->avg_cavs_qpel_pixels_tab[1][ 1] = cavs_qpel8_avg_mc10_c; + p->avg_cavs_qpel_pixels_tab[1][ 2] = cavs_qpel8_avg_mc20_c; + p->avg_cavs_qpel_pixels_tab[1][ 3] = cavs_qpel8_avg_mc30_c; + p->avg_cavs_qpel_pixels_tab[1][ 4] = cavs_qpel8_avg_mc01_c; + p->avg_cavs_qpel_pixels_tab[1][ 5] = cavs_qpel8_avg_mc11_c; + p->avg_cavs_qpel_pixels_tab[1][ 6] = cavs_qpel8_avg_mc21_c; + p->avg_cavs_qpel_pixels_tab[1][ 7] = cavs_qpel8_avg_mc31_c; + p->avg_cavs_qpel_pixels_tab[1][ 8] = cavs_qpel8_avg_mc02_c; + p->avg_cavs_qpel_pixels_tab[1][ 9] = cavs_qpel8_avg_mc12_c; + p->avg_cavs_qpel_pixels_tab[1][10] = cavs_qpel8_avg_mc22_c; + p->avg_cavs_qpel_pixels_tab[1][11] = cavs_qpel8_avg_mc32_c; + p->avg_cavs_qpel_pixels_tab[1][12] = cavs_qpel8_avg_mc03_c; + p->avg_cavs_qpel_pixels_tab[1][13] = cavs_qpel8_avg_mc13_c; + p->avg_cavs_qpel_pixels_tab[1][14] = cavs_qpel8_avg_mc23_c; + p->avg_cavs_qpel_pixels_tab[1][15] = cavs_qpel8_avg_mc33_c; + +#if B_MB_WEIGHTING + /* weighting prediction */ + p->cavs_avg_pixels_tab[0] = pixel_avg_16x16_c; + p->cavs_avg_pixels_tab[1] = pixel_avg_8x8_c; + p->cavs_avg_pixels_tab[2] = pixel_avg_4x4_c; +#endif /* B_MB_WEIGHTING */ +} + +static void cavs_out_image_yuv420(cavs_decoder *p, cavs_image *p_cur, uint8_t *p_yuv_in[3], int b_bottom ) +{ + uint32_t j = 0; + unsigned char* p_bufimg; + uint8_t *p_yuv; + int b_interlaced = p->param.b_interlaced; + int b_align = 0; + + if( !b_interlaced ) + { + /* Y */ + p_bufimg = p_cur->p_data[0]; + p_yuv = p_yuv_in[0]; + for (j = 0; j < p->vsh.i_vertical_size; j++) + { + memcpy(p_yuv, p_bufimg, p->vsh.i_horizontal_size); + p_yuv += p->vsh.i_horizontal_size; + p_bufimg += p_cur->i_stride[0]; + } + + /* U */ + p_yuv = p_yuv_in[1]; + p_bufimg = p_cur->p_data[1]; + for (j = 0; j < p->vsh.i_vertical_size/2; j++) + { + memcpy(p_yuv, p_bufimg, p->vsh.i_horizontal_size/2); + p_yuv += p->vsh.i_horizontal_size/2; + p_bufimg += p_cur->i_stride[1]; + } + + /* V */ + p_yuv = p_yuv_in[2]; + p_bufimg = p_cur->p_data[2]; + for ( j = 0; j < p->vsh.i_vertical_size/2; j++ ) + { + memcpy(p_yuv, p_bufimg, p->vsh.i_horizontal_size/2); + p_yuv += p->vsh.i_horizontal_size/2; + p_bufimg += p_cur->i_stride[2]; + } + } + else + { + int i_offset_y = 0; + int i_offset_uv = 0; + int i_bufimg_y = 0; + int i_bufimg_uv = 0; + + if( b_interlaced && /*p->b_bottom*/b_bottom ) + { + i_offset_y = ((p_cur->i_stride[0])>>1) - 32; + i_offset_uv = ((p_cur->i_stride[1])>>1) - 16; + i_bufimg_y = (p_cur->i_stride[0]>>1); + i_bufimg_uv = (p_cur->i_stride[1]>>1); + } + + /* Y */ + p_yuv = p_yuv_in[0] + i_offset_y; + p_bufimg = p_cur->p_data[0] + i_bufimg_y; + for ( j = 0; j < (p->vsh.i_vertical_size>>b_interlaced); j++ ) + { + memcpy( p_yuv, p_bufimg, p->vsh.i_horizontal_size); + p_yuv += (p->vsh.i_horizontal_size<i_stride[0]; + } + + /* U */ + p_yuv = p_yuv_in[1] + i_offset_uv; + p_bufimg = p_cur->p_data[1] + i_bufimg_uv; + for ( j = 0; j < ((p->vsh.i_vertical_size/2)>>b_interlaced); j++ ) + { + memcpy( p_yuv, p_bufimg, p->vsh.i_horizontal_size/2 ); + p_yuv += ((p->vsh.i_horizontal_size/2)<i_stride[1]; + } + + /* V */ + p_yuv = p_yuv_in[2] + i_offset_uv; + p_bufimg = p_cur->p_data[2] + i_bufimg_uv; + for ( j = 0; j < ((p->vsh.i_vertical_size/2)>>b_interlaced); j++ ) + { + memcpy(p_yuv, p_bufimg, p->vsh.i_horizontal_size/2); + p_yuv += ((p->vsh.i_horizontal_size/2)<i_stride[2]; + } + } +} + +static int cavs_get_extension(cavs_bitstream *s, cavs_decoder *p) +{ + int extension_id = cavs_bitstream_get_bits(s, 4); + if (extension_id == 2) //sequence display extension + { + return cavs_get_sequence_display_extension(s, &p->sde); + } + else if (extension_id == 4) //copyright extension + { + return cavs_get_copyright_extension(s, &p->ce); + } + else if (extension_id == 11) //camera extension + { + return cavs_get_camera_parameters_extension(s, &p->cpe); + } + else + { + while (((*(uint32_t*)(s->p)) & 0x00ffffff) != 0x000001/*0x00010000*/ && s->p < s->p_end ) + cavs_bitstream_get_bits(s, 8); + } + return 0; +} + +int cavs_macroblock_cache_init( cavs_decoder *p ); + +static void cavs_bitstream_save( frame_pack *frame, InputStream*p ) +{ + int64_t min_length; + + frame->bits.p_ori = p->f; + frame->bits.iBitsCount = p->iBitsCount; + frame->bits.iBufBytesNum = p->iBufBytesNum; + frame->bits.iBytePosition = p->iBytePosition; + frame->bits.iClearBitsNum = p->iClearBitsNum; + frame->bits.iStuffBitsNum = p->iStuffBitsNum; + frame->bits.uClearBits = p->uClearBits; + frame->bits.uPre3Bytes = p->uPre3Bytes; + frame->bits.demulate_enable = p->demulate_enable; + + min_length = p->f_end - p->f; + min_length = MIN2(SVA_STREAM_BUF_SIZE, min_length ); + frame->bits.min_length = min_length; + memcpy(frame->bits.buf, p->buf, /*min_length*/SVA_STREAM_BUF_SIZE ); +} + +static void cavs_bitstream_restore( InputStream*p, frame_pack *frame ) +{ + p->f = frame->bits.p_ori; + p->iBitsCount = frame->bits.iBitsCount; + p->iBufBytesNum = frame->bits.iBufBytesNum; + p->iBytePosition = frame->bits.iBytePosition; + p->iClearBitsNum = frame->bits.iClearBitsNum; + p->iStuffBitsNum = frame->bits.iStuffBitsNum; + p->uClearBits = frame->bits.uClearBits; + p->uPre3Bytes = frame->bits.uPre3Bytes; + p->demulate_enable = frame->bits.demulate_enable; + memcpy( p->buf, frame->bits.buf, /*frame->bits.min_length*/SVA_STREAM_BUF_SIZE ); +} + +uint32_t cavs_frame_pack( InputStream*p, frame_pack *frame ) +{ + uint32_t i_startcode; + + int i_len; + + /* pic header */ + i_startcode = frame->slice[0].i_startcode ; + + while(i_startcode) + { + cavs_bitstream_save( frame, p ); + i_startcode = cavs_get_one_nal( p, frame->m_buf, &i_len ); + + switch( i_startcode ) + { + case CAVS_VIDEO_SEQUENCE_START_CODE: + cavs_bitstream_restore( p, frame ); + return i_startcode; + case CAVS_VIDEO_SEQUENCE_END_CODE: + cavs_bitstream_restore( p, frame ); + return i_startcode; + case CAVS_VIDEO_EDIT_CODE: + cavs_bitstream_restore( p, frame ); + return i_startcode; + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_restore( p, frame ); + return i_startcode; + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_restore( p, frame ); + return i_startcode; + + case CAVS_USER_DATA_CODE: + break; + case CAVS_EXTENSION_START_CODE: + break; + case 0x000001fe: // FIXIT + cavs_bitstream_restore( p, frame ); + return i_startcode; + default: + memcpy(frame->p_cur, frame->m_buf, i_len ); /* pack slice into one frame */ + + /* set slice info */ + frame->slice[frame->slice_num].i_startcode = i_startcode; + frame->slice[frame->slice_num].p_start = frame->p_cur + 4; /* for skip current startcode */ + frame->slice[frame->slice_num].i_len = i_len-4; + + /*update frame info */ + frame->p_cur = frame->p_cur + i_len; + frame->i_len += i_len; + frame->slice_num++; + break; + } + } + + return 0; +} + +static void cavs_decoder_thread_init( cavs_decoder *p ) +{ + +} + +int cavs_decoder_process(void *p_decoder, unsigned char *p_in, int i_in_length) +{ + cavs_decoder *p=(cavs_decoder *)p_decoder; + uint32_t i_startcode; + uint8_t *p_buf; + int i_len,i_result=0; + + p_buf = p_in; + i_len = i_in_length; + + i_startcode = ((p_buf[0]<<24))|((p_buf[1]<<16))|(p_buf[2]<<8)|p_buf[3]; + p_buf += 4; /* skip startcode */ + i_len -= 4; + if(i_startcode==0) + { + return CAVS_ERROR; + } + + if(i_startcode!=CAVS_VIDEO_SEQUENCE_START_CODE&&!p->b_get_video_sequence_header) + { + return CAVS_ERROR; + } + + switch(i_startcode) + { + case CAVS_VIDEO_SEQUENCE_START_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + if(cavs_get_video_sequence_header(&p->s,&p->vsh)==0) + { + if(cavs_alloc_resource(p)!=0) + { + return CAVS_ERROR; + } + i_result = CAVS_SEQ_HEADER; + p->b_get_video_sequence_header=1; + + if(!p->b_threadpool_flag) + { + if( p->param.i_thread_num >= 1 && + cavs_threadpool_init( &p->threadpool, p->param.i_thread_num, (void*)cavs_decoder_thread_init, p ) ) + goto fail; + p->b_threadpool_flag = 1; + } + + if( !p->b_thread_flag && p->param.i_thread_num > 0 ) + { + int i; + + p->thread[0] = p; + if( cavs_pthread_mutex_init( &p->thread[0]->mutex, NULL ) ) + goto fail; + if( cavs_pthread_cond_init( &p->thread[0]->cv, NULL ) ) + goto fail; + + for( i = 1; i < p->param.i_thread_num; i++ ) + CHECKED_MALLOC( p->thread[i], sizeof(cavs_decoder) ); + + for( i = 1; i < p->param.i_thread_num; i++ ) + { + if( i > 0 ) + *p->thread[i] = *p; + if( cavs_pthread_mutex_init( &p->thread[i]->mutex, NULL ) ) + goto fail; + if( cavs_pthread_cond_init( &p->thread[i]->cv, NULL ) ) + goto fail; + + if(cavs_macroblock_cache_init( p->thread[i])) + goto fail; + } + p->b_thread_flag = 1; + } + + if( !p->b_accelerate_flag && p->param.b_accelerate ) + { + p->unused[0] = p; + CHECKED_MALLOC( p->unused[1], sizeof(cavs_decoder) ); + + *p->unused[1] = *p; + + if( cavs_pthread_mutex_init( &p->unused[1]->mutex, NULL ) ) + goto fail; + if( cavs_pthread_cond_init( &p->unused[1]->cv, NULL ) ) + goto fail; + + if(cavs_macroblock_cache_init( p->unused[1] )) + goto fail; + + p->b_accelerate_flag = 1; + + p->unused_backup[0] = p->unused[0]; + p->unused_backup[1] = p->unused[1]; + } + } + else + { + return CAVS_ERROR; + } + break; + case CAVS_VIDEO_SEQUENCE_END_CODE: + if( !p->param.b_accelerate ) + p->last_delayed_pframe = p->p_save[1]; + + i_result = CAVS_SEQ_END; + break; + case CAVS_USER_DATA_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_user_data(&p->s, &p->user_data); + i_result = CAVS_USER_DATA; + break; + case CAVS_EXTENSION_START_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_extension(&p->s, p); + i_result = CAVS_USER_DATA; + break; + case CAVS_VIDEO_EDIT_CODE: + p->i_video_edit_code_flag=0; + i_result = CAVS_USER_DATA; + break; + default: + i_result = CAVS_ERROR; + break; + + } + + return i_result; + +fail: + return CAVS_ERROR;//-1; +} + +int cavs_macroblock_cache_init( cavs_decoder *p ) +{ + uint32_t i_mb_width, i_mb_height, i_edge; + + i_mb_width = (p->vsh.i_horizontal_size+15)>>4; + if ( p->vsh.b_progressive_sequence ) + i_mb_height = (p->vsh.i_vertical_size+15)>>4; + else + i_mb_height = ((p->vsh.i_vertical_size+31) & 0xffffffe0)>>4; + + p->i_mb_width = i_mb_width; + p->i_mb_height = i_mb_height; + p->i_mb_num = i_mb_width*i_mb_height; + p->i_mb_num_half = p->i_mb_num>>1; + p->p_top_qp = (uint8_t *)cavs_malloc( p->i_mb_width); + + p->p_top_mv[0] = (cavs_vector *)cavs_malloc((p->i_mb_width*2+1)*sizeof(cavs_vector)); + p->p_top_mv[1] = (cavs_vector *)cavs_malloc((p->i_mb_width*2+1)*sizeof(cavs_vector)); + p->p_top_intra_pred_mode_y = (int *)cavs_malloc( p->i_mb_width*4*sizeof(*p->p_top_intra_pred_mode_y)); + p->p_mb_type_top = (int8_t *)cavs_malloc(p->i_mb_width*sizeof(int8_t)); + p->p_chroma_pred_mode_top = (int8_t *)cavs_malloc(p->i_mb_width*sizeof(int8_t)); + p->p_cbp_top = (int8_t *)cavs_malloc(p->i_mb_width*sizeof(int8_t)); + p->p_ref_top = (int8_t (*)[2][2])cavs_malloc(p->i_mb_width*2*2*sizeof(int8_t)); + p->p_top_border_y = (uint8_t *)cavs_malloc((p->i_mb_width+1)*CAVS_MB_SIZE); + p->p_top_border_cb = (uint8_t *)cavs_malloc((p->i_mb_width)*10); + p->p_top_border_cr = (uint8_t *)cavs_malloc((p->i_mb_width)*10); + + p->p_col_mv = (cavs_vector *)cavs_malloc( p->i_mb_width*(p->i_mb_height)*4*sizeof(cavs_vector)); + p->p_col_type_base = (uint8_t *)cavs_malloc(p->i_mb_width*(p->i_mb_height)); + p->p_block = (DCTELEM *)cavs_malloc(64*sizeof(DCTELEM)); + + if( p->param.b_accelerate ) + { + p->level_buf_tab = (int (*)[6][64])cavs_malloc(p->i_mb_num*6*64*sizeof(int)); + p->run_buf_tab = (int (*)[6][64])cavs_malloc(p->i_mb_num*6*64*sizeof(int)); + p->num_buf_tab = (int (*)[6])cavs_malloc(p->i_mb_num*6*sizeof(int)); + + p->i_mb_type_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); + p->i_qp_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); + p->i_cbp_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); + p->mv_tab = (cavs_vector (*)[24])cavs_malloc( p->i_mb_num*24*sizeof(cavs_vector)); + + p->i_intra_pred_mode_y_tab = (int (*)[25])cavs_malloc(p->i_mb_num*25*sizeof(int)); + p->i_pred_mode_chroma_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); + p->p_mvd_tab = (int16_t (*)[2][6][2])cavs_malloc(p->i_mb_num*2*6*2*sizeof(int16_t)); + p->p_ref_tab = (int8_t (*)[2][9])cavs_malloc(p->i_mb_num*2*9*sizeof(int8_t)); +#if B_MB_WEIGHTING + p->weighting_prediction_tab = (int *)cavs_malloc(p->i_mb_num*sizeof(int)); +#endif + } + + + i_edge = (p->i_mb_width*CAVS_MB_SIZE + CAVS_EDGE*2)*2*17*2*2; + p->p_edge = (uint8_t *)cavs_malloc(i_edge); + if( p->p_edge ) + { + memset(p->p_edge, 0, i_edge); + } + p->p_edge += i_edge/2; + + if( !p->p_top_qp ||!p->p_top_mv[0] ||!p->p_top_mv[1] + ||!p->p_top_intra_pred_mode_y ||!p->p_top_border_y ||!p->p_top_border_cb + ||!p->p_top_border_cr ||!p->p_col_mv ||!p->p_col_type_base + ||!p->p_block ||!p->p_edge ||!p->p_mb_type_top + ||!p->p_chroma_pred_mode_top ||!p->p_cbp_top ||!p->p_ref_top) + { + return -1; + } + + memset(p->p_block,0,64*sizeof(DCTELEM)); + + return 0; +} + +static int cavs_macroblock_cache_finit(cavs_decoder *p) +{ + uint32_t i_edge; + + CAVS_SAFE_FREE(p->p_top_qp); + CAVS_SAFE_FREE(p->p_top_mv[0]); + CAVS_SAFE_FREE(p->p_top_mv[1]); + CAVS_SAFE_FREE(p->p_top_intra_pred_mode_y); + CAVS_SAFE_FREE(p->p_mb_type_top); + CAVS_SAFE_FREE(p->p_chroma_pred_mode_top); + CAVS_SAFE_FREE(p->p_cbp_top); + CAVS_SAFE_FREE(p->p_ref_top); + CAVS_SAFE_FREE(p->p_top_border_y); + CAVS_SAFE_FREE(p->p_top_border_cb); + CAVS_SAFE_FREE(p->p_top_border_cr); + + CAVS_SAFE_FREE(p->p_col_mv); + CAVS_SAFE_FREE(p->p_col_type_base); + CAVS_SAFE_FREE(p->p_block); + + if (p->param.b_accelerate) + { + CAVS_SAFE_FREE(p->level_buf_tab); + CAVS_SAFE_FREE(p->run_buf_tab); + CAVS_SAFE_FREE(p->num_buf_tab); + + CAVS_SAFE_FREE(p->i_mb_type_tab); + CAVS_SAFE_FREE(p->i_qp_tab); + CAVS_SAFE_FREE(p->i_cbp_tab); + CAVS_SAFE_FREE(p->mv_tab); + + CAVS_SAFE_FREE(p->i_intra_pred_mode_y_tab); + CAVS_SAFE_FREE(p->i_pred_mode_chroma_tab); + CAVS_SAFE_FREE(p->p_mvd_tab); + CAVS_SAFE_FREE(p->p_ref_tab); + +#if B_MB_WEIGHTING + CAVS_SAFE_FREE(p->weighting_prediction_tab); +#endif + + } + + i_edge = (p->i_mb_width*CAVS_MB_SIZE + CAVS_EDGE * 2) * 2 * 17 * 2 * 2; + p->p_edge -= i_edge / 2; + CAVS_SAFE_FREE(p->p_edge); + + return 0; +} + +int cavs_decode_one_frame_delay( void *p_decoder, cavs_param *param ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + cavs_decoder *p_m = p; + cavs_decoder *p_rec; + int b_interlaced = p->param.b_interlaced; + + int i_result = 0; + + /* REC */ + /*init REC handle */ + p->current[0] = p->current[1]; + p_rec = p->current[0]; + + p->i_frame_decoded++; + if( p_rec != NULL ) + { + if( !b_interlaced ) + { + cavs_init_picture_ref_list( p_rec ); + cavs_get_slice_rec( p_rec ); + + /* this module will effect ref-list creature and update */ + if(p_rec->b_complete && p_rec->ph.i_picture_coding_type != CAVS_B_PICTURE) + { + cavs_image *p_image = p_rec->p_save[0]; + if(p_rec->vsh.b_low_delay) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + /* when b_low_delay is 1, output current frame when finish decoded current */ + cavs_out_image_yuv420(p, p_rec->p_save[0], param->p_out_yuv, 0); + } + if(!p_rec->p_save[1]) + { + p_rec->p_save[0] = &p_rec->image[1]; + } + else + { + if( p_rec->vsh.b_low_delay == 0 /*&& p_rec->ph.i_picture_coding_type != CAVS_I_PICTURE*/ ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[1]->i_code_type; + + /* when b_low_delay is 0, current frame should delay one frame to output */ + cavs_out_image_yuv420(p, p_rec->p_save[1], param->p_out_yuv, 0); + } + + if(!p_rec->p_save[2]) + { + p_rec->p_save[0] = &p_rec->image[2]; + } + else + { + p_rec->p_save[0] = p_rec->p_save[2]; + } + } + p_rec->p_save[2] = p_rec->p_save[1]; + p_rec->p_save[1] = p_image; + memset(&p_rec->cur, 0, sizeof(cavs_image)); + p_rec->b_complete = 0; + + /* copy ref-list to anther threads */ + p->current[1]->p_save[0] = p_rec->p_save[0]; + p->current[1]->p_save[1] = p_rec->p_save[1]; + p->current[1]->p_save[2] = p_rec->p_save[2]; + } + else if(p_rec->b_complete) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + /* ouput B-frame no delay */ + cavs_out_image_yuv420(p, p_rec->p_save[0], param->p_out_yuv, 0); + memset(&p_rec->cur,0,sizeof(cavs_image)); + p_rec->b_complete=0; + } + + /* NOTE : need this to output last frame */ + p->last_delayed_pframe = p_rec->p_save[1]; + p->p_save[1] = p_rec->p_save[1]; + } + else /* field */ + { + int field_count = 2; + + while(field_count--) + { + p_rec->b_bottom = !field_count; /* first-top second-botttom */ + cavs_init_picture_context_fld( p_rec ); + cavs_get_slice_rec_threads( p_rec ); + + if(p_rec->b_complete && p_rec->ph.i_picture_coding_type != CAVS_B_PICTURE) + { + cavs_image *p_image = p_rec->p_save[0]; + if(p_rec->vsh.b_low_delay) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[0], param->p_out_yuv, p_rec->b_bottom); + } + if(!p_rec->p_save[1]) + { + if( p_rec->b_bottom ) + p_rec->p_save[0] = &p_rec->image[1]; + } + else + { + if(p_rec->vsh.b_low_delay == 0 /*&& p_rec->ph.i_picture_coding_type != CAVS_I_PICTURE*/ ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[1]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[1], param->p_out_yuv, p_rec->b_bottom); + } + + if( p_rec->b_bottom ) + { + if(!p_rec->p_save[2]) + { + p_rec->p_save[0] = &p_rec->image[2]; + } + else + { + p_rec->p_save[0] = p_rec->p_save[2]; + } + } + } + + if( p_rec->b_bottom ) + { + p_rec->p_save[2] = p_rec->p_save[1]; + p_rec->p_save[1] = p_image; + memset(&p_rec->cur, 0, sizeof(cavs_image)); + + /* copy ref-list to anther threads */ + p_m->current[1]->p_save[0] = p_rec->p_save[0]; + p_m->current[1]->p_save[1] = p_rec->p_save[1]; + p_m->current[1]->p_save[2] = p_rec->p_save[2]; + } + p_rec->b_complete = 0; + p_rec->b_bottom = 0; + } + else if( p_rec->b_complete ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[0], param->p_out_yuv, p_rec->b_bottom); + memset(&p_rec->cur,0,sizeof(cavs_image)); + p_rec->b_complete=0; + p_rec->b_bottom = 0; + } + } + + /* NOTE : need this to output last frame */ + p->last_delayed_pframe = p_rec->p_save[1]; + p->p_save[1] = p_rec->p_save[1]; + } + } + + return i_result; + +} + +int decode_one_frame(void *p_decoder, frame_pack *frame, cavs_param *param ) +{ + cavs_decoder *p=(cavs_decoder *)p_decoder; + + uint32_t cur_startcode; + uint8_t *p_buf; + int i_len, i_result=0; + int sliceNum, threadNum; + int slice_count = 1; /* 0 is for pic header */ + + sliceNum = frame->slice_num - 1; /* exclude pic header */ + threadNum = 0; + + cur_startcode = frame->slice[0].i_startcode; + p_buf = frame->slice[0].p_start; + i_len = frame->slice[0].i_len; + frame->slice_num--; + + /* decode header of pic */ + switch( cur_startcode ) + { + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_init(&p->s, p_buf, i_len); + cavs_get_i_picture_header(&p->s, &p->ph, &p->vsh); + + if( p->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + p->ph.b_aec_enable = p->vsh.b_aec_enable; + } + else if(p->vsh.i_profile_id == PROFILE_JIZHUN) + { + p->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p->b_error_flag = 1; + + return CAVS_ERROR; + } + + p->ph.b_picture_structure = 1; /* NOTE : guarantee frame not change */ + cavs_init_picture(p); + + /* add for no-seq header before I-frame */ + p->last_delayed_pframe = p->p_save[1]; + break; + + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_init(&p->s, p_buf, i_len); + cavs_get_pb_picture_header(&p->s, &p->ph, &p->vsh); + + if( p->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p->ph.b_aec_enable = p->vsh.b_aec_enable; + } + else if(p->vsh.i_profile_id == PROFILE_JIZHUN) + { + p->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p->b_error_flag = 1; + + return CAVS_ERROR; + } + + p->ph.b_picture_structure = 1; /* NOTE : guarantee frame not change */ + cavs_init_picture(p); + + break; + + default: + return CAVS_ERROR; + } + + /* weighting quant */ + cavs_init_frame_quant_param( p ); + + cavs_frame_update_wq_matrix( p ); + + /* decode slice */ + while( frame->slice_num--) + { + cur_startcode = frame->slice[slice_count].i_startcode; + p_buf = frame->slice[slice_count].p_start; + i_len = frame->slice[slice_count].i_len; + slice_count++; + + switch( cur_startcode ) + { + case CAVS_USER_DATA_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_user_data(&p->s, &p->user_data); + break; + + case CAVS_EXTENSION_START_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_extension(&p->s, p); + break; + + default: + if( !p->cur.p_data[0] ) /* store current decoded frame */ + { + break; + } + + if( p->ph.i_picture_coding_type == CAVS_B_PICTURE ) + { + if( !p->p_save[1] || !p->p_save[2] ) /* need L0 and L1 reference frame */ + { + break; + } + } + + if( p->ph.i_picture_coding_type == CAVS_P_PICTURE ) + { + if( !p->p_save[1] ) /* need reference frame */ + { + break; + } + } + + if( cur_startcode >= CAVS_SLICE_MIN_START_CODE + && cur_startcode <= CAVS_SLICE_MAX_START_CODE ) + { + int i_next_mb_y; + + cavs_bitstream_init(&p->s, p_buf, i_len); + p->i_mb_y = cur_startcode & 0x000000FF; + + if( frame->slice_num != 0 ) + i_next_mb_y = frame->slice[slice_count].i_startcode & 0x000000FF; /*slice_count++ before*/ + else + i_next_mb_y = 0xFF; + if (i_next_mb_y>=0 && i_next_mb_y<=0xAF) + p->i_slice_mb_end = i_next_mb_y * p->i_mb_width; + else + p->i_slice_mb_end = p->i_mb_num; + + if( cavs_get_slice(p) != 0 ) + { + p->b_complete = 1; /* set for pic exchange */ + //return CAVS_ERROR; + } + + /* this module will effect ref-list creature and update */ + if(p->b_complete && p->ph.i_picture_coding_type != CAVS_B_PICTURE) + { + cavs_image *p_image = p->p_save[0]; + if(p->vsh.b_low_delay) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[0]->i_code_type; + + /* when b_low_delay is 1, output current frame when finish decoded current */ + cavs_out_image_yuv420(p, p->p_save[0], param->p_out_yuv, 0); + } + if(!p->p_save[1]) + { + p->p_save[0] = &p->image[1]; + } + else + { + if( p->vsh.b_low_delay == 0 /*&& p->ph.i_picture_coding_type != CAVS_I_PICTURE*/ ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[1]->i_code_type; + + /* when b_low_delay is 0, current frame should delay one frame to output */ + cavs_out_image_yuv420(p, p->p_save[1], param->p_out_yuv, 0); + } + + if(!p->p_save[2]) + { + p->p_save[0] = &p->image[2]; + } + else + { + p->p_save[0] = p->p_save[2]; + } + } + p->p_save[2] = p->p_save[1]; + p->p_save[1] = p_image; + memset(&p->cur, 0, sizeof(cavs_image)); + p->b_complete = 0; + } + else if(p->b_complete) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[0]->i_code_type; + + /* ouput B-frame no delay */ + cavs_out_image_yuv420(p, p->p_save[0], param->p_out_yuv, 0); + memset(&p->cur,0,sizeof(cavs_image)); + p->b_complete=0; + } + } + else + { + return CAVS_ERROR; + } + } + } + + if( p->b_error_flag ) + { + i_result = CAVS_ERROR; + } + + return i_result; +} + +static int frame_decode_aec_threads_far( cavs_decoder *p_aec ) +{ + cavs_decoder *p_m = p_aec->p_m; + frame_pack *frame = p_aec->fld; + uint8_t *p_buf; + int i_len, i_result = 0; + int slice_count = p_aec->slice_count; + uint32_t cur_startcode; + uint32_t i_ret = 0; + + /* pack */ + i_ret = cavs_frame_pack( p_aec->p_stream, frame ); + if( i_ret == CAVS_ERROR ) + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + + cur_startcode = frame->slice[0].i_startcode; + p_buf = frame->slice[0].p_start; + i_len = frame->slice[0].i_len; + frame->slice_num--; + + /* decode header of pic */ + switch( cur_startcode ) + { + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_init(&p_aec->s, p_buf, i_len); + cavs_get_i_picture_header(&p_aec->s, &p_aec->ph, &p_aec->vsh); + + if( p_aec->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p_aec->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p_aec->ph.b_aec_enable = p_m->vsh.b_aec_enable; + } + else if(p_aec->vsh.i_profile_id == PROFILE_JIZHUN) + { + p_aec->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p_aec->b_error_flag = 1; + + return CAVS_ERROR; + } + p_aec->ph.b_picture_structure = 1; /* NOTE : guarantee frame not change */ + + i_ret = cavs_init_picture_context(p_aec); + if(i_ret == CAVS_ERROR) + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + cavs_init_picture_ref_list_for_aec(p_aec); + + break; + + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_init(&p_aec->s, p_buf, i_len); + cavs_get_pb_picture_header(&p_aec->s, &p_aec->ph, &p_aec->vsh); + + if( p_aec->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p_aec->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p_aec->ph.b_aec_enable = p_m->vsh.b_aec_enable; + } + else if(p_aec->vsh.i_profile_id == PROFILE_JIZHUN) + { + p_aec->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p_aec->b_error_flag = 1; + + return CAVS_ERROR; + } + p_aec->ph.b_picture_structure = 1; /* NOTE : guarantee frame not change */ + + i_ret = cavs_init_picture_context(p_aec); + if( i_ret == CAVS_ERROR ) + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + cavs_init_picture_ref_list_for_aec(p_aec); + + break; + + default: + return CAVS_ERROR; + } + + /* weighting quant */ + cavs_init_frame_quant_param( p_aec ); + + cavs_frame_update_wq_matrix( p_aec ); + + while( frame->slice_num--) + { + cur_startcode = frame->slice[slice_count].i_startcode; + p_buf = frame->slice[slice_count].p_start; + i_len = frame->slice[slice_count].i_len; + slice_count++; + + switch( cur_startcode ) + { + case CAVS_USER_DATA_CODE: + cavs_bitstream_init(&p_aec->s,p_buf,i_len); + i_result = cavs_get_user_data(&p_aec->s, &p_aec->user_data); + break; + + case CAVS_EXTENSION_START_CODE: + cavs_bitstream_init(&p_aec->s,p_buf,i_len); + i_result = cavs_get_extension(&p_aec->s, p_aec); + break; + + default: + + if( cur_startcode >= CAVS_SLICE_MIN_START_CODE + && cur_startcode <= CAVS_SLICE_MAX_START_CODE ) + { + int i_next_mb_y; + + cavs_bitstream_init(&p_aec->s, p_buf, i_len); /* init handle */ + p_aec->i_mb_y = cur_startcode & 0x000000FF; + + if( frame->slice_num != 0 ) + i_next_mb_y = frame->slice[slice_count].i_startcode & 0x000000FF; /*slice_count++ before*/ + else + i_next_mb_y = 0xFF; + if (i_next_mb_y>=0 && i_next_mb_y<=0xAF) + p_aec->i_slice_mb_end = i_next_mb_y * p_aec->i_mb_width; + else + p_aec->i_slice_mb_end = p_aec->i_mb_num; + //p_aec->b_bottom = 0; + //p_aec->i_slice_mb_end_fld[p_aec->b_bottom] = p_aec->i_slice_mb_end; + + /* AEC */ + cavs_get_slice_aec(p_aec); + if(p_aec->b_error_flag == 1) + return CAVS_ERROR; + + /* creat independent ref-list for AEC module */ + if( p_aec->ph.i_picture_coding_type != CAVS_B_PICTURE ) + { + cavs_image *p_image = p_aec->p_save_aec[0]; + + if(!p_aec->p_save_aec[1]) + { + p_aec->p_save_aec[0] = &p_aec->image_aec[1]; + } + else + { + if(!p_aec->p_save_aec[2]) + { + p_aec->p_save_aec[0] = &p_aec->image_aec[2]; + } + else + { + p_aec->p_save_aec[0] = p_aec->p_save_aec[2]; + } + } + p_aec->p_save_aec[2] = p_aec->p_save_aec[1]; + p_aec->p_save_aec[1] = p_image; + memset(&p_aec->cur_aec, 0, sizeof(cavs_image)); + } + } + else + { + p_aec->b_error_flag = 1; + + return CAVS_ERROR; + } + } + } + + return 0; +} + +static int decode_one_frame_far(void *p_decoder, frame_pack *frame, cavs_param *param ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + cavs_decoder *p_m = p;/* backup main threads */ + cavs_decoder *p_aec, *p_rec; + + int i_result=0; + int slice_count = 1; /* 0 is for pic header */ + + /* FIXIT : should init handle here */ + p_aec = p_m->unused[0]; + p = p_aec; /* switch to aec threads */ + + /* decode slice */ + p_aec->p_m = p_m; + p_aec->fld = frame; + p_aec->slice_count = slice_count; + cavs_threadpool_run( p_m->threadpool, (void*)frame_decode_aec_threads_far, p_aec ); + p_aec->b_thread_active = 1; + + /* handle switch */ + p_m->unused[0] = p_m->unused[1]; + p_m->unused[1] = p_aec; + + p_m->current[0] = p_m->current[1]; + p_m->current[1] = p_aec; + + /* REC */ + /*init REC handle */ + p_rec = p_m->current[0]; + if( p_rec != NULL ) + { + cavs_init_picture_context_frame(p_rec); + i_result = cavs_get_slice_rec_threads( p_rec ); + if( i_result == -1 ) + { + i_result = CAVS_ERROR; + + /* close AEC at same time */ + if( p_aec->b_thread_active == 1 ) + { + if(cavs_threadpool_wait( p_m->threadpool, p_aec)) + ;//return -1; + + p_aec->b_thread_active = 0; + } + return i_result; + } + + if( p_rec->ph.i_picture_coding_type != CAVS_B_PICTURE ) + p_m->last_delayed_pframe = p_rec->p_save[1]; + + /* this module will effect ref-list creature and update */ + if(p_rec->b_complete && p_rec->ph.i_picture_coding_type != CAVS_B_PICTURE) + { + cavs_image *p_image = p_rec->p_save[0]; + if(p_rec->vsh.b_low_delay) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + /* when b_low_delay is 1, output current frame when finish decoded current */ + cavs_out_image_yuv420(p_m, p_rec->p_save[0], param->p_out_yuv, 0); + } + if(!p_rec->p_save[1]) + { + p_rec->p_save[0] = &p_rec->image[1]; + } + else + { + if( p_rec->vsh.b_low_delay == 0 /*&& p_rec->ph.i_picture_coding_type != CAVS_I_PICTURE*/ ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[1]->i_code_type; + + /* when b_low_delay is 0, current frame should delay one frame to output */ + cavs_out_image_yuv420(p_m, p_rec->p_save[1], param->p_out_yuv, 0); + } + else + { + param->output_type = -1; + } + + if(!p_rec->p_save[2]) + { + p_rec->p_save[0] = &p_rec->image[2]; + } + else + { + p_rec->p_save[0] = p_rec->p_save[2]; + } + } + p_rec->p_save[2] = p_rec->p_save[1]; + p_rec->p_save[1] = p_image; + memset(&p_rec->cur, 0, sizeof(cavs_image)); + p_rec->b_complete = 0; + + /* copy ref-list to anther threads */ + p_m->current[1]->p_save[0] = p_rec->p_save[0]; + p_m->current[1]->p_save[1] = p_rec->p_save[1]; + p_m->current[1]->p_save[2] = p_rec->p_save[2]; + } + else if(p_rec->b_complete) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + /* ouput B-frame no delay */ + cavs_out_image_yuv420(p_m, p_rec->p_save[0], param->p_out_yuv, 0); + memset(&p_rec->cur,0,sizeof(cavs_image)); + p_rec->b_complete=0; + } + } + + /* waiting for end of AEC threads */ + if( p_aec->b_thread_active == 1 ) + { + if(cavs_threadpool_wait( p_m->threadpool, p_aec)) + ;//return -1; + p_aec->b_thread_active = 0; + } + + if( p_aec->b_error_flag ) + { + return CAVS_ERROR; + } + + p_m->unused[0]->p_save_aec[0] = p_aec->p_save_aec[0];/* should proc like field */ + p_m->unused[0]->p_save_aec[1] = p_aec->p_save_aec[1]; + p_m->unused[0]->p_save_aec[2] = p_aec->p_save_aec[2]; + + /* copy col type to next handle */ + memcpy( p_m->unused[0]->p_col_mv, p_aec->p_col_mv,p_m->i_mb_width*(p_m->i_mb_height)*4*sizeof(cavs_vector)); + memcpy( p_m->unused[0]->p_col_type_base, p_aec->p_col_type_base, p_m->i_mb_width*(p_m->i_mb_height)); + + if( p->b_error_flag ) + { + i_result = CAVS_ERROR; + } + + return i_result; +} + + +/* cavs_topfield_pack */ +uint32_t cavs_topfield_pack( InputStream*p, frame_pack *field ) +{ + uint32_t i_startcode; + int i_len; + //unsigned char *m_buf; + + //m_buf = (unsigned char *)cavs_malloc((MAX_CODED_FRAME_SIZE/2)*sizeof(unsigned char)); + //memset(m_buf, 0, (MAX_CODED_FRAME_SIZE/2)*sizeof(unsigned char)); + + i_startcode = field->slice[0].i_startcode ; /* pic header */ + + while( i_startcode ) + { + cavs_bitstream_save( field, p ); + i_startcode = cavs_get_one_nal( p, field->m_buf, &i_len ); + + if( ((i_startcode & 0xff) > (uint32_t)field->i_mb_end[0]) + && i_startcode != CAVS_USER_DATA_CODE + && i_startcode != CAVS_EXTENSION_START_CODE ) /* next slice start mb address exceed field limit */ + { + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + + return i_startcode; + } + + switch( i_startcode ) + { + case CAVS_USER_DATA_CODE: + break; + case CAVS_EXTENSION_START_CODE: + break; + default: + memcpy(field->p_cur, field->m_buf, i_len ); /* pack slice into one frame */ + + /* set slice info */ + field->slice[field->slice_num].i_startcode = i_startcode; + field->slice[field->slice_num].p_start = field->p_cur + 4; /* for skip current startcode */ + field->slice[field->slice_num].i_len = i_len-4; + + /*update frame info */ + field->p_cur = field->p_cur + i_len; + field->i_len += i_len; + field->slice_num++; + break; + } + } + + return 0; +} + +/* decode_top_field */ +int decode_top_field(void *p_decoder, frame_pack *field, cavs_param *param ) +{ + cavs_decoder *p=(cavs_decoder *)p_decoder; + uint32_t cur_startcode; + uint8_t *p_buf; + int i_len, i_result=0; + int sliceNum, threadNum; + int ret = 0; + int slice_count = 1; /* 0 is for pic header */ + //int b_interlaced = p->param.b_interlaced; + + p->b_bottom = field->b_bottom; + sliceNum = field->slice_num - 1; /* exclude pic header */ + threadNum = 0; + + cur_startcode = field->slice[0].i_startcode; + p_buf = field->slice[0].p_start; + i_len = field->slice[0].i_len; + field->slice_num--; + + /* decode header of pic */ + switch( cur_startcode ) + { + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_init(&p->s, p_buf, i_len); + cavs_get_i_picture_header(&p->s,&p->ph,&p->vsh); + if( p->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p->ph.b_aec_enable = p->vsh.b_aec_enable; + } + else if(p->vsh.i_profile_id == PROFILE_JIZHUN) + { + p->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p->b_error_flag = 1; + + return CAVS_ERROR; + } + p->ph.b_picture_structure = 0; /* NOTE : guarantee field not change */ + cavs_init_picture(p); + + /* add for no-seq header before I-frame */ + p->last_delayed_pframe = p->p_save[1]; + break; + + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_init(&p->s, p_buf, i_len); + cavs_get_pb_picture_header(&p->s,&p->ph,&p->vsh); + if( p->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p->ph.b_aec_enable = p->vsh.b_aec_enable; + } + else if(p->vsh.i_profile_id == PROFILE_JIZHUN) + { + p->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p->b_error_flag = 1; + + return CAVS_ERROR; + } + p->ph.b_picture_structure = 0; /* NOTE : guarantee field not change */ + cavs_init_picture(p); + break; + + default: + return CAVS_ERROR; + } + + /*add for weighting quant */ + cavs_init_frame_quant_param( p ); + + cavs_frame_update_wq_matrix( p ); + + /* decode slice */ + while( field->slice_num--) + { + cur_startcode = field->slice[slice_count].i_startcode; + p_buf = field->slice[slice_count].p_start; + i_len = field->slice[slice_count].i_len; + slice_count++; + + switch( cur_startcode ) + { + case CAVS_USER_DATA_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_user_data(&p->s, &p->user_data); + break; + + case CAVS_EXTENSION_START_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_extension(&p->s, p); + break; + + default: + if( !p->cur.p_data[0] ) /* store current decoded frame */ + { + break; + } + + if( p->ph.i_picture_coding_type == CAVS_B_PICTURE ) + { + if( !p->p_save[1] || !p->p_save[2] ) /* need L0 and L1 reference frame */ + { + break; + } + } + + if( p->ph.i_picture_coding_type == CAVS_P_PICTURE ) + { + if( !p->p_save[1] ) /* need reference frame */ + { + break; + } + } + + if( cur_startcode >= CAVS_SLICE_MIN_START_CODE + && cur_startcode <= CAVS_SLICE_MAX_START_CODE ) + { + int i_next_mb_y; + + p->b_error_flag = 0; + cavs_bitstream_init(&p->s, p_buf, i_len); + p->i_mb_y = cur_startcode & 0x000000FF; + + if( field->slice_num != 0 ) + i_next_mb_y = field->slice[slice_count].i_startcode & 0x000000FF; /*slice_count++ before*/ + else + i_next_mb_y = 0xFF; + + if((uint32_t)i_next_mb_y > (p->i_mb_height>>1) + && field->slice_num != 0 ) + { + p->b_error_flag = 1; + } + + if (i_next_mb_y>=0 && i_next_mb_y<=0xAF) + p->i_slice_mb_end = i_next_mb_y * p->i_mb_width; + else + { + p->i_slice_mb_end = (p->i_mb_num>>1); + } + + if( ! p->b_error_flag ) + { + if( cavs_get_slice(p) != 0 ) + { + p->b_complete = 1; /* set for pic exchange */ + //return CAVS_ERROR; + } + } + else + p->b_complete = 1; /* set for pic exchange */ + + if(p->b_complete && p->ph.i_picture_coding_type != CAVS_B_PICTURE) + { + //cavs_image *p_image = p->p_save[0]; + if(p->vsh.b_low_delay) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p, p->p_save[0], param->p_out_yuv, 0); + } + if(!p->p_save[1]) + { + //p->p_save[0] = &p->image[1]; + } + else + { + if(p->vsh.b_low_delay == 0 /*&& p->ph.i_picture_coding_type != CAVS_I_PICTURE*/ ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[1]->i_code_type; + + cavs_out_image_yuv420(p, p->p_save[1], param->p_out_yuv, 0); + } + + //if(!p->p_save[2]) + //{ + //p->p_save[0] = &p->image[2]; + //} + //else + //{ + // p->p_save[0] = p->p_save[2]; + //} + } + //p->p_save[2] = p->p_save[1]; + //p->p_save[1] = p_image; + //memset(&p->cur, 0, sizeof(cavs_image)); + p->b_complete = 0; + } + else if( p->b_complete ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p, p->p_save[0], param->p_out_yuv, 0); + memset(&p->cur,0,sizeof(cavs_image)); + p->b_complete=0; + } + } + else + { + return CAVS_ERROR; + } + } + } + + if( p->b_error_flag ) + { + i_result = CAVS_ERROR; + } + + return i_result; +} + +/* cavs_botfield_pack */ +uint32_t cavs_botfield_pack( InputStream*p, frame_pack *field ) +{ + uint32_t i_startcode; + int i_len; + //unsigned char *m_buf; + + //m_buf = (unsigned char *)cavs_malloc((MAX_CODED_FRAME_SIZE/2)*sizeof(unsigned char)); + //memset(m_buf, 0, (MAX_CODED_FRAME_SIZE/2)*sizeof(unsigned char)); + + i_startcode = 1; /* use to start loop */ + while( i_startcode ) + { + cavs_bitstream_save( field, p ); + i_startcode = cavs_get_one_nal( p, field->m_buf, &i_len ); + + switch( i_startcode ) + { + case CAVS_VIDEO_SEQUENCE_START_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + case CAVS_VIDEO_SEQUENCE_END_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + case CAVS_VIDEO_EDIT_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + + case CAVS_USER_DATA_CODE: + break; + case CAVS_EXTENSION_START_CODE: + break; + case 0x000001fe: // FIXIT + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + default: + memcpy(field->p_cur, field->m_buf, i_len ); /* pack slice into one frame */ + + /* set slice info */ + field->slice[field->slice_num].i_startcode = i_startcode; + field->slice[field->slice_num].p_start = field->p_cur + 4; /* for skip current startcode */ + field->slice[field->slice_num].i_len = i_len-4; + + /*update frame info */ + field->p_cur = field->p_cur + i_len; + field->i_len += i_len; + field->slice_num++; + break; + } + } + + //cavs_free(m_buf); + + return 0; +} + +/* decode_bot_field */ +int decode_bot_field(void *p_decoder, frame_pack *field, cavs_param *param ) +{ + cavs_decoder *p=(cavs_decoder *)p_decoder; + uint32_t cur_startcode; + uint8_t *p_buf; + int i_len, i_result=0; + int sliceNum, threadNum; + int ret = 0; + int slice_count = 0; /* bot pack has no pic header */ + //int b_interlaced = p->param.b_interlaced; + + p->b_bottom = field->b_bottom; + sliceNum = field->slice_num; /* bot pack has no pic header */ + threadNum = 0; + + cur_startcode = field->i_startcode_type; + + /* decode header of pic */ + switch( cur_startcode ) + { + case CAVS_I_PICUTRE_START_CODE: + //cavs_bitstream_init(&p->s, p_buf, i_len); + //cavs_get_i_picture_header(&p->s,&p->ph,&p->vsh); + cavs_init_picture(p); + break; + + case CAVS_PB_PICUTRE_START_CODE: + //cavs_bitstream_init(&p->s, p_buf, i_len); + //cavs_get_pb_picture_header(&p->s,&p->ph,&p->vsh); + cavs_init_picture(p); + break; + + default: + return CAVS_ERROR; + } + + /* decode slice */ + while( field->slice_num--) + { + cur_startcode = field->slice[slice_count].i_startcode; + p_buf = field->slice[slice_count].p_start; + i_len = field->slice[slice_count].i_len; + slice_count++; + + switch( cur_startcode ) + { + case CAVS_USER_DATA_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_user_data(&p->s, &p->user_data); + break; + + case CAVS_EXTENSION_START_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_extension(&p->s, p); + break; + + default: + if( !p->cur.p_data[0] ) /* store current decoded frame */ + { + break; + } + + if( p->ph.i_picture_coding_type == CAVS_B_PICTURE ) + { + if( !p->p_save[1] || !p->p_save[2] ) /* need L0 and L1 reference frame */ + { + break; + } + } + + if( p->ph.i_picture_coding_type == CAVS_P_PICTURE ) + { + if( !p->p_save[1] ) /* need reference frame */ + { + break; + } + } + + if( cur_startcode >= CAVS_SLICE_MIN_START_CODE + && cur_startcode <= CAVS_SLICE_MAX_START_CODE ) + { + int i_next_mb_y; + + p->b_error_flag = 0; + cavs_bitstream_init(&p->s, p_buf, i_len); + p->i_mb_y = cur_startcode & 0x000000FF; + + if( field->slice_num != 0 ) + i_next_mb_y = field->slice[slice_count].i_startcode & 0x000000FF; /*slice_count++ before*/ + else + i_next_mb_y = 0xFF; + + + if((uint32_t)i_next_mb_y < (p->i_mb_height>>1)) + { + p->b_error_flag = 1; + } + + if (i_next_mb_y>=0 && i_next_mb_y<=0xAF) + p->i_slice_mb_end = i_next_mb_y * p->i_mb_width; + else + { + p->i_slice_mb_end = p->i_mb_num; + } + + if( !p->b_error_flag ) + { + if( cavs_get_slice(p) != 0 ) + { + p->b_complete = 1; /* set for pic exchange */ + } + } + else + p->b_complete = 1; /* set for pic exchange */ + + if(p->b_complete && p->ph.i_picture_coding_type != CAVS_B_PICTURE) + { + cavs_image *p_image = p->p_save[0]; + if( p->vsh.b_low_delay ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p, p->p_save[0], param->p_out_yuv, 1); + } + if(!p->p_save[1]) + { + p->p_save[0] = &p->image[1]; + } + else + { + if(p->vsh.b_low_delay == 0 /*&& p->ph.i_picture_coding_type != CAVS_I_PICTURE*/ ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[1]->i_code_type; + + cavs_out_image_yuv420(p, p->p_save[1], param->p_out_yuv, 1); + } + + if(!p->p_save[2]) + { + p->p_save[0] = &p->image[2]; + } + else + { + p->p_save[0] = p->p_save[2]; + } + } + p->p_save[2] = p->p_save[1]; + p->p_save[1] = p_image; + memset(&p->cur, 0, sizeof(cavs_image)); + p->b_complete = 0; + } + else if(p->b_complete) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p, p->p_save[0], param->p_out_yuv, 1); + memset(&p->cur,0,sizeof(cavs_image)); + p->b_complete=0; + } + } + else + { + return CAVS_ERROR; + } + } + } + + if( p->b_error_flag ) + { + i_result = CAVS_ERROR; + } + + return i_result; +} + +/* pack top-field and bot-field into one frame */ +static uint32_t cavs_field_pack( InputStream*p, frame_pack *field ) +{ + uint32_t i_startcode, pre_startcode = 0; + int i_len; + //unsigned char *m_buf; + + //m_buf = (unsigned char *)cavs_malloc((MAX_CODED_FRAME_SIZE)*sizeof(unsigned char)); + //memset(m_buf, 0, (MAX_CODED_FRAME_SIZE)*sizeof(unsigned char)); + + i_startcode = 1; /* use to start loop */ + while( i_startcode ) + { + cavs_bitstream_save( field, p ); + i_startcode = cavs_get_one_nal( p, field->m_buf, &i_len ); + + switch( i_startcode ) + { + case CAVS_VIDEO_SEQUENCE_START_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + case CAVS_VIDEO_SEQUENCE_END_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + case CAVS_VIDEO_EDIT_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + + case CAVS_USER_DATA_CODE: + break; + case CAVS_EXTENSION_START_CODE: + break; + case 0x000001fe: // FIXIT + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + return i_startcode; + default: + if( i_startcode == pre_startcode ) /* NOTE : repeat slice should discard */ + break; + if ((i_startcode & 0xff) > (uint32_t)field->i_mb_end[1]) + { + cavs_bitstream_restore( p, field ); + //cavs_free(m_buf); + + return i_startcode; + } + + memcpy(field->p_cur, field->m_buf, i_len ); /* pack slice into one frame */ + + /* set slice info */ + field->slice[field->slice_num].i_startcode = i_startcode; + field->slice[field->slice_num].p_start = field->p_cur + 4; /* for skip current startcode */ + field->slice[field->slice_num].i_len = i_len-4; + + /*update frame info */ + field->p_cur = field->p_cur + i_len; + field->i_len += i_len; + field->slice_num++; + break; + } + + pre_startcode = i_startcode; + } + + //cavs_free(m_buf); + + return 0; +} + +static int field_decode_aec_threads( cavs_decoder *p_aec ) +{ + //cavs_decoder *p_m = p_aec->p_m; + frame_pack *field = p_aec->fld; + uint8_t *p_buf; + int i_len, i_result = 0; + int slice_count = p_aec->slice_count; + int field_count = p_aec->field_count; + uint32_t cur_startcode; + uint32_t i_ret =0; + + while( field->slice_num--) + { + cur_startcode = field->slice[slice_count].i_startcode; + p_buf = field->slice[slice_count].p_start; + i_len = field->slice[slice_count].i_len; + slice_count++; + field_count++; + + switch( cur_startcode ) + { + case CAVS_USER_DATA_CODE: + cavs_bitstream_init(&p_aec->s,p_buf,i_len); + i_result = cavs_get_user_data(&p_aec->s, &p_aec->user_data); + break; + + case CAVS_EXTENSION_START_CODE: + cavs_bitstream_init(&p_aec->s,p_buf,i_len); + i_result = cavs_get_extension(&p_aec->s, p_aec); + break; + + default: + + if( cur_startcode >= CAVS_SLICE_MIN_START_CODE + && cur_startcode <= CAVS_SLICE_MAX_START_CODE ) + { + int i_next_mb_y; + uint32_t i_mb_y_ori = 0; + + cavs_bitstream_init(&p_aec->s, p_buf, i_len); + p_aec->i_mb_y = cur_startcode & 0x000000FF; + i_mb_y_ori = p_aec->i_mb_y; + + /* set b_bottom */ + p_aec->b_bottom = 0; + if( p_aec->i_mb_y >= (p_aec->i_mb_height>>1)) + { + p_aec->b_bottom = 1; + + i_ret = cavs_init_picture_context(p_aec); + if( i_ret == CAVS_ERROR ) + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + cavs_init_picture_ref_list_for_aec(p_aec); + } + p_aec->i_mb_y = i_mb_y_ori; + + if( field->slice_num != 0 ) + i_next_mb_y = field->slice[slice_count].i_startcode & 0x000000FF; /*slice_count++ before*/ + else + i_next_mb_y = 0xFF; + + if( !p_aec->b_bottom ) + { + if((uint32_t)i_next_mb_y<(p_aec->i_mb_height>>1)) + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + } + + if (i_next_mb_y>=0 && i_next_mb_y<=0xAF) + p_aec->i_slice_mb_end = i_next_mb_y * p_aec->i_mb_width; + else + { + p_aec->i_slice_mb_end = (p_aec->i_mb_num>>(!p_aec->b_bottom)); + } + p_aec->i_slice_mb_end_fld[p_aec->b_bottom] = p_aec->i_slice_mb_end; + + cavs_get_slice_aec(p_aec); + if(p_aec->b_error_flag == 1) + return CAVS_ERROR; + + /* creat independent ref-list for AEC module */ + if( p_aec->ph.i_picture_coding_type != CAVS_B_PICTURE ) + { + cavs_image *p_image = p_aec->p_save_aec[0]; + + if(!p_aec->p_save_aec[1]) + { + if( p_aec->b_bottom ) + p_aec->p_save_aec[0] = &p_aec->image_aec[1]; + } + else + { + if( p_aec->b_bottom ) + { + if(!p_aec->p_save_aec[2]) + { + p_aec->p_save_aec[0] = &p_aec->image_aec[2]; + } + else + { + p_aec->p_save_aec[0] = p_aec->p_save_aec[2]; + } + } + } + + if( p_aec->b_bottom ) + { + p_aec->p_save_aec[2] = p_aec->p_save_aec[1]; + p_aec->p_save_aec[1] = p_image; + memset(&p_aec->cur_aec, 0, sizeof(cavs_image)); + } + } + } + else + { + return CAVS_ERROR; + } + } + } + + return 0; +} + + +/* decode top-field and bot-field orderly in one function */ +static int cavs_field_decode(void *p_decoder, frame_pack *field, cavs_param *param ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + cavs_decoder *p_m = p;/* backup main threads */ + cavs_decoder *p_aec, *p_rec; + int field_count = 0; + + uint32_t cur_startcode; + uint8_t *p_buf; + int i_len, i_ret = 0, i_result=0; + int sliceNum, threadNum; + int slice_count = 1; /* 0 is for pic header */ + + sliceNum = field->slice_num - 1; /* exclude pic header */ + threadNum = 0; + + cur_startcode = field->slice[0].i_startcode; + p_buf = field->slice[0].p_start; + i_len = field->slice[0].i_len; + field->slice_num--; + + /* init aec handle */ + p_aec = p_m->unused[0]; + p = p_aec; + p_aec->b_bottom = 0; /* init bottom flag */ + p_aec->i_frame_decoded = p_m->i_frame_decoded; //just for debug + + /* decode header of pic */ + switch( cur_startcode ) + { + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_init(&p->s, p_buf, i_len); + cavs_get_i_picture_header(&p->s,&p->ph,&p->vsh); + if( p->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p->ph.b_aec_enable = p->vsh.b_aec_enable; + } + else if(p->vsh.i_profile_id == PROFILE_JIZHUN) + { + p->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p->b_error_flag = 1; + + return CAVS_ERROR; + } + p->ph.b_picture_structure = 0; /* NOTE : guarantee field not change */ + i_ret = cavs_init_picture_context(p); + if( i_ret == CAVS_ERROR ) + { + p->b_error_flag = 1; + return CAVS_ERROR; + } + cavs_init_picture_ref_list_for_aec(p); + + break; + + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_init(&p->s, p_buf, i_len); + cavs_get_pb_picture_header(&p->s,&p->ph,&p->vsh); + if( p->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p->ph.b_aec_enable = p->vsh.b_aec_enable; + } + else if(p->vsh.i_profile_id == PROFILE_JIZHUN) + { + p->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p->b_error_flag = 1; + + return CAVS_ERROR; + } + p->ph.b_picture_structure = 0; /* NOTE : guarantee field not change */ + i_ret = cavs_init_picture_context(p); + if( i_ret == CAVS_ERROR ) + { + p->b_error_flag = 1; + return CAVS_ERROR; + } + cavs_init_picture_ref_list_for_aec(p); + break; + + default: + return CAVS_ERROR; + } + + /*add for weighting quant */ + cavs_init_frame_quant_param( p ); + + cavs_frame_update_wq_matrix( p ); + + p_aec->p_m = p_m; + p_aec->fld = field; + p_aec->slice_count = slice_count; + p_aec->field_count = field_count; + + cavs_threadpool_run( p_m->threadpool, (void*)field_decode_aec_threads, p_aec ); + p_aec->b_thread_active = 1; + + p_m->unused[0] = p_m->unused[1]; + p_m->unused[1] = p_aec; + + p_m->current[0] = p_m->current[1]; + p_m->current[1] = p_aec; + + + + /* rec decode loop */ + p_rec = p_m->current[0]; + field_count = 2; /* only support two field */ + if( p_rec != NULL ) + { + while( field_count-- ) + { + p_rec->b_bottom = !field_count; /* first-top second-botttom */ + + cavs_init_picture_context_fld( p_rec ); + cavs_get_slice_rec_threads( p_rec ); + + if( p_rec->b_bottom ) + { + if( p_rec->ph.i_picture_coding_type != CAVS_B_PICTURE ) + p_m->last_delayed_pframe = p_rec->p_save[1]; + } + + if(p_rec->b_complete && p_rec->ph.i_picture_coding_type != CAVS_B_PICTURE) + { + cavs_image *p_image = p_rec->p_save[0]; + if(p_rec->vsh.b_low_delay) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[0], param->p_out_yuv, p_rec->b_bottom); + } + if(!p_rec->p_save[1]) + { + if( p_rec->b_bottom ) + p_rec->p_save[0] = &p_rec->image[1]; + } + else + { + if(p_rec->vsh.b_low_delay == 0 /*&& p_rec->ph.i_picture_coding_type != CAVS_I_PICTURE*/ ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[1]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[1], param->p_out_yuv, p_rec->b_bottom); + } + else + { + param->output_type = -1; + } + + if( p_rec->b_bottom ) + { + if(!p_rec->p_save[2]) + { + p_rec->p_save[0] = &p_rec->image[2]; + } + else + { + p_rec->p_save[0] = p_rec->p_save[2]; + } + } + } + + if( p_rec->b_bottom ) + { + p_rec->p_save[2] = p_rec->p_save[1]; + p_rec->p_save[1] = p_image; + memset(&p_rec->cur, 0, sizeof(cavs_image)); + + /* copy ref-list to anther threads */ + p_m->current[1]->p_save[0] = p_rec->p_save[0]; + p_m->current[1]->p_save[1] = p_rec->p_save[1]; + p_m->current[1]->p_save[2] = p_rec->p_save[2]; + } + p_rec->b_complete = 0; + p_rec->b_bottom = 0; + } + else if( p_rec->b_complete ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[0], param->p_out_yuv, p_rec->b_bottom); + memset(&p_rec->cur,0,sizeof(cavs_image)); + p_rec->b_complete=0; + p_rec->b_bottom = 0; + } + } + } + + /*wait for end of AEC handle */ + if( p_aec->b_thread_active == 1 ) + { + if(cavs_threadpool_wait( p_m->threadpool, p_aec)) + ;//return -1; + + p_aec->b_thread_active = 0; + } + + p_m->unused[0]->p_save_aec[0] = p_aec->p_save_aec[0]; + p_m->unused[0]->p_save_aec[1] = p_aec->p_save_aec[1]; + p_m->unused[0]->p_save_aec[2] = p_aec->p_save_aec[2]; + + /* copy col type to next handle */ + memcpy( p_m->unused[0]->p_col_mv, p_aec->p_col_mv,p_m->i_mb_width*(p_m->i_mb_height)*4*sizeof(cavs_vector)); + memcpy( p_m->unused[0]->p_col_type_base, p_aec->p_col_type_base, p_m->i_mb_width*(p_m->i_mb_height)); + +#if B_MB_WEIGHTING + { + int i, j; + for( j = 0; j < 2; j++ ) + { + p_m->unused[0]->b_slice_weighting_flag[j] = p_aec->b_slice_weighting_flag[j]; + p_m->unused[0]->b_mb_weighting_flag[j] = p_aec->b_mb_weighting_flag[j]; + for( i = 0; i < 4; i++ ) + { + p_m->unused[0]->i_luma_scale[j][i] = p_aec->i_luma_scale[j][i]; + p_m->unused[0]->i_luma_shift[j][i] = p_aec->i_luma_shift[j][i]; + p_m->unused[0]->i_chroma_scale[j][i] = p_aec->i_chroma_scale[j][i]; + p_m->unused[0]->i_chroma_shift[j][i] = p_aec->i_chroma_shift[j][i]; + } + } + } +#endif + + if( p->b_error_flag ) + { + i_result = CAVS_ERROR; + } + + return i_result; +} + +static int field_decode_aec_threads_far( cavs_decoder *p_aec ) +{ + cavs_decoder *p_m = p_aec->p_m; + frame_pack *field = p_aec->fld; + uint8_t *p_buf; + int i_len, i_result = 0; + int slice_count = p_aec->slice_count; + int field_count = p_aec->field_count; + uint32_t cur_startcode; + uint32_t i_ret = 0; + + /* pack slice */ + cavs_field_pack( p_aec->p_stream, field ); + + cur_startcode = field->slice[0].i_startcode; + p_buf = field->slice[0].p_start; + i_len = field->slice[0].i_len; + field->slice_num--; + + /* decode header of pic */ + switch( cur_startcode ) + { + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_init(&p_aec->s, p_buf, i_len); + cavs_get_i_picture_header(&p_aec->s,&p_aec->ph,&p_aec->vsh); + + if( p_aec->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p_aec->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p_aec->ph.b_aec_enable = p_m->vsh.b_aec_enable; + } + else if(p_aec->vsh.i_profile_id == PROFILE_JIZHUN) + { + p_aec->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p_aec->b_error_flag = 1; + + return CAVS_ERROR; + } + + p_aec->ph.b_picture_structure = 0; /* NOTE : guarantee field or frame not change */ + + i_ret = cavs_init_picture_context(p_aec); + if( i_ret == CAVS_ERROR ) + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + cavs_init_picture_ref_list_for_aec(p_aec); + + break; + + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_init(&p_aec->s, p_buf, i_len); + cavs_get_pb_picture_header(&p_aec->s, &p_aec->ph, &p_aec->vsh); + + if( p_aec->vsh.i_profile_id == PROFILE_GUANGDIAN ) + { + //p_aec->ph.b_aec_enable = 1; /* AEC only for AVS+ */ + p_aec->ph.b_aec_enable = p_m->vsh.b_aec_enable; + } + else if(p_aec->vsh.i_profile_id == PROFILE_JIZHUN) + { + p_aec->ph.b_aec_enable = 0; /* AVS */ + } + else + { + p_aec->b_error_flag = 1; + + return CAVS_ERROR; + } + p_aec->ph.b_picture_structure = 0; /* NOTE : guarantee field not change */ + + i_ret = cavs_init_picture_context(p_aec); + if( i_ret == CAVS_ERROR ) + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + cavs_init_picture_ref_list_for_aec(p_aec); + + break; + + default: + return CAVS_ERROR; + } + + /*add for weighting quant */ + cavs_init_frame_quant_param( p_aec ); + + cavs_frame_update_wq_matrix( p_aec ); + while( field->slice_num--) + { + cur_startcode = field->slice[slice_count].i_startcode; + p_buf = field->slice[slice_count].p_start; + i_len = field->slice[slice_count].i_len; + slice_count++; + field_count++; + + switch( cur_startcode ) + { + case CAVS_USER_DATA_CODE: + cavs_bitstream_init(&p_aec->s,p_buf,i_len); + i_result = cavs_get_user_data(&p_aec->s, &p_aec->user_data); + break; + + case CAVS_EXTENSION_START_CODE: + cavs_bitstream_init(&p_aec->s,p_buf,i_len); + i_result = cavs_get_extension(&p_aec->s, p_aec); + break; + + default: + + if( cur_startcode >= CAVS_SLICE_MIN_START_CODE + && cur_startcode <= CAVS_SLICE_MAX_START_CODE ) + { + int i_next_mb_y; + uint32_t i_mb_y_ori = 0; + + cavs_bitstream_init(&p_aec->s, p_buf, i_len); + p_aec->i_mb_y = cur_startcode & 0x000000FF; + i_mb_y_ori = p_aec->i_mb_y; + + /* set b_bottom */ + p_aec->b_bottom = 0; + if( p_aec->i_mb_y >= (p_aec->i_mb_height>>1)) + { + p_aec->b_bottom = 1; + + i_ret = cavs_init_picture_context(p_aec); + if( i_ret == CAVS_ERROR ) + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + cavs_init_picture_ref_list_for_aec(p_aec); + } + p_aec->i_mb_y = i_mb_y_ori; + + if( field->slice_num != 0 ) + i_next_mb_y = field->slice[slice_count].i_startcode & 0x000000FF; /*slice_count++ before*/ + else + i_next_mb_y = 0xFF;/* bot-field */ + if (i_next_mb_y>=0 && i_next_mb_y<=0xAF) + p_aec->i_slice_mb_end = i_next_mb_y * p_aec->i_mb_width; + else + { + p_aec->i_slice_mb_end = (p_aec->i_mb_num>>(!p_aec->b_bottom)); + } + p_aec->i_slice_mb_end_fld[p_aec->b_bottom] = p_aec->i_slice_mb_end; + + cavs_get_slice_aec(p_aec); + if(p_aec->b_error_flag == 1) + return CAVS_ERROR; + + /* creat independent ref-list for AEC module */ + if( p_aec->ph.i_picture_coding_type != CAVS_B_PICTURE ) + { + cavs_image *p_image = p_aec->p_save_aec[0]; + + if(!p_aec->p_save_aec[1]) + { + if( p_aec->b_bottom ) + p_aec->p_save_aec[0] = &p_aec->image_aec[1]; + } + else + { + if( p_aec->b_bottom ) + { + if(!p_aec->p_save_aec[2]) + { + p_aec->p_save_aec[0] = &p_aec->image_aec[2]; + } + else + { + p_aec->p_save_aec[0] = p_aec->p_save_aec[2]; + } + } + } + + if( p_aec->b_bottom ) + { + p_aec->p_save_aec[2] = p_aec->p_save_aec[1]; + p_aec->p_save_aec[1] = p_image; + memset(&p_aec->cur_aec, 0, sizeof(cavs_image)); + } + } + } + else + { + p_aec->b_error_flag = 1; + return CAVS_ERROR; + } + } + } + + return 0; +} + +static int cavs_field_decode_far(void *p_decoder, frame_pack *field, cavs_param *param ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + cavs_decoder *p_m = p;/* backup main threads */ + cavs_decoder *p_aec, *p_rec; + int field_count = 0; + + int i_result = 0; + int sliceNum, threadNum; + int slice_count = 1; /* 0 is for pic header */ + + sliceNum = field->slice_num - 1; /* exclude pic header */ + threadNum = 0; + + /* init aec handle */ + p_aec = p_m->unused[0]; + p = p_aec; + p_aec->b_bottom = 0; /* init bottom flag */ + p_aec->i_frame_decoded = p_m->i_frame_decoded; //just for debug + + /* init p_aec*/ + p_aec->p_m = p_m; + p_aec->fld = field; + p_aec->slice_count = slice_count; + p_aec->field_count = field_count; + + cavs_threadpool_run( p_m->threadpool, (void*)field_decode_aec_threads_far, p_aec ); + p_aec->b_thread_active = 1; + + p_m->unused[0] = p_m->unused[1]; + p_m->unused[1] = p_aec; + + p_m->current[0] = p_m->current[1]; + p_m->current[1] = p_aec; + + /* rec decode loop */ + p_rec = p_m->current[0]; + field_count = 2; /* only support two field */ + if( p_rec != NULL ) + { + while( field_count-- ) + { + p_rec->b_bottom = !field_count; /* first-top second-botttom */ + + cavs_init_picture_context_fld( p_rec ); + i_result = cavs_get_slice_rec_threads( p_rec ); + if( i_result == -1 ) + { + /* close AEC at same time */ + if( p_aec->b_thread_active == 1 ) + { + if(cavs_threadpool_wait( p_m->threadpool, p_aec ) ) + ;//return -1; + p_aec->b_thread_active = 0; + } + + return CAVS_ERROR; + } + + if( p_rec->b_bottom ) + { + if( p_rec->ph.i_picture_coding_type != CAVS_B_PICTURE ) + p_m->last_delayed_pframe = p_rec->p_save[1]; + } + + if(p_rec->b_complete && p_rec->ph.i_picture_coding_type != CAVS_B_PICTURE) + { + cavs_image *p_image = p_rec->p_save[0]; + if(p_rec->vsh.b_low_delay) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[0], param->p_out_yuv, p_rec->b_bottom); + } + if(!p_rec->p_save[1]) + { + if( p_rec->b_bottom ) + p_rec->p_save[0] = &p_rec->image[1]; + } + else + { + if(p_rec->vsh.b_low_delay == 0 /*&& p_rec->ph.i_picture_coding_type != CAVS_I_PICTURE*/ ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[1]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[1], param->p_out_yuv, p_rec->b_bottom); + } + else + { + param->output_type = -1; + } + + if( p_rec->b_bottom ) + { + if(!p_rec->p_save[2]) + { + p_rec->p_save[0] = &p_rec->image[2]; + } + else + { + p_rec->p_save[0] = p_rec->p_save[2]; + } + } + } + + if( p_rec->b_bottom ) + { + p_rec->p_save[2] = p_rec->p_save[1]; + p_rec->p_save[1] = p_image; + memset(&p_rec->cur, 0, sizeof(cavs_image)); + + /* copy ref-list to anther threads */ + p_m->current[1]->p_save[0] = p_rec->p_save[0]; + p_m->current[1]->p_save[1] = p_rec->p_save[1]; + p_m->current[1]->p_save[2] = p_rec->p_save[2]; + } + p_rec->b_complete = 0; + p_rec->b_bottom = 0; + } + else if( p_rec->b_complete ) + { + i_result = CAVS_FRAME_OUT; + + /* set for ffmpeg interface */ + param->output_type = p_rec->p_save[0]->i_code_type; + + cavs_out_image_yuv420(p_m, p_rec->p_save[0], param->p_out_yuv, p_rec->b_bottom); + memset(&p_rec->cur,0,sizeof(cavs_image)); + p_rec->b_complete=0; + p_rec->b_bottom = 0; + } + } + } + + /*wait for end of AEC handle */ + if( p_aec->b_thread_active == 1 ) + { + if(cavs_threadpool_wait( p_m->threadpool, p_aec ) ) + ;//return -1; + + p_aec->b_thread_active = 0; + } + + if( p_aec->b_error_flag ) + { + return CAVS_ERROR; + } + + p_m->unused[0]->p_save_aec[0] = p_aec->p_save_aec[0]; + p_m->unused[0]->p_save_aec[1] = p_aec->p_save_aec[1]; + p_m->unused[0]->p_save_aec[2] = p_aec->p_save_aec[2]; + + /* copy col type to next handle */ + memcpy( p_m->unused[0]->p_col_mv, p_aec->p_col_mv,p_m->i_mb_width*(p_m->i_mb_height)*4*sizeof(cavs_vector)); + memcpy( p_m->unused[0]->p_col_type_base, p_aec->p_col_type_base, p_m->i_mb_width*(p_m->i_mb_height)); + +#if B_MB_WEIGHTING + { + int i, j; + for( j = 0; j < 2; j++ ) + { + p_m->unused[0]->b_slice_weighting_flag[j] = p_aec->b_slice_weighting_flag[j]; + p_m->unused[0]->b_mb_weighting_flag[j] = p_aec->b_mb_weighting_flag[j]; + for( i = 0; i < 4; i++ ) + { + p_m->unused[0]->i_luma_scale[j][i] = p_aec->i_luma_scale[j][i]; + p_m->unused[0]->i_luma_shift[j][i] = p_aec->i_luma_shift[j][i]; + p_m->unused[0]->i_chroma_scale[j][i] = p_aec->i_chroma_scale[j][i]; + p_m->unused[0]->i_chroma_shift[j][i] = p_aec->i_chroma_shift[j][i]; + } + } + } +#endif + + if( p->b_error_flag ) + { + i_result = CAVS_ERROR; + } + + return i_result; +} + + +int cavs_decoder_create(void **pp_decoder, cavs_param *param) +{ + cavs_decoder *p; + int counter = 0; + int loop_cnt = 0; + unsigned int i_feature_value = 0; + int i_result = 0; + + p = (cavs_decoder *)cavs_malloc(sizeof(cavs_decoder)); + if( !p ) + { + return -1; + } + memset( p, 0, sizeof(cavs_decoder) ); + memcpy (&p->param, param, sizeof (cavs_param)); + p->i_video_edit_code_flag=0; + *pp_decoder = p; + + p->param.b_accelerate = param->b_accelerate; + p->param.output_type = param->output_type = -1; + + cavs_decoder_init( p ); + + p->p_stream = (InputStream*)cavs_malloc(sizeof(InputStream));; + + /* threading */ + /* use threadpool to optimize */ + cavs_decoder_thread_param_init(p); + + return 0; + +} + +int cavs_decoder_get_seq(void *p_decoder, cavs_seq_info *p_si) +{ + cavs_decoder *p=(cavs_decoder *)p_decoder; + + if(!p) + { + return -1; + } + + if(!p->b_get_video_sequence_header) + { + return -1; + } + + p_si->lWidth=p->vsh.i_horizontal_size; + p_si->lHeight=p->vsh.i_vertical_size; + + p_si->i_frame_rate_den = frame_rate_tab[p->vsh.i_frame_rate_code][0]; + p_si->i_frame_rate_num = frame_rate_tab[p->vsh.i_frame_rate_code][1]; + p_si->b_interlaced = !p->vsh.b_progressive_sequence; + + p_si->profile = p->vsh.i_profile_id; + p_si->level = p->vsh.i_level_id; + p_si->aspect_ratio = p->vsh.i_aspect_ratio; + p_si->low_delay = p->vsh.b_low_delay; + p_si->frame_rate_code = p->vsh.i_frame_rate_code; + + return 0; +} + +int cavs_decoder_buffer_init(cavs_param *param) +{ + int w = param->seqsize.lWidth; + int h = param->seqsize.lHeight; + + if (w > 1920 || h > 1080) + { + return -1; + } + + param->p_out_yuv[0]=(unsigned char *)cavs_malloc(w*h*3/2); + param->p_out_yuv[1] = param->p_out_yuv[0] + w*h; + param->p_out_yuv[2] = param->p_out_yuv[1] + w*h/4; + + if ( param->p_out_yuv[0] == NULL ) + return -1; + return 0; +} + +int cavs_decoder_buffer_end(cavs_param *param) +{ + cavs_free(param->p_out_yuv[0]); + + return 0; +} + +void cavs_decoder_destroy( void *p_decoder ) +{ + cavs_decoder *p=(cavs_decoder *)p_decoder; + if(!p) + { + return ; + } + + if( p->param.i_thread_num >= 1 ) + { + cavs_threadpool_delete( p->threadpool ); + } + + cavs_decoder_seq_end(p_decoder); +} + +void cavs_decoder_slice_destroy( void *p_decoder ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + if(!p) + { + return; + } + + for (int i = 1; i < p->param.i_thread_num; i++) + { + if (p->thread[i]) + { + /* destroy threads */ + cavs_pthread_mutex_destroy(&p->thread[i]->mutex); + cavs_pthread_cond_destroy(&p->thread[i]->cv); + + cavs_macroblock_cache_finit(p->thread[i]); + + CAVS_SAFE_FREE(p->thread[i]); + } + } +} + +int cavs_decoder_reset(void *p_decoder) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + if( !p ) + { + return -1; + } + p->i_video_edit_code_flag = 0; + p->b_get_i_picture_header = 0; + + if( p->param.b_accelerate ) + { + memset(&p->ref_aec[0], 0, sizeof(cavs_image)); + memset(&p->ref_aec[1], 0, sizeof(cavs_image)); + memset(&p->ref_aec[2], 0, sizeof(cavs_image)); + memset(&p->ref_aec[3], 0, sizeof(cavs_image)); + p->image_aec[0].i_distance_index = 0; + p->image_aec[1].i_distance_index = 0; + p->image_aec[2].i_distance_index = 0; + + p->p_save_aec[0] = &p->image_aec[0]; + //p->last_delayed_pframe = p->p_save[1]; + p->p_save_aec[1] = 0; // FIXIT : can't shut down this line for open gop + p->p_save_aec[2] = 0; + } + + memset(&p->ref[0], 0, sizeof(cavs_image)); + memset(&p->ref[1], 0, sizeof(cavs_image)); + memset(&p->ref[2], 0, sizeof(cavs_image)); + memset(&p->ref[3], 0, sizeof(cavs_image)); + p->image[0].i_distance_index = 0; + p->image[1].i_distance_index = 0; + p->image[2].i_distance_index = 0; + + p->p_save[0] = &p->image[0]; + p->last_delayed_pframe = p->p_save[1]; + p->p_save[1] = 0; // FIXIT : can't shut down this line for open gop + p->p_save[2] = 0; + + memset(p->p_block, 0, 64*sizeof(DCTELEM)); + + return 0; +} + +int cavs_out_delay_frame(void *p_decoder, unsigned char *p_out_yuv[3]) +{ + cavs_decoder * p = (cavs_decoder *)p_decoder; + int b_interlaced = p->param.b_interlaced; + + /* B frame exists */ + if ( !p->b_low_delay + && ((cavs_decoder *)p_decoder)->last_delayed_pframe /* delay frame exists */ + ) + { + if( !b_interlaced ) + cavs_out_image_yuv420((cavs_decoder *)p_decoder, ((cavs_decoder *)p_decoder)->last_delayed_pframe, p_out_yuv, 0); + else + { + //p->b_bottom = 0; + cavs_out_image_yuv420((cavs_decoder *)p_decoder, ((cavs_decoder *)p_decoder)->last_delayed_pframe, p_out_yuv, 0); + //p->b_bottom = 1; + cavs_out_image_yuv420((cavs_decoder *)p_decoder, ((cavs_decoder *)p_decoder)->last_delayed_pframe, p_out_yuv, 1); + } + + /* reset for next delay frame */ + ((cavs_decoder *)p_decoder)->last_delayed_pframe = NULL; + + return 1; + } + + return 0; +} + +int cavs_set_last_delay_frame( void *p_decoder ) +{ + cavs_decoder * p = (cavs_decoder *)p_decoder; + + p->last_delayed_pframe = p->p_save[1]; + + return 0; +} + +int cavs_out_delay_frame_end(void *p_decoder, unsigned char *p_out_yuv[3]) +{ + cavs_decoder * p = (cavs_decoder *)p_decoder; + int b_interlaced = p->param.b_interlaced; + + if ( !/*p->vsh.b_low_delay*/p->b_low_delay ) /* B frame exists */ + { + p->last_delayed_pframe = p->p_save[1]; + + if(p->last_delayed_pframe == NULL) + { + return 0; + } + + if( !b_interlaced ) + cavs_out_image_yuv420((cavs_decoder *)p_decoder, ((cavs_decoder *)p_decoder)->last_delayed_pframe, p_out_yuv, 0); + else + { + //p->b_bottom = 0; + cavs_out_image_yuv420((cavs_decoder *)p_decoder, ((cavs_decoder *)p_decoder)->last_delayed_pframe, p_out_yuv, 0); + //p->b_bottom = 1; + cavs_out_image_yuv420((cavs_decoder *)p_decoder, ((cavs_decoder *)p_decoder)->last_delayed_pframe, p_out_yuv, 1); + } + + return 1; + } + + return 0; +} + +int cavs_decoder_seq_init( void *p_decoder , cavs_param *param ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + /* NOTE : we can't distinguish frame or field coding frame seq header */ + p->Frame = (frame_pack* )cavs_malloc(sizeof(frame_pack)); + memset(p->Frame, 0, sizeof(frame_pack)); + p->Frame->p_start = (uint8_t* )cavs_malloc(MAX_CODED_FRAME_SIZE*sizeof(uint8_t)); + memset(p->Frame->p_start, 0, MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + + param->fld_mb_end[0] = (((param->seqsize.lHeight+31)& 0xffffffe0)>>5) - 1; /* top field mb end */ + param->fld_mb_end[1] = (((param->seqsize.lHeight+31)& 0xffffffe0)>>4) - 1; /* bot field mb end */ + + return 0; +} + +int cavs_decoder_seq_end( void *p_decoder ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + if(p && p->Frame) + { + if(p->Frame->p_start) + cavs_free( p->Frame->p_start ); + cavs_free( p->Frame ); + p->Frame = NULL; + } + + if (p) + { +#if B_MB_WEIGHTING + if (p->mb_line_buffer[0]) + { + p->mb_line_buffer[0] -= p->image[0].i_stride[0] * CAVS_EDGE + CAVS_EDGE; + CAVS_SAFE_FREE(p->mb_line_buffer[0]); + } + + if (p->mb_line_buffer[1]) + { + p->mb_line_buffer[1] -= p->image[0].i_stride[1] * CAVS_EDGE / 2 + CAVS_EDGE / 2; + CAVS_SAFE_FREE(p->mb_line_buffer[1]); + } + + if (p->mb_line_buffer[2]) + { + p->mb_line_buffer[2] -= p->image[0].i_stride[2] * CAVS_EDGE / 2 + CAVS_EDGE / 2; + CAVS_SAFE_FREE(p->mb_line_buffer[2]); + } +#endif + + //if (p->mutex) + { + cavs_pthread_mutex_destroy(&p->mutex); + } + //if (p->cv) + { + cavs_pthread_cond_destroy(&p->cv); + } + + for (int i = 0; i < 2; i++) + { + if (p->unused[i] && p->unused[i] != p) + { + //if (p->unused[i]->mutex) + { + cavs_pthread_mutex_destroy(&p->unused[i]->mutex); + } + //if (p->unused[i]->cv) + { + cavs_pthread_cond_destroy(&p->unused[i]->cv); + } + + cavs_macroblock_cache_finit(p->unused[i]); + + CAVS_SAFE_FREE(p->unused[i]); + } + } + + cavs_decoder_slice_destroy(p_decoder); + cavs_free_resource(p); + + CAVS_SAFE_FREE(p->p_stream); + CAVS_SAFE_FREE(p); + } + + return 0; +} + + +int cavs_decode_one_frame( void *p_decoder, int i_startcode, cavs_param *param, unsigned char* buf, int length ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + InputStream *p_stream = p->p_stream; + int b_interlaced = p->param.b_interlaced; + int i_result; + + if (!param->seq_header_flag) + { + return 0; + } + + p->i_frame_decoded++; + if( !b_interlaced ) /* decode one frame or one field */ + { + /* init frame pack */ + //memset(p->Frame->p_start, 0, MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + + /* init */ + p->Frame->p_cur = p->Frame->p_start; + p->Frame->i_len = 0; + p->Frame->slice_num = 0; + p->Frame->i_startcode_type = i_startcode; + memcpy(p->Frame->p_cur, buf, length ); /* pack header of pic into one frame */ + + /* set pic header info, use position of slice_num = 0 */ + p->Frame->slice[p->Frame->slice_num].i_startcode = i_startcode; + p->Frame->slice[p->Frame->slice_num].p_start = p->Frame->p_cur + 4; /* for skip current startcode */ + p->Frame->slice[p->Frame->slice_num].i_len = length-4; + + /* update frame info */ + p->Frame->p_cur = p->Frame->p_cur + length; + p->Frame->i_len += length; + p->Frame->slice_num++; + + if( !p->param.b_accelerate ) + { + i_startcode = cavs_frame_pack(p_stream, p->Frame ); + if(i_startcode == CAVS_ERROR) + return CAVS_ERROR; + + i_result = decode_one_frame( p_decoder, p->Frame, param ); + } + else + { + i_result = decode_one_frame_far( p_decoder, p->Frame, param ); + } + } + else + { + uint32_t frame_type = i_startcode; + + /* init field pack of top */ + //memset(p->Frame->p_start, 0, MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + p->Frame->b_bottom = 0; + p->Frame->i_mb_end[0] = param->fld_mb_end[0]; + p->Frame->p_cur = p->Frame->p_start; + p->Frame->i_len = 0; + p->Frame->slice_num = 0; + p->Frame->i_startcode_type = i_startcode; + memcpy( p->Frame->p_cur, buf, length ); /* pack header of pic into one frame */ + + /* set pic header info , use position of slice_num = 0 */ + p->Frame->slice[p->Frame->slice_num].i_startcode = i_startcode; + p->Frame->slice[p->Frame->slice_num].p_start = p->Frame->p_cur + 4; /* for skip current startcode */ + p->Frame->slice[p->Frame->slice_num].i_len = length-4; + + /* update field info of top */ + p->Frame->p_cur = p->Frame->p_cur + length; + p->Frame->i_len += length; + p->Frame->slice_num++; + + if( p->param.b_accelerate ) /* entropy decoded parallel */ + { + p->Frame->i_mb_end[0] = param->fld_mb_end[0]; + p->Frame->i_mb_end[1] = param->fld_mb_end[1]; + p->b_bottom = 0; + + /* decode one image as two field */ + i_result = cavs_field_decode_far( p_decoder, p->Frame, param ); + + } + else + { + /* pack top-field */ + i_startcode = cavs_topfield_pack(p_stream, p->Frame ); + + /* decode top-field */ + i_result = decode_top_field( p_decoder, p->Frame, param ); + if( i_result == CAVS_ERROR ) + { + return i_result; + } + + /* init field pack of bot */ + /* NOTE : bot-field has no pic header */ + memset(p->Frame->p_start, 0, MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + p->Frame->b_bottom = 1; + p->Frame->i_mb_end[0] = param->fld_mb_end[0]; + p->Frame->i_mb_end[1] = param->fld_mb_end[1]; + p->Frame->p_cur = p->Frame->p_start; + p->Frame->i_len = 0; + p->Frame->slice_num = 0; + p->Frame->i_startcode_type = frame_type; + + /* pack bot-field */ + i_startcode = cavs_botfield_pack(p_stream, p->Frame ); + + /* decode bot-field */ + i_result = decode_bot_field( p_decoder, p->Frame, param ); + } + } + + return i_result; +} + +int cavs_decoder_init_stream( void *p_decoder, unsigned char *rawstream, unsigned int i_len) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + cavs_init_bitstream( p->p_stream , rawstream, i_len ); + + return 0; +} + +int cavs_decoder_get_one_nal( void *p_decoder, unsigned char *buf, int *length ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + int i_ret; + + i_ret = cavs_get_one_nal( p->p_stream, buf, length ); + + return i_ret; +} + +int cavs_decoder_cur_frame_type( void* p_decoder ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + if( p->param.b_accelerate ) + { + return p->unused[0]->ph.i_picture_coding_type; + } + else + return p->ph.i_picture_coding_type; +} + +int cavs_decoder_thread_param_init( void* p_decoder ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + p->param.i_thread_num = cavs_cpu_num_processors(); + + return 0; +} + + + + +int cavs_decoder_probe_seq(void *p_decoder, unsigned char *p_in, int i_in_length) +{ + cavs_decoder *p=(cavs_decoder *)p_decoder; + uint32_t i_startcode; + uint8_t *p_buf; + int i_len, i_result=0; + + p_buf = p_in; + i_len = i_in_length; + + i_startcode = ((p_buf[0]<<24))|((p_buf[1]<<16))|(p_buf[2]<<8)|p_buf[3]; + p_buf += 4; /* skip startcode */ + i_len -= 4; + if(i_startcode==0) + { + return CAVS_ERROR; + } + + if(i_startcode!=CAVS_VIDEO_SEQUENCE_START_CODE&&!p->b_get_video_sequence_header) + { + return CAVS_ERROR; + } + + switch(i_startcode) + { + case CAVS_VIDEO_SEQUENCE_START_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + if(cavs_get_video_sequence_header(&p->s,&p->vsh)==0) + { + p->b_get_video_sequence_header = 1; + + return CAVS_SEQ_HEADER; + } + else + { + return CAVS_ERROR; + } + + break; + case CAVS_VIDEO_SEQUENCE_END_CODE: + p->last_delayed_pframe = p->p_save[1]; + i_result = CAVS_SEQ_END; + break; + case CAVS_USER_DATA_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_user_data(&p->s, &p->user_data); + break; + case CAVS_EXTENSION_START_CODE: + cavs_bitstream_init(&p->s,p_buf,i_len); + i_result = cavs_get_extension(&p->s, p); + break; + case CAVS_VIDEO_EDIT_CODE: + p->i_video_edit_code_flag=0; + break; + + } + + return i_result; + +//fail: +// return -1; +} + + +int cavs_decoder_pic_header( void* p_decoder, unsigned char *p_buf, int i_len, cavs_param* param, unsigned int cur_startcode ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + int i_ret = 0; + + /* decode header of pic */ + switch( cur_startcode ) + { + case CAVS_I_PICUTRE_START_CODE: + cavs_bitstream_init(&p->s, p_buf+4, i_len-4); + cavs_get_i_picture_header(&p->s,&p->ph,&p->vsh); + break; + + case CAVS_PB_PICUTRE_START_CODE: + cavs_bitstream_init(&p->s, p_buf+4, i_len-4); + + i_ret = cavs_get_pb_picture_header(&p->s,&p->ph,&p->vsh); + if(i_ret == -1) + return CAVS_ERROR; + + break; + + default: + return CAVS_ERROR; + } + + /* decide frame or field */ + param->b_interlaced = !p->ph.b_picture_structure; + p->b_get_video_sequence_header = 0; + + return 0; +} + +int cavs_decoder_set_format_type( void* p_decoder, cavs_param *param ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + p->param.b_interlaced = param->b_interlaced; + + return 0; +} + +static int cavs_decoder_reset_pipeline( cavs_decoder *p_decoder ) +{ + cavs_decoder *p = p_decoder; + + if( !p ) + { + return -1; + } + p->i_video_edit_code_flag = 0; + p->b_get_i_picture_header = 0; + + if( p->param.b_accelerate ) + { + memset(&p->ref_aec[0], 0, sizeof(cavs_image)); + memset(&p->ref_aec[1], 0, sizeof(cavs_image)); + memset(&p->ref_aec[2], 0, sizeof(cavs_image)); + memset(&p->ref_aec[3], 0, sizeof(cavs_image)); + p->image_aec[0].i_distance_index = 0; + p->image_aec[1].i_distance_index = 0; + p->image_aec[2].i_distance_index = 0; + + p->p_save_aec[0] = &p->image_aec[0]; + //p->last_delayed_pframe = p->p_save[1]; + p->p_save_aec[1] = NULL; // FIXIT : can't shut down this line for open gop + p->p_save_aec[2] = NULL; + } + + memset(&p->ref[0], 0, sizeof(cavs_image)); + memset(&p->ref[1], 0, sizeof(cavs_image)); + memset(&p->ref[2], 0, sizeof(cavs_image)); + memset(&p->ref[3], 0, sizeof(cavs_image)); + p->image[0].i_distance_index = 0; + p->image[1].i_distance_index = 0; + p->image[2].i_distance_index = 0; + + p->p_save[0] = &p->image[0]; + p->last_delayed_pframe = p->p_save[1]; + p->p_save[1] = NULL; // FIXIT : can't shut down this line for open gop + p->p_save[2] = NULL; + + memset(p->p_block, 0, 64*sizeof(DCTELEM)); + + return 0; +} + +int cavs_decoder_seq_header_reset( void* p_decoder ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + if(p->b_low_delay != p->vsh.b_low_delay) + { + p->b_low_delay = p->vsh.b_low_delay; + } + + return 0; +} + +int cavs_decoder_seq_header_reset_pipeline( void* p_decoder ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + /* reset for pipeline */ + cavs_decoder_reset_pipeline( p->unused_backup[0] ); + cavs_decoder_reset_pipeline( p->unused_backup[1] ); + + if (p->unused_backup[1]) + { + p->unused_backup[1]->p_save_aec[0] = &p->image_aec[0]; + } + if (p->unused_backup[1]) + { + p->unused_backup[1]->p_save[0] = &p->image[0]; + } + + p->current[0] = NULL; + p->current[1] = NULL; + + return 0; +} + +int cavs_decoder_low_delay_value( void* p_decoder ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + return p->vsh.b_low_delay; +} + +int cavs_decoder_slice_num_probe( void* p_decoder, int i_startcode, cavs_param *param, unsigned char *buf, int length ) +{ + cavs_decoder *p = (cavs_decoder *)p_decoder; + + int b_interlaced = p->param.b_interlaced; + + p->Frame = (frame_pack* )cavs_malloc(sizeof(frame_pack)); + p->Frame->p_start = (uint8_t* )cavs_malloc(MAX_CODED_FRAME_SIZE*sizeof(uint8_t)); + memset(p->Frame->p_start, 0, MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + + if( !b_interlaced ) + { + /* init frame pack */ + memset(p->Frame->p_start, 0, MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + + /* init */ + p->Frame->p_cur = p->Frame->p_start; + p->Frame->i_len = 0; + p->Frame->slice_num = 0; + p->Frame->i_startcode_type = i_startcode; + memcpy(p->Frame->p_cur, buf, length ); /* pack header of pic into one frame */ + + /* set pic header info, use position of slice_num = 0 */ + p->Frame->slice[p->Frame->slice_num].i_startcode = i_startcode; + p->Frame->slice[p->Frame->slice_num].p_start = p->Frame->p_cur + 4; /* for skip current startcode */ + p->Frame->slice[p->Frame->slice_num].i_len = length-4; + + /* update frame info */ + p->Frame->p_cur = p->Frame->p_cur + length; + p->Frame->i_len += length; + p->Frame->slice_num++; + + /* pack */ + cavs_frame_pack( p->p_stream, p->Frame ); + + p->param.b_accelerate = 0; /* accelerate version don't support multi-slice */ + p->param.i_thread_num = 1;// cavs_cpu_num_processors(); //64; + param->b_accelerate = 0; + } + else + { + /* init field pack of top */ + memset(p->Frame->p_start, 0, MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + p->Frame->b_bottom = 0; + //p->Frame->i_mb_end[0] = param->fld_mb_end[0]; + p->Frame->p_cur = p->Frame->p_start; + p->Frame->i_len = 0; + p->Frame->slice_num = 0; + p->Frame->i_startcode_type = i_startcode; + memcpy( p->Frame->p_cur, buf, length ); /* pack header of pic into one frame */ + + /* set pic header info , use position of slice_num = 0 */ + p->Frame->slice[p->Frame->slice_num].i_startcode = i_startcode; + p->Frame->slice[p->Frame->slice_num].p_start = p->Frame->p_cur + 4; /* for skip current startcode */ + p->Frame->slice[p->Frame->slice_num].i_len = length-4; + + /* update field info of top */ + p->Frame->p_cur = p->Frame->p_cur + length; + p->Frame->i_len += length; + p->Frame->slice_num++; + + p->Frame->i_mb_end[0] = (((p->vsh.i_vertical_size+31)& 0xffffffe0)>>5) - 1; /* top field mb end */ + p->Frame->i_mb_end[1] = (((p->vsh.i_vertical_size+31)& 0xffffffe0)>>4) - 1; /* bot field mb end */ + + /* pack */ + cavs_field_pack( p->p_stream, p->Frame ); + + p->param.b_accelerate = 0; /* accelerate version don't support multi-slice */ + p->param.i_thread_num = 1;// cavs_cpu_num_processors(); + param->b_accelerate = 0; + } + + cavs_free( p->Frame->p_start ); + p->Frame->p_start = NULL; + cavs_free( p->Frame ); + p->Frame = NULL; + + return 0; +} + +/* Opt for multi-thread of AEC module */ +/* AEC module : aec or 2d-vlc */ +/* REC module : reconstructed processdure */ + +/*================================= MB level ========================================================*/ + +/* read coeffs */ +static int get_residual_block_aec_opt( cavs_decoder *p, const cavs_vlc *p_vlc_table, + int i_escape_order, int b_chroma, int i_block ) +{ + int *level_buf = p->level_buf; + int *run_buf = p->run_buf; + int i; + int pos = -1; + //DCTELEM *block = p->p_block; + + i = p->bs_read_coeffs(p, p_vlc_table, i_escape_order, b_chroma); + if(p->b_error_flag ) + { + return -1; + } + + /* copy buf to tab */ + memcpy( &(p->num_buf_tab[p->i_mb_index][i_block]), &i, 1*sizeof(int)); + memcpy( p->run_buf_tab[p->i_mb_index][i_block], run_buf, 64*sizeof(int)); + memcpy( p->level_buf_tab[p->i_mb_index][i_block], level_buf, 64*sizeof(int)); + + if (i == -1 || i > 64) + { + p->b_error_flag = 1; + return -1; + } + + /* add for detecting pos error */ + while(--i >= 0) + { + pos += /*run_buf[i]*/p->run_buf_tab[p->i_mb_index][i_block][i]; + if(pos > 63 || pos < 0) + { + p->b_error_flag = 1; + + return -1; + } + + //block[zigzag[pos]] = (/*level_buf[i]*/p->level_buf_tab[p->i_mb_index][i_block][i]*dqm + dqa) >> dqs; + } + + return 0; +} + +static int get_residual_block_rec_opt(cavs_decoder *p,const cavs_vlc *p_vlc_table, + int i_escape_order,int i_qp, uint8_t *p_dest, int i_stride, int b_chroma, int i_block ) +{ + int i, pos = -1; + //int *level_buf = p->level_buf; + //int *run_buf = p->run_buf; + int dqm = dequant_mul[i_qp]; + int dqs = dequant_shift[i_qp]; + int dqa = 1 << (dqs - 1); + const uint8_t *zigzag = p->ph.b_picture_structure==0 ? zigzag_field : zigzag_progressive; + DCTELEM *block = p->p_block; + + /* read level */ + i= p->num_buf_tab[p->i_mb_index][i_block]; + + if( i == -1 || i > 64) + { + p->b_error_flag = 1; + return -1; + } + + if( !p->b_weight_quant_enable ) + { + while(--i >= 0) + { + pos += p->run_buf_tab[p->i_mb_index][i_block][i]; + if(pos > 63 || pos < 0) + { + p->b_error_flag = 1; + + return -1; + } + + block[zigzag[pos]] = (p->level_buf_tab[p->i_mb_index][i_block][i]*dqm + dqa) >> dqs; + } + } + else + { + int m, n; + + while(--i >= 0) + { + pos += p->run_buf_tab[p->i_mb_index][i_block][i]; + if(pos > 63 || pos < 0 ) + { + p->b_error_flag = 1; + + return -1; + } + + m = SCAN[p->ph.b_picture_structure][pos][0]; + n = SCAN[p->ph.b_picture_structure][pos][1]; + + /* NOTE : bug will conflict with idct asm when Win32-Release, don't why now */ + block[zigzag[pos]] = (((((int)(p->level_buf_tab[p->i_mb_index][i_block][i]*p->cur_wq_matrix[n*8+m])>>3)*dqm)>>4) + dqa) >> dqs; + } + } + + cavs_idct8_add(p_dest, block, i_stride); + + return 0; +} + +static inline int get_residual_inter_aec_opt(cavs_decoder *p,int i_mb_type) +{ + int block; + uint8_t *p_d; + int i_cbp; + int i_ret = 0; + + i_cbp = p->i_cbp_tab[p->i_mb_index]; + + /* luma */ + for(block = 0; block < 4; block++) + { + if( i_cbp & (1<p_y + p->i_luma_offset[block]; + + i_ret = get_residual_block_aec_opt( p, inter_2dvlc, 0, 0, block); + if(i_ret == -1) + return -1; + } + } + + /* cb */ + if( i_cbp & /*(1<<4)*/16) + { + i_ret = get_residual_block_aec_opt( p, chroma_2dvlc, 0, 1, 4); + if(i_ret == -1) + return -1; + + } + + /* cr */ + if( i_cbp & /*(1<<5)*/32) + { + i_ret = get_residual_block_aec_opt( p, chroma_2dvlc, 0, 1, 5); + if(i_ret == -1) + return -1; + } + + return 0; +} + +static inline int get_residual_inter_rec_opt(cavs_decoder *p,int i_mb_type) +{ + int block; + int i_stride = p->cur.i_stride[0]; + uint8_t *p_d; + int i_qp_cb = 0, i_qp_cr = 0; + int i_cbp; + int i_ret = 0; + + i_cbp = p->i_cbp_tab[p->i_mb_index]; + + if(i_cbp <0 || i_cbp >63 || p->i_qp_tab[p->i_mb_index] < 0 + || p->i_qp_tab[p->i_mb_index] > 63 ) + { + return -1; + } + + /* luma */ + for(block = 0; block < 4; block++) + { + if( i_cbp & (1<p_y + p->i_luma_offset[block]; + + i_ret = get_residual_block_rec_opt( p, inter_2dvlc, 0, p->i_qp_tab[p->i_mb_index], p_d, i_stride, 0, block ); + if( i_ret == -1 ) + return -1; + } + } + + /* FIXIT : weighting quant qp for chroma + NOTE : not modify p->i_qp directly + */ + if( p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ) + { + i_qp_cb = clip3_int( p->i_qp_tab[p->i_mb_index] + p->ph.chroma_quant_param_delta_u, 0, 63 ); + i_qp_cr = clip3_int( p->i_qp_tab[p->i_mb_index] + p->ph.chroma_quant_param_delta_v, 0, 63 ); + } + + /* cr */ + if( i_cbp & /*(1<<4)*/16) + { + i_ret = get_residual_block_rec_opt(p, chroma_2dvlc, 0, + chroma_qp[p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ? i_qp_cb : p->i_qp_tab[p->i_mb_index]], + p->p_cb, p->cur.i_stride[1], 1, 4); + if( i_ret == -1 ) + return -1; + } + + /* cr */ + if( i_cbp & /*(1<<5)*/32) + { + i_ret = get_residual_block_rec_opt(p, chroma_2dvlc, 0, + chroma_qp[ p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ? i_qp_cr : p->i_qp_tab[p->i_mb_index]], + p->p_cr, p->cur.i_stride[2], 1, 5); + if( i_ret == -1 ) + return -1; + } + + return 0; +} + +static inline void rec_init_mb( cavs_decoder *p ) +{ + //int i = 0; + int i_offset = p->i_mb_x<<1; + int i_offset_b4 = p->i_mb_x<<2; + + if(!(p->i_mb_flags & A_AVAIL)) + { + p->mv[MV_FWD_A1] = MV_NOT_AVAIL; + p->mv[MV_FWD_A3] = MV_NOT_AVAIL; + p->mv[MV_BWD_A1] = MV_NOT_AVAIL; + p->mv[MV_BWD_A3] = MV_NOT_AVAIL; + + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + } + + if(p->i_mb_flags & B_AVAIL) + { + p->mv[MV_FWD_B2] = p->p_top_mv[0][i_offset]; + p->mv[MV_BWD_B2] = p->p_top_mv[1][i_offset]; + p->mv[MV_FWD_B3] = p->p_top_mv[0][i_offset+1]; + p->mv[MV_BWD_B3] = p->p_top_mv[1][i_offset+1]; + + p->i_intra_pred_mode_y[1] = p->p_top_intra_pred_mode_y[i_offset_b4]; + p->i_intra_pred_mode_y[2] = p->p_top_intra_pred_mode_y[i_offset_b4+1]; + p->i_intra_pred_mode_y[3] = p->p_top_intra_pred_mode_y[i_offset_b4+2]; + p->i_intra_pred_mode_y[4] = p->p_top_intra_pred_mode_y[i_offset_b4+3]; + } + else + { + p->mv[MV_FWD_B2] = MV_NOT_AVAIL; + p->mv[MV_FWD_B3] = MV_NOT_AVAIL; + p->mv[MV_BWD_B2] = MV_NOT_AVAIL; + p->mv[MV_BWD_B3] = MV_NOT_AVAIL; + + p->i_intra_pred_mode_y[1] = p->i_intra_pred_mode_y[2] = + p->i_intra_pred_mode_y[3] = p->i_intra_pred_mode_y[4] = NOT_AVAIL; + } + + if(p->i_mb_flags & C_AVAIL) + { + p->mv[MV_FWD_C2] = p->p_top_mv[0][i_offset+2]; + p->mv[MV_BWD_C2] = p->p_top_mv[1][i_offset+2]; + } + else + { + p->mv[MV_FWD_C2] = MV_NOT_AVAIL; + p->mv[MV_BWD_C2] = MV_NOT_AVAIL; + } + + if(!(p->i_mb_flags & D_AVAIL)) + { + p->mv[MV_FWD_D3] = MV_NOT_AVAIL; + p->mv[MV_BWD_D3] = MV_NOT_AVAIL; + } + + p->p_col_type = &p->p_col_type_base[p->i_mb_y*p->i_mb_width + p->i_mb_x]; + + if (p->ph.b_aec_enable) + { + if (!p->i_mb_x) + { + p->i_chroma_pred_mode_left = 0; + p->i_cbp_left = -1; + + M32(p->p_mvd[0][0]) + = M32(p->p_mvd[0][3]) + = M32(p->p_mvd[1][0]) + = M32(p->p_mvd[1][3]) = 0; + + p->p_ref[0][3] + = p->p_ref[0][6] + = p->p_ref[1][3] + = p->p_ref[1][6] = -1; + } + else + { + M32(p->p_mvd[0][0]) = M32(p->p_mvd[0][2]); + M32(p->p_mvd[0][3]) = M32(p->p_mvd[0][5]); + M32(p->p_mvd[1][0]) = M32(p->p_mvd[1][2]); + M32(p->p_mvd[1][3]) = M32(p->p_mvd[1][5]); + + p->p_ref[0][3] = p->p_ref[0][5]; + p->p_ref[0][6] = p->p_ref[0][8]; + p->p_ref[1][3] = p->p_ref[1][5]; + p->p_ref[1][6] = p->p_ref[1][8]; + + } + + CP16(&p->p_ref[0][1], p->p_ref_top[p->i_mb_x][0]); + CP16(&p->p_ref[1][1], p->p_ref_top[p->i_mb_x][1]); + + M64(p->p_mvd[0][1]) + = M64(p->p_mvd[1][1]) + = M64(p->p_mvd[0][4]) + = M64(p->p_mvd[1][4]) = 0; + + M16(&p->p_ref[0][4]) + = M16(&p->p_ref[0][7]) + = M16(&p->p_ref[1][4]) + = M16(&p->p_ref[1][7]) = -1; + } +} + +static inline int aec_next_mb( cavs_decoder *p ) +{ + int i, i_y; + int i_offset = p->i_mb_x<<1; + + p->i_mb_flags |= A_AVAIL; + + for( i = 0; i <= 20; i += 4 ) + { + p->mv[i] = p->mv[i+2]; + } + + p->mv[MV_FWD_D3] = p->p_top_mv[0][i_offset+1]; + p->mv[MV_BWD_D3] = p->p_top_mv[1][i_offset+1]; + p->p_top_mv[0][i_offset+0] = p->mv[MV_FWD_X2]; + p->p_top_mv[0][i_offset+1] = p->mv[MV_FWD_X3]; + p->p_top_mv[1][i_offset+0] = p->mv[MV_BWD_X2]; + p->p_top_mv[1][i_offset+1] = p->mv[MV_BWD_X3]; + + /* for AEC */ + if (p->ph.b_aec_enable) + { + p->p_mb_type_top[p->i_mb_x] = p->i_mb_type_tab[p->i_mb_index]; + + if( p->ph.i_picture_coding_type == 0 && p->b_bottom == 0) + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = p->i_pred_mode_chroma_tab[p->i_mb_index]; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = p->i_cbp; + } + else + { + if( p->i_mb_type_tab[p->i_mb_index] != P_SKIP && p->i_mb_type_tab[p->i_mb_index] != B_SKIP ) + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = p->i_pred_mode_chroma_tab[p->i_mb_index]; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = p->i_cbp; + } + else + { + p->i_chroma_pred_mode_left = p->p_chroma_pred_mode_top[p->i_mb_x] = 0; + p->i_cbp_left = p->p_cbp_top[p->i_mb_x] = 0; /* skip has not cbp */ + p->i_last_dqp = 0; + } + } + + CP16(p->p_ref_top[p->i_mb_x][0], &p->p_ref[0][7]); + CP16(p->p_ref_top[p->i_mb_x][1], &p->p_ref[1][7]); + } + + /* Move to next MB */ + p->i_mb_x++; + if( p->i_mb_x == p->i_mb_width ) + { + p->i_mb_flags = B_AVAIL|C_AVAIL; + + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + + for( i = 0; i <= 20; i += 4 ) + { + p->mv[i] = MV_NOT_AVAIL; + } + p->i_mb_x = 0; + p->i_mb_y++; + i_y = p->i_mb_y - p->i_mb_offset; + p->b_first_line = 0; + + /* for AEC */ + p->i_mb_type_left = -1; + } + else + { + /* for AEC */ + p->i_mb_type_left = p->i_mb_type_tab[p->i_mb_index]; + } + + if( p->i_mb_x == p->i_mb_width-1 ) + { + p->i_mb_flags &= ~C_AVAIL; + } + + if( p->i_mb_x && p->i_mb_y && p->b_first_line==0 ) + { + p->i_mb_flags |= D_AVAIL; + } + + /* set for AEC decode of frame level */ + if( (p->i_mb_type_tab[p->i_mb_index] != I_8X8 ) + && (p->ph.i_picture_coding_type != 0 + || (p->ph.i_picture_coding_type == CAVS_I_PICTURE && p->b_bottom) ) ) + { + /* set intra prediction modes to default values */ + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[10] = + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[20] = NOT_AVAIL; + + p->p_top_intra_pred_mode_y[(i_offset<<1)+0] = p->p_top_intra_pred_mode_y[(i_offset<<1)+1] = + p->p_top_intra_pred_mode_y[(i_offset<<1)+2] = p->p_top_intra_pred_mode_y[(i_offset<<1)+3] = NOT_AVAIL; + } + + return 0; +} + +static inline int rec_next_mb( cavs_decoder *p ) +{ + int i, i_y; + + p->i_mb_flags |= A_AVAIL; + p->p_y += 16; + p->p_cb += 8; + p->p_cr += 8; + + /* Move to next MB */ + p->i_mb_x++; + if(p->i_mb_x == p->i_mb_width) + { + p->i_mb_flags = B_AVAIL|C_AVAIL; + + for( i = 0; i <= 20; i += 4 ) + { + p->mv[i] = MV_NOT_AVAIL; + } + p->i_mb_x = 0; + p->i_mb_y++; + i_y = p->i_mb_y - p->i_mb_offset; + p->p_y = p->cur.p_data[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_cb = p->cur.p_data[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_cr = p->cur.p_data[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; + +#if B_MB_WEIGHTING + p->p_back_y = p->mb_line_buffer[0] + i_y*CAVS_MB_SIZE*p->cur.i_stride[0]; + p->p_back_cb = p->mb_line_buffer[1] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[1]; + p->p_back_cr = p->mb_line_buffer[2] + i_y*(CAVS_MB_SIZE>>1)*p->cur.i_stride[2]; +#endif + + p->b_first_line = 0; + + /* for AEC */ + p->i_mb_type_left = -1; + } + else + { + /* for AEC */ + p->i_mb_type_left = p->i_mb_type_tab[p->i_mb_index]; + } + + if( p->i_mb_x == p->i_mb_width-1 ) + { + p->i_mb_flags &= ~C_AVAIL; + } + + if( p->i_mb_x && p->i_mb_y && p->b_first_line==0 ) + { + p->i_mb_flags |= D_AVAIL; + } + + return 0; +} + + +static int get_mb_i_aec_opt( cavs_decoder *p ) +{ + static const uint8_t scan5x5[4][4] = { + {6, 7, 11, 12}, + {8, 9, 13, 14}, + {16, 17, 21, 22}, + {18, 19, 23, 24} + }; + + int i; + int i_offset = p->i_mb_x<<2; + int i_rem_mode; + int i_pred_mode; + + int i_ret = 0; + + init_mb(p); + + /* luma predict mode */ + for( i = 0; i < 4; i++ ) + { + { + int i_pos = scan5x5[i][0]; + + i_rem_mode = p->bs_read[SYNTAX_INTRA_LUMA_PRED_MODE](p); + if( p->b_error_flag ) + { + return -1; + } + + i_pred_mode = cavs_mb_predict_intra8x8_mode(p, i_pos); + if(!p->pred_mode_flag) + { + i_pred_mode = i_rem_mode + (i_rem_mode >= i_pred_mode); + } + if( i_pred_mode > 4) + { + p->b_error_flag = 1; + + return -1; + } + + p->i_intra_pred_mode_y[scan5x5[i][0]] = + p->i_intra_pred_mode_y[scan5x5[i][1]] = + p->i_intra_pred_mode_y[scan5x5[i][2]] = + p->i_intra_pred_mode_y[scan5x5[i][3]] = i_pred_mode; + p->i_intra_pred_mode_y_tab[p->i_mb_index][scan5x5[i][0]] = + p->i_intra_pred_mode_y_tab[p->i_mb_index][scan5x5[i][1]] = + p->i_intra_pred_mode_y_tab[p->i_mb_index][scan5x5[i][2]] = + p->i_intra_pred_mode_y_tab[p->i_mb_index][scan5x5[i][3]] = i_pred_mode; + } + } + + p->i_pred_mode_chroma_tab[p->i_mb_index] = p->bs_read[SYNTAX_INTRA_CHROMA_PRED_MODE](p); + if(p->i_pred_mode_chroma_tab[p->i_mb_index] > 6 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + p->i_intra_pred_mode_y[5] = p->i_intra_pred_mode_y[9]; + p->i_intra_pred_mode_y[10] = p->i_intra_pred_mode_y[14]; + p->i_intra_pred_mode_y[15] = p->i_intra_pred_mode_y[19]; + p->i_intra_pred_mode_y[20] = p->i_intra_pred_mode_y[24]; + + p->p_top_intra_pred_mode_y[i_offset+0] = p->i_intra_pred_mode_y[21]; + p->p_top_intra_pred_mode_y[i_offset+1] = p->i_intra_pred_mode_y[22]; + p->p_top_intra_pred_mode_y[i_offset+2] = p->i_intra_pred_mode_y[23]; + p->p_top_intra_pred_mode_y[i_offset+3] = p->i_intra_pred_mode_y[24]; + + if(!(p->i_mb_flags & A_AVAIL)) + { + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[6] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[11] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[16] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[21] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_C, &p->i_pred_mode_chroma ); + } + if(!(p->i_mb_flags & B_AVAIL)) + { + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[6] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[7] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[8] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y[9] ); + adapt_pred_mode(TOP_ADAPT_INDEX_C, &p->i_pred_mode_chroma); + } + + if(!(p->i_mb_flags & A_AVAIL)) + { + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y_tab[p->i_mb_index][6] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y_tab[p->i_mb_index][11] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y_tab[p->i_mb_index][16] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_L, &p->i_intra_pred_mode_y_tab[p->i_mb_index][21] ); + adapt_pred_mode(LEFT_ADAPT_INDEX_C, &p->i_pred_mode_chroma_tab[p->i_mb_index] ); + } + if(!(p->i_mb_flags & B_AVAIL)) + { + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y_tab[p->i_mb_index][6] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y_tab[p->i_mb_index][7] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y_tab[p->i_mb_index][8] ); + adapt_pred_mode(TOP_ADAPT_INDEX_L, &p->i_intra_pred_mode_y_tab[p->i_mb_index][9] ); + adapt_pred_mode(TOP_ADAPT_INDEX_C, &p->i_pred_mode_chroma_tab[p->i_mb_index] ); + } + + /* cbp */ + p->i_cbp_tab[p->i_mb_index] = p->bs_read[SYNTAX_INTRA_CBP](p); + if( p->b_error_flag ) + { + return -1; + } + + p->i_cbp = p->i_cbp_tab[p->i_mb_index]; + if( p->i_cbp_tab[p->i_mb_index] > 63 ) + { + p->b_error_flag = 1; + + return -1; + } + + /* qp */ + p->i_qp_tab[p->i_mb_index] = p->i_qp; + if(p->i_cbp_tab[p->i_mb_index] && !p->b_fixed_qp) + { + int delta_qp = p->bs_read[SYNTAX_DQP](p); + + p->i_qp_tab[p->i_mb_index] = (p->i_qp_tab[p->i_mb_index] -MIN_QP + delta_qp + (MAX_QP-MIN_QP+1))%(MAX_QP-MIN_QP+1)+MIN_QP; + + p->i_qp = p->i_qp_tab[p->i_mb_index]; + + if( p->i_qp < 0 || p->i_qp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + return -1; + } + } + else + p->i_last_dqp = 0; // for cabac only + + /* luma coeffs */ + for( i = 0; i < 4; i++ ) + { + if(p->i_cbp_tab[p->i_mb_index] & (1<i_cbp_tab[p->i_mb_index] & (1<<4)) + { + /* read cb coeffs from stream */ + i_ret = get_residual_block_aec_opt( p, chroma_2dvlc, 0, 1, 4 ); + if( i_ret == -1 ) + return -1; + } + if(p->i_cbp_tab[p->i_mb_index] & (1<<5)) + { + /* read cr coeffs from stream */ + i_ret = get_residual_block_aec_opt( p, chroma_2dvlc, 0, 1, 5 ); + if( i_ret == -1 ) + return -1; + } + + p->mv [MV_FWD_X0] = MV_INTRA; + copy_mvs(&p->mv[MV_FWD_X0], BLK_16X16); + p->mv[MV_BWD_X0] = MV_INTRA; + copy_mvs(&p->mv[MV_BWD_X0], BLK_16X16); + + if(p->ph.i_picture_coding_type != CAVS_B_PICTURE) + *p->p_col_type = I_8X8; + + /* need to update mb info */ + return aec_next_mb(p); +} + +static int get_mb_p_aec_opt( cavs_decoder *p ) +{ + int i_offset; + int ref[4]; + int i_mb_type = p->i_mb_type; + int16_t (*p_mvd)[6][2] = p->p_mvd; + int8_t (*p_ref)[9] = p->p_ref; + int i_ret = 0; + + init_mb(p); + +#define FWD 0 +#define MVD_X0 1 +#define MVD_X1 2 +#define MVD_X2 4 +#define MVD_X3 5 +#define REF_X0 4 +#define REF_X1 5 +#define REF_X2 7 +#define REF_X3 8 + + switch(i_mb_type) + { + case P_SKIP: + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_PSKIP, BLK_16X16, PSKIP_REF, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + break; + case P_16X16: + ref[0] = p->bs_read_ref_p(p, REF_X0); + if( ref[0] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + + M32(p_mvd[FWD][MVD_X1]) = M32(p_mvd[FWD][MVD_X3]) = M32(p_mvd[FWD][MVD_X0]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X2] = p_ref[FWD][REF_X3] = p_ref[FWD][REF_X0]; + break; + case P_16X8: + ref[0] = p->bs_read_ref_p(p, REF_X0); + if( ref[0] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + ref[2] = p->bs_read_ref_p(p, REF_X2); + if( ref[2] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_TOP, BLK_16X8, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X2, MV_FWD_A1, MV_PRED_LEFT, BLK_16X8, ref[2], MVD_X2); + if( p->b_error_flag ) + { + return -1; + } + + CP32(p_mvd[FWD][MVD_X1], p_mvd[FWD][MVD_X0]); + CP32(p_mvd[FWD][MVD_X3], p_mvd[FWD][MVD_X2]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X0]; + p_ref[FWD][REF_X3] = p_ref[FWD][REF_X2]; + break; + case P_8X16: + ref[0] = p->bs_read_ref_p(p, REF_X0); + if( ref[0] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + ref[1] = p->bs_read_ref_p(p, REF_X1); + if( ref[1] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + mv_pred(p, MV_FWD_X0, MV_FWD_B3, MV_PRED_LEFT, BLK_8X16, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X1, MV_FWD_C2, MV_PRED_TOPRIGHT, BLK_8X16, ref[1], MVD_X1); + if( p->b_error_flag ) + { + return -1; + } + + CP32(p_mvd[FWD][MVD_X3], p_mvd[FWD][MVD_X1]); + p_ref[FWD][REF_X2] = p_ref[FWD][REF_X0]; + p_ref[FWD][REF_X3] = p_ref[FWD][REF_X1]; + break; + case P_8X8: + ref[0] = p->bs_read_ref_p(p, REF_X0); + if( ref[0] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + ref[1] = p->bs_read_ref_p(p, REF_X1); + if( ref[1] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + ref[2] = p->bs_read_ref_p(p, REF_X2); + if( ref[2] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + ref[3] = p->bs_read_ref_p(p, REF_X3); + if( ref[3] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + mv_pred(p, MV_FWD_X0, MV_FWD_B3, MV_PRED_MEDIAN, BLK_8X8, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X1, MV_FWD_C2, MV_PRED_MEDIAN, BLK_8X8, ref[1], MVD_X1); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X2, MV_FWD_X1, MV_PRED_MEDIAN, BLK_8X8, ref[2], MVD_X2); + if( p->b_error_flag ) + { + return -1; + } + mv_pred(p, MV_FWD_X3, MV_FWD_X0, MV_PRED_MEDIAN, BLK_8X8, ref[3], MVD_X3); + if( p->b_error_flag ) + { + return -1; + } + + break; + + default: + p->b_error_flag = 1; + return -1; + } + + /* save current mv, mvd, refidx into a frame, ignore neighbor info */ + /* mv copy */ + memcpy(p->mv_tab[p->i_mb_index], p->mv, 24*sizeof(cavs_vector)); + + /* mvd copy */ + memcpy(p->p_mvd_tab[p->i_mb_index], p->p_mvd, 2*6*2*sizeof(int16_t)); + + /* refidx copy */ + memcpy(p->p_ref_tab[p->i_mb_index], p->p_ref, 2*9*sizeof(int8_t)); + +#undef FWD +#undef MVD_X3 +#undef MVD_X2 +#undef MVD_X1 +#undef MVD_X0 +#undef REF_X3 +#undef REF_X2 +#undef REF_X1 +#undef REF_X0 + +#if B_MB_WEIGHTING + p->weighting_prediction = 0; +#endif + if (i_mb_type != P_SKIP) + { +#if B_MB_WEIGHTING + if ( p->sh.b_slice_weighting_flag && p->sh.b_mb_weighting_flag ) + { + if( p->ph.b_aec_enable ) + { + p->weighting_prediction = cavs_cabac_get_mb_weighting_prediction( p ); + } + else + p->weighting_prediction = cavs_bitstream_get_bit1(&p->s); //weighting_prediction + } +#else + if (p->sh.b_mb_weighting_flag) + { + cavs_bitstream_get_bit1(&p->s); /* weighting_prediction */ + } +#endif + } + +#if B_MB_WEIGHTING + p->weighting_prediction_tab[p->i_mb_index] = p->weighting_prediction; +#endif + + i_offset = (p->i_mb_y*p->i_mb_width + p->i_mb_x)*4; + p->p_col_mv[i_offset+ 0] = p->mv[MV_FWD_X0]; + p->p_col_mv[i_offset + 1] = p->mv[MV_FWD_X1]; + p->p_col_mv[i_offset + 2] = p->mv[MV_FWD_X2]; + p->p_col_mv[i_offset + 3] = p->mv[MV_FWD_X3]; + + p->i_qp_tab[p->i_mb_index] = p->i_qp; /* init for skip */ + if (i_mb_type != P_SKIP) + { + /* get coded block pattern */ + p->i_cbp_tab[p->i_mb_index] = p->bs_read[SYNTAX_INTER_CBP](p); + if( p->b_error_flag ) + { + return -1; + } + p->i_cbp = p->i_cbp_tab[p->i_mb_index]; + if( p->i_cbp_tab[p->i_mb_index] > 63) + { + p->b_error_flag = 1; + + return -1; + } + + /* get quantizer */ + p->i_qp_tab[p->i_mb_index] = p->i_qp; + if(p->i_cbp_tab[p->i_mb_index] && !p->b_fixed_qp) + { + int delta_qp = p->bs_read[SYNTAX_DQP](p); + + p->i_qp_tab[p->i_mb_index] = (p->i_qp_tab[p->i_mb_index] -MIN_QP + delta_qp + (MAX_QP-MIN_QP+1))%(MAX_QP-MIN_QP+1)+MIN_QP; + + p->i_qp = p->i_qp_tab[p->i_mb_index]; + + if( p->i_qp < 0 || p->i_qp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + return -1; + } + } + else + p->i_last_dqp = 0; + + i_ret = get_residual_inter_aec_opt(p, i_mb_type); + if( i_ret == -1 ) + return -1; + } + + *p->p_col_type = i_mb_type; + + return aec_next_mb(p); +} + +static int get_mb_b_aec_opt( cavs_decoder *p ) +{ + int kk = 0; + cavs_vector mv[24]; + int block; + enum cavs_mb_sub_type sub_type[4]; + int flags; + int ref[4] = { 0 }; + int i_ref_offset = p->ph.b_picture_structure == 0 ? 2 : 1; + uint8_t i_col_type; + cavs_vector *p_mv; + int i_mb_type = p->i_mb_type_tab[p->i_mb_index]; + int16_t (*p_mvd)[6][2] = p->p_mvd; + int8_t (*p_ref)[9] = p->p_ref; + int i_ret = 0; + + init_mb(p); + + p->mv[MV_FWD_X0] = MV_REF_DIR; + copy_mvs(&p->mv[MV_FWD_X0], BLK_16X16); + p->mv[MV_BWD_X0] = MV_REF_DIR; + copy_mvs(&p->mv[MV_BWD_X0], BLK_16X16); + +#define FWD 0 +#define BWD 1 +#define MVD_X0 1 +#define MVD_X1 2 +#define MVD_X2 4 +#define MVD_X3 5 +#define REF_X0 4 +#define REF_X1 5 +#define REF_X2 7 +#define REF_X3 8 + + /* The MVD of pos X[0-3] have been initialized as 0 + The REF of pos X[0-3] have been initialized as -1 */ + switch(i_mb_type) + { + case -1: + return -1; + break; + + case B_SKIP: + case B_DIRECT: + get_b_direct_skip_mb(p); + if(p->b_error_flag) + { + return -1; + } + + break; + + case B_FWD_16X16: + ref[0] = p->bs_read_ref_b(p, FWD, REF_X0); + if( ref[0] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0]+i_ref_offset, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + + M32(p_mvd[FWD][MVD_X1]) = M32(p_mvd[FWD][MVD_X3]) = M32(p_mvd[FWD][MVD_X0]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X2] = p_ref[FWD][REF_X3] = p_ref[FWD][REF_X0]; + break; + + case B_SYM_16X16: + ref[0] = p->bs_read_ref_b(p, FWD, REF_X0); + if( ref[0] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0]+i_ref_offset, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + + mv_pred_sym(p, &p->mv[MV_FWD_X0], BLK_16X16,ref[0]); + if(p->b_error_flag) + { + return -1; + } + M32(p_mvd[FWD][MVD_X1]) = M32(p_mvd[FWD][MVD_X3]) = M32(p_mvd[FWD][MVD_X0]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X2] = p_ref[FWD][REF_X3] = p_ref[FWD][REF_X0]; + break; + + case B_BWD_16X16: + ref[0] = p->bs_read_ref_b(p, BWD, REF_X0); + if( ref[0] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + mv_pred(p, MV_BWD_X0, MV_BWD_C2, MV_PRED_MEDIAN, BLK_16X16, ref[0], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + + M32(p_mvd[BWD][MVD_X1]) = M32(p_mvd[BWD][MVD_X3]) = M32(p_mvd[BWD][MVD_X0]); + p_ref[BWD][REF_X1] = p_ref[BWD][REF_X2] = p_ref[BWD][REF_X3] = p_ref[BWD][REF_X0]; + break; + + case B_8X8: + mv[MV_FWD_A1] = p->mv[MV_FWD_A1]; + mv[MV_FWD_B2] = p->mv[MV_FWD_B2]; + mv[MV_FWD_C2] = p->mv[MV_FWD_C2]; + mv[MV_FWD_D3] = p->mv[MV_FWD_D3]; + mv[MV_BWD_A1] = p->mv[MV_BWD_A1]; + mv[MV_BWD_B2] = p->mv[MV_BWD_B2]; + mv[MV_BWD_C2] = p->mv[MV_BWD_C2]; + mv[MV_BWD_D3] = p->mv[MV_BWD_D3]; + + for(block = 0; block < 4; block++) + { + sub_type[block] = (enum cavs_mb_sub_type)p->bs_read[SYNTAX_MB_PART_TYPE](p); + if(sub_type[block] < 0 || sub_type[block] > 3 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + + for( block = 0; block < 4; block++) + { + if(sub_type[block] == B_SUB_DIRECT || sub_type[block] == B_SUB_BWD) + ref[block] = 0; + else + ref[block] = p->bs_read_ref_b(p, FWD, ref_scan[block]); + + if( ref[block] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + + for(block = 0; block < 4; block++) + { + if(sub_type[block] == B_SUB_BWD) + { + ref[block] = p->bs_read_ref_b(p, BWD, ref_scan[block]); + } + + if( ref[block] > 1 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + + for( block = 0; block < 4; block++ ) + { + switch(sub_type[block]) + { + case B_SUB_DIRECT: + get_col_info(p, &i_col_type, &p_mv, block); + if(!i_col_type) + { + mv_pred_sub_direct(p, mv, 0, mv_scan[block], mv_scan[block]-3, + MV_PRED_BSKIP, BLK_8X8, i_ref_offset); + if(p->b_error_flag) + return -1; + mv_pred_sub_direct(p, mv, MV_BWD_OFFS, mv_scan[block]+MV_BWD_OFFS, + mv_scan[block]-3+MV_BWD_OFFS, + MV_PRED_BSKIP, BLK_8X8, 0); + } + else + { + get_b_direct_skip_sub_mb(p, block, p_mv); + } + + if(p->b_error_flag) + { + return -1; + } + + break; + + case B_SUB_FWD: + mv_pred(p, mv_scan[block], mv_scan[block]-3, + MV_PRED_MEDIAN, BLK_8X8, ref[block]+i_ref_offset, mvd_scan[block]); + if( p->b_error_flag ) + { + return -1; + } + break; + + case B_SUB_SYM: + mv_pred(p, mv_scan[block], mv_scan[block]-3, + MV_PRED_MEDIAN, BLK_8X8, ref[block]+i_ref_offset, mvd_scan[block]); + if( p->b_error_flag ) + { + return -1; + } + mv_pred_sym(p, &p->mv[mv_scan[block]], BLK_8X8,ref[block]); + if(p->b_error_flag) + { + return -1; + } + break; + default: + break; + } + } + for( block = 0; block < 4; block++ ) + { + if(sub_type[block] == B_SUB_BWD) + { + mv_pred(p, mv_scan[block]+MV_BWD_OFFS, + mv_scan[block]+MV_BWD_OFFS-3, + MV_PRED_MEDIAN, BLK_8X8, ref[block], mvd_scan[block]); + if( p->b_error_flag ) + { + return -1; + } + } + } + break; + default: + flags = partition_flags[i_mb_type]; + if( i_mb_type <= B_SYM_16X16 ) + { + p->b_error_flag = 1; + + return -1; + } + if(i_mb_type & 1) /* 16x8 macroblock types */ + { + int i = 0, k = 0; + + if (flags & FWD0) + ref[i++] = p->bs_read_ref_b(p, FWD, REF_X0); + if (flags & FWD1) + ref[i++] = p->bs_read_ref_b(p, FWD, REF_X2); + if (flags & BWD0) + ref[i++] = p->bs_read_ref_b(p, BWD, REF_X0); + if (flags & BWD1) + ref[i++] = p->bs_read_ref_b(p, BWD, REF_X2); + if( p->b_error_flag ) + { + return -1; + } + + k = i; + for( i = 0 ; i < k; i++ ) + { + if( ref[i] > 1 ) + { + p->b_error_flag = 1; + + return -1; + } + } + + if(flags & FWD0) + { + mv_pred(p, MV_FWD_X0, MV_FWD_C2, MV_PRED_TOP, BLK_16X8, ref[kk++]+i_ref_offset, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[FWD][MVD_X1], p_mvd[FWD][MVD_X0]); + p_ref[FWD][REF_X1] = p_ref[FWD][REF_X0]; + } + + if(flags & SYM0) + { + mv_pred_sym(p, &p->mv[MV_FWD_X0], BLK_16X8,ref[kk-1]); + if(p->b_error_flag) + { + return -1; + } + } + if(flags & FWD1) + { + mv_pred(p, MV_FWD_X2, MV_FWD_A1, MV_PRED_LEFT, BLK_16X8, ref[kk++]+i_ref_offset, MVD_X2); + if( p->b_error_flag ) + { + return -1; + } + + CP32(p_mvd[FWD][MVD_X3], p_mvd[FWD][MVD_X2]); + p_ref[FWD][REF_X3] = p_ref[FWD][REF_X2]; + } + if(flags & SYM1) + { + mv_pred_sym(p, &p->mv[MV_FWD_X2], BLK_16X8,ref[kk-1]); + if(p->b_error_flag) + { + return -1; + } + } + if(flags & BWD0) + { + mv_pred(p, MV_BWD_X0, MV_BWD_C2, MV_PRED_TOP, BLK_16X8, ref[kk++], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + + CP32(p_mvd[BWD][MVD_X1], p_mvd[BWD][MVD_X0]); + p_ref[BWD][REF_X1] = p_ref[BWD][REF_X0]; + } + if(flags & BWD1) + { + mv_pred(p, MV_BWD_X2, MV_BWD_A1, MV_PRED_LEFT, BLK_16X8, ref[kk++], MVD_X2); + if( p->b_error_flag ) + { + return -1; + } + + CP32(p_mvd[BWD][MVD_X3], p_mvd[BWD][MVD_X2]); + p_ref[BWD][REF_X3] = p_ref[BWD][REF_X2]; + } + } + else /* 8x16 macroblock types */ + { + int i = 0, k = 0; + + if (flags & FWD0) + ref[i++] = p->bs_read_ref_b(p, FWD, REF_X0); + if (flags & FWD1) + ref[i++] = p->bs_read_ref_b(p, FWD, REF_X1); + if (flags & BWD0) + ref[i++] = p->bs_read_ref_b(p, BWD, REF_X0); + if (flags & BWD1) + ref[i++] = p->bs_read_ref_b(p, BWD, REF_X1); + if( p->b_error_flag ) + { + return -1; + } + + k = i; + for( i = 0 ; i < k; i++ ) + { + if( ref[i] > 1 ) + { + p->b_error_flag = 1; + + return -1; + } + } + + if(flags & FWD0) + { + mv_pred(p, MV_FWD_X0, MV_FWD_B3, MV_PRED_LEFT, BLK_8X16, ref[kk++]+i_ref_offset, MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + p_ref[FWD][REF_X2] = p_ref[FWD][REF_X0]; + } + if(flags & SYM0) + { + mv_pred_sym(p, &p->mv[MV_FWD_X0], BLK_8X16,ref[kk-1]); + if(p->b_error_flag) + { + return -1; + } + } + if(flags & FWD1) + { + mv_pred(p, MV_FWD_X1, MV_FWD_C2, MV_PRED_TOPRIGHT,BLK_8X16, ref[kk++]+i_ref_offset, MVD_X1); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[FWD][MVD_X3], p_mvd[FWD][MVD_X1]); + p_ref[FWD][REF_X3] = p_ref[FWD][REF_X1]; + } + if(flags & SYM1) + { + mv_pred_sym(p, &p->mv[MV_FWD_X1], BLK_8X16,ref[kk-1]); + if(p->b_error_flag) + { + return -1; + } + } + + if(flags & BWD0) + { + mv_pred(p, MV_BWD_X0, MV_BWD_B3, MV_PRED_LEFT, BLK_8X16, ref[kk++], MVD_X0); + if( p->b_error_flag ) + { + return -1; + } + p_ref[BWD][REF_X2] = p_ref[BWD][REF_X0]; + } + if(flags & BWD1) + { + mv_pred(p, MV_BWD_X1, MV_BWD_C2, MV_PRED_TOPRIGHT,BLK_8X16, ref[kk++], MVD_X1); + if( p->b_error_flag ) + { + return -1; + } + CP32(p_mvd[BWD][MVD_X3], p_mvd[BWD][MVD_X1]); + p_ref[BWD][REF_X3] = p_ref[BWD][REF_X1]; + } + } + } + + /* save current mv, mvd, refidx into a frame, ignore neighbor info */ + /* mv copy */ + memcpy(p->mv_tab[p->i_mb_index], p->mv, 24*sizeof(cavs_vector)); + + /* mvd copy */ + memcpy(p->p_mvd_tab[p->i_mb_index], p->p_mvd, 2*6*2*sizeof(int16_t)); + + /* refidx copy */ + memcpy(p->p_ref_tab[p->i_mb_index], p->p_ref, 2*9*sizeof(int8_t)); + +#undef FWD +#undef BWD +#undef MVD_X3 +#undef MVD_X2 +#undef MVD_X1 +#undef MVD_X0 +#undef REF_X3 +#undef REF_X2 +#undef REF_X1 +#undef REF_X0 + +#if B_MB_WEIGHTING + p->weighting_prediction = 0; +#endif + if (i_mb_type != B_SKIP) + { +#if B_MB_WEIGHTING + if ( p->sh.b_slice_weighting_flag && p->sh.b_mb_weighting_flag ) + { + if( p->ph.b_aec_enable ) + { + p->weighting_prediction = cavs_cabac_get_mb_weighting_prediction( p ); + } + else + p->weighting_prediction = cavs_bitstream_get_bit1(&p->s); //weighting_prediction + } +#else + if (p->sh.b_mb_weighting_flag) + { + cavs_bitstream_get_bit1(&p->s); /* weighting_prediction */ + } +#endif + + } + +#if B_MB_WEIGHTING + p->weighting_prediction_tab[p->i_mb_index] = p->weighting_prediction; +#endif + + p->i_qp_tab[p->i_mb_index] = p->i_qp; /* init for skip */ + if(i_mb_type != B_SKIP) + { + /* get coded block pattern */ + p->i_cbp_tab[p->i_mb_index] = p->bs_read[SYNTAX_INTER_CBP](p); + if( p->b_error_flag ) + { + return -1; + } + p->i_cbp = p->i_cbp_tab[p->i_mb_index]; + if( p->i_cbp_tab[p->i_mb_index] > 63) + { + p->b_error_flag = 1; + + return -1; + } + + /* get quantizer */ + p->i_qp_tab[p->i_mb_index] = p->i_qp; + if(p->i_cbp_tab[p->i_mb_index] && !p->b_fixed_qp) + { + int delta_qp = p->bs_read[SYNTAX_DQP](p); + + p->i_qp_tab[p->i_mb_index] = (p->i_qp_tab[p->i_mb_index] -MIN_QP + delta_qp + (MAX_QP-MIN_QP+1))%(MAX_QP-MIN_QP+1)+MIN_QP; + + p->i_qp = p->i_qp_tab[p->i_mb_index]; + + if( p->i_qp < 0 || p->i_qp > 63 || p->b_error_flag ) + { + p->b_error_flag = 1; + + return -1; + } + } + else + p->i_last_dqp = 0; + + i_ret = get_residual_inter_aec_opt(p, i_mb_type); + if( i_ret == -1 ) + return -1; + } + + return aec_next_mb(p); +} + +static int get_mb_i_rec_opt( cavs_decoder *p ) +{ + uint8_t i_top[18]; + uint8_t *p_left = NULL; + uint8_t *p_d; + + static const uint8_t scan5x5[4][4] = { + {6, 7, 11, 12}, + {8, 9, 13, 14}, + {16, 17, 21, 22}, + {18, 19, 23, 24} + }; + + int i; + DECLARE_ALIGNED_16(uint8_t edge_8x8[33]); + int i_qp_cb = 0, i_qp_cr = 0; + int ret = 0; + + if(p->i_cbp_tab[p->i_mb_index] < 0 || p->i_cbp_tab[p->i_mb_index] > 63 + || p->i_qp_tab[p->i_mb_index] < 0 + || p->i_qp_tab[p->i_mb_index] > 63 ) + { + return -1; + } + + for( i = 0; i < 4; i++ ) + { + int i_mode; + + p_d = p->p_y + p->i_luma_offset[i]; + + load_intra_pred_luma(p, i_top, &p_left, i); + + { + i_mode = p->i_intra_pred_mode_y_tab[p->i_mb_index][scan5x5[i][0]]; + + if( i_mode > 7 || i_mode < 0 ) + { + return -1; + } + + p->cavs_intra_luma[i_mode](p_d, edge_8x8, p->cur.i_stride[0], i_top, p_left); + + if(p->i_cbp_tab[p->i_mb_index] & (1<i_qp_tab[p->i_mb_index], p_d, p->cur.i_stride[0], 0, i); + if(ret == -1) + { + return -1; + } + } + } + } + + load_intra_pred_chroma(p); + + if(p->i_pred_mode_chroma_tab[p->i_mb_index]>6 || p->i_pred_mode_chroma_tab[p->i_mb_index] < 0) + { + return -1; + } + + p->cavs_intra_chroma[p->i_pred_mode_chroma_tab[p->i_mb_index]](p->p_cb, p->mb.i_neighbour, p->cur.i_stride[1], &p->p_top_border_cb[p->i_mb_x*10], p->i_left_border_cb); + p->cavs_intra_chroma[p->i_pred_mode_chroma_tab[p->i_mb_index]](p->p_cr, p->mb.i_neighbour, p->cur.i_stride[2], &p->p_top_border_cr[p->i_mb_x*10], p->i_left_border_cr); + + if( p->b_weight_quant_enable && !p->ph.chroma_quant_param_disable ) + { + i_qp_cb = clip3_int( p->i_qp_tab[p->i_mb_index] + p->ph.chroma_quant_param_delta_u, 0, 63 ); + i_qp_cr = clip3_int( p->i_qp_tab[p->i_mb_index] + p->ph.chroma_quant_param_delta_v, 0, 63 ); + } + + if(p->i_cbp_tab[p->i_mb_index] & (1<<4)) + { + ret = get_residual_block_rec_opt( p, chroma_2dvlc, 0, + chroma_qp[ p->b_weight_quant_enable + && !p->ph.chroma_quant_param_disable? i_qp_cb : p->i_qp_tab[p->i_mb_index]], + p->p_cb,p->cur.i_stride[1], 1, 4); + if(ret == -1) + { + return -1; + } + } + if(p->i_cbp_tab[p->i_mb_index] & (1<<5)) + { + ret = get_residual_block_rec_opt( p, chroma_2dvlc, 0, + chroma_qp[ p->b_weight_quant_enable + && !p->ph.chroma_quant_param_disable? i_qp_cr : p->i_qp_tab[p->i_mb_index]], + p->p_cr, p->cur.i_stride[2], 1, 5); + if(ret == -1) + { + return -1; + } + } + + filter_mb(p, I_8X8); + p->mv[MV_FWD_X0] = MV_INTRA; + copy_mvs(&p->mv[MV_FWD_X0], BLK_16X16); + p->mv[MV_BWD_X0] = MV_INTRA; + copy_mvs(&p->mv[MV_BWD_X0], BLK_16X16); + + return rec_next_mb(p); +} + +static int get_mb_p_rec_opt( cavs_decoder *p ) +{ + int i_mb_type = p->i_mb_type_tab[p->i_mb_index]; + int ret = 0; + +#define FWD 0 +#define MVD_X0 1 +#define MVD_X1 2 +#define MVD_X2 4 +#define MVD_X3 5 +#define REF_X0 4 +#define REF_X1 5 +#define REF_X2 7 +#define REF_X3 8 + + p->mv[MV_FWD_B2] = p->mv_tab[p->i_mb_index][MV_FWD_B2]; + p->mv[MV_FWD_B3] = p->mv_tab[p->i_mb_index][MV_FWD_B3]; + p->mv[MV_FWD_A1] = p->mv_tab[p->i_mb_index][MV_FWD_A1];/* following four used for deblock */ + p->mv[MV_FWD_X0] = p->mv_tab[p->i_mb_index][MV_FWD_X0]; + p->mv[MV_FWD_X1] = p->mv_tab[p->i_mb_index][MV_FWD_X1]; + p->mv[MV_FWD_A3] = p->mv_tab[p->i_mb_index][MV_FWD_A3]; + p->mv[MV_FWD_X2] = p->mv_tab[p->i_mb_index][MV_FWD_X2]; + p->mv[MV_FWD_X3] = p->mv_tab[p->i_mb_index][MV_FWD_X3]; + + /** mvd cache + 0: A1 X0 X1 + 3: A3 X2 X3 */ + CP32(p->p_mvd[FWD][MVD_X0], p->p_mvd_tab[p->i_mb_index][FWD][MVD_X0]); + CP32(p->p_mvd[FWD][MVD_X1], p->p_mvd_tab[p->i_mb_index][FWD][MVD_X1]); + CP32(p->p_mvd[FWD][MVD_X2], p->p_mvd_tab[p->i_mb_index][FWD][MVD_X2]); + CP32(p->p_mvd[FWD][MVD_X3], p->p_mvd_tab[p->i_mb_index][FWD][MVD_X3]); + + /** ref cache + 0: D3 B2 B3 + 3: A1 X0 X1 + 6: A3 X2 X3 */ + p->p_ref[FWD][REF_X0] = p->p_ref_tab[p->i_mb_index][FWD][REF_X0]; + p->p_ref[FWD][REF_X1] = p->p_ref_tab[p->i_mb_index][FWD][REF_X1]; + p->p_ref[FWD][REF_X2] = p->p_ref_tab[p->i_mb_index][FWD][REF_X2]; + p->p_ref[FWD][REF_X3] = p->p_ref_tab[p->i_mb_index][FWD][REF_X3]; + +#undef FWD +#undef MVD_X3 +#undef MVD_X2 +#undef MVD_X1 +#undef MVD_X0 +#undef REF_X3 +#undef REF_X2 +#undef REF_X1 +#undef REF_X0 + +#if B_MB_WEIGHTING + p->weighting_prediction = p->weighting_prediction_tab[p->i_mb_index]; +#endif + + inter_pred(p, i_mb_type); + + if (i_mb_type != P_SKIP) + { + ret = get_residual_inter_rec_opt(p, i_mb_type); + if(ret == -1) + { + return -1; + } + } + + filter_mb(p, i_mb_type); + + return rec_next_mb(p); +} + + +static int get_mb_b_rec_opt( cavs_decoder *p ) +{ + int i_mb_type = p->i_mb_type_tab[p->i_mb_index];//p->i_mb_type; + int ret = 0; + +#define FWD 0 +#define BWD 1 +#define MVD_X0 1 +#define MVD_X1 2 +#define MVD_X2 4 +#define MVD_X3 5 +#define REF_X0 4 +#define REF_X1 5 +#define REF_X2 7 +#define REF_X3 8 + + p->mv[MV_FWD_B2] = p->mv_tab[p->i_mb_index][MV_FWD_B2]; + p->mv[MV_FWD_B3] = p->mv_tab[p->i_mb_index][MV_FWD_B3]; + p->mv[MV_FWD_A1] = p->mv_tab[p->i_mb_index][MV_FWD_A1];/* following four used for deblock */ + p->mv[MV_FWD_X0] = p->mv_tab[p->i_mb_index][MV_FWD_X0]; + p->mv[MV_FWD_X1] = p->mv_tab[p->i_mb_index][MV_FWD_X1]; + p->mv[MV_FWD_A3] = p->mv_tab[p->i_mb_index][MV_FWD_A3]; + p->mv[MV_FWD_X2] = p->mv_tab[p->i_mb_index][MV_FWD_X2]; + p->mv[MV_FWD_X3] = p->mv_tab[p->i_mb_index][MV_FWD_X3]; + + p->mv[MV_BWD_B2] = p->mv_tab[p->i_mb_index][MV_BWD_B2]; + p->mv[MV_BWD_B3] = p->mv_tab[p->i_mb_index][MV_BWD_B3]; + p->mv[MV_BWD_A1] = p->mv_tab[p->i_mb_index][MV_BWD_A1];/* following four used for deblock */ + p->mv[MV_BWD_X0] = p->mv_tab[p->i_mb_index][MV_BWD_X0]; + p->mv[MV_BWD_X1] = p->mv_tab[p->i_mb_index][MV_BWD_X1]; + p->mv[MV_BWD_A3] = p->mv_tab[p->i_mb_index][MV_BWD_A3]; + p->mv[MV_BWD_X2] = p->mv_tab[p->i_mb_index][MV_BWD_X2]; + p->mv[MV_BWD_X3] = p->mv_tab[p->i_mb_index][MV_BWD_X3]; + + /** mvd cache + 0: A1 X0 X1 + 3: A3 X2 X3 */ + CP32(p->p_mvd[FWD][MVD_X0], p->p_mvd_tab[p->i_mb_index][FWD][MVD_X0]); + CP32(p->p_mvd[FWD][MVD_X1], p->p_mvd_tab[p->i_mb_index][FWD][MVD_X1]); + CP32(p->p_mvd[FWD][MVD_X2], p->p_mvd_tab[p->i_mb_index][FWD][MVD_X2]); + CP32(p->p_mvd[FWD][MVD_X3], p->p_mvd_tab[p->i_mb_index][FWD][MVD_X3]); + CP32(p->p_mvd[BWD][MVD_X0], p->p_mvd_tab[p->i_mb_index][BWD][MVD_X0]); + CP32(p->p_mvd[BWD][MVD_X1], p->p_mvd_tab[p->i_mb_index][BWD][MVD_X1]); + CP32(p->p_mvd[BWD][MVD_X2], p->p_mvd_tab[p->i_mb_index][BWD][MVD_X2]); + CP32(p->p_mvd[BWD][MVD_X3], p->p_mvd_tab[p->i_mb_index][BWD][MVD_X3]); + + /** ref cache + 0: D3 B2 B3 + 3: A1 X0 X1 + 6: A3 X2 X3 */ + p->p_ref[FWD][REF_X0] = p->p_ref_tab[p->i_mb_index][FWD][REF_X0]; + p->p_ref[FWD][REF_X1] = p->p_ref_tab[p->i_mb_index][FWD][REF_X1]; + p->p_ref[FWD][REF_X2] = p->p_ref_tab[p->i_mb_index][FWD][REF_X2]; + p->p_ref[FWD][REF_X3] = p->p_ref_tab[p->i_mb_index][FWD][REF_X3]; + p->p_ref[BWD][REF_X0] = p->p_ref_tab[p->i_mb_index][BWD][REF_X0]; + p->p_ref[BWD][REF_X1] = p->p_ref_tab[p->i_mb_index][BWD][REF_X1]; + p->p_ref[BWD][REF_X2] = p->p_ref_tab[p->i_mb_index][BWD][REF_X2]; + p->p_ref[BWD][REF_X3] = p->p_ref_tab[p->i_mb_index][BWD][REF_X3]; + +#undef FWD +#undef BWD +#undef MVD_X3 +#undef MVD_X2 +#undef MVD_X1 +#undef MVD_X0 +#undef REF_X3 +#undef REF_X2 +#undef REF_X1 +#undef REF_X0 + +#if B_MB_WEIGHTING + p->weighting_prediction = p->weighting_prediction_tab[p->i_mb_index]; +#endif + + inter_pred(p, i_mb_type); + + if(i_mb_type != B_SKIP) + { + ret = get_residual_inter_rec_opt(p, i_mb_type); + if(ret == -1) + { + return -1; + } + } + + filter_mb(p, i_mb_type); + + return rec_next_mb(p); +} diff -Naur ./ffmpeg-7.1.2/libavcodec/libcavs.h ./ffmpeg-7.1.2_cavs_dra/libavcodec/libcavs.h --- ./ffmpeg-7.1.2/libavcodec/libcavs.h 1970-01-01 08:00:00.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/libcavs.h 2026-01-16 14:44:37.120222800 +0800 @@ -0,0 +1,163 @@ +/***************************************************************************** +* libcavs.h: the header file of avs/avs+ decoder +***************************************************************************** +*/ + +/* + * Chinese AVS video (AVS1-P2, JiZhun profile) decoder. + * Chinese AVS video (AVS1-P16, Guangdian profile) decoder. +*/ + +#ifndef _CAVS_DECODER_H +#define _CAVS_DECODER_H + +#ifdef __cplusplus +extern "C" { // only need to export C interface if used by C++ source code +#endif + +#include + +typedef struct tagcavs_decoder cavs_decoder; + +#define SLICE_MAX_START_CODE 0x000001af +#define EXT_START_CODE 0x000001b5 +#define USER_START_CODE 0x000001b2 +#define CAVS_START_CODE 0x000001b0 +#define PIC_I_START_CODE 0x000001b3 +#define PIC_PB_START_CODE 0x000001b6 + +#define CAVS_SEQ_HEADER 1 +#define CAVS_FRAME_OUT 2 +#define CAVS_SEQ_END 4 +#define CAVS_ERROR 8 +#define CAVS_USER_DATA 16 + +#define CAVS_CS_YUV420 0 + +#define CAVS_SEQUENCE_DISPLAY_EXTENTION 0x00000002 +#define CAVS_COPYRIGHT_EXTENTION 0x00000004 +#define CAVS_PICTURE_DISPLAY_EXTENTION 0x00000007 +#define CAVS_CAMERA_PARAMETERS_EXTENTION 0x0000000B +#define CAVS_SLICE_MIN_START_CODE 0x00000100 +#define CAVS_SLICE_MAX_START_CODE 0x000001AF +#define CAVS_VIDEO_SEQUENCE_START_CODE 0x000001B0 +#define CAVS_VIDEO_SEQUENCE_END_CODE 0x000001B1 +#define CAVS_USER_DATA_CODE 0x000001B2 +#define CAVS_I_PICUTRE_START_CODE 0x000001B3 +#define CAVS_EXTENSION_START_CODE 0x000001B5 +#define CAVS_PB_PICUTRE_START_CODE 0x000001B6 +#define CAVS_VIDEO_EDIT_CODE 0x000001B7 +#define CAVS_VIDEO_TIME_CODE 0x000001E0 + +#define MAX_CODED_FRAME_SIZE 4000000 //!< bytes for one frame + +typedef struct tagcavs_seq_info +{ + long lWidth; + long lHeight; + int i_frame_rate_den; + int i_frame_rate_num; + int b_interlaced; + + int profile; + int level; + int aspect_ratio; + int low_delay; + int mb_width; + int mb_height; + int frame_rate_code; +}cavs_seq_info; + +typedef struct tagcavs_param +{ + unsigned int i_color_space; /* color space , only support 4:2:0 now */ + unsigned char *p_out_yuv[3]; /* memory for decoded frame */ + unsigned int seq_header_flag; /* first seq header flag */ + + int i_thread_num; /* number of threads (max 64)*/ + + cavs_seq_info seqsize; /* infos of seq header */ + + int cpu; /* detect cpu type */ + int fld_mb_end[2]; /* 0 : top 1 : bot */ + int b_interlaced; /* 0 : frame 1 : field */ + int b_accelerate; /* 0: off 1: on */ + + int output_type; /* mark output type, init as -1, I-0, P-1, B-2 */ +}cavs_param; + +/* creat handle of decoder */ +int cavs_decoder_create( void **pp_decoder, cavs_param *param ); + +/* init stream for decoding */ +int cavs_decoder_init_stream( void *p_decoder, unsigned char *rawstream, unsigned int i_len ); + +/* get one nal from input stream */ +int cavs_decoder_get_one_nal( void *p_decoder, unsigned char *buf,/*int *startcodepos,*/int *length ); + +/* process seq header start and seq end */ +int cavs_decoder_process( void *p_decoder, unsigned char *p_in, int i_in_len ); + +/* alloc buffer for decoded yuv */ +int cavs_decoder_buffer_init( cavs_param *param ); + +/* free buffer for decoded yuv */ +int cavs_decoder_buffer_end( cavs_param *param ); + +/* destroy decoder handle */ +void cavs_decoder_destroy( void *p_decoder ); + +/* destroy decoder handle when across different seq header */ +void cavs_decoder_slice_destroy( void *p_decoder ); + +/* get info from seq header */ +int cavs_decoder_get_seq( void *p_decoder, cavs_seq_info *p_si ); + +/* output delay frame when has B-frames in stream */ +int cavs_out_delay_frame( void *p_decoder, unsigned char *p_out_yuv[3] ); +int cavs_out_delay_frame_end(void *p_decoder, unsigned char *p_out_yuv[3]); + +/* init first seq header for frame decoding */ +int cavs_decoder_seq_init( void *p_decoder , cavs_param *param ); + +int cavs_decoder_seq_end( void *p_decoder ); + +/* decode one frame or field when across pic header */ +/* + void *p_decoder : decoder handle + int i_startcode : type of current picture header + cavs_param *param : decoder configure param + uint8_t* buf : buffer with current picture header + int length : length of current NAL +*/ +int cavs_decode_one_frame( void *p_decoder , int i_startcode, cavs_param *param, unsigned char* buf, int length ); + +/*return current frame type is P or B */ +int cavs_decoder_cur_frame_type( void* p_decoder ); + +int cavs_decoder_thread_param_init( void* p_decoder ); + +/*use for format probe */ +int cavs_decoder_probe_seq(void *p_decoder, unsigned char *p_in, int i_in_length); + +int cavs_decoder_pic_header( void* p_decoder, unsigned char *p_buf, int i_len, cavs_param* param, unsigned int cur_startcode ); + +int cavs_decoder_set_format_type( void* p_decoder, cavs_param *param ); + +int cavs_decoder_seq_header_reset( void* p_decoder ); + +int cavs_decoder_low_delay_value( void* p_decoder ); + +int cavs_decode_one_frame_delay( void *p_decoder, cavs_param *param ); + +int cavs_set_last_delay_frame( void *p_decoder ); + +int cavs_decoder_seq_header_reset_pipeline( void* p_decoder ); + +int cavs_decoder_slice_num_probe( void* p_decoder, int i_startcode, cavs_param *param, unsigned char *buf, int length ); + +#ifdef __cplusplus +} +#endif + +#endif diff -Naur ./ffmpeg-7.1.2/libavcodec/libcavsdec.c ./ffmpeg-7.1.2_cavs_dra/libavcodec/libcavsdec.c --- ./ffmpeg-7.1.2/libavcodec/libcavsdec.c 1970-01-01 08:00:00.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/libcavsdec.c 2026-01-22 22:00:49.966122700 +0800 @@ -0,0 +1,803 @@ +/* + * Chinese AVS video (AVS1-P2, JiZhun profile, frame and field) decoder. + * Chinese AVS video (AVS1-P16, GuanDian profile, frame and field) decoder. + * Copyright (c) 2013 + * + * This file is part of FFmpeg. + * + * FFmpeg 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.1 of the License, or (at your option) any later version. + * + * FFmpeg 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 FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#include "libavutil/avassert.h" +#include "libavutil/common.h" +#include "libavutil/imgutils.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "decode.h" +#include "internal.h" +#include "mpeg12data.h" +#include "mpegvideo.h" +#include "libcavs.h" +#include "startcode.h" + +#define SLICE_MAX_START_CODE 0x000001af +#define EXT_START_CODE 0x000001b5 +#define USER_START_CODE 0x000001b2 +#define CAVS_START_CODE 0x000001b0 +#define PIC_I_START_CODE 0x000001b3 +#define PIC_PB_START_CODE 0x000001b6 +#define VIDEO_EDIT_CODE 0x000001b7 + +#define A_AVAIL 1 +#define B_AVAIL 2 +#define C_AVAIL 4 +#define D_AVAIL 8 +#define NOT_AVAIL -1 +#define REF_INTRA -2 +#define REF_DIR -3 + +#define ESCAPE_CODE 59 + +#define FWD0 0x01 +#define FWD1 0x02 +#define BWD0 0x04 +#define BWD1 0x08 +#define SYM0 0x10 +#define SYM1 0x20 +#define SPLITH 0x40 +#define SPLITV 0x80 + +#define MV_BWD_OFFS 12 +#define MV_STRIDE 4 + +typedef struct AVSFrame { + AVFrame *f; + int poc; +} AVSFrame; + +typedef struct AVSContext { + AVCodecContext *avctx; + + uint8_t *buf; /* decode stream */ + int length; + void* p_decoder; /* decoder handle */ + int b_interlaced; /* 0:frame 1:field */ + cavs_param param; + int b_probe_flag; /* init as 0, when finish probe set to 1 */ + + AVSFrame cur; ///< currently decoded frame + AVSFrame DPB[2]; ///< reference frames + + int dist[2]; ///< temporal distances from current frame to ref frames + int low_delay; + int profile, level; + int aspect_ratio; + int mb_width, mb_height; + int width, height; + int stream_revision; ///<0 for samples from 2006, 1 for rm52j encoder + int progressive; + int pic_structure; + + int stc; ///< last start code + uint8_t *top_qp; + int got_keyframe; + int probe_keyframe; + + int output_type; /* mark type of output frame */ + int b_delay_frame; + int b_last_delay_frame; + + int last_frame_error; /* default 0 */ + int last_frame_type; +} AVSContext; + +int ff_libcavs_init(AVCodecContext *avctx); +int ff_libcavs_end (AVCodecContext *avctx); + +av_cold int ff_libcavs_init(AVCodecContext *avctx) { + AVSContext *h = avctx->priv_data; + int i_result; + + h->avctx = avctx; + avctx->pix_fmt= AV_PIX_FMT_YUV420P; + + h->cur.f = av_frame_alloc(); + h->DPB[0].f = av_frame_alloc(); + h->DPB[1].f = av_frame_alloc(); + + if (!h->cur.f || !h->DPB[0].f || !h->DPB[1].f) { + ff_libcavs_end(avctx); + return AVERROR(ENOMEM); + } + + /* creat decoder */ + h->param.b_accelerate = 1; + i_result = cavs_decoder_create( &h->p_decoder, &h->param ); + if( h->p_decoder == NULL || i_result != 0 ) + { + return -1; + } + + /*init multi-thread*/ + cavs_decoder_thread_param_init( h->p_decoder ); + + /* alloc buf for decode */ + h->buf = (unsigned char *)malloc(MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + memset(h->buf, 0, MAX_CODED_FRAME_SIZE*sizeof(unsigned char)); + + /* init probe flag */ + h->b_probe_flag = 0; + h->b_last_delay_frame = 0; + h->b_delay_frame = 0; + + h->last_frame_error= 0; + h->probe_keyframe = 0; + + return 0; +} + +av_cold int ff_libcavs_end(AVCodecContext *avctx) { + AVSContext *h = avctx->priv_data; + + av_frame_free(&h->cur.f); + av_frame_free(&h->DPB[0].f); + av_frame_free(&h->DPB[1].f); + + free( h->buf ); + cavs_decoder_destroy( h->p_decoder ); + cavs_decoder_buffer_end( &h->param ); + + return 0; +} + + + +/***************************************************************************** + * + * frame level + * + ****************************************************************************/ + +static int decoder_get_cur_frame( AVFrame *frame, cavs_param * param) +{ + int width; + int height; + int linesize; + int i; + uint8_t *dst_y, *dst_u, *dst_v; + uint8_t *p_yuv; + + width = param->seqsize.lWidth; + height = param->seqsize.lHeight; + + /* Y */ + dst_y = frame->data[0]; + p_yuv = param->p_out_yuv[0]; + linesize = frame->linesize[0]; + for( i = 0; i < height; i++ ) + { + memcpy( dst_y, p_yuv, width); + dst_y += linesize; + p_yuv += width; + } + + /* U */ + dst_u = frame->data[1]; + p_yuv = param->p_out_yuv[1]; + linesize = frame->linesize[1]; + for( i = 0; i < (height>>1); i++ ) + { + memcpy( dst_u, p_yuv, width>>1); + dst_u += linesize; + p_yuv += (width>>1); + } + + /* V */ + dst_v = frame->data[2]; + p_yuv = param->p_out_yuv[2]; + linesize = frame->linesize[2]; + for( i = 0; i < (height>>1); i++ ) + { + memcpy( dst_v, p_yuv, width>>1); + dst_v += linesize; + p_yuv += (width>>1); + } + + return 0; +} + +static int cavs_decode_pic(AVSContext *h, int *ret_val) +{ + int ret; + int i_result; + + if( h->param.b_accelerate ) + { + i_result = cavs_decode_one_frame( h->p_decoder, h->stc, &h->param, h->buf, h->length ); + av_frame_unref(h->cur.f); + + h->output_type = h->param.output_type; + switch( h->output_type ) + { + case 0: /* I-frame */ + h->output_type = AV_PICTURE_TYPE_I; + break; + case 1: /* P-frame */ + h->output_type = 1 + AV_PICTURE_TYPE_I; + break; + case 2: /* B-frame */ + h->output_type = 2 + AV_PICTURE_TYPE_I; + break; + default: + ; + } + + if( h->output_type == -1 && i_result == 0 ) + return 0; + + if ((ret = ff_get_buffer(h->avctx, h->cur.f, + h->output_type == AV_PICTURE_TYPE_B ? + 0 : AV_GET_BUFFER_FLAG_REF)) < 0) + return ret; + + /* set h->cur with decoded image */ + if( i_result == CAVS_FRAME_OUT ) + { + decoder_get_cur_frame( h->cur.f, &h->param ); + + if ( h->output_type != AV_PICTURE_TYPE_B ) + { + av_frame_unref(h->DPB[1].f); + FFSWAP(AVSFrame, h->cur, h->DPB[1]); + FFSWAP(AVSFrame, h->DPB[0], h->DPB[1]); + } + else /* B frame */ + { + decoder_get_cur_frame( h->cur.f, &h->param ); + } + } + } + else + { + i_result = cavs_decode_one_frame( h->p_decoder, h->stc, &h->param, h->buf, h->length ); + av_frame_unref(h->cur.f); + + if (h->stc == PIC_PB_START_CODE) { + h->cur.f->pict_type = cavs_decoder_cur_frame_type( h->p_decoder ) + AV_PICTURE_TYPE_I; + if (h->cur.f->pict_type > AV_PICTURE_TYPE_B) { + av_log(h->avctx, AV_LOG_ERROR, "illegal picture type\n"); + printf("illegal picture type\n"); + return -1; + } + } else { + h->cur.f->pict_type = AV_PICTURE_TYPE_I; + } + + if ((ret = ff_get_buffer(h->avctx, h->cur.f, + h->cur.f->pict_type == AV_PICTURE_TYPE_B ? + 0 : AV_GET_BUFFER_FLAG_REF)) < 0) + return ret; + + /* set h->cur with decoded image */ + if( i_result == CAVS_FRAME_OUT ) + { + decoder_get_cur_frame( h->cur.f, &h->param ); + + if (h->cur.f->pict_type != AV_PICTURE_TYPE_B) + { + av_frame_unref(h->DPB[1].f); + FFSWAP(AVSFrame, h->cur, h->DPB[1]); + FFSWAP(AVSFrame, h->DPB[0], h->DPB[1]); + } + else /* B frame */ + { + decoder_get_cur_frame( h->cur.f, &h->param ); + } + } + } + + *ret_val = i_result; + + return 0; +} + +/***************************************************************************** + * + * headers and interface + * + ****************************************************************************/ + +static int cavs_decode_seq_header(AVSContext *h) +{ + int frame_rate_code; + int width, height; + cavs_seq_info si; + + cavs_decoder_process( h->p_decoder, h->buf, h->length ); + + cavs_decoder_get_seq( h->p_decoder, &si); + + h->b_interlaced = si.b_interlaced; + h->profile = si.profile; + h->level = si.level; + width = si.lWidth; + height = si.lHeight; + if ((h->width || h->height) && (h->width != width || h->height != height)) { + avpriv_report_missing_feature(h->avctx, + "Width/height changing in BAVS"); + return AVERROR_PATCHWELCOME; + } + if (width <= 0 || height <= 0) { + av_log(h->avctx, AV_LOG_ERROR, "Dimensions invalid\n"); + return AVERROR_INVALIDDATA; + } + h->width = width; + h->height = height; + h->aspect_ratio = si.aspect_ratio; + frame_rate_code = si.frame_rate_code; + h->low_delay = si.low_delay; + h->mb_width = (h->width + 15) >> 4; + h->mb_height = (h->height + 15) >> 4; + h->avctx->time_base.den = ff_mpeg12_frame_rate_tab[frame_rate_code].num; + h->avctx->time_base.num = ff_mpeg12_frame_rate_tab[frame_rate_code].den; + h->avctx->width = h->width; + h->avctx->height = h->height; + + h->cur.f->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + h->DPB[0].f->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + h->DPB[1].f->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + + return 0; +} + +static int cavs_decode_extension_data(AVSContext *h) +{ + cavs_decoder_process( h->p_decoder, h->buf, h->length ); + + return 0; +} + +static void cavs_flush(AVCodecContext * avctx) +{ + AVSContext *h = avctx->priv_data; + h->got_keyframe = 0; +} + +static int cavs_decoder_param_init( AVSContext *h ) +{ + cavs_param *param = &h->param; + + //param->b_interlaced = h->b_interlaced; /* frame or field decision at probe stage */ + param->cpu = 0; + param->i_color_space = CAVS_CS_YUV420; /*only support 420*/ + //param->i_thread_model = 0; /* don't modify!! 1:multi-threads 0:single( new acceleration ) */ + param->i_thread_num = 64; /* don't modify!! at most */ + param->seqsize.lWidth = h->width; + param->seqsize.lHeight = h->height; + param->seqsize.lWidth = h->width; + param->seqsize.lHeight = h->height; + param->output_type = -1; /* -1 init, I-0, P-1 B-2 */ + + return 0; +} + +#define STREAM_DATA_MAX 3000000 + +static int cavs_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) +{ + AVSContext *h = avctx->priv_data; + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + uint32_t stc = -1; + int ret = 0; + uint8_t *buf_end; + uint8_t *buf_ptr; + int i_pass_idr = 0; + int b_delay_out = 0; + int i_first_adr = 0; + + /* probe frame or field decoded format */ + if( !h->b_probe_flag && buf_size != 0 ) /* first probe flag, when finish set it to 1 */ + { + uint8_t *p_buffer; + uint8_t *buf_cur, *buf_cur_end; + int probe_size; + int decode_size; + + probe_size = buf_size; + decode_size = probe_size; + + /* copy stream */ + p_buffer = (uint8_t*)malloc(buf_size); + + memcpy( p_buffer, buf, probe_size ); + + buf_cur = p_buffer; /* used to cal */ + buf_cur_end = buf_cur + probe_size; + + while( !h->b_probe_flag ) + { + buf_cur = (uint8_t*)avpriv_find_start_code((const uint8_t*)buf_cur, (const uint8_t*)buf_cur_end, &stc); + if ((stc & 0xFFFFFE00) || buf_cur == buf_cur_end) + { + return FFMAX(0, buf_cur - p_buffer); + } + + decode_size = buf_cur_end - buf_cur + 4; + + switch(stc) + { + case CAVS_START_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_cur - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + ret = cavs_decoder_probe_seq( h->p_decoder, h->buf, h->length ); + if(ret == CAVS_ERROR ) + { + break; + } + + break; + case PIC_I_START_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_cur - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + ret = cavs_decoder_pic_header( h->p_decoder, h->buf, h->length, &h->param, stc ); + if( ret == CAVS_ERROR ) + { + break; + } + cavs_decoder_set_format_type( h->p_decoder, &h->param ); + + /* finish probe flag */ + h->b_probe_flag = 1; + if(!h->probe_keyframe ) + { + h->probe_keyframe = 1; + } + + break; + + case PIC_PB_START_CODE: + if(!h->probe_keyframe ) + { + break; + } + cavs_decoder_init_stream( h->p_decoder, buf_cur - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + ret = cavs_decoder_pic_header( h->p_decoder, h->buf, h->length, &h->param, stc ); + if( ret == CAVS_ERROR ) + { + break; + } + cavs_decoder_set_format_type( h->p_decoder, &h->param ); + + /* finish probe flag */ + h->b_probe_flag = 1; + break; + + case EXT_START_CODE: + + cavs_decoder_init_stream( h->p_decoder, buf_cur - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + + cavs_decode_extension_data( h ); + + break; + + case USER_START_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_cur - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + + cavs_decode_extension_data( h ); + + break; + + case VIDEO_EDIT_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_cur - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + + break; + default: + if (stc <= SLICE_MAX_START_CODE) { + } + break; + } + } + + free(p_buffer); + } + + if (buf_size == 0) { + + if( h->param.b_accelerate ) + { + int ret = 0; + + /* when last frame is IDR */ + if(!h->b_last_delay_frame) + { + h->b_last_delay_frame = 1; + ret = cavs_decode_one_frame_delay( h->p_decoder, &h->param ); + + h->output_type = h->param.output_type; + + if( ret == CAVS_FRAME_OUT ) + { + + + av_frame_unref(h->cur.f); + if ((ret = ff_get_buffer(h->avctx, h->cur.f, + h->output_type == AV_PICTURE_TYPE_B ? + 0 : AV_GET_BUFFER_FLAG_REF)) < 0) + return ret; + + decoder_get_cur_frame( h->cur.f, &h->param ); + *got_frame = 1; + av_frame_move_ref(frame, h->cur.f); + + frame->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + + return 0; + } + } + } + + if (!h->low_delay && h->DPB[0].f->data[0]) { + if(cavs_out_delay_frame_end( h->p_decoder, h->param.p_out_yuv) ) + { + + decoder_get_cur_frame( h->DPB[0].f, &h->param ); + *got_frame = 1; + av_frame_move_ref(frame, h->DPB[0].f); + frame->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + } + } + + return 0; + } + + buf_ptr = (uint8_t*)buf; + buf_end = (uint8_t*)(buf + buf_size); + + for(;;) { + + int decode_size; + + if(!i_first_adr) + { + i_first_adr = 1; + } + + buf_ptr = (uint8_t*)avpriv_find_start_code((const uint8_t*)buf_ptr, (const uint8_t*)buf_end, &stc); + + if ((stc & 0xFFFFFE00) || buf_ptr == buf_end) + { + return FFMAX(0, buf_ptr - buf); + } + + decode_size = buf_end - buf_ptr + 4; + + switch (stc) { + case CAVS_START_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_ptr - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + cavs_decode_seq_header( h ); + + /* init h->param */ + cavs_decoder_param_init( h ); + + if( h->param.seq_header_flag == 0 ) + { + /* NOTE : must call at first seq header */ + cavs_decoder_seq_init( h->p_decoder, &h->param ); + + /* alloc frame for decoded yuv */ + if (cavs_decoder_buffer_init(&h->param) < 0) + break; + + h->param.seq_header_flag = 1; + } + else + { + if( h->param.b_accelerate ) + { + h->b_delay_frame = 0; // xun + if( h->last_frame_error ) + { + /* reset pipeline */ + cavs_decoder_seq_header_reset_pipeline( h->p_decoder ); + h->b_delay_frame = 0; + } + } +#if 0 //xun + else + { + //output final p frame if bframe num != 0 + if ( cavs_out_delay_frame( h->p_decoder, h->param.p_out_yuv) ) + { + b_delay_out = 1; /* will output this frame after current frame decoded */ + } + } +#endif + } + + if( h->last_frame_error ) /* error end */ + { + h->last_frame_error = 0; + } + break; + case PIC_I_START_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_ptr - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + if (!h->got_keyframe) { + av_frame_unref(h->DPB[0].f); + av_frame_unref(h->DPB[1].f); + h->got_keyframe = 1; + } + i_pass_idr = 1; + if( h->last_frame_error ) /* error end */ + { + h->last_frame_error = 0; + } + case PIC_PB_START_CODE: + if( !i_pass_idr ) + { + cavs_decoder_init_stream( h->p_decoder, buf_ptr - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + i_pass_idr = 0; + if( h->last_frame_error ) + { + *got_frame = 0; + return 0; + } + } + + *got_frame = 0; + if (!h->got_keyframe) + break; + h->stc = stc; +#if 0 + if (cavs_decode_pic(h, &ret)) + { + break; + } +#else + cavs_decode_pic(h, &ret); + if( ret == CAVS_ERROR ) + { + h->last_frame_error = 1; + h->got_keyframe = 0; + break; + } + +#endif + if( ret == CAVS_FRAME_OUT ) + { + *got_frame = 1; + } + + if( h->param.b_accelerate ) /* output frame according to reconstructed order */ + { + if( h->output_type != AV_PICTURE_TYPE_B ) + { + if (h->DPB[0].f->data[0] && *got_frame == 1) + { + if ((ret = av_frame_ref(frame, h->DPB[0].f)) < 0) + { + return ret; + } + frame->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + } + else + { + { + *got_frame = 0; + } + } + } + else /* B-frame, output */ + { + if(h->output_type == AV_PICTURE_TYPE_B && *got_frame == 1) + { + av_frame_move_ref(frame, h->cur.f); + frame->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + } + } + } + else + { + if (h->cur.f->pict_type != AV_PICTURE_TYPE_B) + { + if (h->DPB[0].f->data[0] && *got_frame == 1) + { + if ((ret = av_frame_ref(frame, h->DPB[0].f)) < 0) + { + return ret; + } + frame->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + } + else + { + if( b_delay_out ) + { + b_delay_out = 0; + + /* set h->cur.f */ + decoder_get_cur_frame( h->cur.f, &h->param ); + + *got_frame = 1; + av_frame_move_ref(frame, h->cur.f); + frame->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + } + else + { + *got_frame = 0; + } + } + } + else /* B-frame, output */ + { + if(*got_frame == 1) + { + av_frame_move_ref(frame, h->cur.f); + frame->flags = h->b_interlaced ? AV_FRAME_FLAG_INTERLACED : 0; + } + } + } + + break; + case EXT_START_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_ptr - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + + cavs_decode_extension_data( h ); + + break; + case USER_START_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_ptr - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + + cavs_decode_extension_data( h ); + + break; + + case VIDEO_EDIT_CODE: + cavs_decoder_init_stream( h->p_decoder, buf_ptr - 4, decode_size); + cavs_decoder_get_one_nal( h->p_decoder, h->buf, &h->length ); + + break; + default: + if (stc <= SLICE_MAX_START_CODE) { + } + break; + } + } +} + +const FFCodec ff_cavs_decoder = { + .p.name = "cavs", + .p.long_name = NULL_IF_CONFIG_SMALL("Chinese AVS (Audio Video Standard) (AVS1-P2, JiZhun profile) and (AVS1-P16, Guangdian profile)"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_CAVS, + .priv_data_size = sizeof(AVSContext), + .init = ff_libcavs_init, + .close = ff_libcavs_end, + FF_CODEC_DECODE_CB(cavs_decode_frame), + .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, + .caps_internal = FF_CODEC_CAP_AUTO_THREADS, + .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE }, + .flush = cavs_flush, +}; diff -Naur ./ffmpeg-7.1.2/libavcodec/libdradec.c ./ffmpeg-7.1.2_cavs_dra/libavcodec/libdradec.c --- ./ffmpeg-7.1.2/libavcodec/libdradec.c 1970-01-01 08:00:00.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/libdradec.c 2026-01-22 20:45:57.963637000 +0800 @@ -0,0 +1,177 @@ +#include +#include +#include +#include +#include +#include +#include "avcodec.h" +#include "codec_internal.h" +#include "decode.h" +#include "internal.h" + +#include "dradec.h" + +#define __min(a,b) (((a) < (b)) ? (a) : (b)) + +typedef struct DRAContext +{ + void *pDRADecoder; +}DRAContext; + +static av_cold int dra_decode_init(AVCodecContext *avctx) +{ + struct DRAContext *s = avctx->priv_data; + + avctx->frame_size = 1024; + av_channel_layout_default(&avctx->ch_layout, 2); + avctx->sample_fmt = AV_SAMPLE_FMT_S16; + + s->pDRADecoder = DRADecCreate(); + if(s->pDRADecoder == NULL) + { + return 1; + } + + return 0; +} + +static int dra_decode_frame(AVCodecContext *avctx, AVFrame *data, + int *got_frame_ptr, AVPacket *avpkt) +{ + int ret = 0; + + uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + AVFrame *frame = data; + int dec_len = 0; + DRAFrameInfo dra_frame_info; + + struct DRAContext *s = avctx->priv_data; + + unsigned char *pcm_data = NULL; + int pcm_len = 0; + + *got_frame_ptr = 0; + + if(buf == NULL || buf_size == 0) + { + ret = DRADecRecvFrame(s->pDRADecoder, &pcm_data, &pcm_len); + if(ret == 0) + { + DRADecGetFrameInfo(s->pDRADecoder, &dra_frame_info); + avctx->sample_rate = dra_frame_info.nSampleRate; + av_channel_layout_default(&avctx->ch_layout, dra_frame_info.nChannels); + if(avctx->ch_layout.nb_channels != 0) + { + avctx->frame_size = pcm_len / (avctx->ch_layout.nb_channels * 2); + } + + frame->ch_layout = avctx->ch_layout; + frame->sample_rate = avctx->sample_rate; + frame->nb_samples = avctx->frame_size; + frame->format = avctx->sample_fmt; + + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + + memcpy(frame->data[0], pcm_data, pcm_len); + + *got_frame_ptr = 1; + } + dec_len = buf_size; + } + else + { + ret = DRADecRecvFrame(s->pDRADecoder, &pcm_data, &pcm_len); + if(ret == 0) + { + DRADecGetFrameInfo(s->pDRADecoder, &dra_frame_info); + avctx->sample_rate = dra_frame_info.nSampleRate; + av_channel_layout_default(&avctx->ch_layout, dra_frame_info.nChannels); + if(avctx->ch_layout.nb_channels != 0) + { + avctx->frame_size = pcm_len / (avctx->ch_layout.nb_channels * 2); + } + + frame->ch_layout = avctx->ch_layout; + frame->sample_rate = avctx->sample_rate; + frame->nb_samples = avctx->frame_size; + frame->format = avctx->sample_fmt; + + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + + memcpy(frame->data[0], pcm_data, pcm_len); + + *got_frame_ptr = 1; + + dec_len = 0; + } + else + { + ret = DRADecSendData(s->pDRADecoder, buf, buf_size); + if(ret != 0) + { + return AVERROR(AVERROR_BUG); + } + + ret = DRADecRecvFrame(s->pDRADecoder, &pcm_data, &pcm_len); + if(ret == 0) + { + DRADecGetFrameInfo(s->pDRADecoder, &dra_frame_info); + avctx->sample_rate = dra_frame_info.nSampleRate; + av_channel_layout_default(&avctx->ch_layout, dra_frame_info.nChannels); + if(avctx->ch_layout.nb_channels != 0) + { + avctx->frame_size = pcm_len / (avctx->ch_layout.nb_channels * 2); + } + + frame->ch_layout = avctx->ch_layout; + + frame->ch_layout = avctx->ch_layout; + frame->sample_rate = avctx->sample_rate; + frame->nb_samples = avctx->frame_size; + frame->format = avctx->sample_fmt; + + if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) + return ret; + + memcpy(frame->data[0], pcm_data, pcm_len); + + *got_frame_ptr = 1; + } + + dec_len = buf_size; + } + } + + return dec_len; +} + +static av_cold int dra_decode_end(AVCodecContext *avctx) +{ + struct DRAContext *s = avctx->priv_data; + + if(s->pDRADecoder) + { + DRADecDestroy(s->pDRADecoder); + s->pDRADecoder = NULL; + } + + return 0; +} + +const FFCodec ff_libdra_decoder = { + .p.name = "libdra", + .p.long_name = NULL_IF_CONFIG_SMALL("dra audio decoder"), + .p.type = AVMEDIA_TYPE_AUDIO, + .p.id = AV_CODEC_ID_DRA, + .priv_data_size = sizeof(DRAContext), + .init = dra_decode_init, + .close = dra_decode_end, + FF_CODEC_DECODE_CB(dra_decode_frame), + .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, + .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, + AV_SAMPLE_FMT_NONE }, +}; diff -Naur ./ffmpeg-7.1.2/libavcodec/Makefile ./ffmpeg-7.1.2_cavs_dra/libavcodec/Makefile --- ./ffmpeg-7.1.2/libavcodec/Makefile 2025-09-15 03:20:09.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavcodec/Makefile 2026-01-22 20:42:51.591431300 +0800 @@ -108,7 +108,7 @@ h2645data.o h2645_parse.o h2645_vui.o OBJS-$(CONFIG_H264PRED) += h264pred.o OBJS-$(CONFIG_H264QPEL) += h264qpel.o -OBJS-$(CONFIG_H264_SEI) += h264_sei.o h2645_sei.o aom_film_grain.o +OBJS-$(CONFIG_H264_SEI) += h264_sei.o h2645_sei.o OBJS-$(CONFIG_HEVCPARSE) += h2645data.o h2645_parse.o h2645_vui.o OBJS-$(CONFIG_HEVC_SEI) += h2645_sei.o aom_film_grain.o \ dynamic_hdr_vivid.o @@ -289,8 +289,7 @@ OBJS-$(CONFIG_BONK_DECODER) += bonk.o OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o OBJS-$(CONFIG_C93_DECODER) += c93.o -OBJS-$(CONFIG_CAVS_DECODER) += cavs.o cavsdec.o cavsdsp.o \ - cavsdata.o +OBJS-$(CONFIG_CAVS_DECODER) += libcavsdec.o libcavs.o OBJS-$(CONFIG_CBD2_DPCM_DECODER) += dpcm.o OBJS-$(CONFIG_CCAPTION_DECODER) += ccaption_dec.o ass.o OBJS-$(CONFIG_CDGRAPHICS_DECODER) += cdgraphics.o @@ -1173,6 +1172,7 @@ OBJS-$(CONFIG_LIBXEVE_ENCODER) += libxeve.o OBJS-$(CONFIG_LIBXVID_ENCODER) += libxvid.o OBJS-$(CONFIG_LIBZVBI_TELETEXT_DECODER) += libzvbi-teletextdec.o ass.o +OBJS-$(CONFIG_LIBDRA_DECODER) += libdradec.o dradec.o # parsers OBJS-$(CONFIG_AAC_LATM_PARSER) += latm_parser.o diff -Naur ./ffmpeg-7.1.2/libavformat/mpegts.c ./ffmpeg-7.1.2_cavs_dra/libavformat/mpegts.c --- ./ffmpeg-7.1.2/libavformat/mpegts.c 2025-09-15 03:20:04.000000000 +0800 +++ ./ffmpeg-7.1.2_cavs_dra/libavformat/mpegts.c 2025-08-05 12:24:03.601886500 +0800 @@ -876,6 +876,7 @@ { MKTAG('I', 'D', '3', ' '), AVMEDIA_TYPE_DATA, AV_CODEC_ID_TIMED_ID3 }, { MKTAG('V', 'C', '-', '1'), AVMEDIA_TYPE_VIDEO, AV_CODEC_ID_VC1 }, { MKTAG('O', 'p', 'u', 's'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_OPUS }, + { MKTAG('D', 'R', 'A', '1'), AVMEDIA_TYPE_AUDIO, AV_CODEC_ID_DRA }, { 0 }, };