2 * Provides routines for encoding and decoding the extended Golay
5 * This implementation will detect up to 4 errors in a codeword (without
6 * being able to correct them); it will correct up to 3 errors.
8 * We use uint32_t to hold the 24-bit codewords, with the data part in
9 * the bottom 12 bits and the parity in bits 12-23.
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * SPDX-License-Identifier: GPL-2.0-or-later
23 #include "ws_symbol_export.h"
25 /* encodes a 12-bit word to a 24-bit codeword
28 uint32_t golay_encode(unsigned w
);
30 /* return a mask showing the bits which are in error in a received
31 * 24-bit codeword, or -1 if 4 errors were detected.
34 int32_t golay_errors(uint32_t codeword
);
36 /* decode a received codeword. Up to 3 errors are corrected for; 4
37 errors are detected as uncorrectable (return -1); 5 or more errors
38 cause an incorrect correction.
41 int golay_decode(uint32_t w
);
51 * indent-tabs-mode: nil
54 * ex: set shiftwidth=4 tabstop=8 expandtab:
55 * :indentSize=4:tabSize=8:noTabs=true: