MikeS11 / MiSTerFPGA_YC_Encoder

All work releated to the YC / NTSC & PAL Encoder for MiSTerFPGA
MIT License
33 stars 4 forks source link

COLORBURST_RANGE expected value? #6

Closed jotego closed 3 months ago

jotego commented 3 months ago

Could you detail in the documentation how to calculate the COLORBURST_RANGE?

MikeS11 commented 3 months ago

Sure,

Its in main but

    int COLORBURST_START = (int)(3.7f * (CLK_VIDEO / CLK_REF));
    int COLORBURST_END = (int)(9.0f * (CLK_VIDEO / CLK_REF)) + COLORBURST_START;
    int COLORBURST_RANGE = (COLORBURST_START << 10) | COLORBURST_END;

Where Start is the number of samples of the ref carrier a number i was comfortable with which shifts the start of the colorburst signal from the stop of the HSYNC, The next is just the number of cycles of the ref clock 9 (Which is the NTSC Standard) Range just combines both of them so when to start and stop the colorburst is pulled into the output module.

Simply Start position of the colorburst + End position of the colorburst (9 cycles)

jotego commented 3 months ago

Thank you!

jotego commented 3 months ago

Is CLK_REF the subcarrier frequency?

MikeS11 commented 3 months ago

Yep! It varies between NTSC and PAL / PAL60

double CLK_REF = (pal || (cfg.ntsc_mode == 1)) ? 4.43361875f : (cfg.ntsc_mode == 2) ? 3.575611f : 3.579545f;