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

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

?? macroblock.c

?? 絕對好的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/***************************************************************************** * macroblock.c: h264 encoder library ***************************************************************************** * Copyright (C) 2003 Laurent Aimar * $Id: macroblock.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 const int dequant_mf[6][4][4] ={    { {10, 13, 10, 13}, {13, 16, 13, 16}, {10, 13, 10, 13}, {13, 16, 13, 16} },    { {11, 14, 11, 14}, {14, 18, 14, 18}, {11, 14, 11, 14}, {14, 18, 14, 18} },    { {13, 16, 13, 16}, {16, 20, 16, 20}, {13, 16, 13, 16}, {16, 20, 16, 20} },    { {14, 18, 14, 18}, {18, 23, 18, 23}, {14, 18, 14, 18}, {18, 23, 18, 23} },    { {16, 20, 16, 20}, {20, 25, 20, 25}, {16, 20, 16, 20}, {20, 25, 20, 25} },    { {18, 23, 18, 23}, {23, 29, 23, 29}, {18, 23, 18, 23}, {23, 29, 23, 29} }};int x264_mb_predict_intra4x4_mode( x264_t *h, int idx ){    const int ma = h->mb.cache.intra4x4_pred_mode[x264_scan8[idx] - 1];    const int mb = h->mb.cache.intra4x4_pred_mode[x264_scan8[idx] - 8];    const int m  = X264_MIN( x264_mb_pred_mode4x4_fix(ma),                             x264_mb_pred_mode4x4_fix(mb) );    if( m < 0 )        return I_PRED_4x4_DC;    return m;}int x264_mb_predict_non_zero_code( x264_t *h, int idx ){    const int za = h->mb.cache.non_zero_count[x264_scan8[idx] - 1];    const int zb = h->mb.cache.non_zero_count[x264_scan8[idx] - 8];    int i_ret = za + zb;    if( i_ret < 0x80 )    {        i_ret = ( i_ret + 1 ) >> 1;    }    return i_ret & 0x7f;}int x264_mb_transform_8x8_allowed( x264_t *h ){    if( IS_SKIP( h->mb.i_type ) )        return 0;    if( h->mb.i_type == P_8x8 || h->mb.i_type == B_8x8 )    {        int i;        for( i = 0; i < 4; i++ )            if( !IS_SUB8x8(h->mb.i_sub_partition[i])                || ( h->mb.i_sub_partition[i] == D_DIRECT_8x8 && !h->sps->b_direct8x8_inference ) )            {                return 0;            }    }    if( h->mb.i_type == B_DIRECT && !h->sps->b_direct8x8_inference )        return 0;    return 1;}void x264_mb_predict_mv( x264_t *h, int i_list, int idx, int i_width, int mvp[2] ){    const int i8 = x264_scan8[idx];    const int i_ref= h->mb.cache.ref[i_list][i8];    int     i_refa = h->mb.cache.ref[i_list][i8 - 1];    int16_t *mv_a  = h->mb.cache.mv[i_list][i8 - 1];    int     i_refb = h->mb.cache.ref[i_list][i8 - 8];    int16_t *mv_b  = h->mb.cache.mv[i_list][i8 - 8];    int     i_refc = h->mb.cache.ref[i_list][i8 - 8 + i_width ];    int16_t *mv_c  = h->mb.cache.mv[i_list][i8 - 8 + i_width];    int i_count;    if( (idx&0x03) == 3 || ( i_width == 2 && (idx&0x3) == 2 )|| i_refc == -2 )    {        i_refc = h->mb.cache.ref[i_list][i8 - 8 - 1];        mv_c   = h->mb.cache.mv[i_list][i8 - 8 - 1];    }    if( h->mb.i_partition == D_16x8 )    {        if( idx == 0 && i_refb == i_ref )        {            mvp[0] = mv_b[0];            mvp[1] = mv_b[1];            return;        }        else if( idx != 0 && i_refa == i_ref )        {            mvp[0] = mv_a[0];            mvp[1] = mv_a[1];            return;        }    }    else if( h->mb.i_partition == D_8x16 )    {        if( idx == 0 && i_refa == i_ref )        {            mvp[0] = mv_a[0];            mvp[1] = mv_a[1];            return;        }        else if( idx != 0 && i_refc == i_ref )        {            mvp[0] = mv_c[0];            mvp[1] = mv_c[1];            return;        }    }    i_count = 0;    if( i_refa == i_ref ) i_count++;    if( i_refb == i_ref ) i_count++;    if( i_refc == i_ref ) i_count++;    if( i_count > 1 )    {        mvp[0] = x264_median( mv_a[0], mv_b[0], mv_c[0] );        mvp[1] = x264_median( mv_a[1], mv_b[1], mv_c[1] );    }    else if( i_count == 1 )    {        if( i_refa == i_ref )        {            mvp[0] = mv_a[0];            mvp[1] = mv_a[1];        }        else if( i_refb == i_ref )        {            mvp[0] = mv_b[0];            mvp[1] = mv_b[1];        }        else        {            mvp[0] = mv_c[0];            mvp[1] = mv_c[1];        }    }    else if( i_refb == -2 && i_refc == -2 && i_refa != -2 )    {        mvp[0] = mv_a[0];        mvp[1] = mv_a[1];    }    else    {        mvp[0] = x264_median( mv_a[0], mv_b[0], mv_c[0] );        mvp[1] = x264_median( mv_a[1], mv_b[1], mv_c[1] );    }}void x264_mb_predict_mv_16x16( x264_t *h, int i_list, int i_ref, int mvp[2] ){    int     i_refa = h->mb.cache.ref[i_list][X264_SCAN8_0 - 1];    int16_t *mv_a  = h->mb.cache.mv[i_list][X264_SCAN8_0 - 1];    int     i_refb = h->mb.cache.ref[i_list][X264_SCAN8_0 - 8];    int16_t *mv_b  = h->mb.cache.mv[i_list][X264_SCAN8_0 - 8];    int     i_refc = h->mb.cache.ref[i_list][X264_SCAN8_0 - 8 + 4];    int16_t *mv_c  = h->mb.cache.mv[i_list][X264_SCAN8_0 - 8 + 4];    int i_count;    if( i_refc == -2 )    {        i_refc = h->mb.cache.ref[i_list][X264_SCAN8_0 - 8 - 1];        mv_c   = h->mb.cache.mv[i_list][X264_SCAN8_0 - 8 - 1];    }    i_count = 0;    if( i_refa == i_ref ) i_count++;    if( i_refb == i_ref ) i_count++;    if( i_refc == i_ref ) i_count++;    if( i_count > 1 )    {        mvp[0] = x264_median( mv_a[0], mv_b[0], mv_c[0] );        mvp[1] = x264_median( mv_a[1], mv_b[1], mv_c[1] );    }    else if( i_count == 1 )    {        if( i_refa == i_ref )        {            mvp[0] = mv_a[0];            mvp[1] = mv_a[1];        }        else if( i_refb == i_ref )        {            mvp[0] = mv_b[0];            mvp[1] = mv_b[1];        }        else        {            mvp[0] = mv_c[0];            mvp[1] = mv_c[1];        }    }    else if( i_refb == -2 && i_refc == -2 && i_refa != -2 )    {        mvp[0] = mv_a[0];        mvp[1] = mv_a[1];    }    else    {        mvp[0] = x264_median( mv_a[0], mv_b[0], mv_c[0] );        mvp[1] = x264_median( mv_a[1], mv_b[1], mv_c[1] );    }}void x264_mb_predict_mv_pskip( x264_t *h, int mv[2] ){    int     i_refa = h->mb.cache.ref[0][X264_SCAN8_0 - 1];    int     i_refb = h->mb.cache.ref[0][X264_SCAN8_0 - 8];    int16_t *mv_a  = h->mb.cache.mv[0][X264_SCAN8_0 - 1];    int16_t *mv_b  = h->mb.cache.mv[0][X264_SCAN8_0 - 8];    if( i_refa == -2 || i_refb == -2 ||        ( i_refa == 0 && mv_a[0] == 0 && mv_a[1] == 0 ) ||        ( i_refb == 0 && mv_b[0] == 0 && mv_b[1] == 0 ) )    {        mv[0] = mv[1] = 0;    }    else    {        x264_mb_predict_mv_16x16( h, 0, 0, mv );    }}static int x264_mb_predict_mv_direct16x16_temporal( x264_t *h ){    int i_mb_4x4 = 16 * h->mb.i_mb_stride * h->mb.i_mb_y + 4 * h->mb.i_mb_x;    int i_mb_8x8 =  4 * h->mb.i_mb_stride * h->mb.i_mb_y + 2 * h->mb.i_mb_x;    int i8, i4;    int b8x8;    const int type_col = h->fref1[0]->mb_type[ h->mb.i_mb_xy ];        x264_macroblock_cache_ref( h, 0, 0, 4, 4, 1, 0 );        if( IS_INTRA( type_col ) )    {        x264_macroblock_cache_ref( h, 0, 0, 4, 4, 0, 0 );        x264_macroblock_cache_mv(  h, 0, 0, 4, 4, 0, 0, 0 );        x264_macroblock_cache_mv(  h, 0, 0, 4, 4, 1, 0, 0 );        return 1;    }    b8x8 = h->sps->b_direct8x8_inference ||           (type_col != P_8x8 && type_col != B_SKIP && type_col != B_DIRECT && type_col != B_8x8);    for( i8 = 0; i8 < 4; i8++ )    {        const int x8 = i8%2;        const int y8 = i8/2;        const int i_part_8x8 = i_mb_8x8 + x8 + y8 * h->mb.i_b8_stride;        const int i_ref = h->mb.map_col_to_list0[ h->fref1[0]->ref[0][ i_part_8x8 ] ];        if( i_ref >= 0 )        {            const int dist_scale_factor = h->mb.dist_scale_factor[i_ref][0];            x264_macroblock_cache_ref( h, 2*x8, 2*y8, 2, 2, 0, i_ref );            if( b8x8 )            {                const int16_t *mv_col = h->fref1[0]->mv[0][ i_mb_4x4 + 3*x8 + 3*y8 * h->mb.i_b4_stride];                int mv_l0[2];                mv_l0[0] = ( dist_scale_factor * mv_col[0] + 128 ) >> 8;                mv_l0[1] = ( dist_scale_factor * mv_col[1] + 128 ) >> 8;                x264_macroblock_cache_mv( h, 2*x8, 2*y8, 2, 2, 0, mv_l0[0], mv_l0[1] );                x264_macroblock_cache_mv( h, 2*x8, 2*y8, 2, 2, 1, mv_l0[0] - mv_col[0], mv_l0[1] - mv_col[1] );            }            else            {                for( i4 = 0; i4 < 4; i4++ )                {                    const int x4 = i4%2 + 2*x8;                    const int y4 = i4/2 + 2*y8;                    const int16_t *mv_col = h->fref1[0]->mv[0][ i_mb_4x4 + x4 + y4 * h->mb.i_b4_stride ];                    int mv_l0[2];                    mv_l0[0] = ( dist_scale_factor * mv_col[0] + 128 ) >> 8;                    mv_l0[1] = ( dist_scale_factor * mv_col[1] + 128 ) >> 8;                    x264_macroblock_cache_mv( h, x4, y4, 1, 1, 0, mv_l0[0], mv_l0[1] );                    x264_macroblock_cache_mv( h, x4, y4, 1, 1, 1, mv_l0[0] - mv_col[0], mv_l0[1] - mv_col[1] );                }            }        }        else        {            /* the colocated ref isn't in the current list0 */            /* FIXME: we might still be able to use direct_8x8 on some partitions */            /* FIXME: with B-pyramid + extensive ref list reordering             *   (not currently used), we would also have to check             *   l1mv1 like in spatial mode */            return 0;        }    }    return 1;}static int x264_mb_predict_mv_direct16x16_spatial( x264_t *h ){    int ref[2];    int mv[2][2];    int i_list;    int i8, i4;    int b8x8;    const int8_t *l1ref0 = &h->fref1[0]->ref[0][ h->mb.i_b8_xy ];    const int8_t *l1ref1 = &h->fref1[0]->ref[1][ h->mb.i_b8_xy ];    const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->fref1[0]->mv[0][ h->mb.i_b4_xy ];    const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->fref1[0]->mv[1][ h->mb.i_b4_xy ];    const int type_col = h->fref1[0]->mb_type[ h->mb.i_mb_xy ];    for( i_list=0; i_list<2; i_list++ )    {        int i_refa = h->mb.cache.ref[i_list][X264_SCAN8_0 - 1];        int i_refb = h->mb.cache.ref[i_list][X264_SCAN8_0 - 8];        int i_refc = h->mb.cache.ref[i_list][X264_SCAN8_0 - 8 + 4];        if( i_refc == -2 )            i_refc = h->mb.cache.ref[i_list][X264_SCAN8_0 - 8 - 1];        ref[i_list] = i_refa;        if( ref[i_list] < 0 || ( i_refb < ref[i_list] && i_refb >= 0 ))            ref[i_list] = i_refb;        if( ref[i_list] < 0 || ( i_refc < ref[i_list] && i_refc >= 0 ))            ref[i_list] = i_refc;        if( ref[i_list] < 0 )            ref[i_list] = -1;    }    if( ref[0] < 0 && ref[1] < 0 )    {        ref[0] =         ref[1] = 0;        mv[0][0] =         mv[0][1] =         mv[1][0] =         mv[1][1] = 0;    }    else    {        for( i_list=0; i_list<2; i_list++ )        {            if( ref[i_list] >= 0 )                x264_mb_predict_mv_16x16( h, i_list, ref[i_list], mv[i_list] );            else                mv[i_list][0] = mv[i_list][1] = 0;        }    }    x264_macroblock_cache_ref( h, 0, 0, 4, 4, 0, ref[0] );    x264_macroblock_cache_ref( h, 0, 0, 4, 4, 1, ref[1] );    x264_macroblock_cache_mv(  h, 0, 0, 4, 4, 0, mv[0][0], mv[0][1] );    x264_macroblock_cache_mv(  h, 0, 0, 4, 4, 1, mv[1][0], mv[1][1] );    if( IS_INTRA( type_col ) )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产三级国产普通话99| 精品国产凹凸成av人导航| 国产在线视视频有精品| 日精品一区二区三区| 亚洲地区一二三色| 亚洲成a人v欧美综合天堂下载 | 老司机一区二区| 丝袜脚交一区二区| 免费在线观看不卡| 国产一区二区成人久久免费影院| 精品午夜一区二区三区在线观看| 黄色日韩三级电影| 成人美女视频在线观看| 91影视在线播放| 欧美日韩一区二区不卡| 日韩午夜精品视频| 国产亚洲综合在线| 亚洲精品网站在线观看| 日韩一区精品视频| 国产盗摄一区二区| 在线观看日韩电影| 精品噜噜噜噜久久久久久久久试看| 日韩久久久精品| 国产精品国产三级国产普通话三级| 亚洲柠檬福利资源导航| 日韩成人精品视频| 国产激情一区二区三区四区| 一本到高清视频免费精品| 91麻豆精品国产91久久久久久| 精品久久久久久久久久久久久久久久久 | 欧美性生活影院| 欧美成人a在线| 中文字幕一区日韩精品欧美| 亚洲一区二区三区四区在线观看 | 爽爽淫人综合网网站| 国产麻豆精品95视频| 91美女视频网站| 日韩欧美激情一区| 中文字幕欧美一区| 美女国产一区二区三区| 99re在线精品| 精品久久久久久最新网址| 国产精品国产三级国产三级人妇| 亚洲国产视频网站| jvid福利写真一区二区三区| 欧美一区欧美二区| 亚洲人成影院在线观看| 国产一区二区三区久久久| 91老师国产黑色丝袜在线| www国产成人免费观看视频 深夜成人网| 亚洲欧洲日韩在线| 国产综合色精品一区二区三区| 欧美色综合影院| 中文字幕中文字幕中文字幕亚洲无线| 丝袜亚洲另类丝袜在线| 色视频一区二区| 最好看的中文字幕久久| 国产一区二区三区在线观看精品| 欧美日韩你懂的| 一区二区三区精品在线观看| 国产91对白在线观看九色| 欧美大片顶级少妇| 日韩国产一二三区| 欧美日韩一区二区三区四区 | 国产片一区二区| 精品午夜一区二区三区在线观看| 欧美视频自拍偷拍| 亚洲一区二区三区影院| 色婷婷亚洲一区二区三区| 国产精品久久看| 成人国产在线观看| 国产精品三级av| 成人性生交大片免费看中文| 国产亚洲1区2区3区| 国产剧情一区在线| 久久久久久久av麻豆果冻| 韩国精品主播一区二区在线观看| 日韩视频免费直播| 免费观看一级特黄欧美大片| 欧美一区二区三区色| 美日韩一区二区三区| 欧美tickling挠脚心丨vk| 蜜桃精品在线观看| 久久亚洲精精品中文字幕早川悠里| 国产中文一区二区三区| 国产亲近乱来精品视频| av在线一区二区| 亚洲综合在线第一页| 欧美日韩精品免费| 久久99国产乱子伦精品免费| 久久久精品国产免大香伊| 大胆亚洲人体视频| 一区二区三区精品视频在线| 欧美三级视频在线播放| 人人狠狠综合久久亚洲| 国产视频一区不卡| 在线日韩一区二区| 麻豆久久一区二区| 国产精品人人做人人爽人人添| 色婷婷一区二区三区四区| 日韩精品电影在线观看| 久久精品亚洲麻豆av一区二区| 播五月开心婷婷综合| 天天色综合天天| 久久夜色精品一区| 91福利视频久久久久| 久久精品噜噜噜成人88aⅴ| 国产精品家庭影院| 在线成人av影院| 国产成人丝袜美腿| 一区二区日韩av| 久久久另类综合| 在线精品视频一区二区| 精品一区二区成人精品| 亚洲精品五月天| 久久毛片高清国产| 精品视频全国免费看| 懂色av一区二区在线播放| 婷婷中文字幕综合| 中文字幕精品在线不卡| 日韩免费观看高清完整版| 在线免费亚洲电影| 成人激情视频网站| 麻豆一区二区在线| 亚洲成人免费在线| 亚洲人妖av一区二区| 久久久久久亚洲综合影院红桃| 欧亚一区二区三区| av综合在线播放| 国产裸体歌舞团一区二区| 视频一区二区三区在线| 亚洲欧美视频在线观看| 国产日韩v精品一区二区| 日韩精品一区二区三区swag| 欧美在线看片a免费观看| 99久久久久免费精品国产| 国产高清亚洲一区| 免费观看在线综合| 日韩高清在线一区| 婷婷开心激情综合| 亚洲www啪成人一区二区麻豆| 中文字幕综合网| 国产精品久久久久毛片软件| 精品少妇一区二区三区在线视频| 制服丝袜日韩国产| 欧美剧在线免费观看网站| 欧美色图在线观看| 欧美性一二三区| 欧美性欧美巨大黑白大战| 色婷婷亚洲婷婷| 欧美在线免费视屏| 欧美视频完全免费看| 欧美性大战久久| 欧美午夜寂寞影院| 在线电影一区二区三区| 欧美一区二区三区性视频| 欧美一卡二卡三卡四卡| 日韩三区在线观看| 精品国产免费视频| 日本一区二区成人在线| 国产精品对白交换视频| 亚洲裸体xxx| 亚洲第一会所有码转帖| 天堂蜜桃一区二区三区 | 丰满放荡岳乱妇91ww| 懂色av一区二区夜夜嗨| 99久久精品国产观看| 日本道免费精品一区二区三区| 欧洲av一区二区嗯嗯嗯啊| 欧美日韩大陆在线| 亚洲精品一区二区三区影院| 久久综合久久综合亚洲| 欧美国产一区二区在线观看| 国产精品色哟哟| 亚洲成av人片在线观看无码| 久久精品72免费观看| 懂色av一区二区三区免费看| 在线影视一区二区三区| 欧美大度的电影原声| 中文字幕欧美日韩一区| 亚洲高清不卡在线| 韩国av一区二区| 色婷婷综合久久久中文字幕| 日韩视频免费直播| 18涩涩午夜精品.www| 免费一级片91| 91在线观看地址| 精品欧美黑人一区二区三区| 亚洲视频免费看| 激情综合色播激情啊| 色哟哟国产精品| 欧美第一区第二区| 亚洲一二三区在线观看| 国产精品456| 精品视频免费看| 中文字幕在线一区免费| 捆绑调教一区二区三区| 在线视频欧美精品| 国产免费观看久久| 日本女人一区二区三区|