Lines Matching refs:FragDecoder

240 static FragDecoder_t FragDecoder;  variable
249 FragDecoder.Callbacks = callbacks; in FragDecoderInit()
251 FragDecoder.File = file; in FragDecoderInit()
252 FragDecoder.FileSize = fileSize; in FragDecoderInit()
254 FragDecoder.FragNb = fragNb; // FragNb = FRAG_MAX_SIZE in FragDecoderInit()
255 FragDecoder.FragSize = fragSize; // number of byte on a row in FragDecoderInit()
256 FragDecoder.Status.FragNbLastRx = 0; in FragDecoderInit()
257 FragDecoder.Status.FragNbLost = 0; in FragDecoderInit()
258 FragDecoder.M2BLine = 0; in FragDecoderInit()
263 FragDecoder.FragNbMissingIndex[i] = 1; in FragDecoderInit()
269 FragDecoder.S[i] = 0; in FragDecoderInit()
274 FragDecoder.MatrixM2B[i] = 0xFF; in FragDecoderInit()
281 … if( ( FragDecoder.Callbacks != NULL ) && ( FragDecoder.Callbacks->FragDecoderWrite != NULL ) ) in FragDecoderInit()
284 FragDecoder.Callbacks->FragDecoderWrite( i, buffer, 1 ); in FragDecoderInit()
287 FragDecoder.File[i] = 0xFF; in FragDecoderInit()
290 FragDecoder.Status.FragNbLost = 0; in FragDecoderInit()
291 FragDecoder.Status.FragNbLastRx = 0; in FragDecoderInit()
317 FragDecoder.Status.FragNbRx = fragCounter; in FragDecoderProcess()
319 if( fragCounter < FragDecoder.Status.FragNbLastRx ) in FragDecoderProcess()
326 if( fragCounter < ( FragDecoder.FragNb + 1 ) ) in FragDecoderProcess()
330 SetRow( rawData, fragCounter - 1, FragDecoder.FragSize ); in FragDecoderProcess()
332 SetRow( FragDecoder.File, rawData, fragCounter - 1, FragDecoder.FragSize ); in FragDecoderProcess()
335 FragDecoder.FragNbMissingIndex[fragCounter - 1] = 0; in FragDecoderProcess()
340 if( ( FragDecoder.Status.FragNbLost == 0 ) && ( fragCounter == FragDecoder.FragNb ) ) in FragDecoderProcess()
343 return FragDecoder.Status.FragNbLost; in FragDecoderProcess()
348 if( FragDecoder.Status.FragNbLost > FRAG_MAX_REDUNDANCY ) in FragDecoderProcess()
350 FragDecoder.Status.MatrixError = 1; in FragDecoderProcess()
360 FragGetParityMatrixRow( fragCounter - FragDecoder.FragNb, FragDecoder.FragNb, matrixRow ); in FragDecoderProcess()
362 for( int32_t i = 0; i < FragDecoder.FragNb; i++ ) in FragDecoderProcess()
366 if( FragDecoder.FragNbMissingIndex[i] == 0 ) in FragDecoderProcess()
371 GetRow( matrixDataTemp, i, FragDecoder.FragSize ); in FragDecoderProcess()
373 GetRow( matrixDataTemp, FragDecoder.File, i, FragDecoder.FragSize ); in FragDecoderProcess()
375 XorDataLine( rawData, matrixDataTemp, FragDecoder.FragSize ); in FragDecoderProcess()
380 SetParity( FragDecoder.FragNbMissingIndex[i] - 1, dataTempVector, 1 ); in FragDecoderProcess()
389 firstOneInRow = BitArrayFindFirstOne( dataTempVector, FragDecoder.Status.FragNbLost ); in FragDecoderProcess()
397 while( GetParity( firstOneInRow, FragDecoder.S ) == 1 ) in FragDecoderProcess()
400 … FragExtractLineFromBinaryMatrix( dataTempVector2, firstOneInRow, FragDecoder.Status.FragNbLost ); in FragDecoderProcess()
401 XorParityLine( dataTempVector, dataTempVector2, FragDecoder.Status.FragNbLost ); in FragDecoderProcess()
405 GetRow( matrixDataTemp, li, FragDecoder.FragSize ); in FragDecoderProcess()
407 GetRow( matrixDataTemp, FragDecoder.File, li, FragDecoder.FragSize ); in FragDecoderProcess()
409 XorDataLine( rawData, matrixDataTemp, FragDecoder.FragSize ); in FragDecoderProcess()
410 if( BitArrayIsAllZeros( dataTempVector, FragDecoder.Status.FragNbLost ) ) in FragDecoderProcess()
415 … firstOneInRow = BitArrayFindFirstOne( dataTempVector, FragDecoder.Status.FragNbLost ); in FragDecoderProcess()
420 … FragPushLineToBinaryMatrix( dataTempVector, firstOneInRow, FragDecoder.Status.FragNbLost ); in FragDecoderProcess()
423 SetRow( rawData, li, FragDecoder.FragSize ); in FragDecoderProcess()
425 SetRow( FragDecoder.File, rawData, li, FragDecoder.FragSize ); in FragDecoderProcess()
427 SetParity( firstOneInRow, FragDecoder.S, 1 ); in FragDecoderProcess()
428 FragDecoder.M2BLine++; in FragDecoderProcess()
431 if( FragDecoder.M2BLine == FragDecoder.Status.FragNbLost ) in FragDecoderProcess()
434 if( FragDecoder.Status.FragNbLost > 1 ) in FragDecoderProcess()
438 for( i = ( FragDecoder.Status.FragNbLost - 2 ); i >= 0 ; i-- ) in FragDecoderProcess()
442 GetRow( matrixDataTemp, li, FragDecoder.FragSize ); in FragDecoderProcess()
444 GetRow( matrixDataTemp, FragDecoder.File, li, FragDecoder.FragSize ); in FragDecoderProcess()
446 for( j = ( FragDecoder.Status.FragNbLost - 1 ); j > i; j--) in FragDecoderProcess()
448 … FragExtractLineFromBinaryMatrix( dataTempVector2, i, FragDecoder.Status.FragNbLost ); in FragDecoderProcess()
449 … FragExtractLineFromBinaryMatrix( dataTempVector, j, FragDecoder.Status.FragNbLost ); in FragDecoderProcess()
452 … XorParityLine( dataTempVector2, dataTempVector, FragDecoder.Status.FragNbLost ); in FragDecoderProcess()
457 GetRow( rawData, lj, FragDecoder.FragSize ); in FragDecoderProcess()
459 GetRow( rawData, FragDecoder.File, lj, FragDecoder.FragSize ); in FragDecoderProcess()
461 XorDataLine( matrixDataTemp , rawData , FragDecoder.FragSize ); in FragDecoderProcess()
465 SetRow( matrixDataTemp, li, FragDecoder.FragSize ); in FragDecoderProcess()
467 SetRow( FragDecoder.File, matrixDataTemp, li, FragDecoder.FragSize ); in FragDecoderProcess()
470 return FragDecoder.Status.FragNbLost; in FragDecoderProcess()
475 return FragDecoder.Status.FragNbLost; in FragDecoderProcess()
485 return FragDecoder.Status; in FragDecoderGetStatus()
497 if( ( FragDecoder.Callbacks != NULL ) && ( FragDecoder.Callbacks->FragDecoderWrite != NULL ) ) in SetRow()
499 FragDecoder.Callbacks->FragDecoderWrite( row * size, src, size ); in SetRow()
505 if( ( FragDecoder.Callbacks != NULL ) && ( FragDecoder.Callbacks->FragDecoderRead != NULL ) ) in GetRow()
507 FragDecoder.Callbacks->FragDecoderRead( row * size, dst, size ); in GetRow()
642 for( i = FragDecoder.Status.FragNbLastRx; i < ( counter - 1 ); i++ ) in FragFindMissingFrags()
644 if( i < FragDecoder.FragNb ) in FragFindMissingFrags()
646 FragDecoder.Status.FragNbLost++; in FragFindMissingFrags()
647 FragDecoder.FragNbMissingIndex[i] = FragDecoder.Status.FragNbLost; in FragFindMissingFrags()
650 if( i < FragDecoder.FragNb ) in FragFindMissingFrags()
652 FragDecoder.Status.FragNbLastRx = counter; in FragFindMissingFrags()
656 FragDecoder.Status.FragNbLastRx = FragDecoder.FragNb + 1; in FragFindMissingFrags()
658 DBG( "RECEIVED : %5d / %5d Fragments\n", FragDecoder.Status.FragNbRx, FragDecoder.FragNb ); in FragFindMissingFrags()
659 … %5d / %5d Bytes\n", FragDecoder.Status.FragNbRx * FragDecoder.FragSize, FragDecoder.… in FragFindMissingFrags()
660 DBG( "LOST : %7d Fragments\n\n", FragDecoder.Status.FragNbLost ); in FragFindMissingFrags()
672 for( uint16_t i = 0; i < FragDecoder.FragNb; i++ ) in FragFindMissingIndex()
674 if( FragDecoder.FragNbMissingIndex[i] == ( x + 1 ) ) in FragFindMissingIndex()
710 ( FragDecoder.MatrixM2B[findByte] >> ( 7 - findBitInByte ) ) & 0x01 ); in FragExtractLineFromBinaryMatrix()
742FragDecoder.MatrixM2B[findByte] = FragDecoder.MatrixM2B[findByte] & ( 0xFF - ( 1 << ( 7 - findBitI… in FragPushLineToBinaryMatrix()