Closed
Bug 961044
Opened 10 years ago
Closed 10 years ago
vorbis static codebook length tables take up too much space
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
Tracking | Status | |
---|---|---|
b2g-v1.3T | --- | fixed |
People
(Reporter: froydnj, Assigned: xiphmont)
References
(Blocks 1 open bug)
Details
(Whiteboard: [MemShrink:P2])
Attachments
(2 files)
436.73 KB,
patch
|
Details | Diff | Splinter Review | |
517.18 KB,
patch
|
cpearce
:
review+
|
Details | Diff | Splinter Review |
The _vq_lengthlist__* arrays in lib/books/* are all defined as arrays of long, which means they take up not quite 2.5MB on an x86-64 build and half of that on a 32-bit build. AFAICS, though, there's no need for them to be arrays of long; arrays of uint8_t/unsigned char would work just fine, as none of the entries are ever large (scanning through the code suggests entries are limited to values <= 32). The lists also don't appear to be used in any sort of vectorized assembly code, suggesting they can be changed freely. Reducing them to arrays of uint8_t/unsigned char would be a huge space win. I'm not familiar enough with vorbis to know whether this is a duplicate of bug 937455; omitting them sounds different than shrinking them, but if we can do both, that'd be great!
Comment 1•10 years ago
|
||
Monty, can you take a look?
Updated•10 years ago
|
Flags: needinfo?(monty)
Comment 2•10 years ago
|
||
Nice find!
Comment 3•10 years ago
|
||
Thinking some more... vorbis isn't that common(?), so most of the time this won't affect physical memory consumption, but it will reduce virtual memory consumption, which is good for Win32.
Comment 4•10 years ago
|
||
Changing the base time to save footprint is indeed different from trimming the tables themselves. This is a lot easier though!
Blocks: 937455
Assignee | ||
Comment 5•10 years ago
|
||
:derf: Will look yes. BTW, we should only have encoder tables for modes we actually use. They're split into a few ranges of sampling rates (8, 16, 44+ IIRC) and channel sets (mono, stereo, surround). If any of those can be eliminated as unused, that reclaims space too.
Assignee | ||
Comment 6•10 years ago
|
||
OK, looked it over and looked at the code history. There is no practical reason the lengthlist needs to be long; uint8 is more than sufficient. There will need to be only minor code work to make it so-- testing will be a bigger deal than the actual modifications. The long lengthlists appear stem from a time when the lengthlists were just not very big. When things moved from tesselated to lattice codebooks (and lengthlists became larger), they weren't changed to take less space. I don't see any external considerations either; shall I make this change upstream? One reason I'm offering is because there _must_ be something I'm missing, this just seems too obvious.
Assignee | ||
Comment 7•10 years ago
|
||
(In reply to Ralph Giles (:rillian) from comment #4) > Changing the base time to save footprint is indeed different from trimming > the tables themselves. This is a lot easier though! We could do both, both look quite easy really.
Flags: needinfo?(monty)
Comment 8•10 years ago
|
||
(In reply to Monty Montgomery (:xiphmont) from comment #6) > I don't see any external considerations either; shall I make this change > upstream? Yes, please.
Assignee: nobody → monty
Updated•10 years ago
|
Whiteboard: [MemShrink] → [MemShrink:P2]
Assignee | ||
Comment 9•10 years ago
|
||
I have landed the lengthlist long -> char conversion upstream. I used 'char' and not another type to follow the preexisting convention elsewhere in the codebook code. I'll cut a new libvorbis dot release from the current code today.
Comment 10•10 years ago
|
||
Attaching patch for monty's upstream fix. Rather than carry this, I'll prepare a patch moving us to the new 1.3.4 release.
Comment 11•10 years ago
|
||
Attachment #8363810 -
Flags: review?(cpearce)
Comment 12•10 years ago
|
||
Pushed to try https://tbpl.mozilla.org/?tree=Try&rev=a45e6e7d64eb
Updated•10 years ago
|
Attachment #8363810 -
Flags: review?(cpearce) → review+
https://hg.mozilla.org/mozilla-central/rev/6aefaebc145d
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Reporter | ||
Comment 15•10 years ago
|
||
Nominating for 1.3T based on library footprint reduction (somewhere around a megabyte).
blocking-b2g: --- → 1.3T?
Comment 16•10 years ago
|
||
can you confirm is this memory saving in RAM or storage size? Thanks
Flags: needinfo?(nfroyd)
Comment 17•10 years ago
|
||
Joe, from what I understand this is mainly storage size. I recommended Nathan nom these since I believe we are short on system partition space on the tarako.
Reporter | ||
Comment 18•10 years ago
|
||
I don't have anything to add to what Ben already said.
Flags: needinfo?(nfroyd)
Updated•10 years ago
|
blocking-b2g: 1.3T? → 1.3T+
Comment 19•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-b2g28_v1_3t/rev/aada028a135e
status-b2g-v1.3T:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•