[FFmpeg-devel] libavfilter-soc: negate filter artifacts

Stefano Sabatini stefano.sabatini-lala
Fri Jul 24 01:58:07 CEST 2009


On date Monday 2009-07-20 05:55:41 +0200, Vitor Sessak encoded:
> Stefano Sabatini wrote:
>> Hi,
>>
>> I wonder what's the point of the default offesets assigned in the config_props:
>> static int config_props(AVFilterLink *link)
>> {
>>     NegContext *neg = link->dst->priv;
>>
>>     avcodec_get_chroma_sub_sample(link->format, &neg->hsub, &neg->vsub);
>>
>>     switch(link->format) {
>>     case PIX_FMT_YUVJ444P:
>>     case PIX_FMT_YUVJ422P:
>>     case PIX_FMT_YUVJ420P:
>>     case PIX_FMT_YUVJ440P:
>>         neg->offY  =
>>         neg->offUV = 0;
>>         break;
>>     default:
>>         neg->offY  = -4;
>>         neg->offUV = 1;
>>     }
>>
>>     return 0;
>> }
>
> I think the problem here is that YUV (and not YUVJ) has Y data in the  
> 16...235 range. So ideally one would negate 235 <-> 16 (see  
> imgconvert.c:47). But as you show in your message, the code is buggy.

Check the patch attached if it looks reasonable.

Also in order to make the else if .. switch just one time, I'm
considering to use a pointer to draw_slice for each different
draw_slice algorithm used (see attached), I still have to see how that
would perform with respect to the current solution.

Regards.
-- 
FFmpeg = Furious & Foolish Moronic Perennial Esoteric Generator
-------------- next part --------------
A non-text attachment was scrubbed...
Name: negate-fix-offsets.patch
Type: text/x-diff
Size: 3105 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090724/f90e1f94/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: negate-use-draw-slice-fun-ptr.patch
Type: text/x-diff
Size: 3988 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090724/f90e1f94/attachment-0001.patch>



More information about the ffmpeg-devel mailing list