| 933 | #endif |
| 934 | |
| 935 | const uint8_t *avpriv_find_start_code(const uint8_t *restrict p, |
| 936 | const uint8_t *end, |
| 937 | uint32_t *restrict state) |
| 938 | { |
| 939 | int i; |
| 940 | |
| 941 | av_assert0(p <= end); |
| 942 | if (p >= end) |
| 943 | return end; |
| 944 | |
| 945 | for (i = 0; i < 3; i++) { |
| 946 | uint32_t tmp = *state << 8; |
| 947 | *state = tmp + *(p++); |
| 948 | if (tmp == 0x100 || p == end) |
| 949 | return p; |
| 950 | } |
| 951 | |
| 952 | while (p < end) { |
| 953 | if (p[-1] > 1 ) p += 3; |
| 954 | else if (p[-2] ) p += 2; |
| 955 | else if (p[-3]|(p[-1]-1)) p++; |
| 956 | else { |
| 957 | p++; |
| 958 | break; |
| 959 | } |
| 960 | } |
| 961 | |
| 962 | p = FFMIN(p, end) - 4; |
| 963 | *state = AV_RB32(p); |
| 964 | |
| 965 | return p + 4; |
| 966 | } |
| 967 | |
| 968 | AVCPBProperties *av_cpb_properties_alloc(size_t *size) |
| 969 | { |
no outgoing calls
no test coverage detected