Hi,

On Mon, Jun 27, 2011 at 5:17 PM, Ronald S. Bultje <[email protected]> wrote:
> Hi,
>
> On Sun, Jun 26, 2011 at 10:20 PM, Kostya <[email protected]> wrote:
>> On Sun, Jun 26, 2011 at 03:52:01PM -0700, Ronald S. Bultje wrote:
>>> This functionality is only implemented for RGB24/32 and causes crashes
>>> otherwise.
>>> ---
>>>  libswscale/utils.c |   13 +++++++++++++
>>>  1 files changed, 13 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/libswscale/utils.c b/libswscale/utils.c
>>> index 6971418..ab28588 100644
>>> --- a/libswscale/utils.c
>>> +++ b/libswscale/utils.c
>>> @@ -845,6 +845,19 @@ int sws_init_context(SwsContext *c, SwsFilter 
>>> *srcFilter, SwsFilter *dstFilter)
>>>      getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, 
>>> dstFormat);
>>>
>>>      // reuse chroma for 2 pixels RGB/BGR unless user wants full chroma 
>>> interpolation
>>> +    if (flags & SWS_FULL_CHR_H_INT &&
>>> +        dstFormat != PIX_FMT_RGBA &&
>>> +        dstFormat != PIX_FMT_ARGB &&
>>> +        dstFormat != PIX_FMT_BGRA &&
>>> +        dstFormat != PIX_FMT_ABGR &&
>>> +        dstFormat != PIX_FMT_RGB24 &&
>>> +        dstFormat != PIX_FMT_BGR24) {
>>> +        av_log(c, AV_LOG_ERROR,
>>> +               "full chroma interpolation for destination format '%s' not 
>>> yet implemented\n",
>>> +               sws_format_name(dstFormat));
>>> +        flags &= ~SWS_FULL_CHR_H_INT;
>>> +        c->flags = flags;
>>> +    }
>>>      if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) 
>>> c->chrDstHSubSample=1;
>>>
>>>      // drop some chroma lines if the user wants it
>>> --
>>
>> Why not use condition like below? I'd like my RGB565 output with full chroma
>> too and mentioning all dst formats in wall of conditions is ugly IMO.
>
> Scaling functions use c->flags to decide whether to use a full or half
> function. I.e., the value needs to match the function chosen, else
> everything goes wrong...
>
> And yes this is a design problem, I'll see what I can do about that,
> but at least it's better to not just plain crash. :-).

Ping.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to