return table_start;
static void yuv2rgb_c_init (unsigned bpp, int mode){      int i;    uint8_t table_Y[1024];    uint32_t *table_32 = 0;    uint16_t *table_16 = 0;    uint8_t *table_8 = 0;    uint8_t *table_332 = 0;    uint8_t *table_121 = 0;    uint8_t *table_1 = 0;    int entry_size = 0;    void *table_r = 0, *table_g = 0, *table_b = 0;    int crv = Inverse_Table_6_9[matrix_coefficients][0];    int cbu = Inverse_Table_6_9[matrix_coefficients][1];    int cgu = -Inverse_Table_6_9[matrix_coefficients][2];    int cgv = -Inverse_Table_6_9[matrix_coefficients][3];    for (i = 0; i < 1024; i++) {	int j;	j = (76309 * (i - 384 - 16) + 32768) >> 16;	j = (j < 0) ? 0 : ((j > 255) ? 255 : j);	table_Y[i] = j;    }    switch (bpp) {    case 32:	yuv2rgb_c_internal = yuv2rgb_c_32;	table_32 = malloc ((197 + 2*682 + 256 + 132) * sizeof (uint32_t));	entry_size = sizeof (uint32_t);	table_r = table_32 + 197;	table_b = table_32 + 197 + 685;	table_g = table_32 + 197 + 2*682;	for (i = -197; i < 256+197; i++)	    ((uint32_t *)table_r)[i] = table_Y[i+384] << ((mode==MODE_RGB) ? 16 : 0);	for (i = -132; i < 256+132; i++)	    ((uint32_t *)table_g)[i] = table_Y[i+384] << 8;	for (i = -232; i < 256+232; i++)	    ((uint32_t *)table_b)[i] = table_Y[i+384] << ((mode==MODE_RGB) ? 0 : 16);	break;    case 24://	yuv2rgb_c_internal = (mode==MODE_RGB) ? yuv2rgb_c_24_rgb : yuv2rgb_c_24_bgr;	yuv2rgb_c_internal = (mode!=MODE_RGB) ? yuv2rgb_c_24_rgb : yuv2rgb_c_24_bgr;	table_8 = malloc ((256 + 2*232) * sizeof (uint8_t));	entry_size = sizeof (uint8_t);	table_r = table_g = table_b = table_8 + 232;	for (i = -232; i < 256+232; i++)	    ((uint8_t * )table_b)[i] = table_Y[i+384];	break;    case 15:    case 16:	yuv2rgb_c_internal = yuv2rgb_c_16;	table_16 = malloc ((197 + 2*682 + 256 + 132) * sizeof (uint16_t));	entry_size = sizeof (uint16_t);	table_r = table_16 + 197;	table_b = table_16 + 197 + 685;	table_g = table_16 + 197 + 2*682;	for (i = -197; i < 256+197; i++) {	    int j = table_Y[i+384] >> 3;	    if (mode == MODE_RGB)		j <<= ((bpp==16) ? 11 : 10);	    ((uint16_t *)table_r)[i] = j;	}	for (i = -132; i < 256+132; i++) {	    int j = table_Y[i+384] >> ((bpp==16) ? 2 : 3);	    ((uint16_t *)table_g)[i] = j << 5;	}	for (i = -232; i < 256+232; i++) {	    int j = table_Y[i+384] >> 3;	    if (mode == MODE_BGR)		j <<= ((bpp==16) ? 11 : 10);	    ((uint16_t *)table_b)[i] = j;	}	break;    case 8:	yuv2rgb_c_internal = yuv2rgb_c_8_ordered_dither; //yuv2rgb_c_8;	table_332 = malloc ((197 + 2*682 + 256 + 132) * sizeof (uint8_t));	entry_size = sizeof (uint8_t);	table_r = table_332 + 197;	table_b = table_332 + 197 + 685;	table_g = table_332 + 197 + 2*682;	for (i = -197; i < 256+197; i++) {	    int j = (table_Y[i+384] - 16) >> 5;	    if(j<0) j=0;	    if (mode == MODE_RGB)		j <<= 5;	    ((uint8_t *)table_r)[i] = j;	}	for (i = -132; i < 256+132; i++) {	    int j = (table_Y[i+384] - 16) >> 5;	    if(j<0) j=0;	    if (mode == MODE_BGR)		j <<= 1;	    ((uint8_t *)table_g)[i] = j << 2;	}	for (i = -232; i < 256+232; i++) {	    int j = (table_Y[i+384] - 32) >> 6;	    if(j<0) j=0;	    if (mode == MODE_BGR)		j <<= 6;	    ((uint8_t *)table_b)[i] = j;	}	break;    case 4:	yuv2rgb_c_internal = yuv2rgb_c_4_ordered_dither; //yuv2rgb_c_4;	table_121 = malloc ((197 + 2*682 + 256 + 132) * sizeof (uint8_t));	entry_size = sizeof (uint8_t);	table_r = table_121 + 197;	table_b = table_121 + 197 + 685;	table_g = table_121 + 197 + 2*682;	for (i = -197; i < 256+197; i++) {	    int j = (table_Y[i+384] - 64) >> 7;	    if(j<0) j=0;	    if (mode == MODE_RGB)		j <<= 3;	    ((uint8_t *)table_r)[i] = j;	}	for (i = -132; i < 256+132; i++) {	    int j = (table_Y[i+384] - 32) >> 6;	    if(j<0) j=0;	    ((uint8_t *)table_g)[i] = j << 1;	}	for (i = -232; i < 256+232; i++) {	    int j =(table_Y[i+384] - 64) >> 7;	    if(j<0) j=0;	    if (mode == MODE_BGR)		j <<= 3;	    ((uint8_t *)table_b)[i] = j;	}	break;    case 1:	yuv2rgb_c_internal = yuv2rgb_c_1_ordered_dither;	table_1 = malloc ((132*2 + 256) * sizeof (uint8_t));	entry_size = sizeof (uint8_t);	table_g = table_1 + 132;	table_r = table_b = NULL;	for (i = -132; i < 256+132; i++) {	    int j = (table_Y[i+384] - 64) >> 7;	    if(j<0) j=0;	    ((uint8_t *)table_g)[i] = j;	}	break;    default:	mp_msg(MSGT_SWS,MSGL_ERR,"%ibpp not supported by yuv2rgb\n", bpp);	//exit (1);    }    for (i = 0; i < 256; i++) {	table_rV[i] = table_r + entry_size * div_round (crv * (i-128), 76309);	table_gU[i] = table_g + entry_size * div_round (cgu * (i-128), 76309);	table_gV[i] = entry_size * div_round (cgv * (i-128), 76309);	table_bU[i] = table_b + entry_size * div_round (cbu * (i-128), 76309);    }}