1#!/bin/bash 2#******************************************************************************* 3# Encoder binary comparison test model 4# -- Compared with benchmark version using SHA-1 string 5# -- Test bit stream under folder openh264/res 6# -- SHA-1 string of benchmark version for all cases of all bit streams 7# under folder openh264/test/encoder_binary_comparion/SHA1Table 8# -- For more detail,please refer to file AboutTest. 9# 10#brief: 11# -- Parse sequence basic info such as picw pich and fps via name 12# -- Usage: run_ParseYUVInfo.sh ${TestSequenceName} 13# 14# date: 10/06/2014 Created 15#******************************************************************************* 16#usage runGetYUVInfo $TestSequenceName 17#eg. input: ABC_1920X1080_30fps_XXX.yuv output: 1920 1080 30 18#eg. input: ABC_1920X1080_XXX.yuv output: 1920 1080 0 19#eg. input: ABC_XXX.yuv output: 0 0 0 20runGetYUVInfo() 21{ 22 if [ ! $# -eq 1 ] 23 then 24 echo "runGetYUVInfo \$TestSequenceName" 25 echo "detected by run_ParseYUVInfo.sh" 26 return 1 27 fi 28 29 local SequenceName=$1 30 local PicWidth="0" 31 local PicHeight="0" 32 local FPS="0" 33 declare -a aPicInfo 34 aPicInfo=(`echo ${SequenceName} | awk 'BEGIN {FS="[_.]"} {for(i=1;i<=NF;i++) printf("%s ",$i)}'`) 35 local Iterm 36 local Index="" 37 local Pattern_01="[xX]" 38 local Pattern_02="^[1-9][0-9]" 39 local Pattern_03="[0-9][0-9]$" 40 local Pattern_04="fps$" 41 #get PicW PicH info 42 let "Index=0" 43 for Iterm in ${aPicInfo[@]} 44 do 45 if [[ $Iterm =~ $Pattern_01 ]] && [[ $Iterm =~ $Pattern_02 ]] && [[ $Iterm =~ $Pattern_03 ]] 46 then 47 PicWidth=`echo $Iterm | awk 'BEGIN {FS="[xX]"} {print $1}'` 48 PicHeight=`echo $Iterm | awk 'BEGIN {FS="[xX]"} {print $2}'` 49 break 50 fi 51 let "Index++" 52 done 53 #get fps info 54 let "Index++" 55 if [ $Index -le ${#aPicInfo[@]} ] 56 then 57 if [[ ${aPicInfo[$Index]} =~ ^[1-9] ]] || [[ ${aPicInfo[$Index]} =~ $Pattern_04 ]] 58 then 59 FPS=`echo ${aPicInfo[$Index]} | awk 'BEGIN {FS="[a-zA-Z]" } {print $1} '` 60 fi 61 fi 62 echo "$PicWidth $PicHeight $FPS" 63} 64TestSequenceName=$1 65runGetYUVInfo ${TestSequenceName} 66 67 68