[x265-commits] [x265] pixel: fixup zeroBug stride for satd_4x4 in psyCost (spot...
Steve Borho
steve at borho.org
Thu Jun 19 16:46:24 CEST 2014
details: http://hg.videolan.org/x265/rev/f5be40ace2cc
branches:
changeset: 7117:f5be40ace2cc
user: Steve Borho <steve at borho.org>
date: Wed Jun 18 13:40:40 2014 -0500
description:
pixel: fixup zeroBug stride for satd_4x4 in psyCost (spotted by MinGW)
This fixes a bug introduced in f3fb2d2b0ba6
Subject: [x265] quant: correct QP range clipping for 10-bit input depths.
details: http://hg.videolan.org/x265/rev/59a6891dff51
branches:
changeset: 7118:59a6891dff51
user: Deepthi Nandakumar <deepthi at multicorewareinc.com>
date: Thu Jun 19 14:37:07 2014 +0530
description:
quant: correct QP range clipping for 10-bit input depths.
Fixes a bad hash error and artifacts introduced by commit c8973aec5e70
Subject: [x265] dpb: destroy and delete m_reconPicYuv from picSymFreeList
details: http://hg.videolan.org/x265/rev/d86fea3cea9c
branches:
changeset: 7119:d86fea3cea9c
user: Gopu Govindaswamy
date: Thu Jun 19 10:24:02 2014 +0530
description:
dpb: destroy and delete m_reconPicYuv from picSymFreeList
Subject: [x265] encoder: remove m_freeList from encoder class, the m_freeList moved into dpb
details: http://hg.videolan.org/x265/rev/d2a13e8541f4
branches:
changeset: 7120:d2a13e8541f4
user: Gopu Govindaswamy
date: Thu Jun 19 10:28:47 2014 +0530
description:
encoder: remove m_freeList from encoder class, the m_freeList moved into dpb
Subject: [x265] keep TComPic until next call if recpic is exported as pic_out
details: http://hg.videolan.org/x265/rev/ecccd5401d27
branches:
changeset: 7121:ecccd5401d27
user: Satoshi Nakagawa <nakagawa424 at oki.com>
date: Thu Jun 19 22:13:36 2014 +0900
description:
keep TComPic until next call if recpic is exported as pic_out
We must prevent the recon YUV from being recycled until the next picture is
encoded.
diffstat:
source/Lib/TLibCommon/TComTrQuant.cpp | 2 +-
source/common/pixel.cpp | 4 ++--
source/encoder/dpb.cpp | 2 ++
source/encoder/encoder.cpp | 24 ++++++++++++++++++++++--
source/encoder/encoder.h | 3 ++-
5 files changed, 29 insertions(+), 6 deletions(-)
diffs (113 lines):
diff -r 5db614f31b85 -r ecccd5401d27 source/Lib/TLibCommon/TComTrQuant.cpp
--- a/source/Lib/TLibCommon/TComTrQuant.cpp Wed Jun 18 13:34:26 2014 -0500
+++ b/source/Lib/TLibCommon/TComTrQuant.cpp Thu Jun 19 22:13:36 2014 +0900
@@ -123,7 +123,7 @@ void TComTrQuant::setQPforQuant(int qpy,
if (ttype == TEXT_LUMA)
{
qpScaled = qpy + qpBdOffset;
- qpScaled = Clip3(-QP_BD_OFFSET, MAX_QP, qpScaled);
+ qpScaled = Clip3(0, MAX_QP + QP_BD_OFFSET, qpScaled);
}
else
{
diff -r 5db614f31b85 -r ecccd5401d27 source/common/pixel.cpp
--- a/source/common/pixel.cpp Wed Jun 18 13:34:26 2014 -0500
+++ b/source/common/pixel.cpp Thu Jun 19 22:13:36 2014 +0900
@@ -741,8 +741,8 @@ int psyCost(pixel *source, intptr_t sstr
else
{
/* 4x4 is too small for sa8d */
- int sourceEnergy = satd_4x4(source, sstride, zeroBuf, 8) - (sad<4, 4>(source, sstride, zeroBuf, 0) >> 2);
- int reconEnergy = satd_4x4(recon, rstride, zeroBuf, 8) - (sad<4, 4>(recon, rstride, zeroBuf, 0) >> 2);
+ int sourceEnergy = satd_4x4(source, sstride, zeroBuf, 0) - (sad<4, 4>(source, sstride, zeroBuf, 0) >> 2);
+ int reconEnergy = satd_4x4(recon, rstride, zeroBuf, 0) - (sad<4, 4>(recon, rstride, zeroBuf, 0) >> 2);
return abs(sourceEnergy - reconEnergy);
}
}
diff -r 5db614f31b85 -r ecccd5401d27 source/encoder/dpb.cpp
--- a/source/encoder/dpb.cpp Wed Jun 18 13:34:26 2014 -0500
+++ b/source/encoder/dpb.cpp Thu Jun 19 22:13:36 2014 +0900
@@ -51,6 +51,8 @@ DPB::~DPB()
{
TComPicSym* next = m_picSymFreeList->m_freeListNext;
m_picSymFreeList->destroy();
+ m_picSymFreeList->m_reconPicYuv->destroy();
+ delete m_picSymFreeList->m_reconPicYuv;
delete m_picSymFreeList;
m_picSymFreeList = next;
}
diff -r 5db614f31b85 -r ecccd5401d27 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp Wed Jun 18 13:34:26 2014 -0500
+++ b/source/encoder/encoder.cpp Thu Jun 19 22:13:36 2014 +0900
@@ -59,6 +59,7 @@ Encoder::Encoder()
m_frameEncoder = NULL;
m_rateControl = NULL;
m_dpb = NULL;
+ m_exportedPic = NULL;
m_nals = NULL;
m_packetData = NULL;
m_outputCount = 0;
@@ -132,6 +133,12 @@ void Encoder::create()
void Encoder::destroy()
{
+ if (m_exportedPic)
+ {
+ ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+ m_exportedPic = NULL;
+ }
+
if (m_frameEncoder)
{
for (int i = 0; i < m_totalFrameThreads; i++)
@@ -255,6 +262,13 @@ int Encoder::encode(bool flush, const x2
if (m_aborted)
return -1;
+ if (m_exportedPic)
+ {
+ ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+ m_exportedPic = NULL;
+ m_dpb->recycleUnreferenced();
+ }
+
if (pic_in)
{
if (pic_in->colorSpace != m_param->internalCsp)
@@ -434,8 +448,14 @@ int Encoder::encode(bool flush, const x2
finishFrameStats(out, curEncoder, bits);
// Allow this frame to be recycled if no frame encoders are using it for reference
- ATOMIC_DEC(&out->m_countRefEncoders);
- m_dpb->recycleUnreferenced();
+ if (!pic_out)
+ {
+ ATOMIC_DEC(&out->m_countRefEncoders);
+ m_dpb->recycleUnreferenced();
+ }
+ else
+ m_exportedPic = out;
+
ret = 1;
}
diff -r 5db614f31b85 -r ecccd5401d27 source/encoder/encoder.h
--- a/source/encoder/encoder.h Wed Jun 18 13:34:26 2014 -0500
+++ b/source/encoder/encoder.h Thu Jun 19 22:13:36 2014 +0900
@@ -76,7 +76,6 @@ private:
bool m_aborted; // fatal error detected
int m_pocLast; ///< time index (POC)
int m_outputCount;
- PicList m_freeList;
int m_bframeDelay;
int64_t m_firstPts;
@@ -88,6 +87,8 @@ private:
FrameEncoder* m_frameEncoder;
DPB* m_dpb;
+ TComPic* m_exportedPic;
+
/* frame parallelism */
int m_curEncoder;
More information about the x265-commits
mailing list