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

Slow performance (barbaric allocation of 64 MB) #3

Open
kwketh opened this issue Oct 9, 2017 · 1 comment
Open

Slow performance (barbaric allocation of 64 MB) #3

kwketh opened this issue Oct 9, 2017 · 1 comment

Comments

@kwketh
Copy link

kwketh commented Oct 9, 2017

Not expecting this to be fixed, but this is just for future reference and/or if anyone is curious why a lot of memory is allocated for any filter, no matter what image size.

(lldb) print sizeof(xbr_data)
(unsigned long) $0 = 67108864

xbr_data is allocated at:

xbrData = malloc(sizeof(xbr_data));

due to a massive array size (64 mb):

uint32_t rgbtoyuv[1<<24];

@kwketh kwketh changed the title Slow performance (Barbaric allocation of 67 MB) Slow performance (barbaric allocation of 67 MB) Oct 9, 2017
@kwketh kwketh changed the title Slow performance (barbaric allocation of 67 MB) Slow performance (barbaric allocation of 64 MB) Oct 9, 2017
@JayFoxRox
Copy link

There were 2 independent ports of a game (which uses libxbr) to original Xbox - and neither of them worked.

After investigating this as a potential toolchain issue in XboxDev/nxdk#324, we realized this is an issue in libxbr. On original Xbox, we only have 64MiB of RAM - so this code could never work.

Aside from being "stupid", the code probably causes performance issues, too:
For more than a decade, CPUs have been faster than memory, so random-index lookups in the LUT will probably trash the cache. If the CPU just did the math instead (or used smaller LUTs), it would likely be faster.

The same problem exists in ffmpeg but probably doesn't trigger on most modern machines, or people don't care for the performance.

I think this code is truly horrible and should be improved. Is this project still being maintained @Treeki ?

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

2 participants