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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mc_prediction.c

?? 壓縮JM12.3d的完整的全部C語言的代碼文檔,用于嵌入式系統(tǒng)的壓縮編解碼
?? 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++)
        {        

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久综合网欧美综合网 | 成人动漫视频在线| 亚洲美女在线国产| 日韩一区二区三区免费看| 国产成人综合在线播放| 亚洲欧美一区二区久久| 欧美一区二区三区视频免费| 粉嫩欧美一区二区三区高清影视| 亚洲人成精品久久久久| 日韩欧美中文字幕一区| 97久久精品人人爽人人爽蜜臀| 亚洲欧美国产77777| 久久男人中文字幕资源站| 91精彩视频在线| 国产一区二区中文字幕| 亚洲国产精品欧美一二99| 国产天堂亚洲国产碰碰| 91超碰这里只有精品国产| 亚洲伊人伊色伊影伊综合网| 麻豆一区二区99久久久久| 在线亚洲+欧美+日本专区| 国产老肥熟一区二区三区| 亚洲成av人片在线观看| 亚洲精品一线二线三线| 夜夜嗨av一区二区三区网页| 成人免费毛片片v| 美女视频黄免费的久久| 亚洲精品水蜜桃| 欧美精品一区二区在线播放| 欧美性猛交xxxx黑人交| www.综合网.com| 国内一区二区视频| 日韩和的一区二区| 一区二区三区美女| 中文字幕日韩av资源站| 亚洲精品一区二区三区香蕉| 91精品国产综合久久精品app | 国产一区二区剧情av在线| 亚洲一区二区av在线| 中文在线一区二区| 久久久久久电影| 欧美不卡123| 日韩丝袜情趣美女图片| 欧美日韩三级一区| 日韩欧美精品在线| 久久网站最新地址| 视频一区国产视频| 亚洲图片欧美综合| 亚洲日本在线天堂| 亚洲欧美怡红院| 欧美国产精品久久| 国产三级精品在线| 国产亚洲va综合人人澡精品| 欧美一卡二卡三卡四卡| 欧美福利视频一区| 91精品国产综合久久久久久漫画 | 国产黄色成人av| 国产自产v一区二区三区c| 久久精品国产精品亚洲精品| 美女脱光内衣内裤视频久久网站| 看电视剧不卡顿的网站| 日韩高清在线电影| 免费在线观看一区二区三区| 亚洲午夜精品久久久久久久久| 久久久久国产成人精品亚洲午夜| 欧美色精品在线视频| 国产成人免费在线观看不卡| 久久久久国产精品麻豆ai换脸| 欧美精品1区2区| 狠狠色伊人亚洲综合成人| 九九精品一区二区| 国产黄色成人av| 91影视在线播放| 一本大道久久a久久精品综合| 国产成人无遮挡在线视频| 成人一道本在线| 成人av影视在线观看| 91免费看`日韩一区二区| 91麻豆自制传媒国产之光| 成人高清视频在线观看| 色婷婷精品大在线视频| 欧美一区二区三区四区在线观看| 日韩精品专区在线| 国产欧美日韩激情| 一区二区三区中文字幕在线观看| 亚洲国产aⅴ天堂久久| 日本亚洲最大的色成网站www| 久久国产欧美日韩精品| 欧美日韩一区成人| 中文一区二区完整视频在线观看 | 91精品国产综合久久久久久久| 欧美日高清视频| 日韩精品中文字幕在线一区| 国产精品久久久久精k8| 亚洲国产三级在线| 国产精品一区二区在线观看不卡| 99免费精品在线观看| 欧美日韩国产天堂| 在线播放欧美女士性生活| 日韩一级大片在线观看| 亚洲日本免费电影| 成人国产在线观看| 99久久99久久免费精品蜜臀| 欧洲一区二区三区免费视频| 久久伊人蜜桃av一区二区| 亚洲午夜在线视频| 肉丝袜脚交视频一区二区| 另类小说视频一区二区| 99精品视频一区| 欧美久久久久久久久中文字幕| 91精品国产一区二区人妖| 亚洲欧美综合网| 男女性色大片免费观看一区二区 | 亚洲国产裸拍裸体视频在线观看乱了| 午夜视频一区二区三区| 久久99国产精品久久99果冻传媒| 色域天天综合网| 久久久噜噜噜久久中文字幕色伊伊| 亚洲卡通动漫在线| 韩国女主播一区| 欧美精品高清视频| 免费成人在线观看| 亚洲丝袜精品丝袜在线| 亚洲国产精品久久人人爱| 福利一区二区在线| 日韩欧美www| 亚洲福利视频三区| bt欧美亚洲午夜电影天堂| 久久这里只有精品首页| 日韩中文字幕一区二区三区| 91在线精品一区二区| 久久精品欧美一区二区三区麻豆 | 日本亚洲电影天堂| 色综合av在线| 亚洲欧洲三级电影| 顶级嫩模精品视频在线看| 欧美大片在线观看一区| 日韩经典中文字幕一区| 北条麻妃一区二区三区| 视频一区在线视频| 欧美一区二区免费视频| 91丨porny丨蝌蚪视频| 久久久久国产一区二区三区四区| 亚洲国产一二三| 久久久久久久久97黄色工厂| 蜜桃视频在线一区| 欧美激情艳妇裸体舞| 亚洲大片免费看| 欧美一区二区三区在线视频| 成人一区二区视频| 国产精品美女久久久久av爽李琼| 日韩中文字幕1| 欧美人体做爰大胆视频| 亚洲国产婷婷综合在线精品| 在线一区二区三区四区五区| 一区二区三区在线视频免费观看| 99re在线精品| 亚洲免费视频成人| 国产99一区视频免费| 欧美一区二区不卡视频| 免费高清不卡av| 久久久综合视频| 狠狠色丁香婷综合久久| 久久久www成人免费无遮挡大片| 九色综合国产一区二区三区| 日韩一级大片在线| 麻豆精品在线看| 亚洲精品一区二区三区99| 久久不见久久见中文字幕免费| 欧美不卡一区二区| 从欧美一区二区三区| 亚洲欧美日韩精品久久久久| 国产91精品久久久久久久网曝门 | av电影一区二区| 亚洲女爱视频在线| 欧美日本在线一区| 美洲天堂一区二卡三卡四卡视频| 久久亚洲一区二区三区明星换脸 | 欧美午夜在线一二页| 亚洲美女淫视频| 宅男噜噜噜66一区二区66| 国产在线播放一区三区四| 国产精品视频一二三区| 色欧美片视频在线观看在线视频| 性做久久久久久久久| 精品成人一区二区三区四区| 国产v日产∨综合v精品视频| 亚洲老司机在线| 91年精品国产| 一区二区三区高清| 国产丶欧美丶日本不卡视频| 成人激情黄色小说| 欧美色综合网站| 免费在线看成人av| 亚洲色图欧洲色图| 欧美va亚洲va香蕉在线 | 欧美色图片你懂的| 国产成人在线观看免费网站| 天天色图综合网| 亚洲乱码国产乱码精品精98午夜 |