Log in

View Full Version : Apply ColorMatrix in SD/HD upscale?


LigH
30th October 2024, 21:58
I'm playing a bit with different methods to upscale SD sources from DVD Video to HD. Due to an unrelated discussion elsewhere I remembered that SD video material often uses Rec.601 colorimetry, whereas HD prefers Rec.709, but the behaviour of players may not be reliable when the encoder does not flag it explicitly.

In my current case, the DVD video in MPEG2 uses explicit flags:
Color primaries : BT.601 PAL
Transfer characteristics : BT.470 System B/G
Matrix coefficients : BT.470 System B/G

Upscaling to a HD resolution, which options would you recommend?

a) use an explicit colorimetry flag for x264 with Rec.601 colorimetry
b) use ColorMatrix("Rec.601->Rec.709") but no encoder flag
c) use ColorMatrix("Rec.601->Rec.709") and an explicit colorimetry flag for x264 with Rec.709 colorimetry
d) something different

FranceBB
30th October 2024, 22:45
I'd say "c", so convert to BT709 and flag it as such within x264 --colormatrix bt709 --transfer bt709 --colorprim bt709.
Unfortunately players are totally unreliable and although most often than not they default to BT709 anyway whenever they find anything HD / FULL HD, it's always better to explicitly flag a stream.

takla
30th October 2024, 23:19
Yeah solution "c)" would be my pick, too.

Selur
31st October 2024, 05:08
I agree, most reliable is c.

LigH
31st October 2024, 06:20
:thanks:

I'll apply that as you all recommend. "20,000 Leagues" (1954) are now public domain, BTW.

SaurusX
4th November 2024, 17:36
Another "c)" vote here.

tormento
4th November 2024, 18:34
I'll apply that as you all recommend. "20,000 Leagues" (1954) are now public domain, BTW.
Where?

LigH
5th November 2024, 09:20
In countries where media copyrights are limited to at most 70 years.

hello_hello
5th November 2024, 20:00
If the transfer function really is 470bg you might be better off with option D. Plus that way you can do it in 16 bit with less chance of color banding.

ConvertBits(16)
z_ConvertFormat(colorspace_op="470bg:470bg:470bg:limited=>709:709:709:limited")
ConvertBits(8, Dither=1)

https://files.videohelp.com/u/210984/470bg.png

Compared to not converting the transfer function as I assume ColorMatrix wouldn't change it and I don't know if players wouldn't just assume 601 or 709.

ConvertBits(16)
z_ConvertFormat(colorspace_op="470bg:709:470bg:limited=>709:709:709:limited")
ConvertBits(8, Dither=1)

https://files.videohelp.com/u/210984/709.png

LigH
5th November 2024, 20:50
"Advanced method", alright. Might test it in a next project.

kolak
8th November 2024, 12:00
: BT.470 System B/G[/code]

Upscaling to a HD resolution, which options would you recommend?

a) use an explicit colorimetry flag for x264 with Rec.601 colorimetry
b) use ColorMatrix("Rec.601->Rec.709") but no encoder flag
c) use ColorMatrix("Rec.601->Rec.709") and an explicit colorimetry flag for x264 with Rec.709 colorimetry
d) something different


Option "c" is the correct approach.
What will happen in the wild is another story. Most players, TVs probably have hard coded rules based mainly on resolution and will assume "own" matrix anyway, but this doesn't matter. You should do correct conversion and flagging and this is option "c" (HD normally should be Rec.709).

StainlessS
8th November 2024, 17:32
On YT (full movie),
https://www.youtube.com/watch?v=pxG90oMpCuM

Apparently also available to buy or rent on YT.

On a quick glance at linked offering and quick look at the buy option sample, the free ver$ is quite a bit better.