Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiph.Org
Opus
Commits
9f555bc4
Commit
9f555bc4
authored
13 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
encode_size() moved out of opus_encoder.c
parent
6696a144
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/opus.c
+14
-0
14 additions, 0 deletions
src/opus.c
src/opus_private.h
+2
-0
2 additions, 0 deletions
src/opus_private.h
src/repacketizer.c
+1
-12
1 addition, 12 deletions
src/repacketizer.c
with
17 additions
and
12 deletions
src/opus.c
+
14
−
0
View file @
9f555bc4
...
...
@@ -30,11 +30,25 @@
#endif
#include
"opus.h"
#include
"opus_private.h"
#ifndef OPUS_VERSION
#define OPUS_VERSION "unknown"
#endif
int
encode_size
(
int
size
,
unsigned
char
*
data
)
{
if
(
size
<
252
)
{
data
[
0
]
=
size
;
return
1
;
}
else
{
data
[
0
]
=
252
+
(
size
&
0x3
);
data
[
1
]
=
(
size
-
(
int
)
data
[
0
])
>>
2
;
return
2
;
}
}
const
char
*
opus_strerror
(
int
error
)
{
static
const
char
*
error_strings
[
8
]
=
{
...
...
This diff is collapsed.
Click to expand it.
src/opus_private.h
+
2
−
0
View file @
9f555bc4
...
...
@@ -29,6 +29,8 @@
#ifndef OPUS_PRIVATE_H
#define OPUS_PRIVATE_H
int
encode_size
(
int
size
,
unsigned
char
*
data
);
/* Make sure everything's aligned to 4 bytes (this may need to be increased
on really weird architectures) */
static
inline
int
align
(
int
i
)
...
...
This diff is collapsed.
Click to expand it.
src/repacketizer.c
+
1
−
12
View file @
9f555bc4
...
...
@@ -42,18 +42,7 @@ struct OpusRepacketizer {
int
framesize
;
};
static
int
encode_size
(
int
size
,
unsigned
char
*
data
)
{
if
(
size
<
252
)
{
data
[
0
]
=
size
;
return
1
;
}
else
{
data
[
0
]
=
252
+
(
size
&
0x3
);
data
[
1
]
=
(
size
-
(
int
)
data
[
0
])
>>
2
;
return
2
;
}
}
int
opus_repacketizer_get_size
(
void
)
{
...
...
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