[FFmpeg-devel] [PATCH] MS Video 1 encoder, take 2

Jason Garrett-Glaser darkshikari
Fri Mar 13 21:27:59 CET 2009


On Fri, Mar 13, 2009 at 1:18 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Mar 13, 2009 at 06:34:21PM +0200, Kostya wrote:
>> On Wed, Mar 11, 2009 at 08:37:00PM +0100, Michael Niedermayer wrote:
>> > On Wed, Mar 11, 2009 at 08:11:39AM +0200, Kostya wrote:
> [...]
>> > [...]
>> > > + ? ? ? ? ? ? ? ?for(i = 0; i < 4*4*3; i++){
>> > > + ? ? ? ? ? ? ? ? ? ?int t = prevptr[i] - c->block[i];
>> > > + ? ? ? ? ? ? ? ? ? ?bestscore += t*t;
>> > > + ? ? ? ? ? ? ? ?}
>> > > + ? ? ? ? ? ? ? ?if(!skips)
>> > > + ? ? ? ? ? ? ? ? ? ?bestscore += 2;
>> >
>> > this is not a correct method of combining rate and distortion
>>
>> Ok, now I don't mix them at all.
>>
>> > rest not reviewed, this is a grave error and has to be fixed first
>>
>> Can you recommend any good book on such matters? I really need it.
>
> i wish i knew one, you could try reading q15e26 / wiegand95efficient (google)
> 70afa3327f02ef514e018e7f4386418f3b002a1c ?wiegand95efficient.ps
> d0b4779c6168cebb45a249c2be899a787b2744c8 ?q15e26.ps
>
> and my rate_distortion.txt in ffmpeg svn
>
> also loren and dark shikari might know some others?

I don't see why one needs a reference for such a thing.

Distortion = SSD( source, reconstructed )
Rate = BITS( decision )
RD = Rate * Lambda + Distortion
OptimalEncode(Lambda) = Decision that minimizes RD for a given lambda

In MPEG-like formats, this usually finding the optimal lambda for a
given quantizer (or bitrate) and using a constant lambda.

In formats without a direct quantizer, if you don't care about target
bitrate mode, you can literally just work with a constant lambda
derived from qscale.

Dark Shikari




More information about the ffmpeg-devel mailing list