Skip to content

Commit de02617

Browse files
authored
Remove unused pSpatialLayer variable in DetermineTemporalSettings (#3761)
* Remove unused pSpatialLayer and iSliceIndex variables which break on Mac CI settings due to the variables being unused * one more * moar
1 parent 1c23887 commit de02617

File tree

5 files changed

+2
-28
lines changed

5 files changed

+2
-28
lines changed

codec/console/dec/src/h264dec.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
231231
unsigned long long uiTimeStamp = 0;
232232
int64_t iStart = 0, iEnd = 0, iTotal = 0;
233233
int32_t iSliceSize;
234-
int32_t iSliceIndex = 0;
235234
uint8_t* pBuf = NULL;
236235
uint8_t uiStartCode[4] = {0, 0, 0, 1};
237236

@@ -449,7 +448,6 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
449448
}
450449
}
451450
iBufPos += iSliceSize;
452-
++ iSliceIndex;
453451
}
454452
FlushFrames (pDecoder, iTotal, pYuvFile, pOptionFile, iFrameCount, uiTimeStamp, iWidth, iHeight, iLastWidth,
455453
iLastHeight);

codec/encoder/core/inc/param_svc.h

-2
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,6 @@ typedef struct TagWelsSvcCodingParam: SEncParamExt {
493493
const int32_t iDecStages = WELS_LOG2 (uiGopSize); // (int8_t)GetLogFactor(1.0f, 1.0f * pcfg->uiGopSize); //log2(uiGopSize)
494494
const uint8_t* pTemporalIdList = &g_kuiTemporalIdListTable[iDecStages][0];
495495
SSpatialLayerInternal* pDlp = &sDependencyLayers[0];
496-
SSpatialLayerConfig* pSpatialLayer = &sSpatialLayers[0];
497496
int8_t i = 0;
498497

499498
while (i < iSpatialLayerNum) {
@@ -524,7 +523,6 @@ typedef struct TagWelsSvcCodingParam: SEncParamExt {
524523
return ENC_RETURN_INVALIDINPUT;
525524
}
526525
++ pDlp;
527-
++ pSpatialLayer;
528526
++ i;
529527
}
530528
iDecompStages = (int8_t)iDecStages;

meson.build

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ cpu_family = host_machine.cpu_family()
4242
supported_arguments = cpp.get_supported_arguments([
4343
'-Wno-non-virtual-dtor',
4444
'-Wno-class-memaccess',
45+
'-Werror',
46+
'-Wunused-but-set-variable',
4547
'-Wno-strict-aliasing'])
4648

4749
add_project_arguments(supported_arguments, language: 'cpp')

test/api/decoder_ec_test.cpp

-22
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) {
248248
EXPECT_EQ (uiGet, uiEcIdc);
249249

250250
//Start for enc/dec
251-
int iIdx = 0;
252251
int len = 0;
253252
unsigned char* pData[3] = { NULL };
254253
ASSERT_TRUE (InitialEncDec (p.width, p.height));
@@ -265,11 +264,9 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) {
265264
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
266265
EXPECT_EQ (rv, 0);
267266
EXPECT_EQ (dstBufInfo_.iBufferStatus, 1);
268-
iIdx++;
269267

270268
//Frame 1: P, EC_IDC=DISABLE, loss = 1
271269
EncodeOneFrame (1);
272-
iIdx++;
273270

274271
//Frame 2: P, EC_IDC=DISABLE, loss = 0
275272
EncodeOneFrame (1);
@@ -284,7 +281,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) {
284281
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
285282
EXPECT_TRUE (rv != 0); //construction error due to data loss
286283
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //no output due to EC DISABLE
287-
iIdx++;
288284

289285
//set EC=SLICE_COPY
290286
uiEcIdc = (uint32_t) (ERROR_CON_SLICE_COPY);
@@ -304,7 +300,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) {
304300
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
305301
EXPECT_TRUE (rv != 0); //construction error due to data loss
306302
EXPECT_EQ (dstBufInfo_.iBufferStatus, 1);
307-
iIdx++;
308303

309304
//set EC=DISABLE
310305
uiEcIdc = (uint32_t) (ERROR_CON_DISABLE);
@@ -325,11 +320,9 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) {
325320
//Ref picture is ECed, so current status is ECed, when EC disable, NO output
326321
EXPECT_TRUE (rv != 0);
327322
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
328-
iIdx++;
329323

330324
//Frame 5: P, EC_IDC=DISABLE, loss = 1
331325
EncodeOneFrame (1);
332-
iIdx++;
333326

334327
//set EC=FRAME_COPY
335328
uiEcIdc = (uint32_t) (ERROR_CON_FRAME_COPY);
@@ -339,7 +332,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) {
339332
//Frame 6: P, EC_IDC=FRAME_COPY, loss = 1
340333
EncodeOneFrame (1);
341334
EXPECT_EQ (uiGet, uiEcIdc);
342-
iIdx++;
343335

344336
//Frame 7: P, EC_IDC=FRAME_COPY, loss = 0
345337
EncodeOneFrame (1);
@@ -354,7 +346,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificFrameChange) {
354346
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
355347
EXPECT_TRUE (rv != 0); //not sure if previous data drop would be detected in construction
356348
EXPECT_EQ (dstBufInfo_.iBufferStatus, 1);
357-
iIdx++;
358349
}
359350

