[x265-commits] [x265] cleanups
Steve Borho
steve at borho.org
Tue Mar 17 23:12:03 CET 2015
details: http://hg.videolan.org/x265/rev/a593af299578
branches:
changeset: 9786:a593af299578
user: Steve Borho <steve at borho.org>
date: Tue Mar 17 16:46:48 2015 -0500
description:
cleanups
diffstat:
source/encoder/dpb.cpp | 34 ++++++++++++++--------------------
source/encoder/ratecontrol.cpp | 7 ++-----
2 files changed, 16 insertions(+), 25 deletions(-)
diffs (68 lines):
diff -r 572b8f2dc414 -r a593af299578 source/encoder/dpb.cpp
--- a/source/encoder/dpb.cpp Wed Mar 18 00:43:45 2015 +0530
+++ b/source/encoder/dpb.cpp Tue Mar 17 16:46:48 2015 -0500
@@ -106,27 +106,21 @@ void DPB::prepareEncode(Frame *newFrame)
{
newFrame->m_encData->m_bHasReferences = false;
- // Adjust NAL type for unreferenced B frames
- if (m_bTemporalSublayer && !(slice->m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R
- || slice->m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R))
- slice->m_nalUnitType = NAL_UNIT_CODED_SLICE_TSA_N;
- else
+ // Adjust NAL type for unreferenced B frames (change from _R "referenced"
+ // to _N "non-referenced" NAL unit type)
+ switch (slice->m_nalUnitType)
{
- // change from _R "referenced" to _N "non-referenced" NAL unit type
- switch (slice->m_nalUnitType)
- {
- case NAL_UNIT_CODED_SLICE_TRAIL_R:
- slice->m_nalUnitType = NAL_UNIT_CODED_SLICE_TRAIL_N;
- break;
- case NAL_UNIT_CODED_SLICE_RADL_R:
- slice->m_nalUnitType = NAL_UNIT_CODED_SLICE_RADL_N;
- break;
- case NAL_UNIT_CODED_SLICE_RASL_R:
- slice->m_nalUnitType = NAL_UNIT_CODED_SLICE_RASL_N;
- break;
- default:
- break;
- }
+ case NAL_UNIT_CODED_SLICE_TRAIL_R:
+ slice->m_nalUnitType = m_bTemporalSublayer ? NAL_UNIT_CODED_SLICE_TSA_N : NAL_UNIT_CODED_SLICE_TRAIL_N;
+ break;
+ case NAL_UNIT_CODED_SLICE_RADL_R:
+ slice->m_nalUnitType = NAL_UNIT_CODED_SLICE_RADL_N;
+ break;
+ case NAL_UNIT_CODED_SLICE_RASL_R:
+ slice->m_nalUnitType = NAL_UNIT_CODED_SLICE_RASL_N;
+ break;
+ default:
+ break;
}
}
else
diff -r 572b8f2dc414 -r a593af299578 source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp Wed Mar 18 00:43:45 2015 +0530
+++ b/source/encoder/ratecontrol.cpp Tue Mar 17 16:46:48 2015 -0500
@@ -1384,17 +1384,14 @@ double RateControl::rateEstimateQscale(F
if (!m_2pass)
{
qScale = clipQscale(curFrame, rce, qScale);
- /* clip qp to permissible range after vbv-lookahead estimation to avoid possible
+ /* clip qp to permissible range after vbv-lookahead estimation to avoid possible
* mispredictions by initial frame size predictors */
- // if (m_pred[m_sliceType].count == 1)
- // qScale = x265_clip3(lmin, lmax, qScale);
m_lastQScaleFor[m_sliceType] = qScale;
rce->frameSizePlanned = predictSize(&m_pred[m_sliceType], qScale, (double)m_currentSatd);
}
else
- {
rce->frameSizePlanned = qScale2bits(rce, qScale);
- }
+
/* Limit planned size by MinCR */
rce->frameSizePlanned = X265_MIN(rce->frameSizePlanned, rce->frameSizeMaximum);
rce->frameSizeEstimated = rce->frameSizePlanned;
More information about the x265-commits
mailing list