diff --git a/thirdparty/README.md b/thirdparty/README.md index 09b016ad4dd..f75cdf16d07 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -191,7 +191,7 @@ Files extracted from upstream source: ## libvorbis - Upstream: https://www.xiph.org/vorbis -- Version: 1.3.5 +- Version: 1.3.6 - License: BSD-3-Clause Files extracted from upstream source: diff --git a/thirdparty/libvorbis/COPYING b/thirdparty/libvorbis/COPYING index 8f1d18cc2b3..153b926a152 100644 --- a/thirdparty/libvorbis/COPYING +++ b/thirdparty/libvorbis/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 2002-2015 Xiph.org Foundation +Copyright (c) 2002-2018 Xiph.org Foundation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/thirdparty/libvorbis/analysis.c b/thirdparty/libvorbis/analysis.c index 01aa6f30dbd..0e11a167be8 100644 --- a/thirdparty/libvorbis/analysis.c +++ b/thirdparty/libvorbis/analysis.c @@ -11,7 +11,6 @@ ******************************************************************** function: single-block PCM analysis mode dispatch - last mod: $Id: analysis.c 16226 2009-07-08 06:43:49Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/backends.h b/thirdparty/libvorbis/backends.h index ff5bcc95fe7..22809d46d52 100644 --- a/thirdparty/libvorbis/backends.h +++ b/thirdparty/libvorbis/backends.h @@ -12,7 +12,6 @@ function: libvorbis backend and mapping structures; needed for static mode headers - last mod: $Id: backends.h 16962 2010-03-11 07:30:34Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/barkmel.c b/thirdparty/libvorbis/barkmel.c index 37b6c4c7ba3..4b19935f30a 100644 --- a/thirdparty/libvorbis/barkmel.c +++ b/thirdparty/libvorbis/barkmel.c @@ -11,7 +11,6 @@ ******************************************************************** function: bark scale utility - last mod: $Id: barkmel.c 19454 2015-03-02 22:39:28Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/bitrate.c b/thirdparty/libvorbis/bitrate.c index 3a71b1dc23c..96055140f71 100644 --- a/thirdparty/libvorbis/bitrate.c +++ b/thirdparty/libvorbis/bitrate.c @@ -11,7 +11,6 @@ ******************************************************************** function: bitrate tracking and management - last mod: $Id: bitrate.c 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/bitrate.h b/thirdparty/libvorbis/bitrate.h index db48fcb645a..655a68cc09f 100644 --- a/thirdparty/libvorbis/bitrate.h +++ b/thirdparty/libvorbis/bitrate.h @@ -11,7 +11,6 @@ ******************************************************************** function: bitrate tracking and management - last mod: $Id: bitrate.h 13293 2007-07-24 00:09:47Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/block.c b/thirdparty/libvorbis/block.c index 345c042769f..db245b3e696 100644 --- a/thirdparty/libvorbis/block.c +++ b/thirdparty/libvorbis/block.c @@ -11,7 +11,6 @@ ******************************************************************** function: PCM data vector blocking, windowing and dis/reassembly - last mod: $Id: block.c 19457 2015-03-03 00:15:29Z giles $ Handle windowing, overlap-add, etc of the PCM vectors. This is made more amusing by Vorbis' current two allowed block sizes. diff --git a/thirdparty/libvorbis/books/coupled/res_books_51.h b/thirdparty/libvorbis/books/coupled/res_books_51.h index 93910ff4813..47df4b221b8 100644 --- a/thirdparty/libvorbis/books/coupled/res_books_51.h +++ b/thirdparty/libvorbis/books/coupled/res_books_51.h @@ -11,7 +11,6 @@ ******************************************************************** * * function: static codebooks for 5.1 surround - * last modified: $Id: res_books_51.h 19057 2014-01-22 12:32:31Z xiphmont $ * ********************************************************************/ diff --git a/thirdparty/libvorbis/books/coupled/res_books_stereo.h b/thirdparty/libvorbis/books/coupled/res_books_stereo.h index 9a9049f6ed9..61d934046dc 100644 --- a/thirdparty/libvorbis/books/coupled/res_books_stereo.h +++ b/thirdparty/libvorbis/books/coupled/res_books_stereo.h @@ -11,7 +11,6 @@ ******************************************************************** function: static codebooks autogenerated by huff/huffbuld - last modified: $Id: res_books_stereo.h 19057 2014-01-22 12:32:31Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/books/floor/floor_books.h b/thirdparty/libvorbis/books/floor/floor_books.h index e925313f7b3..67d5f31a3bd 100644 --- a/thirdparty/libvorbis/books/floor/floor_books.h +++ b/thirdparty/libvorbis/books/floor/floor_books.h @@ -11,7 +11,6 @@ ******************************************************************** function: static codebooks autogenerated by huff/huffbuld - last modified: $Id: floor_books.h 19057 2014-01-22 12:32:31Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/books/uncoupled/res_books_uncoupled.h b/thirdparty/libvorbis/books/uncoupled/res_books_uncoupled.h index 736353b675b..3d658ec4703 100644 --- a/thirdparty/libvorbis/books/uncoupled/res_books_uncoupled.h +++ b/thirdparty/libvorbis/books/uncoupled/res_books_uncoupled.h @@ -11,7 +11,6 @@ ******************************************************************** function: static codebooks autogenerated by huff/huffbuld - last modified: $Id: res_books_uncoupled.h 19057 2014-01-22 12:32:31Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/codebook.c b/thirdparty/libvorbis/codebook.c index 72f8a17a350..78672e222d8 100644 --- a/thirdparty/libvorbis/codebook.c +++ b/thirdparty/libvorbis/codebook.c @@ -11,7 +11,6 @@ ******************************************************************** function: basic codebook pack/unpack/code/decode operations - last mod: $Id: codebook.c 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ @@ -387,7 +386,7 @@ long vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){ t[i] = book->valuelist+entry[i]*book->dim; } for(i=0,o=0;idim;i++,o+=step) - for (j=0;jdim>8){ - for(i=0;ivaluelist+entry*book->dim; - for (j=0;jdim;) - a[i++]+=t[j++]; - } - }else{ - for(i=0;ivaluelist+entry*book->dim; - j=0; - switch((int)book->dim){ - case 8: - a[i++]+=t[j++]; - case 7: - a[i++]+=t[j++]; - case 6: - a[i++]+=t[j++]; - case 5: - a[i++]+=t[j++]; - case 4: - a[i++]+=t[j++]; - case 3: - a[i++]+=t[j++]; - case 2: - a[i++]+=t[j++]; - case 1: - a[i++]+=t[j++]; - case 0: - break; - } - } + for(i=0;ivaluelist+entry*book->dim; + for(j=0;idim;) + a[i++]+=t[j++]; } } return(0); @@ -471,12 +441,13 @@ long vorbis_book_decodevv_add(codebook *book,float **a,long offset,int ch, long i,j,entry; int chptr=0; if(book->used_entries>0){ - for(i=offset/ch;i<(offset+n)/ch;){ + int m=(offset+n)/ch; + for(i=offset/ch;ivaluelist+entry*book->dim; - for (j=0;jdim;j++){ + for (j=0;idim;j++){ a[chptr++][i]+=t[j]; if(chptr==ch){ chptr=0; diff --git a/thirdparty/libvorbis/codebook.h b/thirdparty/libvorbis/codebook.h index 537d6c12d30..08440c6962a 100644 --- a/thirdparty/libvorbis/codebook.h +++ b/thirdparty/libvorbis/codebook.h @@ -11,7 +11,6 @@ ******************************************************************** function: basic shared codebook operations - last mod: $Id: codebook.h 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/codec_internal.h b/thirdparty/libvorbis/codec_internal.h index de1bccaedf4..e522be18da1 100644 --- a/thirdparty/libvorbis/codec_internal.h +++ b/thirdparty/libvorbis/codec_internal.h @@ -11,7 +11,6 @@ ******************************************************************** function: libvorbis codec headers - last mod: $Id: codec_internal.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/envelope.c b/thirdparty/libvorbis/envelope.c index 010c66e2d6b..da752375428 100644 --- a/thirdparty/libvorbis/envelope.c +++ b/thirdparty/libvorbis/envelope.c @@ -11,7 +11,6 @@ ******************************************************************** function: PCM data envelope analysis - last mod: $Id: envelope.c 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/envelope.h b/thirdparty/libvorbis/envelope.h index fd15fb32a73..f466efde8a7 100644 --- a/thirdparty/libvorbis/envelope.h +++ b/thirdparty/libvorbis/envelope.h @@ -11,7 +11,6 @@ ******************************************************************** function: PCM data envelope analysis and manipulation - last mod: $Id: envelope.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/floor0.c b/thirdparty/libvorbis/floor0.c index 213cce4ec89..443c0e5a96f 100644 --- a/thirdparty/libvorbis/floor0.c +++ b/thirdparty/libvorbis/floor0.c @@ -11,7 +11,6 @@ ******************************************************************** function: floor backend 0 implementation - last mod: $Id: floor0.c 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/floor1.c b/thirdparty/libvorbis/floor1.c index d8bd4645c15..673e954c53a 100644 --- a/thirdparty/libvorbis/floor1.c +++ b/thirdparty/libvorbis/floor1.c @@ -11,7 +11,6 @@ ******************************************************************** function: floor backend 1 implementation - last mod: $Id: floor1.c 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/highlevel.h b/thirdparty/libvorbis/highlevel.h index e38f370fd6c..337b75bfa47 100644 --- a/thirdparty/libvorbis/highlevel.h +++ b/thirdparty/libvorbis/highlevel.h @@ -11,7 +11,6 @@ ******************************************************************** function: highlevel encoder setup struct separated out for vorbisenc clarity - last mod: $Id: highlevel.h 17195 2010-05-05 21:49:51Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/info.c b/thirdparty/libvorbis/info.c index 8a2a001f99f..3fbb7c757aa 100644 --- a/thirdparty/libvorbis/info.c +++ b/thirdparty/libvorbis/info.c @@ -11,7 +11,6 @@ ******************************************************************** function: maintain the info structure, info <-> header packets - last mod: $Id: info.c 19441 2015-01-21 01:17:41Z xiphmont $ ********************************************************************/ @@ -31,8 +30,8 @@ #include "misc.h" #include "os.h" -#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.3.5" -#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20150105 (⛄⛄⛄⛄)" +#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.3.6" +#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20180316 (Now 100% fewer shells)" /* helpers */ static void _v_writestring(oggpack_buffer *o,const char *s, int bytes){ @@ -65,11 +64,13 @@ void vorbis_comment_add(vorbis_comment *vc,const char *comment){ } void vorbis_comment_add_tag(vorbis_comment *vc, const char *tag, const char *contents){ - char *comment=alloca(strlen(tag)+strlen(contents)+2); /* +2 for = and \0 */ + /* Length for key and value +2 for = and \0 */ + char *comment=_ogg_malloc(strlen(tag)+strlen(contents)+2); strcpy(comment, tag); strcat(comment, "="); strcat(comment, contents); vorbis_comment_add(vc, comment); + _ogg_free(comment); } /* This is more or less the same as strncasecmp - but that doesn't exist @@ -88,27 +89,30 @@ char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count){ long i; int found = 0; int taglen = strlen(tag)+1; /* +1 for the = we append */ - char *fulltag = alloca(taglen+ 1); + char *fulltag = _ogg_malloc(taglen+1); strcpy(fulltag, tag); strcat(fulltag, "="); for(i=0;icomments;i++){ if(!tagcompare(vc->user_comments[i], fulltag, taglen)){ - if(count == found) + if(count == found) { /* We return a pointer to the data, not a copy */ - return vc->user_comments[i] + taglen; - else + _ogg_free(fulltag); + return vc->user_comments[i] + taglen; + } else { found++; + } } } + _ogg_free(fulltag); return NULL; /* didn't find anything */ } int vorbis_comment_query_count(vorbis_comment *vc, const char *tag){ int i,count=0; int taglen = strlen(tag)+1; /* +1 for the = we append */ - char *fulltag = alloca(taglen+1); + char *fulltag = _ogg_malloc(taglen+1); strcpy(fulltag,tag); strcat(fulltag, "="); @@ -117,6 +121,7 @@ int vorbis_comment_query_count(vorbis_comment *vc, const char *tag){ count++; } + _ogg_free(fulltag); return count; } @@ -206,9 +211,9 @@ static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ vi->channels=oggpack_read(opb,8); vi->rate=oggpack_read(opb,32); - vi->bitrate_upper=oggpack_read(opb,32); - vi->bitrate_nominal=oggpack_read(opb,32); - vi->bitrate_lower=oggpack_read(opb,32); + vi->bitrate_upper=(ogg_int32_t)oggpack_read(opb,32); + vi->bitrate_nominal=(ogg_int32_t)oggpack_read(opb,32); + vi->bitrate_lower=(ogg_int32_t)oggpack_read(opb,32); ci->blocksizes[0]=1<blocksizes[1]=1<backend_state; - if(!b||vi->channels<=0){ + if(!b||vi->channels<=0||vi->channels>256){ + b = NULL; ret=OV_EFAULT; goto err_out; } @@ -642,7 +648,7 @@ int vorbis_analysis_headerout(vorbis_dsp_state *v, memset(op_code,0,sizeof(*op_code)); if(b){ - oggpack_writeclear(&opb); + if(vi->channels>0)oggpack_writeclear(&opb); if(b->header)_ogg_free(b->header); if(b->header1)_ogg_free(b->header1); if(b->header2)_ogg_free(b->header2); diff --git a/thirdparty/libvorbis/lookup.c b/thirdparty/libvorbis/lookup.c index 3321ed3dbc2..1cc1f88ee94 100644 --- a/thirdparty/libvorbis/lookup.c +++ b/thirdparty/libvorbis/lookup.c @@ -11,7 +11,6 @@ ******************************************************************** function: lookup based functions - last mod: $Id: lookup.c 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/lookup.h b/thirdparty/libvorbis/lookup.h index f8b5b82730e..4bc0f3a206b 100644 --- a/thirdparty/libvorbis/lookup.h +++ b/thirdparty/libvorbis/lookup.h @@ -11,7 +11,6 @@ ******************************************************************** function: lookup based functions - last mod: $Id: lookup.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/lookup_data.h b/thirdparty/libvorbis/lookup_data.h index 2424a1b3864..5de3cfdc7ea 100644 --- a/thirdparty/libvorbis/lookup_data.h +++ b/thirdparty/libvorbis/lookup_data.h @@ -11,7 +11,6 @@ ******************************************************************** function: lookup data; generated by lookups.pl; edit there - last mod: $Id: lookup_data.h 16037 2009-05-26 21:10:58Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/lpc.c b/thirdparty/libvorbis/lpc.c index f5199ec235c..798f4cf0766 100644 --- a/thirdparty/libvorbis/lpc.c +++ b/thirdparty/libvorbis/lpc.c @@ -11,7 +11,6 @@ ******************************************************************** function: LPC low level routines - last mod: $Id: lpc.c 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/lpc.h b/thirdparty/libvorbis/lpc.h index 39d237601bb..9cc79451b60 100644 --- a/thirdparty/libvorbis/lpc.h +++ b/thirdparty/libvorbis/lpc.h @@ -11,7 +11,6 @@ ******************************************************************** function: LPC low level routines - last mod: $Id: lpc.h 16037 2009-05-26 21:10:58Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/lsp.c b/thirdparty/libvorbis/lsp.c index 6a619f7b0c6..85880545159 100644 --- a/thirdparty/libvorbis/lsp.c +++ b/thirdparty/libvorbis/lsp.c @@ -11,7 +11,6 @@ ******************************************************************** function: LSP (also called LSF) conversion routines - last mod: $Id: lsp.c 19453 2015-03-02 22:35:34Z xiphmont $ The LSP generation code is taken (with minimal modification and a few bugfixes) from "On the Computation of the LSP Frequencies" by diff --git a/thirdparty/libvorbis/lsp.h b/thirdparty/libvorbis/lsp.h index bacfb0971f9..8a8d10e978a 100644 --- a/thirdparty/libvorbis/lsp.h +++ b/thirdparty/libvorbis/lsp.h @@ -11,7 +11,6 @@ ******************************************************************** function: LSP (also called LSF) conversion routines - last mod: $Id: lsp.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/mapping0.c b/thirdparty/libvorbis/mapping0.c index 85c7d22d832..ccb4493d4cd 100644 --- a/thirdparty/libvorbis/mapping0.c +++ b/thirdparty/libvorbis/mapping0.c @@ -11,7 +11,6 @@ ******************************************************************** function: channel mapping 0 implementation - last mod: $Id: mapping0.c 19441 2015-01-21 01:17:41Z xiphmont $ ********************************************************************/ @@ -93,7 +92,6 @@ static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb) int i,b; vorbis_info_mapping0 *info=_ogg_calloc(1,sizeof(*info)); codec_setup_info *ci=vi->codec_setup; - memset(info,0,sizeof(*info)); if(vi->channels<=0)goto err_out; b=oggpack_read(opb,1); diff --git a/thirdparty/libvorbis/masking.h b/thirdparty/libvorbis/masking.h index 3576ab78854..955e18c719b 100644 --- a/thirdparty/libvorbis/masking.h +++ b/thirdparty/libvorbis/masking.h @@ -11,7 +11,6 @@ ******************************************************************** function: masking curve data for psychoacoustics - last mod: $Id: masking.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/mdct.c b/thirdparty/libvorbis/mdct.c index 0816331805c..f3f1ed805b5 100644 --- a/thirdparty/libvorbis/mdct.c +++ b/thirdparty/libvorbis/mdct.c @@ -12,7 +12,6 @@ function: normalized modified discrete cosine transform power of two length transform only [64 <= n ] - last mod: $Id: mdct.c 16227 2009-07-08 06:58:46Z xiphmont $ Original algorithm adapted long ago from _The use of multirate filter banks for coding of high quality digital audio_, by T. Sporer, diff --git a/thirdparty/libvorbis/mdct.h b/thirdparty/libvorbis/mdct.h index 3ed94333c51..3b8c9ba4a23 100644 --- a/thirdparty/libvorbis/mdct.h +++ b/thirdparty/libvorbis/mdct.h @@ -11,7 +11,6 @@ ******************************************************************** function: modified discrete cosine transform prototypes - last mod: $Id: mdct.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/misc.h b/thirdparty/libvorbis/misc.h index 73b45198985..13788445a34 100644 --- a/thirdparty/libvorbis/misc.h +++ b/thirdparty/libvorbis/misc.h @@ -11,7 +11,6 @@ ******************************************************************** function: miscellaneous prototypes - last mod: $Id: misc.h 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/floor_all.h b/thirdparty/libvorbis/modes/floor_all.h index 4292be326e2..20928aac877 100644 --- a/thirdparty/libvorbis/modes/floor_all.h +++ b/thirdparty/libvorbis/modes/floor_all.h @@ -11,7 +11,6 @@ ******************************************************************** function: key floor settings - last mod: $Id: floor_all.h 17050 2010-03-26 01:34:42Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/psych_11.h b/thirdparty/libvorbis/modes/psych_11.h index 844a8ed3cd1..cc5eea2402a 100644 --- a/thirdparty/libvorbis/modes/psych_11.h +++ b/thirdparty/libvorbis/modes/psych_11.h @@ -11,7 +11,6 @@ ******************************************************************** function: 11kHz settings - last mod: $Id: psych_11.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/psych_16.h b/thirdparty/libvorbis/modes/psych_16.h index 1c10b3954e3..477cb4d90f1 100644 --- a/thirdparty/libvorbis/modes/psych_16.h +++ b/thirdparty/libvorbis/modes/psych_16.h @@ -11,7 +11,6 @@ ******************************************************************** function: 16kHz settings - last mod: $Id: psych_16.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/psych_44.h b/thirdparty/libvorbis/modes/psych_44.h index f05c0326535..6c9eaa4e5f7 100644 --- a/thirdparty/libvorbis/modes/psych_44.h +++ b/thirdparty/libvorbis/modes/psych_44.h @@ -11,7 +11,6 @@ ******************************************************************** function: key psychoacoustic settings for 44.1/48kHz - last mod: $Id: psych_44.h 16962 2010-03-11 07:30:34Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/psych_8.h b/thirdparty/libvorbis/modes/psych_8.h index 0e2dd573719..277db8436c4 100644 --- a/thirdparty/libvorbis/modes/psych_8.h +++ b/thirdparty/libvorbis/modes/psych_8.h @@ -11,7 +11,6 @@ ******************************************************************** function: 8kHz psychoacoustic settings - last mod: $Id: psych_8.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/residue_16.h b/thirdparty/libvorbis/modes/residue_16.h index dcaca5451e5..3e05471cec1 100644 --- a/thirdparty/libvorbis/modes/residue_16.h +++ b/thirdparty/libvorbis/modes/residue_16.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel residue templates 16/22kHz - last mod: $Id: residue_16.h 16962 2010-03-11 07:30:34Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/residue_44.h b/thirdparty/libvorbis/modes/residue_44.h index 236c18341b9..e89bc0e4861 100644 --- a/thirdparty/libvorbis/modes/residue_44.h +++ b/thirdparty/libvorbis/modes/residue_44.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel residue templates for 32/44.1/48kHz - last mod: $Id: residue_44.h 16962 2010-03-11 07:30:34Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/residue_44p51.h b/thirdparty/libvorbis/modes/residue_44p51.h index a52cc5245e5..7f33e250e27 100644 --- a/thirdparty/libvorbis/modes/residue_44p51.h +++ b/thirdparty/libvorbis/modes/residue_44p51.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel residue templates for 32/44.1/48kHz uncoupled - last mod: $Id: residue_44p51.h 19013 2013-11-12 04:04:50Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/residue_44u.h b/thirdparty/libvorbis/modes/residue_44u.h index 92c4a09ce31..e55ac12548d 100644 --- a/thirdparty/libvorbis/modes/residue_44u.h +++ b/thirdparty/libvorbis/modes/residue_44u.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel residue templates for 32/44.1/48kHz uncoupled - last mod: $Id: residue_44u.h 16962 2010-03-11 07:30:34Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/residue_8.h b/thirdparty/libvorbis/modes/residue_8.h index 94c6d84c440..ae123a276a8 100644 --- a/thirdparty/libvorbis/modes/residue_8.h +++ b/thirdparty/libvorbis/modes/residue_8.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel residue templates 8/11kHz - last mod: $Id: residue_8.h 16962 2010-03-11 07:30:34Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_11.h b/thirdparty/libvorbis/modes/setup_11.h index 4c2d619ca29..0cbcaafcb26 100644 --- a/thirdparty/libvorbis/modes/setup_11.h +++ b/thirdparty/libvorbis/modes/setup_11.h @@ -11,7 +11,6 @@ ******************************************************************** function: 11kHz settings - last mod: $Id: setup_11.h 16894 2010-02-12 20:32:12Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_16.h b/thirdparty/libvorbis/modes/setup_16.h index 336007f98e3..d59ad70d2e3 100644 --- a/thirdparty/libvorbis/modes/setup_16.h +++ b/thirdparty/libvorbis/modes/setup_16.h @@ -11,7 +11,6 @@ ******************************************************************** function: 16kHz settings - last mod: $Id: setup_16.h 16894 2010-02-12 20:32:12Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_22.h b/thirdparty/libvorbis/modes/setup_22.h index 4fd5e57111a..bc38af9630e 100644 --- a/thirdparty/libvorbis/modes/setup_22.h +++ b/thirdparty/libvorbis/modes/setup_22.h @@ -11,7 +11,6 @@ ******************************************************************** function: 22kHz settings - last mod: $Id: setup_22.h 17026 2010-03-25 05:00:27Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_32.h b/thirdparty/libvorbis/modes/setup_32.h index 2275ac96153..f66a0bcd002 100644 --- a/thirdparty/libvorbis/modes/setup_32.h +++ b/thirdparty/libvorbis/modes/setup_32.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel settings for 32kHz - last mod: $Id: setup_32.h 16894 2010-02-12 20:32:12Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_44.h b/thirdparty/libvorbis/modes/setup_44.h index 3b88a89ac56..a189b5fb953 100644 --- a/thirdparty/libvorbis/modes/setup_44.h +++ b/thirdparty/libvorbis/modes/setup_44.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel settings for 44.1/48kHz - last mod: $Id: setup_44.h 16962 2010-03-11 07:30:34Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_44p51.h b/thirdparty/libvorbis/modes/setup_44p51.h index 67d99796083..3bde7b340cb 100644 --- a/thirdparty/libvorbis/modes/setup_44p51.h +++ b/thirdparty/libvorbis/modes/setup_44p51.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel settings for 44.1/48kHz 5.1 surround modes - last mod: $Id: setup_44p51.h 19013 2013-11-12 04:04:50Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_44u.h b/thirdparty/libvorbis/modes/setup_44u.h index 568b5f8959d..7ae3af6b2a9 100644 --- a/thirdparty/libvorbis/modes/setup_44u.h +++ b/thirdparty/libvorbis/modes/setup_44u.h @@ -11,7 +11,6 @@ ******************************************************************** function: toplevel settings for 44.1/48kHz uncoupled modes - last mod: $Id: setup_44u.h 16962 2010-03-11 07:30:34Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_8.h b/thirdparty/libvorbis/modes/setup_8.h index 14c48374fa1..7502556879d 100644 --- a/thirdparty/libvorbis/modes/setup_8.h +++ b/thirdparty/libvorbis/modes/setup_8.h @@ -11,7 +11,6 @@ ******************************************************************** function: 8kHz settings - last mod: $Id: setup_8.h 16894 2010-02-12 20:32:12Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/modes/setup_X.h b/thirdparty/libvorbis/modes/setup_X.h index a69f5d40a24..2229a5ef2fd 100644 --- a/thirdparty/libvorbis/modes/setup_X.h +++ b/thirdparty/libvorbis/modes/setup_X.h @@ -11,7 +11,6 @@ ******************************************************************** function: catch-all toplevel settings for q modes only - last mod: $Id: setup_X.h 16894 2010-02-12 20:32:12Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/os.h b/thirdparty/libvorbis/os.h index 8bc3e5fe9ce..416a401dd1b 100644 --- a/thirdparty/libvorbis/os.h +++ b/thirdparty/libvorbis/os.h @@ -13,7 +13,6 @@ ******************************************************************** function: #ifdef jail to whip a few platforms into the UNIX ideal. - last mod: $Id: os.h 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ @@ -31,7 +30,7 @@ # ifdef __GNUC__ # define STIN static __inline__ -# elif _WIN32 +# elif defined(_WIN32) # define STIN static __inline # else # define STIN static diff --git a/thirdparty/libvorbis/psy.c b/thirdparty/libvorbis/psy.c index f7a44c6d005..422c6f1e412 100644 --- a/thirdparty/libvorbis/psy.c +++ b/thirdparty/libvorbis/psy.c @@ -11,7 +11,6 @@ ******************************************************************** function: psychoacoustics not including preecho - last mod: $Id: psy.c 18077 2011-09-02 02:49:00Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/psy.h b/thirdparty/libvorbis/psy.h index c1ea8244014..ab2534db3a8 100644 --- a/thirdparty/libvorbis/psy.h +++ b/thirdparty/libvorbis/psy.h @@ -11,7 +11,6 @@ ******************************************************************** function: random psychoacoustics (not including preecho) - last mod: $Id: psy.h 16946 2010-03-03 16:12:40Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/psytune.c b/thirdparty/libvorbis/psytune.c index 64c13171f72..6952136c6b9 100644 --- a/thirdparty/libvorbis/psytune.c +++ b/thirdparty/libvorbis/psytune.c @@ -12,7 +12,6 @@ function: simple utility that runs audio through the psychoacoustics without encoding - last mod: $Id: psytune.c 16037 2009-05-26 21:10:58Z xiphmont $ ********************************************************************/ @@ -41,11 +40,11 @@ static vorbis_info_psy_global _psy_set0G={ 0, /* decaydBpms */ 8, /* lines per eighth octave */ - + /* thresh sample period, preecho clamp trigger threshhold, range, minenergy */ 256, {26.f,26.f,26.f,30.f}, {-90.f,-90.f,-90.f,-90.f}, -90.f, - -6.f, - + -6.f, + 0, 0., @@ -68,7 +67,7 @@ static vp_couple _vp_couple0[]={ static vorbis_info_psy _psy_set0={ ATH_Bark_dB_lineaggressive, - + -100.f, -140.f, 6.f, /* floor master att */ @@ -148,7 +147,7 @@ static vorbis_info_psy _psy_set0={ .900f, 0.f, /*11500*/ .900f, 1.f, /*16000*/ }, - + 95.f, /* even decade + 5 is important; saves an rint() later in a tight loop) */ -44., @@ -159,7 +158,7 @@ static vorbis_info_psy _psy_set0={ static vorbis_info_floor1 _floor_set0={1, {0}, - + {32}, {0}, {0}, @@ -171,12 +170,12 @@ static vorbis_info_floor1 _floor_set0={1, 88,31,243, 14,54,143,460, - - 6,3,10, 22,18,26, 41,36,47, - 69,61,78, 112,99,126, 185,162,211, + + 6,3,10, 22,18,26, 41,36,47, + 69,61,78, 112,99,126, 185,162,211, 329,282,387, 672,553,825 }, - + 60,30,400, 20,8,1,18., 20,600, @@ -184,8 +183,8 @@ static vorbis_info_floor1 _floor_set0={1, static vorbis_info_mapping0 mapping_info={1,{0,1},{0},{0},{0},0, 1, {0},{1}}; -static codec_setup_info codec_setup0={ {0,0}, - 1,1,1,1,1,0,1, +static codec_setup_info codec_setup0={ {0,0}, + 1,1,1,1,1,0,1, {NULL}, {0},{&mapping_info}, {0},{NULL}, @@ -194,7 +193,7 @@ static codec_setup_info codec_setup0={ {0,0}, {NULL}, {&_psy_set0}, &_psy_set0G}; - + static int noisy=0; void analysis(char *base,int i,float *v,int n,int bark,int dB){ if(noisy){ @@ -212,7 +211,7 @@ void analysis(char *base,int i,float *v,int n,int bark,int dB){ fprintf(of,"%g ",toBARK(22050.f*j/n)); else fprintf(of,"%g ",(float)j); - + if(dB){ fprintf(of,"%g\n",todB(v+j)); }else{ @@ -269,7 +268,7 @@ int main(int argc,char *argv[]){ framesize=atoi(argv[0]); argv++; } - + vi.channels=2; vi.codec_setup=&codec_setup0; @@ -292,7 +291,7 @@ int main(int argc,char *argv[]){ /* we cheat on the WAV header; we just bypass 44 bytes and never verify that it matches 16bit/stereo/44.1kHz. */ - + fread(buffer,1,44,stdin); fwrite(buffer,1,44,stdout); memset(buffer,0,framesize*2); @@ -302,10 +301,10 @@ int main(int argc,char *argv[]){ fprintf(stderr,"Processing for frame size %d...\n",framesize); while(!eos){ - long bytes=fread(buffer2,1,framesize*2,stdin); + long bytes=fread(buffer2,1,framesize*2,stdin); if(byteslocal_ampmax[i])local_ampmax[i]=temp; } if(local_ampmax[i]>ampmax)ampmax=local_ampmax[i]; - + mdct_forward(&m_look,pcm[i],mdct); for(j=0;j1500) fprintf(stderr,"%ld ",frameno+i); - + analysis("res",frameno+i,pcm[i],framesize/2,1,0); analysis("codedflr",frameno+i,flr[i],framesize/2,1,1); } @@ -416,7 +415,7 @@ int main(int argc,char *argv[]){ &vi, pcm, nonzero); - + for(i=0;i<2;i++) analysis("quant",frameno+i,pcm[i],framesize/2,1,0); @@ -426,7 +425,7 @@ int main(int argc,char *argv[]){ &mapping_info, pcm, nonzero); - + for(i=0;i<2;i++) analysis("coupled",frameno+i,pcm[i],framesize/2,1,0); @@ -434,11 +433,11 @@ int main(int argc,char *argv[]){ for(i=mapping_info.coupling_steps-1;i>=0;i--){ float *pcmM=pcm[mapping_info.coupling_mag[i]]; float *pcmA=pcm[mapping_info.coupling_ang[i]]; - + for(j=0;j0) if(ang>0){ pcmM[j]=mag; @@ -457,7 +456,7 @@ int main(int argc,char *argv[]){ } } } - + for(i=0;i<2;i++) analysis("decoupled",frameno+i,pcm[i],framesize/2,1,0); @@ -479,7 +478,7 @@ int main(int argc,char *argv[]){ } - + /* write data. Use the part of buffer we're about to shift out */ for(i=0;i<2;i++){ char *ptr=buffer+i*2; @@ -503,7 +502,7 @@ int main(int argc,char *argv[]){ ptr+=4; } } - + fprintf(stderr,"*"); fwrite(buffer,1,framesize*2,stdout); memmove(buffer,buffer2,framesize*2); diff --git a/thirdparty/libvorbis/registry.c b/thirdparty/libvorbis/registry.c index 3961ed14033..74f7ef0396b 100644 --- a/thirdparty/libvorbis/registry.c +++ b/thirdparty/libvorbis/registry.c @@ -11,7 +11,6 @@ ******************************************************************** function: registry for time, floor, res backends and channel mappings - last mod: $Id: registry.c 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/registry.h b/thirdparty/libvorbis/registry.h index 3ae04776d85..599d9599426 100644 --- a/thirdparty/libvorbis/registry.h +++ b/thirdparty/libvorbis/registry.h @@ -11,7 +11,6 @@ ******************************************************************** function: registry for time, floor, res backends and channel mappings - last mod: $Id: registry.h 15531 2008-11-24 23:50:06Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/res0.c b/thirdparty/libvorbis/res0.c index ec11488c2f2..6d623d730fb 100644 --- a/thirdparty/libvorbis/res0.c +++ b/thirdparty/libvorbis/res0.c @@ -11,7 +11,6 @@ ******************************************************************** function: residue backend 0, 1 and 2 implementation - last mod: $Id: res0.c 19441 2015-01-21 01:17:41Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/scales.h b/thirdparty/libvorbis/scales.h index 613f796e770..18bc4e75186 100644 --- a/thirdparty/libvorbis/scales.h +++ b/thirdparty/libvorbis/scales.h @@ -11,7 +11,6 @@ ******************************************************************** function: linear scale -> dB, Bark and Mel scales - last mod: $Id: scales.h 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/sharedbook.c b/thirdparty/libvorbis/sharedbook.c index 6bfdf7311ee..4545d4f4590 100644 --- a/thirdparty/libvorbis/sharedbook.c +++ b/thirdparty/libvorbis/sharedbook.c @@ -11,11 +11,11 @@ ******************************************************************** function: basic shared codebook operations - last mod: $Id: sharedbook.c 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ #include +#include #include #include #include @@ -158,25 +158,34 @@ ogg_uint32_t *_make_words(char *l,long n,long sparsecount){ that's portable and totally safe against roundoff, but I haven't thought of it. Therefore, we opt on the side of caution */ long _book_maptype1_quantvals(const static_codebook *b){ - long vals=floor(pow((float)b->entries,1.f/b->dim)); + long vals; + if(b->entries<1){ + return(0); + } + vals=floor(pow((float)b->entries,1.f/b->dim)); /* the above *should* be reliable, but we'll not assume that FP is ever reliable when bitstream sync is at stake; verify via integer means that vals really is the greatest value of dim for which vals^b->bim <= b->entries */ /* treat the above as an initial guess */ + if(vals<1){ + vals=1; + } while(1){ long acc=1; long acc1=1; int i; for(i=0;idim;i++){ + if(b->entries/valsentries && acc1>b->entries){ + if(i>=b->dim && acc<=b->entries && acc1>b->entries){ return(vals); }else{ - if(acc>b->entries){ + if(idim || acc>b->entries){ vals--; }else{ vals++; diff --git a/thirdparty/libvorbis/smallft.c b/thirdparty/libvorbis/smallft.c index ae2bc41b6b1..6d528af423d 100644 --- a/thirdparty/libvorbis/smallft.c +++ b/thirdparty/libvorbis/smallft.c @@ -11,7 +11,6 @@ ******************************************************************** function: *unnormalized* fft transform - last mod: $Id: smallft.c 16227 2009-07-08 06:58:46Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/smallft.h b/thirdparty/libvorbis/smallft.h index 456497326ca..9e867c67d22 100644 --- a/thirdparty/libvorbis/smallft.h +++ b/thirdparty/libvorbis/smallft.h @@ -11,7 +11,6 @@ ******************************************************************** function: fft transform - last mod: $Id: smallft.h 13293 2007-07-24 00:09:47Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/synthesis.c b/thirdparty/libvorbis/synthesis.c index 932d271a63a..5f6092c3d30 100644 --- a/thirdparty/libvorbis/synthesis.c +++ b/thirdparty/libvorbis/synthesis.c @@ -11,7 +11,6 @@ ******************************************************************** function: single-block PCM synthesis - last mod: $Id: synthesis.c 19441 2015-01-21 01:17:41Z xiphmont $ ********************************************************************/ @@ -117,7 +116,7 @@ int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op){ if(!ci->mode_param[mode]){ return(OV_EBADPACKET); } - + vb->W=ci->mode_param[mode]->blockflag; if(vb->W){ vb->lW=oggpack_read(opb,1); diff --git a/thirdparty/libvorbis/tone.c b/thirdparty/libvorbis/tone.c index 73afc67d4c3..5b8b0206040 100644 --- a/thirdparty/libvorbis/tone.c +++ b/thirdparty/libvorbis/tone.c @@ -12,7 +12,7 @@ int main (int argc,char *argv[]){ int i,j; double *f; double *amp; - + if(argc<2)usage(); f=alloca(sizeof(*f)*(argc-1)); @@ -21,7 +21,7 @@ int main (int argc,char *argv[]){ i=0; while(argv[i+1]){ char *pos=strchr(argv[i+1],','); - + f[i]=atof(argv[i+1]); if(pos) amp[i]=atof(pos+1)*32767.f; diff --git a/thirdparty/libvorbis/vorbis/codec.h b/thirdparty/libvorbis/vorbis/codec.h index 999aa33510a..42aa29138e5 100644 --- a/thirdparty/libvorbis/vorbis/codec.h +++ b/thirdparty/libvorbis/vorbis/codec.h @@ -11,7 +11,6 @@ ******************************************************************** function: libvorbis codec headers - last mod: $Id: codec.h 17021 2010-03-24 09:29:41Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/vorbis/vorbisenc.h b/thirdparty/libvorbis/vorbis/vorbisenc.h index 02332b50caf..55f3b4a6672 100644 --- a/thirdparty/libvorbis/vorbis/vorbisenc.h +++ b/thirdparty/libvorbis/vorbis/vorbisenc.h @@ -11,7 +11,6 @@ ******************************************************************** function: vorbis encode-engine setup - last mod: $Id: vorbisenc.h 17021 2010-03-24 09:29:41Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/vorbis/vorbisfile.h b/thirdparty/libvorbis/vorbis/vorbisfile.h index 9271331e723..56626119bbd 100644 --- a/thirdparty/libvorbis/vorbis/vorbisfile.h +++ b/thirdparty/libvorbis/vorbis/vorbisfile.h @@ -11,7 +11,6 @@ ******************************************************************** function: stdio-based convenience library for opening/seeking/decoding - last mod: $Id: vorbisfile.h 17182 2010-04-29 03:48:32Z xiphmont $ ********************************************************************/ diff --git a/thirdparty/libvorbis/vorbisenc.c b/thirdparty/libvorbis/vorbisenc.c index b5d621e9009..4a4607cb413 100644 --- a/thirdparty/libvorbis/vorbisenc.c +++ b/thirdparty/libvorbis/vorbisenc.c @@ -11,7 +11,6 @@ ******************************************************************** function: simple programmatic interface for encoder mode setup - last mod: $Id: vorbisenc.c 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/vorbisfile.c b/thirdparty/libvorbis/vorbisfile.c index fc0c86ff11d..b570c3c5f6d 100644 --- a/thirdparty/libvorbis/vorbisfile.c +++ b/thirdparty/libvorbis/vorbisfile.c @@ -11,7 +11,6 @@ ******************************************************************** function: stdio-based convenience library for opening/seeking/decoding - last mod: $Id: vorbisfile.c 19457 2015-03-03 00:15:29Z giles $ ********************************************************************/ diff --git a/thirdparty/libvorbis/window.c b/thirdparty/libvorbis/window.c index 0305b79297e..b3b7ce0163c 100644 --- a/thirdparty/libvorbis/window.c +++ b/thirdparty/libvorbis/window.c @@ -11,7 +11,6 @@ ******************************************************************** function: window functions - last mod: $Id: window.c 19028 2013-12-02 23:23:39Z tterribe $ ********************************************************************/ diff --git a/thirdparty/libvorbis/window.h b/thirdparty/libvorbis/window.h index 51f97599f59..6ac260749ee 100644 --- a/thirdparty/libvorbis/window.h +++ b/thirdparty/libvorbis/window.h @@ -11,7 +11,6 @@ ******************************************************************** function: window functions - last mod: $Id: window.h 19028 2013-12-02 23:23:39Z tterribe $ ********************************************************************/