[vlc-devel] [PATCH] video_text: assume the text rendering is done in SRGB/SDR

Steve Lhomme robux4 at ycbcr.xyz
Mon Jun 3 10:34:39 CEST 2019


Hi,

On 2019-05-29 20:29, Alexandre Janniaux wrote:
> Hi,
> 
> Shouldn't this be set in the SpuRenderText function ? Or maybe even in the
> text_renderer module. Before that, no one is able to use VLC_CODEC_TEXT
> subpictures.

SpuRenderText is generic for all text sources. IMO it's better if the 
source set its proper colorimetry parameters. For example the Closed 
Caption modules uses VLC_CODEC_TEXT and maybe as some point broadcasters 
will adjust the brightness of text depending on the frames.

So maybe it should be adjusted, if the colorimetry is not set, when the 
region is created. If the source set some colorimetry then it should be 
kept.

I'll try to do that.

> LGTM for the intent.
> 
> -- 
> Alexandre Janniaux
> VideoLabs
> 
> On 2019-05-29 13:24, Steve Lhomme wrote:
>> If it's rendered on a HDR surface its luminance and colors will need 
>> to be
>> adjusted accordingly.
>>
>> Reverts 08b8ef7cf313971c69d401a9b05c3b788d08e8d2
>> ---
>>  src/video_output/video_text.c | 9 ++++-----
>>  1 file changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/video_output/video_text.c 
>> b/src/video_output/video_text.c
>> index 171f29e8d6..9506c2300b 100644
>> --- a/src/video_output/video_text.c
>> +++ b/src/video_output/video_text.c
>> @@ -68,6 +68,10 @@ static void OSDTextUpdate(subpicture_t *subpic,
>>      video_format_Init( &fmt, VLC_CODEC_TEXT);
>>      fmt.i_sar_num = 1;
>>      fmt.i_sar_den = 1;
>> +    fmt.transfer  = TRANSFER_FUNC_SRGB;
>> +    fmt.primaries = COLOR_PRIMARIES_SRGB;
>> +    fmt.space     = COLOR_SPACE_SRGB;
>> +    fmt.mastering.max_luminance = 0;
>>
>>      subpicture_region_t *r = subpic->p_region = 
>> subpicture_region_New(&fmt);
>>      if (!r)
>> @@ -92,11 +96,6 @@ static void OSDTextUpdate(subpicture_t *subpic,
>>          r->i_y += margin_v + fmt_dst->i_y_offset;
>>      else if (r->i_align & SUBPICTURE_ALIGN_BOTTOM )
>>          r->i_y += margin_v - fmt_dst->i_y_offset;
>> -
>> -    r->fmt.transfer  = fmt_dst->transfer;
>> -    r->fmt.primaries = fmt_dst->primaries;
>> -    r->fmt.space     = fmt_dst->space;
>> -    r->fmt.mastering = fmt_dst->mastering;
>>  }
>>
>>  static void OSDTextDestroy(subpicture_t *subpic)
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list