[FFmpeg-cvslog] r18421 - trunk/libavcodec/pngdec.c

Ronald S. Bultje rsbultje
Fri Apr 10 21:57:46 CEST 2009


Hi,

On Fri, Apr 10, 2009 at 3:51 PM, Reimar D?ffinger
<Reimar.Doeffinger at gmx.de> wrote:
> On Fri, Apr 10, 2009 at 07:16:19PM +0200, stefano wrote:
>> + ? ? ? ? ? ?for(j=0; j < s->height; j++) {
>> + ? ? ? ? ? ? ? ?for(i=0; i < s->width * s->bpp; i++) {
>> + ? ? ? ? ? ? ? ? ? ?pd[i] += pd_last[i];
>> + ? ? ? ? ? ? ? ?}
>> + ? ? ? ? ? ? ? ?pd += s->image_linesize;
>> + ? ? ? ? ? ? ? ?pd_last += s->image_linesize;
>> + ? ? ? ? ? ?}
>
> I suspect that except possibly for some borders it should be possible to
> use dsputil functions for this?
> Should be a good bit faster...

Now that we're on the subject of this anyway, can someone explain me
in layman terminology how this works? It seems like these P-frames are
a mask (i.e. nearly-black) of a "difference" between the last frame
and the current actual frame, and I suppose near-black is easier to
encode (lower bitrate, because less "signal").

So here's what I don't understand: pd is a uint8 and pd_last is a
uint8, so every pixel in the mask is always positive. Doesn't that
make no sense at all? Shouldn't a mask be (for reatively stable noise
/ rando input) zero on average, i.e. some negative, some positive?
Then how can a positive-only mask ever work? (I'm just trying to
understand video encoding at all, I might some day want to actually
dive into it...)

Ronald



More information about the ffmpeg-cvslog mailing list