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.
Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 1 file). Show all
Unified · Split
| @@ -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 | ||
| 55 | namespace WelsDec { | 56 | namespace WelsDec { |
| 56 | 57 | ||
| @@ -58,21 +59,9 @@ extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth · 1 unmodified line | |||
| 58 | 59 | ||
| 59 | extern void_t FreePicture (PPicture pPic); | 60 | extern void_t FreePicture (PPicture pPic); |
| 60 | 61 | ||
| 61 | #ifdef WORDS_BIGENDIAN | ||
| 62 | inline void_t GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) { | 62 | inline 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 | ||
| 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 | ||
| 76 | 65 | ||
| 77 | static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize, | 66 | static 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) { |