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
4242 #include "codec_def.h"
4343 #include "memory_align.h"
4444
45−namespace WelsDec {
46−
4745 void FreePicture (PPicture pPic, CMemoryAlign* pMa);
4846
4947
@@ -60,14 +58,14 @@ void FreePicture (PPicture pPic, CMemoryAlign* pMa); · 10 unmodified lines
6058
6159
6260 PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const int32_t kiPicHeight) {
63− PPicture pPic = NULL;
64− int32_t iPicWidth = 0;
65− int32_t iPicHeight = 0;
66−
67− int32_t iPicChromaWidth = 0;
68− int32_t iPicChromaHeight = 0;
69− int32_t iLumaSize = 0;
70− int32_t iChromaSize = 0;
61+ PPicture pPic;
62+ int32_t iPicWidth;
63+ int32_t iPicHeight;
64+
65+ int32_t iPicChromaWidth;
66+ int32_t iPicChromaHeight;
67+ int32_t iLumaSize;
68+ int32_t iChromaSize;
7169 CMemoryAlign* pMa = pCtx->pMemAlign;
7270
7371 pPic = (PPicture) pMa->WelsMallocz (sizeof (SPicture), "PPicture");
@@ -89,7 +87,7 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const · 15 unmodified lines
8987 pPic->iLinesize[0] = iPicWidth;
9088 pPic->iLinesize[1] = pPic->iLinesize[2] = iPicChromaWidth;
9189 } else {
92− pPic->pBuffer[0] = static_cast<uint8_t*> (pMa->WelsMallocz (iLumaSize /* luma */
90+ pPic->pBuffer[0] = (uint8_t*) (pMa->WelsMallocz (iLumaSize /* luma */
9391 + (iChromaSize << 1) /* Cb,Cr */, "_pic->buffer[0]"));
9492 WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->pBuffer[0], FreePicture (pPic, pMa));
9593
@@ -177,11 +175,10 @@ void FreePicture (PPicture pPic, CMemoryAlign* pMa) { · 81 unmodified lines
177175 pPic->pReadyEvent = NULL;
178176 }
179177 pMa->WelsFree (pPic, "pPic");
180− pPic = NULL;
181178 }
182179 }
183180 PPicture PrefetchPic (PPicBuff pPicBuf) {
184− int32_t iPicIdx = 0;
181+ int32_t iPicIdx;
185182 PPicture pPic = NULL;
186183
187184 if (pPicBuf->iCapacity == 0) {
@@ -216,7 +213,7 @@ PPicture PrefetchPic (PPicBuff pPicBuf) { · 28 unmodified lines
216213 }
217214
218215 PPicture PrefetchPicForThread (PPicBuff pPicBuf) {
219− PPicture pPic = NULL;
216+ PPicture pPic;
220217
221218 if (pPicBuf->iCapacity == 0) {
222219 return NULL;
@@ -229,7 +226,7 @@ PPicture PrefetchPicForThread (PPicBuff pPicBuf) { · 6 unmodified lines
229226 return pPic;
230227 }
231228
232−PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t& iLastPicBuffIdx) {
229+PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t iLastPicBuffIdx) {
233230 PPicture pPic = NULL;
234231
235232 if (pPicBuf->iCapacity == 0) {
@@ -240,5 +237,3 @@ PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t& iLastPicBuff · 4 unmodified lines
240237 }
241238 return pPic;
242239 }
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