[x265] slicetype: fix flush

Steve Borho steve at borho.org
Thu Jan 8 14:49:27 CET 2015


On 01/08, Satoshi Nakagawa wrote:
> # HG changeset patch
> # User Satoshi Nakagawa <nakagawa424 at oki.com>
> # Date 1420711444 -32400
> #      Thu Jan 08 19:04:04 2015 +0900
> # Node ID 25fb38350e81cda31a5e4af4f2814d12b968a8d1
> # Parent  6dce2b87f0fe4aa37f9c7d66ec99447919b19c64
> slicetype: fix flush

ah, I see where it got stuck.  Let me see if I can fix this without
introducing another state flag.

> diff -r 6dce2b87f0fe -r 25fb38350e81 source/encoder/slicetype.cpp
> --- a/source/encoder/slicetype.cpp	Thu Jan 08 10:29:09 2015 +0530
> +++ b/source/encoder/slicetype.cpp	Thu Jan 08 19:04:04 2015 +0900
> @@ -66,6 +66,7 @@
>      m_lastNonB = NULL;
>      m_bFilled = false;
>      m_bFlushed = false;
> +    m_bFlush = false;
>      m_widthInCU = ((m_param->sourceWidth / 2) + X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS;
>      m_heightInCU = ((m_param->sourceHeight / 2) + X265_LOWRES_CU_SIZE - 1) >> X265_LOWRES_CU_BITS;
>      m_scratch = (int*)x265_malloc(m_widthInCU * sizeof(int));
> @@ -92,6 +93,7 @@
>      /* do not allow slicetypeDecide() to get started again */
>      m_bReady = false;
>      m_bFlushed = false;
> +    m_bFlush = false;
>      m_bBusy = false;
>  
>      if (m_pool)
> @@ -156,6 +158,7 @@
>  /* Called by API thread */
>  void Lookahead::flush()
>  {
> +    m_bFlush = true;
>      m_bFilled = true;
>  
>      /* just in case the input queue is never allowed to fill */
> @@ -233,7 +236,7 @@
>              break;
>      }
>      while (m_inputQueue.size() >= m_param->lookaheadDepth ||
> -           (m_bFlushed && m_inputQueue.size()));
> +           (m_bFlush && m_inputQueue.size()));
>  
>      m_bBusy = false;
>      m_inputQueueLock.release();
> diff -r 6dce2b87f0fe -r 25fb38350e81 source/encoder/slicetype.h
> --- a/source/encoder/slicetype.h	Thu Jan 08 10:29:09 2015 +0530
> +++ b/source/encoder/slicetype.h	Thu Jan 08 19:04:04 2015 +0900
> @@ -163,6 +163,7 @@
>      bool  m_bBusy;    /* input lock - slicetypeDecide() is running */
>      bool  m_bFilled;  /* enough frames in lookahead for output to be available */
>      bool  m_bFlushed; /* no more frames will be received */
> +    bool  m_bFlush;
>  
>      bool  findJob(int);
>  
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel

-- 
Steve Borho


More information about the x265-devel mailing list