From 8e94244f86e657e4113e35438e59cf5771882b25 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 3 Mar 2024 12:51:03 +0100 Subject: libogg and libvorbis are no longer part of this source tree --- contrib/vorbis/vq/latticetune.c | 163 ---------------------------------------- 1 file changed, 163 deletions(-) delete mode 100644 contrib/vorbis/vq/latticetune.c (limited to 'contrib/vorbis/vq/latticetune.c') diff --git a/contrib/vorbis/vq/latticetune.c b/contrib/vorbis/vq/latticetune.c deleted file mode 100644 index 193d4d1..0000000 --- a/contrib/vorbis/vq/latticetune.c +++ /dev/null @@ -1,163 +0,0 @@ -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: utility main for setting entropy encoding parameters - for lattice codebooks - - ********************************************************************/ - -#include -#include -#include -#include -#include -#include "bookutil.h" - -static int strrcmp_i(char *s,char *cmp){ - return(strncmp(s+strlen(s)-strlen(cmp),cmp,strlen(cmp))); -} - -/* This util takes a training-collected file listing codewords used in - LSP fitting, then generates new codeword lengths for maximally - efficient integer-bits entropy encoding. - - command line: - latticetune book.vqh input.vqd [unused_entriesp] - - latticetune produces book.vqh on stdout */ - -int main(int argc,char *argv[]){ - codebook *b; - static_codebook *c; - long *lengths; - long *hits; - - int entries=-1,dim=-1,guard=1; - FILE *in=NULL; - char *line,*name; - long j; - - if(argv[1]==NULL){ - fprintf(stderr,"Need a lattice codebook on the command line.\n"); - exit(1); - } - if(argv[2]==NULL){ - fprintf(stderr,"Need a codeword data file on the command line.\n"); - exit(1); - } - if(argv[3]!=NULL)guard=0; - - { - char *ptr; - char *filename=strdup(argv[1]); - - b=codebook_load(filename); - c=(static_codebook *)(b->c); - - ptr=strrchr(filename,'.'); - if(ptr){ - *ptr='\0'; - name=strdup(filename); - }else{ - name=strdup(filename); - } - } - - if(c->maptype!=1){ - fprintf(stderr,"Provided book is not a latticebook.\n"); - exit(1); - } - - entries=b->entries; - dim=b->dim; - - hits=_ogg_malloc(entries*sizeof(long)); - lengths=_ogg_calloc(entries,sizeof(long)); - for(j=0;jlengthlist=lengths; - write_codebook(stdout,name,c); - - { - long bins=_book_maptype1_quantvals(c); - long i,k,base=c->lengthlist[0]; - for(i=0;ilengthlist[i]>base)base=c->lengthlist[i]; - - for(j=0;jlengthlist[j]){ - int indexdiv=1; - fprintf(stderr,"%4ld: ",j); - for(k=0;kdim;k++){ - int index= (j/indexdiv)%bins; - fprintf(stderr,"%+3.1f,", c->quantlist[index]*_float32_unpack(c->q_delta)+ - _float32_unpack(c->q_min)); - indexdiv*=bins; - } - fprintf(stderr,"\t|"); - for(k=0;klengthlist[j];k++)fprintf(stderr,"*"); - fprintf(stderr,"\n"); - } - } - } - - fprintf(stderr,"\r " - "\nDone.\n"); - exit(0); -} -- cgit v1.1