Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
TimPhilipp Müller
Opus
Commits
ad49daa4
Commit
ad49daa4
authored
May 17, 2012
by
JeanMarc Valin
Browse files
s/octet/byte/
Also version bump
parent
a4745783
Changes
3
Hide whitespace changes
Inline
Sidebyside
Showing
3 changed files
with
25 additions
and
25 deletions
+25
25
Makefile.draft
Makefile.draft
+1
1
configure.ac
configure.ac
+1
1
doc/draftietfcodecopus.xml
doc/draftietfcodecopus.xml
+23
23
No files found.
Makefile.draft
View file @
ad49daa4
...
...
@@ 20,7 +20,7 @@ CFLAGS := Drestrict= $(CFLAGS)
###################### END OF OPTIONS ######################
CFLAGS
+=
DOPUS_VERSION
=
'"0.9.1
1
"'
CFLAGS
+=
DOPUS_VERSION
=
'"0.9.1
4
"'
include
silk_sources.mk
include
celt_sources.mk
include
opus_sources.mk
...
...
configure.ac
View file @
ad49daa4
...
...
@@ 9,7 +9,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
OPUS_MAJOR_VERSION=0
OPUS_MINOR_VERSION=9
OPUS_MICRO_VERSION=1
1
OPUS_MICRO_VERSION=1
4
OPUS_EXTRA_VERSION=
OPUS_VERSION="$OPUS_MAJOR_VERSION.$OPUS_MINOR_VERSION.$OPUS_MICRO_VERSION$OPUS_EXTRA_VERSION"
...
...
doc/draftietfcodecopus.xml
View file @
ad49daa4
...
...
@@ 2,7 +2,7 @@
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
<?rfc toc="yes" symrefs="yes" ?>
<rfc
ipr=
"trust200902"
category=
"std"
docName=
"draftietfcodecopus1
3
"
>
<rfc
ipr=
"trust200902"
category=
"std"
docName=
"draftietfcodecopus1
4
"
>
<front>
<title
abbrev=
"Interactive Audio Codec"
>
Definition of the Opus Audio Codec
</title>
...
...
@@ 53,7 +53,7 @@
</address>
</author>
<date
day=
"1
5
"
month=
"May"
year=
"2012"
/>
<date
day=
"1
7
"
month=
"May"
year=
"2012"
/>
<area>
General
</area>
...
...
@@ 1044,7 +1044,7 @@ Opus uses an entropy coder based on range coding <xref target="rangecoding"></x
which is itself a rediscovery of the FIFO arithmetic code introduced by
<xref
target=
"codingthesis"
></xref>
.
It is very similar to arithmetic encoding, except that encoding is done with
digits in any base instead of with bits,
so it is faster when using larger bases (i.e., a
n oc
te
t
). All of the
so it is faster when using larger bases (i.e., a
by
te). All of the
calculations in the range coder must use bitexact integer arithmetic.
</t>
<t>
...
...
@@ 1113,11 +1113,11 @@ Both val and rng are 32bit unsigned integer values.
<section
anchor=
"rangedecoderinit"
title=
"Range Decoder Initialization"
>
<t>
Let b0 be the first input
oc
te
t
(or zero if there are no
oc
te
t
s in this Opus
Let b0 be the first input
by
te (or zero if there are no
by
tes in this Opus
frame).
The decoder initializes rng to 128 and initializes val to
(127

(b0
>>
1)), where (b0
>>
1) is the top 7 bits of the
first input
oc
te
t
.
first input
by
te.
It saves the remaining bit, (b0
&
1), for use in the renormalization
procedure described in
<xref
target=
"rangedecoderrenorm"
/>
, which the
decoder invokes immediately after initialization to read additional bits and
...
...
@@ 1198,14 +1198,14 @@ To normalize the range, the decoder repeats the following process, implemented
by ec_dec_normalize() (entdec.c), until rng
>
2**23.
If rng is already greater than 2**23, the entire process is skipped.
First, it sets rng to (rng
<<
8).
Then it reads the next
oc
te
t
of the Opus frame and forms an 8bit value sym,
using the leftover bit buffered from the previous
oc
te
t
as the high bit
and the top 7 bits of the
oc
te
t
just read as the other 7 bits of sym.
The remaining bit in the
oc
te
t
just read is buffered for use in the next
Then it reads the next
by
te of the Opus frame and forms an 8bit value sym,
using the leftover bit buffered from the previous
by
te as the high bit
and the top 7 bits of the
by
te just read as the other 7 bits of sym.
The remaining bit in the
by
te just read is buffered for use in the next
iteration.
If no more input
oc
te
t
s remain, it uses zero bits instead.
If no more input
by
tes remain, it uses zero bits instead.
See
<xref
target=
"rangedecoderinit"
/>
for the initialization used to process
the first
oc
te
t
.
the first
by
te.
Then, it sets
<figure
align=
"center"
>
<artwork
align=
"center"
>
<![CDATA[
...
...
@@ 6160,9 +6160,9 @@ Integers from 0 to (ft  1) (where ft is not a power of two) using
<t>
The range encoder maintains an internal state vector composed of the fourtuple
(val,
rng,
rem,
ext) representing the low end of the current
range, the size of the current range, a single buffered output
oc
te
t
, and a
count of additional carrypropagating output
oc
te
t
s.
Both val and rng are 32bit unsigned integer values, rem is a
n oc
te
t
value or
range, the size of the current range, a single buffered output
by
te, and a
count of additional carrypropagating output
by
tes.
Both val and rng are 32bit unsigned integer values, rem is a
by
te value or
less than 255 or the special value 1, and ext is an unsigned integer with at
least 11 bits.
This state vector is initialized at the start of each each frame to the value
...
...
@@ 6181,11 +6181,11 @@ The decoder has no analog for rem and ext.
These are used to perform carry propagation in the renormalization loop below.
Each iteration of this loop produces 9 bits of output, consisting of 8 data
bits and a carry flag.
The encoder cannot determine the final value of the output
oc
te
t
s until it
The encoder cannot determine the final value of the output
by
tes until it
propagates these carry flags.
Therefore the reference implementation buffers a single nonpropagating output
oc
te
t
(i.e., one less than 255) in rem and keeps a count of additional
propagating (i.e., 255) output
oc
te
t
s in ext.
by
te (i.e., one less than 255) in rem and keeps a count of additional
propagating (i.e., 255) output
by
tes in ext.
An implementation may choose to use any mathematically equivalent scheme to
perform carry propagation.
</t>
...
...
@@ 6254,12 +6254,12 @@ Otherwise, let b = (c>>8) be the carry bit.
Then,
<list
style=
"symbols"
>
<t>
If the buffered
oc
te
t
rem contains a value other than 1, the encoder outputs
the
oc
te
t
(rem
+
b).
Otherwise, if rem is 1, no
oc
te
t
is output.
If the buffered
by
te rem contains a value other than 1, the encoder outputs
the
by
te (rem
+
b).
Otherwise, if rem is 1, no
by
te is output.
</t>
<t>
If ext is nonzero, then the encoder outputs ext
oc
te
t
sall with a value of 0
If ext is nonzero, then the encoder outputs ext
by
tesall with a value of 0
if b is set, or 255 if b is unsetand sets ext to 0.
</t>
<t>
...
...
@@ 6329,7 +6329,7 @@ The raw bits used by the CELT layer are packed at the end of the buffer using
ec_enc_bits() (entenc.c).
Because the raw bits may continue into the last byte output by the range coder
if there is room in the loworder bits, the encoder must be prepared to merge
these values into a single
oc
te
t
.
these values into a single
by
te.
The procedure in
<xref
target=
"encoderfinalizing"
/>
does this in a way that
ensures both the range coded data and the raw bits can be decoded
successfully.
...
...
@@ 6384,7 +6384,7 @@ Then, while end is not zero, the top 9 bits of end, i.e., (end>>23), are
end = (end<<8) & 0x7FFFFFFF .
]]>
</artwork>
</figure>
Finally, if the buffered output
oc
te
t
, rem, is neither zero nor the special
Finally, if the buffered output
by
te, rem, is neither zero nor the special
value 1, or the carry count, ext, is greater than zero, then 9 zero bits are
sent to the carry buffer to flush it to the output buffer.
When outputting the final byte from the range coder, if it would overlap any
...
...
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