if(h->slice_type == B_TYPE && h->pps.cabac){ if(IS_8X8(mb_type)){ h->direct_table[b8_xy+1+0*h->b8_stride] = IS_DIRECT(h->sub_mb_type[1]) ? 1 : 0; h->direct_table[b8_xy+0+1*h->b8_stride] = IS_DIRECT(h->sub_mb_type[2]) ? 1 : 0; h->direct_table[b8_xy+1+1*h->b8_stride] = IS_DIRECT(h->sub_mb_type[3]) ? 1 : 0; } }
static inline void write_back_motion(H264Context *h, int mb_type){    MpegEncContext * const s = &h->s;    const int b_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;    const int b8_xy= 2*s->mb_x + 2*s->mb_y*h->b8_stride;    int list;    for(list=0; list<2; list++){        int y;        if((!IS_8X8(mb_type)) && !USES_LIST(mb_type, list)){            if(1){ //FIXME skip or never read if mb_type doesnt use it                for(y=0; y<4; y++){                    *(uint64_t*)s->current_picture.motion_val[list][b_xy + 0 + y*h->b_stride]=                    *(uint64_t*)s->current_picture.motion_val[list][b_xy + 2 + y*h->b_stride]= 0;                }                if( h->pps.cabac ) {                    /* FIXME needed ? */                    for(y=0; y<4; y++){                        *(uint64_t*)h->mvd_table[list][b_xy + 0 + y*h->b_stride]=                        *(uint64_t*)h->mvd_table[list][b_xy + 2 + y*h->b_stride]= 0;                    }                }                for(y=0; y<2; y++){                    *(uint16_t*)&s->current_picture.ref_index[list][b8_xy + y*h->b8_stride]= (LIST_NOT_USED&0xFF)*0x0101;                }            }            continue; //FIXME direct mode ...        }                for(y=0; y<4; y++){            *(uint64_t*)s->current_picture.motion_val[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+0 + 8*y];            *(uint64_t*)s->current_picture.motion_val[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mv_cache[list][scan8[0]+2 + 8*y];        }        if( h->pps.cabac ) {            for(y=0; y<4; y++){                *(uint64_t*)h->mvd_table[list][b_xy + 0 + y*h->b_stride]= *(uint64_t*)h->mvd_cache[list][scan8[0]+0 + 8*y];                *(uint64_t*)h->mvd_table[list][b_xy + 2 + y*h->b_stride]= *(uint64_t*)h->mvd_cache[list][scan8[0]+2 + 8*y];            }        }        for(y=0; y<2; y++){            s->current_picture.ref_index[list][b8_xy + 0 + y*h->b8_stride]= h->ref_cache[list][scan8[0]+0 + 16*y];            s->current_picture.ref_index[list][b8_xy + 1 + y*h->b8_stride]= h->ref_cache[list][scan8[0]+2 + 16*y];        }    }}