• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <gtest/gtest.h>
2 
3 #include "utils/DataGenerator.h"
4 #include "encoder_context.h"
5 #include "wels_task_management.h"
6 
7 using namespace WelsEnc;
8 
9 
TEST(EncoderTaskManagement,CWelsTaskManageBase)10 TEST (EncoderTaskManagement, CWelsTaskManageBase) {
11   sWelsEncCtx sCtx;
12   SWelsSvcCodingParam sWelsSvcCodingParam;
13 
14   sCtx.pSvcParam = &sWelsSvcCodingParam;
15   sWelsSvcCodingParam.iMultipleThreadIdc = 4;
16   sCtx.iMaxSliceCount = 35;
17   IWelsTaskManage*  pTaskManage = IWelsTaskManage::CreateTaskManage (&sCtx, 1, false);
18   ASSERT_TRUE (NULL != pTaskManage);
19 
20   delete pTaskManage;
21 }
22 
TEST(EncoderTaskManagement,CWelsTaskManageParallel)23 TEST (EncoderTaskManagement, CWelsTaskManageParallel) {
24   sWelsEncCtx sCtx;
25   SWelsSvcCodingParam sWelsSvcCodingParam;
26 
27   sCtx.pSvcParam = &sWelsSvcCodingParam;
28   sWelsSvcCodingParam.iMultipleThreadIdc = 4;
29   sCtx.iMaxSliceCount = 35;
30   IWelsTaskManage*  pTaskManage = IWelsTaskManage::CreateTaskManage (&sCtx, 1, true);
31   ASSERT_TRUE (NULL != pTaskManage);
32 
33   delete pTaskManage;
34 }
35 
TEST(EncoderTaskManagement,CWelsTaskManageMultiD)36 TEST (EncoderTaskManagement, CWelsTaskManageMultiD) {
37   sWelsEncCtx sCtx;
38   SWelsSvcCodingParam sWelsSvcCodingParam;
39 
40   sCtx.pSvcParam = &sWelsSvcCodingParam;
41   sWelsSvcCodingParam.iMultipleThreadIdc = 4;
42   sWelsSvcCodingParam.sSpatialLayers[0].sSliceArgument.uiSliceNum = 35;
43   sCtx.iMaxSliceCount = 35;
44 
45   IWelsTaskManage*  pTaskManage = IWelsTaskManage::CreateTaskManage (&sCtx, 4, true);
46   ASSERT_TRUE (NULL != pTaskManage);
47 
48   delete pTaskManage;
49 }