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

Corey Hickey bugfood-ml
Tue Sep 5 17:47:06 CEST 2006


Michael Niedermayer wrote:
> 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


Great! I just checked the regression tests and applied the patch. I
probably won't have time to do more until the weekend.

-Corey




More information about the ffmpeg-devel mailing list