Esempio n. 1
0
/**
When all slice are decoded, we execute the MMO operation and the loop filter, and the display management.
*/
void FinishFrame(SPS *Sps, PPS *Pps, LIST_MMO *Current_pic, SLICE *Slice, int EndOfSlice, unsigned char *SliceTab, DATA *TabBlbock, 
				 RESIDU *Residu, short *MvL0, short *MvL1, short *RefL0, short *RefL1, int *Crop, int *ImgToDisplay, DISPLAY_M* display_memory, 
				 MMO *Mmo, unsigned char *RefY, unsigned char *RefU, unsigned char *RefV, int *xsize, int *ysize)
{


	if (!EndOfSlice){
		unsigned int PicWidthInPix = (Sps -> pic_width_in_mbs + 2) << 4   ;
		unsigned int PicHeightInPix = (Sps -> pic_height_in_map_units ) << 4 ;
		unsigned char *Y = Current_pic->picture_memory_y;
		unsigned char *U = Current_pic->picture_memory_u;
		unsigned char *V = Current_pic->picture_memory_v;

		//Short and long term management
		execute_ref_pic_marking(Sps,Mmo,0,0);

		if( Slice -> disable_deblocking_filter_idc != 1){
			//Deblocking filter if necessary
			filter_P(Sps, Pps, Slice, SliceTab, MvL0, RefL0, Residu, Y, U, V);
		}

		//Padding for motion interpolation
		ImageSetEdges(Y, U, V, PicWidthInPix, PicHeightInPix);

		//Display managment.
		display_order(Sps, Current_pic, display_memory, xsize, ysize, Crop, ImgToDisplay, Mmo);
	}
}
Esempio n. 2
0
/**
Used when error has been detected into a slice, to execute the MMO operation and the display management
*/
void FinishFrameError(SPS *sps_id, LIST_MMO *Current_pic, int *Crop, int *ImgToDisplay, DISPLAY_M* display_memory, 
				 MMO *Mmo, int *xsize, int *ysize){

	//Short and long term management
	execute_ref_pic_marking(sps_id,Mmo,0,0);

	//Display managment.
	display_order(sps_id, Current_pic, display_memory, xsize, ysize, Crop, ImgToDisplay, Mmo);
}
Esempio n. 3
0
/**
Used when error has been detected into a slice, to execute the MMO operation and the display management
*/
void FinishFrameSVCError(int Execute, NAL *Nal, SPS *StructSPS, PPS *Pps, LIST_MMO *Current_pic, int *Crop, 
						 int *ImgToDisplay, int *AdressPic, MMO *Mmo, int *xsize, int *ysize)
{

	int pic_parameter_set_id = Nal -> pic_parameter_id [Nal -> LayerId];
	SPS *sps_id = &StructSPS[Pps[pic_parameter_set_id] . seq_parameter_set_id + (Nal -> LayerId ? 16: 0)];


	//Sps must be defined
	if(Execute){
		//Short and long term management
		execute_ref_pic_marking(Current_pic, Mmo, Nal -> LayerId);
	}

	//Display managment.
	DisplayOrderSvc(sps_id, Current_pic, Nal, AdressPic, xsize, ysize, Crop, ImgToDisplay, Mmo);
}
Esempio n. 4
0
/**
Used when error has been detected into a slice, to execute the MMO operation and the display management
*/
void FinishFrameSVCError(int Execute, NAL *Nal, SPS *StructSPS, PPS *Pps, LIST_MMO *Current_pic, int *Crop, 
						 int *ImgToDisplay, DISPLAY_M * display_memory, MMO *Mmo, int *xsize, int *ysize)
{
	SPS *sps_id;
	int pic_parameter_set_id;

	pic_parameter_set_id = Nal -> pic_parameter_id [Nal -> LayerId];
	sps_id = &StructSPS[Pps[pic_parameter_set_id] . seq_parameter_set_id + (Nal -> LayerId ? 16: 0)];


	//Sps must be defined
	if(Execute){
		//Short and long term management
		int baseLayerId = GetLayerNumber(Nal,Nal->DqId>>4<<4);
		int highDQId = Nal->DqId < Nal->DqIdToDisplay ? Nal->DqId:Nal->DqIdToDisplay;
		int highLayerId = GetLayerNumber(Nal,highDQId);
		execute_ref_pic_marking(StructSPS,Mmo,baseLayerId,highLayerId);
	}

	//Display managment.
	DisplayOrderSvc(NULL, display_memory, xsize, ysize, Crop, ImgToDisplay, Mmo);
}
Esempio n. 5
0
/**
This function applies the deblocking filter if necessary and stores the decoded pictures.
*/
void FinishFrameSVC(const int NbMacro, NAL *Nal, SPS *Sps, PPS *Pps, LIST_MMO *Current_pic, SLICE *Slice, int EndOfSlice, 
					unsigned char *SliceTab, DATA *TabBlbock, RESIDU *Residu, short *MvL0, short *MvL1, short *RefL0, 
					short *RefL1, int *Crop, int *ImgToDisplay, int *AdressPic, MMO *Mmo,  
					unsigned char *RefY, unsigned char *RefU, unsigned char *RefV, int *xsize, int *ysize)
{


	if (!EndOfSlice && Mmo -> MemoryAllocation){
		//Short and long term management
		execute_ref_pic_marking(Current_pic, Mmo, Nal -> LayerId);

		if ( Nal -> PicToDisplay){
			const int PicWidthInPix = (Sps -> pic_width_in_mbs + 2) << 4;
			const int PicHeightInPix = (Sps -> pic_height_in_map_units ) << 4;
			short *mvL0 = &MvL0[Current_pic -> MvMemoryAddress];
			short *mvL1 = &MvL1[Current_pic -> MvMemoryAddress];
			short *refL0 = &RefL0[Current_pic -> MvMemoryAddress >> 1];
			short *refL1 = &RefL1[Current_pic -> MvMemoryAddress >> 1];
			unsigned char *Y = &RefY[Current_pic -> MemoryAddress];
			unsigned char *U = &RefU[Current_pic -> MemoryAddress >> 2];
			unsigned char *V = &RefV[Current_pic -> MemoryAddress >> 2];

			//Deblocking filter
			if (!Nal -> DqId){
				Loop_filter_avc(NbMacro, 0, Sps, Pps, Slice, Current_pic, SliceTab, TabBlbock, mvL0, mvL1, refL0, refL1, Residu, Y, U, V);
			}else {
				Loop_filter_svc(NbMacro, Nal, Sps, Pps, Slice, Current_pic, SliceTab, mvL0, mvL1, refL0, refL1, Residu, Y, U, V);
			}

			//Padding for motion interpolation
			ImageSetEdges(Y, U, V, PicWidthInPix, PicHeightInPix);
		}

		//Display managment.
		DisplayOrderSvc(Sps, Current_pic, Nal, AdressPic, xsize, ysize, Crop, ImgToDisplay, Mmo);
	}else {