Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

ZXReedSolomonDecoder.h 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2012 ZXing authors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. @class ZXGenericGF, ZXIntArray;
  17. /**
  18. * Implements Reed-Solomon decoding, as the name implies.
  19. *
  20. * The algorithm will not be explained here, but the following references were helpful
  21. * in creating this implementation:
  22. *
  23. * Bruce Maggs.
  24. * http://www.cs.cmu.edu/afs/cs.cmu.edu/project/pscico-guyb/realworld/www/rs_decode.ps
  25. * "Decoding Reed-Solomon Codes" (see discussion of Forney's Formula)
  26. *
  27. * J.I. Hall. www.mth.msu.edu/~jhall/classes/codenotes/GRS.pdf
  28. * "Chapter 5. Generalized Reed-Solomon Codes"
  29. * (see discussion of Euclidean algorithm)
  30. *
  31. * Much credit is due to William Rucklidge since portions of this code are an indirect
  32. * port of his C++ Reed-Solomon implementation.
  33. */
  34. @interface ZXReedSolomonDecoder : NSObject
  35. - (id)initWithField:(ZXGenericGF *)field;
  36. /**
  37. * Decodes given set of received codewords, which include both data and error-correction
  38. * codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place,
  39. * in the input.
  40. *
  41. * @param received data and error-correction codewords
  42. * @param twoS number of error-correction codewords available
  43. * @return NO if decoding fails for any reason
  44. */
  45. - (BOOL)decode:(ZXIntArray *)received twoS:(int)twoS error:(NSError **)error;
  46. @end