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
51#include "expand_pic.h"51#include "expand_pic.h"
52#include "decode_slice.h"52#include "decode_slice.h"
53#include "mem_align.h"53#include "mem_align.h"
54#include "ls_defines.h"
54 55
55namespace WelsDec {56namespace WelsDec {
56 57
@@ -58,21 +59,9 @@ extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth · 1 unmodified line
58 59
59extern void_t FreePicture (PPicture pPic);60extern void_t FreePicture (PPicture pPic);
60 61
61#ifdef WORDS_BIGENDIAN
62inline void_t GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {62inline void_t GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {
63 pDstNal[0] = (iDdstIdx & 0xff000000) >> 24;63 ST32(pDstNal, iDdstIdx);
64 pDstNal[1] = (iDdstIdx & 0xff0000) >> 16;
65 pDstNal[2] = (iDdstIdx & 0xff00) >> 8;
66 pDstNal[3] = (iDdstIdx & 0xff);
67}64}
68#else //WORDS_BIGENDIAN
69inline 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
76 65
77static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize,66static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize,
78 const int32_t kiPicWidth, const int32_t kiPicHeight) {67 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