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

2019-02-11 Thread Tomas Härdin
sön 2019-02-10 klockan 22:18 + skrev Matthew Fearnley: > > On Thu, 31 Jan 2019 at 15:00, Tomas Härdin 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

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

2019-02-10 Thread Matthew Fearnley
On Thu, 31 Jan 2019 at 15:00, Tomas Härdin 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

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

2019-01-31 Thread Tomas Härdin
tor 2019-01-31 klockan 13:31 + skrev Matthew Fearnley: > > On Sun, 20 Jan 2019 at 15:16, Tomas Härdin wrote: > > > > Hi.  Just to say, I tried setting up additional score_tabs for the > > > bottom/right partial blocks.  Unfortunately, after implementing it and > > > ironing out the bugs, the

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

2019-01-31 Thread Matthew Fearnley
On Sun, 20 Jan 2019 at 15:16, Tomas Härdin wrote: > > Hi. Just to say, I tried setting up additional score_tabs for the > > bottom/right partial blocks. Unfortunately, after implementing it and > > ironing out the bugs, the new score tables actually caused a slight > > increase in file size! >

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

2019-01-20 Thread Tomas Härdin
lör 2019-01-19 klockan 22:40 + skrev Matthew Fearnley: > > On Tue, 25 Dec 2018 at 09:35, Tomas Härdin wrote: > > > lör 2018-12-22 klockan 15:32 + skrev Matthew Fearnley: > > > > > > > > > > > > > > > > Note that bw,bh aren't guaranteed to equal ZMBV_BLOCK, so > > > > `histogram[0] ==

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

2019-01-19 Thread Matthew Fearnley
On Tue, 25 Dec 2018 at 09:35, Tomas Härdin wrote: > lör 2018-12-22 klockan 15:32 + skrev Matthew Fearnley: > > > > > > > > > Note that bw,bh aren't guaranteed to equal ZMBV_BLOCK, so > `histogram[0] == > > > > bw*bh` would have to be used to guard against those (literal) edge > cases. > > >

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

2018-12-25 Thread Tomas Härdin
lör 2018-12-22 klockan 15:32 + skrev Matthew Fearnley: > > > > > > > Note that bw,bh aren't guaranteed to equal ZMBV_BLOCK, so `histogram[0] == > > > bw*bh` would have to be used to guard against those (literal) edge cases. > > > > Right, yes. But if we have block sizes other than

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

2018-12-22 Thread Matthew Fearnley
> On 22 Dec 2018, at 12:11, Tomas Härdin wrote: > > tor 2018-12-20 klockan 17:46 + skrev Matthew Fearnley: On Thu, 20 Dec 2018 at 16:30, Tomas Härdin wrote: >>> >>> I have a feeling this could be sped up further by just doing *xored = >>> histogram[0] == ZMBV_BLOCK*ZMBV_BLOCK after

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

2018-12-22 Thread Tomas Härdin
tor 2018-12-20 klockan 17:46 + skrev Matthew Fearnley: > > On Thu, 20 Dec 2018 at 16:30, Tomas Härdin wrote: > > > I have a feeling this could be sped up further by just doing *xored = > > histogram[0] == ZMBV_BLOCK*ZMBV_BLOCK after the loops, if [PATCH 3/4] > > is applied before this.

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

2018-12-20 Thread Matthew Fearnley
On Thu, 20 Dec 2018 at 16:30, Tomas Härdin wrote: > I have a feeling this could be sped up further by just doing *xored = > histogram[0] == ZMBV_BLOCK*ZMBV_BLOCK after the loops, if [PATCH 3/4] > is applied before this. Computing both histogram and xored in the loop > seems pointless. > You're

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

2018-12-20 Thread Tomas Härdin
ons 2018-12-19 klockan 22:00 + skrev matthew.w.fearn...@gmail.com: > > From: Matthew Fearnley > > If *xored is 0, then histogram[0]==bw*bh and histogram[1..255]==0. > > Because histogram[0] is skipped over for the entropy calculation, the > return value is always 0 when *xored==0, so we

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

2018-12-19 Thread matthew . w . fearnley
From: Matthew Fearnley If *xored is 0, then histogram[0]==bw*bh and histogram[1..255]==0. Because histogram[0] is skipped over for the entropy calculation, the return value is always 0 when *xored==0, so we don't need to waste time calculating it. This addition both clarifies the behaviour of