Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
8491f405
Commit
8491f405
authored
Jun 04, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tak: use crc table from lavu
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
410192e3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
27 deletions
+1
-27
tak.c
libavcodec/tak.c
+1
-17
tak.h
libavcodec/tak.h
+0
-2
tak_parser.c
libavcodec/tak_parser.c
+0
-7
takdec.c
libavcodec/takdec.c
+0
-1
No files found.
libavcodec/tak.c
View file @
8491f405
...
...
@@ -72,22 +72,6 @@ static int tak_get_nb_samples(int sample_rate, enum TAKFrameSizeType type)
return
nb_samples
;
}
static
int
crc_init
=
0
;
#if CONFIG_SMALL
#define CRC_TABLE_SIZE 257
#else
#define CRC_TABLE_SIZE 1024
#endif
static
AVCRC
crc_24
[
CRC_TABLE_SIZE
];
av_cold
void
ff_tak_init_crc
(
void
)
{
if
(
!
crc_init
)
{
av_crc_init
(
crc_24
,
0
,
24
,
0x864CFBU
,
sizeof
(
crc_24
));
crc_init
=
1
;
}
}
int
ff_tak_check_crc
(
const
uint8_t
*
buf
,
unsigned
int
buf_size
)
{
uint32_t
crc
,
CRC
;
...
...
@@ -97,7 +81,7 @@ int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size)
buf_size
-=
3
;
CRC
=
AV_RB24
(
buf
+
buf_size
);
crc
=
av_crc
(
crc_24
,
0xCE04B7U
,
buf
,
buf_size
);
crc
=
av_crc
(
av_crc_get_table
(
AV_CRC_24_IEEE
)
,
0xCE04B7U
,
buf
,
buf_size
);
if
(
CRC
!=
crc
)
return
AVERROR_INVALIDDATA
;
...
...
libavcodec/tak.h
View file @
8491f405
...
...
@@ -140,8 +140,6 @@ typedef struct TAKStreamInfo {
int64_t
samples
;
}
TAKStreamInfo
;
void
ff_tak_init_crc
(
void
);
int
ff_tak_check_crc
(
const
uint8_t
*
buf
,
unsigned
int
buf_size
);
/**
...
...
libavcodec/tak_parser.c
View file @
8491f405
...
...
@@ -33,12 +33,6 @@ typedef struct TAKParseContext {
int
index
;
}
TAKParseContext
;
static
av_cold
int
tak_init
(
AVCodecParserContext
*
s
)
{
ff_tak_init_crc
();
return
0
;
}
static
int
tak_parse
(
AVCodecParserContext
*
s
,
AVCodecContext
*
avctx
,
const
uint8_t
**
poutbuf
,
int
*
poutbuf_size
,
const
uint8_t
*
buf
,
int
buf_size
)
...
...
@@ -123,7 +117,6 @@ found:
AVCodecParser
ff_tak_parser
=
{
.
codec_ids
=
{
AV_CODEC_ID_TAK
},
.
priv_data_size
=
sizeof
(
TAKParseContext
),
.
parser_init
=
tak_init
,
.
parser_parse
=
tak_parse
,
.
parser_close
=
ff_parse_close
,
};
libavcodec/takdec.c
View file @
8491f405
...
...
@@ -171,7 +171,6 @@ static av_cold int tak_decode_init(AVCodecContext *avctx)
{
TAKDecContext
*
s
=
avctx
->
priv_data
;
ff_tak_init_crc
();
ff_dsputil_init
(
&
s
->
dsp
,
avctx
);
s
->
avctx
=
avctx
;
...
...
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