28 #define MAX_SPS_COUNT 32
29 #define MAX_PPS_COUNT 256
34 int sps = 0, pps = 0,
idr = 0, res = 0, sli = 0;
38 unsigned pps_id, sps_id;
41 for (i = 0; i + 2 < p->
buf_size; i++) {
42 code = (code << 8) + p->
buf[i];
43 if ((code & 0xffffff00) == 0x100) {
44 int ref_idc = (code >> 5) & 3;
45 int type = code & 0x1F;
46 static const int8_t ref_zero[] = {
47 2, 0, 0, 0, 0, -1, 1, -1,
48 -1, 1, 1, 1, 1, -1, 2, 2,
49 2, 2, 2, 0, 2, 2, 2, 2,
50 2, 2, 2, 2, 2, 2, 2, 2
56 if (ref_zero[type] == 1 && ref_idc)
58 if (ref_zero[type] == -1 && !ref_idc)
60 if (ref_zero[type] == 2) {
61 if (!(code == 0x100 && !p->
buf[i + 1] && !p->
buf[i + 2]))
104 if (!sps_ids[sps_id])
112 ff_tlog(
NULL,
"sps:%d pps:%d idr:%d sli:%d res:%d\n", sps, pps,
idr, sli, res);
114 if (sps && pps && (
idr || sli > 3) && res < (sps + pps +
idr))
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define FF_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)
static void idr(H264Context *h)
instantaneous decoder refresh.
bitstream reader API header.
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.
static unsigned get_ue_golomb_long(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static void skip_bits(GetBitContext *s, int n)
This structure contains the data a format has to probe a file.
common internal api header.