static av_always_inline void write_back_motion(H264Context *h, int mb_type){
    MpegEncContext * const s = &h->s;
    const int b_stride = h->b_stride;
    const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; //try mb2b(8)_xy
    const int b8_xy= 4*h->mb_xy;

    if(USES_LIST(mb_type, 0)){
        write_back_motion_list(h, s, b_stride, b_xy, b8_xy, mb_type, 0);
    }else{
        fill_rectangle(&s->current_picture.ref_index[0][b8_xy], 2, 2, 2, (uint8_t)LIST_NOT_USED, 1);
    }
    if(USES_LIST(mb_type, 1)){
        write_back_motion_list(h, s, b_stride, b_xy, b8_xy, mb_type, 1);
    }

    if(h->slice_type_nos == AV_PICTURE_TYPE_B && CABAC){
        if(IS_8X8(mb_type)){
            uint8_t *direct_table = &h->direct_table[4*h->mb_xy];
            direct_table[1] = h->sub_mb_type[1]>>1;
            direct_table[2] = h->sub_mb_type[2]>>1;
            direct_table[3] = h->sub_mb_type[3]>>1;
        }
    }
}