[FFmpeg-devel] need help fixing sws on PPC

Vitor Sessak vitor1001
Tue Oct 7 22:36:51 CEST 2008


Michael Niedermayer escreveu:
> On Tue, Oct 07, 2008 at 09:24:26PM +0200, Vitor Sessak wrote:
>   
>> Michael Niedermayer escreveu:
>>     
>>> On Mon, Oct 06, 2008 at 09:42:56PM +0200, Vitor Sessak wrote:
>>>   
>>>       
>>>> Michael Niedermayer escreveu:
>>>>     
>>>>         
>>>>> On Wed, Sep 10, 2008 at 01:42:44PM +0200, Vitor Sessak wrote:
>>>>>         
>>>>>           
>>>>>> Michael Niedermayer escreveu:
>>>>>>             
> [...]
>   
>>>> @@ -2659,12 +2702,18 @@
>>>>      int i;
>>>>      uint8_t* src2[4]= {src[0], src[1], src[2]};
>>>>      uint32_t pal[256];
>>>> -    int use_pal=   c->srcFormat == PIX_FMT_PAL8
>>>> -                || c->srcFormat == PIX_FMT_BGR4_BYTE
>>>> +    int use_pal=   c->srcFormat == PIX_FMT_BGR4_BYTE
>>>>                  || c->srcFormat == PIX_FMT_RGB4_BYTE
>>>>                  || c->srcFormat == PIX_FMT_BGR8
>>>>                  || c->srcFormat == PIX_FMT_RGB8;
>>>>  +    use_pal = use_pal
>>>> +                && c->srcFormat == PIX_FMT_PAL8
>>>> +                && c->dstFormat != PIX_FMT_RGB32
>>>> +                && c->dstFormat != PIX_FMT_RGB24
>>>> +                && c->dstFormat != PIX_FMT_BGR32
>>>> +                && c->dstFormat != PIX_FMT_BGR24;
>>>> +
>>>>      if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != 
>>>> c->srcH) {
>>>>          av_log(c, AV_LOG_ERROR, "Slices start in the middle!\n");
>>>>          return 0;
>>>>     
>>>>         
>>> This code makes no sense at all
>>> it assumes that no scaling happens which surely is not correct but it
>>>   
>>>       
>> indeed, changed the logic in my patch and fixed it.
>>
>>     
>>> likely is wrong in more ways than just that.
>>>   
>>>       
>> Is swscale such a big mess that is that easy to break stuff?
>>     
>
> dont insult my poor swscaler
>   

No offense intended, I don't even know this code well enough to have my 
opinion about it (and I was just asking!).

>>> also may i suggest that you use swscale-example to test that your changes
>>> dont break things!
>>>   
>>>       
>> I will as soon as I get a ssh from Hudo...
>>     
>
> fine, but it has to be checked before commit
>   

Ok, no problem

>
> [...]
>   
>> @@ -2658,12 +2705,7 @@
>>                int srcSliceH, uint8_t* dst[], int dstStride[]){
>>      int i;
>>      uint8_t* src2[4]= {src[0], src[1], src[2]};
>> -    uint32_t pal[256];
>> -    int use_pal=   c->srcFormat == PIX_FMT_PAL8
>> -                || c->srcFormat == PIX_FMT_BGR4_BYTE
>> -                || c->srcFormat == PIX_FMT_RGB4_BYTE
>> -                || c->srcFormat == PIX_FMT_BGR8
>> -                || c->srcFormat == PIX_FMT_RGB8;
>> +    uint32_t pal[512];
>>     
>
> what about putting a rgbpal and yuvpal in the context?
> i think this would be cleaner than the "didnt you know the rgb pal was
> at pal+256?!"
>   

I agree. New patch attached.

I've also attached a second patch to use pal_yuv instead of src[1] that 
is completely untested for the moment (I will obviously not apply 
anything before doing a full test)...

-Vitor

PS: BTW, Diego, can I apply patches to libswscale/ ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pal2rgb_3.diff
Type: text/x-patch
Size: 4849 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081007/0336076e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pal2rgb_4.diff
Type: text/x-patch
Size: 738 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081007/0336076e/attachment-0001.bin>



More information about the ffmpeg-devel mailing list