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

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

?? csp.c

?? 絕對好的源碼
?? C
字號:
/***************************************************************************** * csp.c: h264 encoder library ***************************************************************************** * Copyright (C) 2004 Laurent Aimar * $Id: csp.c,v 1.1 2004/06/03 19:27:06 fenrir Exp $ * * Authors: Laurent Aimar <fenrir@via.ecp.fr> * * 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 <stdio.h>#include <string.h>#include "common.h"static inline void plane_copy( uint8_t *dst, int i_dst,                               uint8_t *src, int i_src, int w, int h){    for( ; h > 0; h-- )    {        memcpy( dst, src, w );        dst += i_dst;        src += i_src;    }}static inline void plane_copy_vflip( uint8_t *dst, int i_dst,                                     uint8_t *src, int i_src, int w, int h){    plane_copy( dst, i_dst, src + (h -1)*i_src, -i_src, w, h );}static inline void plane_subsamplev2( uint8_t *dst, int i_dst,                                      uint8_t *src, int i_src, int w, int h){    for( ; h > 0; h-- )    {        uint8_t *d = dst;        uint8_t *s = src;        int     i;        for( i = 0; i < w; i++ )        {            *d++ = ( s[0] + s[i_src] + 1 ) >> 1;            s++;        }        dst += i_dst;        src += 2 * i_src;    }}static inline void plane_subsamplev2_vlip( uint8_t *dst, int i_dst,                                           uint8_t *src, int i_src, int w, int h){    plane_subsamplev2( dst, i_dst, src + (2*h-1)*i_src, -i_src, w, h );}static inline void plane_subsamplehv2( uint8_t *dst, int i_dst,                                       uint8_t *src, int i_src, int w, int h){    for( ; h > 0; h-- )    {        uint8_t *d = dst;        uint8_t *s = src;        int     i;        for( i = 0; i < w; i++ )        {            *d++ = ( s[0] + s[1] + s[i_src] + s[i_src+1] + 1 ) >> 2;            s += 2;        }        dst += i_dst;        src += 2 * i_src;    }}static inline void plane_subsamplehv2_vlip( uint8_t *dst, int i_dst,                                            uint8_t *src, int i_src, int w, int h){    plane_subsamplehv2( dst, i_dst, src + (2*h-1)*i_src, -i_src, w, h );}static void i420_to_i420( x264_frame_t *frm, x264_image_t *img,                          int i_width, int i_height ){    if( img->i_csp & X264_CSP_VFLIP )    {        plane_copy_vflip( frm->plane[0], frm->i_stride[0],                          img->plane[0], img->i_stride[0],                          i_width, i_height );        plane_copy_vflip( frm->plane[1], frm->i_stride[1],                          img->plane[1], img->i_stride[1],                          i_width / 2, i_height / 2 );        plane_copy_vflip( frm->plane[2], frm->i_stride[2],                          img->plane[2], img->i_stride[2],                          i_width / 2, i_height / 2 );    }    else    {        plane_copy( frm->plane[0], frm->i_stride[0],                    img->plane[0], img->i_stride[0],                    i_width, i_height );        plane_copy( frm->plane[1], frm->i_stride[1],                    img->plane[1], img->i_stride[1],                    i_width / 2, i_height / 2 );        plane_copy( frm->plane[2], frm->i_stride[2],                    img->plane[2], img->i_stride[2],                    i_width / 2, i_height / 2 );    }}static void yv12_to_i420( x264_frame_t *frm, x264_image_t *img,                          int i_width, int i_height ){    if( img->i_csp & X264_CSP_VFLIP )    {        plane_copy_vflip( frm->plane[0], frm->i_stride[0],                          img->plane[0], img->i_stride[0],                          i_width, i_height );        plane_copy_vflip( frm->plane[2], frm->i_stride[2],                          img->plane[1], img->i_stride[1],                          i_width / 2, i_height / 2 );        plane_copy_vflip( frm->plane[1], frm->i_stride[1],                          img->plane[2], img->i_stride[2],                          i_width / 2, i_height / 2 );    }    else    {        plane_copy( frm->plane[0], frm->i_stride[0],                    img->plane[0], img->i_stride[0],                    i_width, i_height );        plane_copy( frm->plane[2], frm->i_stride[2],                    img->plane[1], img->i_stride[1],                    i_width / 2, i_height / 2 );        plane_copy( frm->plane[1], frm->i_stride[1],                    img->plane[2], img->i_stride[2],                    i_width / 2, i_height / 2 );    }}static void i422_to_i420( x264_frame_t *frm, x264_image_t *img,                          int i_width, int i_height ){    if( img->i_csp & X264_CSP_VFLIP )    {        plane_copy_vflip( frm->plane[0], frm->i_stride[0],                          img->plane[0], img->i_stride[0],                          i_width, i_height );        plane_subsamplev2_vlip( frm->plane[1], frm->i_stride[1],                                img->plane[1], img->i_stride[1],                                i_width / 2, i_height / 2 );        plane_subsamplev2_vlip( frm->plane[2], frm->i_stride[2],                                img->plane[2], img->i_stride[2],                                i_width / 2, i_height / 2 );    }    else    {        plane_copy( frm->plane[0], frm->i_stride[0],                    img->plane[0], img->i_stride[0],                    i_width, i_height );        plane_subsamplev2( frm->plane[1], frm->i_stride[1],                           img->plane[1], img->i_stride[1],                           i_width / 2, i_height / 2 );        plane_subsamplev2( frm->plane[2], frm->i_stride[2],                           img->plane[2], img->i_stride[2],                           i_width / 2, i_height / 2 );    }}static void i444_to_i420( x264_frame_t *frm, x264_image_t *img,                          int i_width, int i_height ){    if( img->i_csp & X264_CSP_VFLIP )    {        plane_copy_vflip( frm->plane[0], frm->i_stride[0],                          img->plane[0], img->i_stride[0],                          i_width, i_height );        plane_subsamplehv2_vlip( frm->plane[1], frm->i_stride[1],                                 img->plane[1], img->i_stride[1],                                 i_width / 2, i_height / 2 );        plane_subsamplehv2_vlip( frm->plane[2], frm->i_stride[2],                                 img->plane[2], img->i_stride[2],                                 i_width / 2, i_height / 2 );    }    else    {        plane_copy( frm->plane[0], frm->i_stride[0],                    img->plane[0], img->i_stride[0],                    i_width, i_height );        plane_subsamplehv2( frm->plane[1], frm->i_stride[1],                            img->plane[1], img->i_stride[1],                            i_width / 2, i_height / 2 );        plane_subsamplehv2( frm->plane[2], frm->i_stride[2],                            img->plane[2], img->i_stride[2],                            i_width / 2, i_height / 2 );    }}static void yuyv_to_i420( x264_frame_t *frm, x264_image_t *img,                          int i_width, int i_height ){    uint8_t *src = img->plane[0];    int     i_src= img->i_stride[0];    uint8_t *y   = frm->plane[0];    uint8_t *u   = frm->plane[1];    uint8_t *v   = frm->plane[2];    if( img->i_csp & X264_CSP_VFLIP )    {        src += ( i_height - 1 ) * i_src;        i_src = -i_src;    }    for( ; i_height > 0; i_height -= 2 )    {        uint8_t *ss = src;        uint8_t *yy = y;        uint8_t *uu = u;        uint8_t *vv = v;        int w;        for( w = i_width; w > 0; w -= 2 )        {            *yy++ = ss[0];            *yy++ = ss[2];            *uu++ = ( ss[1] + ss[1+i_src] + 1 ) >> 1;            *vv++ = ( ss[3] + ss[3+i_src] + 1 ) >> 1;            ss += 4;        }        src += i_src;        y += frm->i_stride[0];        u += frm->i_stride[1];        v += frm->i_stride[2];        ss = src;        yy = y;        for( w = i_width; w > 0; w -= 2 )        {            *yy++ = ss[0];            *yy++ = ss[2];            ss += 4;        }        src += i_src;        y += frm->i_stride[0];    }}/* Same value than in XviD */#define BITS 8#define FIX(f) ((int)((f) * (1 << BITS) + 0.5))#define Y_R   FIX(0.257)#define Y_G   FIX(0.504)#define Y_B   FIX(0.098)#define Y_ADD 16#define U_R   FIX(0.148)#define U_G   FIX(0.291)#define U_B   FIX(0.439)#define U_ADD 128#define V_R   FIX(0.439)#define V_G   FIX(0.368)#define V_B   FIX(0.071)#define V_ADD 128#define RGB_TO_I420( name, POS_R, POS_G, POS_B, S_RGB ) \static void name( x264_frame_t *frm, x264_image_t *img, \                  int i_width, int i_height )           \{                                                       \    uint8_t *src = img->plane[0];                       \    int     i_src= img->i_stride[0];                    \    int     i_y  = frm->i_stride[0];                    \    uint8_t *y   = frm->plane[0];                       \    uint8_t *u   = frm->plane[1];                       \    uint8_t *v   = frm->plane[2];                       \                                                        \    if( img->i_csp & X264_CSP_VFLIP )                   \    {                                                   \        src += ( i_height - 1 ) * i_src;                \        i_src = -i_src;                                 \    }                                                   \                                                        \    for(  ; i_height > 0; i_height -= 2 )               \    {                                                   \        uint8_t *ss = src;                              \        uint8_t *yy = y;                                \        uint8_t *uu = u;                                \        uint8_t *vv = v;                                \        int w;                                          \                                                        \        for( w = i_width; w > 0; w -= 2 )               \        {                                               \            int cr = 0,cg = 0,cb = 0;                   \            int r, g, b;                                \                                                        \            /* Luma */                                  \            cr = r = ss[POS_R];                         \            cg = g = ss[POS_G];                         \            cb = b = ss[POS_B];                         \                                                        \            yy[0] = Y_ADD + ((Y_R * r + Y_G * g + Y_B * b) >> BITS);    \                                                        \            cr+= r = ss[POS_R+i_src];                   \            cg+= g = ss[POS_G+i_src];                   \            cb+= b = ss[POS_B+i_src];                   \            yy[i_y] = Y_ADD + ((Y_R * r + Y_G * g + Y_B * b) >> BITS);  \            yy++;                                       \            ss += S_RGB;                                \                                                        \            cr+= r = ss[POS_R];                         \            cg+= g = ss[POS_G];                         \            cb+= b = ss[POS_B];                         \                                                        \            yy[0] = Y_ADD + ((Y_R * r + Y_G * g + Y_B * b) >> BITS);    \                                                        \            cr+= r = ss[POS_R+i_src];                   \            cg+= g = ss[POS_G+i_src];                   \            cb+= b = ss[POS_B+i_src];                   \            yy[i_y] = Y_ADD + ((Y_R * r + Y_G * g + Y_B * b) >> BITS);  \            yy++;                                       \            ss += S_RGB;                                \                                                        \            /* Chroma */                                \            *uu++ = (uint8_t)(U_ADD + ((-U_R * cr - U_G * cg + U_B * cb) >> (BITS+2)) ); \            *vv++ = (uint8_t)(V_ADD + (( V_R * cr - V_G * cg - V_B * cb) >> (BITS+2)) ); \        }                                               \                                                        \        src += 2*i_src;                                   \        y += 2*frm->i_stride[0];                        \        u += frm->i_stride[1];                          \        v += frm->i_stride[2];                          \    }                                                   \}RGB_TO_I420( rgb_to_i420,  0, 1, 2, 3 );RGB_TO_I420( bgr_to_i420,  2, 1, 0, 3 );RGB_TO_I420( bgra_to_i420, 2, 1, 0, 4 );void x264_csp_init( int cpu, int i_csp, x264_csp_function_t *pf ){    switch( i_csp )    {        case X264_CSP_I420:            pf->i420 = i420_to_i420;            pf->i422 = i422_to_i420;            pf->i444 = i444_to_i420;            pf->yv12 = yv12_to_i420;            pf->yuyv = yuyv_to_i420;            pf->rgb  = rgb_to_i420;            pf->bgr  = bgr_to_i420;            pf->bgra = bgra_to_i420;            break;        default:            /* For now, can't happen */            fprintf( stderr, "arg in x264_csp_init\n" );            exit( -1 );            break;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产精品成人| 久久免费午夜影院| 欧美videos大乳护士334| 国产精品你懂的在线| 一级精品视频在线观看宜春院| 精品一区二区三区免费观看 | 国内精品久久久久影院薰衣草| 成人精品国产免费网站| 日韩一二三区不卡| 亚洲综合清纯丝袜自拍| 99精品欧美一区二区三区小说| 日韩免费视频一区二区| 日韩黄色片在线观看| 91九色02白丝porn| 亚洲视频一区在线观看| 懂色av一区二区三区蜜臀| 久久影院午夜论| 美女视频第一区二区三区免费观看网站| 91免费在线视频观看| 国产精品久久午夜夜伦鲁鲁| 激情文学综合网| 精品粉嫩超白一线天av| 蜜臀av一级做a爰片久久| 欧美美女直播网站| 亚洲国产一区二区视频| 91国偷自产一区二区开放时间 | 亚洲午夜久久久久久久久久久| kk眼镜猥琐国模调教系列一区二区| 日韩欧美成人激情| 奇米精品一区二区三区四区| 日韩一区二区在线免费观看| 一片黄亚洲嫩模| 欧美三级日韩三级| 午夜精品福利一区二区三区av | 成人app软件下载大全免费| 国产日韩精品一区二区三区| 国产米奇在线777精品观看| 欧美mv日韩mv国产网站| 国产一区 二区| 亚洲国产岛国毛片在线| 91蜜桃视频在线| 亚洲免费av在线| 欧美群妇大交群的观看方式| 亚洲成人av资源| 精品久久久久久久久久久久久久久| 精品在线亚洲视频| 欧美激情中文不卡| 不卡的电视剧免费网站有什么| 最近日韩中文字幕| 欧美伊人精品成人久久综合97| 调教+趴+乳夹+国产+精品| 精品欧美一区二区三区精品久久 | 久久久久久久久久看片| 国产成人啪免费观看软件| 国产精品蜜臀在线观看| 欧洲av一区二区嗯嗯嗯啊| 亚洲精品午夜久久久| 欧美日韩国产免费| 国产一区二区三区高清播放| 国产精品天干天干在线综合| 色妹子一区二区| 蜜臀av一区二区在线免费观看 | 久久综合九色综合97婷婷女人 | 亚洲免费在线视频| 欧美日韩国产在线播放网站| 免费成人av在线播放| 国产精品午夜在线| 9191成人精品久久| 粗大黑人巨茎大战欧美成人| 亚洲va欧美va人人爽午夜| 精品成人在线观看| 91成人免费电影| 国产精品99久久久久久久vr | 亚洲理论在线观看| 欧美成人午夜电影| 一本色道久久加勒比精品| 日本亚洲免费观看| 亚洲精品福利视频网站| 欧美精品一区视频| 欧美日韩高清在线| 不卡区在线中文字幕| 日韩电影在线一区二区三区| 国产精品人妖ts系列视频| 3751色影院一区二区三区| 91免费版在线| 国产成都精品91一区二区三| 婷婷成人综合网| 亚洲精品视频免费看| 国产日本一区二区| 欧美大白屁股肥臀xxxxxx| 一本一道久久a久久精品| 国产福利一区二区三区在线视频| 日本欧美久久久久免费播放网| 亚洲日本乱码在线观看| 国产日产亚洲精品系列| 日韩欧美精品三级| 日韩欧美一卡二卡| 欧美肥妇毛茸茸| 欧美高清视频一二三区 | 一卡二卡三卡日韩欧美| 国产精品久久久久久久蜜臀| 2欧美一区二区三区在线观看视频| 欧美视频精品在线观看| 色噜噜狠狠色综合中国| 99久久精品免费看国产免费软件| 国产成人av电影免费在线观看| 久久精品国内一区二区三区| 日韩精品1区2区3区| 日韩av电影天堂| 日本欧美一区二区| 美腿丝袜亚洲色图| 精品一区二区三区久久久| 美女网站色91| 国内精品在线播放| 国产成人亚洲综合a∨婷婷图片| 国产一区二区三区久久悠悠色av| 久久成人麻豆午夜电影| 国产在线不卡一区| 成人午夜精品在线| 91麻豆视频网站| 欧美性一二三区| 7777精品伊人久久久大香线蕉| 欧美日韩国产中文| 精品国内二区三区| 中文字幕第一区第二区| 亚洲欧美日韩成人高清在线一区| 亚洲女同一区二区| 亚洲宅男天堂在线观看无病毒| 亚洲国产另类av| 久久精品噜噜噜成人88aⅴ| 国产尤物一区二区| 91影院在线观看| 欧美日免费三级在线| 欧美大片一区二区三区| 国产亚洲一区二区三区在线观看| 国产目拍亚洲精品99久久精品| 国产精品免费人成网站| 一区二区理论电影在线观看| 天天综合色天天| 国产成人综合亚洲91猫咪| 在线欧美日韩精品| 精品奇米国产一区二区三区| 国产精品久久久久久久久久久免费看 | 国产精品福利av| 午夜视频一区二区| 国产精品一线二线三线精华| 99久久精品免费| 欧美精品xxxxbbbb| 国产精品天干天干在观线| 亚洲综合丝袜美腿| 国产高清成人在线| 欧美色成人综合| 亚洲国产高清不卡| 日韩高清不卡一区二区三区| 成人开心网精品视频| 欧美日韩大陆在线| 国产精品国产精品国产专区不蜜| 日韩综合一区二区| jvid福利写真一区二区三区| 欧美一区二区精品| 亚洲精品日日夜夜| 国产一区二区三区蝌蚪| 在线观看日韩精品| 日本一区二区三级电影在线观看| 亚洲综合成人在线| aa级大片欧美| 精品国产91亚洲一区二区三区婷婷| 亚洲人成影院在线观看| 国产在线播精品第三| 欧美猛男gaygay网站| 亚洲欧美国产高清| 丁香另类激情小说| 精品久久五月天| 日本不卡不码高清免费观看| 色网综合在线观看| 国产精品欧美精品| 国产在线不卡视频| 日韩欧美国产精品| 婷婷久久综合九色综合伊人色| 91一区一区三区| 亚洲欧美在线高清| 国产成都精品91一区二区三| 精品奇米国产一区二区三区| 石原莉奈在线亚洲三区| 欧美色网站导航| 亚洲影视在线播放| 欧美日韩专区在线| 亚洲一区二区三区四区在线观看| 91老师国产黑色丝袜在线| 亚洲国产精品99久久久久久久久| 国产精品一区二区黑丝| 欧美www视频| 国产精品一线二线三线| 欧美精品一区男女天堂| 国产在线一区二区| 久久综合丝袜日本网| 国产一区二区成人久久免费影院| 26uuu国产日韩综合| 国产最新精品精品你懂的| 欧美变态tickling挠脚心|