You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
lavc/h264: simplify find_unused_picture()
This commit is contained in:
committed by
Clément Bœsch
parent
bcfa8551a1
commit
e5ac554ba7
@@ -254,26 +254,16 @@ fail:
|
|||||||
return (ret < 0) ? ret : AVERROR(ENOMEM);
|
return (ret < 0) ? ret : AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int pic_is_unused(H264Context *h, H264Picture *pic)
|
|
||||||
{
|
|
||||||
if (!pic->f->buf[0])
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int find_unused_picture(H264Context *h)
|
static int find_unused_picture(H264Context *h)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
|
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
|
||||||
if (pic_is_unused(h, &h->DPB[i]))
|
if (!h->DPB[i].f->buf[0])
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (i == H264_MAX_PICTURE_COUNT)
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define IN_RANGE(a, b, size) (((void*)(a) >= (void*)(b)) && ((void*)(a) < (void*)((b) + (size))))
|
#define IN_RANGE(a, b, size) (((void*)(a) >= (void*)(b)) && ((void*)(a) < (void*)((b) + (size))))
|
||||||
|
Reference in New Issue
Block a user