[FFmpeg-devel] [PATCH] Fix roq encoding

Michael Niedermayer michaelni
Wed Jul 23 04:02:47 CEST 2008

    On Tue, Jul 22, 2008 at 11:49:11PM +0200, Vitor Sessak wrote:
> Michael Niedermayer wrote:
>> On Sat, Jul 19, 2008 at 04:25:17AM +0200, Vitor Sessak wrote:
>>> Michael Niedermayer wrote:
>>>> On Sat, Jul 19, 2008 at 12:23:28AM +0200, Vitor Sessak wrote:
>>>>> Hi,
>>>>> The following patch fix the issue 548. Not that I fully understand why
>>>>> before it was ok not to set avctx->coded_frame and now it crashes...
>>>>> -Vitor
>>>>> PS: nice to know there is someone who used this encoder...
>>>>> Index: libavcodec/roqvideoenc.c
>>>>> ===================================================================
>>>>> --- libavcodec/roqvideoenc.c	(revision 14271)
>>>>> +++ libavcodec/roqvideoenc.c	(working copy)
>>>>> @@ -1037,6 +1037,8 @@
>>>>>      /* Encode the actual frame */
>>>>>      roq_encode_video(enc);
>>>>>  +    avctx->coded_frame = enc->last_frame;
>>>> I think it should be set to current_frame before the pointers
>>>> are swapped, that would be cleaner
>>> I agree, like the attached patch?
>> yes, patch ok
> Mike has just added a testcase for RoQ encoding in FATE and it shows that 
> roq encoding segfaults on ICC. While trying to fix it I found a few bugs in 
> the codebook generator that exists also in gcc:
> fixroq1.diff: The algorithm involves picking three different codebook 
> centroids ("high utility", "low utility" and "closest to the low utility 
> one"). This enforces that they are really different.
> fixroq2.diff: When picking a "high utility centroid" do not pick one that 
> has no corresponding points. Not only it is the worse possible pick, but 
> also I wrote my code without considering this case.
> fixroq3.diff: Workaround an ICC bug.

all ok, you are elbg maintainer anyway

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is not what we do, but why we do it that matters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080723/5561f147/attachment.pgp>

More information about the ffmpeg-devel mailing list