/*! ************************************************************************ * \brief * Returns inter-view prediction pic with given targetViewID * ************************************************************************ */ static StorablePicture* get_inter_view_pic(VideoParameters *p_Vid, Slice *currSlice, int targetViewID, int currPOC, int listidx) { unsigned i; unsigned int listinterview_size; FrameStore **fs_listinterview; if (listidx == 0) { fs_listinterview = currSlice->fs_listinterview0; listinterview_size = currSlice->listinterviewidx0; } else { fs_listinterview = currSlice->fs_listinterview1; listinterview_size = currSlice->listinterviewidx1; } for(i=0; i<listinterview_size; i++) { if (fs_listinterview[i]->layer_id == GetVOIdx( p_Vid, targetViewID )) { if(p_Vid->structure==FRAME && fs_listinterview[i]->frame->poc == currPOC) { return fs_listinterview[i]->frame; } else if(p_Vid->structure==TOP_FIELD && fs_listinterview[i]->top_field->poc == currPOC) { return fs_listinterview[i]->top_field; } else if(p_Vid->structure==BOTTOM_FIELD && fs_listinterview[i]->bottom_field->poc == currPOC) { return fs_listinterview[i]->bottom_field; } } } return NULL; }
/*! ************************************************************************ * \brief * Reordering process for MVC reference picture lists * ************************************************************************ */ void reorder_ref_pic_list_mvc(Slice *currSlice, int cur_list, int **anchor_ref, int **non_anchor_ref, int view_id, int anchor_pic_flag, int currPOC, int listidx) { VideoParameters *p_Vid = currSlice->p_Vid; int *reordering_of_pic_nums_idc = currSlice->reordering_of_pic_nums_idc[cur_list]; int *abs_diff_pic_num_minus1 = currSlice->abs_diff_pic_num_minus1[cur_list]; int *long_term_pic_idx = currSlice->long_term_pic_idx[cur_list]; int num_ref_idx_lX_active_minus1 = currSlice->num_ref_idx_active[cur_list] - 1; int *abs_diff_view_idx_minus1 = currSlice->abs_diff_view_idx_minus1[cur_list]; int i; int maxPicNum, currPicNum, picNumLXNoWrap, picNumLXPred, picNumLX; int picViewIdxLX, targetViewID; int refIdxLX = 0; int maxViewIdx =0; int curr_VOIdx = -1; int picViewIdxLXPred=-1; if (p_Vid->structure==FRAME) { maxPicNum = p_Vid->MaxFrameNum; currPicNum = currSlice->frame_num; } else { maxPicNum = 2 * p_Vid->MaxFrameNum; currPicNum = 2 * currSlice->frame_num + 1; } if(currSlice->svc_extension_flag==0) { curr_VOIdx = GetVOIdx(p_Vid, view_id); maxViewIdx = get_maxViewIdx(p_Vid, view_id, anchor_pic_flag, 0); picViewIdxLXPred=-1; } picNumLXPred = currPicNum; for (i=0; reordering_of_pic_nums_idc[i]!=3; i++) { if (reordering_of_pic_nums_idc[i] > 5) error ("Invalid remapping_of_pic_nums_idc command", 500); if (reordering_of_pic_nums_idc[i] < 2) { if (reordering_of_pic_nums_idc[i] == 0) { if( picNumLXPred - ( abs_diff_pic_num_minus1[i] + 1 ) < 0 ) picNumLXNoWrap = picNumLXPred - ( abs_diff_pic_num_minus1[i] + 1 ) + maxPicNum; else picNumLXNoWrap = picNumLXPred - ( abs_diff_pic_num_minus1[i] + 1 ); } else // (remapping_of_pic_nums_idc[i] == 1) { if( picNumLXPred + ( abs_diff_pic_num_minus1[i] + 1 ) >= maxPicNum ) picNumLXNoWrap = picNumLXPred + ( abs_diff_pic_num_minus1[i] + 1 ) - maxPicNum; else picNumLXNoWrap = picNumLXPred + ( abs_diff_pic_num_minus1[i] + 1 ); } picNumLXPred = picNumLXNoWrap; if( picNumLXNoWrap > currPicNum ) picNumLX = picNumLXNoWrap - maxPicNum; else picNumLX = picNumLXNoWrap; reorder_short_term(currSlice, cur_list, num_ref_idx_lX_active_minus1, picNumLX, &refIdxLX, view_id); } else if (reordering_of_pic_nums_idc[i] == 2) //(remapping_of_pic_nums_idc[i] == 2) { reorder_long_term(currSlice, currSlice->listX[cur_list], num_ref_idx_lX_active_minus1, long_term_pic_idx[i], &refIdxLX, view_id); } else { if(reordering_of_pic_nums_idc[i] == 4) //(remapping_of_pic_nums_idc[i] == 4) { picViewIdxLX = picViewIdxLXPred - (abs_diff_view_idx_minus1[i] + 1); if( picViewIdxLX <0) picViewIdxLX += maxViewIdx; } else //(remapping_of_pic_nums_idc[i] == 5) { picViewIdxLX = picViewIdxLXPred + (abs_diff_view_idx_minus1[i] + 1); if( picViewIdxLX >= maxViewIdx) picViewIdxLX -= maxViewIdx; } picViewIdxLXPred = picViewIdxLX; if (anchor_pic_flag) targetViewID = anchor_ref[curr_VOIdx][picViewIdxLX]; else targetViewID = non_anchor_ref[curr_VOIdx][picViewIdxLX]; reorder_interview(p_Vid, currSlice, currSlice->listX[cur_list], num_ref_idx_lX_active_minus1, picViewIdxLX, &refIdxLX, targetViewID, currPOC, listidx); } } // that's a definition currSlice->listXsize[cur_list] = (char) (num_ref_idx_lX_active_minus1 + 1); }