[Tremor] reg:Decoder type

Balatoni Denes dbalatoni at programozo.hu
Tue Jun 14 14:37:54 PDT 2005


Hi!

Yes, only VQ lookup type 1 (lattice VQ) is used in current encoders. Monty 
mentioned on this list that attempts to use custom vectors (not a regular 
lattice, but one generated with an algorithm similar to the LGB algorithm) 
for VQ lead to worse quality (loss of details). VQ lookup type 3 is not even 
mentioned in the official Vorbis I specification.

bye
Denes

hétfő 13 június 2005 14.01-kor Dhanabal ezeket a bolcs gondolatokat fogalmazta 
meg:
> Hi
>    In this part of the code.....
>
> int decode_map(codebook *s, oggpack_buffer *b, ogg_int32_t *v, int point){
>   ogg_uint32_t entry = decode_packed_entry_number(s,b);
>   int i;
>   if(oggpack_eop(b))return(-1);
>
>   /* according to decode type */
>   switch(s->dec_type){
>   case 1:{
>     /* packed vector of values */
>     int mask=(1<<s->q_bits)-1;
>     for(i=0;i<s->dim;i++){
>       v[i]=entry&mask;
>       entry>>=s->q_bits;
>     }
>     break;
>   }
>   case 2:{
>     /* packed vector of column offsets */
>     int mask=(1<<s->q_pack)-1;
>     for(i=0;i<s->dim;i++){
>       if(s->q_bits<=8)
>  v[i]=((unsigned char *)(s->q_val))[entry&mask];
>       else
>  v[i]=((ogg_uint16_t *)(s->q_val))[entry&mask];
>       entry>>=s->q_pack;
>     }
>     break;
>   }
>   case 3:{
>     /* offset into array */
>     int *ptr=(int *)s->q_val+entry*s->q_pack;
>
>     if(s->q_bits<=8){
>       for(i=0;i<s->dim;i++)
>  v[i]=((unsigned char *)ptr)[i];
>     }else{
>       for(i=0;i<s->dim;i++)
>  v[i]=((ogg_uint16_t *)ptr)[i];
>     }
>     break;
>   }
>   default:
>     return -1;
>   }
>
> All the test vectors pass through case1. Case 2 and 3 are not reached. I
> need clarification regarding this.
>
> Thanks and Regards
> Dhanapal

-- 
- Use the Source Luke ! -


More information about the Tremor mailing list