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

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

?? mc.c

?? 絕對好的源碼
?? C
字號:
/***************************************************************************** * mc.c: h264 encoder library (Motion Compensation) ***************************************************************************** * Copyright (C) 2003 Laurent Aimar * $Id: mc.c,v 1.1 2004/06/03 19:27:07 fenrir Exp $ * * Authors: Eric Petit <titer@m0k.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA. *****************************************************************************/#include <stdlib.h>#include <stdio.h>#include <string.h>#include <stdint.h>#include <stdarg.h>#ifdef SYS_LINUX#include <altivec.h>#endif#include "x264.h"#include "common/mc.h"#include "common/clip1.h"#include "mc.h"#include "ppccommon.h"typedef void (*pf_mc_t)( uint8_t *src, int i_src,                         uint8_t *dst, int i_dst, int i_height );static inline int x264_tapfilter( uint8_t *pix, int i_pix_next ){    return pix[-2*i_pix_next] - 5*pix[-1*i_pix_next] + 20*(pix[0] +           pix[1*i_pix_next]) - 5*pix[ 2*i_pix_next] +           pix[ 3*i_pix_next];}static inline int x264_tapfilter1( uint8_t *pix ){    return pix[-2] - 5*pix[-1] + 20*(pix[0] + pix[1]) - 5*pix[ 2] +           pix[ 3];}/* pixel_avg */static inline void pixel_avg_w4( uint8_t *dst,  int i_dst,                                 uint8_t *src1, int i_src1,                                 uint8_t *src2, int i_src2,                                 int i_height ){    int x, y;    for( y = 0; y < i_height; y++ )    {        for( x = 0; x < 4; x++ )        {            dst[x] = ( src1[x] + src2[x] + 1 ) >> 1;        }        dst  += i_dst;        src1 += i_src1;        src2 += i_src2;    }}static inline void pixel_avg_w8( uint8_t *dst,  int i_dst,                                 uint8_t *src1, int i_src1,                                 uint8_t *src2, int i_src2,                                 int i_height ){    int y;    vec_u8_t src1v, src2v;    LOAD_ZERO;    PREP_LOAD;    PREP_STORE8;    for( y = 0; y < i_height; y++ )    {        VEC_LOAD( src1, src1v, 8, vec_u8_t );        VEC_LOAD( src2, src2v, 8, vec_u8_t );        src1v = vec_avg( src1v, src2v );        VEC_STORE8( src1v, dst );        dst  += i_dst;        src1 += i_src1;        src2 += i_src2;    }}static inline void pixel_avg_w16( uint8_t *dst,  int i_dst,                                  uint8_t *src1, int i_src1,                                  uint8_t *src2, int i_src2,                                  int i_height ){    int y;    vec_u8_t src1v, src2v;    PREP_LOAD;    PREP_STORE16;    for( y = 0; y < i_height; y++ )    {        VEC_LOAD( src1, src1v, 16, vec_u8_t );        VEC_LOAD( src2, src2v, 16, vec_u8_t );        src1v = vec_avg( src1v, src2v );        VEC_STORE16( src1v, dst );        dst  += i_dst;        src1 += i_src1;        src2 += i_src2;    }}/* mc_copy: plain c */#define MC_COPY( name, a )                                \static void name( uint8_t *src, int i_src,                \                  uint8_t *dst, int i_dst, int i_height ) \{                                                         \    int y;                                                \    for( y = 0; y < i_height; y++ )                       \    {                                                     \        memcpy( dst, src, a );                            \        src += i_src;                                     \        dst += i_dst;                                     \    }                                                     \}MC_COPY( mc_copy_w4,  4  )MC_COPY( mc_copy_w8,  8  )MC_COPY( mc_copy_w16, 16 )void mc_luma_altivec( uint8_t *src[4], int i_src_stride,                      uint8_t *dst,    int i_dst_stride,                      int mvx, int mvy,                      int i_width, int i_height ){    uint8_t *src1, *src2;        /* todo : fixme... */    int correction = (((mvx&3) == 3 && (mvy&3) == 1) || ((mvx&3) == 1 && (mvy&3) == 3)) ? 1:0;        int hpel1x = mvx>>1;    int hpel1y = (mvy+1-correction)>>1;    int filter1 = (hpel1x & 1) + ( (hpel1y & 1) << 1 );            src1 = src[filter1] + (hpel1y >> 1) * i_src_stride + (hpel1x >> 1);        if ( (mvx|mvy) & 1 ) /* qpel interpolation needed */    {        int hpel2x = (mvx+1)>>1;        int hpel2y = (mvy+correction)>>1;        int filter2 = (hpel2x & 1) + ( (hpel2y & 1) <<1 );                src2 = src[filter2] + (hpel2y >> 1) * i_src_stride + (hpel2x >> 1);                switch(i_width) {        case 4:            pixel_avg_w4( dst, i_dst_stride, src1, i_src_stride,                          src2, i_src_stride, i_height );            break;        case 8:            pixel_avg_w8( dst, i_dst_stride, src1, i_src_stride,                          src2, i_src_stride, i_height );            break;        case 16:        default:            pixel_avg_w16( dst, i_dst_stride, src1, i_src_stride,                           src2, i_src_stride, i_height );        }            }    else    {        switch(i_width) {        case 4:            mc_copy_w4( src1, i_src_stride, dst, i_dst_stride, i_height );            break;        case 8:            mc_copy_w8( src1, i_src_stride, dst, i_dst_stride, i_height );            break;        case 16:            mc_copy_w16( src1, i_src_stride, dst, i_dst_stride, i_height );            break;        }            }}uint8_t *get_ref_altivec( uint8_t *src[4], int i_src_stride,                          uint8_t *dst,    int * i_dst_stride,                          int mvx, int mvy,                          int i_width, int i_height ){    uint8_t *src1, *src2;        /* todo : fixme... */    int correction = (((mvx&3) == 3 && (mvy&3) == 1) || ((mvx&3) == 1 && (mvy&3) == 3)) ? 1:0;        int hpel1x = mvx>>1;    int hpel1y = (mvy+1-correction)>>1;    int filter1 = (hpel1x & 1) + ( (hpel1y & 1) << 1 );            src1 = src[filter1] + (hpel1y >> 1) * i_src_stride + (hpel1x >> 1);        if ( (mvx|mvy) & 1 ) /* qpel interpolation needed */    {        int hpel2x = (mvx+1)>>1;        int hpel2y = (mvy+correction)>>1;        int filter2 = (hpel2x & 1) + ( (hpel2y & 1) <<1 );                src2 = src[filter2] + (hpel2y >> 1) * i_src_stride + (hpel2x >> 1);                switch(i_width) {        case 4:            pixel_avg_w4( dst, *i_dst_stride, src1, i_src_stride,                          src2, i_src_stride, i_height );            break;        case 8:            pixel_avg_w8( dst, *i_dst_stride, src1, i_src_stride,                          src2, i_src_stride, i_height );            break;        case 16:        default:            pixel_avg_w16( dst, *i_dst_stride, src1, i_src_stride,                          src2, i_src_stride, i_height );        }        return dst;    }    else    {        *i_dst_stride = i_src_stride;        return src1;    }}static void mc_chroma_c( uint8_t *src, int i_src_stride,                         uint8_t *dst, int i_dst_stride,                         int mvx, int mvy,                         int i_width, int i_height ){    uint8_t *srcp;    int x, y;    int d8x = mvx & 0x07;    int d8y = mvy & 0x07;    DECLARE_ALIGNED( uint16_t, coeff[4], 16 );    coeff[0] = (8-d8x)*(8-d8y);    coeff[1] = d8x    *(8-d8y);    coeff[2] = (8-d8x)*d8y;    coeff[3] = d8x    *d8y;    src  += (mvy >> 3) * i_src_stride + (mvx >> 3);    srcp  = &src[i_src_stride];    /* TODO: optimize */    for( y = 0; y < i_height; y++ )    {        for( x = 0; x < i_width; x++ )        {            dst[x] = ( coeff[0]*src[x]  + coeff[1]*src[x+1] +                       coeff[2]*srcp[x] + coeff[3]*srcp[x+1] + 32 ) >> 6;        }        dst  += i_dst_stride;        src   = srcp;        srcp += i_src_stride;    }}#define DO_PROCESS(a) \        src##a##v_16 = vec_u8_to_u16( src##a##v_8 ); \        src##a##v_16 = vec_mladd( coeff##a##v, src##a##v_16, zero_u16v ); \        dstv_16      = vec_add( dstv_16, src##a##v_16 )static void mc_chroma_altivec_4xh( uint8_t *src, int i_src_stride,                                   uint8_t *dst, int i_dst_stride,                                   int mvx, int mvy,                                   int i_height ){    uint8_t *srcp;    int y;    int d8x = mvx & 0x07;    int d8y = mvy & 0x07;    DECLARE_ALIGNED( uint16_t, coeff[4], 16 );    coeff[0] = (8-d8x)*(8-d8y);    coeff[1] = d8x    *(8-d8y);    coeff[2] = (8-d8x)*d8y;    coeff[3] = d8x    *d8y;    src  += (mvy >> 3) * i_src_stride + (mvx >> 3);    srcp  = &src[i_src_stride];        LOAD_ZERO;    PREP_LOAD;    PREP_STORE4;    vec_u16_t   coeff0v, coeff1v, coeff2v, coeff3v;    vec_u8_t    src0v_8, src1v_8, src2v_8, src3v_8;    vec_u16_t   src0v_16, src1v_16, src2v_16, src3v_16;    vec_u8_t    dstv_8;    vec_u16_t   dstv_16;    vec_u8_t    permv;    vec_u16_t   shiftv;    vec_u16_t   k32v;        coeff0v = vec_ld( 0, coeff );    coeff3v = vec_splat( coeff0v, 3 );    coeff2v = vec_splat( coeff0v, 2 );    coeff1v = vec_splat( coeff0v, 1 );    coeff0v = vec_splat( coeff0v, 0 );    k32v    = vec_sl( vec_splat_u16( 1 ), vec_splat_u16( 5 ) );    permv   = vec_lvsl( 0, (uint8_t *) 1 );    shiftv  = vec_splat_u16( 6 );    VEC_LOAD( src, src2v_8, 5, vec_u8_t );    src3v_8 = vec_perm( src2v_8, src2v_8, permv );    for( y = 0; y < i_height; y++ )    {        src0v_8 = src2v_8;        src1v_8 = src3v_8;        VEC_LOAD( srcp, src2v_8, 5, vec_u8_t );        src3v_8 = vec_perm( src2v_8, src2v_8, permv );        dstv_16 = k32v;        DO_PROCESS( 0 );        DO_PROCESS( 1 );        DO_PROCESS( 2 );        DO_PROCESS( 3 );        dstv_16 = vec_sr( dstv_16, shiftv );        dstv_8  = vec_u16_to_u8( dstv_16 );        VEC_STORE4( dstv_8, dst );        dst  += i_dst_stride;        srcp += i_src_stride;    }}static void mc_chroma_altivec_8xh( uint8_t *src, int i_src_stride,                                   uint8_t *dst, int i_dst_stride,                                   int mvx, int mvy,                                   int i_height ){    uint8_t *srcp;    int y;    int d8x = mvx & 0x07;    int d8y = mvy & 0x07;    DECLARE_ALIGNED( uint16_t, coeff[4], 16 );    coeff[0] = (8-d8x)*(8-d8y);    coeff[1] = d8x    *(8-d8y);    coeff[2] = (8-d8x)*d8y;    coeff[3] = d8x    *d8y;    src  += (mvy >> 3) * i_src_stride + (mvx >> 3);    srcp  = &src[i_src_stride];        LOAD_ZERO;    PREP_LOAD;    PREP_STORE8;    vec_u16_t   coeff0v, coeff1v, coeff2v, coeff3v;    vec_u8_t    src0v_8, src1v_8, src2v_8, src3v_8;    vec_u16_t   src0v_16, src1v_16, src2v_16, src3v_16;    vec_u8_t    dstv_8;    vec_u16_t   dstv_16;    vec_u8_t    permv;    vec_u16_t   shiftv;    vec_u16_t   k32v;        coeff0v = vec_ld( 0, coeff );    coeff3v = vec_splat( coeff0v, 3 );    coeff2v = vec_splat( coeff0v, 2 );    coeff1v = vec_splat( coeff0v, 1 );    coeff0v = vec_splat( coeff0v, 0 );    k32v    = vec_sl( vec_splat_u16( 1 ), vec_splat_u16( 5 ) );    permv   = vec_lvsl( 0, (uint8_t *) 1 );    shiftv  = vec_splat_u16( 6 );    VEC_LOAD( src, src2v_8, 9, vec_u8_t );    src3v_8 = vec_perm( src2v_8, src2v_8, permv );    for( y = 0; y < i_height; y++ )    {        src0v_8 = src2v_8;        src1v_8 = src3v_8;        VEC_LOAD( srcp, src2v_8, 9, vec_u8_t );        src3v_8 = vec_perm( src2v_8, src2v_8, permv );        dstv_16 = k32v;        DO_PROCESS( 0 );        DO_PROCESS( 1 );        DO_PROCESS( 2 );        DO_PROCESS( 3 );        dstv_16 = vec_sr( dstv_16, shiftv );        dstv_8  = vec_u16_to_u8( dstv_16 );        VEC_STORE8( dstv_8, dst );        dst  += i_dst_stride;        srcp += i_src_stride;    }}static void mc_chroma_altivec( uint8_t *src, int i_src_stride,                               uint8_t *dst, int i_dst_stride,                               int mvx, int mvy,                               int i_width, int i_height ){    if( i_width == 8 )    {        mc_chroma_altivec_8xh( src, i_src_stride, dst, i_dst_stride,                               mvx, mvy, i_height );        return;    }    if( i_width == 4 )    {        mc_chroma_altivec_4xh( src, i_src_stride, dst, i_dst_stride,                               mvx, mvy, i_height );        return;    }    mc_chroma_c( src, i_src_stride, dst, i_dst_stride,                 mvx, mvy, i_width, i_height );}void x264_mc_altivec_init( x264_mc_functions_t *pf ){    pf->mc_luma   = mc_luma_altivec;    pf->get_ref   = get_ref_altivec;    pf->mc_chroma = mc_chroma_altivec;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av电影一区二区| 亚洲人成影院在线观看| 成人精品视频一区| 性欧美疯狂xxxxbbbb| 精品福利一区二区三区免费视频| 精品一二三四区| 亚洲成人av一区二区| 亚洲国产精品黑人久久久| 7777精品伊人久久久大香线蕉完整版 | 精品国产免费一区二区三区香蕉| av在线综合网| 国产成人在线视频网址| 亚洲午夜久久久久久久久久久| 久久久高清一区二区三区| 欧美高清一级片在线| av亚洲精华国产精华精华| 久久99精品国产麻豆婷婷洗澡| 亚洲一区二三区| 亚洲欧美电影一区二区| 中文字幕一区av| 日韩欧美亚洲国产另类| 日韩区在线观看| 欧美精品一区二区三区蜜臀 | 成人免费观看男女羞羞视频| 亚洲国产美女搞黄色| 亚洲美女淫视频| 久久综合狠狠综合久久综合88 | 久久综合久色欧美综合狠狠| 欧美成人三级在线| 欧美精品一区二区在线播放| 3d动漫精品啪啪| 欧美成人激情免费网| 精品国产91九色蝌蚪| 久久久久久久综合日本| 欧美国产一区在线| 亚洲欧洲av另类| 婷婷成人综合网| 国产原创一区二区| 成人开心网精品视频| 欧美视频精品在线观看| 91麻豆精品国产综合久久久久久| 日韩欧美中文一区| wwwwww.欧美系列| 日本一区二区动态图| 亚洲欧美偷拍另类a∨色屁股| 亚洲一二三四在线观看| 九九**精品视频免费播放| 波多野结衣91| 日韩免费福利电影在线观看| 国产精品福利一区| 亚洲国产美女搞黄色| 日韩高清不卡一区| 国产91精品欧美| 日韩一区二区三区视频在线| 国产欧美精品一区| 成人毛片视频在线观看| 日韩欧美一级片| 亚洲自拍偷拍综合| 成人黄色大片在线观看| 91精品国产一区二区三区香蕉| 精品捆绑美女sm三区| 亚洲午夜精品一区二区三区他趣| 国产呦精品一区二区三区网站| 欧美日韩久久不卡| 亚洲激情成人在线| av不卡一区二区三区| 国产亚洲精品aa午夜观看| 美女视频免费一区| 欧美老女人第四色| 亚洲欧洲韩国日本视频| av福利精品导航| 亚洲国产成人私人影院tom| 免费观看一级欧美片| 欧美日本在线看| 日本午夜精品视频在线观看| 欧美日韩一区二区三区免费看| 夜夜爽夜夜爽精品视频| 在线视频综合导航| 亚洲自拍另类综合| 一本色道久久综合亚洲精品按摩| 最新国产成人在线观看| 在线这里只有精品| 午夜欧美一区二区三区在线播放| 欧美性猛片aaaaaaa做受| 亚洲图片欧美色图| xfplay精品久久| 国产成人精品免费看| 久久久久99精品国产片| 成人免费毛片高清视频| 亚洲综合一二区| 欧美男女性生活在线直播观看| 美女一区二区视频| 久久久久88色偷偷免费| 一本大道久久a久久精品综合| 丝袜亚洲精品中文字幕一区| 久久久精品tv| 在线免费观看日韩欧美| 日本不卡视频在线观看| 国产精品丝袜在线| 亚洲免费色视频| 亚洲精品一区二区在线观看| 91福利区一区二区三区| 精品亚洲成av人在线观看| 一区二区免费在线| 精品91自产拍在线观看一区| 色88888久久久久久影院野外| 精品一区二区三区av| 亚洲一区二区偷拍精品| 中文字幕精品一区二区三区精品| 7777精品伊人久久久大香线蕉的 | 亚洲视频一二三| 欧美精品一区二区不卡| 91超碰这里只有精品国产| 国产成人午夜视频| 韩国一区二区视频| 偷拍亚洲欧洲综合| 亚洲一区在线视频| 亚洲视频网在线直播| 久久久久九九视频| 欧美成人一级视频| 日韩欧美在线一区二区三区| 欧美一区二区在线免费观看| 欧洲视频一区二区| 色综合夜色一区| 不卡一区在线观看| 国产99久久久国产精品| 国产成人av电影在线播放| 久久99精品国产| 九色|91porny| 国产精品一卡二卡在线观看| 激情欧美一区二区| 久久91精品久久久久久秒播| 卡一卡二国产精品 | 国产iv一区二区三区| 毛片av中文字幕一区二区| 久久成人免费网站| 韩国成人在线视频| 成人性视频免费网站| 色狠狠综合天天综合综合| 欧美日韩免费高清一区色橹橹| 91高清视频在线| 国产伦精品一区二区三区在线观看| 亚洲电影在线播放| 视频一区二区三区在线| 亚洲电影视频在线| 蜜臀精品一区二区三区在线观看| 日韩主播视频在线| 久久精品av麻豆的观看方式| 久久99精品国产麻豆不卡| zzijzzij亚洲日本少妇熟睡| 在线观看国产日韩| 久久久91精品国产一区二区三区| 中文字幕一区二区三区av| 亚洲精品v日韩精品| 蜜桃久久久久久久| 色狠狠色噜噜噜综合网| 91精品黄色片免费大全| 中文字幕av一区二区三区高| 亚洲国产另类精品专区| 国产精品中文有码| 欧美一区二区视频在线观看| 国产精品成人一区二区艾草 | 激情图片小说一区| 欧美久久久久免费| 亚洲欧美激情小说另类| 国产精品一区二区你懂的| 欧美色老头old∨ideo| 国产亚洲综合av| 九九**精品视频免费播放| 国产精品第13页| a级精品国产片在线观看| 久久精品人人做人人综合 | 性欧美大战久久久久久久久| 91福利视频在线| 亚洲午夜在线观看视频在线| 色综合天天视频在线观看| 亚洲第一二三四区| 日韩欧美一区二区视频| 国产一区在线观看麻豆| 中文字幕av一区 二区| 白白色 亚洲乱淫| 亚洲成av人片在线| 欧美电影免费观看高清完整版| 国产精品亚洲视频| 亚洲乱码国产乱码精品精的特点| 色欧美片视频在线观看在线视频| 性做久久久久久久免费看| 精品电影一区二区三区 | 成人av在线网| 亚洲成人自拍网| 久久久99久久| 欧美精品123区| 99国产精品久久久| 日韩高清一区二区| 中文字幕av一区二区三区高| 欧美美女直播网站| av亚洲精华国产精华| 久久99热这里只有精品| 亚洲免费观看在线观看| 26uuu成人网一区二区三区|