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
72#define JUMPPACKETSIZE_JUDGE(len,mb_idx,max_byte) ( (len) > JUMPPACKETSIZE_CONSTRAINT(max_byte) ) //( (mb_idx+1)%40/*16slice for compare*/ == 0 ) //72#define JUMPPACKETSIZE_JUDGE(len,mb_idx,max_byte) ( (len) > JUMPPACKETSIZE_CONSTRAINT(max_byte) ) //( (mb_idx+1)%40/*16slice for compare*/ == 0 ) //
73//cur_mb_idx is for early tests, can be omit in optimization73//cur_mb_idx is for early tests, can be omit in optimization
74 74
75typedef struct TagSlice SSlice;75typedef struct TagSlice SSlice;
76typedef struct TagDqLayer SDqLayer;
76typedef struct TagWelsEncCtx sWelsEncCtx;77typedef struct TagWelsEncCtx sWelsEncCtx;
77/*!78/*!
78 * \brief SSlice context79 * \brief SSlice context
@@ -110,7 +111,7 @@ uint8_t uiLastMbQp; · 31 unmodified lines
110/*!111/*!
111 * \brief Initialize Wels SSlice context (Single/multiple slices and FMO)112 * \brief Initialize Wels SSlice context (Single/multiple slices and FMO)
112 *113 *
113 * \param pSliceCtx SSlice context to be initialized114 * \param pCurDq current layer which its SSlice context will be initialized
114 * \param bFmoUseFlag flag of using fmo115 * \param bFmoUseFlag flag of using fmo
115 * \param iMbWidth MB width116 * \param iMbWidth MB width
116 * \param iMbHeight MB height117 * \param iMbHeight MB height
@@ -120,7 +121,7 @@ uint8_t uiLastMbQp; · 3 unmodified lines
120 *121 *
121 * \return 0 - successful; none 0 - failed;122 * \return 0 - successful; none 0 - failed;
122 */123 */
123int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx,124int32_t InitSlicePEncCtx (SDqLayer* pCurDq,
124 CMemoryAlign* pMa,125 CMemoryAlign* pMa,
125 bool bFmoUseFlag,126 bool bFmoUseFlag,
126 int32_t iMbWidth,127 int32_t iMbWidth,
@@ -132,11 +133,11 @@ int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx, · 5 unmodified lines
132/*!133/*!
133 * \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)134 * \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)
134 *135 *
135 * \param pSliceCtx SSlice context to be initialized136 * \param pCurDq curent layer which its SSlice context will be initialized
136 *137 *
137 * \return NONE;138 * \return NONE;
138 */139 */
139void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa);140void UninitSlicePEncCtx (SDqLayer* pCurDq, CMemoryAlign* pMa);
140 141
141/*!142/*!
142 * \brief Get slice idc for given iMbXY (apply in Single/multiple slices and FMO)143 * \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
1361 1361
1362 // Not using FMO in SVC coding so far, come back if need FMO1362 // Not using FMO in SVC coding so far, come back if need FMO
1363 {1363 {
1364 iResult = InitSlicePEncCtx (&(*ppCtx)->ppDqLayerList[iDlayerIndex]->sSliceEncCtx,1364 iResult = InitSlicePEncCtx ((*ppCtx)->ppDqLayerList[iDlayerIndex],
1365 (*ppCtx)->pMemAlign,1365 (*ppCtx)->pMemAlign,
1366 false,1366 false,
1367 pSps->iMbWidth,1367 pSps->iMbWidth,
@@ -2120,9 +2120,8 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 752 unmodified lines
2120 pDq->pFeatureSearchPreparation = NULL;2120 pDq->pFeatureSearchPreparation = NULL;
2121 }2121 }
2122 2122
2123 SSliceCtx* pSliceCtx = &pDq->sSliceEncCtx;2123 if (NULL != pDq) {
2124 if (NULL != pSliceCtx) {2124 UninitSlicePEncCtx (pDq, pMa);
2125 UninitSlicePEncCtx (pSliceCtx, pMa);
2126 }2125 }
2127 2126
2128 pMa->WelsFree (pDq, "pDq");2127 pMa->WelsFree (pDq, "pDq");
codec/encoder/core/src/svc_enc_slice_segment.cpp+17−14
@@ -39,6 +39,7 @@ · 38 unmodified lines
39 */39 */
40#include <string.h>40#include <string.h>
41#include "rc.h"41#include "rc.h"
42#include "svc_enc_frame.h"
42 43
43namespace WelsEnc {44namespace WelsEnc {
44/*!45/*!
@@ -343,7 +344,7 @@ int32_t GetInitialSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, S · 298 unmodified lines
343/*!344/*!
344 * \brief Initialize slice segment (Single/multiple slices)345 * \brief Initialize slice segment (Single/multiple slices)
345 *346 *
346 * \param pSliceSeg SSlice segment to be initialized347 * \param pCurDq current layer which its SSlice segment will be initialized
347 * \param uiSliceMode SSlice mode348 * \param uiSliceMode SSlice mode
348 * \param multi_slice_argv Multiple slices argument349 * \param multi_slice_argv Multiple slices argument
349 * \param iMbWidth MB width350 * \param iMbWidth MB width
@@ -351,13 +352,14 @@ int32_t GetInitialSliceNum (const int32_t kiMbWidth, const int32_t kiMbHeight, S · 1 unmodified line
351 *352 *
352 * \return 0 - successful; none 0 - failed;353 * \return 0 - successful; none 0 - failed;
353 */354 */
354int32_t InitSliceSegment (SSliceCtx* pSliceSeg,355int32_t InitSliceSegment (SDqLayer* pCurDq,
355 CMemoryAlign* pMa,356 CMemoryAlign* pMa,
356 SSliceArgument* pSliceArgument,357 SSliceArgument* pSliceArgument,
357 const int32_t kiMbWidth,358 const int32_t kiMbWidth,
358 const int32_t kiMbHeight) {359 const int32_t kiMbHeight) {
359 const int32_t kiCountMbNum = kiMbWidth * kiMbHeight;360 SSliceCtx* pSliceSeg = &pCurDq->sSliceEncCtx;
360 SliceModeEnum uiSliceMode = SM_SINGLE_SLICE;361 const int32_t kiCountMbNum = kiMbWidth * kiMbHeight;
362 SliceModeEnum uiSliceMode = SM_SINGLE_SLICE;
361 363
362 if (NULL == pSliceSeg || NULL == pSliceArgument || kiMbWidth == 0 || kiMbHeight == 0)364 if (NULL == pSliceSeg || NULL == pSliceArgument || kiMbWidth == 0 || kiMbHeight == 0)
363 return 1;365 return 1;
@@ -475,11 +477,12 @@ int32_t InitSliceSegment (SSliceCtx* pSliceSeg, · 111 unmodified lines
475/*!477/*!
476 * \brief Uninitialize slice segment (Single/multiple slices)478 * \brief Uninitialize slice segment (Single/multiple slices)
477 *479 *
478 * \param pSliceSeg SSlice segment to be uninitialized480 * \param pCurDq current layer which its SSlice segment will be uninitialized
479 *481 *
480 * \return none;482 * \return none;
481 */483 */
482void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) {484void UninitSliceSegment (SDqLayer* pCurDq, CMemoryAlign* pMa) {
485 SSliceCtx* pSliceSeg = &pCurDq->sSliceEncCtx;
483 if (NULL != pSliceSeg) {486 if (NULL != pSliceSeg) {
484 if (NULL != pSliceSeg->pOverallMbMap) {487 if (NULL != pSliceSeg->pOverallMbMap) {
485 pMa->WelsFree (pSliceSeg->pOverallMbMap, "pSliceSeg->pOverallMbMap");488 pMa->WelsFree (pSliceSeg->pOverallMbMap, "pSliceSeg->pOverallMbMap");
@@ -514,7 +517,7 @@ void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) { · 28 unmodified lines
514/*!517/*!
515 * \brief Initialize Wels SSlice context (Single/multiple slices and FMO)518 * \brief Initialize Wels SSlice context (Single/multiple slices and FMO)
516 *519 *
517 * \param pSliceCtx SSlice context to be initialized520 * \param pCurDq current layer which its SSlice context will be initialized
518 * \param bFmoUseFlag flag of using fmo521 * \param bFmoUseFlag flag of using fmo
519 * \param iMbWidth MB width522 * \param iMbWidth MB width
520 * \param iMbHeight MB height523 * \param iMbHeight MB height
@@ -524,17 +527,17 @@ void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) { · 3 unmodified lines
524 *527 *
525 * \return 0 - successful; none 0 - failed;528 * \return 0 - successful; none 0 - failed;
526 */529 */
527int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx,530int32_t InitSlicePEncCtx (SDqLayer* pCurDq,
528 CMemoryAlign* pMa,531 CMemoryAlign* pMa,
529 bool bFmoUseFlag,532 bool bFmoUseFlag,
530 int32_t iMbWidth,533 int32_t iMbWidth,
531 int32_t iMbHeight,534 int32_t iMbHeight,
532 SSliceArgument* pSliceArgument,535 SSliceArgument* pSliceArgument,
533 void* pPpsArg) {536 void* pPpsArg) {
534 if (NULL == pSliceCtx)537 if (NULL == pCurDq)
535 return 1;538 return 1;
536 539
537 InitSliceSegment (pSliceCtx,540 InitSliceSegment (pCurDq,
538 pMa,541 pMa,
539 pSliceArgument,542 pSliceArgument,
540 iMbWidth,543 iMbWidth,
@@ -545,13 +548,13 @@ int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx, · 4 unmodified lines
545/*!548/*!
546 * \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)549 * \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO)
547 *550 *
548 * \param pSliceCtx SSlice context to be initialized551 * \param pCurDq current layer which its SSlice context will be initialized
549 *552 *
550 * \return NONE;553 * \return NONE;
551 */554 */
552void UninitSlicePEncCtx (SSliceCtx* pSliceCtx, CMemoryAlign* pMa) {555void UninitSlicePEncCtx (SDqLayer* pCurDq, CMemoryAlign* pMa) {
553 if (NULL != pSliceCtx) {556 if (NULL != pCurDq) {
554 UninitSliceSegment (pSliceCtx, pMa);557 UninitSliceSegment (pCurDq, pMa);
555 }558 }
556}559}
557 560

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