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

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

?? mc_prediction.c

?? 壓縮JM12.3d的完整的全部C語言的代碼文檔,用于嵌入式系統的壓縮編解碼
?? C
?? 第 1 頁 / 共 3 頁
字號:

/*!
 *************************************************************************************
 * \file mc_prediction.c
 *
 * \brief
 *    Functions for motion compensated prediction
 *
 * \author
 *      Main contributors (see contributors.h for copyright, 
 *                         address and affiliation details)
 *      - Alexis Michael Tourapis  <alexismt@ieee.org>
 *
 *************************************************************************************
 */
#include <assert.h>
#include <string.h>

#include "global.h"
#include "block.h"
#include "mc_prediction.h"
#include "mbuffer.h"
#include "mb_access.h"

extern StorablePicture *no_reference_picture;
extern const unsigned char subblk_offset_y[3][8][4];
extern const unsigned char subblk_offset_x[3][8][4];
extern const unsigned char cofuv_blk_y[3][8][4];
extern const unsigned char cofuv_blk_x[3][8][4];
/*!
 ************************************************************************
 * \brief
 *    block single list prediction
 ************************************************************************
 */
static void mc_prediction(struct img_par *img, 
                    int yuv,
                    int ver_block_size, 
                    int hor_block_size,
                    int joff,
                    int ioff,
                    imgpel block[MB_BLOCK_SIZE][MB_BLOCK_SIZE])
{
  static int jj;
  imgpel (*mpr) [16] = img->mpr[yuv];

  for(jj = 0; jj < ver_block_size; jj++)
  {
    memcpy(&(mpr[jj + joff][ioff]), &(block[jj][0]), hor_block_size * sizeof(imgpel));
  }
}

/*!
 ************************************************************************
 * \brief
 *    block single list weighted prediction
 ************************************************************************
 */
static void weighted_mc_prediction(struct img_par *img,
                            int yuv, 
                            int ver_block_size, 
                            int hor_block_size,
                            int joff,
                            int ioff,
                            imgpel block[MB_BLOCK_SIZE][MB_BLOCK_SIZE], 
                            int wp_scale,
                            int wp_offset,
                            int weight_denom,
                            int color_clip)
{
  static int ii, jj;
  imgpel *mpr;
  
  for(jj=0;jj<ver_block_size;jj++)
  {
    mpr = img->mpr[yuv][jj + joff];
    for(ii=0;ii<hor_block_size;ii++)
      mpr[ii+ioff] = iClip1(color_clip, 
      (rshift_rnd((wp_scale *  block[jj][ii]), weight_denom)  + wp_offset ));
  }
}


/*!
 ************************************************************************
 * \brief
 *    block biprediction
 ************************************************************************
 */
static void bi_prediction(struct img_par *img, 
                    int yuv,
                    int ver_block_size, 
                    int hor_block_size,
                    int joff,
                    int ioff,
                    imgpel block_l0[MB_BLOCK_SIZE][MB_BLOCK_SIZE], 
                    imgpel block_l1[MB_BLOCK_SIZE][MB_BLOCK_SIZE])
{
  static int ii, jj;
  imgpel *mpr;

  for(jj = 0;jj < ver_block_size;jj++)
  {
    mpr = img->mpr[yuv][jj + joff];    
    for(ii = 0; ii < hor_block_size;ii++)
      mpr[ii + ioff] = rshift_rnd_sf(block_l0[jj][ii] + block_l1[jj][ii], 1);
  }
}

/*!
 ************************************************************************
 * \brief
 *    block weighted biprediction
 ************************************************************************
 */
static void weighted_bi_prediction(struct img_par *img, 
                            int yuv,
                            int ver_block_size, 
                            int hor_block_size,
                            int joff,
                            int ioff,
                            imgpel block_l0[MB_BLOCK_SIZE][MB_BLOCK_SIZE], 
                            imgpel block_l1[MB_BLOCK_SIZE][MB_BLOCK_SIZE],
                            int wp_scale_l0,
                            int wp_scale_l1,
                            int wp_offset,
                            int weight_denom,
                            int color_clip)
{
  static int ii, jj;
  imgpel *mpr;
  
  for(jj=0;jj<ver_block_size;jj++)
  {
    mpr = img->mpr[yuv][jj + joff];    
    for(ii=0;ii<hor_block_size;ii++)
      mpr[ii+ioff] = (int)iClip1(color_clip, 
      (rshift_rnd((wp_scale_l0 * block_l0[jj][ii] + wp_scale_l1 * block_l1[jj][ii]), 
      weight_denom) + wp_offset));
  }
}

