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
03f7de77
Commit
03f7de77
authored
13 years ago
by
Gregory Maxwell
Browse files
Options
Downloads
Patches
Plain Diff
Strip off trailing zero bytes when in LPC mode.
Saves about 60 bits/sec for 20ms frames.
parent
d830d089
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/opus_encoder.c
+8
-0
8 additions, 0 deletions
src/opus_encoder.c
with
8 additions
and
0 deletions
src/opus_encoder.c
+
8
−
0
View file @
03f7de77
...
...
@@ -568,6 +568,14 @@ int opus_encode(OpusEncoder *st, const opus_int16 *pcm, int frame_size,
{
ret
=
(
ec_tell
(
&
enc
)
+
7
)
>>
3
;
ec_enc_done
(
&
enc
);
/*When in LPC only mode it's perfectly
reasonable to strip off trailing zero bytes as
the required range decoder behavior is to
fill these in. This can't be done when the MDCT
modes are used because the decoder needs to know
the actual length for allocation purposes.*/
if
(
!
redundancy
)
while
(
ret
>
2
&&
data
[
ret
-
1
]
==
0
)
ret
--
;
nb_compr_bytes
=
ret
;
}
...
...
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