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

Tomas Härdin tjoppen at acc.umu.se
Mon Feb 11 10:11:09 EET 2019


sön 2019-02-10 klockan 22:18 +0000 skrev Matthew Fearnley:
> > 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
> somewhere.
> 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:
> https://github.com/countingpine/FFmpeg/commit/prev_histogram.

Darn. Interesting result at least

/Tomas


More information about the ffmpeg-devel mailing list