亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? motion_est_core_2_optimized.c

?? 基于Linux的ffmepg decoder
?? C
?? 第 1 頁 / 共 5 頁
字號:

	// to set pixel interpolation command , last=1 (it's last pixel interpolation command), 
	// Chroma= 1 (select chrominance (Cb & Cr) component)
	// RADD =(((uint32_t) (REF_U + 32*8)) >> 2) (reference block start address)
	pCodec->ME_command_queue0[64] = ((unsigned int)6<<29) | (((uint32_t) (REF_V + 32*8)) >> 2) | (1<<27) | (1<<28); // add unsigned int to avoid warning
    //----------------------------------------------------------------------------   
    
    
	/************	for next block	********************************/

 	lam_16 = NEIGH_TEND_16X16*lambda_vec16[current1->quant];
 	

	// to set the ME Coefficient Register
    // the MECR register is at address 0x10008.
	SET_MECR(lam_16)
	

	// to set the ME Command Queue start address Register
    // the CMDADDR register is at address 0x10010.
	SET_CMDADDR(ME_COMMAND_QUEUE_ADDR) //SET_CMDADDR(pCodec->ME_command_queue0)	
	

	// to set the ME Current and Result Block start address Register
    // the MECADDR register is at address 0x10014.
	SET_MECADDR(CUR_Y0)
	

	// to set the ME Interpolation Block Start Address Register
    // the MEIADDR register is at address 0x10024.
	SET_MEIADDR(INTER_Y0)

    // what's bit 11 doing??? not documented ...
	X = current1->rounding_type << 2 | 1 << 11 | 1 | 1<<3 | 1<<4;		//	1 << 11 => fcode

	POLL_MARKER_S
	while((pmdma->Status & 0x1) == 0) {}			//	check REFyuv, CURyuv OK
	POLL_MARKER_E
    
    // set the ME Control Register and begin ME engine
    // MECTL register is at 0x10000
    // the X variable is used to set the MECTL register, their correspond setting is as shown below :
	// MBCNT_DIS=0 (not disable MB counter ??? ) , SKIP_PXI=0 (not skip PXI command for decoding...well..looks it is not used in encoder ???)
	// VOP_START=1 (starts VOP layer processing)
	// VPKT_START=1 (starts new Video Packet -- used for resync marker ...asked from James )
	// RND= current->rounding_type (rounding control for pixel interpolation)
	// PXI_1MV=0 (interpolation block size, used for decoding mode)
	// ME_GO=1 (start ME operation)
	SET_MECTL(X)						//		ME GO  ************************
	
	// since we have already prepared the secondary part of DMA commands right in the FrameCodeP(),
    // so we can directly begin to execute the secondary part of DMA command buffer (from 0th to 0+40(0x28)-1=39th)
	DMA_MOVE(DMA_COMMAND_QUEUE_STRIDE, 0x4B00028)  // Enable DMA start transferring
                                                   // Enable chain transfer
                                                   // From sequential Local memory to sequential System memory                            
                                                   // transfer 0x28(40) words
    
    //---------------------------------------------------------------------------
    // let's correct some settings in primary part of DMA double command buffers 
    // because some initial DMA command settings in primary part of DMA command
    // double buffer within FrameCodeP() were just used for moving 
    // the reference image once again. So we should correct those temporary 
    // settings to normal settings.
    //---------------------------------------------------------------------------    
    // You know we disable this command chain for the purpose of moving another
    // reference image again right before MotionEstimation_block0_4MV(),
    // so we eanble the command chain again.
    pDMA1[11] = 0x4A50000 | 48;	
	// let's set the primary of DMA command buffer for reference image location to the right address
	// for DMA double command buffer purpose
	// since we use DMA double buffer, so the increment for Y block of reference image is 512 bytes instead of 256 bytes
	pDMA1[0] = ((uint32_t) pEnc->reference->reconstruct.y - (256*XDIM/16) + 768 | 0x07); // add offset 256*3=768
	// since we use DMA double buffer, so the increment for U block of reference image is 128 bytes instead of 64 bytes
    pDMA1[4] = ((uint32_t) pEnc->reference->reconstruct.u - (64*XDIM/16) + 192 | 0x05); // add offset 64*3=192
    // since we use DMA double buffer, so the increment for V block of reference image is 128 bytes instead of 64 bytes
    pDMA1[8] = ((uint32_t) pEnc->reference->reconstruct.v - (64*XDIM/16) + 192 | 0x05); // add offset 64*3=192
    
    //---------------------------------------------------------------------------
    // let's prepare the primary part of DMA double command buffer here 
    // for MotionEstimation_4MV() since you can see from the RTL simulation that
    // the time that polling ME done take is quite wasteful for 4MV.
    //---------------------------------------------------------------------------
    pDMA1[1] = TRANSLATE_LOCAL_MEMORY_BASE_ADDRESS((uint32_t)REF_Y + 48);
	pDMA1[5] = TRANSLATE_LOCAL_MEMORY_BASE_ADDRESS((uint32_t)REF_U + 24);
	pDMA1[9] = TRANSLATE_LOCAL_MEMORY_BASE_ADDRESS((uint32_t)REF_V + 24);
	

	pDMA1[37] = TRANSLATE_LOCAL_MEMORY_BASE_ADDRESS(LOCAL_PREDICTOR0 + 0x80);	
	pDMA1[40] = pDMA2[36];
	pDMA1[36] = (uint32_t) (pCodec->pred_value_phy + 32);
	
	// make it a chain
	pDMA1[39] = 0x04A42010;  // make it gorup 2, to sync to MC done, since MC must be done before loading the ac dc predictor	  
	


	// make it group ID 1, disable all these DMA commands
    pDMA1[27] = 0x04B01040;
	pDMA1[31] = 0x04B01010;
	pDMA1[35] = 0x04B01010;
	
    // set whether the ME is done or not
    // CPSTS register is at address 0x10028
	POLL_ME_DONE_MARKER_START
	//		CHECK ME IS DONE **************
	do {
	  READ_CPSTS(X)
	} while(!(X&0x01));
	POLL_ME_DONE_MARKER_END
	
	#ifdef DUMP_PMV_RESULT
    if(1) {
      int index_array[20]={ 19,20,21,22, 28,29,30,31, 37,38,39,40, 46,47,48,49, 55,56,57,58 };
      int c;  
      int x_result[20],y_result[20],radd_result[20];
      int32_t sad_value;
      int32_t XX;
      for(c=0;c<20;c++)
        {
          sad_value=pCodec->ME_command_queue0[index_array[c]];
          if(sad_value & (1<<26))
            { // SRC==1
              int src_index=(sad_value>>19)&0x7f;
              XX = (pCodec->ME_command_queue0[src_index+(0)*4]>>12);
              x_result[c]=(XX<<18)>>25;
			  y_result[c]=(XX<<25)>>25;
            }
          else
            { // SRC==0
              XX = (pCodec->ME_command_queue0[index_array[c]]>>12);
              x_result[c]=(XX<<18)>>25;
              y_result[c]=(XX<<25)>>25;
            }
          radd_result[c]=sad_value&0x0fff;
        }
    
      for(c=0;c<20;c+=4)
        {
          #ifdef DUMP_WITH_RADDR
          fprintf(pmv_result_file,"\n");
          fprintf(pmv_result_file,"Left candidate : 0x%04x, 0x%04x (RADDR:0x%04x)\n",x_result[c]&0x07f,y_result[c]&0x07f,radd_result[c]);
          fprintf(pmv_result_file,"Top candidate : 0x%04x, 0x%04x (RADDR:0x%04x)\n",x_result[c+1]&0x07f,y_result[c+1]&0x07f,radd_result[c+1]);
          fprintf(pmv_result_file,"Top-Right candidate : 0x%04x, 0x%04x, (RADDR:0x%04x)\n",x_result[c+2]&0x07f,y_result[c+2]&0x07f,radd_result[c+2]);
          fprintf(pmv_result_file,"Previous MB candidate : 0x%04x, 0x%04x, (RADDR:0x%04x)\n",x_result[c+3]&0x07f,y_result[c+3]&0x07f,radd_result[c+3]);
          #else
          fprintf(pmv_result_file,"\n");
          fprintf(pmv_result_file,"Left candidate : 0x%04x, 0x%04x\n",x_result[c]&0x07f,y_result[c]&0x07f);
          fprintf(pmv_result_file,"Top candidate : 0x%04x, 0x%04x\n",x_result[c+1]&0x07f,y_result[c+1]&0x07f);
          fprintf(pmv_result_file,"Top-Right candidate : 0x%04x, 0x%04x\n",x_result[c+2]&0x07f,y_result[c+2]&0x07f);
          fprintf(pmv_result_file,"Previous MB candidate : 0x%04x, 0x%04x\n",x_result[c+3]&0x07f,y_result[c+3]&0x07f);
          #endif
          
          #if 0
          fprintf(pmv_result_file,"\n");
          fprintf(pmv_result_file,"Left candidate : (RADDR:0x%04x)\n",radd_result[c]);
          fprintf(pmv_result_file,"Top candidate : (RADDR:0x%04x)\n",radd_result[c+1]);
          fprintf(pmv_result_file,"Top-Right candidate : (RADDR:0x%04x)\n",radd_result[c+2]);
          fprintf(pmv_result_file,"Previous MB candidate : (RADDR:0x%04x)\n",radd_result[c+3]);
          #endif
        }
        #if 0
        fprintf(pmv_result_file,"\nFour motion vectors are :\n");
        XX = (pCodec->ME_command_queue0[0]>>12);
        fprintf(pmv_result_file,"0x%04x,0x%04x,",((XX<<18)>>25)& 0x7f,((XX<<25)>>25)&0x7f);
        XX = (pCodec->ME_command_queue0[1]>>12);
        fprintf(pmv_result_file,"0x%04x,0x%04x,",((XX<<18)>>25)& 0x7f,((XX<<25)>>25)&0x7f);
        XX = (pCodec->ME_command_queue0[2]>>12);
        fprintf(pmv_result_file,"0x%04x,0x%04x,",((XX<<18)>>25)& 0x7f,((XX<<25)>>25)&0x7f);
        XX = (pCodec->ME_command_queue0[3]>>12);
        fprintf(pmv_result_file,"0x%04x,0x%04x",((XX<<18)>>25)& 0x7f,((XX<<25)>>25)&0x7f);
        fprintf(pmv_result_file,"\n");
        #endif        
      }
    #endif
	
    // checking bit 7 field (ME_INTRA) of CPSTS register, which indicates 
    // the intra mode or inter mode after motion estimation. 1 means intra mode and 0 means inter mode.
    // CPSTS register is at address 0x10028
	d_type = (X & 0x80);								//		check intra/inter mode
	if (d_type) {
		pCodec->MB_mode = 0;
		pMB->mode = MODE_INTRA;
		pMB->mv16x_0 = 0;
		pMB->mv16y_0 = 0;
		pMB->mv16x_1 = 0;
		pMB->mv16y_1 = 0;
		pMB->mv16x_2 = 0;
		pMB->mv16y_2 = 0;
		pMB->mv16x_3 = 0;
		pMB->mv16y_3 = 0;
	} else {
		pCodec->MB_mode = 1;
		// again, checking bit 6 field (ME_BSIZE) of CPSTS register, which indicates 
        // the 1MV mode or 4MV mode after motion estimation. 1 means 1MV mode and 0 means 4MV mode.
        // CPSTS register is at address 0x10028
		if (X & 64) {
			pMB->mode = MODE_INTER;
		    // it's 1MV mode now 
            // let's get motion vector result from MV0[3]
			X = (pCodec->ME_command_queue0[3]);			
			// store back the motion vector to MV0[1] ??? why ???
			pCodec->ME_command_queue0[1] = X;
			X = X >> 12;
			pMB->mv16x_0 = (X<<18)>>25;
			pMB->mv16y_0 = (X<<25)>>25;
			pMB->mv16x_1 = (X<<18)>>25;
			pMB->mv16y_1 = (X<<25)>>25;
			pMB->mv16x_2 = (X<<18)>>25;
			pMB->mv16y_2 = (X<<25)>>25;
			pMB->mv16x_3 = (X<<18)>>25;
			pMB->mv16y_3 = (X<<25)>>25;
			// Hmm.. it is used in bit 16 of MCCTL control register (at location 0x1001c) to indicate
			// whether current motion vector is zero or not...
			pCodec->MVZ = (X == 0);
		} else {
			pMB->mode = MODE_INTER4V;
			X = (pCodec->ME_command_queue0[0]>>12);
			pMB->mv16x_0 = (X<<18)>>25;
			pMB->mv16y_0 = (X<<25)>>25;
//			*vpe_stop = 0x93000000 | ((pMB->mv16x_0 & 0x7f)<<8) | (pMB->mv16y_0 & 0x7f);
			X = (pCodec->ME_command_queue0[1]>>12);
			pMB->mv16x_1 = (X<<18)>>25;
			pMB->mv16y_1 = (X<<25)>>25;
//			*vpe_stop = 0x93000000 | ((pMB->mv16x_1 & 0x7f)<<8) | (pMB->mv16y_1 & 0x7f);
			X = (pCodec->ME_command_queue0[2]>>12);
			pMB->mv16x_2 = (X<<18)>>25;
			pMB->mv16y_2 = (X<<25)>>25;
//			*vpe_stop = 0x93000000 | ((pMB->mv16x_2 & 0x7f)<<8) | (pMB->mv16y_2 & 0x7f);
			X = (pCodec->ME_command_queue0[3]>>12);
			pMB->mv16x_3 = (X<<18)>>25;
			pMB->mv16y_3 = (X<<25)>>25;
//			*vpe_stop = 0x93000000 | ((pMB->mv16x_3 & 0x7f)<<8) | (pMB->mv16y_3 & 0x7f);
			// It is used in bit 16 of MCCTL control register (at location 0x1001c) to indicate
			// whether current motion vector is zero or not...
			pCodec->MVZ = 0;
		}
	}
	
	
	#ifdef DUMP_PMV_RESULT
	switch(pMB->mode)
	  {
	    case MODE_INTRA:
	      fprintf(pmv_result_file,"  Mode is Intra mode\n\n");
	      break;
	    case MODE_INTER:
          fprintf(pmv_result_file,"  (1MV) MVD are : 0x%04x, 0x%04x\n",((pCodec->ME_command_queue0[11]>>16)&0x0ffff),(pCodec->ME_command_queue0[11]&0x0ffff));
          fprintf(pmv_result_file,"  Mode is Inter 1MV mode\n\n");
	      break;
	    case MODE_INTER4V:
          fprintf(pmv_result_file,"  (4MV) MVD are : 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x\n",((pCodec->ME_command_queue0[8]>>16)&0x0ffff), (pCodec->ME_command_queue0[8]&0x0ffff), ((pCodec->ME_command_queue0[9]>>16)&0x0ffff), (pCodec->ME_command_queue0[9]&0x0ffff), ((pCodec->ME_command_queue0[10]>>16)&0x0ffff), (pCodec->ME_command_queue0[10]&0x0ffff), ((pCodec->ME_command_queue0[11]>>16)&0x0ffff), (pCodec->ME_command_queue0[11]&0x0ffff));
          fprintf(pmv_result_file,"  Mode is Inter 4MV mode\n\n");
	      break;             
	  }
    #endif

