Imported Upstream version 0.72.3

This commit is contained in:
TANIGUCHI Takaki
2012-03-06 11:08:15 +09:00
parent 205701b3de
commit 30255c97b3
713 changed files with 13953 additions and 28840 deletions

View File

@@ -1,5 +1,5 @@
/* dvdisaster: Additional error correction for optical media.
* Copyright (C) 2004-2010 Carsten Gnoerlich.
* Copyright (C) 2004-2011 Carsten Gnoerlich.
* Project home page: http://www.dvdisaster.com
* Email: carsten@dvdisaster.com -or- cgnoerlich@fsfe.org
*
@@ -56,44 +56,6 @@ int ProbeSSE2(void)
}
}
void encode_next_layer_sse2(ReedSolomonTables *rt, unsigned char *data, unsigned char *parity, guint64 layer_size, int shift)
{ gint32 *gf_index_of = rt->gfTables->indexOf;
gint32 *enc_alpha_to = rt->gfTables->encAlphaTo;
gint32 *rs_gpoly = rt->gpoly;
int nroots = rt->nroots;
int nroots_aligned = (nroots+15)&~15;
int nroots_full = nroots_aligned>>4;
int i,j;
for(i=0; i<layer_size; i++)
{ int feedback = gf_index_of[data[i] ^ parity[shift]];
int offset = nroots-shift-1;
if(feedback != GF_ALPHA0) /* non-zero feedback term */
{ guint8 *par_idx = (guint8*)parity;
guint8 *e_lut = rt->bLut[feedback]+offset;
__m128i par, lut, out;
/* Process lut in 128 bit steps */
for(j=nroots_full; j; j--)
{
par = _mm_load_si128((__m128i*)par_idx);
lut = _mm_loadu_si128((__m128i*)e_lut);
out = _mm_xor_si128(par, lut);
_mm_store_si128((__m128i*)par_idx, out);
par_idx += 16;
e_lut += 16;
}
parity[shift] = enc_alpha_to[feedback + rs_gpoly[0]];
}
else /* zero feedback term */
parity[shift] = 0;
parity += nroots_aligned;
}
}
#else /* don't have SSE2 */
/* Stub functions to keep the linker happy.
* Should never be executed.
@@ -102,10 +64,5 @@ void encode_next_layer_sse2(ReedSolomonTables *rt, unsigned char *data, unsigned
int ProbeSSE2()
{ return 0;
}
void encode_next_layer_sse2(ReedSolomonTables *rt, unsigned char *data, unsigned char *parity, guint64 layer_size, int shift)
{
Stop("Mega borkage - EncodeNextLayerSSE2() stub called.\n");
}
#endif /* HAVE_SSE2 */