[mythtv-users] New deinterlacer for perfect image quality when using an interlaced display, mode that matches the source

Paul Gardiner lists at glidos.net
Sun Mar 29 18:58:42 UTC 2009


Tom Dexter wrote:
> I noticed some flickering of translucent portions of the OSD (the
> playback menu for example) while this deinterlacer was in use (unless
> video is paused).  On 720p stations where it gets disabled this
> doesn't occur at all.

I think I've just sussed what is causing this. The deinterlacer gets
given each frame twice. Each time it overwrites the bottom field,
but leaves the top field unchanged. After each call the OSD will
be rendered over the frame. The fact that I don't update the
top field in the second call to the deinterlacer means the OSD gets
rendered over the top of a previous rendering. That doesn't matter
for a solid OSD, but if translucent the top field will be
darker than the bottom.

Should be easy to fix:

Change

    if (y & tff)
    {
        if(parity)
        {
            /* Second call: put back the second field to its previous 
state */
            memcpy(dst + dst_offsets[i] + y*dst_stride[i], 
&p->ref[nr_c][i][y*refs], w);
        }
        else
        {
            /* First call: replace second field by that of the previous 
frame */
            memcpy(dst + dst_offsets[i] + y*dst_stride[i], 
&p->ref[nr_p][i][y*refs], w);
        }
    }

to
    if(parity)
    {
        /* Second call: put back the whole frame to its previous state.
         * Although we have not altered first field, we need to overwrite
         * it because the OSD will have been rendered to the copy passed
         * in. */
        memcpy(dst + dst_offsets[i] + y*dst_stride[i], 
&p->ref[nr_c][i][y*refs], w);
    }
    else
    {
        /* First call: replace second field by that of the previous frame */
        if (y & tff)
        {
            memcpy(dst + dst_offsets[i] + y*dst_stride[i], 
&p->ref[nr_p][i][y*refs], w);
        }
    }



More information about the mythtv-users mailing list