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
c4cc3610
Commit
c4cc3610
authored
17 years ago
by
Aurelien Jacobs
Browse files
Options
Downloads
Patches
Plain Diff
cleanup and simplify adx_decode_header()
Originally committed as revision 10900 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
6177c7ef
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/adx.c
+6
-23
6 additions, 23 deletions
libavcodec/adx.c
with
6 additions
and
23 deletions
libavcodec/adx.c
+
6
−
23
View file @
c4cc3610
...
...
@@ -249,35 +249,18 @@ static int adx_encode_frame(AVCodecContext *avctx,
#endif //CONFIG_ENCODERS
static
int
is_adx
(
const
unsigned
char
*
buf
,
size_t
bufsize
)
/* return data offset or 0 */
static
int
adx_decode_header
(
AVCodecContext
*
avctx
,
const
unsigned
char
*
buf
,
size_t
bufsize
)
{
int
offset
;
int
offset
;
if
(
buf
[
0
]
!=
0x80
)
return
0
;
offset
=
(
AV_RB32
(
buf
)
^
0x80000000
)
+
4
;
if
(
bufsize
<
offset
||
memcmp
(
buf
+
offset
-
6
,
"(c)CRI"
,
6
))
return
0
;
return
offset
;
}
/* return data offset or 6 */
static
int
adx_decode_header
(
AVCodecContext
*
avctx
,
const
unsigned
char
*
buf
,
size_t
bufsize
)
{
int
offset
;
int
channels
,
freq
,
size
;
offset
=
is_adx
(
buf
,
bufsize
);
if
(
offset
==
0
)
return
0
;
channels
=
buf
[
7
];
freq
=
AV_RB32
(
buf
+
8
);
size
=
AV_RB32
(
buf
+
12
);
// printf("freq=%d ch=%d\n",freq,channels);
avctx
->
sample_rate
=
freq
;
avctx
->
channels
=
channels
;
avctx
->
bit_rate
=
freq
*
channels
*
18
*
8
/
32
;
// avctx->frame_size = 18*channels;
avctx
->
channels
=
buf
[
7
];
avctx
->
sample_rate
=
AV_RB32
(
buf
+
8
);
avctx
->
bit_rate
=
avctx
->
sample_rate
*
avctx
->
channels
*
18
*
8
/
32
;
return
offset
;
}
...
...
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