Hi,

I don't really like the attached patch firstly because it's a hack,
and secondly because it may break with other kinds of threading
(slice/wpp).

It depends on the previous patch around tmvp.

-- 
Christophe
From 225ab2adceef611b4d6ff7825767a741d26395b6 Mon Sep 17 00:00:00 2001
From: Christophe Gisquet <christophe.gisq...@gmail.com>
Date: Sun, 20 Jul 2014 09:52:50 +0200
Subject: [PATCH 2/2] hevc: use different thread wait/report for tmvp

The tmvp only needs decoded MVs, not the whole filtered pixels.
Therefore abuse field 1 to report parsing process, and use it when
checking progress for tmvp.
---
 libavcodec/hevc.c     | 13 +++++++++++--
 libavcodec/hevc_mvs.c |  4 ++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 6f93fcb..5a42e62 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -2326,6 +2326,9 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread)
             return more_data;
         }
 
+        if (s->threads_type & FF_THREAD_FRAME &&
+            x_ctb + ctb_size >= s->sps->width)
+            ff_thread_report_progress(&s->ref->tf, y_ctb+ctb_size, 1);
 
         ctb_addr_ts++;
         ff_hevc_save_states(s, ctb_addr_ts);
@@ -2417,6 +2420,8 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
         x_ctb+=ctb_size;
 
         if(x_ctb >= s->sps->width) {
+            if (s->threads_type & FF_THREAD_FRAME)
+                ff_thread_report_progress(&s->ref->tf, y_ctb+ctb_size, 1);
             break;
         }
     }
@@ -2624,8 +2629,10 @@ static int hevc_frame_start(HEVCContext *s)
     return 0;
 
 fail:
-    if (s->ref && s->threads_type == FF_THREAD_FRAME)
+    if (s->ref && s->threads_type == FF_THREAD_FRAME) {
         ff_thread_report_progress(&s->ref->tf, INT_MAX, 0);
+        ff_thread_report_progress(&s->ref->tf, INT_MAX, 1);
+    }
     s->ref = NULL;
     return ret;
 }
@@ -2983,8 +2990,10 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
     }
 
 fail:
-    if (s->ref && s->threads_type == FF_THREAD_FRAME)
+    if (s->ref && s->threads_type == FF_THREAD_FRAME) {
         ff_thread_report_progress(&s->ref->tf, INT_MAX, 0);
+        ff_thread_report_progress(&s->ref->tf, INT_MAX, 1);
+    }
 
     return ret;
 }
diff --git a/libavcodec/hevc_mvs.c b/libavcodec/hevc_mvs.c
index acc0b71..c50bf5c 100644
--- a/libavcodec/hevc_mvs.c
+++ b/libavcodec/hevc_mvs.c
@@ -277,7 +277,7 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
         x                 &= -16;
         y                 &= -16;
         if (s->threads_type == FF_THREAD_FRAME)
-            ff_thread_await_progress(&ref->tf, y, 0);
+            ff_thread_await_progress(&ref->tf, y, 1);
         x_pu               = x >> s->sps->log2_min_pu_size;
         y_pu               = y >> s->sps->log2_min_pu_size;
         temp_col           = TAB_MVF(x_pu, y_pu);
@@ -291,7 +291,7 @@ static int temporal_luma_motion_vector(HEVCContext *s, int x0, int y0,
         x                 &= -16;
         y                 &= -16;
         if (s->threads_type == FF_THREAD_FRAME)
-            ff_thread_await_progress(&ref->tf, y, 0);
+            ff_thread_await_progress(&ref->tf, y, 1);
         x_pu               = x >> s->sps->log2_min_pu_size;
         y_pu               = y >> s->sps->log2_min_pu_size;
         temp_col           = TAB_MVF(x_pu, y_pu);
-- 
1.9.2.msysgit.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to