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 guint32s 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
21 #include "ws_symbol_export.h"
23 /* encodes a 12-bit word to a 24-bit codeword
26 guint32 golay_encode(guint w);
28 /* return a mask showing the bits which are in error in a received
29 * 24-bit codeword, or -1 if 4 errors were detected.
32 gint32 golay_errors(guint32 codeword);
34 /* decode a received codeword. Up to 3 errors are corrected for; 4
35 errors are detected as uncorrectable (return -1); 5 or more errors
36 cause an incorrect correction.
39 gint golay_decode(guint32 w);
49 * indent-tabs-mode: nil
52 * ex: set shiftwidth=4 tabstop=8 expandtab:
53 * :indentSize=4:tabSize=8:noTabs=true: