• Ben Chang's avatar
    avcodec/nvenc: surface allocation reduction · 8de3458a
    Ben Chang authored
    This patch aims to reduce the number of input/output surfaces
    NVENC allocates per session. Previous default sets allocated surfaces to 32
    (unless there is user specified param or lookahead involved). Having large
    number of surfaces consumes extra video memory (esp for higher resolution
    encoding). The patch changes the surfaces calculation for default, B-frames,
    lookahead scenario respectively.
    
    The other change involves surface selection. Previously, if a session
    allocates x surfaces, only x-1 surfaces are used (due to combination
    of output delay and lock toggle logic). To prevent unused surfaces,
    changing surface rotation to using predefined fifo.
    Signed-off-by: 's avatarTimo Rothenpieler <timo@rothenpieler.org>
    8de3458a
nvenc_h264.c 16.3 KB