Ticket #4513: patch_yadif_greedy_fix.diff

File patch_yadif_greedy_fix.diff, 4.5 KB (added by Markus Schulz <msc@…>, 16 years ago)

better fix

  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    873873
    874874void NuppelVideoPlayer::AutoDeint(VideoFrame *frame)
    875875{
    876     if (!frame || m_scan_locked)
     876    if (!frame)
    877877        return;
     878    if (m_scan_locked)
     879    {
     880        frame->interlaced_frame = m_scan != kScan_Progressive?1:0;
     881        frame->top_field_first = m_scan == kScan_Intr2ndField?1:0;
     882        return;
     883    }
    878884
    879885    if (frame->interlaced_frame)
    880886    {
  • filters/yadif/filter_yadif.c

     
    500500    }
    501501
    502502    /* filter all frames, even if frame->interlaced_frame is not set */
     503    if (frame->interlaced_frame)
    503504    filter_func(
    504505        filter, frame->buf, frame->offsets, frame->pitches,
    505506        frame->width, frame->height, second_field, frame->top_field_first);
  • filters/greedyhdeint/filter_greedyhdeint.c

     
    229229    if (!filter->got_frames[last_frame])
    230230        last_frame = cur_frame;
    231231
     232    if(frame->interlaced_frame)
     233    {
    232234#ifdef MMX
    233     /* SSE Version has best quality. 3DNOW and MMX a litte bit impure */
    234     if (filter->mm_flags & MM_SSE)
    235     {
    236         greedyh_filter_sse(
    237             filter->deint_frame, 2 * frame->width,
    238             filter->frames[cur_frame], filter->frames[last_frame],
    239             bottom_field, second_field, frame->width, frame->height);
    240     }
    241     else if (filter->mm_flags & MM_3DNOW)
    242     {
    243         greedyh_filter_3dnow(
    244             filter->deint_frame, 2 * frame->width,
    245             filter->frames[cur_frame], filter->frames[last_frame],
    246             bottom_field, second_field, frame->width, frame->height);
    247     }
    248     else if (filter->mm_flags & MM_MMX)
    249     {
    250         greedyh_filter_mmx(
    251             filter->deint_frame, 2 * frame->width,
    252             filter->frames[cur_frame], filter->frames[last_frame],
    253             bottom_field, second_field, frame->width, frame->height);
    254     }
    255     else
     235        /* SSE Version has best quality. 3DNOW and MMX a litte bit impure */
     236        if (filter->mm_flags & MM_SSE)
     237        {
     238          greedyh_filter_sse(
     239              filter->deint_frame, 2 * frame->width,
     240              filter->frames[cur_frame], filter->frames[last_frame],
     241              bottom_field, second_field, frame->width, frame->height);
     242        }
     243        else if (filter->mm_flags & MM_3DNOW)
     244        {
     245          greedyh_filter_3dnow(
     246              filter->deint_frame, 2 * frame->width,
     247              filter->frames[cur_frame], filter->frames[last_frame],
     248              bottom_field, second_field, frame->width, frame->height);
     249        }
     250        else if (filter->mm_flags & MM_MMX)
     251        {
     252          greedyh_filter_mmx(
     253              filter->deint_frame, 2 * frame->width,
     254              filter->frames[cur_frame], filter->frames[last_frame],
     255              bottom_field, second_field, frame->width, frame->height);
     256        }
     257        else
    256258#endif
    257     {
    258         /* TODO plain old C implementation */
    259     }
     259        {
     260          /* TODO plain old C implementation */
     261        }
    260262
    261263#if 0
    262       apply_chroma_filter(filter->deint_frame, frame->width * 2,
    263                           frame->width, frame->height );
     264        apply_chroma_filter(filter->deint_frame, frame->width * 2,
     265            frame->width, frame->height );
    264266#endif
    265267
    266     /* convert back to yv12, cause myth only works with this format */
    267     yuy2_to_yv12(
    268         filter->deint_frame, 2 * frame->width,
    269         frame->buf + frame->offsets[0], frame->pitches[0],
    270         frame->buf + frame->offsets[1], frame->pitches[1],
    271         frame->buf + frame->offsets[2], frame->pitches[2],
    272         frame->width, frame->height);
    273 
     268        /* convert back to yv12, cause myth only works with this format */
     269        yuy2_to_yv12(
     270            filter->deint_frame, 2 * frame->width,
     271            frame->buf + frame->offsets[0], frame->pitches[0],
     272            frame->buf + frame->offsets[1], frame->pitches[1],
     273            frame->buf + frame->offsets[2], frame->pitches[2],
     274            frame->width, frame->height);
     275    }
    274276    filter->last_framenr = frame->frameNumber;
    275277
    276278    return 0;