mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-19 19:03:00 +02:00
Move the size of the H264Context delayed_pic array into a #define.
This improves readability by getting rid of some magic numbers. Originally committed as revision 14248 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
+2
-2
@@ -3302,7 +3302,7 @@ static void idr(H264Context *h){
|
|||||||
static void flush_dpb(AVCodecContext *avctx){
|
static void flush_dpb(AVCodecContext *avctx){
|
||||||
H264Context *h= avctx->priv_data;
|
H264Context *h= avctx->priv_data;
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i<16; i++) {
|
for(i=0; i<MAX_DELAYED_PIC_COUNT; i++) {
|
||||||
if(h->delayed_pic[i])
|
if(h->delayed_pic[i])
|
||||||
h->delayed_pic[i]->reference= 0;
|
h->delayed_pic[i]->reference= 0;
|
||||||
h->delayed_pic[i]= NULL;
|
h->delayed_pic[i]= NULL;
|
||||||
@@ -7836,7 +7836,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
pics = 0;
|
pics = 0;
|
||||||
while(h->delayed_pic[pics]) pics++;
|
while(h->delayed_pic[pics]) pics++;
|
||||||
|
|
||||||
assert(pics+1 < sizeof(h->delayed_pic) / sizeof(h->delayed_pic[0]));
|
assert(pics <= MAX_DELAYED_PIC_COUNT);
|
||||||
|
|
||||||
h->delayed_pic[pics++] = cur;
|
h->delayed_pic[pics++] = cur;
|
||||||
if(cur->reference == 0)
|
if(cur->reference == 0)
|
||||||
|
|||||||
+3
-1
@@ -51,6 +51,8 @@
|
|||||||
|
|
||||||
#define MAX_MMCO_COUNT 66
|
#define MAX_MMCO_COUNT 66
|
||||||
|
|
||||||
|
#define MAX_DELAYED_PIC_COUNT 16
|
||||||
|
|
||||||
/* Compiling in interlaced support reduces the speed
|
/* Compiling in interlaced support reduces the speed
|
||||||
* of progressive decoding by about 2%. */
|
* of progressive decoding by about 2%. */
|
||||||
#define ALLOW_INTERLACE
|
#define ALLOW_INTERLACE
|
||||||
@@ -334,7 +336,7 @@ typedef struct H264Context{
|
|||||||
Picture ref_list[2][48]; /**< 0..15: frame refs, 16..47: mbaff field refs.
|
Picture ref_list[2][48]; /**< 0..15: frame refs, 16..47: mbaff field refs.
|
||||||
Reordered version of default_ref_list
|
Reordered version of default_ref_list
|
||||||
according to picture reordering in slice header */
|
according to picture reordering in slice header */
|
||||||
Picture *delayed_pic[18]; //FIXME size?
|
Picture *delayed_pic[MAX_DELAYED_PIC_COUNT+2]; //FIXME size?
|
||||||
Picture *delayed_output_pic;
|
Picture *delayed_output_pic;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user