ref: 1e744b1933ffe37c15d1ce426f923083124cdd5b
parent: fbcd962169caa01293634de0e351f8c30a39ee7f
parent: 1d2c37f7dee3fd53df95350a061a2165541ab015
author: Ethan Hugg <ethanhugg@gmail.com>
date: Wed Jan 29 10:25:30 EST 2014
Merge pull request #257 from mstorsjo/simplify-endian-func Simplify the implementation of GetValueOf4Bytes
--- a/codec/decoder/core/src/decoder.cpp
+++ b/codec/decoder/core/src/decoder.cpp
@@ -51,6 +51,7 @@
#include "expand_pic.h"
#include "decode_slice.h"
#include "mem_align.h"
+#include "ls_defines.h"
namespace WelsDec {
@@ -58,21 +59,9 @@
extern void_t FreePicture (PPicture pPic);
-#ifdef WORDS_BIGENDIAN
inline void_t GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {
- pDstNal[0] = (iDdstIdx & 0xff000000) >> 24;
- pDstNal[1] = (iDdstIdx & 0xff0000) >> 16;
- pDstNal[2] = (iDdstIdx & 0xff00) >> 8;
- pDstNal[3] = (iDdstIdx & 0xff);
+ ST32(pDstNal, iDdstIdx);
}
-#else //WORDS_BIGENDIAN
-inline void_t GetValueOf4Bytes (uint8_t* pDstNal, int32_t iDdstIdx) {
- pDstNal[0] = (iDdstIdx & 0xff);
- pDstNal[1] = (iDdstIdx & 0xff00) >> 8;
- pDstNal[2] = (iDdstIdx & 0xff0000) >> 16;
- pDstNal[3] = (iDdstIdx & 0xff000000) >> 24;
-}
-#endif //WORDS_BIGENDIAN
static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiSize,
const int32_t kiPicWidth, const int32_t kiPicHeight) {