Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flac
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Strogin
flac
Commits
5579f292
Commit
5579f292
authored
Apr 30, 2018
by
Robert Kausch
Committed by
Erik de Castro Lopo
May 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement slicing-by-8 CRC16 algorithm.
parent
fed5ad42
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
274 additions
and
10 deletions
+274
-10
src/libFLAC/crc.c
src/libFLAC/crc.c
+270
-6
src/libFLAC/include/private/crc.h
src/libFLAC/include/private/crc.h
+4
-4
No files found.
src/libFLAC/crc.c
View file @
5579f292
This diff is collapsed.
Click to expand it.
src/libFLAC/include/private/crc.h
View file @
5579f292
...
...
@@ -45,14 +45,14 @@ FLAC__uint8 FLAC__crc8(const FLAC__byte *data, uint32_t len);
** polynomial = x^16 + x^15 + x^2 + x^0
** init = 0
*/
extern
uint32_t
const
FLAC__crc16_table
[
256
];
extern
FLAC__uint16
const
FLAC__crc16_table
[
8
]
[
256
];
#define FLAC__CRC16_UPDATE(data, crc) ((((crc)<<8) & 0xffff) ^ FLAC__crc16_table[((crc)>>8) ^ (data)])
#define FLAC__CRC16_UPDATE(data, crc) ((((crc)<<8) & 0xffff) ^ FLAC__crc16_table[
0][
((crc)>>8) ^ (data)])
/* this alternate may be faster on some systems/compilers */
#if 0
#define FLAC__CRC16_UPDATE(data, crc) ((((crc)<<8) ^ FLAC__crc16_table[((crc)>>8) ^ (data)]) & 0xffff)
#define FLAC__CRC16_UPDATE(data, crc) ((((crc)<<8) ^ FLAC__crc16_table[
0][
((crc)>>8) ^ (data)]) & 0xffff)
#endif
uint32_t
FLAC__crc16
(
const
FLAC__byte
*
data
,
uint32_t
len
);
FLAC__uint16
FLAC__crc16
(
const
FLAC__byte
*
data
,
uint32_t
len
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment