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

Reduce memory #44

Open
xnvi opened this issue Mar 23, 2021 · 0 comments
Open

Reduce memory #44

xnvi opened this issue Mar 23, 2021 · 0 comments

Comments

@xnvi
Copy link

xnvi commented Mar 23, 2021

  1. I don't found any code use ‘’faacEncStruct.coderInfo.bwpInfo‘’ , remove ‘’bwpInfo‘’ can save about 157KB for each channel.
  2. in function "faacEncEncode()"
if (!hEncoder->sampleBuff[channel])
    hEncoder->sampleBuff[channel] = (double*)AllocMemory(FRAME_LEN*sizeof(double));

tmp = hEncoder->sampleBuff[channel];

hEncoder->sampleBuff[channel]		= hEncoder->nextSampleBuff[channel];
hEncoder->nextSampleBuff[channel]	= hEncoder->next2SampleBuff[channel];
hEncoder->next2SampleBuff[channel]	= hEncoder->next3SampleBuff[channel];
hEncoder->next3SampleBuff[channel]	= tmp;

I think "nextSampleBuff" and "next2SampleBuff" is useless, so change it to this

hEncoder->sampleBuff[channel]		= hEncoder->next3SampleBuff[channel];
hEncoder->next3SampleBuff[channel]	= tmp;

can save 16KB for each channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant