memmove(&h->long_ref[i], &h->long_ref[i+1], (h->long_ref_count - i - 1)*sizeof(Picture*)); h->long_ref_count--;
if(pic) h->long_ref_count--;
static Picture * remove_long(H264Context *h, int i){    Picture *pic;    if(i >= h->long_ref_count) return NULL;    pic= h->long_ref[i];    if(pic==NULL) return NULL;        h->long_ref[i]= NULL;    memmove(&h->long_ref[i], &h->long_ref[i+1], (h->long_ref_count - i - 1)*sizeof(Picture*));    h->long_ref_count--;    return pic;}