if(src->motion_val[0] && src->motion_val[0] != dst->motion_val[0]){ if(src->motion_subsample_log2 != dst->motion_subsample_log2) av_log(s->avctx, AV_LOG_ERROR, "AVFrame.motion_subsample_log2 doesnt match!\n"); else{ int stride= ((16*s->mb_width )>>src->motion_subsample_log2) + 1; int height= ((16*s->mb_height)>>src->motion_subsample_log2);  for(i=0; i<2; i++) memcpy(dst->motion_val[i], src->motion_val[i], stride*height*sizeof(int16_t)); } }
static void copy_picture_attributes(AVFrame *dst, AVFrame *src){    dst->pict_type              = src->pict_type;    dst->quality                = src->quality;    dst->coded_picture_number   = src->coded_picture_number;    dst->display_picture_number = src->display_picture_number;//    dst->reference              = src->reference;    dst->pts                    = src->pts;    dst->interlaced_frame       = src->interlaced_frame;    dst->top_field_first        = src->top_field_first;}