⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mcomp_sgl_simple.cc

📁 PIXIL is a small footprint operating environment, complete with PDA PIM applications, a browser and
💻 CC
📖 第 1 页 / 共 4 页
字号:
static void MC16xXXadd_420_SGL_FF_Chroma(MotionCompensation_Common::PredData* p){  const int y0    = p->y0 >>1;  const int x0    = p->x0 >>1;  const int yend  = y0 + p->blkheight_chr;  const int x1    = x0 + ((p->sglpred->h/2)>>1);  const int yoffs = ((p->sglpred->v/2)>>1);  for (int y=y0;y<yend;y++)    {      const Pixel* rp = &p->sglpred->cb[y+yoffs][x1];            Pixel* dp = &p->current.cb[y][x0];      dp[ 0]= (dp[ 0]+rp[ 0]+MV_MEAN_CONST)>>1;      dp[ 1]= (dp[ 1]+rp[ 1]+MV_MEAN_CONST)>>1;      dp[ 2]= (dp[ 2]+rp[ 2]+MV_MEAN_CONST)>>1;      dp[ 3]= (dp[ 3]+rp[ 3]+MV_MEAN_CONST)>>1;      dp[ 4]= (dp[ 4]+rp[ 4]+MV_MEAN_CONST)>>1;      dp[ 5]= (dp[ 5]+rp[ 5]+MV_MEAN_CONST)>>1;      dp[ 6]= (dp[ 6]+rp[ 6]+MV_MEAN_CONST)>>1;      dp[ 7]= (dp[ 7]+rp[ 7]+MV_MEAN_CONST)>>1;      rp = &p->sglpred->cr[y+yoffs][x1];      dp = &p->current.cr[y][x0];      dp[ 0]= (dp[ 0]+rp[ 0]+MV_MEAN_CONST)>>1;      dp[ 1]= (dp[ 1]+rp[ 1]+MV_MEAN_CONST)>>1;      dp[ 2]= (dp[ 2]+rp[ 2]+MV_MEAN_CONST)>>1;      dp[ 3]= (dp[ 3]+rp[ 3]+MV_MEAN_CONST)>>1;      dp[ 4]= (dp[ 4]+rp[ 4]+MV_MEAN_CONST)>>1;      dp[ 5]= (dp[ 5]+rp[ 5]+MV_MEAN_CONST)>>1;      dp[ 6]= (dp[ 6]+rp[ 6]+MV_MEAN_CONST)>>1;      dp[ 7]= (dp[ 7]+rp[ 7]+MV_MEAN_CONST)>>1;    }}static void MC16xXXadd_420_SGL_HF_Luma(MotionCompensation_Common::PredData* p){  const int yend  = p->y0 + p->blkheight;  const int x1    = p->x0 + (p->sglpred->h>>1);  const int dy    = (p->sglpred->v>>1);  for (int y=p->y0;y<yend;y++)    {      int y1 = y+dy;      const Pixel* rp = &p->sglpred->y[y1][x1];            Pixel* dp = &p->current.y [y ][p->x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rp[ 1]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rp[ 2]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rp[ 3]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rp[ 4]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rp[ 5]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rp[ 6]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rp[ 7]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rp[ 8]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 8]=(dp[ 8]+((rp[ 8]+rp[ 9]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 9]=(dp[ 9]+((rp[ 9]+rp[10]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[10]=(dp[10]+((rp[10]+rp[11]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[11]=(dp[11]+((rp[11]+rp[12]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[12]=(dp[12]+((rp[12]+rp[13]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[13]=(dp[13]+((rp[13]+rp[14]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[14]=(dp[14]+((rp[14]+rp[15]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[15]=(dp[15]+((rp[15]+rp[16]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;    }}static void MC16xXXadd_420_SGL_HF_Chroma(MotionCompensation_Common::PredData* p){  const int y0    = p->y0 >>1;  const int x0    = p->x0 >>1;  const int yend  = y0 + p->blkheight_chr;  const int x1    = x0 + ((p->sglpred->h/2)>>1);  const int yoffs = ((p->sglpred->v/2)>>1);  for (int y=y0;y<yend;y++)    {      const Pixel* rp = &p->sglpred->cb[y+yoffs][x1];            Pixel* dp = &p->current.cb[y][x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rp[ 1]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rp[ 2]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rp[ 3]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rp[ 4]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rp[ 5]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rp[ 6]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rp[ 7]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rp[ 8]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      rp = &p->sglpred->cr[y+yoffs][x1];      dp = &p->current.cr[y][x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rp[ 1]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rp[ 2]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rp[ 3]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rp[ 4]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rp[ 5]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rp[ 6]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rp[ 7]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rp[ 8]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;    }}static void MC16xXXadd_420_SGL_FH_Luma(MotionCompensation_Common::PredData* p){  const int yend  = p->y0 + p->blkheight;  const int x1    = p->x0 + (p->sglpred->h>>1);  const int dy    = (p->sglpred->v>>1);  for (int y=p->y0;y<yend;y++)    {      int y1 = y+dy;      const Pixel* rp = &p->sglpred->y[y1  ][x1];      const Pixel* rpb= &p->sglpred->y[y1+1][x1];            Pixel* dp = &p->current.y [y ][p->x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rpb[ 0]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rpb[ 1]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rpb[ 2]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rpb[ 3]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rpb[ 4]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rpb[ 5]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rpb[ 6]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rpb[ 7]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 8]=(dp[ 8]+((rp[ 8]+rpb[ 8]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 9]=(dp[ 9]+((rp[ 9]+rpb[ 9]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[10]=(dp[10]+((rp[10]+rpb[10]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[11]=(dp[11]+((rp[11]+rpb[11]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[12]=(dp[12]+((rp[12]+rpb[12]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[13]=(dp[13]+((rp[13]+rpb[13]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[14]=(dp[14]+((rp[14]+rpb[14]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[15]=(dp[15]+((rp[15]+rpb[15]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;    }}static void MC16xXXadd_420_SGL_FH_Chroma(MotionCompensation_Common::PredData* p){  const int y0    = p->y0 >>1;  const int x0    = p->x0 >>1;  const int yend  = y0 + p->blkheight_chr;  const int x1    = x0 + ((p->sglpred->h/2)>>1);  const int yoffs = ((p->sglpred->v/2)>>1);  for (int y=y0;y<yend;y++)    {      const Pixel* rp = &p->sglpred->cb[y+yoffs  ][x1];      const Pixel* rpb= &p->sglpred->cb[y+yoffs+1][x1];            Pixel* dp = &p->current.cb[y][x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rpb[ 0]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rpb[ 1]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rpb[ 2]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rpb[ 3]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rpb[ 4]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rpb[ 5]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rpb[ 6]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rpb[ 7]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      rp = &p->sglpred->cr[y+yoffs][x1];      rpb= &p->sglpred->cr[y+yoffs+1][x1];      dp = &p->current.cr[y][x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rpb[ 0]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rpb[ 1]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rpb[ 2]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rpb[ 3]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rpb[ 4]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rpb[ 5]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rpb[ 6]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rpb[ 7]+MV_MEAN_CONST)>>1)+MV_MEAN_CONST)>>1;    }}static void MC16xXXadd_420_SGL_HH_Luma(MotionCompensation_Common::PredData* p){  const int yend  = p->y0 + p->blkheight;  const int x1    = p->x0 + (p->sglpred->h>>1);  const int dy    = (p->sglpred->v>>1);  for (int y=p->y0;y<yend;y++)    {      int y1 = y+dy;      const Pixel* rp = &p->sglpred->y[y1  ][x1];      const Pixel* rpb= &p->sglpred->y[y1+1][x1];            Pixel* dp = &p->current.y [y ][p->x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rp[ 1]+rpb[ 0]+rpb[ 1]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rp[ 2]+rpb[ 1]+rpb[ 2]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rp[ 3]+rpb[ 2]+rpb[ 3]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rp[ 4]+rpb[ 3]+rpb[ 4]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rp[ 5]+rpb[ 4]+rpb[ 5]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rp[ 6]+rpb[ 5]+rpb[ 6]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rp[ 7]+rpb[ 6]+rpb[ 7]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rp[ 8]+rpb[ 7]+rpb[ 8]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 8]=(dp[ 8]+((rp[ 8]+rp[ 9]+rpb[ 8]+rpb[ 9]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 9]=(dp[ 9]+((rp[ 9]+rp[10]+rpb[ 9]+rpb[10]+2)>>2)+MV_MEAN_CONST)>>1;      dp[10]=(dp[10]+((rp[10]+rp[11]+rpb[10]+rpb[11]+2)>>2)+MV_MEAN_CONST)>>1;      dp[11]=(dp[11]+((rp[11]+rp[12]+rpb[11]+rpb[12]+2)>>2)+MV_MEAN_CONST)>>1;      dp[12]=(dp[12]+((rp[12]+rp[13]+rpb[12]+rpb[13]+2)>>2)+MV_MEAN_CONST)>>1;      dp[13]=(dp[13]+((rp[13]+rp[14]+rpb[13]+rpb[14]+2)>>2)+MV_MEAN_CONST)>>1;      dp[14]=(dp[14]+((rp[14]+rp[15]+rpb[14]+rpb[15]+2)>>2)+MV_MEAN_CONST)>>1;      dp[15]=(dp[15]+((rp[15]+rp[16]+rpb[15]+rpb[16]+2)>>2)+MV_MEAN_CONST)>>1;    }}static void MC16xXXadd_420_SGL_HH_Chroma(MotionCompensation_Common::PredData* p){  const int y0    = p->y0 >>1;  const int x0    = p->x0 >>1;  const int yend  = y0 + p->blkheight_chr;  const int x1    = x0 + ((p->sglpred->h/2)>>1);  const int yoffs = ((p->sglpred->v/2)>>1);  for (int y=y0;y<yend;y++)    {      const Pixel* rp = &p->sglpred->cb[y+yoffs  ][x1];      const Pixel* rpb= &p->sglpred->cb[y+yoffs+1][x1];            Pixel* dp = &p->current.cb[y][x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rp[ 1]+rpb[ 0]+rpb[ 1]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rp[ 2]+rpb[ 1]+rpb[ 2]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rp[ 3]+rpb[ 2]+rpb[ 3]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rp[ 4]+rpb[ 3]+rpb[ 4]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rp[ 5]+rpb[ 4]+rpb[ 5]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rp[ 6]+rpb[ 5]+rpb[ 6]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rp[ 7]+rpb[ 6]+rpb[ 7]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rp[ 8]+rpb[ 7]+rpb[ 8]+2)>>2)+MV_MEAN_CONST)>>1;      rp = &p->sglpred->cr[y+yoffs][x1];      rpb= &p->sglpred->cr[y+yoffs+1][x1];      dp = &p->current.cr[y][x0];      dp[ 0]=(dp[ 0]+((rp[ 0]+rp[ 1]+rpb[ 0]+rpb[ 1]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 1]=(dp[ 1]+((rp[ 1]+rp[ 2]+rpb[ 1]+rpb[ 2]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 2]=(dp[ 2]+((rp[ 2]+rp[ 3]+rpb[ 2]+rpb[ 3]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 3]=(dp[ 3]+((rp[ 3]+rp[ 4]+rpb[ 3]+rpb[ 4]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 4]=(dp[ 4]+((rp[ 4]+rp[ 5]+rpb[ 4]+rpb[ 5]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 5]=(dp[ 5]+((rp[ 5]+rp[ 6]+rpb[ 5]+rpb[ 6]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 6]=(dp[ 6]+((rp[ 6]+rp[ 7]+rpb[ 6]+rpb[ 7]+2)>>2)+MV_MEAN_CONST)>>1;      dp[ 7]=(dp[ 7]+((rp[ 7]+rp[ 8]+rpb[ 7]+rpb[ 8]+2)>>2)+MV_MEAN_CONST)>>1;    }}// ------------------------- BIDIRECTIONAL PREDICTION --------------------------------------static void MC16xXX_420_DBL_FFFF_Luma(MotionCompensation_Common::PredData* p){  const int yend  = p->y0 + p->blkheight;  const int x1    = p->x0 + (p->pred1.h>>1);  const int x2    = p->x0 + (p->pred2.h>>1);  const int dy1   = (p->pred1.v>>1);  const int dy2   = (p->pred2.v>>1);  for (int y=p->y0;y<yend;y++)    {      int y1 = y+dy1;      int y2 = y+dy2;      const Pixel* rp1 = &p->pred1.y[y1][x1];      const Pixel* rp2 = &p->pred2.y[y2][x2];            Pixel* dp  = &p->current.y [y ][p->x0];      dp[ 0]=(rp1[ 0]+rp2[ 0]+MV_MEAN_CONST)>>1;      dp[ 1]=(rp1[ 1]+rp2[ 1]+MV_MEAN_CONST)>>1;      dp[ 2]=(rp1[ 2]+rp2[ 2]+MV_MEAN_CONST)>>1;      dp[ 3]=(rp1[ 3]+rp2[ 3]+MV_MEAN_CONST)>>1;      dp[ 4]=(rp1[ 4]+rp2[ 4]+MV_MEAN_CONST)>>1;      dp[ 5]=(rp1[ 5]+rp2[ 5]+MV_MEAN_CONST)>>1;      dp[ 6]=(rp1[ 6]+rp2[ 6]+MV_MEAN_CONST)>>1;      dp[ 7]=(rp1[ 7]+rp2[ 7]+MV_MEAN_CONST)>>1;      dp[ 8]=(rp1[ 8]+rp2[ 8]+MV_MEAN_CONST)>>1;      dp[ 9]=(rp1[ 9]+rp2[ 9]+MV_MEAN_CONST)>>1;      dp[10]=(rp1[10]+rp2[10]+MV_MEAN_CONST)>>1;      dp[11]=(rp1[11]+rp2[11]+MV_MEAN_CONST)>>1;      dp[12]=(rp1[12]+rp2[12]+MV_MEAN_CONST)>>1;      dp[13]=(rp1[13]+rp2[13]+MV_MEAN_CONST)>>1;      dp[14]=(rp1[14]+rp2[14]+MV_MEAN_CONST)>>1;      dp[15]=(rp1[15]+rp2[15]+MV_MEAN_CONST)>>1;    }}static void MC16xXX_420_DBL_FFFF_Chroma(MotionCompensation_Common::PredData* p){  const int y0     = p->y0 >>1;  const int x0     = p->x0 >>1;  const int yend   = y0 + p->blkheight_chr;  const int x1     = x0 + ((p->pred1.h/2)>>1);  const int x2     = x0 + ((p->pred2.h/2)>>1);  const int yoffs1 = ((p->pred1.v/2)>>1);  const int yoffs2 = ((p->pred2.v/2)>>1);  for (int y=y0;y<yend;y++)    {      const Pixel* rp1 = &p->pred1.cb[y+yoffs1][x1];      const Pixel* rp2 = &p->pred2.cb[y+yoffs2][x2];            Pixel* dp  = &p->current.cb[y][x0];      dp[0]=(rp1[0]+rp2[0]+MV_MEAN_CONST)>>1;      dp[1]=(rp1[1]+rp2[1]+MV_MEAN_CONST)>>1;      dp[2]=(rp1[2]+rp2[2]+MV_MEAN_CONST)>>1;      dp[3]=(rp1[3]+rp2[3]+MV_MEAN_CONST)>>1;      dp[4]=(rp1[4]+rp2[4]+MV_MEAN_CONST)>>1;      dp[5]=(rp1[5]+rp2[5]+MV_MEAN_CONST)>>1;      dp[6]=(rp1[6]+rp2[6]+MV_MEAN_CONST)>>1;      dp[7]=(rp1[7]+rp2[7]+MV_MEAN_CONST)>>1;      rp1 = &p->pred1.cr[y+yoffs1][x1];      rp2 = &p->pred2.cr[y+yoffs2][x2];      dp  = &p->current.cr[y][x0];      dp[0]=(rp1[0]+rp2[0]+MV_MEAN_CONST)>>1;      dp[1]=(rp1[1]+rp2[1]+MV_MEAN_CONST)>>1;      dp[2]=(rp1[2]+rp2[2]+MV_MEAN_CONST)>>1;      dp[3]=(rp1[3]+rp2[3]+MV_MEAN_CONST)>>1;      dp[4]=(rp1[4]+rp2[4]+MV_MEAN_CONST)>>1;      dp[5]=(rp1[5]+rp2[5]+MV_MEAN_CONST)>>1;      dp[6]=(rp1[6]+rp2[6]+MV_MEAN_CONST)>>1;      dp[7]=(rp1[7]+rp2[7]+MV_MEAN_CONST)>>1;    }}static void MC16xXX_420_DBL_xxxx_Luma(MotionCompensation_Common::PredData* p,                                      bool h1,bool v1,bool h2,bool v2){  const int yend  = p->y0 + p->blkheight;  const int x1    = p->x0 + (p->pred1.h>>1);  const int x2    = p->x0 + (p->pred2.h>>1);  const int dy1   = (p->pred1.v>>1);  const int dy2   = (p->pred2.v>>1);  for (int y=p->y0;y<yend;y++)    {      int y1 = y+dy1;      int y2 = y+dy2;      const Pixel* rp1  = &p->pred1.y[y1  ][x1];      const Pixel* rp1b = (v1 ? &p->pred1.y[y1+1][x1] : 0);      const Pixel* rp2  = &p->pred2.y[y2  ][x2];      const Pixel* rp2b = (v2 ? &p->pred2.y[y2+1][x2] : 0);            Pixel* dp  = &p->current.y [y ][p->x0];      for (int i=0;i<16;i++)        {          int val1;          if (v1 && h1) val1=(rp1[i]+rp1[i+1]+rp1b[i]+rp1b[i+1]+2)>>2;          else if (h1)  val1=(rp1[i]+rp1[i+1]+1)>>1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -