History

SSliceCtx struture refactoring----change input paramters for Init/UninitSlicePEncCtx()

huade committed 10 years ago

Commit b60bb671 parent 268e6cf3 files · +26 −23Browse files

Unified · Split

3 files
  1. codec/encoder/core/inc/svc_enc_slice_segment.h +6 −5
  2. codec/encoder/core/src/encoder_ext.cpp +3 −4
  3. codec/encoder/core/src/svc_enc_slice_segment.cpp +17 −14
codec/encoder/core/inc/svc_enc_slice_segment.h+6−5
@@ -72,7 +72,8 @@ namespace WelsEnc { · 71 unmodified lines
7272 #define JUMPPACKETSIZE_JUDGE(len,mb_idx,max_byte) ( (len) > JUMPPACKETSIZE_CONSTRAINT(max_byte) ) //( (mb_idx+1)%40/*16slice for compare*/ == 0 ) //
7373 //cur_mb_idx is for early tests, can be omit in optimization
7474
75−typedef struct TagSlice SSlice;
75+typedef struct TagSlice SSlice;
76+typedef struct TagDqLayer SDqLayer;
7677 typedef struct TagWelsEncCtx sWelsEncCtx;
7778 /*!
7879 * \brief SSlice context
@@ -110,7 +111,7 @@ uint8_t uiLastMbQp; · 31 unmodified lines
110111 /*!
111112 * \brief Initialize Wels SSlice context (Single/multiple slices and FMO)
112113 *
113− * \param pSliceCtx SSlice context to be initialized
114+ * \param pCurDq current layer which its SSlice context will be initialized
114115 * \param bFmoUseFlag flag of using fmo
115116 * \param iMbWidth MB width
116117 * \param iMbHeight MB height
@@ -120,7 +121,7 @@ uint8_t uiLastMbQp; · 3 unmodified lines
120121 *
121122 * \return 0 - successful; none 0 - failed;
122123 */
123−int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx,
124+int32_t InitSlicePEncCtx (SDqLayer* pCurDq,
124125 CMemoryAlign* pMa,
125126 bool bFmoUseFlag,
126127 int32_t iMbWidth,
@@ -132,11 +133,11 @@ int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx, · 5 unmodified lines
132133 /*!
133134 * \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)
134135 *
135− * \param pSliceCtx SSlice context to be initialized
136+ * \param pCurDq curent layer which its SSlice context will be initialized
136137 *
137138 * \return NONE;
138139 */
139−void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa);
140+void UninitSlicePEncCtx (SDqLayer* pCurDq, CMemoryAlign* pMa);
140141
141142 /*!
142143 * \brief Get slice idc for given iMbXY (apply in Single/multiple slices and FMO)
codec/encoder/core/src/encoder_ext.cpp+3−4
@@ -1361,7 +1361,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 1360 unmodified lines
13611361
13621362 // Not using FMO in SVC coding so far, come back if need FMO
13631363 {
1364− iResult = InitSlicePEncCtx (&(*ppCtx)->ppDqLayerList[iDlayerIndex]->sSliceEncCtx,
1364+ iResult = InitSlicePEncCtx ((*ppCtx)->ppDqLayerList[iDlayerIndex],
13651365 (*ppCtx)->pMemAlign,
13661366 false,
13671367 pSps->iMbWidth,
@@ -2120,9 +2120,8 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 752 unmodified lines
21202120 pDq->pFeatureSearchPreparation = NULL;
21212121 }
21222122
2123− SSliceCtx* pSliceCtx = &pDq->sSliceEncCtx;
2124− if (NULL != pSliceCtx) {
2125− UninitSlicePEncCtx (pSliceCtx, pMa);
2123+ if (NULL != pDq) {
2124+ UninitSlicePEncCtx (pDq, pMa);
21262125 }
21272126
21282127 pMa->WelsFree (pDq, "pDq");
codec/encoder/core/src/svc_enc_slice_segment.cpp+17−14
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 */
4040 #include <string.h>
4141 #include "rc.h"
42+#include "svc_enc_frame.h"
4243
4344 namespace WelsEnc {
4445 /*!
@@ -343,7 +344,7 @@ int32_t GetInitialSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, S · 298 unmodified lines
343344 /*!
344345 * \brief Initialize slice segment (Single/multiple slices)
345346 *
346− * \param pSliceSeg SSlice segment to be initialized
347+ * \param pCurDq current layer which its SSlice segment will be initialized
347348 * \param uiSliceMode SSlice mode
348349 * \param multi_slice_argv Multiple slices argument
349350 * \param iMbWidth MB width
@@ -351,13 +352,14 @@ int32_t GetInitialSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, S · 1 unmodified line
351352 *
352353 * \return 0 - successful; none 0 - failed;
353354 */
354−int32_t InitSliceSegment (SSliceCtx* pSliceSeg,
355+int32_t InitSliceSegment (SDqLayer* pCurDq,
355356 CMemoryAlign* pMa,
356357 SSliceArgument* pSliceArgument,
357358 const int32_t kiMbWidth,
358359 const int32_t kiMbHeight) {
359− const int32_t kiCountMbNum = kiMbWidth * kiMbHeight;
360− SliceModeEnum uiSliceMode = SM_SINGLE_SLICE;
360+ SSliceCtx* pSliceSeg = &pCurDq->sSliceEncCtx;
361+ const int32_t kiCountMbNum = kiMbWidth * kiMbHeight;
362+ SliceModeEnum uiSliceMode = SM_SINGLE_SLICE;
361363
362364 if (NULL == pSliceSeg || NULL == pSliceArgument || kiMbWidth == 0 || kiMbHeight == 0)
363365 return 1;
@@ -475,11 +477,12 @@ int32_t InitSliceSegment (SSliceCtx* pSliceSeg, · 111 unmodified lines
475477 /*!
476478 * \brief Uninitialize slice segment (Single/multiple slices)
477479 *
478− * \param pSliceSeg SSlice segment to be uninitialized
480+ * \param pCurDq current layer which its SSlice segment will be uninitialized
479481 *
480482 * \return none;
481483 */
482−void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) {
484+void UninitSliceSegment (SDqLayer* pCurDq, CMemoryAlign* pMa) {
485+ SSliceCtx* pSliceSeg = &pCurDq->sSliceEncCtx;
483486 if (NULL != pSliceSeg) {
484487 if (NULL != pSliceSeg->pOverallMbMap) {
485488 pMa->WelsFree (pSliceSeg->pOverallMbMap, "pSliceSeg->pOverallMbMap");
@@ -514,7 +517,7 @@ void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) { · 28 unmodified lines
514517 /*!
515518 * \brief Initialize Wels SSlice context (Single/multiple slices and FMO)
516519 *
517− * \param pSliceCtx SSlice context to be initialized
520+ * \param pCurDq current layer which its SSlice context will be initialized
518521 * \param bFmoUseFlag flag of using fmo
519522 * \param iMbWidth MB width
520523 * \param iMbHeight MB height
@@ -524,17 +527,17 @@ void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) { · 3 unmodified lines
524527 *
525528 * \return 0 - successful; none 0 - failed;
526529 */
527−int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx,
530+int32_t InitSlicePEncCtx (SDqLayer* pCurDq,
528531 CMemoryAlign* pMa,
529532 bool bFmoUseFlag,
530533 int32_t iMbWidth,
531534 int32_t iMbHeight,
532535 SSliceArgument* pSliceArgument,
533536 void* pPpsArg) {
534− if (NULL == pSliceCtx)
537+ if (NULL == pCurDq)
535538 return 1;
536539
537− InitSliceSegment (pSliceCtx,
540+ InitSliceSegment (pCurDq,
538541 pMa,
539542 pSliceArgument,
540543 iMbWidth,
@@ -545,13 +548,13 @@ int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx, · 4 unmodified lines
545548 /*!
546549 * \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)
547550 *
548− * \param pSliceCtx SSlice context to be initialized
551+ * \param pCurDq current layer which its SSlice context will be initialized
549552 *
550553 * \return NONE;
551554 */
552−void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa) {
553− if (NULL != pSliceCtx) {
554− UninitSliceSegment (pSliceCtx, pMa);
555+void UninitSlicePEncCtx (SDqLayer* pCurDq, CMemoryAlign* pMa) {
556+ if (NULL != pCurDq) {
557+ UninitSliceSegment (pCurDq, pMa);
555558 }
556559 }
557560

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t