I was passing the YUV422_BIT12
into the fresh_tx_vsif_pkt
function instead of RGB_8BIT
. Don’t know exactly where that function is used for the code that supports the ‘official’ dovi.ko
approach to DV.
Ok, thank you. In your case where was this implemented?
Thank you, really appreciate your help.
@doppingkoala , thank you again for your previous help, so I got the YUV422_BIT12
tunnel working but I need to use the appropriate matrix and offset to convert from ICtCp to YCbCr/YUV as you mentioned on you previous post from Sep 29. Unfortunately, I am not able to find those matrices/functions. Where are they coded/located. Thank you again.
Not sure what you mean here. The matrix/colorspace that goes into the embedded DV metadata reflects the colorspace of the actual video data itself. This is independent from tunnel mode - the tunnel mode is just what what the hdmi mode the output is marked as, i.e., 8-bit RGB or 12-bit YUV422.
In any case, you can get these matrices/offset values from the metadata of any DV file. A p5 file will give the IPT ones, a p8.1 file will give YUV ones, etc.
@doppingkoala , Sorry I was not clear. I am trying send Display-Led DV via YUV422_BIT12
tunnel but also want to make sure that the signal inside the tunnel is YCbCr and not ICTCp. I changed the code to send YUV422_BIT12
tunnel but the signal seems to still be ICTCp. So I am trying to convert the signal from ICTCp to YCbCr at CoreELEC. Not sure if this makes sense? Thank you.
I haven’t been doing any colorspace conversion within CE. Just been setting the DV metadata to match whatever the source is and letting the TV handle it.
What is the reason you want to convert from ICtCp? Getting p5 to work correctly, i.e. including the reshaping?
I am feeding the signal to a video processor and not a TV. My video processor cannot accept ICtCp but only YCbCr, so I am trying to convert the signal to YCbCr. CoreELEC does that already for LLDV so I am trying to tap into this capability but without using the LLDV engine since I want the signal not to be processed by LLDV engine but send as Standard DV.
Ok,.
Doing that conversion has two steps, the first one is to reshape the ICtCp data by using the polynomial coefficients (for p5). This is a nonlinear operation, so can’t be done with a standard colorspace conversion (maybe could be approxiamted though). After the reshaping I think those the remaining colorspace conversion could be handled by the hardware within the hdmi output block - arbitrary matrices can be set there.
I don’t know how to do the reshaping step in CE.
@doppingkoala , ok, thank you, I am primarily using P7 so I do not need double conversion but from what I understand CE convert to ICtCp before sending the Standard DV signal. So I am just trying to stop the first conversion and just send the signal as the standard file format.
Do you know if converting to ICtCp is needed as a part of the process of reconstructing FEL? Or is that being applied afterwards?
Not sure but the signal I am getting is ICtCp with FEL or MEL so I am assuming CoreELEC send ICtCp if Standard-DV is selected no matter what is the original file format.
So from what I an understanding the reshaping will have already been performed in your use case, and you might just need to apply a colorspace conversion. I haven’t tried to do this myself. But if you can work out which values to use, I think you could put them in hdmitx_csc_config(), which I think is after the FEL layer is reconstructed.
May / may not ruin the metadata that is embedded though, not sure if that would matter for your use case though.
edit: or try to work out if the conversion to ICtCp can be disabled in CE, it is clearly unneeded for the MEL case so you could start with that.
Thank you will try that to see how it works. Thank you for your help.
@doppingkoala , so I checked hdmitx_csc_config() and it only converts from/to RGB<>YUV not ICtCp.
Do you have or know where to find documentation of how CoreELEC process works from reading the media to sending to the output hdmi?
Thank you again for all of your help.
The thought was you add that option by working out what values those coefficients should be set to.
Far as I can tell the hdmi module seems to be as described in https://people.freebsd.org/~gonzo/arm/iMX6-HDMI.pdf. See Section 33.4.5 for a overview of the color space conversion. Section 33.5.282 shows the equations that are applied from which you can set variables, csc_coeff_a1
etc.
Not that I have found. Slightly helpful is, https://www.kernel.org/doc/Documentation/devicetree/bindings/display/amlogic%2Cmeson-vpu.txt which shows a very basic diagram for amlogic in general.
Ok, got it. Thank you.
@doppingkoala , ok, making some progress, I am changing the code to be able to do the conversion. One interesting thing I just noticed since I never played a DV P5 file with CE, it does not work (at least for mp4 files)? Is that correct? I thought that CE could play DV P5 files? I was testing with a LLDV connection, so not sure if it is a limitation just for LLDV.
In any case, if what I am doing works it could potentially solve this CE limitation (if it actually cannot play DV P5 files) and your item of playing P5 with your specific code also since I am trying not to use any specific cpu code.
Far as I knew, CE plays p5 files fine with a licenced device. I’m sure others can confirm that to be the case.
So are you working out a way that can do the reshaping? I thought you were just looking at the colorspace conversion?