Skip to content

Commit

Permalink
Fix h264 blocking artifacts
Browse files Browse the repository at this point in the history
Reverse commit 99042c2bf6 of ffmpeg 4.4. which causes blocking artifacts
in h264 interlaced video with vdpau.

Signed-off-by: Peter Bennett <pbennett@mythtv.org>
  • Loading branch information
kmdewaal authored and bennettpeter committed Nov 28, 2021
1 parent 1147ad9 commit f521387
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions mythtv/external/FFmpeg/libavcodec/h264_slice.c
Expand Up @@ -1603,15 +1603,14 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
ff_thread_await_progress(&prev->tf, INT_MAX, 0);
if (prev->field_picture)
ff_thread_await_progress(&prev->tf, INT_MAX, 1);
ff_thread_release_buffer(h->avctx, &h->short_ref[0]->tf);
h->short_ref[0]->tf.f = h->short_ref[0]->f;
ret = ff_thread_ref_frame(&h->short_ref[0]->tf, &prev->tf);
if (ret < 0)
return ret;
av_image_copy(h->short_ref[0]->f->data,
h->short_ref[0]->f->linesize,
(const uint8_t **)prev->f->data,
prev->f->linesize,
prev->f->format,
prev->f->width,
prev->f->height);
h->short_ref[0]->poc = prev->poc + 2U;
ff_thread_report_progress(&h->short_ref[0]->tf, INT_MAX, 0);
if (h->short_ref[0]->field_picture)
ff_thread_report_progress(&h->short_ref[0]->tf, INT_MAX, 1);
} else if (!h->frame_recovered && !h->avctx->hwaccel)
ff_color_frame(h->short_ref[0]->f, c);
h->short_ref[0]->frame_num = h->poc.prev_frame_num;
Expand Down

0 comments on commit f521387

Please sign in to comment.