History

make the decoder compile and run with treason

Sigrid Solveig Haflínudóttir committed 5 years ago

Commit 37423d41 parent be8e62f71 files · +961 −1217Browse files

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

Unified · Split

codec/decoder/core/src/pic_queue.cpp+12−17
@@ -42,8 +42,6 @@ · 41 unmodified lines
42#include "codec_def.h"42#include "codec_def.h"
43#include "memory_align.h"43#include "memory_align.h"
44 44
45namespace WelsDec {
46
47void FreePicture (PPicture pPic, CMemoryAlign* pMa);45void FreePicture (PPicture pPic, CMemoryAlign* pMa);
48 46
49 47
@@ -60,14 +58,14 @@ void FreePicture (PPicture pPic, CMemoryAlign* pMa); · 10 unmodified lines
60 58
61 59
62PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const int32_t kiPicHeight) {60PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const int32_t kiPicHeight) {
63 PPicture pPic = NULL;61 PPicture pPic;
64 int32_t iPicWidth = 0;62 int32_t iPicWidth;
65 int32_t iPicHeight = 0;63 int32_t iPicHeight;
66 64
67 int32_t iPicChromaWidth = 0;65 int32_t iPicChromaWidth;
68 int32_t iPicChromaHeight = 0;66 int32_t iPicChromaHeight;
69 int32_t iLumaSize = 0;67 int32_t iLumaSize;
70 int32_t iChromaSize = 0;68 int32_t iChromaSize;
71 CMemoryAlign* pMa = pCtx->pMemAlign;69 CMemoryAlign* pMa = pCtx->pMemAlign;
72 70
73 pPic = (PPicture) pMa->WelsMallocz (sizeof (SPicture), "PPicture");71 pPic = (PPicture) pMa->WelsMallocz (sizeof (SPicture), "PPicture");
@@ -89,7 +87,7 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const · 15 unmodified lines
89 pPic->iLinesize[0] = iPicWidth;87 pPic->iLinesize[0] = iPicWidth;
90 pPic->iLinesize[1] = pPic->iLinesize[2] = iPicChromaWidth;88 pPic->iLinesize[1] = pPic->iLinesize[2] = iPicChromaWidth;
91 } else {89 } else {
92 pPic->pBuffer[0] = static_cast<uint8_t*> (pMa->WelsMallocz (iLumaSize /* luma */90 pPic->pBuffer[0] = (uint8_t*) (pMa->WelsMallocz (iLumaSize /* luma */
93 + (iChromaSize << 1) /* Cb,Cr */, "_pic->buffer[0]"));91 + (iChromaSize << 1) /* Cb,Cr */, "_pic->buffer[0]"));
94 WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->pBuffer[0], FreePicture (pPic, pMa));92 WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->pBuffer[0], FreePicture (pPic, pMa));
95 93
@@ -177,11 +175,10 @@ void FreePicture (PPicture pPic, CMemoryAlign* pMa) { · 81 unmodified lines
177 pPic->pReadyEvent = NULL;175 pPic->pReadyEvent = NULL;
178 }176 }
179 pMa->WelsFree (pPic, "pPic");177 pMa->WelsFree (pPic, "pPic");
180 pPic = NULL;
181 }178 }
182}179}
183PPicture PrefetchPic (PPicBuff pPicBuf) {180PPicture PrefetchPic (PPicBuff pPicBuf) {
184 int32_t iPicIdx = 0;181 int32_t iPicIdx;
185 PPicture pPic = NULL;182 PPicture pPic = NULL;
186 183
187 if (pPicBuf->iCapacity == 0) {184 if (pPicBuf->iCapacity == 0) {
@@ -216,7 +213,7 @@ PPicture PrefetchPic (PPicBuff pPicBuf) { · 28 unmodified lines
216}213}
217 214
218PPicture PrefetchPicForThread (PPicBuff pPicBuf) {215PPicture PrefetchPicForThread (PPicBuff pPicBuf) {
219 PPicture pPic = NULL;216 PPicture pPic;
220 217
221 if (pPicBuf->iCapacity == 0) {218 if (pPicBuf->iCapacity == 0) {
222 return NULL;219 return NULL;
@@ -229,7 +226,7 @@ PPicture PrefetchPicForThread (PPicBuff pPicBuf) { · 6 unmodified lines
229 return pPic;226 return pPic;
230}227}
231 228
232PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t& iLastPicBuffIdx) {229PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t iLastPicBuffIdx) {
233 PPicture pPic = NULL;230 PPicture pPic = NULL;
234 231
235 if (pPicBuf->iCapacity == 0) {232 if (pPicBuf->iCapacity == 0) {
@@ -240,5 +237,3 @@ PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t& iLastPicBuff · 4 unmodified lines
240 }237 }
241 return pPic;238 return pPic;
242}239}
243
244} // namespace WelsDec

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