| 116 | } |
| 117 | |
| 118 | static inline int32_t CompareFrameNum (int32_t iFrameNumA, int32_t iFrameNumB, int32_t iMaxFrameNumPlus1) { |
| 119 | int64_t iNumA, iNumB, iDiffAB, iDiffMin; |
| 120 | if (iFrameNumA > iMaxFrameNumPlus1 || iFrameNumB > iMaxFrameNumPlus1) { |
| 121 | return -2; |
| 122 | } |
| 123 | #define WelsAbsDiffInt64(a,b) ( (a) > (b) )?( a - b ):( b - a ) |
| 124 | |
| 125 | iDiffAB = WelsAbsDiffInt64 ((int64_t) (iFrameNumA), (int64_t) (iFrameNumB)); |
| 126 | |
| 127 | iDiffMin = iDiffAB; |
| 128 | if (iDiffMin == 0) { |
| 129 | return FRAME_NUM_EQUAL; |
| 130 | } |
| 131 | |
| 132 | iNumA = WelsAbsDiffInt64 ((int64_t) (iFrameNumA + iMaxFrameNumPlus1), (int64_t) (iFrameNumB)); |
| 133 | if (iNumA == 0) { |
| 134 | return FRAME_NUM_EQUAL; |
| 135 | } else if (iDiffMin > iNumA) { |
| 136 | return FRAME_NUM_BIGGER; |
| 137 | } |
| 138 | |
| 139 | iNumB = WelsAbsDiffInt64 ((int64_t) (iFrameNumB + iMaxFrameNumPlus1), (int64_t) (iFrameNumA)); |
| 140 | if (iNumB == 0) { |
| 141 | return FRAME_NUM_EQUAL; |
| 142 | } else if (iDiffMin > iNumB) { |
| 143 | return FRAME_NUM_SMALLER; |
| 144 | } |
| 145 | |
| 146 | return (iFrameNumA > iFrameNumB) ? (FRAME_NUM_BIGGER) : (FRAME_NUM_SMALLER); |
| 147 | |
| 148 | } |
| 149 | /* |
| 150 | * delete failed mark according LTR recovery pRequest |
| 151 | */ |
no outgoing calls
no test coverage detected