Hi, 2014-07-18 22:24 GMT+02:00 Christophe Gisquet <christophe.gisq...@gmail.com>: > 014-07-18 17:41 GMT+02:00 Christophe Gisquet <christophe.gisq...@gmail.com>: >> This is more of an RFC > > Only a part can apply, Michaël should have a patch with the correct part.
After more discussion with Mickaël, the patch was more correct than first thought Here's an updated version reflecting our conclusions. -- Christophe
From e0e6d453da102c1440f0a55f046f5ffc847c40c8 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet <christophe.gisq...@gmail.com> Date: Sat, 19 Jul 2014 10:30:06 +0200 Subject: [PATCH] hevc: report more precise progress There's a lag of one CTB line for SAO behind deblocking filter, except for last line. However, once SAO has been completed on a line, all its pixels, i.e. up to y+ctb_size are filtered and ready to be used as reference. Without SAO, when deblocking filter finishes a CTB line, only the bottom bottom 4 pixels may be filtered when next CTB is process by the deblocing. The await_progess for hevc then checks whether the bottom pixels of a PU requires access beyond that point, so the reporting should effectively report up to the the above limits. --- libavcodec/hevc_filter.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c index 0d3e238..108df49 100644 --- a/libavcodec/hevc_filter.c +++ b/libavcodec/hevc_filter.c @@ -676,9 +676,9 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) { + int x_end = x >= s->sps->width - ctb_size; deblocking_filter_CTB(s, x, y); if (s->sps->sao_enabled) { - int x_end = x >= s->sps->width - ctb_size; int y_end = y >= s->sps->height - ctb_size; if (y && x) sao_filter_CTB(s, x - ctb_size, y - ctb_size); @@ -687,18 +687,15 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) if (y && x_end) { sao_filter_CTB(s, x, y - ctb_size); if (s->threads_type & FF_THREAD_FRAME ) - ff_thread_report_progress(&s->ref->tf, y - ctb_size, 0); + ff_thread_report_progress(&s->ref->tf, y, 0); } if (x_end && y_end) { sao_filter_CTB(s, x , y); if (s->threads_type & FF_THREAD_FRAME ) - ff_thread_report_progress(&s->ref->tf, y, 0); + ff_thread_report_progress(&s->ref->tf, y + ctb_size, 0); } - } else { - if (y && x >= s->sps->width - ctb_size) - if (s->threads_type & FF_THREAD_FRAME ) - ff_thread_report_progress(&s->ref->tf, y, 0); - } + } else if (s->threads_type & FF_THREAD_FRAME && x_end) + ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); } void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size) -- 1.9.2.msysgit.0
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel