diff options
author | Andreas Huber <andih@google.com> | 2010-05-07 10:37:02 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-05-07 10:37:02 -0700 |
commit | 1a7ca64dd19ab9a5af3c4c3c58c815f764877bf7 (patch) | |
tree | f760f559d771598e04a487fc7195e5a58448385a /Tremolo | |
parent | 20dda290edd481880682bdc9ac9d1aa4ef6410b6 (diff) | |
download | external_tremolo-1a7ca64dd19ab9a5af3c4c3c58c815f764877bf7.zip external_tremolo-1a7ca64dd19ab9a5af3c4c3c58c815f764877bf7.tar.gz external_tremolo-1a7ca64dd19ab9a5af3c4c3c58c815f764877bf7.tar.bz2 |
Expose some internals of the tremolo library for use by the OggExtractor/VorbisDecoder
Change-Id: I3846bb61bcf032a445c501a831ab90e81bf2ff21
related-to-bug: 2654400
Diffstat (limited to 'Tremolo')
-rw-r--r-- | Tremolo/codec_internal.h | 2 | ||||
-rw-r--r-- | Tremolo/floor1.c | 38 | ||||
-rw-r--r-- | Tremolo/treminfo.c | 6 |
3 files changed, 23 insertions, 23 deletions
diff --git a/Tremolo/codec_internal.h b/Tremolo/codec_internal.h index 6889ec8..1d4a146 100644 --- a/Tremolo/codec_internal.h +++ b/Tremolo/codec_internal.h @@ -113,7 +113,7 @@ typedef struct{ } floor1class; typedef struct{ - floor1class *class; /* [VIF_CLASS] */ + floor1class *klass; /* [VIF_CLASS] */ char *partitionclass; /* [VIF_PARTS]; 0 to 15 */ ogg_uint16_t *postlist; /* [VIF_POSIT+2]; first two implicit */ char *forward_index; /* [VIF_POSIT+2]; */ diff --git a/Tremolo/floor1.c b/Tremolo/floor1.c index c471ead..a2a035b 100644 --- a/Tremolo/floor1.c +++ b/Tremolo/floor1.c @@ -53,7 +53,7 @@ extern const ogg_int32_t FLOOR_fromdB_LOOKUP[]; void floor1_free_info(vorbis_info_floor *i){ vorbis_info_floor1 *info=(vorbis_info_floor1 *)i; if(info){ - if(info->class)_ogg_free(info->class); + if(info->klass)_ogg_free(info->klass); if(info->partitionclass)_ogg_free(info->partitionclass); if(info->postlist)_ogg_free(info->postlist); if(info->forward_index)_ogg_free(info->forward_index); @@ -119,21 +119,21 @@ vorbis_info_floor *floor1_info_unpack (vorbis_info *vi,oggpack_buffer *opb){ } /* read partition classes */ - info->class= - (floor1class *)_ogg_malloc((maxclass+1)*sizeof(*info->class)); + info->klass= + (floor1class *)_ogg_malloc((maxclass+1)*sizeof(*info->klass)); for(j=0;j<maxclass+1;j++){ - info->class[j].class_dim=(char)oggpack_read(opb,3)+1; /* 1 to 8 */ - info->class[j].class_subs=(char)oggpack_read(opb,2); /* 0,1,2,3 bits */ + info->klass[j].class_dim=(char)oggpack_read(opb,3)+1; /* 1 to 8 */ + info->klass[j].class_subs=(char)oggpack_read(opb,2); /* 0,1,2,3 bits */ if(oggpack_eop(opb)<0) goto err_out; - if(info->class[j].class_subs) - info->class[j].class_book=(unsigned char)oggpack_read(opb,8); + if(info->klass[j].class_subs) + info->klass[j].class_book=(unsigned char)oggpack_read(opb,8); else - info->class[j].class_book=0; - if(info->class[j].class_book>=ci->books)goto err_out; - for(k=0;k<(1<<info->class[j].class_subs);k++){ - info->class[j].class_subbook[k]=(unsigned char)(oggpack_read(opb,8)-1); - if(info->class[j].class_subbook[k]>=ci->books && - info->class[j].class_subbook[k]!=0xff)goto err_out; + info->klass[j].class_book=0; + if(info->klass[j].class_book>=ci->books)goto err_out; + for(k=0;k<(1<<info->klass[j].class_subs);k++){ + info->klass[j].class_subbook[k]=(unsigned char)(oggpack_read(opb,8)-1); + if(info->klass[j].class_subbook[k]>=ci->books && + info->klass[j].class_subbook[k]!=0xff)goto err_out; } } @@ -142,7 +142,7 @@ vorbis_info_floor *floor1_info_unpack (vorbis_info *vi,oggpack_buffer *opb){ rangebits=oggpack_read(opb,4); for(j=0,k=0;j<info->partitions;j++) - count+=info->class[info->partitionclass[j]].class_dim; + count+=info->klass[info->partitionclass[j]].class_dim; info->postlist= (ogg_uint16_t *)_ogg_malloc((count+2)*sizeof(*info->postlist)); info->forward_index= @@ -154,7 +154,7 @@ vorbis_info_floor *floor1_info_unpack (vorbis_info *vi,oggpack_buffer *opb){ count=0; for(j=0,k=0;j<info->partitions;j++){ - count+=info->class[info->partitionclass[j]].class_dim; + count+=info->klass[info->partitionclass[j]].class_dim; for(;k<count;k++){ int t=info->postlist[k+2]=(ogg_uint16_t)oggpack_read(opb,rangebits); if(t>=(1<<rangebits))goto err_out; @@ -303,20 +303,20 @@ ogg_int32_t *floor1_inverse1(vorbis_dsp_state *vd,vorbis_info_floor *in, /* partition by partition */ for(i=0,j=2;i<info->partitions;i++){ int classv=info->partitionclass[i]; - int cdim=info->class[classv].class_dim; - int csubbits=info->class[classv].class_subs; + int cdim=info->klass[classv].class_dim; + int csubbits=info->klass[classv].class_subs; int csub=1<<csubbits; int cval=0; /* decode the partition's first stage cascade value */ if(csubbits){ - cval=vorbis_book_decode(books+info->class[classv].class_book,&vd->opb); + cval=vorbis_book_decode(books+info->klass[classv].class_book,&vd->opb); if(cval==-1)goto eop; } for(k=0;k<cdim;k++){ - int book=info->class[classv].class_subbook[cval&(csub-1)]; + int book=info->klass[classv].class_subbook[cval&(csub-1)]; cval>>=csubbits; if(book!=0xff){ if((fit_value[j+k]=vorbis_book_decode(books+book,&vd->opb))==-1) diff --git a/Tremolo/treminfo.c b/Tremolo/treminfo.c index 331b459..f7c4973 100644 --- a/Tremolo/treminfo.c +++ b/Tremolo/treminfo.c @@ -176,7 +176,7 @@ void vorbis_info_clear(vorbis_info *vi){ /* Header packing/unpacking ********************************************/ -static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ +int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; if(!ci)return(OV_EFAULT); @@ -213,7 +213,7 @@ static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ return(OV_EBADHEADER); } -static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ +int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ int i; int vendorlen=oggpack_read(opb,32); if(vendorlen<0)goto err_out; @@ -241,7 +241,7 @@ static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ /* all of the real encoding details are here. The modes, books, everything */ -static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){ +int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){ codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; int i; if(!ci)return(OV_EFAULT); |