Merge pull request #1913 from mstorsjo/style-cleanup

Clean up trailing whitespace, astyle a new file, clean up mixed spaces/tabs indentation
This commit is contained in:
huili2 2015-04-28 08:47:04 +08:00
commit faf1bdde0f
8 changed files with 145 additions and 148 deletions

View File

@ -4,30 +4,30 @@
runGetPerformanceInfo_openh264()
{
if [ ! $# -eq 2 ]
then
echo "not enough parameters!"
echo "usage: ${0} [android/ios] ${PerformanceLogFile}"
return 1
fi
if [ ! $# -eq 2 ]
then
echo "not enough parameters!"
echo "usage: ${0} [android/ios] ${PerformanceLogFile}"
return 1
fi
local PerformanceLogFile=$2
local PerformanceLogFile=$2
local FileName=""
local Width=""
local Height=""
local Frames=""
local FPS=""
local EncodeTime=""
local Width=""
local Height=""
local Frames=""
local FPS=""
local EncodeTime=""
if [ $1 = "android" ]
then seperatorNum=3
else
seperatorNum=2
fi
while read line
do
if [[ $line =~ "enc yuv file" ]]
then
while read line
do
if [[ $line =~ "enc yuv file" ]]
then
FileName=`echo $line | awk 'BEGIN {FS="enc yuv file"} {print $2}'`
FileName=`echo $FileName | awk 'BEGIN {FS=":"} {print $2}'`
fi
@ -51,9 +51,9 @@ runGetPerformanceInfo_openh264()
fi
if [[ $line =~ "encode time" ]]
then
EncodeTime=`echo $line | awk 'BEGIN {FS=":"} {print $'${seperatorNum}'}'`
fi
then
EncodeTime=`echo $line | awk 'BEGIN {FS=":"} {print $'${seperatorNum}'}'`
fi
if [[ $line =~ "height" ]]
then
Height=`echo $line | awk 'BEGIN {FS=":"} {print $'${seperatorNum}'}'`
@ -70,7 +70,7 @@ runGetPerformanceInfo_openh264()
fi
fi
done <${PerformanceLogFile}
done <${PerformanceLogFile}
}

View File

@ -19,7 +19,7 @@ ANDROID_SDK_PATH=${ANDROID_HOME}
ANDROID_NDK_PATH=${ANDROID_NDK_HOME}
if [ "#${ANDROID_SDK_PATH}" = "#" ]
then
echo Please set ANDROID_HOME with the path of Android SDK
echo Please set ANDROID_HOME with the path of Android SDK
exit 1
fi
if [ "#${ANDROID_NDK_PATH}" = "#" ]

View File

@ -4,15 +4,15 @@
#
if [ "$1"x = ""x ]; then
echo "Please input the version number as: major_ver.minor_ver.patch.reserve"
exit 127
echo "Please input the version number as: major_ver.minor_ver.patch.reserve"
exit 127
fi
codec_ver=`echo "$1" | egrep "^([0-9]+[.]){3}[0-9]+$"`
if [ $? -ne 0 ]; then
echo "Please input the version number as: major_ver.minor_ver.patch.reserve"
exit 127
echo "Please input the version number as: major_ver.minor_ver.patch.reserve"
exit 127
fi
revision=`git show | head -n 1`

View File

@ -105,7 +105,7 @@ struct TagDqLayer {
int32_t iInterLayerSliceBetaOffset;
//SPosOffset sScaledRefLayer;
int32_t iSliceGroupChangeCycle;
PRefPicListReorderSyn pRefPicListReordering;
PPredWeightTabSyn pPredWeightTable;
PRefPicMarking pRefPicMarking; // Decoded reference picture marking syntaxs

View File

@ -231,7 +231,7 @@ static const SI4PredInfo g_ksI4PredInfo[9] = {
{ I4_PRED_HU, 1, 0, 0},
};
static const uint8_t g_kuiI16CbpTable[6] = {0, 16, 32, 15, 31, 47};
static const uint8_t g_kuiI16CbpTable[6] = {0, 16, 32, 15, 31, 47};
typedef struct TagPartMbInfo {

View File

@ -211,7 +211,7 @@ int32_t iFrameCodedInVGop;
int32_t iSkipFrameInVGop;
int32_t iGopNumberInVGop;
int32_t iGopIndexInVGop;
int32_t iSkipQpValue;
int32_t iQpRangeUpperInFrame;
int32_t iQpRangeLowerInFrame;

View File

@ -12,71 +12,68 @@ import android.os.Process;
public class MainActivity extends Activity {
private TextView mStatusView;
private TextView mStatusView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_main);
mStatusView = (TextView)findViewById(R.id.status_view);
mStatusView = (TextView)findViewById (R.id.status_view);
runUnitTest();
runUnitTest();
}
}
@Override
public void onDestroy()
{
super.onDestroy();
Log.i("codec_unittest","OnDestroy");
Process.killProcess(Process.myPid());
}
@Override
public void onDestroy() {
super.onDestroy();
Log.i ("codec_unittest", "OnDestroy");
Process.killProcess (Process.myPid());
}
public void runUnitTest()
{
Thread thread = new Thread() {
public void runUnitTest() {
Thread thread = new Thread() {
public void run()
{
Log.i("codec_unittest","codec unittest begin");
CharSequence text = "Running...";
if(mStatusView !=null)
{
mStatusView.setText(text);
}
public void run() {
Log.i ("codec_unittest", "codec unittest begin");
CharSequence text = "Running...";
if (mStatusView != null) {
mStatusView.setText (text);
}
// String path = getIntent().getStringExtra("path");
// if (path.length() <=0)
// {
// path = "/sdcard/codec_unittest.xml";
// }
String path = "/sdcard/codec_unittest.xml";
Log.i("codec_unittest","codec unittest runing @"+path);
DoUnittest("/sdcard", path);
Log.i("codec_unittest","codec unittest end");
finish();
}
// String path = getIntent().getStringExtra("path");
// if (path.length() <=0)
// {
// path = "/sdcard/codec_unittest.xml";
// }
String path = "/sdcard/codec_unittest.xml";
Log.i ("codec_unittest", "codec unittest runing @" + path);
DoUnittest ("/sdcard", path);
Log.i ("codec_unittest", "codec unittest end");
finish();
}
};
thread.start();
}
};
thread.start();
}
static{
try{
System.loadLibrary("stlport_shared");
//System.loadLibrary("openh264");
System.loadLibrary("ut");
System.loadLibrary("utDemo");
static {
try {
System.loadLibrary ("stlport_shared");
//System.loadLibrary("openh264");
System.loadLibrary ("ut");
System.loadLibrary ("utDemo");
}
catch(Exception e){Log.v("codec_unittest","Load library failed");}
} catch (Exception e) {
Log.v ("codec_unittest", "Load library failed");
}
}
}
public native void DoUnittest(String directory, String path);
public native void DoUnittest (String directory, String path);
}

View File

@ -56,25 +56,25 @@ runGlobalVariableDef()
runEncoderCommandInital()
{
aEncoderCommandSet=( -utype -frms -numl -numtl \
-sw -sh "-dw 0" "-dh 0" "-dw 1" "-dh 1" "-dw 2" "-dh 2" "-dw 3" "-dh 3" \
"-frout 0" "-frout 1" "-frout 2" "-frout 3" \
"-lqp 0" "-lqp 1" "-lqp 2" "-lqp 3" \
-rc -tarb "-ltarb 0" "-ltarb 1" "-ltarb 2" "-ltarb 3" \
"-slcmd 0" "-slcnum 0" "-slcmd 1" "-slcnum 1"\
"-slcmd 2" "-slcnum 2" "-slcmd 3" "-slcnum 3"\
-nalsize \
-iper -thread -ltr \
-db -denois -scene -bgd -aq )
-sw -sh "-dw 0" "-dh 0" "-dw 1" "-dh 1" "-dw 2" "-dh 2" "-dw 3" "-dh 3" \
"-frout 0" "-frout 1" "-frout 2" "-frout 3" \
"-lqp 0" "-lqp 1" "-lqp 2" "-lqp 3" \
-rc -tarb "-ltarb 0" "-ltarb 1" "-ltarb 2" "-ltarb 3" \
"-slcmd 0" "-slcnum 0" "-slcmd 1" "-slcnum 1"\
"-slcmd 2" "-slcnum 2" "-slcmd 3" "-slcnum 3"\
-nalsize \
-iper -thread -ltr \
-db -denois -scene -bgd -aq )
aEncoderCommandName=(usagetype frms numl numtl \
sw sh dw0 dh0 dw1 dh1 dw2 dh2 dw3 dh3 \
frout0 frout1 frout2 frout3 \
lqp0 lqp1 lqp2 lqp3 \
rc tarb ltarb0 ltarb1 ltarb2 ltarb3 \
slcmd0 slcnum0 slcmd1 slcnum1 \
slcmd2 slcnum2 slcmd3 slcnum3 \
MaxNalSZ \
iper thread ltr \
db denois scene bgd aq )
sw sh dw0 dh0 dw1 dh1 dw2 dh2 dw3 dh3 \
frout0 frout1 frout2 frout3 \
lqp0 lqp1 lqp2 lqp3 \
rc tarb ltarb0 ltarb1 ltarb2 ltarb3 \
slcmd0 slcnum0 slcmd1 slcnum1 \
slcmd2 slcnum2 slcmd3 slcnum3 \
MaxNalSZ \
iper thread ltr \
db denois scene bgd aq )
NumParameter=${#aEncoderCommandSet[@]}
for ((i=0;i<NumParameter; i++))
do
@ -103,27 +103,27 @@ runGlobalVariableInitial()
UpdateSHA1TableFile="${FinalResultPath}/${TestSequenceName}_UpdateSHA1Table.csv"
HeadLine1="BitMatched Status, SHA-1-Target, SHA-1-Benchmark, MD5-Target, MD5-Benchmark,\
Bitstream-Target,Bitstream-Benchmark,YUV-Target,YUV-Benchmark,\
-utype, -frms, -numl, -numtl, -sw, -sh,\
-dw 0, -dh 0, -dw 1, -dh 1, -dw 2, -dh 2, -dw 3, -dh 3,\
-frout 0, -frout 1, -frout 2, -frout 3,\
-lqp 0, -lqp 1, -lqp 2, -lqp 3,\
-rc, -tarb, -ltarb 0, -ltarb 1, -ltarb 2, -ltarb 3,\
-slcmd 0, -slcnum 0, -slcmd 1, -slcnum 1,\
-slcmd 2, -slcnum 2, -slcmd 3, -slcnum 3,\
-nalsize,\
-iper, -thread, -ltr, -db, -denois,\
-scene, -bgd , -aq, "
-utype, -frms, -numl, -numtl, -sw, -sh,\
-dw 0, -dh 0, -dw 1, -dh 1, -dw 2, -dh 2, -dw 3, -dh 3,\
-frout 0, -frout 1, -frout 2, -frout 3,\
-lqp 0, -lqp 1, -lqp 2, -lqp 3,\
-rc, -tarb, -ltarb 0, -ltarb 1, -ltarb 2, -ltarb 3,\
-slcmd 0, -slcnum 0, -slcmd 1, -slcnum 1,\
-slcmd 2, -slcnum 2, -slcmd 3, -slcnum 3,\
-nalsize,\
-iper, -thread, -ltr, -db, -denois,\
-scene, -bgd , -aq, "
HeadLine2="SHA-1 Value, MD5String, BitStreamSize, YUVSize, \
-utype, -frms, -numl, -numtl, -sw, -sh,\
-dw 0, -dh 0, -dw 1, -dh 1,-dw 2, -dh 2, -dw 3, -dh 3,\
-frout 0, -frout 1, -frout 2, -frout 3,\
-lqp 0, -lqp 1, -lqp 2, -lqp 3,\
-rc, -tarb, -ltarb 0, -ltarb 1, -ltarb 2, -ltarb 3,\
-slcmd 0, -slcnum 0, -slcmd 1, -slcnum 1,\
-slcmd 2, -slcnum 2, -slcmd 3, -slcnum 3,\
-nalsize,\
-iper, -thread, -ltr, -db, -denois,\
-scene , bgd , -aq "
-utype, -frms, -numl, -numtl, -sw, -sh,\
-dw 0, -dh 0, -dw 1, -dh 1,-dw 2, -dh 2, -dw 3, -dh 3,\
-frout 0, -frout 1, -frout 2, -frout 3,\
-lqp 0, -lqp 1, -lqp 2, -lqp 3,\
-rc, -tarb, -ltarb 0, -ltarb 1, -ltarb 2, -ltarb 3,\
-slcmd 0, -slcnum 0, -slcmd 1, -slcnum 1,\
-slcmd 2, -slcnum 2, -slcmd 3, -slcnum 3,\
-nalsize,\
-iper, -thread, -ltr, -db, -denois,\
-scene , bgd , -aq "
echo ${HeadLine1}>${AllCasePassStatusFile}
echo ${HeadLine1}>${UnpassCaseFile}
echo ${HeadLine2}>${UpdateSHA1TableFile}
@ -152,8 +152,8 @@ runParseCaseInfo()
{
if [ $# -lt 1 ]
then
echo "no parameter!"
return 1
echo "no parameter!"
return 1
fi
local TempData=""
local CaseData=$@
@ -169,18 +169,18 @@ runParseCaseInfo()
let "TempParamFlag=0"
for((i=0; i<$NumParameter; i++))
do
for ParnmIndex in ${aTempParamIndex[@]}
do
if [ $i -eq ${ParnmIndex} ]
then
let "TempParamFlag=1"
fi
done
if [ ${TempParamFlag} -eq 0 ]
then
BitstreamPrefix=${BitstreamPrefix}_${aEncoderCommandName[$i]}_${aEncoderCommandValue[$i]}
fi
let "TempParamFlag=0"
for ParnmIndex in ${aTempParamIndex[@]}
do
if [ $i -eq ${ParnmIndex} ]
then
let "TempParamFlag=1"
fi
done
if [ ${TempParamFlag} -eq 0 ]
then
BitstreamPrefix=${BitstreamPrefix}_${aEncoderCommandName[$i]}_${aEncoderCommandValue[$i]}
fi
let "TempParamFlag=0"
done
BitstreamTarget=${TempDataPath}/${TestSequenceName}_${BitstreamPrefix}_codec_target.264
@ -195,44 +195,44 @@ runEncodeOneCase()
for ((i=4; i<${NumParameter}; i++))
do
ParamCommand="${ParamCommand} ${aEncoderCommandSet[$i]} ${aEncoderCommandValue[$i]} "
ParamCommand="${ParamCommand} ${aEncoderCommandSet[$i]} ${aEncoderCommandValue[$i]} "
done
for((i=0;i<4;i++))
do
aRecYUVFileList[$i]="${TempDataPath}/${TestYUVName}_rec${i}.yuv"
aRecYUVFileList[$i]="${TempDataPath}/${TestYUVName}_rec${i}.yuv"
done
ParamCommand="${aEncoderCommandSet[0]} ${aEncoderCommandValue[0]} ${aEncoderCommandSet[1]} ${aEncoderCommandValue[1]} \
${aEncoderCommandSet[2]} ${aEncoderCommandValue[2]} \
-lconfig 0 layer0.cfg -lconfig 1 layer1.cfg -lconfig 2 layer2.cfg -lconfig 3 layer3.cfg \
${aEncoderCommandSet[3]} ${aEncoderCommandValue[3]} \
${ParamCommand}"
${aEncoderCommandSet[2]} ${aEncoderCommandValue[2]} \
-lconfig 0 layer0.cfg -lconfig 1 layer1.cfg -lconfig 2 layer2.cfg -lconfig 3 layer3.cfg \
${aEncoderCommandSet[3]} ${aEncoderCommandValue[3]} \
${ParamCommand}"
echo ""
echo "---------------Encode One Case-------------------------------------------"
echo "case line is :"
EncoderCommand="./h264enc welsenc.cfg ${ParamCommand} -bf ${BitStreamFile} \
-drec 0 ${aRecYUVFileList[0]} -drec 1 ${aRecYUVFileList[1]} \
-drec 2 ${aRecYUVFileList[2]} -drec 3 ${aRecYUVFileList[3]} \
-org ${TestSequencePath}/${TestSequenceName}"
-drec 0 ${aRecYUVFileList[0]} -drec 1 ${aRecYUVFileList[1]} \
-drec 2 ${aRecYUVFileList[2]} -drec 3 ${aRecYUVFileList[3]} \
-org ${TestSequencePath}/${TestSequenceName}"
echo ${EncoderCommand}
echo -e "\n\n"
./h264enc welsenc.cfg ${ParamCommand} -bf ${BitStreamFile} \
-drec 0 ${aRecYUVFileList[0]} -drec 1 ${aRecYUVFileList[1]} \
-drec 2 ${aRecYUVFileList[2]} -drec 3 ${aRecYUVFileList[3]} \
-org ${TestSequencePath}/${TestSequenceName} 2>${EncoderLogFile}
-drec 0 ${aRecYUVFileList[0]} -drec 1 ${aRecYUVFileList[1]} \
-drec 2 ${aRecYUVFileList[2]} -drec 3 ${aRecYUVFileList[3]} \
-org ${TestSequencePath}/${TestSequenceName} 2>${EncoderLogFile}
if [ $? -eq 0 ]
then
let "EncoderFlag=0"
let "EncoderFlag=0"
else
let "EncoderFlag=1"
let "EncoderFlag=1"
fi
#delete the core down file as core down files for disk space limitation
for file in ./core*
do
if [ -e ${file} ]
then
./run_SafeDelete.sh ${file}
fi
if [ -e ${file} ]
then
./run_SafeDelete.sh ${file}
fi
done
return 0
}