Nadeem,
Sounds like you're current problem is a luma/chroma swap to me. This can occur because the luma/chroma are actually swapped from what you expect them to be. I believe Luma is on the lower 8 bits of the clocked video output.
Also
You might find this useful. This is some code I use in one of my projects to define different video standards. Some of the fields of the struct are irrelevant for you but among other things it contains the line numbers for when Vertical and Field flag transitions take place. The horizontal sync is simply the total words minus the active words.
* Statically declare standards */
//3G standards
const sdi_standard standard_1080p50 = {
1125, 1920, 2640, 0, 42, 1122, 0, 0, 581, 0, "1080p50", 3, -1, 0, 0, 0, 0, 0, 1125,
&sync_out_standard_1080p50};
const sdi_standard standard_1080p59 = {
1125, 1920, 2200, 0, 42, 1122, 0, 0, 699, 0, "1080p59", 3, 0, 0, 0, 0, 0, 0, 1125,
&sync_out_standard_1080p59};
const sdi_standard standard_1080p60 = {
1125, 1920, 2200, 0, 42, 1122, 0, 0, 581, 0, "1080p60", 3, 1, 0, 0, 0, 0, 0, 1125,
&sync_out_standard_1080p59};
//HD standards
const sdi_standard standard_1080i50 = {
1125, 1920, 2640, 564, 21, 561, 584, 1124, 413, 975, "1080i50", 1, -1, 0, 0, 0, 0, 0, 1125,
&sync_out_standard_1080i50};
const sdi_standard standard_1080i59 = {
1125, 1920, 2200, 564, 21, 561, 584, 1124, 290, 853, "1080i59", 1, 0, 0, 0, 0, 0, 0, 1125,
&sync_out_standard_1080i59};
const sdi_standard standard_1080i60 = {
1125, 1920, 2200, 564, 21, 561, 584, 1124, 290, 853, "1080i60", 1, 1, 0, 0, 0, 0, 0, 1125,
&sync_out_standard_1080i59};
const sdi_standard standard_720p50 = {
750, 1280, 1980, 0, 26, 746, 0, 0, 385, 0, "720p50", 1, -1, 0, 0, 0, 0, 0, 750,
&sync_out_standard_720p50};
const sdi_standard standard_720p59 = {
750, 1280, 1650, 0, 26, 746, 0, 0, 385, 0, "720p59", 1, 0, 0, 0, 0, 0, 0, 750,
&sync_out_standard_720p59};
const sdi_standard standard_720p60 = {
750, 1280, 1650, 0, 26, 746, 0, 0, 385, 0, "720p60", 1, 1, 0, 0, 0, 0, 0, 750,
&sync_out_standard_720p59};
//SD standards
const sdi_standard standard_480i59 = {
525, 720, 858, 263, 17, 261, 280, 523, 140, 400, "480i59", 0, -1, 1, 9, 269, 272, 6, 522,
&sync_out_standard_480i59}; // All line numbers offset by -3
const sdi_standard standard_575i50 = {
625, 720, 864, 313, 23, 311, 336, 624, 164, 474, "575i50", 0, -1, 1, 8, 318, 321, 5, 625,
&sync_out_standard_575i50}; // All line numbers offset by -1
//typedef struct{
// int line_count; /**<Number of total lines (vertical res) in standard */
// int active_words; /**<Number of active pixel words in a line */
// int total_words; /**<Number of total words in a line */
// int f_rise; /**<Line number at which F flag is raised (interlaced) */
// int v_fall1; /**<Line number at which V flag is lowered */
// int v_rise1; /**<Line number at which V flag is raised */
// int v_fall2; /**<Line number at which V flag is lowered 2nd time.*/
// int v_rise2; /**<Line number at which V flag is raised 2nd time. */
// int p_change1; /**<Pathological change 1 */
// int p_change2; /**<Pathological change 2 */
// char name; /**<Textual name for this standard */
// int txstd; /**<0=SD,1=HD,3=3G */
// int fastclk; /**<0=148.3516MHz reference clock, 1=148.5MHz reference clock*/
// int edh_enable; /**<0 = No EDH, 1 = EDH */
// int edh_start1; /**<Line number to start EDH caclulation for 1st field*/
// int edh_end1; /**<Line number to end EDH calculation for 1st field.*/
// int edh_start2; /**<Line number to start EDH caclulation for 2nd field*/
// int edh_end2; /**<Line number to end EDH calculation for 2nd field.*/
// int id_ln; /**<Line number to insert TRIO signal ID.*/
// const sync_out_standard *sync_out_std; /**<Struct containing sync_out_standard*/
//} sdi_standard;