360351
//This case contain 2 slices per picture for IDR loss
@@ -380,7 +371,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) {
380371
decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
381372

382373
//Start for enc/dec
383-
int iIdx = 0;
384374
int len = 0;
385375
unsigned char* pData[3] = { NULL };
386376
int iTotalSliceSize = 0;
@@ -406,7 +396,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) {
406396
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
407397
EXPECT_EQ (rv, 0); // Reconstruct first slice OK
408398
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //slice incomplete, no output
409-
iIdx++;
410399

411400
//Frame 1: P, EC_IDC=2, loss = 0
412401
//will clean SPS/PPS status
@@ -422,7 +411,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) {
422411
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //ECed status, reconstruction current frame 1
423412
EXPECT_TRUE ((rv & 32) != 0); //decoder ECed status
424413
EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //ECed output for frame 1
425-
iIdx++;
426414

427415
//set EC=DISABLE
428416
uiEcIdc = (uint32_t) (ERROR_CON_DISABLE);
@@ -443,7 +431,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) {
443431
// Ref picture is ECed, so reconstructed picture is ECed
444432
EXPECT_TRUE ((rv & 32) != 0);
445433
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
446-
iIdx++;
447434

448435
//set EC=SLICE_COPY
449436
uiEcIdc = (uint32_t) (ERROR_CON_FRAME_COPY);
@@ -464,7 +451,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) {
464451
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
465452
EXPECT_TRUE ((rv & 32) != 0);
466453
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //slice loss
467-
iIdx++;
468454

469455
//set EC=DISABLE
470456
uiEcIdc = (uint32_t) (ERROR_CON_DISABLE);
@@ -484,7 +470,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRLoss) {
484470
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
485471
EXPECT_TRUE (rv != 0);
486472
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); // No ref picture, no output
487-
iIdx++;
488473

489474
}
490475

@@ -512,7 +497,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) {
512497
decoder_->SetOption (DECODER_OPTION_TRACE_LEVEL, &iTraceLevel);
513498

514499
//Start for enc/dec
515-
int iIdx = 0;
516500
int len = 0;
517501
unsigned char* pData[3] = { NULL };
518502
int iTotalSliceSize = 0;
@@ -537,7 +521,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) {
537521
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
538522
EXPECT_EQ (rv, 0); //parse correct
539523
EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //output frame 0
540-
iIdx++;
541524

542525
//Frame 1: P, EC_IDC=0, loss = 0
543526
//Expected result: all OK, 2nd Output
@@ -553,7 +536,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) {
553536
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction current frame 1
554537
EXPECT_EQ (rv, 0); //parse correct
555538
EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //ECed output for frame 1
556-
iIdx++;
557539

558540
//Frame 2: P, EC_IDC=0, loss = 1
559541
//Expected result: all OK, no Output
@@ -570,7 +552,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) {
570552
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
571553
EXPECT_EQ (rv, 0); //parse correct
572554
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0);
573-
iIdx++;
574555

575556
//set EC=SLICE_COPY
576557
uiEcIdc = (uint32_t) (ERROR_CON_SLICE_COPY);
@@ -591,7 +572,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) {
591572
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction
592573
EXPECT_TRUE ((rv & 32) != 0);
593574
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //slice loss
594-
iIdx++;
595575

596576
//set EC=DISABLE
597577
uiEcIdc = (uint32_t) (ERROR_CON_DISABLE);
@@ -613,7 +593,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) {
613593
// previous frame NOT output, no ref
614594
EXPECT_TRUE (rv != 0);
615595
EXPECT_EQ (dstBufInfo_.iBufferStatus, 0); //output previous pic
616-
iIdx++;
617596

618597
//Frame 5: IDR, EC_IDC=2->0, loss = 0
619598
//Expected result: depends on DecodeFrame2 result. If OK, output; else ,no output
@@ -654,7 +633,6 @@ TEST_F (EncodeDecodeTestAPI, SetOptionECIDC_SpecificSliceChange_IDRNoLoss) {
654633
rv = decoder_->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); //reconstruction,
655634
EXPECT_EQ (rv, 0);
656635
EXPECT_EQ (dstBufInfo_.iBufferStatus, 1); //output previous pic
657-
iIdx++;
658636

659637
}
660638

test/decoder/DecUT_DecExt.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ void DecoderInterfaceTest::DecoderBs (const char* sFileName) {
140140
int32_t iFileSize;
141141
int32_t i = 0;
142142
int32_t iSliceSize;
143-
int32_t iSliceIndex = 0;
144143
int32_t iEndOfStreamFlag = 0;
145144
FILE* pH264File;
146145
uint8_t uiStartCode[4] = {0, 0, 0, 1};
@@ -174,7 +173,6 @@ void DecoderInterfaceTest::DecoderBs (const char* sFileName) {
174173
m_pDec->DecodeFrame2 (pBuf + iBufPos, iSliceSize, m_pData, &m_sBufferInfo);
175174
m_pDec->DecodeFrame2 (NULL, 0, m_pData, &m_sBufferInfo);
176175
iBufPos += iSliceSize;
177-
++ iSliceIndex;
178176
}
179177

180178
fclose (pH264File);

0 commit comments

Comments
 (0)