[FFmpeg-devel] [PATCH 1/4] zmbvenc: don't sum the entropy when blocks are equal

Matthew Fearnley matthew.w.fearnley at gmail.com
Mon Feb 11 00:18:23 EET 2019

On Thu, 31 Jan 2019 at 15:00, Tomas Härdin <tjoppen at acc.umu.se> wrote:

> > 1. The entropy calculation in block_cmp() omits the score of histogram[0]
> > from the final sum.
> > It's tempting to do this to bias the scores in favour of 0-bytes, but in
> > reality, blocks with a majority of 0 (or any other byte) will already be
> > naturally favoured by the entropy score anyway, and this bias will fail
> to
> > penalise blocks with an "average" (i.e. high entropy) number of 0's in
> them.
> > The exact implications are difficult to ponder, but in practical terms
> this
> > error does tend to produce worse results in the video compression.  Not
> > massively so, but it's still noticeable.
> Did you try combining the statistics of the current MV with the
> statistics of the previous block, to bias the choice in favor of
> similar bytes? Could work like a cheap order-1 entropy model.

I've had a go at this, but sadly, it seemed to adversely affect
compression, producing larger files.
Maybe it can be improved with some tweaking, or maybe there's a bug
But it feels to me like this approach on its own isn't enough to improve
scoring.  Maybe as part of something larger though..
Anyway, you can see the results of my efforts here:

- Matthew

More information about the ffmpeg-devel mailing list