/* Remove a picture from the long term reference list by its index in that list.  */
static Picture* remove_long(H264Context *h, int i, int ref_mask)
/* Remove a picture from the long term reference list by its index in that list.  */
static Picture* remove_long(H264Context *h, int i, int ref_mask)
{
        if(unreference_pic(h, pic, ref_mask)){
            assert(h->long_ref[i]->long_ref == 1);
            h->long_ref[i]->long_ref= 0;
            h->long_ref[i]= NULL;
            h->long_ref_count--;
        }
    }
    return pic;
}