comparison h264.c @ 5774:e71de81878c4 libavcodec

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
author andoma
date Thu, 04 Oct 2007 06:53:12 +0000
parents e3d7a78e2df3
children c4984d69d373
comparison
equal deleted inserted replaced
5773:e3d7a78e2df3 5774:e71de81878c4
3222 3222
3223 return pic; 3223 return pic;
3224 } 3224 }
3225 3225
3226 /** 3226 /**
3227 * Remove a picture from the long term reference list by its index in
3228 * that list. This does no checking on the provided index; it is assumed
3229 * to be valid. The removed entry is set to NULL. Other entries are unaffected.
3230 * @param i index into h->long_ref of picture to remove.
3231 */
3232 static void remove_long_at_index(H264Context *h, int i){
3233 h->long_ref[i]= NULL;
3234 h->long_ref_count--;
3235 }
3236
3237 /**
3227 * 3238 *
3228 * @return the removed picture or NULL if an error occurs 3239 * @return the removed picture or NULL if an error occurs
3229 */ 3240 */
3230 static Picture * remove_long(H264Context *h, int i){ 3241 static Picture * remove_long(H264Context *h, int i){
3231 Picture *pic; 3242 Picture *pic;
3232 3243
3233 pic= h->long_ref[i]; 3244 pic= h->long_ref[i];
3234 h->long_ref[i]= NULL; 3245 if (pic)
3235 if(pic) h->long_ref_count--; 3246 remove_long_at_index(h, i);
3236 3247
3237 return pic; 3248 return pic;
3238 } 3249 }
3239 3250
3240 /** 3251 /**