[FFmpeg-devel] [PATCH] lavc/libzvbi: base support for multiple levels

Marton Balint cus at passwd.hu
Sat Feb 18 18:31:30 EET 2017


On Sat, 18 Feb 2017, Josh de Kock wrote:

> On 18/02/2017 00:51, Marton Balint wrote:
>> 
>> On Fri, 17 Feb 2017, Josh de Kock wrote:
>> 
>>> Also add support for level 1.0 explicitly.
>>>
>> 
>> What is the use case for this? Reducing the number of colors?
>> 
>
> Pretty much.
>
>> I don't think you can reduce the number of colors based on teletext
>> level, because libzvbi uses high (>32) colors for navigation, which is
>> also part of level 1.0.
>> 
>> Also, I don't think you can skip fix_transparency.
>> 
>
> Does level 1.0 support transparency?

Not as a color, but as a feature. See Start Box/End Box. Typical for 
subtitles.

>
>> And by reducing to level 1.0, you are excluding a lot of users, many
>> countries use the extra international characters level 1.5 provides.
>> 
>
> 1.5 could be done instead.
>
>> If you only want to reduce the number of colors, then I prefer an option
>> which makes the code go through every pixel, find the minimum color
>> value, and sets nb_colors to that.  Still a hack, but IMHO small enough
>> to be acceptable, until subtitle filters are implemented, and you can do
>> this with a filter.
>> 
>
> Not entirely sure what you mean by this, shouldn't the nb_colors be set
> based on the CLUT?

As long as according to zvbi docs it has internal colors from index 32 to 
39 for navigation, it does not matter how many CLUT the page uses.

What I am saying is that it's simpler to add a txt_reduce_colors 
option, and if that is set, find the maximum used color index, and set 
nb_colors to that + 1.

I think the original teletext patch had such a feature, but I removed it, 
hoping that it can be achieved with a subtitle filter later in the 
future...

Or if you are specifically aiming for 16 colors, then the 
txt_reduce_colors option can do a modulo 16 for each color index instead 
of finding the maximum index, which may vary between different pages, and 
I don't know how the dvb subtitle encoder would behave in that case.

Regards,
Marton


More information about the ffmpeg-devel mailing list