Non-multiple of 16 width/height support for enc testapp
Also included test sequence. ../h264enc welsenc_arbitrary_res.cfg
This commit is contained in:
parent
e66b3488c5
commit
70d2ae8334
@ -1088,6 +1088,11 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) {
|
||||
sSvcParam.iActualPicHeight =
|
||||
sSvcParam.SUsedPicRect.iHeight = sSvcParam.sDependencyLayers[sSvcParam.iNumDependencyLayer - 1].iFrameHeight;
|
||||
|
||||
sSvcParam.sDependencyLayers[sSvcParam.iNumDependencyLayer - 1].iFrameWidth =
|
||||
WELS_ALIGN(sSvcParam.sDependencyLayers[sSvcParam.iNumDependencyLayer - 1].iActualWidth, MB_WIDTH_LUMA);
|
||||
sSvcParam.sDependencyLayers[sSvcParam.iNumDependencyLayer - 1].iFrameHeight =
|
||||
WELS_ALIGN(sSvcParam.sDependencyLayers[sSvcParam.iNumDependencyLayer - 1].iActualHeight, MB_HEIGHT_LUMA);
|
||||
|
||||
if (cmResultSuccess != pPtrEnc->Initialize ((void*)&sSvcParam, INIT_TYPE_CONFIG_BASED)) { // SVC encoder initialization
|
||||
fprintf (stderr, "SVC encoder Initialize failed\n");
|
||||
iRet = 1;
|
||||
@ -1117,7 +1122,7 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) {
|
||||
pSrcPicList = new SSourcePicture * [sSvcParam.iNumDependencyLayer];
|
||||
while (iDlayerIdx < sSvcParam.iNumDependencyLayer) {
|
||||
SDLayerParam* pDLayer = &sSvcParam.sDependencyLayers[iDlayerIdx];
|
||||
const int kiPicResSize = pDLayer->iFrameWidth * pDLayer->iFrameHeight;
|
||||
const int kiPicResSize = pDLayer->iActualWidth * pDLayer->iActualHeight;
|
||||
SSourcePicture* pSrcPic = new SSourcePicture;
|
||||
if (pSrcPic == NULL) {
|
||||
iRet = 1;
|
||||
@ -1132,10 +1137,10 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) {
|
||||
}
|
||||
|
||||
pSrcPic->iColorFormat = videoFormatI420;
|
||||
pSrcPic->iPicWidth = pDLayer->iFrameWidth;
|
||||
pSrcPic->iPicHeight = pDLayer->iFrameHeight;
|
||||
pSrcPic->iStride[0] = pDLayer->iFrameWidth;
|
||||
pSrcPic->iStride[1] = pSrcPic->iStride[2] = pDLayer->iFrameWidth >> 1;
|
||||
pSrcPic->iPicWidth = pDLayer->iActualWidth;
|
||||
pSrcPic->iPicHeight = pDLayer->iActualHeight;
|
||||
pSrcPic->iStride[0] = pDLayer->iActualWidth;
|
||||
pSrcPic->iStride[1] = pSrcPic->iStride[2] = pDLayer->iActualWidth >> 1;
|
||||
|
||||
pSrcPicList[iDlayerIdx] = pSrcPic;
|
||||
|
||||
@ -1173,7 +1178,7 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) {
|
||||
int nSpatialLayerNum = 0;
|
||||
while (iDlayerIdx < sSvcParam.iNumDependencyLayer) {
|
||||
SDLayerParam* pDLayer = &sSvcParam.sDependencyLayers[iDlayerIdx];
|
||||
const int kiPicResSize = ((pDLayer->iFrameWidth * pDLayer->iFrameHeight) * 3) >> 1;
|
||||
const int kiPicResSize = ((pDLayer->iActualWidth * pDLayer->iActualHeight) * 3) >> 1;
|
||||
uint32_t uiSkipIdx = (1 << pDLayer->iTemporalResolution);
|
||||
|
||||
bool_t bCanBeRead = false;
|
||||
@ -1186,15 +1191,15 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) {
|
||||
|
||||
pSrcPicList[nSpatialLayerNum]->pData[0] = pYUV[iDlayerIdx];
|
||||
pSrcPicList[nSpatialLayerNum]->pData[1] = pSrcPicList[nSpatialLayerNum]->pData[0] +
|
||||
(pDLayer->iFrameWidth * pDLayer->iFrameHeight);
|
||||
(pDLayer->iActualWidth * pDLayer->iActualHeight);
|
||||
pSrcPicList[nSpatialLayerNum]->pData[2] = pSrcPicList[nSpatialLayerNum]->pData[1] +
|
||||
((pDLayer->iFrameWidth * pDLayer->iFrameHeight) >> 2);
|
||||
((pDLayer->iActualWidth * pDLayer->iActualHeight) >> 2);
|
||||
|
||||
pSrcPicList[nSpatialLayerNum]->iPicWidth = pDLayer->iFrameWidth;
|
||||
pSrcPicList[nSpatialLayerNum]->iPicHeight = pDLayer->iFrameHeight;
|
||||
pSrcPicList[nSpatialLayerNum]->iStride[0] = pDLayer->iFrameWidth;
|
||||
pSrcPicList[nSpatialLayerNum]->iPicWidth = pDLayer->iActualWidth;
|
||||
pSrcPicList[nSpatialLayerNum]->iPicHeight = pDLayer->iActualHeight;
|
||||
pSrcPicList[nSpatialLayerNum]->iStride[0] = pDLayer->iActualWidth;
|
||||
pSrcPicList[nSpatialLayerNum]->iStride[1] = pSrcPicList[nSpatialLayerNum]->iStride[2]
|
||||
= pDLayer->iFrameWidth >> 1;
|
||||
= pDLayer->iActualWidth >> 1;
|
||||
|
||||
++ nSpatialLayerNum;
|
||||
} else { // file end while reading
|
||||
|
1
testbin/Static_152_100.yuv
Normal file
1
testbin/Static_152_100.yuv
Normal file
File diff suppressed because one or more lines are too long
39
testbin/layer2_arbitrary_res.cfg
Normal file
39
testbin/layer2_arbitrary_res.cfg
Normal file
@ -0,0 +1,39 @@
|
||||
# Layer Configuration File
|
||||
|
||||
|
||||
#============================== INPUT / OUTPUT ==============================
|
||||
SourceWidth 152 # Input frame width
|
||||
SourceHeight 100 # Input frame height
|
||||
FrameRateIn 12 # Input frame rate [Hz]
|
||||
FrameRateOut 12 # Output frame rate [Hz]
|
||||
InputFile Static_152_100.yuv # Input file
|
||||
ReconFile rec_layer2.yuv # Reconstructed file
|
||||
|
||||
#============================== CODING ==============================
|
||||
ProfileIdc 66 # value of profile_idc (or 0 for auto detection)
|
||||
|
||||
InitialQP 24 # Quantization parameters for base quality layer
|
||||
#================================ RATE CONTROL ===============================
|
||||
SpatialBitrate 600 # Unit: kbps, controled by DisableRC also
|
||||
#============================== MultiSlice Slice Argument ==============================
|
||||
# for S/M Slice(s) mode settings
|
||||
SliceMode 0 # 0: sigle slice mode; >0: multiple slices mode, see below;
|
||||
SliceSize 1500
|
||||
SliceNum 1 # multiple slices number specified
|
||||
|
||||
SlicesAssign0 960 # count number of MBs in slice #0
|
||||
SlicesAssign1 0 # count number of MBs in slice #1
|
||||
SlicesAssign2 0 # count number of MBs in slice #2
|
||||
SlicesAssign3 0 # count number of MBs in slice #3 -- seting here is for better testing
|
||||
SlicesAssign4 0 # count number of MBs in slice #4
|
||||
SlicesAssign5 0 # count number of MBs in slice #5
|
||||
SlicesAssign6 0 # count number of MBs in slice #6
|
||||
SlicesAssign7 0 # count number of MBs in slice #7
|
||||
|
||||
### DESIGN OF SLICE MODE ####
|
||||
# 0 SM_SINGLE_SLICE | SliceNum==1
|
||||
# 1 SM_FIXEDSLCNUM_SLICE | according to SliceNum | Enabled dynamic slicing for multi-thread
|
||||
# 2 SM_RASTER_SLICE | according to SlicesAssign | Need input of MB numbers each slice. In addition, if other constraint in slice_argument is presented, need to follow the constraints. Typically if MB num and slice size are both constrained, re-encoding may be involved.
|
||||
# 3 SM_ROWMB_SLICE | according to PictureMBHeight | Typical of single row of mbs each slice?+ slice size constraint which including re-encoding
|
||||
# 4 SM_DYN_SLICE | according to SliceSize | Dynamic slicing (have no idea about slice_nums until encoding current frame)
|
||||
|
63
testbin/welsenc_arbitrary_res.cfg
Normal file
63
testbin/welsenc_arbitrary_res.cfg
Normal file
@ -0,0 +1,63 @@
|
||||
# Cisco Scalable H.264/AVC Extension Encoder Configuration File
|
||||
|
||||
#============================== GENERAL ==============================
|
||||
OutputFile test.264 # Bitstream file
|
||||
MaxFrameRate 30 # Maximum frame rate [Hz]
|
||||
FramesToBeEncoded -1 # Number of frames (at input frame rate)
|
||||
|
||||
GOPSize 4 # GOP Size (at maximum frame rate), 16
|
||||
IntraPeriod 0 # Intra Period ( multiple of GoP size or -1)
|
||||
EnableSpsPpsIDAddition 1
|
||||
|
||||
EnableFrameCropping 1 # enable frame cropping flag
|
||||
|
||||
#============================== LOOP FILTER ==============================
|
||||
LoopFilterDisableIDC 0 # Loop filter idc (0: on, 1: off,
|
||||
# 2: on except for slice boundaries,
|
||||
# 3: two stage. slice boundries on in second stage
|
||||
# 4: Luma on but Chroma off (w.r.t. idc=0)
|
||||
# 5: Luma on except on slice boundaries, but Chroma off in enh. layer (w.r.t. idc=2)
|
||||
# 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
|
||||
LoopFilterAlphaC0Offset 0 # AlphaOffset(-6..+6): valid range
|
||||
LoopFilterBetaOffset 0 # BetaOffset (-6..+6): valid range
|
||||
|
||||
InterLayerLoopFilterDisableIDC 0 # filter idc for inter-layer deblocking (0: on, 1: off,
|
||||
# 2: on except for slice boundaries,
|
||||
# 3: two stage. slice boundries on in second stage
|
||||
# 4: Luma on but Chroma off in enh. layer (w.r.t. idc=0)
|
||||
# 5: Luma on except on slice boundaries, but Chroma off in enh. layer (w.r.t. idc=2)
|
||||
# 6: Luma on in two stage. slice boundries on in second stage, but Chroma off (w.r.t. idc=3)
|
||||
InterLayerLoopFilterAlphaC0Offset 0 # AlphaOffset for inter-layer deblocking
|
||||
InterLayerLoopFilterBetaOffset 0 # BetaOffset for inter-layer deblocking
|
||||
|
||||
#============================== SOFTWARE IMPLEMENTATION ==============================
|
||||
MultipleThreadIdc 1 # 0: auto(dynamic imp. internal encoder); 1: multiple threads imp. disabled; > 1: count number of threads;
|
||||
|
||||
#============================== RATE CONTROL ==============================
|
||||
EnableRC 1 # ENABLE RC
|
||||
TargetBitrate 5000 # Unit: kbps, controled by EnableRC also
|
||||
|
||||
#============================== DENOISE CONTROL ==============================
|
||||
EnableDenoise 0 # Enable Denoise (1: enable, 0: disable)
|
||||
|
||||
#============================== SCENE CHANGE DETECTION CONTROL =======================
|
||||
EnableSceneChangeDetection 1 # Enable Scene Change Detection (1: enable, 0: disable)
|
||||
|
||||
#============================== BACKGROUND DETECTION CONTROL ==============================
|
||||
EnableBackgroundDetection 1 # BGD control(1: enable, 0: disable)
|
||||
|
||||
#============================== ADAPTIVE QUANTIZATION CONTROL =======================
|
||||
EnableAdaptiveQuantization 1 # Enable Adaptive Quantization (1: enable, 0: disable)
|
||||
|
||||
#============================== LONG TERM REFERENCE CONTROL ==============================
|
||||
EnableLongTermReference 0 # Enable Long Term Reference (1: enable, 0: disable)
|
||||
LtrMarkPeriod 30 # Long Term Reference Marking Period
|
||||
|
||||
#============================== LAYER DEFINITION ==============================
|
||||
PrefixNALAddingCtrl 0 # Control flag of adding prefix unit (0: off, 1: on)
|
||||
# It shall always be on in SVC contexts (i.e. when there are CGS/MGS/spatial enhancement layers)
|
||||
# Can be disabled when no inter spatial layer prediction in case of its value as 0
|
||||
NumLayers 1 # Number of layers
|
||||
//LayerCfg layer0.cfg # Layer 0 configuration file
|
||||
//LayerCfg layer1.cfg # Layer 1 configuration file
|
||||
LayerCfg layer2_arbitrary_res.cfg # Layer 2 configuration file
|
Loading…
Reference in New Issue
Block a user