Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix of implicit type conversion. #79

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bitrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void vorbis_bitrate_init(vorbis_info *vi,bitrate_manager_state *bm){
bm->min_bitsper= rint(1.*bi->min_rate*halfsamples/ratesamples);
bm->max_bitsper= rint(1.*bi->max_rate*halfsamples/ratesamples);

bm->avgfloat=PACKETBLOBS/2;
bm->avgfloat=(double)(PACKETBLOBS)/2;

/* not a necessary fix, but one that leads to a more balanced
typical initialization */
Expand Down
2 changes: 1 addition & 1 deletion lib/envelope.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static int _ve_amp(envelope_lookup *ve,
/* stretch is used to gradually lengthen the number of windows
considered prevoius-to-potential-trigger */
int stretch=max(VE_MINSTRETCH,ve->stretch/2);
float penalty=gi->stretch_penalty-(ve->stretch/2-VE_MINSTRETCH);
float penalty=gi->stretch_penalty-((float)(ve->stretch)/2-VE_MINSTRETCH);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stretch itself is calculated with integer division, so maybe that's a more accurate heuristic for the penalty?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know better

if(penalty<0.f)penalty=0.f;
if(penalty>gi->stretch_penalty)penalty=gi->stretch_penalty;

Expand Down
2 changes: 1 addition & 1 deletion lib/floor1.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ static int inspect_error(int x0,int x1,int y0,int y1,const float *mask,

if(info->maxover*info->maxover/n>info->maxerr)return(0);
if(info->maxunder*info->maxunder/n>info->maxerr)return(0);
if(mse/n>info->maxerr)return(1);
if((float)(mse)/n>info->maxerr)return(1);
return(0);
}

Expand Down