/*!
 ************************************************************************
 * \brief
 *    Interpolation of 1/4 subpixel
 ************************************************************************
 */
void get_block_luma(int ref_frame, StorablePicture **list, int x_pos, int y_pos, int hor_block_size, int ver_block_size, struct img_par *img, imgpel block[MB_BLOCK_SIZE][MB_BLOCK_SIZE])
{
  int dx = (x_pos & 3), dy = (y_pos & 3);
  int i, j;
  int shift_x = dec_picture->size_x;
  int maxold_x = dec_picture->size_x_m1;
  int maxold_y = (dec_picture->mb_field[img->current_mb_nr]) ? (dec_picture->size_y >> 1) - 1 : dec_picture->size_y_m1;
  int result;
  int pres_x, pres_y;

  static int tmp_res[21][21];
  static const int COEF[6] = { 1, -5, 20, 20, -5, 1  };
  StorablePicture *curr_ref = list[ref_frame];
  static imgpel **cur_imgY, *cur_lineY;
  static imgpel *cur_lineY_m2, *cur_lineY_m1, *cur_lineY_p1, *cur_lineY_p2, *cur_lineY_p3;
  int tmp_pos;
  static int jpos_m2, jpos_m1, jpos, jpos_p1, jpos_p2, jpos_p3;
  static int ipos_m2, ipos_m1, ipos, ipos_p1, ipos_p2, ipos_p3;

  if (curr_ref == no_reference_picture && img->framepoc < img->recovery_poc)
  {
    printf("list[ref_frame] is equal to 'no reference picture' before RAP\n");

    /* fill the block with sample value 128 */
    for (j = 0; j < ver_block_size; j++)
      for (i = 0; i < hor_block_size; i++)
        block[j][i] = 128;
    return;
  }

  if( IS_INDEPENDENT(img) )
  {
    switch( img->colour_plane_id )
    {
    case    0:
      cur_imgY = curr_ref->imgY;
      break;
    case    1:
      cur_imgY = curr_ref->imgUV[0];
      break;
    case    2:
      cur_imgY = curr_ref->imgUV[1];
      break;
    }
  }
  else
  {
    cur_imgY = curr_ref->imgY;
  }

  x_pos = x_pos >> 2;
  y_pos = y_pos >> 2;

  if ( (y_pos > 1) && (y_pos < maxold_y - 2 - ver_block_size) && (x_pos > 1) && (x_pos < maxold_x - 2 - hor_block_size))
  {
    if (dx == 0 && dy == 0)
    {  /* fullpel position */
      for (j = 0; j < ver_block_size; j++)
      {        
        memcpy(&(block[j][0]), &(cur_imgY[ y_pos + j ][x_pos]), hor_block_size * sizeof(imgpel));
      }
    }
    else
    { /* other positions */

      if (dy == 0)
      { /* No vertical interpolation */
        tmp_pos = x_pos - 2;
        for (i = 0; i < hor_block_size; i++)
        {        
          ipos_m2 = tmp_pos++;
          ipos_m1 = tmp_pos++;
          ipos    = tmp_pos++;
          ipos_p1 = tmp_pos++;
          ipos_p2 = tmp_pos++;
          ipos_p3 = tmp_pos  ;
          tmp_pos -= 4;

          for (j = 0; j < ver_block_size; j++)
          {
            cur_lineY = cur_imgY[y_pos + j];

            result  = (cur_lineY[ipos_m2] + cur_lineY[ipos_p3]) * COEF[0];
            result += (cur_lineY[ipos_m1] + cur_lineY[ipos_p2]) * COEF[1];
            result += (cur_lineY[ipos   ] + cur_lineY[ipos_p1]) * COEF[2];

            block[j][i] = iClip1(img->max_imgpel_value, ((result + 16)>>5));
          }
        }

        if ((dx&1) == 1)
        {
          for (j = 0; j < ver_block_size; j++)
          {
            cur_lineY = &(cur_imgY[ y_pos + j ][x_pos + (dx >> 1)]);
            for (i = 0; i < hor_block_size; i++)
            {
              block[j][i] = (block[j][i] + *(cur_lineY++) + 1 )>>1;
            }
          }
        }
      }
      else if (dx == 0)
      {  /* No horizontal interpolation */        
        cur_lineY_m2 = &(cur_imgY[y_pos - 2][x_pos]);
        for (j = 0; j < ver_block_size; j++)
        {                  
          cur_lineY_m1 = cur_lineY_m2 + shift_x;          
          cur_lineY    = cur_lineY_m1 + shift_x;
          cur_lineY_p1 = cur_lineY    + shift_x;
          cur_lineY_p2 = cur_lineY_p1 + shift_x;
          cur_lineY_p3 = cur_lineY_p2 + shift_x;

          for (i = 0; i < hor_block_size; i++)
          {
            result  = (*(cur_lineY_m2++) + *(cur_lineY_p3++)) * COEF[0];
            result += (*(cur_lineY_m1++) + *(cur_lineY_p2++)) * COEF[1];
            result += (*(cur_lineY   ++) + *(cur_lineY_p1++)) * COEF[2];

            block[j][i] = iClip1(img->max_imgpel_value, ((result+16)>>5));
          }
          cur_lineY_m2 = cur_lineY_m1 - hor_block_size;
        }

        if ((dy&1) == 1)
        {
          for (j = 0; j < ver_block_size; j++)
          {
            cur_lineY = &(cur_imgY[ y_pos + j + (dy >> 1)][x_pos]);
            for (i = 0; i < hor_block_size; i++)
            {
              block[j][i] = (block[j][i] + *(cur_lineY++) + 1 )>>1;
            }
          }
        }
      }
      else if (dx == 2)
      {  /* Vertical & horizontal interpolation */
        tmp_pos = x_pos - 2;
        for (i = 0; i < hor_block_size; i++)
        {        
          ipos_m2 = tmp_pos++;
          ipos_m1 = tmp_pos++;
          ipos    = tmp_pos++;
          ipos_p1 = tmp_pos++;
          ipos_p2 = tmp_pos++;
          ipos_p3 = tmp_pos  ;
          tmp_pos -= 4;

          for (j = 0; j < ver_block_size + 5; j++)
          {
            cur_lineY = cur_imgY[y_pos + j - 2];

            tmp_res[j][i]  = (cur_lineY[ipos_m2] + cur_lineY[ipos_p3]) * COEF[0];
            tmp_res[j][i] += (cur_lineY[ipos_m1] + cur_lineY[ipos_p2]) * COEF[1];
            tmp_res[j][i] += (cur_lineY[ipos   ] + cur_lineY[ipos_p1]) * COEF[2];
          }
        }

        for (j = 0; j < ver_block_size; j++)
        {
          jpos_m2 = j    ;
          jpos_m1 = j + 1;
          jpos    = j + 2;
          jpos_p1 = j + 3;
          jpos_p2 = j + 4;
          jpos_p3 = j + 5;

          for (i = 0; i < hor_block_size; i++)
          {
            result  = (tmp_res[jpos_m2][i] + tmp_res[jpos_p3][i]) * COEF[0];
            result += (tmp_res[jpos_m1][i] + tmp_res[jpos_p2][i]) * COEF[1];
            result += (tmp_res[jpos   ][i] + tmp_res[jpos_p1][i]) * COEF[2];

            block[j][i] = iClip1(img->max_imgpel_value, ((result+512)>>10));
          }
        }

        if ((dy&1) == 1)
        {
          for (j = 0; j < ver_block_size; j++)
          {
            pres_y = j+2+(dy>>1);
            for (i = 0; i < hor_block_size; i++)
            {
              block[j][i] = (block[j][i] + iClip1(img->max_imgpel_value, ((tmp_res[pres_y][i] + 16) >> 5)) + 1 )>>1;
            }
          }
        }
      }
      else if (dy == 2)
      {  /* Horizontal & vertical interpolation */
        cur_lineY_m2 = &(cur_imgY[y_pos - 2][x_pos - 2]);
        for (j = 0; j < ver_block_size; j++)
        {                    
          cur_lineY_m1 = cur_lineY_m2 + shift_x;
          cur_lineY    = cur_lineY_m1 + shift_x;
          cur_lineY_p1 = cur_lineY    + shift_x;
          cur_lineY_p2 = cur_lineY_p1 + shift_x;
          cur_lineY_p3 = cur_lineY_p2 + shift_x;

          for (i = 0; i < hor_block_size + 5; i++)
          {
            tmp_res[j][i]  = (*(cur_lineY_m2++) + *(cur_lineY_p3++)) * COEF[0];
            tmp_res[j][i] += (*(cur_lineY_m1++) + *(cur_lineY_p2++)) * COEF[1];
            tmp_res[j][i] += (*(cur_lineY   ++) + *(cur_lineY_p1++)) * COEF[2];
          }
          cur_lineY_m2 = cur_lineY_m1 - (hor_block_size + 5);
        }

        for (j = 0; j < ver_block_size; j++)
        {
          for (i = 0; i < hor_block_size; i++)
          {
            result  = (tmp_res[j][i    ] + tmp_res[j][i + 5]) * COEF[0];
            result += (tmp_res[j][i + 1] + tmp_res[j][i + 4]) * COEF[1];
            result += (tmp_res[j][i + 2] + tmp_res[j][i + 3]) * COEF[2];
            block[j][i] = iClip1(img->max_imgpel_value, ((result+512)>>10));
          }
        }

        if ((dx&1) == 1)
        {
          for (j = 0; j < ver_block_size; j++)
          {
            for (i = 0; i < hor_block_size; i++)
            {
              block[j][i] = (block[j][i] + iClip1(img->max_imgpel_value, ((tmp_res[j][i + 2 + (dx>>1)] + 16)>>5))+1)>>1;
            }
          }
        }
      }
      else
      {  /* Diagonal interpolation */
        tmp_pos = x_pos - 2;
        for (i = 0; i < hor_block_size; i++)
        {
          ipos_m2 = tmp_pos++;
          ipos_m1 = tmp_pos++;
          ipos    = tmp_pos++;
          ipos_p1 = tmp_pos++;
          ipos_p2 = tmp_pos++;
          ipos_p3 = tmp_pos  ;
          tmp_pos -= 4;

          for (j = 0; j < ver_block_size; j++)
          {
            cur_lineY = cur_imgY[(dy == 1 ? y_pos + j : y_pos + j + 1)];

            result  = (cur_lineY[ipos_m2] + cur_lineY[ipos_p3]) * COEF[0];
            result += (cur_lineY[ipos_m1] + cur_lineY[ipos_p2]) * COEF[1];
            result += (cur_lineY[ipos   ] + cur_lineY[ipos_p1]) * COEF[2];

            block[j][i] = iClip1(img->max_imgpel_value, ((result+16)>>5));
          }
        }

        cur_lineY_m2 = &(cur_imgY[y_pos - 2][(dx == 1 ? x_pos : x_pos + 1)]);
        for (j = 0; j < ver_block_size; j++)
        {        

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品中午字幕| 精品亚洲国内自在自线福利| 91美女蜜桃在线| 一区二区在线观看免费视频播放| www.视频一区| 亚洲日本中文字幕区| 色婷婷精品久久二区二区蜜臂av| 一区二区三区加勒比av| 欧美伦理影视网| 久久精品噜噜噜成人av农村| 国产亚洲成av人在线观看导航| 成人黄页毛片网站| 亚洲午夜在线视频| 日韩视频免费观看高清完整版在线观看 | 亚洲私人影院在线观看| 在线视频中文字幕一区二区| 天堂影院一区二区| 欧美精品一区二区三区高清aⅴ | 亚洲欧美日本在线| 欧美日韩激情一区二区| 激情综合网av| **性色生活片久久毛片| 日韩一区二区在线看| 成人手机电影网| 午夜在线成人av| 欧美高清视频一二三区| 国产欧美一区二区三区在线老狼| 久久精品一区二区三区不卡| ww亚洲ww在线观看国产| 欧美国产成人精品| 五月天丁香久久| 成人综合婷婷国产精品久久免费| 欧美性xxxxxxxx| 国产视频一区不卡| 黄色精品一二区| 在线观看日韩毛片| 亚洲午夜久久久久久久久久久| 蜜桃久久久久久久| 亚洲欧洲国产日韩| 日韩一区二区三区电影在线观看| 成人黄色电影在线| 久久99精品久久久久久动态图 | 精品国产乱码久久久久久久| 91色乱码一区二区三区| 韩国一区二区视频| 香蕉成人啪国产精品视频综合网| 国产日韩av一区二区| 制服.丝袜.亚洲.另类.中文 | 国产一区二区三区免费观看| 一区二区三区四区中文字幕| 国产网红主播福利一区二区| 欧美一区二区三区免费| 在线观看一区不卡| 99视频精品全部免费在线| 国产酒店精品激情| 久久国内精品自在自线400部| 亚洲成在人线在线播放| 自拍av一区二区三区| 欧美国产精品一区二区三区| 精品久久久久久久久久久久久久久 | 麻豆精品精品国产自在97香蕉 | 欧美一卡在线观看| 欧美日韩在线免费视频| 91视频免费播放| 99在线精品观看| 国产91精品精华液一区二区三区 | 国产99久久久精品| 国产老女人精品毛片久久| 日本中文字幕不卡| 欧美96一区二区免费视频| 亚洲国产精品视频| 亚洲国产精品久久久久秋霞影院| 亚洲自拍偷拍九九九| 亚洲男人都懂的| 亚洲精品日产精品乱码不卡| 中文字幕一区二区视频| 国产精品久久福利| 中文字幕亚洲一区二区va在线| 国产精品拍天天在线| 日韩美女啊v在线免费观看| 国产精品久99| 一区二区三区在线视频观看58 | 蜜桃91丨九色丨蝌蚪91桃色| 日韩福利电影在线| 久久电影网电视剧免费观看| 免费在线看一区| 九九九精品视频| 国产尤物一区二区在线| 国产精品一二三| 成人精品鲁一区一区二区| 99九九99九九九视频精品| 日本福利一区二区| 欧美日韩国产中文| 精品理论电影在线观看| 久久精品日产第一区二区三区高清版| 久久久久久久久97黄色工厂| 国产欧美综合在线观看第十页| 欧美激情综合在线| 亚洲精品视频一区| 日本人妖一区二区| 国产剧情在线观看一区二区| 99久久久久久99| 欧美日韩大陆在线| 久久亚洲精品小早川怜子| 国产精品萝li| 亚洲亚洲精品在线观看| 麻豆国产精品777777在线| 国产99久久久国产精品| 欧美三级日韩三级| 久久亚洲综合色| 亚洲国产成人av网| 国产一区二区三区| 欧美亚洲国产一区在线观看网站| 91精品国产乱| 成人免费在线观看入口| 性欧美疯狂xxxxbbbb| 国产成人免费视频| 欧美综合一区二区三区| 国产日韩一级二级三级| 香蕉久久夜色精品国产使用方法| 国产精品一区二区你懂的| 欧美三日本三级三级在线播放| 欧美成人三级在线| 一级精品视频在线观看宜春院| 精品亚洲国内自在自线福利| 91黄色免费版| 国产欧美日韩卡一| 日韩二区三区四区| 97久久精品人人做人人爽 | 欧美精品一区二区三区在线播放| 亚洲人成网站色在线观看| 久久精品免费看| 欧洲人成人精品| 欧美国产激情二区三区| 美女一区二区视频| 欧美视频一区二| 中文字幕日韩一区| 国产伦精品一区二区三区视频青涩| 色网综合在线观看| 日本一区二区三区四区在线视频| 日韩国产成人精品| 色婷婷久久久久swag精品| 国产亚洲制服色| 国产综合一区二区| 欧美一区二区视频网站| 一区二区在线免费| 91网站最新地址| 国产精品午夜电影| 国产综合久久久久影院| 欧美一区二区三区视频免费播放| 亚洲午夜激情av| 欧洲中文字幕精品| 亚洲品质自拍视频网站| 成人免费视频网站在线观看| 久久精品网站免费观看| 国内外成人在线视频| 日韩一二三区视频| 日本不卡一区二区三区| 欧美色手机在线观看| 亚洲欧美日韩国产成人精品影院| 国产成人在线观看免费网站| 亚洲精品一区二区三区在线观看| 麻豆精品一区二区三区| 91精品国产欧美一区二区成人| 午夜精品久久久久久不卡8050| 欧美色综合天天久久综合精品| 一区二区三区精品在线观看| 91在线国内视频| 亚洲六月丁香色婷婷综合久久| 97精品视频在线观看自产线路二| 国产精品成人免费| 91视视频在线观看入口直接观看www | 亚洲欧美日韩成人高清在线一区| 91丨porny丨中文| 亚洲乱码日产精品bd| 色先锋久久av资源部| 午夜日韩在线观看| 欧美一区二区三区免费观看视频| 美腿丝袜一区二区三区| 精品日韩欧美一区二区| 国产成人精品影院| 国产精品免费av| 色婷婷精品大在线视频| 日韩精品亚洲一区二区三区免费| 欧美一区二区啪啪| 国产综合色在线| 自拍偷拍国产精品| 欧美乱熟臀69xxxxxx| 极品少妇xxxx偷拍精品少妇| 国产色婷婷亚洲99精品小说| 不卡av在线免费观看| 亚洲天堂免费看| 7777女厕盗摄久久久| 国产一区二区三区在线观看精品| 国产精品久久久久毛片软件| 色88888久久久久久影院按摩| 天天色天天操综合| 国产亚洲精品aa午夜观看| 一本大道综合伊人精品热热| 日韩经典中文字幕一区|