[FFmpeg-devel] [PATCH] Implement brg4 and rgb4 input support in libswscale

Vitor Sessak vitor1001
Wed May 19 11:47:46 CEST 2010


On 05/19/2010 12:18 AM, Stefano Sabatini wrote:
> On date Friday 2010-05-14 03:16:33 +0200, Michael Niedermayer encoded:
>> On Fri, May 14, 2010 at 01:33:38AM +0200, Stefano Sabatini wrote:
>>> On date Friday 2010-05-14 00:50:29 +0200, Michael Niedermayer encoded:
>>>> On Fri, May 14, 2010 at 12:46:10AM +0200, Stefano Sabatini wrote:
>>>>> Hi,
>>>>>
>>>>> here it is my naive implementation of subject, first attachment shows
>>>>> the code used to generate the used tables.
>>>>
>>>> the table coefficients should be adjusted depenending on the
>>>> yuv type (sws_setColorspaceDetails)
>>>>
>>>> (and yes i know we are missing this in other rgb->yuv code so its not
>>>>   mandatory for patch approval but would be very nice if we would be
>>>>   slowly fixing these shortcommings)
>>>
>>> Do you prefer to use hardcoded tables or dynamically generated ones?
>>
>> dynamically generate
>
> This requires also to change the signatures for the
> c->chrToYV12 and c->lumToYV12 functions.
>
> Also I'm not sure where the tables should be initialized.

[...]

> +void swscale_init(void)
> +{
> +    static int initialized = 0;
> +
> +    if (initialized != 0)
> +        return;
> +    initialized = 1;
> +
> +    ff_xgx4_init_tables();
> +}

You should set "initialized = 1;" after "ff_xgx4_init_tables();" or else 
it is not thread-safe.

-Vitor



More information about the ffmpeg-devel mailing list