[LIBMPG123] Update to version 1.25.8. CORE-14291

This commit is contained in:
Thomas Faber 2018-02-04 16:37:07 +01:00
parent f46b177e11
commit 2f8a7f36f5
No known key found for this signature in database
GPG key ID: 076E7C3D44720826
6 changed files with 52 additions and 28 deletions

View file

@ -280,10 +280,12 @@ void init_layer3(void)
int *mp;
int cb,lwin;
const unsigned char *bdf;
int switch_idx;
mp = map[j][0] = mapbuf0[j];
bdf = bi->longDiff;
for(i=0,cb = 0; cb < 8 ; cb++,i+=*bdf++)
switch_idx = (j < 3) ? 8 : 6;
for(i=0,cb = 0; cb < switch_idx ; cb++,i+=*bdf++)
{
*mp++ = (*bdf) >> 1;
*mp++ = i;
@ -465,8 +467,14 @@ static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si,int ster
}
gr_info->pow2gain = fr->gainpow2+256 - getbits_fast(fr, 8) + powdiff;
if(ms_stereo) gr_info->pow2gain += 2;
gr_info->scalefac_compress = getbits(fr, tab[4]);
if(gr_info->part2_3_length == 0)
{
if(gr_info->scalefac_compress > 0)
debug1( "scalefac_compress _should_ be zero instead of %i"
, gr_info->scalefac_compress );
gr_info->scalefac_compress = 0;
}
if(get1bit(fr))
{ /* window switch flag */
@ -553,6 +561,14 @@ static int III_get_scale_factors_1(mpg123_handle *fr, int *scf,struct gr_info_s
int num0 = slen[0][gr_info->scalefac_compress];
int num1 = slen[1][gr_info->scalefac_compress];
if(gr_info->part2_3_length == 0)
{
int i;
for(i=0;i<39;i++)
*scf++ = 0;
return 0;
}
if(gr_info->block_type == 2)
{
int i=18;
@ -667,6 +683,14 @@ static int III_get_scale_factors_2(mpg123_handle *fr, int *scf,struct gr_info_s
pnt = stab[n][(slen>>12)&0x7];
if(gr_info->part2_3_length == 0)
{
int i;
for(i=0;i<39;i++)
*scf++ = 0;
return 0;
}
for(i=0;i<4;i++)
{
int num = slen & 0x7;
@ -680,7 +704,7 @@ static int III_get_scale_factors_2(mpg123_handle *fr, int *scf,struct gr_info_s
else
for(j=0;j<(int)(pnt[i]);j++) *scf++ = 0;
}
n = (n << 1) + 1;
for(i=0;i<n;i++) *scf++ = 0;
@ -735,6 +759,12 @@ static int III_dequantize_sample(mpg123_handle *fr, real xr[SBLIMIT][SSLIMIT],in
int gainpow2_scale_idx = 378;
#endif
/* Assumption: If there is some part2_3_length at all, there should be
enough of it to work with properly. In case of zero length we silently
zero things. */
if(gr_info->part2_3_length > 0)
{
/* mhipp tree has this split up a bit... */
int num=getbitoffset(fr);
MASK_TYPE mask;
@ -1197,6 +1227,18 @@ static int III_dequantize_sample(mpg123_handle *fr, real xr[SBLIMIT][SSLIMIT],in
backbits(fr, num);
num = 0;
}
else
{
part2remain = 0;
/* Not entirely sure what good values are, must be > 0. */
gr_info->maxband[0] =
gr_info->maxband[1] =
gr_info->maxband[2] =
gr_info->maxbandl = 0;
gr_info->maxb = 1;
}
while(xrpnt < &xr[SBLIMIT][0])
*xrpnt++ = DOUBLE_TO_REAL(0.0);

View file

@ -889,26 +889,7 @@ void set_pointer(mpg123_handle *fr, long backstep)
double compute_bpf(mpg123_handle *fr)
{
double bpf;
switch(fr->lay)
{
case 1:
bpf = tabsel_123[fr->lsf][0][fr->bitrate_index];
bpf *= 12000.0 * 4.0;
bpf /= freqs[fr->sampling_frequency] <<(fr->lsf);
break;
case 2:
case 3:
bpf = tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index];
bpf *= 144000;
bpf /= freqs[fr->sampling_frequency] << (fr->lsf);
break;
default:
bpf = 1.0;
}
return bpf;
return (fr->framesize > 0) ? fr->framesize + 4.0 : 1.0;
}
int attribute_align_arg mpg123_spf(mpg123_handle *mh)