亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美日本一区二区| av亚洲精华国产精华| 夜夜嗨av一区二区三区中文字幕 | 亚洲欧美电影院| 久久美女艺术照精彩视频福利播放| 日韩欧美视频在线| 欧美大胆人体bbbb| 国产亚洲一区二区在线观看| 久久久久久久综合日本| 久久精品综合网| 亚洲少妇最新在线视频| 一区二区欧美视频| 视频一区中文字幕国产| 三级成人在线视频| 激情丁香综合五月| 99麻豆久久久国产精品免费| 色菇凉天天综合网| 日韩美女视频在线| 欧美高清在线一区二区| 亚洲一区影音先锋| 欧美aⅴ一区二区三区视频| 久久99热这里只有精品| 国产盗摄一区二区| 91麻豆swag| 欧美一卡二卡三卡| 18涩涩午夜精品.www| 亚洲国产成人av| 国产一区二区三区最好精华液| 不卡视频一二三| 91精品综合久久久久久| 欧美激情自拍偷拍| 亚洲国产aⅴ天堂久久| 久久成人免费日本黄色| 成人国产精品免费网站| 欧美专区亚洲专区| 中文字幕的久久| 视频在线在亚洲| 91免费看片在线观看| 欧美一级电影网站| 综合电影一区二区三区 | 91理论电影在线观看| 91精品蜜臀在线一区尤物| 国产亚洲综合色| 午夜精品视频一区| 91影院在线免费观看| 精品福利一区二区三区免费视频| 亚洲欧美视频一区| 国产经典欧美精品| 精品国产乱码久久久久久蜜臀| 亚洲免费观看高清完整版在线观看| 韩国欧美国产1区| 欧美一区二区三区四区高清| 亚洲视频一二三| 成人毛片在线观看| 国产农村妇女毛片精品久久麻豆 | 欧美xingq一区二区| 亚洲自拍偷拍综合| 99精品视频在线免费观看| 久久久精品国产免费观看同学| 亚洲第一av色| 欧美日韩中文另类| 一区二区三区中文字幕在线观看| 国产乱一区二区| 国产亚洲精品bt天堂精选| 久久国产福利国产秒拍| 91精品国产品国语在线不卡| 亚洲成av人**亚洲成av**| 欧美在线不卡视频| 一区二区三区精品在线观看| 93久久精品日日躁夜夜躁欧美| 国产精品每日更新| 99久久精品久久久久久清纯| 最好看的中文字幕久久| 99久久99久久精品免费看蜜桃 | 欧美精品久久99久久在免费线 | 久久av资源站| 91精品国产一区二区三区| 午夜电影一区二区| 欧美性受xxxx黑人xyx性爽| 一区二区三区自拍| 欧美午夜电影在线播放| 亚洲成人精品影院| 欧美肥妇bbw| 国产精品69毛片高清亚洲| 久久这里只有精品6| 裸体一区二区三区| 欧美精品一区在线观看| 国产精品一区免费视频| 欧美日韩国产一区| 国产欧美一区二区精品婷婷| 99久久精品99国产精品| 亚洲人成亚洲人成在线观看图片| 色伊人久久综合中文字幕| 亚洲精品网站在线观看| 欧美在线一区二区三区| 日韩成人av影视| 欧美电视剧在线看免费| 国产精品18久久久久久vr| ㊣最新国产の精品bt伙计久久| 日本精品一区二区三区高清 | 亚洲成人av福利| av在线一区二区| 中文字幕亚洲区| 91精品福利视频| 老司机精品视频导航| 久久久www成人免费毛片麻豆| 色综合天天综合狠狠| 婷婷激情综合网| 中文字幕精品—区二区四季| 欧美日韩国产欧美日美国产精品| 蜜桃久久久久久| 综合av第一页| 久久夜色精品一区| 91麻豆免费看| 国产一区二区中文字幕| 亚洲国产综合色| 亚洲国产精品v| 日韩精品一区二区三区中文精品| 懂色av一区二区三区免费看| 日韩福利电影在线| 亚洲精品中文在线观看| 国产无一区二区| 日韩精品中文字幕一区 | 亚洲国产精品自拍| 国产精品国产a| 亚洲精品一区二区三区蜜桃下载| 欧美性videosxxxxx| 成人一区二区三区在线观看| 开心九九激情九九欧美日韩精美视频电影 | 91玉足脚交白嫩脚丫在线播放| 久久99精品久久久久久动态图| 一区二区三区四区激情| 亚洲国产精品成人综合色在线婷婷| 日韩一级片网站| 欧美日韩激情在线| 欧美四级电影网| 91国产福利在线| 一本色道**综合亚洲精品蜜桃冫| 粉嫩欧美一区二区三区高清影视 | 日韩欧美三级在线| 欧美精选在线播放| 欧美日韩中文另类| 欧美午夜一区二区三区| 在线免费观看成人短视频| 91看片淫黄大片一级在线观看| 成人精品视频网站| 成人精品一区二区三区四区| 国产伦精品一区二区三区免费迷 | 欧美日韩国产123区| 欧美亚洲国产一区二区三区va| 亚洲第一主播视频| 国产亚洲一区二区三区四区| 中文字幕精品综合| 亚洲国产综合91精品麻豆| 亚洲欧美日韩电影| 尤物视频一区二区| 亚洲愉拍自拍另类高清精品| 亚洲午夜免费视频| 午夜欧美一区二区三区在线播放| 亚洲三级免费观看| 亚洲福利视频导航| 亚洲女子a中天字幕| 久久久久久久久蜜桃| 国产精品久久久久毛片软件| 偷拍一区二区三区| 国产精品国产三级国产普通话蜜臀 | 亚洲日本va午夜在线影院| 国产精品一区2区| 国产精品一区二区久久不卡| 国产成人在线观看免费网站| 成人免费观看av| 日本国产一区二区| 欧美精品三级在线观看| 2021久久国产精品不只是精品| 国产日韩精品一区二区三区在线| 国产精品久久久久久久裸模 | 欧美性做爰猛烈叫床潮| 6080yy午夜一二三区久久| 久久综合久久综合久久综合| 亚洲欧洲日产国码二区| 亚洲国产视频直播| 狠狠狠色丁香婷婷综合久久五月| 成人黄色国产精品网站大全在线免费观看| 91在线高清观看| 日韩精品一区二区三区swag| 国产精品美女久久久久久久久久久 | 久久影院午夜论| 成人免费小视频| 精品一区二区三区久久久| 91丨九色丨黑人外教| 日韩欧美国产1| 综合在线观看色| 精品亚洲成a人在线观看| 91一区二区在线观看| 精品盗摄一区二区三区| 亚洲另类在线视频| 国产精品一区二区在线看| 在线播放91灌醉迷j高跟美女 | 欧美视频一区二区在线观看| 欧美精品一区二区三区蜜桃视频 |