29 int sps = 0, pps = 0,
idr = 0, res = 0, sli = 0;
33 code = (code << 8) + p->
buf[i];
34 if ((code & 0xffffff00) == 0x100) {
35 int ref_idc = (code >> 5) & 3;
36 int type = code & 0x1F;
37 static const int8_t ref_zero[] = {
38 2, 0, 0, 0, 0, -1, 1, -1,
39 -1, 1, 1, 1, 1, -1, 2, 2,
40 2, 2, 2, 0, 2, 2, 2, 2,
41 2, 2, 2, 2, 2, 2, 2, 2
47 if (ref_zero[type] == 1 && ref_idc)
49 if (ref_zero[type] == -1 && !ref_idc)
51 if (ref_zero[type] == 2) {
52 if (!(code == 0x100 && !p->
buf[i + 1] && !p->
buf[i + 2]))
64 if (p->
buf[i + 2] & 0x03)
74 ff_tlog(
NULL,
"sps:%d pps:%d idr:%d sli:%d res:%d\n", sps, pps,
idr, sli, res);
76 if (sps && pps && (
idr || sli > 3) && res < (sps + pps +
idr))
#define FF_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)
static int h264_probe(AVProbeData *p)
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
This structure contains the data a format has to probe a file.
static void idr(H264Context *h)
instantaneous decoder refresh.
common internal api header.