mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
Reorganize long reference management to minimize code duplication in upcoming PAFF implementation.
patch by Jeff Downs, heydowns a borg d com original thread: Subject: [FFmpeg-devel] [PATCH] Implement PAFF in H.264 Date: 18/09/07 20:30 Originally committed as revision 10665 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
3a22d7fa1f
commit
24231e4cf6
@ -3223,6 +3223,17 @@ static Picture * remove_short(H264Context *h, int frame_num){
|
|||||||
return pic;
|
return pic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove a picture from the long term reference list by its index in
|
||||||
|
* that list. This does no checking on the provided index; it is assumed
|
||||||
|
* to be valid. The removed entry is set to NULL. Other entries are unaffected.
|
||||||
|
* @param i index into h->long_ref of picture to remove.
|
||||||
|
*/
|
||||||
|
static void remove_long_at_index(H264Context *h, int i){
|
||||||
|
h->long_ref[i]= NULL;
|
||||||
|
h->long_ref_count--;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the removed picture or NULL if an error occurs
|
* @return the removed picture or NULL if an error occurs
|
||||||
@ -3231,8 +3242,8 @@ static Picture * remove_long(H264Context *h, int i){
|
|||||||
Picture *pic;
|
Picture *pic;
|
||||||
|
|
||||||
pic= h->long_ref[i];
|
pic= h->long_ref[i];
|
||||||
h->long_ref[i]= NULL;
|
if (pic)
|
||||||
if(pic) h->long_ref_count--;
|
remove_long_at_index(h, i);
|
||||||
|
|
||||||
return pic;
|
return pic;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user