[x265] [PATCH 1 of 3] improve motionEstimate() by bypass reduce MV Candidate

chen chenm003 at 163.com
Mon Aug 31 15:32:22 CEST 2015


This is simplest way, these MVC generate from MV reference list, we can't remove reduce mv in the list since it defined by HEVC specifiction.
 
btw: my debug code catch more than 6 duplicate MVs in the list.

At 2015-08-31 13:48:00,"Deepthi Nandakumar" <deepthi at multicorewareinc.com> wrote:

hmm, ok. But wouldnt it be better to do this in predMV, and generate the right number of numCandidates?


I'm looking suspiciously at the dynamic adaptation of merange (lines 793:844). This might be a good time to fix that as well.



On Thu, Aug 27, 2015 at 5:43 AM, Min Chen <chenm003 at 163.com> wrote:
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1440632250 25200
# Node ID be9fbc8bf0d5e57949367293035d047d6a7d9da8
# Parent  d8091487bc9749e702c468786b0cd9e663478a91
improve motionEstimate() by bypass reduce MV Candidate
---
 source/common/mv.h        |    2 ++
 source/encoder/motion.cpp |   11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff -r d8091487bc97 -r be9fbc8bf0d5 source/common/mv.h
--- a/source/common/mv.h        Tue Aug 25 16:39:12 2015 -0700
+++ b/source/common/mv.h        Wed Aug 26 16:37:30 2015 -0700
@@ -79,6 +79,8 @@

     bool operator !() const                    { return !word; }

+    MV operator ~() const                    { return ~word; }
+
     // Scale down a QPEL mv to FPEL mv, rounding up by one HPEL offset
     MV roundToFPel() const                     { return MV((x + 2) >> 2, (y + 2) >> 2); }

diff -r d8091487bc97 -r be9fbc8bf0d5 source/encoder/motion.cpp
--- a/source/encoder/motion.cpp Tue Aug 25 16:39:12 2015 -0700
+++ b/source/encoder/motion.cpp Wed Aug 26 16:37:30 2015 -0700
@@ -621,10 +621,19 @@
         }
     }

-    X265_CHECK(!(ref->isLowres && numCandidates), "lowres motion candidates not allowed\n")
+    X265_CHECK(!(ref->isLowres && numCandidates), "lowres motion candidates not allowed\n");
+
     // measure SAD cost at each QPEL motion vector candidate
+    MV prevMV;
+    if (numCandidates)
+        prevMV = ~mvc[0];
     for (int i = 0; i < numCandidates; i++)
     {
+        // Bypass duplicated mvc, it isn't a good way but simplest. Prepare to sort input mvc list will give us less candidate
+        if (prevMV == mvc[i])
+            continue;
+        prevMV = mvc[i];
+
         MV m = mvc[i].clipped(qmvmin, qmvmax);
         if (m.notZero() & (m != pmv ? 1 : 0) & (m != bestpre ? 1 : 0)) // check already measured
         {

_______________________________________________
x265-devel mailing list
x265-devel at videolan.org
https://mailman.videolan.org/listinfo/x265-devel


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20150831/411d1d11/attachment.html>


More information about the x265-devel mailing list