MCPcopy Create free account
hub / github.com/cisco/openh264 / CheckLine

Function CheckLine

codec/processing/src/scrolldetection/ScrollDetectionFuncs.cpp:37–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35#include "ls_defines.h"
36
37WELSVP_NAMESPACE_BEGIN
38
39int32_t CheckLine (uint8_t* pData, int32_t iWidth) {
40 int32_t iQualified = 0;
41 int32_t iColorMap[8] = {0};
42 int32_t iChangedTimes = 0;
43 int32_t iColorCounts = 0;
44
45 RECORD_COLOR (pData[0], iColorMap);
46
47 for (int32_t i = 1; i < iWidth; i++) {
48 RECORD_COLOR (pData[i], iColorMap);
49 iChangedTimes += (pData[i] != pData[i - 1]);
50 }
51 for (int32_t i = 0; i < 8; i++)
52 for (int32_t j = 0; j < 32; j++)
53 iColorCounts += ((iColorMap[i] >> j) & 1);
54
55 switch (iColorCounts) {
56 case 1:
57 iQualified = 0;
58 break;
59 case 2:
60 case 3:
61 iQualified = (iChangedTimes > 3);
62 break;
63 default:
64 iQualified = 1;
65 break;
66 }
67 return iQualified;
68}
69
70int32_t SelectTestLine (uint8_t* pY, int32_t iWidth, int32_t iHeight, int32_t iPicHeight,
71 int32_t iStride, int32_t iOffsetX, int32_t iOffsetY) {

Callers 1

SelectTestLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected