IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
In Vorbis 1 specification, [sparse] bit
yesjoon
post May 27 2004, 03:14
Post #1





Group: Members
Posts: 20
Joined: 30-April 04
Member No.: 13794



I don't understand below explanation.


In Vorbis 1 specification, 3.2.1. codebook decode
===================================

If the [ordered] flag is unset, the codeword list is not length ordered and the decoder needs to read each codeword length one-by-one.

The decoder first reads one additional bit flag, the [sparse] flag. This flag determines whether or not the codebook contains unused entries that are not to be included in the codeword decode tree:

byte 8: [ X 1 ] [sparse] flag (1 bit)

The decoder now performs for each of the [codebook_entries] codebook entries:


1) if([sparse] is set){

2) [flag] = read one bit;
3) if([flag] is set){

4) [length] = read a five bit unsigned integer;
5) codeword length for this entry is [length]+1;

} else {

6) this entry is unused. mark it as such.

}

} else the sparse flag is not set {

7) [length] = read a five bit unsigned integer;
8) the codeword length for this entry is [length]+1;

}


==============================================

byte 8: [ X 1 ] [sparse] flag (1 bit)

==> '1' is [ordered] bit and 'X' is [sparse] bit. Is it right?

What is a difference between "1) [sparse] is set" and " 3) [flag] is set" ?
Go to the top of the page
+Quote Post
kjoonlee
post May 27 2004, 03:51
Post #2





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



CODE
byte 8: [               X ] [ordered] (1 bit)
byte 8: [             X 0 ] [sparse] flag (1 bit)
byte 8: [           X 1 0 ] [flag] flag (1 bit)


This post has been edited by kjoonlee: May 27 2004, 03:54


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
kjoonlee
post May 27 2004, 03:53
Post #3





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



I got some big help from Xiph.org (Michael Smith in particular) in writing that answer, but I still might be wrong.

If you want a definitive, accurate answer, then please email vorbis-dev@xiph.org with your question. smile.gif


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
kjoonlee
post May 27 2004, 04:10
Post #4





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



An unchained Vorbis stream has one (1) codebook header packet, which contains all the codebooks that are used in that stream.

For each codebook, [sparse] is always read.

if [sparse] is 1, then [flag] is read for each and every "codebook entry"/"codeword."

Thanks go to Michael Smith. smile.gif


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th April 2014 - 06:16