History

Simplify the implementation of GetValueOf4Bytes

What the two different implementations currently do is simply to write a 32 bit number, in the native endianness, into the given buffer. The actual purpose of this function is still unknown though, it can be removed completely without breaking decoding - it is possibly a remnant from earlier functionality in the decoder.

Martin Storsjö committed 12 years ago

Commit 1d2c37f1 parent e413ed21 file · +2 −13Browse 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+2−13
@@ -51,6 +51,7 @@ · 50 unmodified lines
5151 #include "expand_pic.h"
5252 #include "decode_slice.h"
5353 #include "mem_align.h"
54+#include "ls_defines.h"
5455
5556 namespace WelsDec {
5657
@@ -58,21 +59,9 @@ extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth · 1 unmodified line
5859
5960 extern void_t FreePicture (PPicture pPic);
6061
61−#ifdef WORDS_BIGENDIAN
6262 inline void_t GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {
63− pDstNal[0] = (iDdstIdx & 0xff000000) >> 24;
64− pDstNal[1] = (iDdstIdx & 0xff0000) >> 16;
65− pDstNal[2] = (iDdstIdx & 0xff00) >> 8;
66− pDstNal[3] = (iDdstIdx & 0xff);
63+ ST32(pDstNal, iDdstIdx);
6764 }
68−#else //WORDS_BIGENDIAN
69−inline void_t GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {
70− pDstNal[0] = (iDdstIdx & 0xff);
71− pDstNal[1] = (iDdstIdx & 0xff00) >> 8;
72− pDstNal[2] = (iDdstIdx & 0xff0000) >> 16;
73− pDstNal[3] = (iDdstIdx & 0xff000000) >> 24;
74−}
75−#endif //WORDS_BIGENDIAN
7665
7766 static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize,
7867 const int32_t kiPicWidth, const int32_t kiPicHeight) {

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