shshankjain / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

libvpx memory usage high #247

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There are 3 large buffers in libvpx.  They limit the resolution possible on 32 
bit builds, and hurt performance.  Can they be reduced in size?

LAG
vp8\encoder\onyx_int.h:#define MAX_LAG_BUFFERS (CONFIG_REALTIME_ONLY? 1 : 25)
This is used for ALTREF and can be made 0 when not using altref.  Currently its 
25 frames

ARNR (Alt Ref Noise Reduction)
vp8\encoder\preproc.c:#define FRAMECOUNT 7
vp8\encoder\preproc.c:    ppi->frame_buffer_alloc = vpx_malloc(32 + frame_size 
* FRAMECOUNT * sizeof(unsigned char));
This also relates to ALT ref... 7 frames of filtering.  Can be set to 0
Make sure to pass arnr_maxframe 0

Token buffer
20 bytes per pixel
vp8\encoder\tokenize.h:} TOKENEXTRA;
vp8\encoder\onyx_if.c:        CHECK_MEM_ERROR(cpi->tok, vpx_calloc(tokens, 
sizeof(*cpi->tok)));
The structure could be packed down to smaller bitfields, but this should be 
done carefully to avoid hurting performance.

Original issue reported on code.google.com by fbarch...@chromium.org on 12 Dec 2010 at 9:11

GoogleCodeExporter commented 9 years ago
Lag buffer allocation is limited to the lag requested by the application, see 
alloc_raw_frame_buffers in onyx_if.c.

preproc.c is not compiled and could be removed from the source tree.

I agree that the token buffer could be handled better.

Original comment by jkoles...@google.com on 13 Dec 2010 at 2:33

GoogleCodeExporter commented 9 years ago
Re lag
It looks like lag_in_frames defaults to 0.

Re ARNR
Is libvpx\vp8\encoder\x86\preproc_mmx.c also unused?  It contains
preproc_mmx.c:#define FRAMECOUNT 7
If unused, can you remove them?

Re Token
It seems this is the main reason 32 bit builds run out of memory?

Original comment by fbarch...@chromium.org on 13 Dec 2010 at 7:58

GoogleCodeExporter commented 9 years ago

Original comment by iss...@webmproject.org on 16 Mar 2011 at 2:51

GoogleCodeExporter commented 9 years ago
the motionmap in first pass of 0.9.6 release is another large one.

Original comment by fbarch...@chromium.org on 31 Mar 2011 at 4:22

GoogleCodeExporter commented 9 years ago
I removed the motion map in change I53e07d23 and modified the use of motion 
compensation in the temporal noise filter to compensate. My tests show that the 
change was neutral in terms of quality.

Adrian

Original comment by agra...@google.com on 31 Mar 2011 at 3:15