//#ifdef DUMP_ME_RESULT
	//READ_MIN_SADMV(pMB->sad16)
//#endif

/*	setup for next ME	*/
	prevMB = &reference->mbs[1];
	 
	MOTION_ACTIVITY=abs(pMB->mv16x_1)+abs(pMB->mv16y_1);
	d_type=(MOTION_ACTIVITY > L1);		//		if (MOTION_ACTIVITY > L1) => Large Diamond else Small Diamond

	pCodec->ME_command_queue0[19] = (2<<29) | ((pMB->mv16x_1 & 0x7f) << 19) | ((pMB->mv16y_1 & 0x7f) << 12) | pCodec->Raddr + (pMB->mv16y_1 < 0 ? 0 : (pMB->mv16y_1 >> 1)*16);
	pCodec->ME_command_queue0[22] = (1<<28) | (2<<29) | ((prevMB->mv16x_3 & 0x7f) << 19) | ((prevMB->mv16y_3 & 0x7f) << 12) 
							| pCodec->Raddr + (prevMB->mv16y_3 < 0 ? 0 : (prevMB->mv16y_3 >> 1)*16);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
caoporm超碰国产精品| 久久婷婷色综合| 亚洲欧美aⅴ...| av电影天堂一区二区在线观看| 久久久精品国产免费观看同学| 狠狠狠色丁香婷婷综合激情| 久久久99久久| 成人av免费观看| 亚洲午夜视频在线| 91麻豆精品国产91久久久久| 韩国一区二区三区| 国产精品视频你懂的| 色屁屁一区二区| 五月天欧美精品| 久久久久久影视| 91在线视频观看| 日韩在线播放一区二区| 久久久久久久综合色一本| av激情成人网| 蜜臀av在线播放一区二区三区| 久久综合狠狠综合| 色av成人天堂桃色av| 毛片av一区二区| 国产精品久久久久一区| 欧美日韩在线播放一区| 国产一区二区三区美女| 亚洲一区国产视频| 精品久久久久久无| 欧美综合一区二区| 国产一区激情在线| 亚洲国产精品一区二区www在线| 欧美成人伊人久久综合网| www.视频一区| 久久成人精品无人区| 亚洲免费观看高清完整版在线观看 | 久久久精品tv| 色999日韩国产欧美一区二区| 青青草国产成人av片免费| 国产精品你懂的在线欣赏| 色狠狠一区二区三区香蕉| 日韩高清不卡在线| 成人免费一区二区三区视频| 337p亚洲精品色噜噜噜| 成人高清免费观看| 麻豆91在线看| 亚洲在线视频网站| 国产亚洲精品7777| 欧美一级二级三级蜜桃| 99re免费视频精品全部| 精彩视频一区二区三区| 午夜精品久久久久| 伊人色综合久久天天| 欧美国产成人精品| 欧美精品一区男女天堂| 538在线一区二区精品国产| 色综合久久99| 99久久精品免费观看| 国产精品88av| 久久se这里有精品| 美女久久久精品| 日韩av电影天堂| 亚洲国产综合人成综合网站| 亚洲欧美二区三区| 中文字幕一区三区| 国产精品麻豆99久久久久久| 久久―日本道色综合久久| 日韩欧美卡一卡二| 日韩午夜av电影| 日韩一区二区影院| 欧美疯狂性受xxxxx喷水图片| 色悠悠亚洲一区二区| 99国产精品久久久| 91在线丨porny丨国产| 91免费国产在线观看| 91亚洲资源网| 色女孩综合影院| 日本高清无吗v一区| 在线观看国产精品网站| 日本道精品一区二区三区| 色国产精品一区在线观看| 欧美视频三区在线播放| 欧美精品在线观看播放| 欧美理论片在线| 日韩欧美中文字幕精品| 精品国产人成亚洲区| 久久亚洲捆绑美女| 久久精品人人做人人爽人人| 国产人成亚洲第一网站在线播放 | 亚洲精品高清在线| 亚洲午夜精品网| 亚洲6080在线| 麻豆精品国产传媒mv男同| 国产一区二区在线影院| 国产成人在线影院| 91蜜桃视频在线| 欧美日本在线看| 欧美一卡二卡三卡四卡| 日韩一二三区视频| 国产日韩亚洲欧美综合| 亚洲欧美日韩国产手机在线| 亚洲第一精品在线| 精品亚洲欧美一区| www.性欧美| 欧美亚洲另类激情小说| 日韩欧美不卡在线观看视频| 国产亚洲精品福利| 亚洲在线中文字幕| 黄色成人免费在线| 色婷婷综合激情| 91精品国模一区二区三区| 久久精品视频一区二区三区| 亚洲在线中文字幕| 国产精品一区二区在线播放| 色综合视频一区二区三区高清| 91精品国产黑色紧身裤美女| 中日韩av电影| 日韩成人一级片| 成人做爰69片免费看网站| 欧美色综合影院| 国产欧美一区二区精品秋霞影院 | 麻豆精品国产传媒mv男同| 成人高清视频免费观看| 制服丝袜中文字幕亚洲| 欧美国产禁国产网站cc| 免费一区二区视频| 色一情一乱一乱一91av| 精品国产乱码久久久久久久久| 亚洲色图丝袜美腿| 国产尤物一区二区| 777色狠狠一区二区三区| 中文字幕精品—区二区四季| 五月婷婷综合激情| 成人免费黄色在线| 日韩精品一区国产麻豆| 亚洲va欧美va人人爽| www.亚洲精品| 国产日韩欧美一区二区三区乱码| 天堂一区二区在线免费观看| 91丨九色丨尤物| 久久色.com| 麻豆精品久久精品色综合| 欧美亚洲综合在线| 最新中文字幕一区二区三区| 国产一区二区免费看| 91精品久久久久久久99蜜桃| 亚洲精品国产精品乱码不99| 成人免费看片app下载| 久久久久久久久久美女| 久久综合综合久久综合| 777精品伊人久久久久大香线蕉| 中文字幕日本不卡| 国产69精品久久99不卡| 26uuuu精品一区二区| 日精品一区二区| 欧美色视频一区| 亚洲欧美日本在线| 成人性生交大片免费看视频在线| 久久你懂得1024| 国产一区二区三区四区在线观看| 日韩一区二区三区在线观看| 视频一区欧美精品| 欧美日本在线播放| 热久久一区二区| 日韩欧美国产系列| 精品亚洲免费视频| 精品毛片乱码1区2区3区| 国内成人精品2018免费看| 欧美成人在线直播| 国产乱码精品一区二区三区av| 精品福利一二区| 国内精品久久久久影院薰衣草| 精品久久久久久无| 国产成人精品综合在线观看| 国产女主播在线一区二区| 国产91露脸合集magnet | 精品理论电影在线| 激情久久五月天| 久久精品视频一区二区三区| 国产成人av电影在线播放| 中文字幕欧美区| 91久久久免费一区二区| 日韩电影在线免费观看| 日韩区在线观看| 国产精品一区二区在线观看网站| 中文字幕精品一区二区精品绿巨人 | 亚洲国产成人tv| 欧美午夜在线观看| 奇米影视一区二区三区小说| 欧美zozozo| 国产超碰在线一区| 亚洲精品国产一区二区三区四区在线| 欧美日韩午夜影院| 久久精品国产成人一区二区三区| 精品播放一区二区| 成人app软件下载大全免费| 亚洲小少妇裸体bbw| 精品国精品自拍自在线| av在线一区二区| 青青草成人在线观看| 国产欧美一区二区在线|