Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r b9948752d551 source/common/cudata.cpp
- --- a/source/common/cudata.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/common/cudata.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -1379,7 +1379,7 @@
- uint32_t CUData::getInterMergeCandidates(uint32_t absPartIdx, uint32_t puIdx, MVField(*candMvField)[2], uint8_t* candDir) const
- {
- uint32_t absPartAddr = m_absIdxInCTU + absPartIdx;
- - const bool isInterB = m_slice->isInterB();
- + const bool isInterB = (m_slice->isInterP() || m_slice->isInterB());
- const uint32_t maxNumMergeCand = m_slice->m_maxNumMergeCand;
- @@ -1708,7 +1708,7 @@
- if (tempRefIdx != -1)
- {
- uint32_t cuAddr = neighbours[MD_COLLOCATED].cuAddr[picList];
- - const Frame* colPic = m_slice->m_refPicList[m_slice->isInterB() && !m_slice->m_colFromL0Flag][m_slice->m_colRefIdx];
- + const Frame* colPic = m_slice->m_refPicList[(m_slice->isInterP() || m_slice->isInterB()) && !m_slice->m_colFromL0Flag][m_slice->m_colRefIdx];
- const CUData* colCU = colPic->m_encData->getPicCTU(cuAddr);
- // Scale the vector
- @@ -1885,7 +1885,7 @@
- bool CUData::getColMVP(MV& outMV, int& outRefIdx, int picList, int cuAddr, int partUnitIdx) const
- {
- - const Frame* colPic = m_slice->m_refPicList[m_slice->isInterB() && !m_slice->m_colFromL0Flag][m_slice->m_colRefIdx];
- + const Frame* colPic = m_slice->m_refPicList[(m_slice->isInterP() || m_slice->isInterB()) && !m_slice->m_colFromL0Flag][m_slice->m_colRefIdx];
- const CUData* colCU = colPic->m_encData->getPicCTU(cuAddr);
- uint32_t absPartAddr = partUnitIdx & TMVP_UNIT_MASK;
- @@ -1920,7 +1920,7 @@
- // Cache the collocated MV.
- bool CUData::getCollocatedMV(int cuAddr, int partUnitIdx, InterNeighbourMV *neighbour) const
- {
- - const Frame* colPic = m_slice->m_refPicList[m_slice->isInterB() && !m_slice->m_colFromL0Flag][m_slice->m_colRefIdx];
- + const Frame* colPic = m_slice->m_refPicList[(m_slice->isInterP() || m_slice->isInterB()) && !m_slice->m_colFromL0Flag][m_slice->m_colRefIdx];
- const CUData* colCU = colPic->m_encData->getPicCTU(cuAddr);
- uint32_t absPartAddr = partUnitIdx & TMVP_UNIT_MASK;
- diff -r b9948752d551 source/common/deblock.cpp
- --- a/source/common/deblock.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/common/deblock.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -214,11 +214,6 @@
- const MV& mvP0 = refP0 ? cuP->m_mv[0][partP] : zeroMv;
- const MV& mvQ0 = refQ0 ? cuQ->m_mv[0][partQ] : zeroMv;
- - if (sliceQ->isInterP() && sliceP->isInterP())
- - {
- - return ((refP0 != refQ0) ||
- - (abs(mvQ0.x - mvP0.x) >= 4) || (abs(mvQ0.y - mvP0.y) >= 4)) ? 1 : 0;
- - }
- // (sliceQ->isInterB() || sliceP->isInterB())
- const Frame* refP1 = sliceP->getRefPic(1, cuP->m_refIdx[1][partP]);
- diff -r b9948752d551 source/common/predict.cpp
- --- a/source/common/predict.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/common/predict.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -84,7 +84,7 @@
- int refIdx0 = cu.m_refIdx[0][pu.puAbsPartIdx];
- int refIdx1 = cu.m_refIdx[1][pu.puAbsPartIdx];
- - if (cu.m_slice->isInterP())
- + if (0)
- {
- /* P Slice */
- WeightValues wv0[3];
- diff -r b9948752d551 source/common/slice.cpp
- --- a/source/common/slice.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/common/slice.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -87,7 +87,7 @@
- X265_CHECK(cIdx == numPocTotalCurr, "RPS index check fail\n");
- - if (m_sliceType == B_SLICE)
- + if (m_sliceType == P_SLICE || m_sliceType == B_SLICE)
- {
- cIdx = 0;
- for (i = 0; i < numPocStCurr1; i++, cIdx++)
- @@ -109,7 +109,7 @@
- m_refPicList[0][rIdx] = rpsCurrList0[cIdx];
- }
- - if (m_sliceType != B_SLICE)
- + if (!(m_sliceType == P_SLICE || m_sliceType == B_SLICE))
- {
- m_numRefIdx[1] = 0;
- memset(m_refPicList[1], 0, sizeof(m_refPicList[1]));
- diff -r b9948752d551 source/encoder/analysis.cpp
- --- a/source/encoder/analysis.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/encoder/analysis.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -138,7 +138,7 @@
- m_reuseIntraDataCTU = (analysis_intra_data *)m_frame->m_analysisData.intraData;
- else
- {
- - int numPredDir = m_slice->isInterP() ? 1 : 2;
- + int numPredDir = 2; //m_slice->isInterP() ? 1 : 2;
- m_reuseInterDataCTU = (analysis_inter_data *)m_frame->m_analysisData.interData;
- m_reuseRef = &m_reuseInterDataCTU->ref[ctu.m_cuAddr * X265_MAX_PRED_MODE_PER_CTU * numPredDir];
- m_reuseBestMergeCand = &m_reuseInterDataCTU->bestMergeCand[ctu.m_cuAddr * CUGeom::MAX_GEOMS];
- @@ -390,7 +390,7 @@
- case PRED_2Nx2N:
- slave.checkInter_rd0_4(md.pred[PRED_2Nx2N], pmode.cuGeom, SIZE_2Nx2N);
- - if (m_slice->m_sliceType == B_SLICE)
- + if (m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE)
- slave.checkBidir2Nx2N(md.pred[PRED_2Nx2N], md.pred[PRED_BIDIR], pmode.cuGeom);
- break;
- @@ -436,7 +436,7 @@
- case PRED_2Nx2N:
- slave.checkInter_rd5_6(md.pred[PRED_2Nx2N], pmode.cuGeom, SIZE_2Nx2N, false);
- md.pred[PRED_BIDIR].rdCost = MAX_INT64;
- - if (m_slice->m_sliceType == B_SLICE)
- + if (m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE)
- {
- slave.checkBidir2Nx2N(md.pred[PRED_2Nx2N], md.pred[PRED_BIDIR], pmode.cuGeom);
- if (md.pred[PRED_BIDIR].sa8dCost < MAX_INT64)
- @@ -584,7 +584,7 @@
- checkBestMode(*bestInter, depth);
- /* If BIDIR is available and within 17/16 of best inter option, choose by RDO */
- - if (m_slice->m_sliceType == B_SLICE && md.pred[PRED_BIDIR].sa8dCost != MAX_INT64 &&
- + if ((m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE) && md.pred[PRED_BIDIR].sa8dCost != MAX_INT64 &&
- md.pred[PRED_BIDIR].sa8dCost * 16 <= bestInter->sa8dCost * 17)
- {
- encodeResAndCalcRdInterCU(md.pred[PRED_BIDIR], cuGeom);
- @@ -599,7 +599,7 @@
- if (!md.bestMode || bestInter->sa8dCost < md.bestMode->sa8dCost)
- md.bestMode = bestInter;
- - if (m_slice->m_sliceType == B_SLICE && md.pred[PRED_BIDIR].sa8dCost < md.bestMode->sa8dCost)
- + if ((m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE) && md.pred[PRED_BIDIR].sa8dCost < md.bestMode->sa8dCost)
- md.bestMode = &md.pred[PRED_BIDIR];
- if (bTryIntra && md.pred[PRED_INTRA].sa8dCost < md.bestMode->sa8dCost)
- @@ -762,7 +762,7 @@
- md.pred[PRED_2Nx2N].cu.initSubCU(parentCTU, cuGeom);
- checkInter_rd0_4(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N);
- - if (m_slice->m_sliceType == B_SLICE)
- + if (m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE)
- {
- md.pred[PRED_BIDIR].cu.initSubCU(parentCTU, cuGeom);
- checkBidir2Nx2N(md.pred[PRED_2Nx2N], md.pred[PRED_BIDIR], cuGeom);
- @@ -837,7 +837,7 @@
- checkBestMode(*bestInter, depth);
- /* If BIDIR is available and within 17/16 of best inter option, choose by RDO */
- - if (m_slice->m_sliceType == B_SLICE && md.pred[PRED_BIDIR].sa8dCost != MAX_INT64 &&
- + if ((m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE) && md.pred[PRED_BIDIR].sa8dCost != MAX_INT64 &&
- md.pred[PRED_BIDIR].sa8dCost * 16 <= bestInter->sa8dCost * 17)
- {
- encodeResAndCalcRdInterCU(md.pred[PRED_BIDIR], cuGeom);
- @@ -859,7 +859,7 @@
- if (!md.bestMode || bestInter->sa8dCost < md.bestMode->sa8dCost)
- md.bestMode = bestInter;
- - if (m_slice->m_sliceType == B_SLICE &&
- + if ((m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE) &&
- md.pred[PRED_BIDIR].sa8dCost < md.bestMode->sa8dCost)
- md.bestMode = &md.pred[PRED_BIDIR];
- @@ -1062,7 +1062,7 @@
- checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, false);
- checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
- - if (m_slice->m_sliceType == B_SLICE)
- + if (m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE)
- {
- md.pred[PRED_BIDIR].cu.initSubCU(parentCTU, cuGeom);
- checkBidir2Nx2N(md.pred[PRED_2Nx2N], md.pred[PRED_BIDIR], cuGeom);
- @@ -1233,7 +1233,7 @@
- continue;
- tempPred->cu.m_mvpIdx[0][0] = (uint8_t)i; // merge candidate ID is stored in L0 MVP idx
- - X265_CHECK(m_slice->m_sliceType == B_SLICE || !(candDir[i] & 0x10), " invalid merge for P slice\n");
- + X265_CHECK((m_slice->m_sliceType == P_SLICE || m_slice->m_sliceType == B_SLICE) || !(candDir[i] & 0x10), " invalid merge for P slice\n");
- tempPred->cu.m_interDir[0] = candDir[i];
- tempPred->cu.m_mv[0][0] = candMvField[i][0].mv;
- tempPred->cu.m_mv[1][0] = candMvField[i][1].mv;
- @@ -1441,7 +1441,7 @@
- interMode.initCosts();
- interMode.cu.setPartSizeSubParts(partSize);
- interMode.cu.setPredModeSubParts(MODE_INTER);
- - int numPredDir = m_slice->isInterP() ? 1 : 2;
- + int numPredDir = 2; //m_slice->isInterP() ? 1 : 2;
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU)
- {
- @@ -1489,7 +1489,7 @@
- interMode.initCosts();
- interMode.cu.setPartSizeSubParts(partSize);
- interMode.cu.setPredModeSubParts(MODE_INTER);
- - int numPredDir = m_slice->isInterP() ? 1 : 2;
- + int numPredDir = 2; //m_slice->isInterP() ? 1 : 2;
- if (m_param->analysisMode == X265_ANALYSIS_LOAD && m_reuseInterDataCTU)
- {
- diff -r b9948752d551 source/encoder/dpb.cpp
- --- a/source/encoder/dpb.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/encoder/dpb.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -145,8 +145,8 @@
- // Mark pictures in m_piclist as unreferenced if they are not included in RPS
- applyReferencePictureSet(&slice->m_rps, pocCurr);
- - slice->m_numRefIdx[0] = X265_MIN(m_maxRefL0, slice->m_rps.numberOfNegativePictures); // Ensuring L0 contains just the -ve POC
- - slice->m_numRefIdx[1] = X265_MIN(m_maxRefL1, slice->m_rps.numberOfPositivePictures);
- + slice->m_numRefIdx[0] = X265_MIN(m_maxRefL0, slice->m_rps.numberOfNegativePictures); // Ensuring L0 contains just the -ve POC
- + slice->m_numRefIdx[1] = X265_MIN(m_maxRefL1, slice->m_rps.numberOfNegativePictures);
- slice->setRefPicList(m_picList);
- X265_CHECK(slice->m_sliceType != B_SLICE || slice->m_numRefIdx[1], "B slice without L1 references (non-fatal)\n");
- @@ -171,7 +171,7 @@
- /* Increment reference count of all motion-referenced frames to prevent them
- * from being recycled. These counts are decremented at the end of
- * compressFrame() */
- - int numPredDir = slice->isInterP() ? 1 : slice->isInterB() ? 2 : 0;
- + int numPredDir = (slice->isInterP() || slice->isInterB()) ? 2 : 0;
- for (int l = 0; l < numPredDir; l++)
- {
- for (int ref = 0; ref < slice->m_numRefIdx[l]; ref++)
- diff -r b9948752d551 source/encoder/encoder.cpp
- --- a/source/encoder/encoder.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/encoder/encoder.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -594,7 +594,7 @@
- freeAnalysis(&pic_out->analysisData);
- }
- }
- - if (slice->m_sliceType == P_SLICE)
- + /* if (slice->m_sliceType == P_SLICE)
- {
- if (slice->m_weightPredTable[0][0][0].bPresentFlag)
- m_numLumaWPFrames++;
- @@ -602,7 +602,8 @@
- slice->m_weightPredTable[0][0][2].bPresentFlag)
- m_numChromaWPFrames++;
- }
- - else if (slice->m_sliceType == B_SLICE)
- + else */
- + if (slice->m_sliceType == P_SLICE || slice->m_sliceType == B_SLICE)
- {
- bool bLuma = false, bChroma = false;
- for (int l = 0; l < 2; l++)
- @@ -1308,7 +1308,7 @@
- if (!slice->isIntra())
- {
- - int numLists = slice->isInterP() ? 1 : 2;
- + int numLists = 2; //slice->isInterP() ? 1 : 2;
- for (int list = 0; list < numLists; list++)
- {
- p += sprintf(buf + p, " [L%d ", list);
- @@ -1364,7 +1364,7 @@
- fputs(", -, -", m_csvfpt);
- else
- {
- - int numLists = slice->isInterP() ? 1 : 2;
- + int numLists = 2; //slice->isInterP() ? 1 : 2;
- for (int list = 0; list < numLists; list++)
- {
- fprintf(m_csvfpt, ", ");
- @@ -1887,15 +1887,6 @@
- analysis->sliceType = X265_TYPE_I;
- consumedBytes += frameRecordSize;
- }
- - else if (analysis->sliceType == X265_TYPE_P)
- - {
- - X265_FREAD(((analysis_inter_data *)analysis->interData)->ref, sizeof(int32_t), analysis->numCUsInFrame * X265_MAX_PRED_MODE_PER_CTU, m_analysisFile);
- - X265_FREAD(((analysis_inter_data *)analysis->interData)->depth, sizeof(uint8_t), analysis->numCUsInFrame * analysis->numPartitions, m_analysisFile);
- - X265_FREAD(((analysis_inter_data *)analysis->interData)->modes, sizeof(uint8_t), analysis->numCUsInFrame * analysis->numPartitions, m_analysisFile);
- - X265_FREAD(((analysis_inter_data *)analysis->interData)->bestMergeCand, sizeof(uint32_t), analysis->numCUsInFrame * CUGeom::MAX_GEOMS, m_analysisFile);
- - consumedBytes += frameRecordSize;
- - totalConsumedBytes = consumedBytes;
- - }
- else
- {
- X265_FREAD(((analysis_inter_data *)analysis->interData)->ref, sizeof(int32_t), analysis->numCUsInFrame * X265_MAX_PRED_MODE_PER_CTU * 2, m_analysisFile);
- @@ -1924,12 +1915,6 @@
- sizeof(analysis->numCUsInFrame) + sizeof(analysis->numPartitions);
- if (analysis->sliceType == X265_TYPE_IDR || analysis->sliceType == X265_TYPE_I)
- analysis->frameRecordSize += sizeof(uint8_t) * analysis->numCUsInFrame * analysis->numPartitions * 4;
- - else if (analysis->sliceType == X265_TYPE_P)
- - {
- - analysis->frameRecordSize += sizeof(int32_t) * analysis->numCUsInFrame * X265_MAX_PRED_MODE_PER_CTU;
- - analysis->frameRecordSize += sizeof(uint8_t) * analysis->numCUsInFrame * analysis->numPartitions * 2;
- - analysis->frameRecordSize += sizeof(uint32_t) * analysis->numCUsInFrame * CUGeom::MAX_GEOMS;
- - }
- else
- {
- analysis->frameRecordSize += sizeof(int32_t) * analysis->numCUsInFrame * X265_MAX_PRED_MODE_PER_CTU * 2;
- @@ -1950,13 +1935,6 @@
- X265_FWRITE(((analysis_intra_data*)analysis->intraData)->partSizes, sizeof(char), analysis->numCUsInFrame * analysis->numPartitions, m_analysisFile);
- X265_FWRITE(((analysis_intra_data*)analysis->intraData)->chromaModes, sizeof(uint8_t), analysis->numCUsInFrame * analysis->numPartitions, m_analysisFile);
- }
- - else if (analysis->sliceType == X265_TYPE_P)
- - {
- - X265_FWRITE(((analysis_inter_data*)analysis->interData)->ref, sizeof(int32_t), analysis->numCUsInFrame * X265_MAX_PRED_MODE_PER_CTU, m_analysisFile);
- - X265_FWRITE(((analysis_inter_data*)analysis->interData)->depth, sizeof(uint8_t), analysis->numCUsInFrame * analysis->numPartitions, m_analysisFile);
- - X265_FWRITE(((analysis_inter_data*)analysis->interData)->modes, sizeof(uint8_t), analysis->numCUsInFrame * analysis->numPartitions, m_analysisFile);
- - X265_FWRITE(((analysis_inter_data*)analysis->interData)->bestMergeCand, sizeof(uint32_t), analysis->numCUsInFrame * CUGeom::MAX_GEOMS, m_analysisFile);
- - }
- else
- {
- X265_FWRITE(((analysis_inter_data*)analysis->interData)->ref, sizeof(int32_t), analysis->numCUsInFrame * X265_MAX_PRED_MODE_PER_CTU * 2, m_analysisFile);
- diff -r b9948752d551 source/encoder/entropy.cpp
- --- a/source/encoder/entropy.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/encoder/entropy.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -380,7 +380,7 @@
- picType = 0;
- break;
- case P_SLICE:
- - picType = 1;
- + picType = 2;
- break;
- case B_SLICE:
- picType = 2;
- @@ -439,12 +439,12 @@
- if (!slice.isIntra())
- {
- - bool overrideFlag = (slice.m_numRefIdx[0] != 1 || (slice.isInterB() && slice.m_numRefIdx[1] != 1));
- + bool overrideFlag = (slice.m_numRefIdx[0] != 1 || ((slice.isInterP() || slice.isInterB()) && slice.m_numRefIdx[1] != 1));
- WRITE_FLAG(overrideFlag, "num_ref_idx_active_override_flag");
- if (overrideFlag)
- {
- WRITE_UVLC(slice.m_numRefIdx[0] - 1, "num_ref_idx_l0_active_minus1");
- - if (slice.isInterB())
- + if ((slice.isInterP() || slice.isInterB()))
- WRITE_UVLC(slice.m_numRefIdx[1] - 1, "num_ref_idx_l1_active_minus1");
- else
- {
- @@ -457,12 +457,12 @@
- X265_CHECK(!slice.m_numRefIdx[0] && !slice.m_numRefIdx[1], "expected no references for I slice\n");
- }
- - if (slice.isInterB())
- + if ((slice.isInterP() || slice.isInterB()))
- WRITE_FLAG(0, "mvd_l1_zero_flag");
- if (slice.m_sps->bTemporalMVPEnabled)
- {
- - if (slice.m_sliceType == B_SLICE)
- + if (slice.m_sliceType == P_SLICE || slice.m_sliceType == B_SLICE)
- WRITE_FLAG(slice.m_colFromL0Flag, "collocated_from_l0_flag");
- if (slice.m_sliceType != I_SLICE &&
- @@ -871,7 +871,7 @@
- codeMergeIndex(cu, subPartIdx);
- else
- {
- - if (cu.m_slice->isInterB())
- + if (cu.m_slice->isInterP() || cu.m_slice->isInterB())
- codeInterDir(cu, subPartIdx);
- uint32_t interDir = cu.m_interDir[subPartIdx];
- @@ -1014,7 +1014,7 @@
- const WeightParam *wp;
- bool bChroma = true; // 4:0:0 not yet supported
- bool bDenomCoded = false;
- - int numRefDirs = slice.m_sliceType == B_SLICE ? 2 : 1;
- + int numRefDirs = (slice.m_sliceType == P_SLICE || slice.m_sliceType == B_SLICE) ? 2 : 1;
- uint32_t totalSignalledWeightFlags = 0;
- if ((slice.m_sliceType == P_SLICE && slice.m_pps->bUseWeightPred) ||
- diff -r b9948752d551 source/encoder/frameencoder.cpp
- --- a/source/encoder/frameencoder.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/encoder/frameencoder.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -337,7 +338,7 @@
- slice->disableWeights();
- // Generate motion references
- - int numPredDir = slice->isInterP() ? 1 : slice->isInterB() ? 2 : 0;
- + int numPredDir = (slice->isInterP() || slice->isInterB()) ? 2 : 0;
- for (int l = 0; l < numPredDir; l++)
- {
- for (int ref = 0; ref < slice->m_numRefIdx[l]; ref++)
- @@ -690,7 +694,7 @@
- bool bUseWeightP = slice->m_pps->bUseWeightPred && slice->m_sliceType == P_SLICE;
- bool bUseWeightB = slice->m_pps->bUseWeightedBiPred && slice->m_sliceType == B_SLICE;
- - int numPredDir = slice->isInterP() ? 1 : slice->isInterB() ? 2 : 0;
- + int numPredDir = (slice->isInterP() || slice->isInterB()) ? 2 : 0;
- m_rows[0].active = true;
- if (m_param->bEnableWavefront)
- diff -r b9948752d551 source/encoder/search.cpp
- --- a/source/encoder/search.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/encoder/search.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -1998,7 +1998,7 @@
- const Slice *slice = m_slice;
- int numPart = cu.getNumPartInter();
- - int numPredDir = slice->isInterP() ? 1 : 2;
- + int numPredDir = 2; //slice->isInterP() ? 1 : 2;
- const int* numRefIdx = slice->m_numRefIdx;
- uint32_t lastMode = 0;
- int totalmebits = 0;
- @@ -2044,7 +2044,7 @@
- bestME[0].cost = MAX_UINT;
- bestME[1].cost = MAX_UINT;
- - getBlkBits((PartSize)cu.m_partSize[0], slice->isInterP(), puIdx, lastMode, m_listSelBits);
- + getBlkBits((PartSize)cu.m_partSize[0], (!slice->isInterP() && !slice->isInterB()), puIdx, lastMode, m_listSelBits);
- bool bDoUnidir = true;
- cu.getNeighbourMV(puIdx, pu.puAbsPartIdx, interMode.interNeighbours);
- @@ -2200,7 +2200,7 @@
- uint32_t bidirCost = MAX_UINT;
- int bidirBits = 0;
- - if (slice->isInterB() && !cu.isBipredRestriction() && /* biprediction is possible for this PU */
- + if ((slice->isInterP() || slice->isInterB()) && !cu.isBipredRestriction() && /* biprediction is possible for this PU */
- cu.m_partSize[pu.puAbsPartIdx] != SIZE_2Nx2N && /* 2Nx2N biprediction is handled elsewhere */
- bestME[0].cost != MAX_UINT && bestME[1].cost != MAX_UINT)
- {
- diff -r b9948752d551 source/encoder/slicetype.cpp
- --- a/source/encoder/slicetype.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/encoder/slicetype.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -770,9 +770,11 @@
- break;
- case P_SLICE:
- - b = p1 = poc - l0poc;
- + b = poc - l0poc;
- + p1 = b + poc - l1poc;
- frames[p0] = &slice->m_refPicList[0][0]->m_lowres;
- frames[b] = &curFrame->m_lowres;
- + frames[p1] = &slice->m_refPicList[1][0]->m_lowres;
- break;
- case B_SLICE:
- diff -r b9948752d551 source/encoder/weightPrediction.cpp
- --- a/source/encoder/weightPrediction.cpp Mon Mar 16 20:40:12 2015 -0500
- +++ b/source/encoder/weightPrediction.cpp Mon Mar 16 23:38:49 2015 -0700
- @@ -228,7 +228,7 @@
- memset(&cache, 0, sizeof(cache));
- cache.intraCost = fenc.intraCost;
- - cache.numPredDir = slice.isInterP() ? 1 : 2;
- + cache.numPredDir = 2; //slice.isInterP() ? 1 : 2;
- cache.lowresWidthInCU = fenc.width >> 3;
- cache.lowresHeightInCU = fenc.lines >> 3;
- cache.csp = fencPic->m_picCsp;
- @@ -507,7 +512,7 @@
- bool bWeighted = false;
- p = sprintf(buf, "poc: %d weights:", slice.m_poc);
- - int numPredDir = slice.isInterP() ? 1 : 2;
- + int numPredDir = 2; //slice.isInterP() ? 1 : 2;
- for (int list = 0; list < numPredDir; list++)
- {
- WeightParam* w = &wp[list][0][0];
Advertisement
Add Comment
Please, Sign In to add comment