History

fix low memory crash issue

huili2 committed 9 years ago

Commit d1c0a931 parent 48c2fe116 files · +401 −386Browse files

Showing the changes to test/api/encode_options_test.cpp (1 of 16 files). Show all

Unified · Split

test/api/encode_options_test.cpp+82−73
@@ -10,13 +10,16 @@ · 9 unmodified lines
10#include "encode_decode_api_test.h"10#include "encode_decode_api_test.h"
11using namespace WelsCommon;11using namespace WelsCommon;
12 12
13void EncodeDecodeTestAPIBase::InitialEncDec (int iWidth, int iHeight) {13bool EncodeDecodeTestAPIBase::InitialEncDec (int iWidth, int iHeight) {
14 // for encoder14 // for encoder
15 // I420: 1(Y) + 1/4(U) + 1/4(V)15 // I420: 1(Y) + 1/4(U) + 1/4(V)
16 int frameSize = iWidth * iHeight * 3 / 2;16 int frameSize = iWidth * iHeight * 3 / 2;
17 17
18 buf_.SetLength (frameSize);18 buf_.SetLength (frameSize);
19 ASSERT_TRUE (buf_.Length() == (size_t)frameSize);19 if (buf_.Length() != (size_t)frameSize) {
20 printf ("buf_.Length() failed! frameSize = %d\n", frameSize);
21 return false;
22 }
20 23
21 memset (&EncPic, 0, sizeof (SSourcePicture));24 memset (&EncPic, 0, sizeof (SSourcePicture));
22 EncPic.iPicWidth = iWidth;25 EncPic.iPicWidth = iWidth;
@@ -33,7 +36,9 @@ void EncodeDecodeTestAPIBase::InitialEncDec (int iWidth, int iHeight) { · 10 unmodified lines
33 36
34 //set a fixed random value37 //set a fixed random value
35 iRandValue = rand() % 256;38 iRandValue = rand() % 256;
39 return true;
36}40}
41
37void EncodeDecodeTestAPIBase::RandomParamExtCombination() {42void EncodeDecodeTestAPIBase::RandomParamExtCombination() {
38 43
39 param_.iPicWidth = WelsClip3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, 2, MAX_WIDTH);44 param_.iPicWidth = WelsClip3 ((((rand() % MAX_WIDTH) >> 1) + 1) << 1, 2, MAX_WIDTH);
@@ -321,7 +326,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionEncParamExt) { · 281 unmodified lines
321 // so need to enhance the validation check for any random value of each variable in ParamExt326 // so need to enhance the validation check for any random value of each variable in ParamExt
322 327
323 if (cmResultSuccess == iResult) {328 if (cmResultSuccess == iResult) {
324 InitialEncDec (param_.iPicWidth, param_.iPicHeight);329 ASSERT_TRUE (InitialEncDec (param_.iPicWidth, param_.iPicHeight));
325 EncodeOneFrame (0);330 EncodeOneFrame (0);
326 encToDecData (info, len);331 encToDecData (info, len);
327 pData[0] = pData[1] = pData[2] = 0;332 pData[0] = pData[1] = pData[2] = 0;
@@ -366,7 +371,7 @@ TEST_F (EncodeDecodeTestAPI, SetOptionEncParamBase) { · 38 unmodified lines
366 iResult = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, &param_);371 iResult = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_BASE, &param_);
367 372
368 if (cmResultSuccess == iResult) {373 if (cmResultSuccess == iResult) {
369 InitialEncDec (param_.iPicWidth, param_.iPicHeight);374 ASSERT_TRUE (InitialEncDec (param_.iPicWidth, param_.iPicHeight));
370 EncodeOneFrame (0);375 EncodeOneFrame (0);
371 encToDecData (info, len);376 encToDecData (info, len);
372 pData[0] = pData[1] = pData[2] = 0;377 pData[0] = pData[1] = pData[2] = 0;
@@ -439,34 +444,34 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_INCREASING_ID) { · 66 unmodified lines
439 int rv = encoder_->InitializeExt (&sParam1);444 int rv = encoder_->InitializeExt (&sParam1);
440 ASSERT_TRUE (rv == cmResultSuccess) << "InitializeExt: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<445 ASSERT_TRUE (rv == cmResultSuccess) << "InitializeExt: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<
441 sParam1.iPicHeight;446 sParam1.iPicHeight;
442 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);447 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
443 448
444 // new IDR449 // new IDR
445 rv = encoder_->ForceIntraFrame (true);450 rv = encoder_->ForceIntraFrame (true);
446 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;451 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
447 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);452 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
448 453
449 // step#2: pParam2454 // step#2: pParam2
450 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);455 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
451 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam2.iPicWidth << "x" <<456 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam2.iPicWidth << "x" <<
452 sParam2.iPicHeight;457 sParam2.iPicHeight;
453 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);458 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
454 459
455 // new IDR460 // new IDR
456 rv = encoder_->ForceIntraFrame (true);461 rv = encoder_->ForceIntraFrame (true);
457 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;462 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
458 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);463 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
459 464
460 // step#3: back to pParam1465 // step#3: back to pParam1
461 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);466 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);
462 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<467 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<
463 sParam1.iPicHeight;468 sParam1.iPicHeight;
464 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);469 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
465 470
466 // step#4: back to pParam2471 // step#4: back to pParam2
467 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);472 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
468 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv << sParam2.iPicWidth << sParam2.iPicHeight;473 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv << sParam2.iPicWidth << sParam2.iPicHeight;
469 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);474 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
470 475
471#ifdef DEBUG_FILE_SAVE_INCREASING_ID476#ifdef DEBUG_FILE_SAVE_INCREASING_ID
472 fclose (fEnc);477 fclose (fEnc);
@@ -487,15 +492,15 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_INCREASING_ID) { · 14 unmodified lines
487 fEnc = fopen ("enc_INCREASING_ID2.264", "wb");492 fEnc = fopen ("enc_INCREASING_ID2.264", "wb");
488#endif493#endif
489 iEncFrameNum = 0;494 iEncFrameNum = 0;
490 EncDecOneFrame (sParam3.iPicWidth, sParam3.iPicHeight, iEncFrameNum++, fEnc);495 ASSERT_TRUE (EncDecOneFrame (sParam3.iPicWidth, sParam3.iPicHeight, iEncFrameNum++, fEnc));
491 496
492 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);497 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
493 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;498 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;
494 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);499 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
495 500
496 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);501 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);
497 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;502 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;
498 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);503 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
499 504
500#ifdef DEBUG_FILE_SAVE_INCREASING_ID505#ifdef DEBUG_FILE_SAVE_INCREASING_ID
501 fclose (fEnc);506 fclose (fEnc);
@@ -547,36 +552,37 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 45 unmodified lines
547 //int TraceLevel = WELS_LOG_INFO;552 //int TraceLevel = WELS_LOG_INFO;
548 //encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &TraceLevel);553 //encoder_->SetOption (ENCODER_OPTION_TRACE_LEVEL, &TraceLevel);
549 int rv = encoder_->InitializeExt (&sParam1);554 int rv = encoder_->InitializeExt (&sParam1);
555 printf ("Start EncDecOneFrame()\n");
550 ASSERT_TRUE (rv == cmResultSuccess) << "InitializeExt: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<556 ASSERT_TRUE (rv == cmResultSuccess) << "InitializeExt: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<
551 sParam1.iPicHeight;557 sParam1.iPicHeight;
552 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);558 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
553 559
554 // new IDR560 // new IDR
555 rv = encoder_->ForceIntraFrame (true);561 rv = encoder_->ForceIntraFrame (true);
556 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;562 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
557 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);563 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
558 564
559 // step#2: pParam2565 // step#2: pParam2
560 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);566 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
561 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam2.iPicWidth << "x" <<567 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam2.iPicWidth << "x" <<
562 sParam2.iPicHeight;568 sParam2.iPicHeight;
563 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);569 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
564 570
565 // new IDR571 // new IDR
566 rv = encoder_->ForceIntraFrame (true);572 rv = encoder_->ForceIntraFrame (true);
567 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;573 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
568 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);574 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
569 575
570 // step#3: back to pParam1576 // step#3: back to pParam1
571 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);577 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);
572 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<578 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<
573 sParam1.iPicHeight;579 sParam1.iPicHeight;
574 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);580 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
575 581
576 // step#4: back to pParam2582 // step#4: back to pParam2
577 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);583 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
578 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv << sParam2.iPicWidth << sParam2.iPicHeight;584 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv << sParam2.iPicWidth << sParam2.iPicHeight;
579 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);585 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
580 586
581#ifdef DEBUG_FILE_SAVE2587#ifdef DEBUG_FILE_SAVE2
582 fclose (fEnc);588 fclose (fEnc);
@@ -597,15 +603,15 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 14 unmodified lines
597 fEnc = fopen ("enc_SPS_LISTING_AND_PPS_INCREASING11.264", "wb");603 fEnc = fopen ("enc_SPS_LISTING_AND_PPS_INCREASING11.264", "wb");
598#endif604#endif
599 iEncFrameNum = 0;605 iEncFrameNum = 0;
600 EncDecOneFrame (sParam3.iPicWidth, sParam3.iPicHeight, iEncFrameNum++, fEnc);606 ASSERT_TRUE (EncDecOneFrame (sParam3.iPicWidth, sParam3.iPicHeight, iEncFrameNum++, fEnc));
601 607
602 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);608 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
603 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;609 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;
604 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);610 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
605 611
606 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);612 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);
607 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;613 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;
608 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);614 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
609 615
610#ifdef DEBUG_FILE_SAVE2616#ifdef DEBUG_FILE_SAVE2
611 fclose (fEnc);617 fclose (fEnc);
@@ -657,12 +663,12 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 45 unmodified lines
657 // step#3: set back to pParam1, with a smaller num_ref, it still uses the previous SPS663 // step#3: set back to pParam1, with a smaller num_ref, it still uses the previous SPS
658 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);664 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);
659 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam1: rv = " << rv;665 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam1: rv = " << rv;
660 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);666 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
661 667
662 // new IDR, PPS increases668 // new IDR, PPS increases
663 rv = encoder_->ForceIntraFrame (true);669 rv = encoder_->ForceIntraFrame (true);
664 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;670 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
665 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);671 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
666 672
667 rv = encoder_->Uninitialize();673 rv = encoder_->Uninitialize();
668 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;674 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
@@ -719,7 +725,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_LISTING_AND_PPS_INCREASING · 50 unmodified lines
719 sParam2.iPicWidth;725 sParam2.iPicWidth;
720 } // end of setting loop726 } // end of setting loop
721 727
722 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);728 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
723 729
724#ifdef DEBUG_FILE_SAVE2730#ifdef DEBUG_FILE_SAVE2
725 fclose (fEnc);731 fclose (fEnc);
@@ -765,13 +771,13 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING1) { · 39 unmodified lines
765 int rv = encoder_->InitializeExt (&sParam1);771 int rv = encoder_->InitializeExt (&sParam1);
766 ASSERT_TRUE (rv == cmResultSuccess) << "InitializeExt: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<772 ASSERT_TRUE (rv == cmResultSuccess) << "InitializeExt: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<
767 sParam1.iPicHeight;773 sParam1.iPicHeight;
768 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);774 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
769 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);775 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
770 776
771 // new IDR777 // new IDR
772 rv = encoder_->ForceIntraFrame (true);778 rv = encoder_->ForceIntraFrame (true);
773 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;779 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
774 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);780 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
775 781
776 rv = encoder_->Uninitialize();782 rv = encoder_->Uninitialize();
777 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;783 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
@@ -841,18 +847,18 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING2) { · 63 unmodified lines
841 // step#2: pParam2847 // step#2: pParam2
842 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);848 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
843 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;849 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;
844 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);850 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
845 851
846 // step#3: back to pParam1, SHOULD NOT encounter ERROR852 // step#3: back to pParam1, SHOULD NOT encounter ERROR
847 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);853 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam1);
848 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<854 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption: rv = " << rv << " at " << sParam1.iPicWidth << "x" <<
849 sParam1.iPicHeight;855 sParam1.iPicHeight;
850 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);856 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
851 857
852 // new IDR858 // new IDR
853 rv = encoder_->ForceIntraFrame (true);859 rv = encoder_->ForceIntraFrame (true);
854 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;860 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
855 EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc);861 ASSERT_TRUE (EncDecOneFrame (sParam1.iPicWidth, sParam1.iPicHeight, iEncFrameNum++, fEnc));
856 862
857 rv = encoder_->Uninitialize();863 rv = encoder_->Uninitialize();
858 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;864 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
@@ -906,7 +912,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING3) { · 47 unmodified lines
906 sParam1.iPicHeight;912 sParam1.iPicHeight;
907 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);913 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam2);
908 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;914 ASSERT_TRUE (rv == cmResultSuccess) << "SetOption Failed sParam2: rv = " << rv;
909 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);915 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
910 916
911 // step#2: set strategy for success917 // step#2: set strategy for success
912 int32_t iNewStra = SPS_PPS_LISTING;918 int32_t iNewStra = SPS_PPS_LISTING;
@@ -921,7 +927,7 @@ TEST_F (EncodeDecodeTestAPI, ParameterSetStrategy_SPS_PPS_LISTING3) { · 8 unmodified lines
921 rv = encoder_->SetOption (ENCODER_OPTION_SPS_PPS_ID_STRATEGY, &iNewStra);927 rv = encoder_->SetOption (ENCODER_OPTION_SPS_PPS_ID_STRATEGY, &iNewStra);
922 ASSERT_TRUE (rv != cmResultSuccess);928 ASSERT_TRUE (rv != cmResultSuccess);
923 929
924 EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc);930 ASSERT_TRUE (EncDecOneFrame (sParam2.iPicWidth, sParam2.iPicHeight, iEncFrameNum++, fEnc));
925 931
926 // step#4: pParam3, SHOULD encounter ERROR932 // step#4: pParam3, SHOULD encounter ERROR
927 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam3);933 rv = encoder_->SetOption (ENCODER_OPTION_SVC_ENCODE_PARAM_EXT, &sParam3);
@@ -966,12 +972,12 @@ TEST_F (EncodeDecodeTestAPI, SimulcastSVC) { · 38 unmodified lines
966 int iIdx = 0;972 int iIdx = 0;
967 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {973 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
968 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));974 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
969 EXPECT_TRUE (pBsBuf[iIdx] != NULL);975 ASSERT_TRUE (pBsBuf[iIdx] != NULL);
970 aLen[iIdx] = 0;976 aLen[iIdx] = 0;
971 977
972 long rv = WelsCreateDecoder (&decoder[iIdx]);978 long rv = WelsCreateDecoder (&decoder[iIdx]);
973 ASSERT_EQ (0, rv);979 ASSERT_EQ (0, rv);
974 EXPECT_TRUE (decoder[iIdx] != NULL);980 ASSERT_TRUE (decoder[iIdx] != NULL);
975 981
976 SDecodingParam decParam;982 SDecodingParam decParam;
977 memset (&decParam, 0, sizeof (SDecodingParam));983 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -988,7 +994,7 @@ TEST_F (EncodeDecodeTestAPI, SimulcastSVC) { · 10 unmodified lines
988 int iLayerLen = 0;994 int iLayerLen = 0;
989 unsigned char* pData[3] = { NULL };995 unsigned char* pData[3] = { NULL };
990 996
991 InitialEncDec (param_.iPicWidth, param_.iPicHeight);997 ASSERT_TRUE (InitialEncDec (param_.iPicWidth, param_.iPicHeight));
992 EncodeOneFrame (0);998 EncodeOneFrame (0);
993 999
994 iLayerLen = 0;1000 iLayerLen = 0;
@@ -1083,12 +1089,12 @@ TEST_F (EncodeDecodeTestAPI, SimulcastAVC) { · 88 unmodified lines
1083 //create decoder1089 //create decoder
1084 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1090 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1085 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));1091 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
1086 EXPECT_TRUE (pBsBuf[iIdx] != NULL);1092 ASSERT_TRUE (pBsBuf[iIdx] != NULL);
1087 aLen[iIdx] = 0;1093 aLen[iIdx] = 0;
1088 1094
1089 long rv = WelsCreateDecoder (&decoder[iIdx]);1095 long rv = WelsCreateDecoder (&decoder[iIdx]);
1090 ASSERT_EQ (0, rv);1096 ASSERT_EQ (0, rv);
1091 EXPECT_TRUE (decoder[iIdx] != NULL);1097 ASSERT_TRUE (decoder[iIdx] != NULL);
1092 1098
1093 SDecodingParam decParam;1099 SDecodingParam decParam;
1094 memset (&decParam, 0, sizeof (SDecodingParam));1100 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -1106,7 +1112,7 @@ TEST_F (EncodeDecodeTestAPI, SimulcastAVC) { · 11 unmodified lines
1106 int iLayerLen = 0;1112 int iLayerLen = 0;
1107 unsigned char* pData[3] = { NULL };1113 unsigned char* pData[3] = { NULL };
1108 1114
1109 InitialEncDec (param_.iPicWidth, param_.iPicHeight);1115 ASSERT_TRUE (InitialEncDec (param_.iPicWidth, param_.iPicHeight));
1110 EncodeOneFrame (0);1116 EncodeOneFrame (0);
1111 1117
1112 // init1118 // init
@@ -1197,11 +1203,11 @@ TEST_F (EncodeDecodeTestAPI, SimulcastAVC_SPS_PPS_LISTING) { · 84 unmodified lines
1197 //create decoder1203 //create decoder
1198 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1204 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1199 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));1205 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
1200 EXPECT_TRUE (pBsBuf[iIdx] != NULL);1206 ASSERT_TRUE (pBsBuf[iIdx] != NULL);
1201 1207
1202 long rv = WelsCreateDecoder (&decoder[iIdx]);1208 long rv = WelsCreateDecoder (&decoder[iIdx]);
1203 ASSERT_EQ (0, rv);1209 ASSERT_EQ (0, rv);
1204 EXPECT_TRUE (decoder[iIdx] != NULL);1210 ASSERT_TRUE (decoder[iIdx] != NULL);
1205 1211
1206 SDecodingParam decParam;1212 SDecodingParam decParam;
1207 memset (&decParam, 0, sizeof (SDecodingParam));1213 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -1213,8 +1219,8 @@ TEST_F (EncodeDecodeTestAPI, SimulcastAVC_SPS_PPS_LISTING) { · 5 unmodified lines
1213 ASSERT_EQ (0, rv);1219 ASSERT_EQ (0, rv);
1214 }1220 }
1215 1221
1216 TestOneSimulcastAVC (&sParam1, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0);1222 ASSERT_TRUE (TestOneSimulcastAVC (&sParam1, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0));
1217 TestOneSimulcastAVC (&sParam2, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0);1223 ASSERT_TRUE (TestOneSimulcastAVC (&sParam2, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0));
1218 1224
1219 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1225 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1220 free (pBsBuf[iIdx]);1226 free (pBsBuf[iIdx]);
@@ -1367,8 +1373,7 @@ TEST_P (EncodeTestAPI, SetEncOptionSize) { · 146 unmodified lines
1367 encoder_->Uninitialize();1373 encoder_->Uninitialize();
1368 int rv = encoder_->InitializeExt (&param_);1374 int rv = encoder_->InitializeExt (&param_);
1369 ASSERT_TRUE (rv == cmResultSuccess);1375 ASSERT_TRUE (rv == cmResultSuccess);
1370 InitialEncDec (p.iWidth, p.iHeight);1376 ASSERT_TRUE (InitialEncDec (p.iWidth, p.iHeight));
1371
1372 1377
1373 int32_t iSpsPpsIdAddition = 1;1378 int32_t iSpsPpsIdAddition = 1;
1374 encoder_->SetOption (ENCODER_OPTION_SPS_PPS_ID_STRATEGY, &iSpsPpsIdAddition);1379 encoder_->SetOption (ENCODER_OPTION_SPS_PPS_ID_STRATEGY, &iSpsPpsIdAddition);
@@ -1456,12 +1461,12 @@ TEST_F (EncodeDecodeTestAPI, SimulcastAVCDiffFps) { · 81 unmodified lines
1456 //create decoder1461 //create decoder
1457 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1462 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1458 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));1463 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
1459 EXPECT_TRUE (pBsBuf[iIdx] != NULL);1464 ASSERT_TRUE (pBsBuf[iIdx] != NULL);
1460 aLen[iIdx] = 0;1465 aLen[iIdx] = 0;
1461 1466
1462 long rv = WelsCreateDecoder (&decoder[iIdx]);1467 long rv = WelsCreateDecoder (&decoder[iIdx]);
1463 ASSERT_EQ (0, rv);1468 ASSERT_EQ (0, rv);
1464 EXPECT_TRUE (decoder[iIdx] != NULL);1469 ASSERT_TRUE (decoder[iIdx] != NULL);
1465 1470
1466 SDecodingParam decParam;1471 SDecodingParam decParam;
1467 memset (&decParam, 0, sizeof (SDecodingParam));1472 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -1494,7 +1499,7 @@ TEST_F (EncodeDecodeTestAPI, SimulcastAVCDiffFps) { · 26 unmodified lines
1494 int iLayerLen = 0;1499 int iLayerLen = 0;
1495 unsigned char* pData[3] = { NULL };1500 unsigned char* pData[3] = { NULL };
1496 1501
1497 InitialEncDec (param_.iPicWidth, param_.iPicHeight);1502 ASSERT_TRUE (InitialEncDec (param_.iPicWidth, param_.iPicHeight));
1498 EncodeOneFrame (0);1503 EncodeOneFrame (0);
1499 1504
1500 if (iInsertIdr == iFrame) {1505 if (iInsertIdr == iFrame) {
@@ -1597,11 +1602,11 @@ TEST_F (EncodeDecodeTestAPI, DiffSlicingInDlayer) { · 96 unmodified lines
1597 //create decoder1602 //create decoder
1598 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1603 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1599 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));1604 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
1600 EXPECT_TRUE (pBsBuf[iIdx] != NULL);1605 ASSERT_TRUE (pBsBuf[iIdx] != NULL);
1601 1606
1602 long rv = WelsCreateDecoder (&decoder[iIdx]);1607 long rv = WelsCreateDecoder (&decoder[iIdx]);
1603 ASSERT_EQ (0, rv);1608 ASSERT_EQ (0, rv);
1604 EXPECT_TRUE (decoder[iIdx] != NULL);1609 ASSERT_TRUE (decoder[iIdx] != NULL);
1605 1610
1606 SDecodingParam decParam;1611 SDecodingParam decParam;
1607 memset (&decParam, 0, sizeof (SDecodingParam));1612 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -1613,10 +1618,13 @@ TEST_F (EncodeDecodeTestAPI, DiffSlicingInDlayer) { · 5 unmodified lines
1613 ASSERT_EQ (0, rv);1618 ASSERT_EQ (0, rv);
1614 }1619 }
1615 1620
1616 TestOneSimulcastAVC (&sParam, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0);1621 ASSERT_TRUE (TestOneSimulcastAVC (&sParam, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0));
1617 1622
1618 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1623 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1619 free (pBsBuf[iIdx]);1624 if (pBsBuf[iIdx]) {
1625 free (pBsBuf[iIdx]);
1626 pBsBuf[iIdx] = NULL;
1627 }
1620 1628
1621 if (decoder[iIdx] != NULL) {1629 if (decoder[iIdx] != NULL) {
1622 decoder[iIdx]->Uninitialize();1630 decoder[iIdx]->Uninitialize();
@@ -1665,11 +1673,11 @@ TEST_F (EncodeDecodeTestAPI, DiffSlicingInDlayerMixed) { · 42 unmodified lines
1665 //create decoder1673 //create decoder
1666 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1674 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1667 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));1675 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
1668 EXPECT_TRUE (pBsBuf[iIdx] != NULL);1676 ASSERT_TRUE (pBsBuf[iIdx] != NULL);
1669 1677
1670 long rv = WelsCreateDecoder (&decoder[iIdx]);1678 long rv = WelsCreateDecoder (&decoder[iIdx]);
1671 ASSERT_EQ (0, rv);1679 ASSERT_EQ (0, rv);
1672 EXPECT_TRUE (decoder[iIdx] != NULL);1680 ASSERT_TRUE (decoder[iIdx] != NULL);
1673 1681
1674 SDecodingParam decParam;1682 SDecodingParam decParam;
1675 memset (&decParam, 0, sizeof (SDecodingParam));1683 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -1681,10 +1689,11 @@ TEST_F (EncodeDecodeTestAPI, DiffSlicingInDlayerMixed) { · 5 unmodified lines
1681 ASSERT_EQ (0, rv);1689 ASSERT_EQ (0, rv);
1682 }1690 }
1683 1691
1684 TestOneSimulcastAVC (&sParam, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0);1692 ASSERT_TRUE (TestOneSimulcastAVC (&sParam, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0));
1685 1693
1686 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1694 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1687 free (pBsBuf[iIdx]);1695 if (pBsBuf[iIdx])
1696 free (pBsBuf[iIdx]);
1688 1697
1689 if (decoder[iIdx] != NULL) {1698 if (decoder[iIdx] != NULL) {
1690 decoder[iIdx]->Uninitialize();1699 decoder[iIdx]->Uninitialize();
@@ -1725,11 +1734,11 @@ TEST_F (EncodeDecodeTestAPI, ThreadNumAndSliceNum) { · 34 unmodified lines
1725 //create decoder1734 //create decoder
1726 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1735 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1727 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));1736 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
1728 EXPECT_TRUE (pBsBuf[iIdx] != NULL);1737 ASSERT_TRUE (pBsBuf[iIdx] != NULL);
1729 1738
1730 long rv = WelsCreateDecoder (&decoder[iIdx]);1739 long rv = WelsCreateDecoder (&decoder[iIdx]);
1731 ASSERT_EQ (0, rv);1740 ASSERT_EQ (0, rv);
1732 EXPECT_TRUE (decoder[iIdx] != NULL);1741 ASSERT_TRUE (decoder[iIdx] != NULL);
1733 1742
1734 SDecodingParam decParam;1743 SDecodingParam decParam;
1735 memset (&decParam, 0, sizeof (SDecodingParam));1744 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -1741,7 +1750,7 @@ TEST_F (EncodeDecodeTestAPI, ThreadNumAndSliceNum) { · 5 unmodified lines
1741 ASSERT_EQ (0, rv);1750 ASSERT_EQ (0, rv);
1742 }1751 }
1743 1752
1744 TestOneSimulcastAVC (&sParam, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0);1753 ASSERT_TRUE (TestOneSimulcastAVC (&sParam, decoder, pBsBuf, iSpatialLayerNum, iEncFrameNum, 0));
1745 1754
1746 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1755 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1747 free (pBsBuf[iIdx]);1756 free (pBsBuf[iIdx]);
@@ -1790,11 +1799,11 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 42 unmodified lines
1790 //create decoder1799 //create decoder
1791 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {1800 for (iIdx = 0; iIdx < iSpatialLayerNum; iIdx++) {
1792 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));1801 pBsBuf[iIdx] = static_cast<unsigned char*> (malloc (iWidth * iHeight * 3 * sizeof (unsigned char) / 2));
1793 EXPECT_TRUE (pBsBuf[iIdx] != NULL);1802 ASSERT_TRUE (pBsBuf[iIdx] != NULL);
1794 1803
1795 long rv = WelsCreateDecoder (&decoder[iIdx]);1804 long rv = WelsCreateDecoder (&decoder[iIdx]);
1796 ASSERT_EQ (0, rv);1805 ASSERT_EQ (0, rv);
1797 EXPECT_TRUE (decoder[iIdx] != NULL);1806 ASSERT_TRUE (decoder[iIdx] != NULL);
1798 1807
1799 SDecodingParam decParam;1808 SDecodingParam decParam;
1800 memset (&decParam, 0, sizeof (SDecodingParam));1809 memset (&decParam, 0, sizeof (SDecodingParam));
@@ -1815,7 +1824,7 @@ TEST_F (EncodeDecodeTestAPI, TriggerLoadBalancing) { · 14 unmodified lines
1815 int iLayerLen = 0;1824 int iLayerLen = 0;
1816 unsigned char* pData[3] = { NULL };1825 unsigned char* pData[3] = { NULL };
1817 1826
1818 InitialEncDec (sParam.iPicWidth, sParam.iPicHeight);1827 ASSERT_TRUE (InitialEncDec (sParam.iPicWidth, sParam.iPicHeight));
1819 int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2;1828 int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2;
1820 memset (buf_.data(), rand() % 256, (frameSize >> 2));1829 memset (buf_.data(), rand() % 256, (frameSize >> 2));
1821 memset (buf_.data() + (frameSize >> 2), rand() % 256, (frameSize - (frameSize >> 2)));1830 memset (buf_.data() + (frameSize >> 2), rand() % 256, (frameSize - (frameSize >> 2)));
@@ -1920,16 +1929,16 @@ TEST_F (EncodeDecodeTestAPI, ProfileLevelSetting) { · 98 unmodified lines
1920 int iSliceNum = 1;1929 int iSliceNum = 1;
1921 1930
1922 EProfileIdc profileList[11] = {PRO_UNKNOWN, PRO_BASELINE, PRO_MAIN,1931 EProfileIdc profileList[11] = {PRO_UNKNOWN, PRO_BASELINE, PRO_MAIN,
1923 PRO_EXTENDED , PRO_HIGH , PRO_HIGH10,1932 PRO_EXTENDED , PRO_HIGH , PRO_HIGH10,
1924 PRO_HIGH422, PRO_HIGH444, PRO_CAVLC444,1933 PRO_HIGH422, PRO_HIGH444, PRO_CAVLC444,
1925 PRO_SCALABLE_BASELINE,1934 PRO_SCALABLE_BASELINE,
1926 PRO_SCALABLE_HIGH1935 PRO_SCALABLE_HIGH
1927 };1936 };
1928 ELevelIdc levelList[18] = { LEVEL_UNKNOWN, LEVEL_1_0, LEVEL_1_B, LEVEL_1_1, LEVEL_1_2,1937 ELevelIdc levelList[18] = { LEVEL_UNKNOWN, LEVEL_1_0, LEVEL_1_B, LEVEL_1_1, LEVEL_1_2,
1929 LEVEL_1_3, LEVEL_2_0, LEVEL_2_1, LEVEL_2_2, LEVEL_3_0,1938 LEVEL_1_3, LEVEL_2_0, LEVEL_2_1, LEVEL_2_2, LEVEL_3_0,
1930 LEVEL_3_1, LEVEL_3_2, LEVEL_4_0, LEVEL_4_1,1939 LEVEL_3_1, LEVEL_3_2, LEVEL_4_0, LEVEL_4_1,
1931 LEVEL_4_2, LEVEL_5_0, LEVEL_5_1, LEVEL_5_21940 LEVEL_4_2, LEVEL_5_0, LEVEL_5_1, LEVEL_5_2
1932 };1941 };
1933 1942
1934 EProfileIdc iEncProfileIdc = PRO_UNKNOWN;1943 EProfileIdc iEncProfileIdc = PRO_UNKNOWN;
1935 ELevelIdc iEncLevelIdc = LEVEL_UNKNOWN;1944 ELevelIdc iEncLevelIdc = LEVEL_UNKNOWN;
@@ -1958,7 +1967,7 @@ TEST_F (EncodeDecodeTestAPI, ProfileLevelSetting) { · 22 unmodified lines
1958 int rv = encoder_->InitializeExt (&sParam);1967 int rv = encoder_->InitializeExt (&sParam);
1959 ASSERT_TRUE (rv == cmResultSuccess) << "InitializeExt: rv = " << rv << " at " << sParam.iPicWidth << "x" <<1968 ASSERT_TRUE (rv == cmResultSuccess) << "InitializeExt: rv = " << rv << " at " << sParam.iPicWidth << "x" <<
1960 sParam.iPicHeight;1969 sParam.iPicHeight;
1961 EncDecOneFrame (sParam.iPicWidth, sParam.iPicHeight, iEncFrameNum++, NULL);1970 ASSERT_TRUE (EncDecOneFrame (sParam.iPicWidth, sParam.iPicHeight, iEncFrameNum++, NULL));
1962 1971
1963 decoder_->GetOption (DECODER_OPTION_PROFILE, &iDecProfileIdc);1972 decoder_->GetOption (DECODER_OPTION_PROFILE, &iDecProfileIdc);
1964 1973
@@ -2021,7 +2030,7 @@ TEST_F (EncodeDecodeTestAPI, ProfileLevelSetting) { · 56 unmodified lines
2021 rv = encoder_->ForceIntraFrame (true);2030 rv = encoder_->ForceIntraFrame (true);
2022 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;2031 ASSERT_TRUE (rv == cmResultSuccess) << "rv = " << rv;
2023 2032
2024 EncDecOneFrame (sParam.iPicWidth, sParam.iPicHeight, iEncFrameNum++, NULL);2033 ASSERT_TRUE (EncDecOneFrame (sParam.iPicWidth, sParam.iPicHeight, iEncFrameNum++, NULL));
2025 2034
2026 decoder_->GetOption (DECODER_OPTION_PROFILE, &iDecProfileIdc);2035 decoder_->GetOption (DECODER_OPTION_PROFILE, &iDecProfileIdc);
2027 2036

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