History

Remove unnecessary writing of nal length in the decoder

The written nal length doesn't seem to be used at all.

Martin Storsjö committed 12 years ago

Commit e9e4d0a1 parent 3d599051 file · +1 −8Browse files

Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 1 file). Show all

Unified · Split

codec/decoder/core/src/decoder.cpp+1−8
@@ -52,7 +52,6 @@ · 51 unmodified lines
52#include "decode_slice.h"52#include "decode_slice.h"
53#include "error_concealment.h"53#include "error_concealment.h"
54#include "mem_align.h"54#include "mem_align.h"
55#include "ls_defines.h"
56 55
57namespace WelsDec {56namespace WelsDec {
58 57
@@ -60,10 +59,6 @@ extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth · 1 unmodified line
60 59
61extern void FreePicture (PPicture pPic);60extern void FreePicture (PPicture pPic);
62 61
63inline void GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {
64 ST32 (pDstNal, iDdstIdx);
65}
66
67static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize,62static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize,
68 const int32_t kiPicWidth, const int32_t kiPicHeight) {63 const int32_t kiPicWidth, const int32_t kiPicHeight) {
69 PPicBuff pPicBuf = NULL;64 PPicBuff pPicBuf = NULL;
@@ -447,7 +442,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 377 unmodified lines
447 442
448 //copy raw data from source buffer (application) to raw data buffer (codec inside)443 //copy raw data from source buffer (application) to raw data buffer (codec inside)
449 //0x03 removal and extract all of NAL Unit from current raw data444 //0x03 removal and extract all of NAL Unit from current raw data
450 pDstNal = pRawData->pCurPos + 4; //4-bytes used to write the length of current NAL rbsp445 pDstNal = pRawData->pCurPos;
451 446
452 while (iSrcConsumed < iSrcLength) {447 while (iSrcConsumed < iSrcLength) {
453 if ((2 + iSrcConsumed < iSrcLength) &&448 if ((2 + iSrcConsumed < iSrcLength) &&
@@ -459,7 +454,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 5 unmodified lines
459 iSrcIdx += 3;454 iSrcIdx += 3;
460 iSrcConsumed += 3;455 iSrcConsumed += 3;
461 } else {456 } else {
462 GetValueOf4Bytes (pDstNal - 4, iDstIdx); //pDstNal-4 (non-aligned by 4) in Solaris10(SPARC). Given value by byte.
463 457
464 iConsumedBytes = 0;458 iConsumedBytes = 0;
465 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);459 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
@@ -515,7 +509,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 49 unmodified lines
515 }509 }
516 510
517 //last NAL decoding511 //last NAL decoding
518 GetValueOf4Bytes (pDstNal - 4, iDstIdx); //pDstNal-4 (non-aligned by 4) in Solaris10(SPARC). Given value by byte.
519 512
520 iConsumedBytes = 0;513 iConsumedBytes = 0;
521 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);514 pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);

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