| @@ -39,6 +39,7 @@ · 38 unmodified lines |
| 39 | 39 | */ |
| 40 | 40 | #include <string.h> |
| 41 | 41 | #include "rc.h" |
| 42 | +#include "svc_enc_frame.h" |
| 42 | 43 | |
| 43 | 44 | namespace 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 | 345 | * \brief Initialize slice segment (Single/multiple slices) |
| 345 | 346 | * |
| 346 | | − * \param pSliceSeg SSlice segment to be initialized |
| 347 | + * \param pCurDq current layer which its SSlice segment will be initialized |
| 347 | 348 | * \param uiSliceMode SSlice mode |
| 348 | 349 | * \param multi_slice_argv Multiple slices argument |
| 349 | 350 | * \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 | 353 | * \return 0 - successful; none 0 - failed; |
| 353 | 354 | */ |
| 354 | | −int32_t InitSliceSegment (SSliceCtx* pSliceSeg, |
| 355 | +int32_t InitSliceSegment (SDqLayer* pCurDq, |
| 355 | 356 | CMemoryAlign* pMa, |
| 356 | 357 | SSliceArgument* pSliceArgument, |
| 357 | 358 | const int32_t kiMbWidth, |
| 358 | 359 | 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; |
| 361 | 363 | |
| 362 | 364 | if (NULL == pSliceSeg || NULL == pSliceArgument || kiMbWidth == 0 || kiMbHeight == 0) |
| 363 | 365 | return 1; |
| @@ -475,11 +477,12 @@ int32_t InitSliceSegment (SSliceCtx* pSliceSeg, · 111 unmodified lines |
| 475 | 477 | /*! |
| 476 | 478 | * \brief Uninitialize slice segment (Single/multiple slices) |
| 477 | 479 | * |
| 478 | | − * \param pSliceSeg SSlice segment to be uninitialized |
| 480 | + * \param pCurDq current layer which its SSlice segment will be uninitialized |
| 479 | 481 | * |
| 480 | 482 | * \return none; |
| 481 | 483 | */ |
| 482 | | −void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) { |
| 484 | +void UninitSliceSegment (SDqLayer* pCurDq, CMemoryAlign* pMa) { |
| 485 | + SSliceCtx* pSliceSeg = &pCurDq->sSliceEncCtx; |
| 483 | 486 | if (NULL != pSliceSeg) { |
| 484 | 487 | if (NULL != pSliceSeg->pOverallMbMap) { |
| 485 | 488 | pMa->WelsFree (pSliceSeg->pOverallMbMap, "pSliceSeg->pOverallMbMap"); |
| @@ -514,7 +517,7 @@ void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) { · 28 unmodified lines |
| 514 | 517 | /*! |
| 515 | 518 | * \brief Initialize Wels SSlice context (Single/multiple slices and FMO) |
| 516 | 519 | * |
| 517 | | − * \param pSliceCtx SSlice context to be initialized |
| 520 | + * \param pCurDq current layer which its SSlice context will be initialized |
| 518 | 521 | * \param bFmoUseFlag flag of using fmo |
| 519 | 522 | * \param iMbWidth MB width |
| 520 | 523 | * \param iMbHeight MB height |
| @@ -524,17 +527,17 @@ void UninitSliceSegment (SSliceCtx* pSliceSeg, CMemoryAlign* pMa) { · 3 unmodified lines |
| 524 | 527 | * |
| 525 | 528 | * \return 0 - successful; none 0 - failed; |
| 526 | 529 | */ |
| 527 | | −int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx, |
| 530 | +int32_t InitSlicePEncCtx (SDqLayer* pCurDq, |
| 528 | 531 | CMemoryAlign* pMa, |
| 529 | 532 | bool bFmoUseFlag, |
| 530 | 533 | int32_t iMbWidth, |
| 531 | 534 | int32_t iMbHeight, |
| 532 | 535 | SSliceArgument* pSliceArgument, |
| 533 | 536 | void* pPpsArg) { |
| 534 | | − if (NULL == pSliceCtx) |
| 537 | + if (NULL == pCurDq) |
| 535 | 538 | return 1; |
| 536 | 539 | |
| 537 | | − InitSliceSegment (pSliceCtx, |
| 540 | + InitSliceSegment (pCurDq, |
| 538 | 541 | pMa, |
| 539 | 542 | pSliceArgument, |
| 540 | 543 | iMbWidth, |
| @@ -545,13 +548,13 @@ int32_t InitSlicePEncCtx (SSliceCtx* pSliceCtx, · 4 unmodified lines |
| 545 | 548 | /*! |
| 546 | 549 | * \brief Uninitialize Wels SSlice context (Single/multiple slices and FMO) |
| 547 | 550 | * |
| 548 | | − * \param pSliceCtx SSlice context to be initialized |
| 551 | + * \param pCurDq current layer which its SSlice context will be initialized |
| 549 | 552 | * |
| 550 | 553 | * \return NONE; |
| 551 | 554 | */ |
| 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); |
| 555 | 558 | } |
| 556 | 559 | } |
| 557 | 560 | |