Open Bug 1616511 Opened 6 years ago Updated 3 years ago

AV1 wedge masks make up 42% of BSS segment size in libxul

Categories

(Core :: Audio/Video: Playback, task, P3)

task

Tracking

()

People

(Reporter: sg, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [overhead:369K])

The following symbols related to wedge from libav1 and libdav1d masks make up a significant portion of the BSS segment size of libxul:

0000000226747392 0000000000000512 b wedge_masks_420_4x4
0000000226743296 0000000000001024 b wedge_masks_420_4x8
0000000226721792 0000000000001024 b wedge_masks_420_8x4
0000000226746368 0000000000001024 b wedge_masks_422_4x8
0000000226670592 0000000000002048 b wedge_masks_420_16x4
0000000226735104 0000000000002048 b wedge_masks_420_4x16
0000000226713600 0000000000002048 b wedge_masks_420_8x8
0000000226741248 0000000000002048 b wedge_masks_422_4x16
0000000226719744 0000000000002048 b wedge_masks_422_8x8
0000000226744320 0000000000002048 b wedge_masks_444_8x8
0000000226654208 0000000000004096 b wedge_masks_420_16x8
0000000226697216 0000000000004096 b wedge_masks_420_8x16
0000000226666496 0000000000004096 b wedge_masks_422_16x8
0000000226731008 0000000000004096 b wedge_masks_422_4x32
0000000226709504 0000000000004096 b wedge_masks_422_8x16
0000000226715648 0000000000004096 b wedge_masks_444_16x8
0000000226737152 0000000000004096 b wedge_masks_444_8x16
0000000226309632 0000000000005632 b wedge_masks
0000000226621440 0000000000008192 b wedge_masks_420_16x16
0000000226646016 0000000000008192 b wedge_masks_422_16x16
0000000226689024 0000000000008192 b wedge_masks_422_8x32
0000000226701312 0000000000008192 b wedge_masks_444_16x16
0000000226658304 0000000000008192 b wedge_masks_444_32x8
0000000226722816 0000000000008192 b wedge_masks_444_8x32
0000000226605056 0000000000016384 b wedge_masks_422_16x32
0000000226672640 0000000000016384 b wedge_masks_444_16x32
0000000226629632 0000000000016384 b wedge_masks_444_32x16
0000000226864192 0000000000016896 b dav1d_wedge_masks
0000000226572288 0000000000032768 b wedge_masks_444_32x32
0000000226315264 0000000000049152 b wedge_mask_obl
0000000226364416 0000000000131072 b wedge_mask_buf

On x64 Linux, these attribute to 42% of the total BSS segment size, for which a copy must be present for every process using libxul.so.

This seems wasteful. IIUC, wedge_mask_buf is only used during initialization. It might be better allocated on the heap, in particular since I guess it doesn't need to be initialized in every process using libxul.so at all.

The other variables seem to be able to be precomputed in principle and then made constant, which would move them out of the BSS segment. (The data they are based on is already precomputed but they are copied from a different structure at runtime at https://searchfox.org/mozilla-central/source/third_party/aom/av1/common/reconinter.c#429 in libav1).

Whiteboard: [overhead:369K]

The issue of wedge_mask_buf is also mentioned in https://bugs.chromium.org/p/aomedia/issues/detail?id=1238#c4, but the issue was closed as WONTFIX, without responding to this specific variable.

Component: Audio/Video → Audio/Video: Playback

It seems like most of the symbols come from libaom rather than dav1d. Since we default to dav1d now, we should be able to remove libaom entirely, which would hopefully resolve this.

If dav1d itself is still a problem, we can explore moving things to a dynamically loaded library.

Priority: -- → P3

The largest ones are from libaom, but I think all of those are from libdav1d:

0000000226747392 0000000000000512 b wedge_masks_420_4x4
0000000226743296 0000000000001024 b wedge_masks_420_4x8
0000000226721792 0000000000001024 b wedge_masks_420_8x4
0000000226746368 0000000000001024 b wedge_masks_422_4x8
0000000226670592 0000000000002048 b wedge_masks_420_16x4
0000000226735104 0000000000002048 b wedge_masks_420_4x16
0000000226713600 0000000000002048 b wedge_masks_420_8x8
0000000226741248 0000000000002048 b wedge_masks_422_4x16
0000000226719744 0000000000002048 b wedge_masks_422_8x8
0000000226744320 0000000000002048 b wedge_masks_444_8x8
0000000226654208 0000000000004096 b wedge_masks_420_16x8
0000000226697216 0000000000004096 b wedge_masks_420_8x16
0000000226666496 0000000000004096 b wedge_masks_422_16x8
0000000226731008 0000000000004096 b wedge_masks_422_4x32
0000000226709504 0000000000004096 b wedge_masks_422_8x16
0000000226715648 0000000000004096 b wedge_masks_444_16x8
0000000226737152 0000000000004096 b wedge_masks_444_8x16
0000000226621440 0000000000008192 b wedge_masks_420_16x16
0000000226646016 0000000000008192 b wedge_masks_422_16x16
0000000226689024 0000000000008192 b wedge_masks_422_8x32
0000000226701312 0000000000008192 b wedge_masks_444_16x16
0000000226658304 0000000000008192 b wedge_masks_444_32x8
0000000226722816 0000000000008192 b wedge_masks_444_8x32
0000000226605056 0000000000016384 b wedge_masks_422_16x32
0000000226672640 0000000000016384 b wedge_masks_444_16x32
0000000226629632 0000000000016384 b wedge_masks_444_32x16
0000000226864192 0000000000016896 b dav1d_wedge_masks
0000000226572288 0000000000032768 b wedge_masks_444_32x32

I guess loading libdav1d dynamically might be a good idea, since it will not be used in a lot of content processes (in particular with fission enabled).

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.