00001 00002 static XvMCSurface* findPastSurface(MpegEncContext *s, 00003 xvmc_render_state_t *render) 00004 { 00005 Picture *lastp = s->last_picture_ptr; 00006 xvmc_render_state_t *last = NULL; 00007 00008 if (NULL!=lastp) { 00009 last = (xvmc_render_state_t*)(lastp->data[2]); 00010 if (B_TYPE==last->pict_type) 00011 { 00012 last = NULL; 00013 av_log(s->avctx, AV_LOG_ERROR, "Past frame is a B frame in findPastSurface\n"); 00014 } 00015 //assert(B_TYPE!=last->pict_type); 00016 } 00017 00018 if (NULL==last) 00019 if (!s->first_field) 00020 last = render; // predict second field from the first 00021 else 00022 return 0; 00023 00024 if (last->magic != MP_XVMC_RENDER_MAGIC) 00025 return 0; 00026 00027 return (last->state & MP_XVMC_STATE_PREDICTION) ? last->p_surface : 0; 00028 } 00029 00030 static XvMCSurface* findFutureSurface(MpegEncContext *s) 00031 { 00032 Picture *nextp = s->next_picture_ptr; 00033 xvmc_render_state_t *next = NULL; 00034 00035 if (NULL!=nextp) { 00036 next = (xvmc_render_state_t*)(nextp->data[2]); 00037 if (B_TYPE==next->pict_type) 00038 { 00039 next = NULL; 00040 av_log(s->avctx, AV_LOG_ERROR, "Next frame is a B frame in findFutureSurface\n"); 00041 } 00042 //assert(B_TYPE!=next->pict_type); 00043 } 00044 00045 if (NULL==next) 00046 return 0; 00047 00048 //assert(NULL!=next); 00049 00050 if (next->magic != MP_XVMC_RENDER_MAGIC) 00051 return 0; 00052 00053 return (next->state & MP_XVMC_STATE_PREDICTION) ? next->p_surface : 0; 00054 } 00055
1.5.5