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

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

?? frame.c

?? 法國人的264代碼 大家看看啊,里面有很多可以借鑒的東西啊
?? C
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************** * frame.c: h264 encoder library ***************************************************************************** * Copyright (C) 2003 Laurent Aimar * $Id: frame.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 "include\common.h"x264_frame_t *x264_frame_new( x264_t *h ){    x264_frame_t *frame = x264_malloc( sizeof(x264_frame_t) );    int i, j;    int i_mb_count = h->mb.i_mb_count;    int i_stride;    int i_lines;    if( !frame ) return NULL;    memset( frame, 0, sizeof(x264_frame_t) );    /* allocate frame data (+64 for extra data for me) */    i_stride = ( ( h->param.i_width  + 15 )&0xfffff0 )+ 64;    i_lines  = ( ( h->param.i_height + 15 )&0xfffff0 );    frame->i_plane = 3;    for( i = 0; i < 3; i++ )    {        int i_divh = 1;        int i_divw = 1;        if( i > 0 )        {            if( h->param.i_csp == X264_CSP_I420 )                i_divh = i_divw = 2;            else if( h->param.i_csp == X264_CSP_I422 )                i_divw = 2;        }        frame->i_stride[i] = i_stride / i_divw;        frame->i_lines[i] = i_lines / i_divh;        CHECKED_MALLOC( frame->buffer[i],                        frame->i_stride[i] * ( frame->i_lines[i] + 64 / i_divh ) );        frame->plane[i] = ((uint8_t*)frame->buffer[i]) +                          frame->i_stride[i] * 32 / i_divh + 32 / i_divw;    }    frame->i_stride[3] = 0;    frame->i_lines[3] = 0;    frame->buffer[3] = NULL;    frame->plane[3] = NULL;    frame->filtered[0] = frame->plane[0];    for( i = 0; i < 3; i++ )    {        CHECKED_MALLOC( frame->buffer[4+i],                        frame->i_stride[0] * ( frame->i_lines[0] + 64 ) );        frame->filtered[i+1] = ((uint8_t*)frame->buffer[4+i]) +                                frame->i_stride[0] * 32 + 32;    }    if( h->frames.b_have_lowres )    {        frame->i_stride_lowres = frame->i_stride[0]/2 + 32;        frame->i_lines_lowres = frame->i_lines[0]/2;        for( i = 0; i < 4; i++ )        {            CHECKED_MALLOC( frame->buffer[7+i],                            frame->i_stride_lowres * ( frame->i_lines[0]/2 + 64 ) );            frame->lowres[i] = ((uint8_t*)frame->buffer[7+i]) +                                frame->i_stride_lowres * 32 + 32;        }    }    if( h->param.analyse.i_me_method == X264_ME_ESA )    {        CHECKED_MALLOC( frame->buffer[11],                        frame->i_stride[0] * (frame->i_lines[0] + 64) * sizeof(uint16_t) );        frame->integral = (uint16_t*)frame->buffer[11] + frame->i_stride[0] * 32 + 32;    }    frame->i_poc = -1;    frame->i_type = X264_TYPE_AUTO;    frame->i_qpplus1 = 0;    frame->i_pts = -1;    frame->i_frame = -1;    frame->i_frame_num = -1;    CHECKED_MALLOC( frame->mb_type, i_mb_count * sizeof(int8_t));    CHECKED_MALLOC( frame->mv[0], 2*16 * i_mb_count * sizeof(int16_t) );    CHECKED_MALLOC( frame->ref[0], 4 * i_mb_count * sizeof(int8_t) );    if( h->param.i_bframe )    {        CHECKED_MALLOC( frame->mv[1], 2*16 * i_mb_count * sizeof(int16_t) );        CHECKED_MALLOC( frame->ref[1], 4 * i_mb_count * sizeof(int8_t) );    }    else    {        frame->mv[1]  = NULL;        frame->ref[1] = NULL;    }    CHECKED_MALLOC( frame->i_row_bits, i_lines/16 * sizeof(int) );    CHECKED_MALLOC( frame->i_row_qp, i_lines/16 * sizeof(int) );    for( i = 0; i < h->param.i_bframe + 2; i++ )        for( j = 0; j < h->param.i_bframe + 2; j++ )            CHECKED_MALLOC( frame->i_row_satds[i][j], i_lines/16 * sizeof(int) );    return frame;fail:    x264_frame_delete( frame );    return NULL;}void x264_frame_delete( x264_frame_t *frame ){    int i, j;    for( i = 0; i < 12; i++ )        x264_free( frame->buffer[i] );    for( i = 0; i < X264_BFRAME_MAX+2; i++ )        for( j = 0; j < X264_BFRAME_MAX+2; j++ )            x264_free( frame->i_row_satds[i][j] );    x264_free( frame->i_row_bits );    x264_free( frame->i_row_qp );    x264_free( frame->mb_type );    x264_free( frame->mv[0] );    x264_free( frame->mv[1] );    x264_free( frame->ref[0] );    x264_free( frame->ref[1] );    x264_free( frame );}void x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_picture_t *src ){    dst->i_type     = src->i_type;    dst->i_qpplus1  = src->i_qpplus1;    dst->i_pts      = src->i_pts;    switch( src->img.i_csp & X264_CSP_MASK )    {        case X264_CSP_I420:            h->csp.i420( dst, &src->img, h->param.i_width, h->param.i_height );            break;        case X264_CSP_YV12:            h->csp.yv12( dst, &src->img, h->param.i_width, h->param.i_height );            break;        case X264_CSP_I422:            h->csp.i422( dst, &src->img, h->param.i_width, h->param.i_height );            break;        case X264_CSP_I444:            h->csp.i444( dst, &src->img, h->param.i_width, h->param.i_height );            break;        case X264_CSP_YUYV:            h->csp.yuyv( dst, &src->img, h->param.i_width, h->param.i_height );            break;        case X264_CSP_RGB:            h->csp.rgb( dst, &src->img, h->param.i_width, h->param.i_height );            break;        case X264_CSP_BGR:            h->csp.bgr( dst, &src->img, h->param.i_width, h->param.i_height );            break;        case X264_CSP_BGRA:            h->csp.bgra( dst, &src->img, h->param.i_width, h->param.i_height );            break;        default:            x264_log( h, X264_LOG_ERROR, "Arg invalid CSP\n" );            break;    }}static void plane_expand_border( uint8_t *pix, int i_stride, int i_height, int i_pad ){#define PPIXEL(x, y) ( pix + (x) + (y)*i_stride )    const int i_width = i_stride - 2*i_pad;    int y;    for( y = 0; y < i_height; y++ )    {        /* left band */        memset( PPIXEL(-i_pad, y), PPIXEL(0, y)[0], i_pad );        /* right band */        memset( PPIXEL(i_width, y), PPIXEL(i_width-1, y)[0], i_pad );    }    /* upper band */    for( y = 0; y < i_pad; y++ )        memcpy( PPIXEL(-i_pad, -y-1), PPIXEL(-i_pad, 0), i_stride );    /* lower band */    for( y = 0; y < i_pad; y++ )        memcpy( PPIXEL(-i_pad, i_height+y), PPIXEL(-i_pad, i_height-1), i_stride );#undef PPIXEL}void x264_frame_expand_border( x264_frame_t *frame ){    int i;    for( i = 0; i < frame->i_plane; i++ )    {        int i_pad = i ? 16 : 32;        plane_expand_border( frame->plane[i], frame->i_stride[i], frame->i_lines[i], i_pad );    }}void x264_frame_expand_border_filtered( x264_frame_t *frame ){    /* during filtering, 8 extra pixels were filtered on each edge.        we want to expand border from the last filtered pixel */    int i;    for( i = 1; i < 4; i++ )        plane_expand_border( frame->filtered[i] - 8*frame->i_stride[0] - 8, frame->i_stride[0], frame->i_lines[0]+2*8, 24 );}void x264_frame_expand_border_lowres( x264_frame_t *frame ){    int i;    for( i = 0; i < 4; i++ )        plane_expand_border( frame->lowres[i], frame->i_stride_lowres, frame->i_lines_lowres, 32 );}void x264_frame_expand_border_mod16( x264_t *h, x264_frame_t *frame ){    int i, y;    for( i = 0; i < frame->i_plane; i++ )    {        int i_subsample = i ? 1 : 0;        int i_width = h->param.i_width >> i_subsample;        int i_height = h->param.i_height >> i_subsample;        int i_padx = ( h->sps->i_mb_width * 16 - h->param.i_width ) >> i_subsample;        int i_pady = ( h->sps->i_mb_height * 16 - h->param.i_height ) >> i_subsample;        if( i_padx )        {            for( y = 0; y < i_height; y++ )                memset( &frame->plane[i][y*frame->i_stride[i] + i_width],                         frame->plane[i][y*frame->i_stride[i] + i_width - 1],                         i_padx );        }        if( i_pady )        {            for( y = i_height; y < i_height + i_pady; y++ )                memcpy( &frame->plane[i][y*frame->i_stride[i]],                        &frame->plane[i][(i_height-1)*frame->i_stride[i]],                        i_width + i_padx );        }    }}/* Deblocking filter */static const int i_alpha_table[52] ={     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,     0,  0,  0,  0,  0,  0,  4,  4,  5,  6,     7,  8,  9, 10, 12, 13, 15, 17, 20, 22,    25, 28, 32, 36, 40, 45, 50, 56, 63, 71,    80, 90,101,113,127,144,162,182,203,226,    255, 255};static const int i_beta_table[52] ={     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,     0,  0,  0,  0,  0,  0,  2,  2,  2,  3,     3,  3,  3,  4,  4,  4,  6,  6,  7,  7,     8,  8,  9,  9, 10, 10, 11, 11, 12, 12,    13, 13, 14, 14, 15, 15, 16, 16, 17, 17,    18, 18};static const int i_tc0_table[52][3] ={    { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },    { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 },    { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 },    { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 1, 1 }, { 0, 1, 1 }, { 1, 1, 1 },    { 1, 1, 1 }, { 1, 1, 1 }, { 1, 1, 1 }, { 1, 1, 2 }, { 1, 1, 2 }, { 1, 1, 2 },    { 1, 1, 2 }, { 1, 2, 3 }, { 1, 2, 3 }, { 2, 2, 3 }, { 2, 2, 4 }, { 2, 3, 4 },    { 2, 3, 4 }, { 3, 3, 5 }, { 3, 4, 6 }, { 3, 4, 6 }, { 4, 5, 7 }, { 4, 5, 8 },    { 4, 6, 9 }, { 5, 7,10 }, { 6, 8,11 }, { 6, 8,13 }, { 7,10,14 }, { 8,11,16 },    { 9,12,18 }, {10,13,20 }, {11,15,23 }, {13,17,25 }};/* From ffmpeg */static inline int clip_uint8( int a ){    if (a&(~255))        return (-a)>>31;    else        return a;}static inline void deblock_luma_c( uint8_t *pix, int xstride, int ystride, int alpha, int beta, int8_t *tc0 ){    int i, d;    for( i = 0; i < 4; i++ ) {        if( tc0[i] < 0 ) {            pix += 4*ystride;            continue;        }        for( d = 0; d < 4; d++ ) {            const int p2 = pix[-3*xstride];            const int p1 = pix[-2*xstride];            const int p0 = pix[-1*xstride];            const int q0 = pix[ 0*xstride];            const int q1 = pix[ 1*xstride];            const int q2 = pix[ 2*xstride];               if( abs( p0 - q0 ) < alpha &&                abs( p1 - p0 ) < beta &&                abs( q1 - q0 ) < beta ) {                   int tc = tc0[i];                int delta;                   if( abs( p2 - p0 ) < beta ) {                    pix[-2*xstride] = p1 + x264_clip3( (( p2 + ((p0 + q0 + 1) >> 1)) >> 1) - p1, -tc0[i], tc0[i] );                    tc++;                 }                if( abs( q2 - q0 ) < beta ) {                    pix[ 1*xstride] = q1 + x264_clip3( (( q2 + ((p0 + q0 + 1) >> 1)) >> 1) - q1, -tc0[i], tc0[i] );                    tc++;                }                    delta = x264_clip3( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );                pix[-1*xstride] = clip_uint8( p0 + delta );    /* p0' */                pix[ 0*xstride] = clip_uint8( q0 - delta );    /* q0' */            }            pix += ystride;        }    }}static void deblock_v_luma_c( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ){    deblock_luma_c( pix, stride, 1, alpha, beta, tc0 ); }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产激情一区二区三区| 99精品久久99久久久久| 韩国视频一区二区| 欧美美女激情18p| 亚洲色图.com| 国产成人av在线影院| 亚洲精品一区二区在线观看| 石原莉奈一区二区三区在线观看| 91黄色在线观看| 亚洲欧洲av另类| 成人动漫一区二区在线| 国产精品福利影院| www.一区二区| 亚洲日本电影在线| 色婷婷国产精品| 亚洲小说欧美激情另类| 91免费看片在线观看| 国产精品久久久久aaaa樱花 | 欧美精品一卡两卡| 亚洲尤物在线视频观看| 欧美亚洲国产一区在线观看网站 | 亚洲国产精品成人久久综合一区 | 麻豆国产欧美一区二区三区| 欧美做爰猛烈大尺度电影无法无天| 亚洲天堂福利av| 欧美图片一区二区三区| 五月天中文字幕一区二区| 欧美一区二区三区在线| 蜜桃久久av一区| 国产亚洲人成网站| 91天堂素人约啪| 亚洲色图在线视频| 欧美美女视频在线观看| 久久成人免费网| 国产精品伦理一区二区| 在线免费观看不卡av| 香蕉久久夜色精品国产使用方法 | 精品国产一区二区三区不卡| 狠狠色丁香久久婷婷综合丁香| 久久久精品国产免大香伊| 丁香婷婷综合色啪| 亚洲精品日日夜夜| 日韩一区二区麻豆国产| 国产一区二三区好的| 亚洲视频图片小说| 欧美高清一级片在线| 久久国产视频网| 国产精品国产三级国产有无不卡 | 一区二区三区欧美| 日韩欧美一区在线| 成人动漫视频在线| 日韩—二三区免费观看av| 久久精品一区四区| 欧美三级在线播放| 国产激情偷乱视频一区二区三区| 一区二区三区四区在线播放| 日韩欧美三级在线| 91在线视频免费观看| 日韩在线一二三区| 国产精品美日韩| 欧美一区二区三区白人| av网站一区二区三区| 午夜精品免费在线| 精品日韩一区二区三区 | 亚洲综合免费观看高清在线观看| 久久亚洲免费视频| 欧美喷潮久久久xxxxx| 99久久精品国产观看| 黑人巨大精品欧美一区| 亚洲第四色夜色| 中文字幕视频一区二区三区久| 欧美电影免费观看高清完整版在| 激情欧美日韩一区二区| 亚洲国产精品久久久久婷婷884| 中文字幕的久久| 久久综合中文字幕| 在线播放视频一区| 99精品1区2区| 国产精品91一区二区| 在线视频欧美精品| 成人av在线电影| 国产一区视频网站| 伦理电影国产精品| 三级欧美韩日大片在线看| 一区二区三区中文字幕电影| 久久在线观看免费| 日韩一区二区三区免费观看| 欧美综合欧美视频| 色综合天天综合网天天狠天天| 国产久卡久卡久卡久卡视频精品| 一区二区三区在线高清| 最新久久zyz资源站| 国产欧美精品一区| 久久精品视频免费| 欧美精品一区在线观看| 国产亚洲欧美日韩日本| 久久久亚洲精品石原莉奈| 欧美精品一区二区三区在线| 精品免费一区二区三区| 精品日韩在线一区| 2022国产精品视频| 国产亚洲成aⅴ人片在线观看| 精品对白一区国产伦| 欧美电视剧免费观看| 亚洲精品一区二区三区福利| 久久综合久久综合九色| 久久久久久久精| 国产精品视频免费看| 中文字幕在线观看一区| 亚洲制服丝袜一区| 精品国产百合女同互慰| 2020国产成人综合网| 国产精品久久久久久久久免费桃花| 亚洲欧美在线aaa| 婷婷中文字幕一区三区| 国产精品一区二区在线观看不卡| eeuss鲁片一区二区三区在线观看| 欧美色窝79yyyycom| 精品国产一区二区亚洲人成毛片| 国产精品高潮呻吟| 日韩电影在线观看网站| 成人激情免费网站| 国产精品色噜噜| 亚洲成人第一页| 国产综合色在线| 欧美视频一区二区三区四区 | 国产精品久久久久久户外露出 | 成人午夜又粗又硬又大| 欧美午夜寂寞影院| 国产欧美视频一区二区三区| 亚洲va在线va天堂| 成人免费精品视频| 欧美一区二区网站| 国产精品丝袜一区| 美美哒免费高清在线观看视频一区二区| 国产69精品久久99不卡| 欧美一区二区性放荡片| 亚洲精品日韩一| 丁香一区二区三区| 欧美大胆一级视频| 亚洲国产精品自拍| 99精品1区2区| 国产欧美精品在线观看| 久久99久久久久| 欧美日韩免费视频| 亚洲视频在线一区二区| 国产美女久久久久| 日韩免费观看高清完整版在线观看| 国产精品久久久久久久久果冻传媒| 久久不见久久见免费视频1| 欧美在线一区二区三区| 成人欧美一区二区三区白人| 国产麻豆精品在线| 日韩无一区二区| 日日夜夜一区二区| 欧美色涩在线第一页| 最近日韩中文字幕| 成人午夜av影视| 国产精品污污网站在线观看| 国产在线播放一区| 精品久久久久久亚洲综合网| 青青草国产成人99久久| 欧美日韩精品专区| 亚洲国产人成综合网站| 在线观看视频一区二区欧美日韩| 国产精品久久精品日日| 成人性生交大片免费看中文| 久久久精品蜜桃| 丁香婷婷深情五月亚洲| 国产蜜臀97一区二区三区| 国产麻豆欧美日韩一区| 欧美大片顶级少妇| 亚洲视频电影在线| 精品少妇一区二区三区视频免付费| 久草中文综合在线| 国产一区二区三区免费观看| 天堂影院一区二区| 日本一区二区三区国色天香 | av亚洲精华国产精华精华| 国产精品国产三级国产有无不卡 | 97精品久久久久中文字幕| 2020日本不卡一区二区视频| 精品夜夜嗨av一区二区三区| 日韩欧美国产1| 国产精选一区二区三区| 国产农村妇女毛片精品久久麻豆 | 91精品蜜臀在线一区尤物| 免费久久精品视频| 久久综合狠狠综合| 国产成人av一区二区三区在线 | 成人永久看片免费视频天堂| 欧美极品xxx| 色哟哟在线观看一区二区三区| 一区二区三区免费在线观看| 在线观看网站黄不卡| 青椒成人免费视频| 久久久国产综合精品女国产盗摄| jvid福利写真一区二区三区| 亚洲成人一区在线| 亚洲精品一区二区精华|