<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"> On Fri, Jul 8, 2016 at 4:56 PM, walter harms <span dir="ltr"><<a href="mailto:wharms@bfs.de" target="_blank">wharms@bfs.de</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
<br>
Am 08.07.2016 16:09, schrieb Arnaud Vrac:<br>
> From: Arnaud Vrac <<a href="mailto:avrac@freebox.fr" target="_blank">avrac@freebox.fr</a>><br>
><br>
> ---<br>
>  edid-decode.c | 38 ++++++++++++++++++++++++++++++++++++++<br>
>  1 file changed, 38 insertions(+)<br>
><br>
> diff --git a/edid-decode.c b/edid-decode.c<br>
> index 2e367b3..c18697f 100644<br>
> --- a/edid-decode.c<br>
> +++ b/edid-decode.c<br>
> @@ -1100,6 +1100,43 @@ cea_colorimetry_block(unsigned char *x)<br>
>      }<br>
>  }<br>
><br>
> +static const char *eotf_map[] = {<br>
> +    "Traditional gamma - SDR luminance range",<br>
> +    "Traditional gamma - HDR luminance range",<br>
> +    "SMPTE ST2084",<br>
> +};<br>
> +<br>
> +static void<br>
> +cea_hdr_metadata_block(unsigned char *x)<br>
> +{<br>
> +    int length = x[0] & 0x1f;<br>
> +    int i;<br>
> +<br>
> +    if (length >= 3) {<br>
> +     printf("    Electro optical transfer functions:\n");<br>
> +     for (i = 0; i < 6; i++) {<br>
> +         if (x[2] >> i) {<br>
> +             printf("      %s\n", i < ARRAY_SIZE(eotf_map) ?<br>
> +                    eotf_map[i] : "Unknown");<br>
> +         }<br>
> +     }<br>
<br>
</div></div>i would move "Unknown" into eotf_map[], that make later changes more easy.<br></blockquote><div><br></div><div>That would add "Unknown" 3 times in the array, which I thought was redundant. Bits 3 to 5 are reserved for future use.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I assume that x[2] is a bitfield, so is (x[2] >> i) & 1 intended ?</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
as in "[PATCH edid-decode 3/9] Print speaker allocation data block"<br></blockquote><div><br></div><div>Ah right, nice catch. I'll update the patch.</div><div>  </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
re,<br>
 wh<br>
<div><div><br>
> +     printf("    Supported static metadata descriptors:\n");<br>
> +     for (i = 0; i < 8; i++) {<br>
> +         if (x[3] >> i)<br>
> +             printf("      Static metadata type %d\n", i + 1);<br>
> +     }<br>
> +    }<br>
> +<br>
> +    if (length >= 4)<br>
> +     printf("    Desired content max luminance: %d\n", x[4]);<br>
> +<br>
> +    if (length >= 5)<br>
> +     printf("    Desired content max frame-average luminance: %d\n", x[5]);<br>
> +<br>
> +    if (length >= 6)<br>
> +     printf("    Desired content min luminance: %d\n", x[6]);<br>
> +}<br>
> +<br>
>  static void<br>
>  cea_block(unsigned char *x)<br>
>  {<br>
> @@ -1155,6 +1192,7 @@ cea_block(unsigned char *x)<br>
>                   break;<br>
>               case 0x06:<br>
>                   printf("HDR static metadata data block\n");<br>
> +                 cea_hdr_metadata_block(x);<br>
>                   break;<br>
>               case 0x0d:<br>
>                   printf("Video format preference data block\n");</div></div></blockquote></div><div><br></div>-- <br><div data-smartmail="gmail_signature"><div dir="ltr"><div>Arnaud</div></div></div>
</div></div>