Esempio n. 1
0
static void video_cbm_palette_to_ycbcr_oddlines(video_resources_t *video_resources,
                                                const video_cbm_palette_t *p, video_ycbcr_palette_t* ycbcr)
{
    unsigned int i;
    float offs = (((float)(video_resources->pal_oddlines_phase)) / (2000.0f / 90.0f)) + (180.0f - 45.0f);

    for (i = 0; i < p->num_entries; i++) {
        video_convert_cbm_to_ycbcr(&p->entries[i], p->saturation, (p->phase + offs), &ycbcr->entries[i]);
    }
}
Esempio n. 2
0
/* Convert a CBM palette to YCbCr. */
static void video_cbm_palette_to_ycbcr(const video_cbm_palette_t *p,
                                       video_ycbcr_palette_t* ycbcr)
{
    unsigned int i;

    for (i = 0;i < p->num_entries; i++) {
        video_convert_cbm_to_ycbcr(&p->entries[i], p->saturation,
                                   p->phase, &ycbcr->entries[i]);
    }
}
Esempio n. 3
0
/* Convert the internal videochip palette to YCbCr. */
static void video_cbm_palette_to_ycbcr(const video_cbm_palette_t *p, video_ycbcr_palette_t* ycbcr, int video)
{
    unsigned int i;
#ifdef DEBUG_VIDEO
    int cb, cr;
#endif

    DBG(("video_cbm_palette_to_ycbcr"));

    if (p->type == CBM_PALETTE_RGB) {
        /* special case for handling chips that output RGB (such as the VDC),
           admittedly slightly ugly but simple and effective :) */
        palette_entry_t src;
        for (i = 0; i < p->num_entries; i++) {
            src.red = (BYTE)p->entries[i].luminance;
            src.green = (BYTE)p->entries[i].angle;
            src.blue = p->entries[i].direction;
            video_convert_rgb_to_renderer(&src, &ycbcr->entries[i], video);
        }
    } else {
        for (i = 0; i < p->num_entries; i++) {
            video_convert_cbm_to_ycbcr(&p->entries[i], p->saturation, p->phase, &ycbcr->entries[i], video);
#ifdef DEBUG_VIDEO
            cb = ycbcr->entries[i].cb;
            cr = ycbcr->entries[i].cr;
            if (video) {
                video_convert_ycbcr_to_yuv(&ycbcr->entries[i], &ycbcr->entries[i]);
                DBG((" %2d: Luma:%4d Angle:%4d Dir:%2d    Y:%4d Cb:%4d Cr:%4d    Y:%4d U:%4d V:%4d", i,
                    (int)p->entries[i].luminance, (int)p->entries[i].angle, (int)p->entries[i].direction,
                    (int)ycbcr->entries[i].y, cb, cr,
                    (int)ycbcr->entries[i].y, (int)ycbcr->entries[i].cb, (int)ycbcr->entries[i].cr
                    ));
            } else {
                /* video_convert_ycbcr_to_yiq(&ycbcr->entries[i], &ycbcr->entries[i]); */
                DBG((" %2d: Luma:%4d Angle:%4d Dir:%2d    Y:%4d Cb:%4d Cr:%4d    Y:%4d I:%4d Q:%4d", i,
                    (int)p->entries[i].luminance, (int)p->entries[i].angle, (int)p->entries[i].direction,
                    (int)ycbcr->entries[i].y, cb, cr,
                    (int)ycbcr->entries[i].y, (int)ycbcr->entries[i].cb, (int)ycbcr->entries[i].cr
                    ));
            }
            ycbcr->entries[i].cb = cb;
            ycbcr->entries[i].cr = cr;
#endif
        }
    }
}
Esempio n. 4
0
/* Convert the internal videochip palette to YCbCr. */
static void video_cbm_palette_to_ycbcr(const video_cbm_palette_t *p, video_ycbcr_palette_t* ycbcr)
{
    unsigned int i;

    if (p->type == CBM_PALETTE_RGB) {
        /* special case for handling chips that output RGB (such as the VDC),
           admittedly slightly ugly but simple and effective :) */
        palette_entry_t src;
        for (i = 0; i < p->num_entries; i++) {
            src.red = (BYTE)p->entries[i].luminance;
            src.green = (BYTE)p->entries[i].angle;
            src.blue = p->entries[i].direction;
            video_convert_rgb_to_ycbcr(&src, &ycbcr->entries[i]);
        }
    } else {
        for (i = 0; i < p->num_entries; i++) {
            video_convert_cbm_to_ycbcr(&p->entries[i], p->saturation, p->phase, &ycbcr->entries[i]);
        }
    }
}