[Ffmpeg-devel] [PATCH] fix (?) 2pass convergence errors

Michael Niedermayer michaelni
Tue Sep 5 12:22:56 CEST 2006


Hi

On Mon, Sep 04, 2006 at 09:23:27PM -0700, Corey Hickey wrote:
> Loren Merritt wrote:
> > On Mon, 4 Sep 2006, Michael Niedermayer wrote:
> >> On Mon, Sep 04, 2006 at 12:35:21PM -0700, Corey Hickey wrote:
> >>> I haven't figured out how to get the average qp. The attached code
> >>> * sums up rce->qscale for each rcc->entry[i]
> >>> * divides the result by rcc->num_entries and then by FF_QP2LAMBDA
> >>> * does the same thing for rce->new_qscale
> >>> * prints out both the results
> >>>
> >>> According to several tests, the average of qscale more or less matches
> >>> the average qp of the first pass and the average of new_qscale sort of
> >>> matches the average qp of the second pass. Both of them get thrown off
> >>> when lmin is below qmin. Is there a better way? I understand
> >>> approximately 5% of the ratecontrol code so far, so I'm probably
> >>> overlooking something easy.
> > 
> > for(...)
> >      qp_sum += clip(rcc->entry[i].new_qscale, qmin, qmax);
> > qp_sum /= num_entries * FF_QP2LAMBDA;
> 
> Ahh. I get your meaning, I think. I changed my patch to use your
> suggestion, with the modification that I divide rcc->entry[i] by
> FF_QP2LAMBDA before clipping it.

patch looks ok

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list