Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
b4dc6dcc
Commit
b4dc6dcc
authored
12 years ago
by
Anton Khirnov
Browse files
Options
Downloads
Patches
Plain Diff
crc: move doxy to the header
parent
b68aac7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavutil/crc.c
+0
-28
0 additions, 28 deletions
libavutil/crc.c
libavutil/crc.h
+30
-0
30 additions, 0 deletions
libavutil/crc.h
with
30 additions
and
28 deletions
libavutil/crc.c
+
0
−
28
View file @
b4dc6dcc
...
...
@@ -40,22 +40,6 @@ static struct {
static
AVCRC
av_crc_table
[
AV_CRC_MAX
][
257
];
#endif
/**
* Initialize a CRC table.
* @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
* @param le If 1, the lowest bit represents the coefficient for the highest
* exponent of the corresponding polynomial (both for poly and
* actual CRC).
* If 0, you must swap the CRC parameter and the result of av_crc
* if you need the standard representation (can be simplified in
* most cases to e.g. bswap16):
* av_bswap32(crc << (32-bits))
* @param bits number of bits for the CRC
* @param poly generator polynomial without the x**bits coefficient, in the
* representation as specified by le
* @param ctx_size size of ctx in bytes
* @return <0 on failure
*/
int
av_crc_init
(
AVCRC
*
ctx
,
int
le
,
int
bits
,
uint32_t
poly
,
int
ctx_size
)
{
unsigned
i
,
j
;
...
...
@@ -89,11 +73,6 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size)
return
0
;
}
/**
* Get an initialized standard CRC table.
* @param crc_id ID of a standard CRC
* @return a pointer to the CRC table or NULL on failure
*/
const
AVCRC
*
av_crc_get_table
(
AVCRCId
crc_id
)
{
#if !CONFIG_HARDCODED_TABLES
...
...
@@ -108,13 +87,6 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id)
return
av_crc_table
[
crc_id
];
}
/**
* Calculate the CRC of a block.
* @param crc CRC of previous blocks if any or initial value for CRC
* @return CRC updated with the data from the given block
*
* @see av_crc_init() "le" parameter
*/
uint32_t
av_crc
(
const
AVCRC
*
ctx
,
uint32_t
crc
,
const
uint8_t
*
buffer
,
size_t
length
)
{
...
...
This diff is collapsed.
Click to expand it.
libavutil/crc.h
+
30
−
0
View file @
b4dc6dcc
...
...
@@ -36,8 +36,38 @@ typedef enum {
AV_CRC_MAX
,
/*< Not part of public API! Do not use outside libavutil. */
}
AVCRCId
;
/**
* Initialize a CRC table.
* @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
* @param le If 1, the lowest bit represents the coefficient for the highest
* exponent of the corresponding polynomial (both for poly and
* actual CRC).
* If 0, you must swap the CRC parameter and the result of av_crc
* if you need the standard representation (can be simplified in
* most cases to e.g. bswap16):
* av_bswap32(crc << (32-bits))
* @param bits number of bits for the CRC
* @param poly generator polynomial without the x**bits coefficient, in the
* representation as specified by le
* @param ctx_size size of ctx in bytes
* @return <0 on failure
*/
int
av_crc_init
(
AVCRC
*
ctx
,
int
le
,
int
bits
,
uint32_t
poly
,
int
ctx_size
);
/**
* Get an initialized standard CRC table.
* @param crc_id ID of a standard CRC
* @return a pointer to the CRC table or NULL on failure
*/
const
AVCRC
*
av_crc_get_table
(
AVCRCId
crc_id
);
/**
* Calculate the CRC of a block.
* @param crc CRC of previous blocks if any or initial value for CRC
* @return CRC updated with the data from the given block
*
* @see av_crc_init() "le" parameter
*/
uint32_t
av_crc
(
const
AVCRC
*
ctx
,
uint32_t
start_crc
,
const
uint8_t
*
buffer
,
size_t
length
)
av_pure
;
#endif
/* AVUTIL_CRC_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment