• Lucas Stach's avatar
    media: coda: limit queueing into internal bitstream buffer · c3d996fb
    Lucas Stach authored
    The ringbuffer used to hold the bitstream is very conservatively sized,
    as keyframes can get very large and still need to fit into this buffer.
    This means that the buffer is way oversized for the average stream to
    the extend that it will hold a few hundred frames when the video data
    is compressing well.
    
    The current strategy of queueing as much bitstream data as possible
    leads to large delays when draining the decoder. In order to keep the
    drain latency to a reasonable bound, try to only queue a full reorder
    window of buffers. We can't always hit this low target for very well
    compressible video data, as we might end up with less than the minimum
    amount of data that needs to be available to the bitstream prefetcher,
    so we must take this into account and allow more buffers to be queued
    in this case.
    Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
    Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
    Signed-off-by: default avatarHans Verkuil <hansverk@cisco.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
    c3d996fb
coda-bit.c 66.4 KB